Start here
Quickstart
An endpoint, a chain ID check, and a first transaction that does not disappear.
1. Get a key
Keys issue instantly and cover both networks. The key goes in the path, or in an Authorization header if you would rather keep it out of URLs and logs. See Authentication for the other two mechanisms.
2. Verify what you are talking to
Two calls worth making before anything else: confirm the chain, and confirm the node build. The second one matters because Arc behaviour changes between node releases, and arc_getVersion is how you pin an incident to a build.
curl https://rpc.arcrpc.com/v1/$KEY \
-H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'
# => {"jsonrpc":"2.0","id":1,"result":"0x13b2"} // 5042
curl https://rpc.arcrpc.com/v1/$KEY \
-d '{"jsonrpc":"2.0","id":1,"method":"arc_getVersion","params":[]}'
# => the execution build this key is being served from3. Point a client at it
Arc ships as a built-in chain in viem, as arc and arcTestnet. Nothing about the client changes.
import { createPublicClient, createWalletClient, http } from 'viem'
import { arc } from 'viem/chains'
import { privateKeyToAccount } from 'viem/accounts'
const transport = http('https://rpc.arcrpc.com/v1/' + process.env.ARCRPC_KEY)
const client = createPublicClient({ chain: arc, transport })
await client.getBlockNumber()
const wallet = createWalletClient({
account: privateKeyToAccount(process.env.PK),
chain: arc,
transport,
})
// 20 Gwei is the protocol floor. Below it the transaction is dropped
// with no receipt, so set it explicitly rather than trusting a default.
await wallet.sendTransaction({
to: recipient,
value: 1_000_000_000_000_000_000n, // 1 USDC, native 18 decimals
maxFeePerGas: 20_000_000_000n,
})Networks
- Arc Mainnet, chain 5042:
https://rpc.arcrpc.com/v1/$KEY - Arc Testnet, chain 5042002:
https://rpc-testnet.arcrpc.com/v1/$KEY, funded from faucet.circle.com