The other canister functions accept RpcServices
but the request
function only a single RpcService
. Is this intentional @rvanasa?
pub async fn request(
&self,
arg0: RpcService,
arg1: String,
arg2: u64,
) -> Result<(RequestResult,)> {
ic_cdk::call(self.0, "request", (arg0,arg1,arg2,)).await
}
This is intentional; here is a quick explanation of the difference. Canister methods such as eth_getLogs
include built-in agreement logic between multiple RPC providers, and in some cases they may call each API several times. The details are abstracted away behind the scenes.
On the other hand, the request
method sends a raw JSON request to one specific RPC provider without transforming the input or response. This is intended for use cases which require custom agreement logic between providers (e.g. if using a non-standard RPC method or provider).
This is explained in more detail in the EVM RPC documentation.
1 Like