Skip to content

@armada/sdk / index / extractFeeOutput

Function: extractFeeOutput() ​

extractFeeOutput(decoded, broadcaster, tokenDataGetter, chain?, expected?): Promise<{ tokenAddress: `0x${string}`; value: bigint; } | undefined>

Defined in: src/tx/decode.ts:158

Recover the in-band fee note addressed to broadcaster from a decoded transaction, or undefined if none. Trial-decrypts each output ciphertext with the broadcaster identity, then BINDS the result: the decrypted note's commitment hash must equal the commitment at the SAME index as its ciphertext (commitmentCiphertexts[i] ↔ commitments[i]). Without that binding a sender could attach a ciphertext claiming any fee value while the real commitment encodes something else (or is addressed elsewhere) — and the index matters because the broadcaster's own scanner pairs them by index: a fee note whose ciphertext sits at another commitment's index is never discovered, so the relayer would never be paid.

Parameters ​

decoded ​

DecodedTransact

broadcaster ​

ReceiverNoteKeys

tokenDataGetter ​

TokenDataGetter

chain? ​

Chain

expected? ​

tokenAddress? ​

`0x${string}`

minValue? ​

bigint

Returns ​

Promise<{ tokenAddress: `0x${string}`; value: bigint; } | undefined>