Skip to content
docs

WalletManagerBtc

Defined in: wallet-btc/src/manager.ts:20

One seed → Bitcoin accounts. p2wpkh (default): BIP-84, m/84’/0’/0’/0/i on mainnet, m/84’/1’/0’/0/i on test networks — bc1q… / tb1q… p2tr: BIP-86, m/86’/0’/0’/0/i (key-path taproot) — bc1p… / tb1p… Paths may be relative to the purpose/coin prefix (“0’/0/i”) or given in full.

Built with a secp256k1 Signer instead of a seed, the manager wraps it:

  • a derivable SeedSigner sitting at the account branch (m/84'/0'/0'/0 or m/86'/0'/0'/0, per addressType/network) yields getAccount(i) children;
  • a SeedSigner at a leaf, or any external signer, is getAccount(0) (path = the signer’s path, or ‘external’) with the configured address type; other indexes/paths throw.

new WalletManagerBtc(seedOrSigner, config?): WalletManagerBtc

Defined in: wallet-btc/src/manager.ts:21

string | Uint8Array<ArrayBufferLike> | Signer

BtcConfig = {}

WalletManagerBtc

WalletManager<WalletAccountBtc, BtcConfig>.constructor

protected readonly _accounts: Map<string, WalletAccountBtc>

Defined in: core/dist/index.d.ts:271

WalletManager._accounts


protected readonly _config: BtcConfig

Defined in: core/dist/index.d.ts:270

WalletManager._config


protected readonly _signer: Signer | undefined

Defined in: core/dist/index.d.ts:269

WalletManager._signer

get basePath(): string

Defined in: wallet-btc/src/manager.ts:30

m/84'/0' for p2wpkh or m/86'/0' for p2tr on mainnet (coin type 1 on test networks); account i is at basePath/0'/0/i.

string

protected cachedAccount(key, create): Promise<WalletAccountBtc>

Defined in: core/dist/index.d.ts:295

The account cached under key, built by create at most once: concurrent calls share one build. Throws once the manager is disposed; an account whose build finishes after dispose() is disposed itself and the call throws, so no live signing account outlives the manager.

string

() => WalletAccountBtc | Promise<WalletAccountBtc>

Promise<WalletAccountBtc>

WalletManager.cachedAccount


dispose(): void

Defined in: core/dist/index.d.ts:302

Dispose every derived account and zeroize the seed; subclasses zeroize their own extras first, then call super.

void

WalletManager.dispose


protected externalSigner(): Signer | undefined

Defined in: core/dist/index.d.ts:281

The Signer this manager was built with, if any (no mnemonic then). Chain managers decide how to turn it into accounts.

Signer | undefined

WalletManager.externalSigner


getAccount(index?): Promise<WalletAccountBtc>

Defined in: wallet-btc/src/manager.ts:34

Account index on the chain’s standard path. Cached per index.

number = 0

Promise<WalletAccountBtc>

WalletManager.getAccount


getAccountByPath(path): Promise<WalletAccountBtc>

Defined in: wallet-btc/src/manager.ts:38

Account at an explicit path. Cached per path.

string

Promise<WalletAccountBtc>

WalletManager.getAccountByPath


getFeeRates(): Promise<FeeRates>

Defined in: wallet-btc/src/manager.ts:71

sat/vB from the client’s estimator: fast = 1 block, normal = 3, slow = 6.

Promise<FeeRates>

WalletManager.getFeeRates


getReadOnlyAccount(address): WalletAccountReadOnlyBtc

Defined in: wallet-btc/src/manager.ts:66

A read-only account for any address, with this manager’s config.

string

WalletAccountReadOnlyBtc


protected requireSigner(curve): Signer

Defined in: core/dist/index.d.ts:283

The external signer, asserted to sign on curve; throws when the manager holds a mnemonic instead.

SignerCurve

Signer

WalletManager.requireSigner


protected seedBytes(): Uint8Array

Defined in: core/dist/index.d.ts:275

The 64-byte seed this manager derives from; throws for a Signer-built or disposed manager.

Uint8Array

WalletManager.seedBytes


protected signerAccount(key, signer, relativePath, build): Promise<WalletAccountBtc>

Defined in: core/dist/index.d.ts:300

cachedAccount over an injected signer: the signer itself (relativePath undefined) or its child along relativePath. A child that never becomes an account is disposed.

string

Signer

string | undefined

(leaf, publicKey) => WalletAccountBtc

Promise<WalletAccountBtc>

WalletManager.signerAccount


static getRandomSeedPhrase(words?): string

Defined in: core/dist/index.d.ts:279

Same as the core getRandomSeedPhrase.

12 | 24

string

WalletManager.getRandomSeedPhrase


static isValidSeedPhrase(seed): boolean

Defined in: core/dist/index.d.ts:277

Same as the core isValidSeedPhrase.

string

boolean

WalletManager.isValidSeedPhrase