@ethernauta/arbitrum
v0.0.48
Published
Arbitrum support for Ethernauta — bridge verbs, 16 precompiles, arb_* RPC, orbit chains, timeboost.
Maintainers
Readme
Philosophy
Arbitrum-specific primitives. Nitro precompile bindings, the arb_* consensus-side RPC namespace, the L1+L2 gas split, per-chain L1 deployment registry, Timeboost, and the L1↔L2 bridge verbs — everything that's true of every Nitro-stack chain (Arbitrum One, Nova, Sepolia, plus curated Orbits: Xai, ApeChain, Sanko, Proof of Play Apex, RARI, Treasure, Reya, Plume, Degen, Game7, Hychain, AlienX, Kinto, Aleph Zero, Real, Corn) but isn't part of L1 Ethereum.
The Yellow-Paper substrate — accounts, EVM, RLP, EIP-1559, the eth_* method surface — stays in @ethernauta/eth. This package is the layer on top.
Modules
API
Fees
import { estimate_arbitrum_fees } from "@ethernauta/arbitrum"
const fees = await estimate_arbitrum_fees({
tx: { to: recipient, input },
})(reader({ chain_id }))
// { gas_estimate, gas_estimate_for_l1, base_fee, l1_base_fee_estimate }estimate_arbitrum_fees is one read against the NodeInterface virtual precompile at 0x00…C8 — the Nitro node intercepts and decodes the four-tuple into the L2-execution + L1-batch-posting split in one shot. Relocated here from the (now retired) @ethernauta/gas package.
arb_* RPC — Readable<T>
import {
arb_getL1Confirmations,
arb_findBatchContainingBlock,
} from "@ethernauta/arbitrum"The two public consensus-side methods exposed by the Arbitrum node.
Precompile bindings
import {
ArbSys,
ArbGasInfo,
ArbRetryableTx,
ArbAddressTable,
ArbAggregator,
NodeInterface,
// …
} from "@ethernauta/arbitrum"16 precompile bindings autogenerated against nitro-contracts/v3.2.0. ArbosActs is intentionally skipped (system-internal, always reverts for non-system callers).
Per-chain L1 deploys
import { require_deploy_addresses } from "@ethernauta/arbitrum"
import { eip155_42161 } from "@ethernauta/chain/eip155-42161"
const deploys = require_deploy_addresses(eip155_42161)
// { rollup, inbox, outbox, sequencerInbox, bridge,
// l1GatewayRouter, l2GatewayRouter, … }Returns the L1 deployment registry for 11+ canonical and Orbit chains.
Bridge verbs + retryable lifecycle — Bridgeable<T>
import {
send_eth,
send_erc20,
send_message,
redeem_retryable,
cancel_retryable,
start_withdraw_eth,
start_withdraw_erc20,
start_withdraw_message,
execute_withdraw,
fetch_message_proof,
get_status,
decode_l2_to_l1_tx,
} from "@ethernauta/arbitrum/bridge"
import { create_bridge } from "@ethernauta/transport"
const bridge = create_bridge(CHAINS)({
l1_chain_id: ETH_MAINNET,
l2_chain_id: ARB_ONE,
})
const hash = await send_eth({ to, value })(bridge.signer)Covers L1 → L2 deposits (via the Inbox), the retryable-ticket lifecycle (redeem / cancel), L2 → L1 withdrawals (start on L2, execute on L1 after the dispute window), and an L2ToL1Tx event decoder for parsing the withdraw message off the L2 receipt. Errors are typed.
Timeboost
import {
arb_getRawBlockMetadata,
// auctioneer_* / timeboost_* method bindings
} from "@ethernauta/arbitrum"Express-Lane auction surface — runtime-side auctioneer_* / timeboost_* namespaces plus the per-tx metadata RPC.
Solidity sources
The vendored Nitro contracts (nitro-contracts/v3.2.0) live colocated under packages/arbitrum/src/bridge/<contract>/ and packages/arbitrum/src/precompiles/. pnpm pull-contracts refreshes them from the upstream tarball; pnpm pull-deploys regenerates the per-chain L1 deploys registry.
