View Source Ethers.RPC (Ethers v0.0.6)
RPC Methods for interacting with the Ethereum blockchain
Summary
Functions
Makes an eth_call to with the given data and overrides, Than parses the response using the selector in the params
Makes an eth_send to with the given data and overrides, Then returns the transaction binary.
Functions
Makes an eth_call to with the given data and overrides, Than parses the response using the selector in the params
Overrides
This function accepts all of options which Ethereumex.BaseClient.eth_send_transaction
accepts.
Notable you can use these.
:to
: Indicates recepient address. (Contract address in this case)
Options
:block
: The block number or block alias. Defaults tolatest
:rpc_client
: The RPC Client to use. It should implement ethereum jsonRPC API. default: Ethereumex.HttpClient:rpc_opts
: Extra options to pass to rpc_client. (Like timeout, Server URL, etc.)
Examples
iex> Ethers.Contract.ERC20.total_supply() |> Ethers.Contract.call(to: "0xa0b...ef6")
{:ok, [100000000000000]}
Link to this function
eth_get_block_by_number(block_number, include_details?, opts \\ [])
View SourceMakes an eth_send to with the given data and overrides, Then returns the transaction binary.
Overrides
This function accepts all of options which Ethereumex.BaseClient.eth_send_transaction
accepts.
Notable you can use these.
:to
: Indicates recepient address. (Contract address in this case)
Options
:rpc_client
: The RPC Client to use. It should implement ethereum jsonRPC API. default: Ethereumex.HttpClient:rpc_opts
: Extra options to pass to rpc_client. (Like timeout, Server URL, etc.)
Examples
iex> Ethers.Contract.ERC20.transfer("0xff0...ea2", 1000) |> Ethers.Contract.send(to: "0xa0b...ef6")
{:ok, transaction_bin}