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 method | Description | Use case |
|---|
| Standard | Standard 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 RPC | Private key setup that lets you configure an RPC endpoint. | Production deployments that require reliable RPC providers. |
| Browser wallet | Uses 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.
This code block initializes the Viem adapter to transfer tokens between
EVM-compatible chains:import { createAdapterFromPrivateKey } from "@circle-fin/adapter-viem-v2";
const adapter = createAdapterFromPrivateKey({
privateKey: process.env.PRIVATE_KEY as string,
});
This code block initializes the Ethers adapter to transfer tokens between
EVM-compatible chains:import { createAdapterFromPrivateKey } from "@circle-fin/adapter-ethers-v6";
const adapter = createAdapterFromPrivateKey({
privateKey: process.env.PRIVATE_KEY as string,
});
This code block initializes the Solana adapter to bridge on Solana:import { createAdapterFromPrivateKey } from "@circle-fin/adapter-solana";
// Solana accepts Base58, Base64, or JSON array format private keys
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.
To use your own connection, replace the default one and add your custom RPC
endpoint. This example uses an Alchemy connection: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,
},
),
}),
});
To use your own connection, replace the default one and add your custom RPC
endpoint. This example uses an Alchemy connection:import { createAdapterFromPrivateKey } from "@circle-fin/adapter-ethers-v6";
import { JsonRpcProvider } from "ethers";
// Create an adapter
const adapter = createAdapterFromPrivateKey({
privateKey: process.env.PRIVATE_KEY as string,
// Replace the default connection
getProvider: ({ chain }) =>
// Use an Alchemy connection
new JsonRpcProvider(
`https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY_KEY}`,
),
});
To use your own connection, create a custom connection to your RPC endpoint.
Point to that connection when making a Solana adapter. This example creates a
custom connection using Alchemy:import { createAdapterFromPrivateKey } from "@circle-fin/adapter-solana";
import { Connection } from "@solana/web3.js";
// Create a connection to an Alchemy endpoint
const customConnection = new Connection(
`https://solana-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_KEY}`,
{
commitment: "confirmed",
wsEndpoint: `wss://solana-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_KEY}`,
},
);
// Create a Solana adapter
const adapter = createAdapterFromPrivateKey({
privateKey: process.env.SOLANA_PRIVATE_KEY as string,
connection: customConnection,
});
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.
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 = await createAdapterFromProvider({
provider: window.ethereum as EIP1193Provider,
});
import { createAdapterFromProvider } from "@circle-fin/adapter-ethers-v6";
import { MetaMaskInpageProvider } from "@metamask/providers";
import { EIP1193Provider } from "ethers";
declare global {
interface Window {
ethereum?: MetaMaskInpageProvider;
}
}
const adapter = await createAdapterFromProvider({
provider: window.ethereum as EIP1193Provider,
});
import {
createAdapterFromProvider,
CreateAdapterFromProviderParams,
} from "@circle-fin/adapter-solana";
declare global {
interface Window {
solana?: CreateAdapterFromProviderParams["provider"];
}
}
if (window.solana) {
const adapter = await createAdapterFromProvider({
provider: window.solana,
});
}
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:
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
});