Nothing here gives DZap open-ended access to funds. The intent signature is bound to a single
txId, carries a deadline, and is consumed by a per-user nonce, so it cannot be replayed.Setup
- Swap
- Bridge
A gasless same-chain swap on Arbitrum: 5 USDC to WETH, with 0 ETH in the wallet.
Steps
The gasless path is quote, sign a permit, execute, and confirm.tradeGasless() does the whole tail in one call: it builds the transaction, collects the intent signature from the wallet, and submits it to DZap. These steps use the EIP-2612 permit mode, the one that works for a wallet with zero native balance. Allowance and Permit2 are in Authorization modes.
- Swap
- Bridge
1
Quote
Pass
gasless: true. The returned destAmount is already net of the relayer’s gas.Confirm the source token supports EIP-2612 permits before offering the zero-gas path: quotes don’t check this. See Fees & limits for the
$1 per-pair minimum and the End-to-end tab for the pre-flight check.2
Sign the permit
Sign an EIP-2612 permit for the source token. This is off-chain, so it costs zero gas.
Signing an EIP-2612 permit for a token that does not implement it throws. If
permit.eip2612.supported is false for your token, use allowance or Permit2 mode from Authorization modes.3
Execute
Feed the permit back in as
permitData and call tradeGasless(). It builds the transaction, prompts the user to sign the intent, and submits it to DZap.DZap pays gas and deducts the equivalent from the output in the source token. Call
buildTradeTxn({ ...request }) first only to preview the authoritative fees.executorFee. Full request shape: Execute trade.4
Status
tradeGasless() resolves with the hash DZap submitted. Track it like a regular trade.status.gasless is true. Same-chain gasless swaps settle fast; terminal states are COMPLETED, FAILED, PARTIAL, and REFUNDED. See Track trade status.End-to-end
- Swap
- Bridge
API usage
The REST flow is the same sequencetradeGasless() performs. Unlike a regular trade, the gasless build returns a set of hashes you must sign as an EIP-712 intent, so the sign step is client-side code, not a curl.
- Swap
- Bridge
1
Quote
Send
gasless: true. Pick a route’s recommendedSource.2
Build
The gasless build returns the hashes to sign, not raw calldata.
fees.executorFee is the authoritative fee.Build response (trimmed)
3
Sign the intent (EIP-712)
Read the user’s nonce from the router, then sign a
SignedGasLessSwapData intent over the hashes from the build response.4
Execute
Submit the signed intent. The The response carries
permit object carries the token permit plus the intent signature, nonce, and deadline.status and the txnHash DZap submitted.5
Status
Fees and limits
The gasless fee is charged in the source token and deducted from what the user receives. The quote returns an estimate; the build returns the authoritative number.
Show the quote’s
protocolFee while the user is still choosing, and re-read executorFee from the build for the confirmation screen. Both carry the same shape:
Fee entry
amount is in the source token’s smallest unit; amountUSD is the same fee in dollars. included: true means it is already reflected in the quoted output, so do not subtract it again.
Minimum trade size. The fee has to be covered by the trade, so the API enforces a $1 minimum per pair. Below it, the pair returns an explicit error instead of routes. Branch on status/message rather than inferring the floor from an empty route list, the threshold is server-side and moves with gas prices.
If
supportsPermit is false, the token can’t use the EIP-2612 path, so fall back to allowance or Permit2 mode (Authorization modes). In a multi-token trade every srcToken must qualify, and the gasless fee is split across tokens proportionally to their USD value.Authorization modes
DZap can only move the source token if it is authorized to. The steps above use EIP-2612 permit, the only mode that works for a wallet with zero native balance. The other two need one on-chain approval first, after which every gasless trade is a single intent signature.
For allowance mode, run
getAllowance / approve with ApprovalModes.Default once, then call tradeGasless() with no permitData. For Permit2, approve with ApprovalModes.PermitBatchWitnessTransferFrom, then call tradeGasless() with hasPermit2ApprovalForAllTokens: true. Details: Check allowance and Approval mechanisms.
sign() takes a PermitTypes value (a signature scheme). approve() and getAllowance() take an ApprovalModes value (an on-chain approval target: Default is the router, anything else is Permit2). ApprovalModes has no EIP2612Permit member because an EIP-2612 permit is a signature and never approves anything on-chain.Reference
Endpoints
Base URLs:
https://api.dzap.io (production), https://staging.dzap.io (staging). Send your API key as the x-api-key header, see Rate Limits for the unauthenticated caps.