@lelantos-org/sdk / protocol / swapIntentHash
Function: swapIntentHash()
function swapIntentHash(swap): bigint;Defined in: @lelantos-org/sdk/dist/protocol/abi-hash.d.ts:87
PubInputs.Transact.intentHash for a swap's withdraw leg: uint256(keccak256(abi.encode(refundTo, tokenOut, minOut, adapter, deadline, deposit_d, aux_d, fee_aux_d, refund_d, refund_aux_d, refund_fee_aux_d))) mod r. Mirrors SwapWrapper._intentHash; swap reverts IntentMismatch when the proof's word differs.
Takes the swap blob, so the hash is computed from the values the relayer is asked to submit. It covers every field the submitter could otherwise rewrite: the output and refund notes, their payloads, the slippage floor, the venue, the expiry and the refund owner of a cancelled escrow. tokenIn, amountIn and route are not covered: the withdraw leg pins what is spent, and for any route the wrapper holds the output to minOut.
Reduced mod r because the word is a circuit field element; the contract reduces the same way before comparing.
Addresses go through abiAddress because adapter and tokenOut arrive from the quoter and the registry in arbitrary case.
Parameters
| Parameter | Type |
|---|---|
swap | Pick<SwapBlob, | "refundTo" | "tokenOut" | "minOut" | "adapter" | "deadline" | "depositD" | "auxD" | "feeAuxD" | "refundD" | "refundAuxD" | "refundFeeAuxD"> |
Returns
bigint