Prerequisites
Before you begin, ensure that you’ve:- Installed Node.js v18+ and npm.
- Obtained a Circle API Key and Entity Secret from the Circle Developer Console.
- Created an Ethereum Sepolia wallet and Solana Devnet wallet.
Step 1. Set up the project
This step shows you how to prepare your project and environment.1.1. Set up your development environment
Create a new directory and install Bridge Kit with the Circle Wallets adapter and supporting tools:Shell
1.2. Initialize and configure the project
First, initialize the project. This command creates atsconfig.json file:
Shell
tsconfig.json file:
Shell
1.3. Configure environment variables
Create a.env file in the project directory with your Circle credentials and
wallet addresses, replacing these placeholders with your value:
CIRCLE_API_KEY: your API key should be either environment-prefixed (for example,TEST_API_KEY:abc123:def456orLIVE_API_KEY:xyz:uvw) or base64-encoded strings.YOUR_ENTITY_SECRET: your entity secret should be 64 lowercase alphanumeric characters.YOUR_EVM_WALLET_ADDRESSandYOUR_SOLANA_WALLET_ADDRESSare the wallet addresses you control through Circle Wallets. You can fetch the addresses from the Circle Developer Console or the list wallets endpoint.
Shell
1.4. Fund your wallets (optional)
For this quickstart, you need USDC and native tokens in your Ethereum testnet wallet and native tokens in your Solana testnet wallet. If you need USDC testnet tokens, use the Circle Faucet to get 1 USDC on the Ethereum Sepolia and Solana Devnet testnets. If you need testnet native tokens, use the Circle Console Faucet. For more information about the faucets, see Testnet Faucets.Step 2. Bridge USDC
This step shows you how to set up your script, execute the bridge transfer, and check the result.2.1. Create the script
Create anindex.ts file in the project directory and add the following code.
This code sets up your script and transfers 1 USDC from Ethereum Sepolia to
Solana Devnet.
Typescript
from and to
contexts in the bridge call.
2.2. Run the script
Save theindex.ts file and run the script in your terminal:
2.3. Verify the transfer
After the script finishes, find the returnedsteps array in the terminal
output. Each transaction step includes an explorerUrl. Use that link to verify
that the USDC amount matches the amount you transferred.
The following code is an example of how an approve step might look in the
terminal output. The values are used in this example only and are not a real
transaction:
Shell