Skip to content
docs

Wallet

Defined in: kit/src/wallet.ts:61

The orchestrator. Register chain wallets by CAIP-2 namespace prefix (or exact chain id) and protocol modules by name; ask for accounts and protocols. One seed phrase (or external signer) feeds every registered chain. Policies wrap every account handed out. dispose() zeroizes everything.

A seed phrase is turned into the 64-byte seed in the constructor and the string is not kept (a JS string cannot be zeroized); each chain manager gets its own copy of the bytes. Pass the seed bytes instead of the phrase to never hand the words to the SDK at all.

const w = new Wallet(seed, { policies: { maxFee: { 'eip155:1': 10n ** 16n } } })
w.registerWallet('eip155', WalletManagerEvm, { provider: RPC })
w.registerWallet('solana', WalletManagerSolana, { provider: SOL_RPC })
w.registerProtocol('lido', LidoProtocolEvm, { chain: 'eip155:1' })
const eth = await w.getAccount('eip155:1')
const lido = await w.getProtocol<LidoProtocolEvm>('lido')

new Wallet(seedOrSigner, options?): Wallet

Defined in: kit/src/wallet.ts:76

string | Uint8Array<ArrayBufferLike> | Signer

WalletOptions = {}

Wallet

get chains(): string[]

Defined in: kit/src/wallet.ts:124

Registered wallet keys.

string[]


get historyChains(): string[]

Defined in: kit/src/wallet.ts:121

Chains with a registered history source.

string[]


get protocols(): string[]

Defined in: kit/src/wallet.ts:126

Registered protocol names.

string[]

describeTransaction(tx, own?, index?): Promise<FeedItem>

Defined in: kit/src/wallet.ts:290

One transaction through the same pipeline, for a detail screen. own defaults to the row’s own address.

ChainTx

Iterable<string> = ...

number = 0

Promise<FeedItem>


dispose(): void

Defined in: kit/src/wallet.ts:297

Zeroize every manager and drop protocol instances.

void


getAccount<A>(chain, index?): Promise<A>

Defined in: kit/src/wallet.ts:190

Account index on chain, wrapped with the wallet’s policies. Its writes are refused (PolicyViolationError, policy: 'chain') when the account signs on another network than chain — one namespace registration with its RPC elsewhere — with or without policies; its reads (the address is the same across a family) keep working, so history and activity do.

A extends IWalletAccount = IWalletAccount

string

number = 0

Promise<A>


getManager<M>(chain): M

Defined in: kit/src/wallet.ts:151

The chain package’s manager (lazily constructed), behind the wallet’s policies: every account it hands out (getAccount, getAccountByPath, getNamedAccount…) is wrapped as getAccount wraps it, and its seed and signer accessors (seedBytes, externalSigner, _-prefixed state) are not reachable through it (round 3, H3).

M extends WalletManager<IWalletAccount, object> = WalletManager<IWalletAccount, object>

string

M


getProtocol<P>(name, index?): Promise<P>

Defined in: kit/src/wallet.ts:227

The protocol instance (one per name), constructed over the account of its chain, never the raw account (see restrict).

P

string

number = 0

Promise<P>


history(query?): Promise<HistoryFeedPage>

Defined in: kit/src/wallet.ts:283

The activity feed: one page across every chain with a history source, newest first. Each row is described by the first registered protocol module that recognizes it, else by the generic fallback (send / receive / self / approve / revoke / contract); the intent journal adds pending rows, inherited kinds and cross-chain joins.

HistoryFeedQuery = {}

Promise<HistoryFeedPage>


registerHistorySource(source): this

Defined in: kit/src/wallet.ts:108

Register the history source of one chain (exact CAIP-2 id, one per chain).

HistorySource

this


registerProtocol<P, C>(name, Protocol, options): this

Defined in: kit/src/wallet.ts:101

Register a protocol module under a name, bound to the chain its account must come from.

P

C

string

ProtocolClass<P, C>

string

NoInfer<C>

this


registerWallet<M, C>(key, Manager, config): this

Defined in: kit/src/wallet.ts:94

Register a chain package under a CAIP-2 key: a full chain id (“eip155:1”) or a namespace (“eip155”, “solana”, “ton”, “tron”, “bip122”) that matches every chain id in it.

M extends WalletManager<IWalletAccount, object>

C extends object

string

ManagerClass<M, C>

NoInfer<C>

this


setIntentJournal(journal): this

Defined in: kit/src/wallet.ts:115

The app’s intent journal (what it meant when it broadcast): history() folds it in. Pass undefined to detach.

IntentJournal | undefined

this