eth_tx_codec
Encode signed transaction fields into a raw Ethereum transaction, or decode a raw transaction to extract fields and sender address.
Instructions
Serialize signed tx fields into a raw transaction, or decode a raw tx.
action=encode (needs fields) serializes the supplied, already-signed fields
(it does not sign) -> {type, raw:'0x...', hash}. fields is an object; the
type is taken from a type key or inferred from which fields are present
(maxFeePerGas -> 1559, blobVersionedHashes -> 4844, accessList -> 2930, else
legacy). Numbers accept int / decimal / 0x-hex; to/data are 0x-hex.
action=decode (needs data, a 0x-hex raw tx) -> {type, fields, hash, from},
recovering from from the signature; numeric fields come back as decimal
strings, addresses EIP-55 checksummed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| data | No | ||
| fields | No |