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')Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Wallet(
seedOrSigner,options?):Wallet
Defined in: kit/src/wallet.ts:76
Parameters
Section titled “Parameters”seedOrSigner
Section titled “seedOrSigner”string | Uint8Array<ArrayBufferLike> | Signer
options?
Section titled “options?”WalletOptions = {}
Returns
Section titled “Returns”Wallet
Accessors
Section titled “Accessors”chains
Section titled “chains”Get Signature
Section titled “Get Signature”get chains():
string[]
Defined in: kit/src/wallet.ts:124
Registered wallet keys.
Returns
Section titled “Returns”string[]
historyChains
Section titled “historyChains”Get Signature
Section titled “Get Signature”get historyChains():
string[]
Defined in: kit/src/wallet.ts:121
Chains with a registered history source.
Returns
Section titled “Returns”string[]
protocols
Section titled “protocols”Get Signature
Section titled “Get Signature”get protocols():
string[]
Defined in: kit/src/wallet.ts:126
Registered protocol names.
Returns
Section titled “Returns”string[]
Methods
Section titled “Methods”describeTransaction()
Section titled “describeTransaction()”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.
Parameters
Section titled “Parameters”ChainTx
Iterable<string> = ...
index?
Section titled “index?”number = 0
Returns
Section titled “Returns”Promise<FeedItem>
dispose()
Section titled “dispose()”dispose():
void
Defined in: kit/src/wallet.ts:297
Zeroize every manager and drop protocol instances.
Returns
Section titled “Returns”void
getAccount()
Section titled “getAccount()”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.
Type Parameters
Section titled “Type Parameters”A extends IWalletAccount = IWalletAccount
Parameters
Section titled “Parameters”string
index?
Section titled “index?”number = 0
Returns
Section titled “Returns”Promise<A>
getManager()
Section titled “getManager()”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).
Type Parameters
Section titled “Type Parameters”M extends WalletManager<IWalletAccount, object> = WalletManager<IWalletAccount, object>
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”M
getProtocol()
Section titled “getProtocol()”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).
Type Parameters
Section titled “Type Parameters”P
Parameters
Section titled “Parameters”string
index?
Section titled “index?”number = 0
Returns
Section titled “Returns”Promise<P>
history()
Section titled “history()”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.
Parameters
Section titled “Parameters”query?
Section titled “query?”HistoryFeedQuery = {}
Returns
Section titled “Returns”Promise<HistoryFeedPage>
registerHistorySource()
Section titled “registerHistorySource()”registerHistorySource(
source):this
Defined in: kit/src/wallet.ts:108
Register the history source of one chain (exact CAIP-2 id, one per chain).
Parameters
Section titled “Parameters”source
Section titled “source”HistorySource
Returns
Section titled “Returns”this
registerProtocol()
Section titled “registerProtocol()”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.
Type Parameters
Section titled “Type Parameters”P
C
Parameters
Section titled “Parameters”string
Protocol
Section titled “Protocol”ProtocolClass<P, C>
options
Section titled “options”string
config?
Section titled “config?”NoInfer<C>
Returns
Section titled “Returns”this
registerWallet()
Section titled “registerWallet()”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.
Type Parameters
Section titled “Type Parameters”M extends WalletManager<IWalletAccount, object>
C extends object
Parameters
Section titled “Parameters”string
Manager
Section titled “Manager”ManagerClass<M, C>
config
Section titled “config”NoInfer<C>
Returns
Section titled “Returns”this
setIntentJournal()
Section titled “setIntentJournal()”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.
Parameters
Section titled “Parameters”journal
Section titled “journal”IntentJournal | undefined
Returns
Section titled “Returns”this