Arbitrum One
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Arbitrum One
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
This page collects the Arbitrum One operations developers reach for first: reading the latest block, checking ETH balances, looking up transactions and receipts, fetching blocks, calling smart contracts, and preparing the gas and nonce values needed to send a transaction. Each example is a JSON-RPC request you can POST straight to https://arbitrum.therpc.io/YOUR_API_KEY on chain ID 42161.
Two foundational reads start almost every integration: eth_blockNumber returns the height of the latest Arbitrum One block the sequencer has produced, and eth_getBalance returns an account's balance. Note that the balance comes back in wei as a hex string; divide by 10^18 to convert it into ETH, the native gas token on Arbitrum One.
Two reads cover transaction lookups on Arbitrum One. eth_getTransactionByHash returns a transaction's current state and content by its hash, letting you confirm the sequencer has accepted it. eth_getTransactionReceipt returns the full receipt once the transaction is included — including the block it landed in, the gas actually used, the success status, and any emitted logs.
You can fetch an Arbitrum One block two ways: eth_getBlockByNumber takes a block height (or a tag like latest), and eth_getBlockByHash takes the block hash. Both accept a boolean second parameter — pass true to receive full transaction objects embedded in the block, or false to receive only the transaction hashes, which is faster and lighter when you do not need the bodies.
Two methods cover read-only contract access on Arbitrum One. eth_call executes a view or pure function against the current state without sending a transaction or spending gas — the workhorse for reading token balances, pool reserves on Uniswap or Camelot, or position data on GMX. eth_getCode returns the deployed bytecode at an address, which you can use to confirm a contract exists at that address before interacting with it.
Two checks confirm you are talking to the right network and a healthy node. net_version returns the network identifier as a string — 42161 for Arbitrum One mainnet — which is a quick guard against accidentally pointing at the wrong chain. eth_syncing reports whether the node is still catching up to the chain head or fully synced and ready to serve current data.
Before sending a transaction on Arbitrum One you need two values. eth_gasPrice returns the current price the sequencer expects — on a rollup this reflects both the L2 execution cost and the L1 calldata posting cost, all paid in ETH. eth_getTransactionCount returns an account's nonce, the per-address counter that orders transactions; each new transaction from an address must use the next nonce in sequence, so reading it correctly prevents stuck or rejected sends.