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.