Arbitrum integrations for the Alloy Rust SDK.
This project is under active development and not yet stable. API and feature coverage may change at any time. This project is neither affiliated or endorsed by Alloy or OffchainLabs.
use alloy_provider::{Provider, ProviderBuilder};
use arbitrum_alloy::{network::Arbitrum, provider::ArbProviderExt};
#[tokio::main()]
async fn main() {
let provider = ProviderBuilder::<_, _, Arbitrum>::default()
.connect("http://localhost:8547")
.await.unwrap();
let latest = provider.get_block_number().await.unwrap();
println!("latest block: {latest}");
let _ = provider.arb_maintenance_status().await;
}- Docs Index
- Quickstart Guide
- Connect To A Provider
- Provider Extensions
- Use Precompiles
- Local Dev Chain
- FAQ
Published on crates.io under the arbitrum-alloy-* namespace (the shorter arb-alloy-*
names are held by an unrelated project):
arbitrum-alloy: umbrella crate re-exporting the components below.arbitrum-alloy-consensus: Arbitrum consensus transaction and receipt types.arbitrum-alloy-network:Networkimplementation for Arbitrum.arbitrum-alloy-rpc-types: Arbitrum RPC request/response types.arbitrum-alloy-provider: provider extension traits forarb_*RPC methods.arbitrum-alloy-precompiles: Arbitrum precompile address constants andsol!bindings.arbitrum-alloy-sequencer: Arbitrum sequencer feed protocol types.
The package name and import path match (hyphens become underscores), so arbitrum-alloy-consensus
is use arbitrum_alloy_consensus. For the umbrella:
[dependencies]
arbitrum-alloy = { version = "0.2", features = ["network", "provider"] }use arbitrum_alloy::{network::Arbitrum, provider::ArbProviderExt};