decryptOwnedUtxo
decryptOwnedUtxo(
crypto,viewSecret,substate,substateId):Promise<DecryptedData|null>
Defined in: ootle/src/stealth/wallet-helpers.ts:70
The recipient owner-read: try to decrypt a fetched UTXO substate with a view secret.
Parses the substate (commitment from the id, public_nonce + encrypted_data from
the body), derives the AEAD key, and unblinds. Returns the DecryptedData for
an owned UTXO, or null when the substate is not a live stealth UTXO or the
decrypt throws (the “not ours” signal). This lets a recipient scan many substates in
a loop without a try/catch at each call site.
Parameters
Section titled “Parameters”crypto
Section titled “crypto”The crypto seam (real WASM or a fake).
viewSecret
Section titled “viewSecret”Uint8Array
The recipient’s 32-byte view secret.
substate
Section titled “substate”IndexerGetSubstateResponse
The fetched substate response.
substateId
Section titled “substateId”string
The substate id the response was fetched by (source of the commitment).
Returns
Section titled “Returns”Promise<DecryptedData | null>
The decrypted output if owned, else null.