Skip to main content

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


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

Type alias: WalletState

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

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.