Type reference
Hexadecimal quantities, byte strings, addresses, hashes, block selectors, and transaction call objects used by MegaETH JSON-RPC.
Last updated
Hexadecimal quantities, byte strings, addresses, hashes, block selectors, and transaction call objects used by MegaETH JSON-RPC.
This page defines wire types shared by MegaETH JSON-RPC methods. Method pages remain self-contained and specify the types accepted in each position.
QuantityA Quantity is a non-negative integer encoded as a 0x-prefixed hexadecimal string. It uses the shortest representation, so leading zeroes are not allowed except in 0x0.
0x0
0
0x1
0x01
0x5208
21000
DataData is an arbitrary byte sequence encoded as a 0x-prefixed hexadecimal string. It contains exactly two hexadecimal digits per byte and may be empty.
0x
0
0x12
0x1
0xdeadbeef
deadbeef
AddressAn Address is a 20-byte value encoded as 0x followed by 40 hexadecimal digits. The wire format accepts upper- or lowercase hexadecimal digits.
Example: 0x0000000000000000000000000000000000000000.
Hash32A Hash32 is a 32-byte hash encoded as 0x followed by 64 hexadecimal digits. Block hashes, transaction hashes, and trie roots use this representation.
Bytes32Bytes32 has the same wire width as Hash32 but represents a fixed-width value rather than necessarily a hash. Storage keys and proof values commonly use this representation.
Methods that read block or state data may accept a block number encoded as Quantity or one of these tags:
earliest
The genesis block.
latest
The latest streaming state, including committed mini-blocks.
pending
The latest streaming state.
safe
The latest safe EVM block known to the node.
finalized
The latest finalized EVM block known to the node.
Some methods also accept an EIP-1898 block selector object containing blockHash or blockNumber. Check the method page before using the object form because support is method-specific.
Simulation methods such as eth_call, eth_estimateGas, and eth_createAccessList accept a transaction call object. Common fields include:
from
Address
Simulated sender.
to
Address or null
Recipient, or null for contract creation.
gas
Quantity
Gas limit supplied to the simulation.
gasPrice
Quantity
Legacy gas price.
maxFeePerGas
Quantity
EIP-1559 maximum fee.
maxPriorityFeePerGas
Quantity
EIP-1559 priority fee.
value
Quantity
Value transferred in wei.
input or data
Data
Calldata or contract creation bytecode.
nonce
Quantity
Sender nonce when the method supports it.
accessList
array
EIP-2930 access list.
Do not combine gasPrice with EIP-1559 fee fields. Use the relevant method page for accepted fields and defaults.
Decimal quantity
21000
"0x5208"
Leading zeroes
"0x0001"
"0x1"
Odd-length data
"0x123"
"0x0123"
Short address
"0x1234"
A full 20-byte address
Mixed log selector modes
blockHash with fromBlock
Use one selector mode
Mixed fee models
gasPrice with maxFeePerGas
Use one fee model
Last updated