npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@circle-fin/provider-cctp-v2

v1.0.4

Published

Circle's official Cross-Chain Transfer Protocol v2 provider for native USDC bridging

Readme

CCTPv2 Bridging Provider

npm version TypeScript License Discord

Circle's Cross-Chain Transfer Protocol v2 provider for Bridge Kit

Native USDC bridging across 34 chains using Circle's battle-tested protocols.

Table of Contents

Overview

The CCTPv2 Bridging Provider is a strongly-typed implementation of Circle's Cross-Chain Transfer Protocol (CCTP) version 2 that enables native USDC bridging between 34+ supported blockchain networks.

While primarily designed to power the Bridge Kit, this provider can also be used directly in applications that need fine-grained control over the CCTP transfer process or want to integrate CCTP without the full Stablecoin Kits framework.

Why CCTPv2 Provider?

  • 🔒 Circle's official protocol: Uses Circle's native CCTP infrastructure for maximum security
  • ⚡ 34 chain support: Enables bridging across all CCTPv2-supported networks
  • 🎯 Native USDC: Bridges actual USDC tokens, not wrapped or synthetic versions
  • 🔧 Type-safe operations: Built with TypeScript strict mode and comprehensive validation
  • 🛠️ Direct integration: Use standalone or with custom orchestration logic

Installation

npm install @circle-fin/provider-cctp-v2
# or
yarn add @circle-fin/provider-cctp-v2

Note: This provider is included by default with the Bridge Kit. You can import this provider if you need to do a custom CCTP integration.

Quick Start

Option 1: With Bridge Kit (Recommended)

import { BridgeKit } from '@circle-fin/bridge-kit'

// Provider included by default
const kit = new BridgeKit()

const result = await kit.bridge({
  from: { adapter: sourceAdapter, chain: 'Ethereum' },
  to: { adapter: destAdapter, chain: 'Base' },
  amount: '100.50',
})

Option 2: Direct Provider Usage

import { CCTPV2BridgingProvider } from '@circle-fin/provider-cctp-v2'
import { ViemAdapter } from '@circle-fin/adapter-viem-v2'
import { createPublicClient, createWalletClient, http } from 'viem'
import { mainnet, base } from 'viem/chains'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount(process.env.PRIVATE_KEY)
const provider = new CCTPV2BridgingProvider()

// Create adapters
const sourceAdapter = new ViemAdapter({
  publicClient: createPublicClient({ chain: mainnet, transport: http() }),
  walletClient: createWalletClient({
    account,
    chain: mainnet,
    transport: http(),
  }),
})

const destAdapter = new ViemAdapter({
  publicClient: createPublicClient({ chain: base, transport: http() }),
  walletClient: createWalletClient({ account, chain: base, transport: http() }),
})

// Check route support
const isSupported = provider.supportsRoute('Ethereum', 'Base', 'USDC')

// Get bridge estimate
const estimate = await provider.estimate({
  from: { adapter: sourceAdapter, chain: 'Ethereum' },
  to: { adapter: destAdapter, chain: 'Base' },
  amount: '100.50',
  config: { transferSpeed: 'FAST' },
})

// Execute bridge operation with custom logic
const result = await provider.bridge({
  from: { adapter: sourceAdapter, chain: 'Ethereum' },
  to: { adapter: destAdapter, chain: 'Base' },
  amount: '100.50',
  config: { transferSpeed: 'FAST' },
})

Features

  • Native USDC bridging - Move real USDC between supported networks
  • CCTP v2 integration - Direct integration with Circle's CCTP v2 protocol
  • Comprehensive validation - Route validation and parameter checking
  • Multi-chain support - Works across all 34 CCTPv2-supported chains
  • Type safety - Full TypeScript support with detailed error handling
  • Bridge speeds - Support for both FAST and SLOW bridge configurations

Supported Chains & Routes

The provider supports 544 total bridge routes across these chains:

Mainnet Chains

