Skip to main content
Class

Instance Properties

Instance Methods

addRecoveryMethod(_:)

Adds a recovery method to the wallet.

Return Value

The completed Transaction.

Discussion

Solana and Stellar wallets only. A recovery method of the wallet approves the change. To select it, see useRecoveryMethod(_:).
Throws: WalletError.recoveryConfigRejected(code:message:) with one of these codes:
  • WalletError.RecoveryConfigCode.notSupportedOnChain if the wallet is an EVM wallet.
  • WalletError.RecoveryConfigCode.signerNotAllowed if method is a passkey and the wallet is a Solana wallet.

Example

Parameters

addSigner(_:)

Registers a new signer on this wallet.

Discussion

Throws: WalletError if registration fails.

Parameters

approve(transactionId:)

Approves and submits a pending transaction on behalf of the current signer.

Discussion

Use this when a transaction was created externally (e.g. via the Crossmint API) and shows TransactionStatus.awaitingApproval. The SDK signs the approval message and polls until the transaction reaches a terminal state.

Parameters

balance(of:)

balances(_:_:)

Returns balances for the requested tokens, always including the chain’s native token and USDC.

Parameters

fund(token:amount:)

Funds the wallet with test tokens from the Crossmint faucet.

Discussion

Only available in staging/development environments; throws in production.

Parameters

getTransaction(id:)

Fetches a transaction by its ID.

Return Value

The Transaction matching the given ID.

Discussion

Use this to check the current status of a transaction, including its TransactionStatus, on-chain data, and any pending or submitted approvals.
Throws: TransactionError if the transaction cannot be retrieved or decoded.

Example

Parameters

isSignerApproved(_:)

Returns whether the given signer is approved and usable on this wallet’s chain.

Discussion

A freshly registered signer can need approval before it can sign. Call addSigner(_:) to register a signer. This method returns false when the signer is not registered on this wallet.
Throws: WalletError if the request fails, or WalletError.signerLocatorError(_:) when the locator string does not parse as a SignerLocator.

Parameters

isSignerApproved(_:)

Returns whether the given signer is approved and usable on this wallet’s chain.

Discussion

A freshly registered signer can need approval before it can sign. Call addSigner(_:) to register a signer. This method returns false when the signer is not registered on this wallet.
Throws: WalletError if the request fails.

Parameters

listTransactions(page:transactionsPerPage:)

Fetches a page of the transaction history for this wallet, ordered most recent first.

Return Value

The wallet’s Transaction list for the requested page.

Discussion

Throws: TransactionError if the request fails.

Example

Parameters

listTransfers(tokens:)

Fetches the transfer history for this wallet.

Return Value

A TransferListResult containing the transfer events sorted by timestamp (most recent first).

Discussion

Returns a list of incoming and outgoing transfers for the specified tokens. Use this method to display transaction history in your application.
Throws: WalletError if the request fails.

Example

Parameters

localDeviceSigner()

Returns the locator of the device signer whose private key is on this device. Returns nil if this wallet has no such signer.

Discussion

A wallet can have device: delegated signers registered from other devices. This method only returns a locator when the matching key is present in local secure storage.

localDeviceSignerLocator()

Returns the locator string of the device signer whose private key is on this device. Returns nil if this wallet has no such signer.

needsRecovery()

Returns whether this wallet needs recovery on the current device.

Discussion

A wallet needs recovery when a device signer is configured but the signing key for this wallet is not present on the current device. Call recover() to re-register.
Note: This method awaits the background signer-initialization task that runs at wallet creation, so the first call may take a moment on slow networks.

nfts(page:nftsPerPage:)

Returns a page of NFTs owned by this wallet.

Parameters

recover()

Re-registers the device signer on this device.

Discussion

Call this when needsRecovery() returns true — i.e. the wallet has a device signer registered but the private key is missing on the current device. This generates a new key, registers it with Crossmint, and awaits approval from the existing admin signer. If the wallet’s provider does not support device signers, this returns without error and signing stays on the recovery signer; the rejection is remembered so registration is not retried for this wallet instance.
Throws: WalletError if recovery fails or there is no device signer configured.

