The underlying signing utility (
signGaslessDzapUserIntent) is internal and not exported from @dzapio/sdk. Use the high-level tradeGasless() method below — it handles building, signing, and submission for you.tradeGasless()
gasless: true on the request. tradeGasless() will:
- Build the transaction via
POST /v1/buildTx(unless you pass pre-builttxnData) — this returns aGaslessTradeBuildTxnResponsewith a typed-data payload to sign. - Prompt the signer for an EIP-712 signature over that payload (EIP-2612 permit, or a batch Permit2 signature if
request.hasPermit2ApprovalForAllTokensis set). - Submit the signed permit to
POST /v1/gasless/executeTxfor the relay to execute. - Optionally call
txnStatusCallbackwithTxnStatus.waitingForExecutiononce the signature is submitted.
Why the hashes matter
The build response’s typed-data payload commits toexecutorFeesHash and (for swaps) swapDataHash — the relay can’t inflate fees or substitute a worse route after you sign, because those values are hashed into the signed message. If either is tampered with, on-chain verification reverts.