Skip to main content
signGaslessDzapUserIntent produces an EIP-712 signature for a Fuse intent. The user pays no gas; the solver settles.

Three intent shapes

txTypeUse caseType set
swapSame-chain swapDzapUserIntentSwapTypes
bridgeCross-chain transfer (no swap)DzapUserIntentBridgeTypes
swapBridgeCross-chain swap + optional destination actionDzapUserIntentSwapBridgeTypes
The SDK picks the right type set when you pass txType.

End-to-end flow

import { DZapClient, signGaslessDzapUserIntent } from '@dzapio/sdk';
import { createWalletClient, http } from 'viem';
import { arbitrum } from 'viem/chains';

const dzap = DZapClient.getInstance();
const walletClient = createWalletClient({ account: '0xUser', chain: arbitrum, transport: http() });

// 1. Quote
const quote = await dzap.getZapQuote({
  srcChainId: 42161,
  destChainId: 8453,
  account: '0xUser',
  srcToken: '0xaf88...',
  destToken: '0x4200000000000000000000000000000000000006',
  amount: '100000000',
  recipient: '0xUser',
  refundee: '0xUser',
  slippage: 1,
});

// 2. Sign
const signature = await signGaslessDzapUserIntent({
  chainId: 42161,
  spender: dzap.getDZapContractAddress(42161),
  account: '0xUser',
  signer: walletClient,
  txType: 'swapBridge',
  txId: quote.txId,
  executorFeesHash: quote.executorFeesHash,
  swapDataHash: quote.swapDataHash,
  contractVersion: 'v1',
});

// 3. Submit
await fetch('https://zap.dzap.io/v1/execute', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ intent: quote, signature, txType: 'swapBridge' }),
});

// 4. Track
const status = await dzap.getZapTxnStatus({ txId: quote.txId });

Why hashes are bound at sign time

The intent message you sign includes executorFeesHash and swapDataHash. These are commitments — the solver can’t:
  • Inflate fees after you sign (the fee struct is hashed in)
  • Substitute a worse swap path (the calldata is hashed in)
If they try either, the on-chain verifier reverts the settlement.

Deadline

Every intent has a deadline (Unix seconds). Past the deadline, the signature is unusable — the solver simply can’t settle. Default is generally minutes-to-an-hour; it’s set at quote time. For non-gasless flow, see Zap.
Last modified on May 4, 2026