MEGAETHDOCS
GitHubGet started →
API

JSON-RPC Reference

MegaETH provides standard Ethereum JSON-RPC with additional realtime-oriented methods.

Endpoints

NetworkHTTPWebSocket
Mainnethttps://rpc.megaeth.comwss://rpc.megaeth.com
Testnethttps://carrot.megaeth.com/rpcwss://carrot.megaeth.com/ws

Rate/Usage Guidance

For production traffic, use managed infra and retries with backoff. If you hit 429, rotate to managed endpoints and reduce burst pressure.

Try It Live

POSThttps://rpc.megaeth.commainnet
Request Preview
{
  "jsonrpc": "2.0",
  "method": "eth_blockNumber",
  "params": [],
  "id": 1
}
no params · returns current block
POSThttps://rpc.megaeth.commainnet
blockNumber
fullTxObjects
Request Preview
{
  "jsonrpc": "2.0",
  "method": "eth_getBlockByNumber",
  "params": [
    "latest",
    false
  ],
  "id": 1
}
returns block header + tx list
POSThttps://rpc.megaeth.commainnet
address
blockTag
Request Preview
{
  "jsonrpc": "2.0",
  "method": "eth_getBalance",
  "params": [
    "0x0CA3A2FBC3D770b578223FBB6b062fa875a2eE75",
    "latest"
  ],
  "id": 1
}
returns wei · decoded to ETH + Gwei
POSThttps://rpc.megaeth.commainnet
address
blockTag
Request Preview
{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionCount",
  "params": [
    "0x0CA3A2FBC3D770b578223FBB6b062fa875a2eE75",
    "latest"
  ],
  "id": 1
}
returns hex nonce · decoded to decimal
POSThttps://rpc.megaeth.commainnet
txHash
Request Preview
{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionReceipt",
  "params": [
    ""
  ],
  "id": 1
}
status decoded + gas + log count
POSThttps://rpc.megaeth.commainnet
filter(JSON)
Request Preview
{
  "jsonrpc": "2.0",
  "method": "eth_getLogs",
  "params": [
    {
      "fromBlock": "latest",
      "toBlock": "latest"
    }
  ],
  "id": 1
}
returns logs for a block range
POSThttps://rpc.megaeth.commainnet
Request Preview
{
  "jsonrpc": "2.0",
  "method": "eth_chainId",
  "params": [],
  "id": 1
}
parallel call equivalent for chain info
POSThttps://rpc.megaeth.commainnet
Request Preview
{
  "jsonrpc": "2.0",
  "method": "realtime_sendRawTransaction",
  "params": [],
  "id": 1
}
example response shape · no browser signing
Requires signed transaction. Never use private keys in browser docs playgrounds.
200 OKResponse
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "blockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "blockNumber": "0x10",
    "contractAddress": null,
    "cumulativeGasUsed": "0x11dde",
    "effectiveGasPrice": "0x23ebdf",
    "from": "0xf39f...2266",
    "gasUsed": "0xea60",
    "logs": [],
    "status": "0x1",
    "to": "0xa7b8...941a"
  }
}

Was this page helpful?

Edit on GitHub