Register a server-managed account with a target chain and token. The service creates a smart account deterministically from your API key and the salt you provide, and returns deposit addresses.
import { keccak256, toHex } from "viem";// Use any unique identifier per user (e.g., internal user ID)const salt = keccak256(toHex("user-123"));const RECIPIENT = "0xYOUR_RECIPIENT_ADDRESS";const TARGET_CHAIN = "eip155:84532"; // Base Sepoliaconst TARGET_TOKEN = "0x036CbD53842c5426634e7929541eC2318f3dCF7e"; // USDC on Base Sepoliaconst registerResponse = await fetch( `${DEPOSIT_SERVICE_URL}/register-managed`, { method: "POST", headers: { "Content-Type": "application/json", "x-api-key": API_KEY, }, body: JSON.stringify({ account: { salt, target: { chain: TARGET_CHAIN, token: TARGET_TOKEN, recipient: RECIPIENT, }, }, }), },);const { evmDepositAddress, solanaDepositAddress } = await registerResponse.json();console.log(`EVM deposit address: ${evmDepositAddress}`);console.log(`Solana deposit address: ${solanaDepositAddress}`);
You should see two deposit addresses printed. The evmDepositAddress is where users send tokens on any supported EVM chain.
Once bridging completes, the deposit status changes to completed and includes the destination transaction hash. The USDC is now at the recipient address on Base Sepolia.