Skip to content

generateOutputsStatement

generateOutputsStatement(crypto, specs, revealed): Promise<StealthTransferStatement>

Defined in: ootle/src/stealth/wallet-helpers.ts:127

Faucet / public-stealth convenience: build a complete StealthTransferStatement for a transfer that has no stealth inputs (e.g. a faucet minting confidential outputs, or any revealed → stealth transfer that doesn’t need the full StealthTransfer builder).

Generates the outputs statement, derives the matching revealed-input amount as the sum of the stealth output amounts plus any revealed output amount (∑inputs == ∑outputs), uses a zero (Mask.zero()) input mask, signs the balance proof, validates the result with crypto.validateTransfer, and returns a ready-to-embed statement (balanceProof filled). The output mask is non-zero (there is ≥1 stealth output), so the proof is real — not the omitted all-zeros case.

For multi-step transfers with revealed change / fee, prefer the StealthTransfer builder + WalletStealthAuthorizer; this is the one-shot helper.

StealthCryptoProvider

The crypto seam (real WASM or a fake).

Output[]

The stealth outputs to create (must be non-empty).

RevealedOutput | null

The revealed (un-confidential) output and its receiver (null for fully-stealth).

Promise<StealthTransferStatement>

A complete transfer statement.

if specs is empty or any spec fails assertValidOutput.

if crypto.validateTransfer rejects the built statement (the error is propagated as-is).