- Browser wallet
- Circle Wallets
Use this flow to deposit and spend a Unified Balance with connected browser
wallets. The examples use Base Sepolia, Solana Devnet, and Arc Testnet.Create a Then, update the 2.1. Discover a browser wallet with
You’ll see output like:You’ll see output like:You’ll see output like:After a deposit, funds can appear in When the spend completes, you should see output similar to:
Prerequisites
Before you begin, ensure that you’ve:- Installed Node.js v22+.
- Created an EVM wallet using a wallet provider such as MetaMask and added the Base Sepolia and Arc Testnet networks.
- Created a Solana wallet (for example, Phantom or Solflare) on Devnet.
- Funded your wallets with testnet tokens:
- Get testnet USDC from the Circle Faucet on Base Sepolia and Solana Devnet.
- Get testnet ETH on Base Sepolia from a public faucet (needed for deposit and spend transactions on Base Sepolia).
- Get SOL for Solana Devnet from the Solana Faucet.
- Fund the connected EVM wallet on Arc Testnet if needed (USDC on Arc can cover gas for the destination credit when you spend on Arc).
- Obtained an Arc Testnet address that will receive USDC when you spend on Arc Testnet.
Step 1. Set up the project
1.1. Create the project and install dependencies
Create a new directory, install the App Kit packages, and add local browser demo tooling:Shell
1.2. Configure TypeScript (optional)
This step is optional. It helps prevent missing types in your IDE or editor.
tsconfig.json file:Shell
tsconfig.json file:Shell
Step 2. Connect browser wallets
This step shows the core browser wallet integration flow: discover anEIP-6963 provider, create App Kit
adapters from the selected providers, and pass those adapters into App Kit SDK
methods.The snippets below keep wallet discovery, wallet connection, and adapter setup
in small helper functions for readability.2.1. Discover a browser wallet with EIP-6963
This pattern is standards-based. The example uses MetaMask as the selected
wallet, but the discovery flow works with any wallet that announces an
EIP-6963 provider.TypeScript
2.2. Connect the wallet and request account access
After you select a provider, request account access before calling an App Kit SDK method. This should happen in a user-triggered action such as aConnect wallet button.TypeScript
2.3. Create an EVM adapter for Unified Balance
This quickstart uses adapter-only balance checks and spend sources so the SDK can choose source blockchains automatically. Configure the EVM adapter with the EVM chains used in this flow so automatic allocation has chain context for balance discovery.TypeScript
2.4. Connect the Solana wallet and create a Solana adapter
This pattern assumes a Solana browser wallet that exposes
window.solana. Keep
wallet connection and App Kit actions as separate user actions so the wallet is
fully connected before you call an App Kit SDK method.TypeScript
Step 3. Deposit into a Unified Balance
In this step, you’ll deposit from Base Sepolia and Solana Devnet. The EVM deposit uses the EVM browser wallet adapter from the previous step. The Solana deposit uses the Solana browser wallet adapter from the previous step.The examples in the remaining steps reuse the samekit instance and Adapter
type.3.1. Deposit from Base Sepolia
Callkit.unifiedBalance.deposit with the connected EVM browser wallet adapter.
Before the deposit, switch the browser wallet to Base Sepolia so the deposit
authorization is signed on the source chain:TypeScript
Shell
3.2. Deposit from Solana Devnet
Callkit.unifiedBalance.deposit with the Solana browser wallet adapter:TypeScript
Shell
3.3. Verify the deposits
Open theexplorerUrl from each deposit result and confirm the onchain
transactions on Base Sepolia and Solana Devnet. When both deposits are
finalized, continue to the next step.Step 4. Check your Unified Balance
In this step, you query your Unified Balance across the Base Sepolia and Solana Devnet depositors and print the confirmed and pending amounts.4.1. Check balances
Callkit.unifiedBalance.getBalances with the same browser wallet adapters you
used for the deposits:TypeScript
Shell
totalPendingBalance before they are
reflected in totalConfirmedBalance. Wait until the confirmed balance is
sufficient before you spend.Step 5. Spend from the combined balance
In this step, you spend USDC on Arc Testnet from your Unified Balance.5.1. Spend on Arc Testnet
Collect the recipient address from your app UI, then pass it with the connected wallet adapters into the spend function. This code spends 2.50 USDC on Arc Testnet for the recipient. The App Kit SDK chooses how much USDC to use from each blockchain.TypeScript
Shell
5.2. Verify the spend
Use theexplorerUrl from the spend result to confirm that USDC arrived at the
recipient address on Arc Testnet. The received amount can be less than the
requested spend after fees. For more on fees, see
How Unified Balance fees work.