Skip to main content

Install

Install the SDK alongside viem, its one peer dependency.
The SDK is viem-based and ships ESM + CJS + types. 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 a ClientPair: 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.
Arc’s public RPC is rate-limited. For a multi-transaction flow, wrap the transport to back off on the JSON-RPC error -32011 (“request limit reached”), which viem does not retry by default, and enable Multicall3 batching on the public client (batch: { multicall: true }) to collapse concurrent reads into one request.

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 as ARC_TESTNET_CHAIN_ID.
  • RPC https://rpc.testnet.arc.network (RPC_URL). The explorer is ArcScan at https://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 0x3600000000000000000000000000000000000000 with 6 decimals. Because it is native, an ERC-20 transfer moves native balance, so contracts that receive it implement receive(). The SDK only ever touches the ERC-20 interface.
  • Faucet. Fund a test wallet with USDC from https://faucet.circle.com.

Next

Send your first protected transfer in the quickstart.