Skip to main content
Abstract Base Class Base class for chain-specific runtime wallets (EVM, Solana, Stellar).
Wraps a server-issued CrossmintWallet with signer management, transaction/signature approval flows, device-signer recovery, and token operations. Use the chain subclasses (CrossmintEvmWallet, CrossmintSolanaWallet, CrossmintStellarWallet) rather than this class directly.

Constructors

CrossmintRuntimeWalletBase

Properties

client

Top-level Crossmint client shared by all wallet operations.

wallet

Server-issued wallet snapshot backing this runtime instance.

deviceSignerKeyStorage

Storage backend for hardware-backed device signer keys.

onAuthRequired

Callback invoked when a signer operation requires user authentication.

defaultChain

Chain identifier used when the wallet snapshot has no explicit chain.

chain

Blockchain this wallet operates on (falls back to defaultChain).

address

On-chain address of the wallet.

owner

Owner identifier associated with the wallet, if any.

recoveryMethods

Every recovery method configured on the wallet.

recovery

Primary recovery signer config, the first of recoveryMethods.

locator

Unique wallet locator used for API calls.

signer

Currently active approval signer, or null if none is selected.

additionalSigners

Secondary signers available alongside the primary signer.

needsRecovery

Whether the wallet needs recovery (signer registration) before the next transaction.

canExportPrivateKey

Whether the active signer supports private-key export.

debugIsRecovering

Test-only: true while recover() is in flight. Lets concurrency tests assert that concurrent callers coalesce onto a single recovery future.

Methods

useSigner

Sets the active signer for this wallet. Accepts a signer config object; the locator is inferred internally. Works for device, non-custodial, external-wallet, and passkey signers.

useRecoveryMethod

Selects which recovery method authorizes admin operations: addSigner, removeSigner, and device-signer recovery. Unlike useSigner, this does not change the active signer used for transactions and signatures.

balances

Returns the wallet balances — always includes USDC and the native token. Pass additional tokens to request extra token balances.

transactions

Lists transaction summaries for this wallet.

transaction

Retrieves details for a specific transaction by ID.

approve

Approves a pending transaction or signature request.

nfts

Returns the wallet’s NFTs (paginated).

fund

Initiates a funding (on-ramp) request for this wallet.

transfers

Reads transfer history for this wallet (unstable API).

send

Sends a token transfer and waits for confirmation.

sendToken

Convenience wrapper around send for simple token transfers.

signers

Lists all signers registered on this wallet with their current status.

removeSigner

Removes a signer from the wallet by its locator.

signerIsRegistered

Checks whether a signer with the given locator is registered.

isSignerApproved

Checks whether a registered signer is approved and usable.

addSigner

Registers a new signer on the wallet and approves the registration.

preAuthIfNeeded

Awaits any in-flight recovery; if _needsRecovery is set and no recovery is in-flight, starts one and awaits it. Concurrent callers coalesce onto the same future so a single recovery runs per wallet. Then authenticates a non-custodial active signer, so an OTP round-trip happens before the operation exists rather than inside the window in which a Solana blockhash stays valid. Mirrors the TypeScript SDK.

recover

Runs device-signer recovery: resumes any pending operation or registers a new device signer using the recovery signer. Returns early if the device signer is already approved on-chain.

debugRegisterRecoverySigner

Test-only: inject a pre-assembled recovery signer, bypassing the constructor-config resolution path. Used by tests that wire a fake bridge into a non-custodial signer without exercising hiddenSignerBridgeController. Not part of the supported public API.

debugSelectRecoveryApprover

Test-only: the approver locator an admin API call would carry, or null on a wallet with a single recovery method.

debugRecoverySignerForPendingOperation

Test-only: the signer that can approve an operation addressed to approverLocator.

debugResolveRecoverySigner

Test-only: the signer the selected recovery method resolves to. Throws when the selected method cannot sign from this client.

exportPrivateKey

Exports the wallet’s private key via the export signer bridge.

approveSignatureAndWaitInternal

Approves a pending signature and polls until it completes.

approveSignatureInternal

Submits approvals for a pending signature request.

approveTransactionAndWait

Approves a pending transaction and polls until it reaches a terminal state.

approveTransactionInternal

Submits approvals for a pending transaction.

transactionApprovalPayload

Extracts the signable payload from a pending transaction approval.

completeApprovedTransaction

Polls a transaction until it reaches a terminal state and attaches explorer links.

waitForTransaction

Polls a transaction by ID until it succeeds or fails.

walletSnapshotForSigners

Fetches a fresh wallet snapshot to inspect registered signers.

requireActiveSigner

Returns the active signer or throws if none is selected.