Skip to content

Commit

Permalink
Update API documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rvanasa committed Sep 21, 2023
1 parent 6c9bbf0 commit a6ae440
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,21 @@ Confirm the authenticity of a message signed by an Ethereum private key. Check o

Make a request to a Web2 Ethereum node using the caller's URL to an openly available JSON-RPC service, or the caller's URL (including an API key if necessary). No registered API key of the canister is used in this scenario.

request: (source: Source, json_rpc_payload: text, max_response_bytes: nat64) -> (EthRpcResult);
request: (source: Source, json_rpc_payload: text, max_response_bytes: nat64) -> (Result<blob, EthRpcError>);

* `source`: Any of the following:
* `#Url : text` The URL of the service, including any API key if required for access-protected services.
* `#Chain : nat64` The relevant EVM network identifier ([reference list](https://chainlist.org/?testnets=true)).
* `#Provider : nat64` The ID of the provider to be used for this call. Call `get_providers` to view a full list of providers.
* `json_rpc_payload`: The payload for the JSON-RPC request. View examples in the [Ethereum documentation](https://ethereum.org/en/developers/docs/apis/json-rpc/).
* `max_response_bytes`: The expected maximum size of the response of the Web2 API server. This parameter determines the network response size that is charged for. Not specifying it or it being larger than required may lead to substantial extra cycles cost for the HTTPS outcalls mechanism as its (large) default value is used and charged for.
* `EthRpcResult`: The response comprises the JSON-encoded result or error, see the corresponding type.


### `request_cost`

Calculate the cost of sending a request with the given input arguments.

request_cost: (source: Source, json_rpc_payload: text, max_response_bytes: nat64) -> (nat) query;
request_cost: (source: Source, json_rpc_payload: text, max_response_bytes: nat64) -> (Result<nat, EthRpcError>) query;

* `source`: See `request`.
* `json_rpc_payload`: See `request`.
Expand Down

0 comments on commit a6ae440

Please sign in to comment.