@umbra-privacy/sdk/burn.
getBurnableStealthPoolNoteScannerFunction
Import:@umbra-privacy/sdk/burn
client.utxoDataStore, fetches missing ranges from the indexer, decrypts ciphertexts addressable by your viewing keys, persists progress, and returns the result grouped by (kind, source).
client.indexerApiEndpoint must be set (pass it to getUmbraClient).
Deps
fetchStealthPoolNoteData?: StealthPoolNoteDataFetcherFunction— override the default indexer note-data fetcher.fetchMerkleProof?: MerkleProofFetcherFunction— override the single-leaf Merkle proof fetcher used internally for sanity checks. The burner factory uses its ownfetchBatchMerkleProofdep at submit time.aesDecryptor?: AesDecryptorFunction— override the AES-GCM decryptor used to decode receiver-burnable note ciphertexts.x25519GetPublicKey?/x25519GetSharedSecret?— override X25519 ECDH primitives.additionalX25519PrivateKeys?: readonly X25519PrivateKey[]— multi-key wallets can scan against extra X25519 keys.
Returns
ScannedStealthPoolNoteResult
Errors
ThrowsFetchUtxosError (named with the legacy noun; class name retained for backwards compatibility — the error itself covers V18 Stealth Pool Note scanning). See Errors.
Example
getReceiverBurnableStealthPoolNoteIntoETABurnerFunction
Import:@umbra-privacy/sdk/burn
destinationAddress, chunks to ≤5 per proof.
Required deps
fetchBatchMerkleProof— typicallyclient.fetchBatchMerkleProof(auto-wired whenindexerApiEndpointis set on the client).zkProver—getClaimReceiverClaimableUtxoIntoEncryptedBalanceProver()from@umbra-privacy/sdk/zk-prover. (The interface type is aliased internally asIZkProverForBurnReceiverBurnableStealthPoolNoteIntoEncryptedTokenAccount— the underlying type is identical.)relayer— adapter built fromgetUmbraRelayer({ apiEndpoint }).BurnSubmitterFunctionandBurnStatusPollerFunctionare V18 TypeScript aliases ofClaimSubmitterFunctionandClaimStatusPollerFunction, so the relayer client’ssubmitClaim/pollClaimStatusplug in directly under the renamed property names.
Returns
completed / callback_received indicate success. The signature to display is callbackSignature ?? txSignature. failureReason containing "NullifierAlreadyBurnt" means the note was already burnt — the SDK treats this as idempotent success.
Errors
ThrowsClaimUtxoError. See Errors. The "transaction-validate" stage often indicates a stale Merkle proof — the burner refetches on retry.
getSelfBurnableStealthPoolNoteIntoETABurnerFunction
Import:@umbra-privacy/sdk/burn
Same shape as the receiver variant. MAX_NOTES_PER_PROOF = 1 — the SDK loops internally; caller still passes an array. zkProver is IZkProverForClaimSelfClaimableUtxoIntoEncryptedBalance — use getClaimSelfClaimableUtxoIntoEncryptedBalanceProver from @umbra-privacy/sdk/zk-prover.
getSelfBurnableStealthPoolNoteIntoATABurnerFunction
Import:@umbra-privacy/sdk/burn
Same shape; tokens released to the destination ATA instead of an ETA. zkProver is IZkProverForClaimSelfClaimableUtxoIntoPublicBalance — use getClaimSelfClaimableUtxoIntoPublicBalanceProver from @umbra-privacy/sdk/zk-prover.
Receiver-burnable → ATA exists on-chain but is not yet shipped in the SDK. Use receiver-burnable → ETA then a regular withdrawal until the SDK adds the direct path.
Full scan + burn example
FetchUtxosError
Thrown bygetBurnableStealthPoolNoteScannerFunction.
Stage values: "initialization" | "validation" | "key-derivation" | "indexer-fetch" | "proof-fetch" | "proof-enrichment".
See Errors.
ClaimUtxoError
Thrown by all burner factories. Stage values:"initialization" | "validation" | "key-derivation" | "zk-proof-generation" | "pda-derivation" | "instruction-build" | "transaction-build" | "transaction-compile" | "transaction-sign" | "transaction-validate" | "transaction-send".
See Errors. Before retrying after "transaction-send", verify on-chain — the nullifier may have been burnt. The burner itself treats NullifierAlreadyBurnt as idempotent success in BurnBatchOutcome.failureReason.