Arbitrum, Avalanche, Base, Codex, Ethereum, HyperEVM, Ink, Linea, OP Mainnet, Plume, Polygon PoS, Sei, Solana, Sonic, Unichain, World Chain, XDC

Testnet Chains

Arbitrum Sepolia, Avalanche Fuji, Base Sepolia, Codex Testnet, Ethereum Sepolia, HyperEVM Testnet, Ink Testnet, Linea Sepolia, OP Sepolia, Plume Testnet, Polygon PoS Amoy, Sei Testnet, Solana Devnet, Sonic Testnet, Unichain Sepolia, World Chain Sepolia, XDC Apothem

Error Handling

The provider implements thoughtful error handling for different scenarios:

// Using the same kit and adapters from the examples above
const params = {
  from: { adapter: sourceAdapter, chain: 'Ethereum' },
  to: { adapter: destAdapter, chain: 'Base' },
  amount: '100.50',
}

try {
  const result = await kit.bridge(params)

  if (result.state === 'success') {
    console.log('Bridge completed successfully!')

    // Display explorer URLs for each step
    result.steps.forEach((step) => {
      if (step.explorerUrl) {
        console.log(`${step.name}: ${step.explorerUrl}`)
      }
    })
  } else {
    // Handle partial completion
    const successfulSteps = result.steps.filter((s) => s.state === 'success')
    const failedStep = result.steps.find((s) => s.state === 'error')

    console.log('Successful steps:', successfulSteps)
    console.log('Failed at:', failedStep)
  }
} catch (error) {
  // Handle validation or configuration errors
  console.error('Bridge failed:', error.message)
}

Bridge Process

The CCTPv2 provider handles the complete cross-chain bridging flow:

  1. Approval - Approve USDC spending (if needed)
  2. Burn - Burn USDC on source chain via depositForBurn
  3. Attestation - Fetch Circle's attestation for the burn
  4. Mint - Mint USDC on destination chain using attestation

Each step is tracked and can be monitored through the Provider's event system. Transaction details for each step include explorer URLs for easy verification on block explorers.

Integration with Bridge Kit

This provider is designed specifically for the Bridge Kit:

import { BridgeKit } from '@circle-fin/bridge-kit'
import { ViemAdapter } from '@circle-fin/adapter-viem-v2'
import { createPublicClient, createWalletClient, http } from 'viem'
import { mainnet, base } from 'viem/chains'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount(process.env.PRIVATE_KEY)

// Provider is included by default
const kit = new BridgeKit()

const sourceAdapter = new ViemAdapter({
  publicClient: createPublicClient({ chain: mainnet, transport: http() }),
  walletClient: createWalletClient({
    account,
    chain: mainnet,
    transport: http(),
  }),
})

const destAdapter = new ViemAdapter({
  publicClient: createPublicClient({ chain: base, transport: http() }),
  walletClient: createWalletClient({ account, chain: base, transport: http() }),
})

// Monitor transfer events
kit.on('*', (event) => console.log('Event:', event)) // subscribe to all events
kit.on('approve', (event) => console.log('Approval:', event.values.txHash))
kit.on('burn', (event) => console.log('Burn:', event.values.txHash))
kit.on('fetchAttestation', (event) =>
  console.log('Attestation:', event.values.data),
)
kit.on('mint', (event) => console.log('Mint:', event.values.txHash))

// Execute transfer
const result = await kit.bridge({
  from: { adapter: sourceAdapter, chain: 'Ethereum' },
  to: { adapter: destAdapter, chain: 'Base' },
  amount: '25.0',
})

Development

This package is part of the Stablecoin Kits monorepo.

# Build
nx build @circle-fin/provider-cctp-v2

# Test
nx test @circle-fin/provider-cctp-v2

License

This project is licensed under the Apache 2.0 License. Contact support for details.


Ready for cross-chain bridging?

Join DiscordVisit our Help-Desk

Built with ❤️ by Circle