Skip to main content
Use Eco’s gasless deposit flow to move 1 testnet USDC from Base Sepolia into Circle Gateway without holding ETH on the source blockchain. This quickstart shows a TypeScript script that requests an Eco deposit address, signs an EIP-3009 authorization, submits the deposit, and checks your Gateway balance on Polygon PoS Amoy.
Eco is a third-party fast-deposit service. Circle names Eco as an option for faster Gateway deposits in current docs, but Circle does not operate or audit Eco’s service. Review Eco’s docs and test the flow before you use it in production.
This quickstart uses Base Sepolia as the source blockchain and Polygon PoS Amoy (Gateway domain ID 7) as the destination. You sign an EIP-3009 TransferWithAuthorization payload locally, and Eco submits the transfer onchain. You still need USDC in your wallet, but you do not need ETH on Base Sepolia for the deposit. For other deposit methods and Eco-specific routing details, see the Eco Gateway Deposits guide.

Prerequisites

Before you begin, ensure you have:
  • Installed Node.js v22.6+
  • Obtained a private key for a Base Sepolia EOA
  • Funded your wallet with testnet USDC from the Circle Faucet (select Base Sepolia)
Base Sepolia network details
You do not need ETH on Base Sepolia for this gasless deposit flow.

Step 1. Set up your project

1.1. Create the project and install dependencies

1.2. Configure TypeScript (optional)

This step is optional. It helps prevent missing types in your IDE or editor.
Create a tsconfig.json file:
Then, update the tsconfig.json file:

1.3. Set environment variables

Open .env in your editor and add:
  • PRIVATE_KEY is the private key for the Base Sepolia EOA that holds the testnet USDC you want to deposit.
  • Include the 0x prefix. MetaMask often copies the private key as bare hex, but this script expects a hex string with the prefix.
Open .env in your editor rather than writing values with shell commands, and add .env to your .gitignore. This prevents credentials from leaking into your shell history or version control.
The npm run start command loads variables from .env using Node.js native env-file support.
This example uses one or more private keys for local testing. In production, use a secure key management solution and never expose or share private keys.
Steps 2 through 6 show individual parts of the flow. Each snippet highlights one stage and is not independently runnable. Use the full script in Full deposit script to run the quickstart end to end.

Step 2. Request an Eco deposit address

Request a deterministic Eco deposit address for Gateway on Polygon PoS Amoy.
The returned depositAddress is a reusable address for this depositor and destination combination.

Step 3. Generate EIP-3009 authorization

Create the authorization parameters. EIP-3009 uses a TransferWithAuthorization signed message to let a third party (Eco) submit the transfer on your behalf. For a deeper explanation of the signing flow, see EIP-3009 signing.
Sign the TransferWithAuthorization payload:
For this Base Sepolia flow, the EIP-712 domain name is USDC, not USD Coin.

Step 4. Submit the gasless deposit to Eco

Submit the signed authorization:
Eco returns a jobId you can poll until the deposit completes or fails.

Step 5. Wait for the deposit to complete

Poll the job status endpoint:

Step 6. Check your Gateway balance

After the job completes, query the Gateway balances endpoint:
The current Gateway balances API returns balance as a decimal USDC string for this flow.

Full deposit script

This script requests the Eco deposit address, signs the EIP-3009 payload, submits the gasless deposit, waits for completion, and prints the resulting Gateway balance. Save it as eco-deposit.ts.
Run the script:
For withdrawal and crosschain transfer capabilities, see the Gateway documentation. To use your Gateway balance for Gateway-based USDC flows, explore the Arc Nanopayments Demo.