CrossmintSolanaWallet class final

Runtime wallet for Solana.

On Solana, device signer support depends on the wallet type and is validated server-side; the runtime falls back to the recovery signer when the server rejects a device signer. Non-custodial, external, and passkey signers are also supported. Default chain is solana.

Inheritance

Constructors

CrossmintSolanaWallet({required CrossmintClient client, required CrossmintWallet wallet, CrossmintSignerConfig? recoverySigner, CrossmintWalletApprovalSigner? signer, List<CrossmintWalletApprovalSigner> additionalSigners = const <CrossmintWalletApprovalSigner>[], DeviceSignerKeyStorage? deviceSignerKeyStorage, CrossmintSignerAuthRequiredCallback? onAuthRequired})
Creates a runtime Solana wallet. Prefer CrossmintClient.createSolanaWallet or the wallet controller over constructing this directly.

Properties

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

Methods

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

Operators

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