> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CrossmintRuntimeWalletBase

> Flutter Abstract Base Class

**Abstract Base Class**

Base class for chain-specific runtime wallets (EVM, Solana, Stellar).

```dart theme={null}
abstract base class CrossmintRuntimeWalletBase
```

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

```dart theme={null}
CrossmintRuntimeWalletBase({
  required this.client,
  required this.wallet,
  CrossmintSignerConfig? recoverySigner,
  CrossmintWalletApprovalSigner? signer,
  List<CrossmintWalletApprovalSigner> additionalSigners =
      const <CrossmintWalletApprovalSigner>[],
  this.deviceSignerKeyStorage,
  this.onAuthRequired,
})
```

## Properties

### client

```dart theme={null}
final CrossmintClient client
```

Top-level Crossmint client shared by all wallet operations.

### wallet

```dart theme={null}
final CrossmintWallet wallet
```

Server-issued wallet snapshot backing this runtime instance.

### deviceSignerKeyStorage

```dart theme={null}
final DeviceSignerKeyStorage? deviceSignerKeyStorage
```

Storage backend for hardware-backed device signer keys.

### onAuthRequired

```dart theme={null}
final CrossmintSignerAuthRequiredCallback? onAuthRequired
```

Callback invoked when a signer operation requires user authentication.

### defaultChain

```dart theme={null}
String get defaultChain
```

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

### chain

```dart theme={null}
String get chain
```

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

### address

```dart theme={null}
String get address
```

On-chain address of the wallet.

### owner

```dart theme={null}
String? get owner
```

Owner identifier associated with the wallet, if any.

### recovery

```dart theme={null}
CrossmintSignerConfig? get recovery
```

Recovery (admin) signer config parsed from the wallet's backend state.

### locator

```dart theme={null}
String get locator
```

Unique wallet locator used for API calls.

### signer

```dart theme={null}
CrossmintWalletApprovalSigner? get signer
```

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

### additionalSigners

```dart theme={null}
List<CrossmintWalletApprovalSigner> get additionalSigners
```

Secondary signers available alongside the primary `signer`.

### needsRecovery

```dart theme={null}
bool get needsRecovery
```

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

### canExportPrivateKey

```dart theme={null}
bool get canExportPrivateKey
```

Whether the active signer supports private-key export.

### debugIsRecovering

```dart theme={null}
bool get debugIsRecovering
```

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

## Methods

### useSigner

```dart theme={null}
Future<void> useSigner(
  CrossmintSignerConfig signer, {
  List<CrossmintSignerConfig> additionalSigners =
      const <CrossmintSignerConfig>[],
})
```

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.

### balances

```dart theme={null}
Future<CrossmintWalletBalanceSnapshot> balances({
  List<String> tokens = const <String>[],
})
```

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

### transactions

```dart theme={null}
Future<List<CrossmintTransactionSummary>> transactions()
```

Lists transaction summaries for this wallet.

### transaction

```dart theme={null}
Future<CrossmintTransactionDetails?> transaction(String transactionId)
```

Retrieves details for a specific transaction by ID.

### approve

```dart theme={null}
Future<CrossmintWalletApproveResult> approve(
  CrossmintWalletApproveRequest request,
)
```

Approves a pending transaction or signature request.

### nfts

```dart theme={null}
Future<CrossmintWalletNftPage> nfts({int page = 1, int perPage = 50})
```

Returns the wallet's NFTs (paginated).

### fund

```dart theme={null}
Future<CrossmintWalletFundResult> fund(CrossmintWalletFundRequest request)
```

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

### transfers

```dart theme={null}
Future<List<CrossmintJsonMap>> transfers({
  int page = 1,
  int perPage = 50,
  List<String> tokens = const <String>[],
  String? status,
})
```

Reads transfer history for this wallet (unstable API).

### send

```dart theme={null}
Future<CrossmintTransactionDetails> send(
  CrossmintWalletTokenTransferRequest request,
)
```

Sends a token transfer and waits for confirmation.

### sendToken

```dart theme={null}
Future<CrossmintTransactionDetails> sendToken(
  String to,
  String token,
  String amount, {
  bool prepareOnly = false,
  String? transactionType,
})
```

Convenience wrapper around `send` for simple token transfers.

### signers

```dart theme={null}
Future<List<CrossmintWalletSigner>> signers()
```

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

### removeSigner

```dart theme={null}
Future<void> removeSigner(String signerLocator)
```

Removes a signer from the wallet by its locator.

### signerIsRegistered

```dart theme={null}
Future<bool> signerIsRegistered(String signerLocator)
```

Checks whether a signer with the given locator is registered.

### isSignerApproved

```dart theme={null}
Future<bool> isSignerApproved(String signerLocator)
```

Checks whether a registered signer is approved and usable.

### addSigner

```dart theme={null}
Future<CrossmintWalletAddSignerResult> addSigner(
  CrossmintSignerConfig signer, {
  bool prepareOnly = false,
})
```

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

### preAuthIfNeeded

```dart theme={null}
Future<void> 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.

### recover

```dart theme={null}
Future<void> 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

```dart theme={null}
void debugRegisterRecoverySigner(CrossmintWalletApprovalSigner signer)
```

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.

### exportPrivateKey

```dart theme={null}
Future<void> exportPrivateKey({CrossmintExportSignerBridge? bridge})
```

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

### approveSignatureAndWaitInternal

```dart theme={null}
Future<String> approveSignatureAndWaitInternal(String signatureId)
```

Approves a pending signature and polls until it completes.

### approveSignatureInternal

```dart theme={null}
Future<CrossmintSignatureRecord> approveSignatureInternal( String signatureId, )
```

Submits approvals for a pending signature request.

### approveTransactionAndWait

```dart theme={null}
Future<CrossmintTransactionDetails> approveTransactionAndWait(
  String transactionId, {
  CrossmintTransactionDetails? seedTransaction,
})
```

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

### approveTransactionInternal

```dart theme={null}
Future<CrossmintTransactionDetails> approveTransactionInternal(
  String transactionId,
)
```

Submits approvals for a pending transaction.

### transactionApprovalPayload

```dart theme={null}
String transactionApprovalPayload({
  required CrossmintTransactionDetails transaction,
  required CrossmintJsonMap pendingApproval,
  required CrossmintWalletApprovalSigner signer,
})
```

Extracts the signable payload from a pending transaction approval.

### completeApprovedTransaction

```dart theme={null}
Future<CrossmintTransactionDetails> completeApprovedTransaction(
  CrossmintTransactionDetails transaction, {
  required String transactionId,
})
```

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

### waitForTransaction

```dart theme={null}
Future<CrossmintTransactionDetails> waitForTransaction( String transactionId, )
```

Polls a transaction by ID until it succeeds or fails.

### walletSnapshotForSigners

```dart theme={null}
Future<CrossmintWallet> walletSnapshotForSigners()
```

Fetches a fresh wallet snapshot to inspect registered signers.

### requireActiveSigner

```dart theme={null}
CrossmintWalletApprovalSigner requireActiveSigner(String operation)
```

Returns the active signer or throws if none is selected.
