View Source Ethers.RPC (Ethers v0.0.2)
RPC Methods for interacting with the Ethereum blockchain
Link to this section 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.
Link to this section Functions
Makes an eth_call to with the given data and overrides, Than parses the response using the selector in the params
overrides
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
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
Examples
iex> Ethers.Contract.ERC20.total_supply() |> Ethers.Contract.call(to: "0xa0b...ef6")
{:ok, [100000000000000]}
Makes an eth_send to with the given data and overrides, Then returns the transaction binary.
overrides
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
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
Examples
iex> Ethers.Contract.ERC20.transfer("0xff0...ea2", 1000) |> Ethers.Contract.send(to: "0xa0b...ef6")
{:ok, transaction_bin}