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
1,971 downloads per month
170KB
3.5K
SLoC
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