Skip to main content
Bridge Kit supports these adapter types:
  • Chain client adapters abstract away the complexity of different blockchain architectures. Each adapter manages blockchain-specific bridging operations.
  • The Circle Wallet adapter is available if you already use Circle’s developer-controlled wallets. It uses your Circle Wallets account to let you transfer between supported blockchains.

Chain client adapter setups

Bridge Kit works with these client adapter libraries:
  • viem v2 for EVM-compatible blockchains
  • ethers v6 for EVM-compatible blockchains
  • solana for the Solana blockchain
You only need to set up with one EVM adapter, either Viem or Ethers. Add the Solana adapter to your setup only if you plan to transfer to or from Solana. The following table shows ways to set up chain client adapters and when to use each setup.
Setup methodDescriptionUse case
StandardStandard setup that creates an adapter from a private wallet key. Uses default built-in public RPC endpoints and factory functions.Testing environments that need a quick start without custom RPC configuration.
Custom RPCPrivate key setup that lets you configure an RPC endpoint.Production deployments that require reliable RPC providers.
Browser walletUses an injected wallet provider, such as MetaMask or Phantom, to create an adapter in the browser.Browser-based apps that rely on user wallet providers.

Standard setup

This setup is the fastest way to start. Create one adapter from your wallet private key to transfer tokens between EVM-compatible blockchains. Add the Solana adapter to transfer tokens to or from Solana. This setup uses public RPC endpoints and factory functions. For production, you should configure a custom RPC. Public connections have rate limits and might be slow. Select the tab to see code examples for your adapter choice.
  • Viem
  • Ethers
  • Solana
This code block initializes the Viem adapter to transfer tokens between EVM-compatible chains:
TypeScript
import { createAdapterFromPrivateKey } from "@circle-fin/adapter-viem-v2";

const adapter = createAdapterFromPrivateKey({
  privateKey: process.env.PRIVATE_KEY as string,
});

Custom RPC

You can replace the public RPC from the standard setup with your own connection. For production, you should use a paid service like Alchemy or QuickNode. These services are more reliable than free connections. The following code shows how to set up your own RPC. Pick your adapter to see the code.
  • Viem
  • Ethers
  • Solana
To use your own connection, replace the default one and add your custom RPC endpoint. This example uses an Alchemy connection:
TypeScript
import { createAdapterFromPrivateKey } from "@circle-fin/adapter-viem-v2";
import { createPublicClient, http } from "viem";

// Create an adapter
const adapter = createAdapterFromPrivateKey({
  privateKey: process.env.PRIVATE_KEY as string,
  // Replace the default connection
  getPublicClient: ({ chain }) =>
    createPublicClient({
      chain,
      // Use an Alchemy connection
      transport: http(
        `https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY_KEY}`,
        {
          retryCount: 3,
          timeout: 10000,
        }
      ),
    }),
});

Browser wallet

You can create an adapter from browser wallet apps like MetaMask or Phantom. The following code creates an adapter from a MetaMask wallet. Pick your adapter to see the code.
  • Viem
  • Ethers
  • Solana
TypeScript
import { createAdapterFromProvider } from "@circle-fin/adapter-viem-v2";
import { MetaMaskInpageProvider } from "@metamask/providers";
import { EIP1193Provider } from "viem";

declare global {
  interface Window {
    ethereum?: MetaMaskInpageProvider;
  }
}

const adapter = createAdapterFromProvider({
  provider: window.ethereum as EIP1193Provider,
});

Circle Wallets adapter setup

Note: This adapter is for server-side applications only. It requires private keys and entity secrets that must never be exposed to browsers.
You can use the Circle Wallets adapter if you already manage wallets through Circle. Suited for enterprise and backend applications, it uses Circle’s developer-controlled wallets and Circle Contracts so you can transfer between supported blockchains without managing private keys yourself. The Circle Wallets adapter requires a Circle API Key and Entity Secret obtained from the Circle Developer Console. API Key format:
  • Environment-prefixed: TEST_API_KEY:abc123:def456 or LIVE_API_KEY:xyz:uvw
  • Base64 encoded: standard Base64 string
Entity Secret format:
  • 64 lowercase alphanumeric characters
This code block initializes the Circle Wallets adapter:
Typescript
import { createCircleWalletsAdapter } from "@circle-fin/adapter-circle-wallets";

// Initialize adapter with Circle credentials (server-side only)
const adapter = createCircleWalletsAdapter({
  apiKey: process.env.CIRCLE_API_KEY!, // Format: TEST_API_KEY:abc:def or Base64
  entitySecret: process.env.CIRCLE_ENTITY_SECRET!, // Format: 64 lowercase alphanumeric chars
});