CrossmintRuntimeWalletBase class abstract base

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.

Implementers

Constructors

CrossmintRuntimeWalletBase({required CrossmintClient client, required CrossmintWallet wallet, CrossmintSignerConfig? recoverySigner, CrossmintWalletApprovalSigner? signer, List<CrossmintWalletApprovalSigner> additionalSigners = const <CrossmintWalletApprovalSigner>[], DeviceSignerKeyStorage? deviceSignerKeyStorage, CrossmintSignerAuthRequiredCallback? onAuthRequired})

Properties

additionalSigners → List<CrossmintWalletApprovalSigner>
Secondary signers available alongside the primary signer.
no setter
address → String
On-chain address of the wallet.
no setter
canExportPrivateKey → bool
Whether the active signer supports private-key export.
no setter
chain → String
Blockchain this wallet operates on (falls back to defaultChain).
no setter
client → CrossmintClient
Top-level Crossmint client shared by all wallet operations.
final
debugIsRecovering → bool
Test-only: true while recover() is in flight. Lets concurrency tests assert that concurrent callers coalesce onto a single recovery future.
no setter
defaultChain → String
Chain identifier used when the wallet snapshot has no explicit chain.
no setter
deviceSignerKeyStorage → DeviceSignerKeyStorage?
Storage backend for hardware-backed device signer keys.
final
hashCode → int
The hash code for this object.
no setterinherited
locator → String
Unique wallet locator used for API calls.
no setter
needsRecovery → bool
Whether the wallet needs recovery (signer registration) before the next transaction.
no setter
onAuthRequired → CrossmintSignerAuthRequiredCallback?
Callback invoked when a signer operation requires user authentication.
final
owner → String?
Owner identifier associated with the wallet, if any.
no setter
recovery → CrossmintSignerConfig?
Primary recovery signer config, the first of recoveryMethods.
no setter
recoveryMethods → List<CrossmintSignerConfig>
Every recovery method configured on the wallet.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
signer → CrossmintWalletApprovalSigner?
Currently active approval signer, or null if none is selected.
no setter
wallet → CrossmintWallet
Server-issued wallet snapshot backing this runtime instance.
final

Methods

addSigner(CrossmintSignerConfig signer, {bool prepareOnly = false, bool deployImmediately = true}) → Future<CrossmintWalletAddSignerResult>
Registers a new signer on the wallet and approves the registration.
approve(CrossmintWalletApproveRequest request) → Future<CrossmintWalletApproveResult>
Approves a pending transaction or signature request.
approveSignatureAndWaitInternal(String signatureId) → Future<String>
Approves a pending signature and polls until it completes.
approveSignatureInternal(String signatureId) → Future<CrossmintSignatureRecord>
Submits approvals for a pending signature request.
approveTransactionAndWait(String transactionId, {CrossmintTransactionDetails? seedTransaction}) → Future<CrossmintTransactionDetails>
Approves a pending transaction and polls until it reaches a terminal state.
approveTransactionInternal(String transactionId) → Future<CrossmintTransactionDetails>
Submits approvals for a pending transaction.
balances({List<String> tokens = const <String>[]}) → Future<CrossmintWalletBalanceSnapshot>
Returns the wallet balances — always includes USDC and the native token. Pass additional tokens to request extra token balances.
completeApprovedTransaction(CrossmintTransactionDetails transaction, {required String transactionId}) → Future<CrossmintTransactionDetails>
Polls a transaction until it reaches a terminal state and attaches explorer links.
debugRecoverySignerForPendingOperation(String approverLocator) → Future<CrossmintWalletApprovalSigner>
Test-only: the signer that can approve an operation addressed to approverLocator.
debugRegisterRecoverySigner(CrossmintWalletApprovalSigner signer) → void
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.
debugResolveRecoverySigner() → Future<CrossmintWalletApprovalSigner>
Test-only: the signer the selected recovery method resolves to. Throws when the selected method cannot sign from this client.
debugSelectRecoveryApprover() → Future<String?>
Test-only: the approver locator an admin API call would carry, or null on a wallet with a single recovery method.
exportPrivateKey({CrossmintExportSignerBridge? bridge}) → Future<void>
Exports the wallet's private key via the export signer bridge.
fund(CrossmintWalletFundRequest request) → Future<CrossmintWalletFundResult>
Initiates a funding (on-ramp) request for this wallet.
isSignerApproved(String signerLocator) → Future<bool>
Checks whether a registered signer is approved and usable.
nfts({int page = 1, int perPage = 50}) → Future<CrossmintWalletNftPage>
Returns the wallet's NFTs (paginated).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
preAuthIfNeeded() → Future<void>
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() → Future<void>
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.
removeSigner(String signerLocator, {bool prepareOnly = false}) → Future<CrossmintTransactionDetails>
Removes a signer from the wallet by its locator.
requireActiveSigner(String operation) → CrossmintWalletApprovalSigner
Returns the active signer or throws if none is selected.
send(CrossmintWalletTokenTransferRequest request) → Future<CrossmintTransactionDetails>
Sends a token transfer and waits for confirmation.
sendToken(String to, String token, String amount, {bool prepareOnly = false, String? transactionType}) → Future<CrossmintTransactionDetails>
Convenience wrapper around send for simple token transfers.
signerIsRegistered(String signerLocator) → Future<bool>
Checks whether a signer with the given locator is registered.
signers() → Future<List<CrossmintWalletSigner>>
Lists all signers registered on this wallet with their current status.
toString() → String
A string representation of this object.
inherited
transaction(String transactionId) → Future<CrossmintTransactionDetails?>
Retrieves details for a specific transaction by ID.
transactionApprovalPayload({required CrossmintTransactionDetails transaction, required CrossmintJsonMap pendingApproval, required CrossmintWalletApprovalSigner signer}) → String
Extracts the signable payload from a pending transaction approval.
transactions() → Future<List<CrossmintTransactionSummary>>
Lists transaction summaries for this wallet.
transfers({int page = 1, int perPage = 50, List<String> tokens = const <String>[], String? status}) → Future<List<CrossmintJsonMap>>
Reads transfer history for this wallet (unstable API).
useRecoveryMethod(CrossmintSignerConfig recoveryMethod) → Future<void>
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.
useSigner(CrossmintSignerConfig signer, {List<CrossmintSignerConfig> additionalSigners = const <CrossmintSignerConfig>[]}) → Future<void>
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.
waitForTransaction(String transactionId) → Future<CrossmintTransactionDetails>
Polls a transaction by ID until it succeeds or fails.
walletSnapshotForSigners() → Future<CrossmintWallet>
Fetches a fresh wallet snapshot to inspect registered signers.

Operators

operator ==(Object other) → bool
The equality operator.
inherited