View-Only Wallets
Example: Generate shareable key and associated View-Only wallet
import {
getWalletShareableViewingKey,
createViewOnlyRailgunWallet,
} from '@railgun-community/wallet';
const encryptionKey = ...; // See `Encryption Keys` section
const railgunWalletID = ...; // Stored after RAILGUN wallet creation
const shareableViewingKey = await getWalletShareableViewingKey(railgunWalletID);
// Current block numbers for each chain when wallet was first created.
// If unknown, provide undefined.
const creationBlockNumberMap: Optional<MapType<number>> = undefined;
const viewOnlyWalletInfo = await createViewOnlyRailgunWallet(
encryptionKey,
shareableViewingKey,
creationBlockNumberMap,
);
const id = viewOnlyWalletInfo.id;Example: Load stored RAILGUN Wallet by its ID
Last updated