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

Link to this function

call(params, overrides \\ [], opts \\ [])

View Source

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 to latest
  • :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]}
Link to this function

eth_call(params, block, opts \\ [])

View Source
Link to this function

eth_estimate_gas(params, opts \\ [])

View Source
Link to this function

eth_gas_price(opts \\ [])

View Source
Link to this function

eth_get_logs(params, opts \\ [])

View Source
Link to this function

eth_get_transaction_receipt(tx_hash, opts \\ [])

View Source
Link to this function

eth_send_transaction(params, opts \\ [])

View Source
Link to this function

send(params, overrides \\ [], opts \\ [])

View Source

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}