Skip to main content
Gasless Fuse uses EIP-712 signatures instead of on-chain transactions. The user signs an intent off-chain; a solver pays the gas to settle.

When it works

Gasless requires:
  • The source token supports Permit2 or EIP-2612 permit (most major tokens do).
  • The user has a balance ≥ intent amount (no transfer happens until settlement).
  • The intent’s deadline hasn’t passed.
If the token has neither permit method, fall back to standard zap() (user pays gas).

SDK 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. Get quote (returns intent body + hashes)
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 the intent (no gas)
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 signature + intent to the relay
await fetch('https://zap.dzap.io/v1/bundle', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    intent: quote,
    signature,
  }),
});

Three intent types

txTypeUse when
swapSame-chain swap
bridgeCross-chain transfer, no swap
swapBridgeCross-chain swap (or swap on destination)
The SDK picks the right EIP-712 type set for you (DzapUserIntentSwapTypes, DzapUserIntentBridgeTypes, DzapUserIntentSwapBridgeTypes).

Why executorFeesHash and swapDataHash?

Both are committed at signature time. 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 the solver tries either, the on-chain verifier reverts.

When gasless isn’t right

  • High-value swaps — solvers may demand a wider spread for big intents; check the quote’s effective rate.
  • Tokens without permit support — falls back to a standard approval; not gasless.
  • You want immediate finality — gasless intents settle when a solver picks them up. Usually fast, but not synchronous.
For the non-gasless flow, see Bundle.
Last modified on May 4, 2026