To use Sepolia instead of Arc testnet in the script, replace
arcTestnet with
sepolia (the import, both clients, and the explorer link), substitute
Sepolia’s USDC token address (the xReserve contract address is the same), and
set RPC_URL in .env to a Sepolia RPC endpoint. See
Supported Blockchains and Domains
for the values.If your USDC is on another testnet, use the
Bridge capability in Arc App Kits to move
funds to Arc testnet before making a deposit.Prerequisites
Before you begin, ensure that you’ve:- Installed Node.js v22.18+.
-
Created a wallet on your source blockchain (Arc testnet or Ethereum Sepolia)
and a wallet on the remote chain where you want to receive USDCx, and funded
them with testnet tokens. The script signs with a private key, so your source
wallet must let you export it.
Need a wallet or testnet tokens?
- Arc testnet: MetaMask with the Arc testnet network, and Circle Faucet USDC for the deposit and gas (Arc uses USDC as the native gas token). The script deposits 5 USDC, so request more than that to cover gas.
- Ethereum Sepolia: MetaMask, Circle Faucet for USDC, and a public Sepolia faucet for ETH.
- Canton TestNet: Console Wallet or Bron.
- Aleo Testnet: Shield.
- Stacks Testnet: Leather Wallet or Xverse.
- Cardano Preprod: Eternl or Lace.
- Movement Bardock: Nightly.
Step 1. Choose your remote chain
Use this table for chain-specific values. Domain IDs also appear in Supported Blockchains and Domains.Step 2. Set up your project
2.1. Create the project and install dependencies
Create a new directory and install the base dependencies.Shell
Shell
2.2. Configure TypeScript (optional)
Create atsconfig.json file:
tsconfig.json file:
2.3. Set environment variables
Create a.env file in the project directory:
Shell
If you use MetaMask, follow their guide for how to find and export your
private
key.
.env
PRIVATE_KEYis the private key for the wallet on your source blockchain (Arc testnet by default) that holds USDC and pays gas.REMOTE_ADDRESSis the recipient on your remote chain (Movement Bardock0x…in the worked example). Change the value when you target another chain; see the Step 1 table for formats.RPC_URLis optional. Set it when you need a custom RPC (for example, a Sepolia endpoint if you change the source chain).
npm run start command loads variables from .env using Node.js native
env-file support.
Step 3. Create the deposit script
The script approves USDC on your source blockchain (Arc testnet by default) and callsdepositToRemote on xReserve.
3.1. Create index.ts
Create index.ts with the following worked example. It deposits to Movement
Bardock. If you are targeting a different remote chain, complete section 3.2
after you create the file.
You can review the xReserve EVM
contracts on GitHub.
For more background on contract ABIs, see QuickNode’s guide, What is an
ABI?.
index.ts
3.2. Add your remote chain’s recipient encoding
If you are depositing to Movement Bardock, skip this subsection. The worked example already includes that encoding. For another remote chain, select its tab. Add any import statements the adapter shows at the top ofindex.ts (replace the existing viem import when the
adapter shows a full one), then replace the // --- Remote chain config ---
section with the adapter’s config block.
- Movement
- Canton
- Aleo
- Stacks
- Cardano
Movement accounts are already
bytes32-sized hex. Normalize an optional 0x
prefix. hookData is unused. No extra imports. Set REMOTE_ADDRESS in .env
to your Movement Bardock account address (0x…).Replace the remote-chain config section with:TypeScript
Step 4. Run the script
Run the following command to execute the script:Shell
4.1. Verify the deposit
Open theDeposit confirmed URL from the terminal output in the block explorer
for your source chain (Arc testnet Explorer
or Sepolia Etherscan) to confirm the
transaction.
Then complete settlement on your remote chain:
- Movement, Stacks, Cardano: the recipient wallet receives minted testnet USDCx automatically after attestation.
- Aleo: mint USDCx on Aleo before it appears in the recipient wallet. See the Aleo USDCx bridge documentation.
- Canton: after Circle attests the deposit, mint USDCx on Canton for that party. See the official Digital Asset xReserve documentation.