removeRecoveryMethod(locator:)

Removes a recovery method from the wallet.

Return Value

The completed Transaction.

Discussion

Solana and Stellar wallets only. A different recovery method of the wallet approves the change. To select it, see useRecoveryMethod(_:). If you selected the removed recovery method, the SDK clears the selection. To remove a signer that you added with addSigner(_:), use removeSigner(locator:).
Throws: WalletError.recoveryConfigRejected(code:message:) with one of these codes:
  • WalletError.RecoveryConfigCode.notSupportedOnChain on an EVM wallet.
  • WalletError.RecoveryConfigCode.lastSigner if the wallet has no other recovery method.

Example

Parameters

removeSigner(locator:)

Removes an assigned signer from this wallet.

Return Value

The completed Transaction once the signer has been removed on-chain.

Discussion

This method submits a remove-signer transaction on-chain. If the transaction needs approval, the current signer signs it. The method then polls until the transaction completes.

Parameters

removeSigner(locator:)

Removes an assigned signer from this wallet.

Return Value

The completed Transaction once the signer has been removed on-chain.

Discussion

This method submits a remove-signer transaction on-chain. If the transaction needs approval, the current signer signs it. The method then polls until the transaction completes. Use removeRecoveryMethod(locator:) to remove a recovery method.

Parameters

send(_:_:_:idempotencyKey:)

Transfers tokens to another wallet and polls until the transaction is confirmed on-chain.

Return Value

A TransactionSummary with the on-chain hash and explorer link once confirmed.

Example

Parameters

send(token:recipient:amount:)

signerIsRegistered(_:)

Returns true if the locator is a signer on this wallet.

Discussion

This method sends a request to the server. It returns false if the request fails.

signerIsRegistered(_:)

Returns true if the locator is a signer on this wallet.

Discussion

This method sends a request to the server. It returns false if the request fails. It also returns false if the locator string is not valid.

Parameters

signers()

Fetches the current list of signers from the API.

Discussion

Each WalletSigner includes its registration status on this wallet’s chain. On EVM wallets, signers without a registration entry (pending or completed) for the wallet’s chain are omitted. A signer whose state lookup fails is returned with SignerStatus.unknown rather than dropped. Always returns fresh data — safe to call after addSigner(_:) or removeSigner(locator:).

transferToken(tokenId:recipient:amount:)

Transfers an NFT or fungible token to a recipient.

Parameters

useRecoveryMethod(_:)

Selects the recovery method that approves changes to signers and recovery methods.

Discussion

The signer for transactions and messages does not change. To change it, use useSigner(_:). If you do not select a recovery method, the SDK uses one of these:
  1. The only recovery method of the wallet.
  2. The active signer, if it is a recovery method. If neither applies, the change fails with WalletError.RecoveryConfigCode.signerRequired.
Throws: WalletError.recoveryConfigRejected(code:message:) with WalletError.RecoveryConfigCode.invalidConfig if method is not in recoveryMethods, or if method is a passkey with no id and the wallet has more than one passkey recovery method. The SDK throws WalletError.walletGeneric(_:) for a different signer type.

Example

Parameters

useSigner(_:)

Sets the signer for the send and sign operations of this wallet.

Discussion

The signer replaces the admin signer. The signer must be registered on this wallet. To register a new signer, call addSigner(_:) first. To select the recovery method that approves signer changes, use useRecoveryMethod(_:).
Throws: - WalletError.signerNotRegistered(_:) if the signer is not registered on this wallet.
  • The WalletError of the failed request if the API does not return the wallet signers. The active signer does not change. You can try again.
  • WalletError.walletGeneric(_:) if config is SignerConfig.externalWallet(_:onSign:) and onSign is nil.
  • WalletError.walletGeneric(_:) if config is SignerConfig.passkey(name:host:id:) with no id and the wallet has more than one passkey signer.
  • WalletError.deviceSignerNotSupported(_:) if you select .device and the wallet provider does not accept device signers.

Parameters