Install
Install the SDK alongsideviem, its one peer dependency.
viem is a peer dependency, so
you control its version. Arc Testnet is a built-in viem chain, which requires
viem >= 2.38.
Set up clients
Every SDK call takes aClientPair: a viem public client for reads and a wallet
client for writes. Both run on arcTestnet, and the chain plus RPC are exported
from the SDK so you never transcribe them.
Pass the account object (not just its address) to the wallet client. That is
what tells viem to sign locally and submit via
eth_sendRawTransaction. A bare
address string makes viem call wallet_sendTransaction, which Arc’s RPC does not
support.Addresses and chain constants
Contract addresses, the chain, and endpoints live in one place and are exported from the SDK, so you never hardcode them:Read these from the SDK rather than copying them.
SPEND_POLICY_FACTORY_ADDRESS
was redeployed on 2026-08-24 and the superseded factory is still live on chain, so
a hardcoded address keeps working while pointing at the wrong contract.
SPEND_POLICY_FACTORY_PRIOR_ADDRESSES lists the retired ones, which is how the
co-signer still recognises a box created under an older factory.About Arc Testnet
- Chain id
5042002, exported asARC_TESTNET_CHAIN_ID. - RPC
https://rpc.testnet.arc.network(RPC_URL). The explorer is ArcScan athttps://testnet.arcscan.app, which exposes a Blockscout-compatible REST API the firewall reads from. - USDC is the native gas token, exposed as an ERC-20 interface at
0x3600000000000000000000000000000000000000with 6 decimals. Because it is native, an ERC-20transfermoves native balance, so contracts that receive it implementreceive(). The SDK only ever touches the ERC-20 interface. - Faucet. Fund a test wallet with USDC from
https://faucet.circle.com.