> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sending USDC across chains

> End-to-end pattern for moving USDC from one chain to another via the V3 quote API, quote, publish, track.

Sending USDC across chains is the most common Routes flow. This recipe walks through a server-side integration: get a quote, publish and fund the intent onchain using the `encodedRoute` from the quote, poll for fulfillment.

For an interactive CLI walkthrough instead, see the [Routes CLI guide](/routes/integrate/cli).

## 1. Get a quote

```bash theme={null}
curl -X POST https://quotes.eco.com/api/v3/quotes/single \
  -H "Content-Type: application/json" \
  -d '{
    "dAppID": "your-app",
    "quoteRequest": {
      "sourceChainID": 10,
      "destinationChainID": 8453,
      "sourceToken": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
      "destinationToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "sourceAmount": "1000000",
      "funder": "0xYourWalletAddress",
      "recipient": "0xRecipientAddress"
    }
  }'
```

The response includes `quoteResponse.encodedRoute`, `quoteResponse.deadline`, `contracts.sourcePortal`, and `contracts.prover`. That's everything you need to publish onchain.

## 2. Approve the reward token to the source Portal

```typescript theme={null}
import { erc20Abi } from 'viem';

const portal = quote.data.contracts.sourcePortal;
const rewardToken = quote.data.quoteResponse.sourceToken;
const rewardAmount = BigInt(quote.data.quoteResponse.sourceAmount);

const allowance = await publicClient.readContract({
  address: rewardToken,
  abi: erc20Abi,
  functionName: 'allowance',
  args: [user, portal],
});

if (allowance < rewardAmount) {
  await walletClient.writeContract({
    address: rewardToken,
    abi: erc20Abi,
    functionName: 'approve',
    args: [portal, rewardAmount],
  });
}
```

## 3. Publish and fund

Build the reward struct from the quote and call `publishAndFund` on the source Portal.

```typescript theme={null}
const reward = {
  deadline: BigInt(quote.data.quoteResponse.deadline),
  creator: user,
  prover: quote.data.contracts.prover,
  nativeAmount: 0n,
  tokens: [{ token: rewardToken, amount: rewardAmount }],
};

const tx = await walletClient.writeContract({
  address: portal,
  abi: portalAbi,
  functionName: 'publishAndFund',
  args: [
    BigInt(quote.data.quoteResponse.destinationChainID),
    quote.data.quoteResponse.encodedRoute,
    reward,
    false, // allowPartial
  ],
});

const receipt = await publicClient.waitForTransactionReceipt({ hash: tx });
// Read the IntentPublished event from the receipt logs to get intentHash
```

## 4. Track fulfillment

```bash theme={null}
curl -X POST https://quotes.eco.com/api/v3/intents/intentStatus \
  -H "Content-Type: application/json" \
  -d '{ "intentHash": "0x..." }'
```

Status returns `{ status: "Pending" | "Completed", subStatus: "WaitingToFulfill" | "WaitingForRefund" | "Fulfilled" | "Refunded", subStatusMessage }`. Typical fulfillment: **20–40 seconds**.

You've successfully sent USDC across chains.
