Skip to content

@lelantos-org/sdk / advanced / createWallet

Function: createWallet() ​

ts
function createWallet(source, cfg): Promise<WalletApi>;

Defined in: @lelantos-org/sdk/dist/wallet/create.d.ts:21

Build a wallet from any key source, wiring defaults for omitted pluggables. Collects every config problem into WalletConfigError.missing.

Use it when connect()'s options cannot express the wiring: a custom submitter (a bundler, a capturing test double), selector, noteSource, pre-built treeStore / nullifierStore, or a feeBps override, none of which connect() accepts.

The prover defaults to a lazy build over the bundled artifacts, so this does no artifact I/O.

Ownership: the wallet disposes only what it built. A Prover or Scanner passed in cfg is left running by wallet.dispose() and by a failed createWallet; the caller releases it. Stores, persistence backends, the chain adapter and the submitter are never closed by the SDK.

Parameters ​

ParameterType
sourceKeySource
cfgWalletConfig

Returns ​

Promise<WalletApi>