Skip to content

@lelantos-org/sdk / advanced / createWatchWallet

Function: createWatchWallet() ​

ts
function createWatchWallet(
   key, 
   cfg, 
   deps?
): Promise<ReadOnlyWalletApi>;

Defined in: @lelantos-org/sdk/dist/wallet/watch/watch-wallet.d.ts:15

Build a watch-only wallet from either viewing-key tier, or its bech32m encoding.

The tier is read from the key and reported by spentKnown and keys.tier.

dispose() releases only a scanner the SDK built (the default LocalScanner); a cfg.scanner passed in stays with the caller. Stores and the reader are never closed.

Parameters ​

ParameterTypeDescription
key| string | ViewingKey | FullViewingKey | ViewingKeyString-
cfgWatchWalletConfig-
deps?{ J?: Jubjub; P?: Poseidon; scannerOwned?: boolean; }-
deps.J?Jubjub-
deps.P?Poseidon-
deps.scannerOwned?booleanWhether the SDK built cfg.scanner. Default: only when cfg.scanner is absent.

Returns ​

Promise<ReadOnlyWalletApi>