Skip to main content
This quickstart is for developers who want to integrate xReserve into their apps. It helps you write a TypeScript script that deposits USDC into xReserve on Arc testnet or Ethereum Sepolia. Your recipient wallet will receive USDCx on the remote blockchain when that network supports automatic settlement. The deposit steps are the same for every remote chain. Only the domain ID, how the recipient address is encoded, any extra packages, and what you do after the deposit differ. See Choose your remote chain for each chain’s values.
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.

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
If your chain needs an extra package (see the Step 1 table), install it now. For example, for Aleo:
Shell
Canton and Movement don’t need an extra package.

2.2. Configure TypeScript (optional)

This step is optional. It helps prevent missing types in your IDE or editor.
Create a tsconfig.json file:
Then, update the tsconfig.json file:

2.3. Set environment variables

Create a .env file in the project directory:
Shell
Add your source blockchain wallet private key and remote recipient address:
If you use MetaMask, follow their guide for how to find and export your private key.
.env
  • PRIVATE_KEY is the private key for the wallet on your source blockchain (Arc testnet by default) that holds USDC and pays gas.
  • REMOTE_ADDRESS is the recipient on your remote chain (Movement Bardock 0x… in the worked example). Change the value when you target another chain; see the Step 1 table for formats.
  • RPC_URL is optional. Set it when you need a custom RPC (for example, a Sepolia endpoint if you change the source chain).
Open .env in your editor rather than writing values with shell commands, and add .env to your .gitignore. This prevents credentials from leaking into your shell history or version control.
The npm run start command loads variables from .env using Node.js native env-file support.
This example uses one or more private keys for local testing. In production, use a secure key management solution and never expose or share private keys.

Step 3. Create the deposit script

The script approves USDC on your source blockchain (Arc testnet by default) and calls depositToRemote 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 of index.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 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 the Deposit 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: