Skip to main content

Transactions

Transactions is a library with utilities to encode, decode and sign Ethereum transactions.

Functions​

encodeRLP​

encode a EIP-155 transaction in RLP.

Input:

  • "txStruct": is the transaction structure.

Output:

  • "output": the encoded RLP bytes.

encodeRLP​

encode a EIP-1559 request transaction in RLP.

Input:

  • "txStruct": is the transaction structure.

Output:

  • "output": the encoded RLP bytes.

encodeRLP​

encode a EIP-1559 transaction in RLP.

Input:

  • "txStruct": is the transaction structure.

Output:

  • "output": the encoded RLP bytes.

encodeRLP​

encode a EIP-1559 request transaction in RLP.

Input:

  • "txStruct": is the transaction structure.

Output:

  • "output": the encoded RLP bytes.

decodeRLP_EIP155​

decode a EIP-155 transaction from RLP.

Input:

  • "rlp": is the encoded RLP bytes.

Output:

  • "txStruct": the transaction structure.

decodeRLP_EIP155Request​

decode a EIP-155 request transaction from RLP.

Input:

  • "rlp": is the encoded RLP bytes.

Output:

  • "txStruct": the transaction structure.

decodeRLP_EIP1559​

decode a EIP-1559 transaction from RLP.

Input:

  • "rlp": is the encoded RLP bytes.

Output:

  • "txStruct": the transaction structure.

decodeRLP_EIP1559Request​

decode a EIP-1559 request transaction from RLP.

Input:

  • "rlp": is the encoded RLP bytes.

Output:

  • "txStruct": the transaction structure.

signTxn​

sign a EIP-155 transaction request.

Input:

  • "request": is the transaction request.

  • "signingKey": is the private key to sign the transaction.

Output:

  • "response": the signed transaction.

signTxn​

sign a EIP-155 transaction request.

Input:

  • "request": is the transaction request.

  • "signingKey": is the private key to sign the transaction.

Output:

  • "response": the signed transaction.

Structs​

EIP155​

EIP-155 transaction structure.

  • "to": is the target address.
  • "gas": is the gas limit.
  • "gasPrice": is the gas price.
  • "value": is the transfer value in gwei.
  • "nonce": is the latest nonce of the sender.
  • "data": is the transaction data.
  • "chainId": is the id of the chain where the transaction will be executed.
  • "r": is the 'r' signature value.
  • "s": is the 's' signature value.
  • "v": is the 'v' signature value.

EIP155Request​

EIP-155 transaction request structure.

  • "to": is the target address.
  • "gas": is the gas limit.
  • "gasPrice": is the gas price.
  • "value": is the transfer value in gwei.
  • "nonce": is the latest nonce of the sender.
  • "data": is the transaction data.
  • "chainId": is the id of the chain where the transaction will be executed.

EIP1559​

EIP-1559 transaction structure.

  • "to": is the target address.
  • "gas": is the gas limit.
  • "maxFeePerGas": is the maximum fee per gas.
  • "maxPriorityFeePerGas": is the maximum priority fee per gas.
  • "value": is the transfer value in gwei.
  • "nonce": is the latest nonce of the sender.
  • "data": is the transaction data.
  • "chainId": is the id of the chain where the transaction will be executed.
  • "accessList": is the access list.
  • "r": is the 'r' signature value.
  • "s": is the 's' signature value.
  • "v": is the 'v' signature value.

EIP1559Request​

EIP-1559 transaction request structure.

  • "to": is the target address.
  • "gas": is the gas limit.
  • "maxFeePerGas": is the maximum fee per gas.
  • "maxPriorityFeePerGas": is the maximum priority fee per gas.
  • "value": is the transfer value in gwei.
  • "nonce": is the latest nonce of the sender.
  • "data": is the transaction data.
  • "chainId": is the id of the chain where the transaction will be executed.
  • "accessList": is the access list.