Skip to content

hashOrderRef

hashOrderRef(params): `0x${string}`

Defined in: src/settlement/order-hash.ts:168

ref — the order reference, computed exactly the way Settlement.orderRef computes it on chain: an EIP-712 digest under the domain KawasekitSettlement / 1 / chainId / settlement.

The chain id and the deployment are part of the domain, so a reference cannot be replayed on another chain or against another version of the contract.

Parameters

params

HashOrderRefParams

Returns

`0x${string}`

Example

import { getJpycAddress, getSettlementAddress, hashOrderRef, polygonAmoy } from "kawasekit";
const ref = hashOrderRef({
chainId: polygonAmoy.id,
settlement: getSettlementAddress(polygonAmoy.id),
order: { token: getJpycAddress(polygonAmoy.id), payer, merchant, amount, validUntil, details },
});