View Source Ethers.Transaction.Protocol protocol (Ethers v0.6.2)

Protocol for handling Ethereum Virtual Machine (EVM) transactions.

Summary

Types

t()

All the types that implement this protocol.

Functions

Returns a list ready to be RLP encoded for a given transaction.

Returns the binary value of the transaction type envelope. For legacy transactions, returns an empty binary.

Returns type of transaction as an integer.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

to_rlp_list(transaction, mode)

@spec to_rlp_list(t(), mode :: :payload | :hash) :: [binary() | [binary()]]

Returns a list ready to be RLP encoded for a given transaction.

Parameters

  • transaction - Transaction struct containing the transaction data
  • mode - Encoding mode:
    • :payload - For encoding the transaction payload
    • :hash - For encoding the transaction hash

type_envelope(transaction)

@spec type_envelope(t()) :: binary()

Returns the binary value of the transaction type envelope. For legacy transactions, returns an empty binary.

type_id(transaction)

@spec type_id(t()) :: non_neg_integer()

Returns type of transaction as an integer.