View Source Ethers.TxData (Ethers v0.5.5)

Transaction struct to hold information about the ABI selector, encoded data and the target to address.

Summary

Types

t()

Holds transaction data, the function selector and the default to address.

Functions

ABI decodes a function input/output given a TxData or FunctionSelector

Converts a TxData struct and optional overrides to a map ready for RPC data.

Types

t()

@type t() :: %Ethers.TxData{
  base_module: atom() | nil,
  data: binary() | [binary()],
  default_address: nil | Ethers.Types.t_address(),
  selector: ABI.FunctionSelector.t()
}

Holds transaction data, the function selector and the default to address.

Can be passed in to Ethers.call/2 or Ethers.send/2 to execute.

Functions

abi_decode(data, tx_data_or_selector, type \\ :output)

@spec abi_decode(binary(), ABI.FunctionSelector.t() | t(), type :: :input | :output) ::
  {:ok, any() | [any()]}

ABI decodes a function input/output given a TxData or FunctionSelector

to_map(tx_data, overrides \\ [])

@spec to_map(t() | map(), Keyword.t()) :: map()

Converts a TxData struct and optional overrides to a map ready for RPC data.