Skip to main content

WalletState

@midnight-ntwrk/wallet-api v5.0.0 β€’ Readme | API


@midnight-ntwrk/wallet-api v5.0.0 / WalletState

Type alias: WalletState

type WalletState: {
address: Address;
addressLegacy: AddressLegacy;
availableCoins: QualifiedCoinInfo[];
balances: Record<TokenType, bigint>;
coinPublicKey: CoinPublicKey;
coinPublicKeyLegacy: CoinPublicKeyLegacy;
coins: QualifiedCoinInfo[];
encryptionPublicKey: EncPublicKey;
encryptionPublicKeyLegacy: EncPublicKeyLegacy;
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

addressLegacy​

readonly addressLegacy: AddressLegacy;

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

coinPublicKeyLegacy​

readonly coinPublicKeyLegacy: CoinPublicKeyLegacy;

Wallet CoinPublicKeyLegacy

coins​

readonly coins: QualifiedCoinInfo[];

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

encryptionPublicKey​

readonly encryptionPublicKey: EncPublicKey;

Wallet EncryptionPublicKey

encryptionPublicKeyLegacy​

readonly encryptionPublicKeyLegacy: EncPublicKeyLegacy;

Wallet EncPublicKeyLegacy

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.