Prerequisites
Before you begin, ensure that you’ve:- Installed Node.js v22+.
- Set up Circle Wallets:
- Obtained a API Key and entity secret from the Circle Console.
- Created an owner wallet and an EOA delegate wallet on Base Sepolia. The owner wallet holds the Unified Balance, and the delegate wallet signs delegated spends after authorization.
- Funded the Base Sepolia wallets:
- Owner wallet: testnet ETH from a public faucet.
- Delegate wallet: testnet USDC from the Circle Faucet and testnet ETH from a public faucet.
- Obtained an Arc Testnet recipient address that will receive the USDC.
Step 1. Set up your project
1.1. Create the project and install dependencies
Create a new directory and install the App Kit SDK with the Circle Wallets adapter and supporting tools:Shell
1.2. Configure TypeScript (optional)
This step is optional. It helps prevent missing types in your IDE or editor.
tsconfig.json file configured for ESM and Node:
Shell
1.3. Set environment variables
Create an.env file in the project directory:
Shell
YOUR_API_KEY with your Circle Developer API key
and YOUR_ENTITY_SECRET with your entity secret:
.env
Step 2. Deposit into the owner’s Unified Balance
In this step, the delegate wallet deposits USDC into the owner’s Unified Balance from Base Sepolia.2.1. Create the deposit script
Create adelegate-deposit.ts file. In this script, the delegate wallet
deposits 2.00 USDC from Base Sepolia into the owner’s Unified Balance.
delegate-deposit.ts
depositFor is permissionless. Any wallet can fund another account’s Unified
Balance. This quickstart uses it so the delegate funds the owner before the
owner grants spend authorization.2.2. Run the deposit script
In your terminal, run:Shell
Shell
2.3. Verify the deposit
Open theexplorerUrl from the deposit result to confirm the onchain
transaction on Base Sepolia.
Step 3. Authorize the delegate
In this step, the owner wallet grants the delegate permission to spend from its Unified Balance on a specific blockchain.3.1. Create the authorize script
Create adelegate-authorize.ts file. In this script, the owner wallet
authorizes the delegate to spend from its Unified Balance on Base Sepolia:
delegate-authorize.ts
addDelegate is an onchain transaction signed by the owner wallet. Once
authorized, the delegate can spend repeatedly on the same blockchain without
reauthorization. Authorize only delegate addresses you control, and revoke
access when it is no longer needed. Authorization is source-blockchain specific.
See Manage Delegates for
details.3.2. Run the authorize script
In your terminal, run:Shell
Shell
status is already 'ready', the script exits without calling
addDelegate. If status is 'pending', it asks you to wait and run the
script again. Otherwise it submits addDelegate.
Step 4. Check the owner’s Unified Balance
In this step, you check the owner’s Unified Balance by address.4.1. Create the balance check script
Create adelegate-check-balance.ts file. This script prints the owner’s
confirmed and pending Unified Balance totals:
delegate-check-balance.ts
You can check balances by address, adapter, chain, and network. See
Check Unified Balance
for more options.
4.2. Run the balance check script
In your terminal, run:Shell
Shell
totalPendingBalance before they are
reflected in totalConfirmedBalance. Wait until the owner’s
totalConfirmedBalance is high enough for the spend you plan to make before you
continue.
Step 5. Spend from the owner’s balance
In this step, the delegate spends from the owner’s Unified Balance on Arc Testnet for the recipient. The Forwarding Service submits the destination mint, so you don’t need a wallet on Arc Testnet.The Forwarding Service charges a fee that is deducted from the amount minted on
the destination chain. The spend result includes the forwarding fee in the fee
breakdown.
5.1. Create the spend script
Create adelegate-spend.ts file. This script spends 0.50 USDC from the owner’s
Unified Balance on Arc Testnet for the recipient, signed by the delegate.
delegate-spend.ts
5.2. Run the spend script
In your terminal, run:Shell
Shell
5.3. Verify the spend
Use the spend result to confirm that USDC arrived at the recipient address on Arc Testnet. When you use the Forwarding Service, the result can include atransferId instead of a locally submitted destination transaction hash. The
received amount can be less than the requested spend after fees. For more on
fees, see
How Unified Balance fees work.