Skip to main content

Documentation Index

Fetch the complete documentation index at: https://eco.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

This recipe walks through the cleanest gasless funding path Eco supports today: a user signs an ERC-3009 transferWithAuthorization; Eco’s relayer broadcasts; USDC lands in the user’s Circle Gateway balance on Polygon.

When to use

  • Onboarding flows where users don’t yet hold the source chain’s gas token
  • Nanopayment / micro-deposit flows where gas would dominate the value transferred
  • Any flow where the UX win of “no gas” beats the marginal latency

1. Register the deposit address

Same call as Solana — pick the Gateway endpoint variant:
curl -X POST https://deposit-addresses.eco.com/api/v1/depositAddresses/gateway/polygon \
  -H "Content-Type: application/json" \
  -d '{
    "chainId": 8453,
    "depositor": "0xUserWallet",
    "evmDestinationAddress": "0xRecipientOnGateway"
  }'
Returns evmDepositAddress deterministically. Address is shareable before deployment.

2. Have the user sign an ERC-3009 authorization

USDC’s EIP-712 domain name varies per chain — "USDC" on Base Sepolia, "USD Coin" elsewhere. Use the right one.
import { parseUnits, toHex } from 'viem';

const value = parseUnits('100', 6);
const nonce = toHex(crypto.getRandomValues(new Uint8Array(32)));
const validBefore = String(Math.floor(Date.now() / 1000) + 3600);

const signature = await signTypedDataAsync({
  domain: { name: 'USD Coin', version: '2', chainId, verifyingContract: USDC_ADDRESS },
  types: {
    TransferWithAuthorization: [
      { name: 'from', type: 'address' },
      { name: 'to', type: 'address' },
      { name: 'value', type: 'uint256' },
      { name: 'validAfter', type: 'uint256' },
      { name: 'validBefore', type: 'uint256' },
      { name: 'nonce', type: 'bytes32' },
    ],
  },
  primaryType: 'TransferWithAuthorization',
  message: { from: owner, to: evmDepositAddress, value, validAfter: 0n, validBefore: BigInt(validBefore), nonce },
});

3. Submit the signed authorization

curl -X POST https://deposit-addresses.eco.com/api/v1/gasless/transferWithAuthorization \
  -H "Content-Type: application/json" \
  -d '{
    "chainId": 8453,
    "from": "0xSigner",
    "to": "0xDepositAddress",
    "value": "100000000",
    "validAfter": "0",
    "validBefore": "1717200000",
    "nonce": "0x...",
    "signature": "0x..."
  }'
Returns 202 Accepted with { id, status: "PENDING" }.

4. Poll the job

curl https://deposit-addresses.eco.com/api/v1/gasless/jobs/<id>
Status transitions: PENDINGCOMPLETED (or FAILED). Response includes transferTxHash and intentHash once complete. End-to-end (Base Sepolia → Polygon Amoy): typically 20–40 seconds.

What the user paid

Nothing on-chain. Eco’s deposit-address service paid source-chain gas; Eco’s solver service paid Polygon-side gas. You’ve successfully completed a gasless deposit into Gateway.