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

# Cross-Chain Transfer (CCTP)

> Bridge USDC across chains using Circle's CCTP

The `cctp` sub-client enables cross-chain USDC transfers using Circle's Cross-Chain Transfer Protocol (CCTP). This allows GLAM vaults to bridge USDC between Solana and EVM chains.

## Bridge USDC (Outgoing)

Send USDC from the vault on Solana to a destination on another chain:

```typescript theme={null}
import { GlamClient } from "@glamsystems/glam-sdk";
import { PublicKey } from "@solana/web3.js";
import { BN } from "@coral-xyz/anchor";

const glamClient = new GlamClient();

const txSig = await glamClient.cctp.bridgeUsdc(
  new BN(1_000_000), // 1 USDC (6 decimals)
  0, // destination domain (0 = Ethereum)
  new PublicKey("EvmAddr1111111111111111111111111"), // destination address as PublicKey
  {
    maxFee: new BN(500_000), // max fee in USDC units
    minFinalityThreshold: 1000,
  },
);
```

### CCTP Domain IDs

| Domain ID | Chain     |
| --------- | --------- |
| 0         | Ethereum  |
| 1         | Avalanche |
| 2         | Optimism  |
| 3         | Arbitrum  |
| 5         | Solana    |
| 6         | Base      |
| 7         | Polygon   |

## Receive USDC (Incoming)

Receive USDC from another chain into the vault. You need either the source transaction hash or nonce:

```typescript theme={null}
// Receive using transaction hash
const txSig = await glamClient.cctp.receiveUsdc(
  0, // source domain (Ethereum)
  { txHash: "0xabc123..." },
);

// Receive using nonce
const txSig = await glamClient.cctp.receiveUsdc(
  0,
  { nonce: "0x..." },
);
```

## Query Bridge Events

### Outgoing Events

Get all Solana-to-EVM bridge events for the vault:

```typescript theme={null}
const events = await glamClient.cctp.getOutgoingBridgeEvents({
  commitment: "confirmed",
});

for (const event of events) {
  console.log(event.amount.toString(), event.destinationDomain, event.status);
}
```

### Incoming Events

Get all EVM-to-Solana bridge events for the vault:

```typescript theme={null}
const events = await glamClient.cctp.getIncomingBridgeEvents({
  commitment: "confirmed",
});
```
