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:155

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 appear in decoded.commitments. Without that binding a sender could attach a ciphertext claiming any fee value while the real commitment encodes something else (or is addressed elsewhere) — so the value is only trusted once its commitment is confirmed.

Parameters

decoded

DecodedTransact

broadcaster

ReceiverNoteKeys

tokenDataGetter

TokenDataGetter

chain?

Chain

expected?

tokenAddress?

`0x${string}`

minValue?

bigint

Returns

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