3 releases (breaking)

new 0.3.0 Nov 25, 2025
0.2.0 Nov 3, 2025
0.1.0 Oct 21, 2025

#28 in #count

Download history 155/week @ 2025-10-20 12/week @ 2025-10-27 469/week @ 2025-11-03 645/week @ 2025-11-10 838/week @ 2025-11-17

1,971 downloads per month

Apache-2.0

170KB
3.5K SLoC

Internet Computer portal DFinity Forum GitHub license

Crate evm_rpc_client

Library to interact with the EVM RPC canister from a canister running on the Internet Computer. The alloy feature flag allows using Alloy types in requests and responses.

See the Rust documentation for more details.

Example

Fetching the latest transaction count for a given address using the eth_getTransactionCount JSON-RPC method.

use alloy_primitives::{Adress, U256};
use alloy_rpc_types::BlockNumberOrTag;
use evm_rpc_client::EvmRpcClient;
use evm_rpc_types::RpcResult;

fn get_latest_transaction_count (address: Address) -> RpcResult<U256> {
    let client = EvmRpcClient::builder_for_ic()
        .with_alloy()
        .build();

    client
        .get_transaction_count((address, BlockNumberOrTag::Latest))
        .send()
        .await
        .expect_consistent()
}

Dependencies

~7–24MB
~294K SLoC