Skip to main content

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.

Final Class Single source of truth for the wallet state surfaced by CrossmintWalletController and the wallet provider UI layer. Holds the currently-loaded wallet, its identifier, and the lifecycle status; emits notifyListeners() whenever any of those change.
final class CrossmintWalletStateRepository extends ChangeNotifier implements CrossmintWalletStateView
This class is deliberately small and side-effect-free: it does not fetch wallets, call the transport layer, or touch the Crossmint API. The wallet controller is responsible for orchestrating the API calls and pushing results into this repository via beginOperation, setWallet, setError, and clear. Funnelling mutations through this type gives the SDK a clean seam to add caching, optimistic updates, or offline persistence in the future without touching the controller’s public API.

Constructors

CrossmintWalletStateRepository

CrossmintWalletStateRepository()

Properties

currentWallet

CrossmintWallet? get currentWallet

currentWalletId

String? get currentWalletId

status

CrossmintWalletStatus get status

Methods

beginOperation

void beginOperation()
Mark the beginning of a wallet operation (load / create / refresh). Transitions to CrossmintWalletStatus.inProgress without touching the stored wallet or wallet id, so consumers can still render stale data while a refresh runs. No-op if already in progress.

setWallet

void setWallet(CrossmintWallet? wallet)
Commit the result of a successful wallet operation. A non-null wallet transitions to CrossmintWalletStatus.loaded; a null wallet transitions to CrossmintWalletStatus.notLoaded and clears the stored id (mirroring the pre-repository controller contract — an explicit backend “not found” must not silently revive the previous wallet on the next refresh()).

setError

void setError()
Transition to CrossmintWalletStatus.error after a failed operation. The previously-loaded wallet and wallet id are preserved so consumers can still show stale data alongside the error.

clear

void clear()
Reset to the initial state. Transitions to CrossmintWalletStatus.notLoaded and clears both the wallet and its identifier.