WalletBalance

data class WalletBalance(val unshieldedNight: BigInteger, val shieldedNight: BigInteger, val dust: BigInteger, val dustRegistered: Boolean)

Snapshot of a wallet's full balance state across both pools.

Pool semantics:

  • Unshielded NIGHT lives in UTXOs on the public ledger; this is what external transfers ("fund this address") land in.

  • Shielded NIGHT lives in Zswap coins on the private ledger; the wallet moves NIGHT here for transactions whose amounts/recipients shouldn't be public.

  • DUST is a separate fee token, generated by the chain at a rate tied to the wallet's registered NIGHT. Not held in either pool's coin/UTXO graph; tracked in the ledger's dust state.

Why DUST has no "shielded" half: Midnight's protocol generates DUST against a registered NIGHT key directly. It's never wrapped in a Zswap coin and never appears as a shielded balance — by design, since DUST is the fee substrate, not a transferrable shielded asset.

Constructors

Link copied to clipboard
constructor(unshieldedNight: BigInteger, shieldedNight: BigInteger, dust: BigInteger, dustRegistered: Boolean)

Properties

Link copied to clipboard

Wallet's locally-replayed DUST state — what the SDK would spend on the next fee. u128 base units.

Link copied to clipboard

Best-effort signal: true iff the wallet currently holds spendable dust. A fresh wallet that hasn't run MidnightSdk.registerForDustGeneration reports false even with NIGHT funded, because the chain doesn't release spendable dust to an unregistered key.

Link copied to clipboard

True iff any shielded NIGHT is present. UIs use this to gate the privacy badge.

Link copied to clipboard

Sum of shielded NIGHT coins decryptable by this wallet's zswap key. u128 base units. Zero until the SDK's shielded subscription has completed its first replay (a few hundred ms on localnet, a few seconds on PREPROD).

Link copied to clipboard

Sum of both NIGHT pools — what the wallet "has" in NIGHT terms.

Link copied to clipboard

Sum of unspent NIGHT UTXOs at this wallet's Bech32m address. u128 base units.