LocalState
@midnight-ntwrk/ledger v3.0.2 β’ Readme | API
@midnight-ntwrk/ledger v3.0.2 / LocalState
Class: LocalState
The local state of a user/wallet, consisting of their secret key, and a set of unspent coins.
It also keeps track of coins that are in-flight, either expecting to spend or expecting to receive, and a local copy of the global coin commitment Merkle tree to generate proofs against.
Constructorsβ
new LocalState()β
new LocalState(): LocalState
Creates a new state with a randomly sampled secret key
Returnsβ
Propertiesβ
coinPublicKeyβ
readonly coinPublicKey: string;
The coin public key of this wallet
coinsβ
readonly coins: Set<QualifiedCoinInfo>;
The set of spendable coins of this wallet
encryptionPublicKeyβ
readonly encryptionPublicKey: string;
The encryption public key of this wallet
firstFreeβ
readonly firstFree: bigint;
The first free index in the internal coin commitments Merkle tree. This may be used to identify which merkle tree updates are necessary.
pendingOutputsβ
readonly pendingOutputs: Map<string, CoinInfo>;
The outputs that this wallet is expecting to receive in the future
pendingSpendsβ
readonly pendingSpends: Map<string, QualifiedCoinInfo>;
The spends that this wallet is expecting to be finalized on-chain in the future