arb_rpc/
lib.rs

1//! Arbitrum-specific RPC types, converters, and builders.
2//!
3//! Provides the Arbitrum Eth API builder and RPC type conversions needed
4//! to serve the `eth_` namespace with Arbitrum-specific transaction,
5//! receipt, and header types.
6
7pub mod api;
8pub mod arb_api;
9pub mod block_producer;
10pub mod builder;
11pub mod header;
12pub mod nitro_execution;
13pub mod nitro_execution_handler;
14pub mod receipt;
15pub mod response;
16pub mod transaction;
17pub mod types;
18
19pub use api::ArbEthApi;
20pub use arb_api::{ArbApiHandler, ArbApiServer};
21pub use block_producer::{BlockProducer, BlockProducerError, BlockProductionInput, ProducedBlock};
22pub use builder::{ArbEthApiBuilder, ArbRpcConvert};
23pub use header::ArbHeaderConverter;
24pub use nitro_execution::{NitroExecutionApiServer, RpcMessageResult, RpcMessageWithMetadata};
25pub use nitro_execution_handler::NitroExecutionHandler;
26pub use receipt::ArbReceiptConverter;
27pub use response::ArbRpcTxConverter;
28pub use transaction::ArbTransactionRequest;
29pub use types::ArbRpcTypes;
30
31use alloy_primitives::{B256, U256};
32use serde::{Deserialize, Serialize};
33
34/// Arbitrum transaction receipt extension fields.
35#[derive(Debug, Clone, Default, Serialize, Deserialize)]
36#[serde(rename_all = "camelCase")]
37pub struct ArbReceiptFields {
38    /// L1 block number when the L2 tx was batched.
39    #[serde(skip_serializing_if = "Option::is_none")]
40    pub l1_block_number: Option<u64>,
41    /// Gas units charged for L1 calldata.
42    #[serde(skip_serializing_if = "Option::is_none")]
43    pub gas_used_for_l1: Option<U256>,
44}
45
46/// Arbitrum block information returned by `arb_getBlockInfo`.
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(rename_all = "camelCase")]
49pub struct ArbBlockInfo {
50    /// The L1 block number that this L2 block was batched on.
51    pub l1_block_number: u64,
52    /// ArbOS format version of this block.
53    pub arbos_format_version: u64,
54    /// The send count (L2-to-L1 messages) as of this block.
55    pub send_count: u64,
56    /// The send root hash.
57    pub send_root: B256,
58}
59
60/// Maintenance status for the node.
61#[derive(Debug, Clone, Default, Serialize, Deserialize)]
62#[serde(rename_all = "camelCase")]
63pub struct ArbMaintenanceStatus {
64    pub is_running: bool,
65}