ic_eth/lib.rs
1use ic_cdk::api::management_canister::http_request::{HttpResponse, TransformArgs};
2
3pub mod abi;
4pub mod rpc;
5pub mod utils;
6
7pub use ethers_core as core;
8
9pub use rpc::{call_contract, request};
10
11#[ic_cdk_macros::query(name = "__transform_eth_rpc")]
12pub fn transform_eth_rpc(args: TransformArgs) -> HttpResponse {
13 HttpResponse {
14 status: args.response.status.clone(),
15 body: args.response.body,
16 // Strip headers as they contain the Date which is not necessarily the same
17 // and will prevent consensus on the result.
18 headers: Vec::new(),
19 }
20}