Skip to main content

@midnight-ntwrk/wallet-api v3.5.0Readme | API


@midnight-ntwrk/wallet-api v3.5.0 / WalletState

Type alias: WalletState

type WalletState: {
address: Address;
availableCoins: QualifiedCoinInfo[];
balances: Record<TokenType, bigint>;
coinPublicKey: CoinPublicKey;
coins: QualifiedCoinInfo[];
encryptionPublicKey: EncPublicKey;
nullifiers: Nullifier[];
pendingCoins: CoinInfo[];
syncProgress: SyncProgress | undefined;
transactionHistory: TransactionHistoryEntry[];
};

Wallet state information

Remarks

WalletState is a data structure used for storing wallet state information, such as wallet coins, balances, transaction history, etc.

Type declaration

address

readonly address: Address;

Wallet address

availableCoins

readonly availableCoins: QualifiedCoinInfo[];

All available wallet coins that can be spent immediately.

balances

readonly balances: Record<TokenType, bigint>;

A map of balances for all available coins, where the key is a TokenType and the value is a balance. Note that this won't list any zero balance coins

coinPublicKey

readonly coinPublicKey: CoinPublicKey;

Wallet CoinPublicKey

coins

readonly coins: QualifiedCoinInfo[];

All wallet coins (including those which are pending to spend)

encryptionPublicKey

readonly encryptionPublicKey: EncPublicKey;

Wallet EncryptionPublicKey

nullifiers

readonly nullifiers: Nullifier[];

Nullifiers corresponding to the coins. For 0 <= i < coins.length, nullifiers[i] corresponds to coins[i]

pendingCoins

readonly pendingCoins: CoinInfo[];

The coins the wallet is expecting to receive in the future, but which are not yet available for spending

syncProgress

readonly syncProgress: SyncProgress | undefined;

SyncProgress of the wallet

It can be undefined when wallet is started and if it is not syncing

transactionHistory

readonly transactionHistory: TransactionHistoryEntry[];

Transaction history - an array of TransactionHistoryEntry sorted from the oldest one to the newest one.