internet-computer-protocol / evm-rpc-canister

Interact with EVM blockchains from the Internet Computer.
https://internetcomputer.org/docs/current/developer-docs/multi-chain/ethereum/evm-rpc/overview
Apache License 2.0
63 stars 13 forks source link

Simplify calling a specific EVM network #38

Closed rvanasa closed 1 year ago

rvanasa commented 1 year ago

This PR changes the request and request_cost methods to receive Source variants which can represent URLs, registered providers, or EVM chain identifiers. This provides a layer of abstraction for more realistic use cases where the developer wants to call an RPC method on a specific EVM network without needing to know which specific RPC provider is being used behind the scenes.

At the moment, the "preferred provider" for a given network is defined as the earliest registered provider with the active flag set to true.