eth_getTransactionByHash on X Layer
Everything below was measured on 2026-11-29 by calling eth_getTransactionByHash on X Layer through the same endpoint customers use, and is re-measured weekly.
What eth_getTransactionByHash does
Returns a transaction by its hash: sender, recipient, value, input data, gas fields and signature, plus the block it was included in. It returns null for a hash the node does not know, and a transaction still in the mempool has a null blockNumber.
Transaction types on X Layer
Types of the 118 transactions in five consecutive blocks when we measured. Decoders that reject unknown types will fail on X Layer if any of these is missing from their list.
| 0x2 EIP-1559 | 111 (94%) |
|---|---|
| 0x7e L1-to-L2 deposit (OP Stack) | 5 (4%) |
| 0x0 legacy | 2 (2%) |
Fields beyond Ethereum's
Type 0x7e (L1-to-L2 deposit (OP Stack)) transactions carry extra fields. depositReceiptVersion: the version of the deposit receipt format; mint: the amount of ETH minted on L2 by a deposit; sourceHash: the unique ID of an L1-to-L2 deposit, derived from its L1 origin.
Transactions include blockTimestamp, so you get the block time without a second call for the block.
A real X Layer transaction
A type 0x2 transaction from one of the latest blocks, as our endpoint returned it (long hex values shortened).
{
"accessList": [],
"blockHash": "0x55ecd9052b5f67d75a5903082f99f89e4fe34dfcb4a934db8bdfd7e1df63925c",
"blockNumber": "0x499735d",
"blockTimestamp": "0x6b0bc8e9",
"chainId": "0xc4",
"from": "0x6c3fd827f6787cd4059752900b8bd8d7c96bfa45",
"gas": "0x493e0",
"gasPrice": "0x5bf0f98a",
"hash": "0xe937e8d3f6bf71115cc8a816e12b29a59e3623a094e1b5d16a2205bcc4e0ba86",
"input": "0x4526cae400000000…(644 bytes)",
"maxFeePerGas": "0x5d22268a",
"maxPriorityFeePerGas": "0x5abfcc8a",
"nonce": "0x11442",
"r": "0x9f53ab79899cd7cde3a038edaa2cad21c4974d12b7a2d8993ed65a6d83a053b7",
"s": "0xd0b513ed087ed403156adee34b14bc8c3bf4f9628b7a8e6030be2e71db11acd",
"to": "0x466e3a334136770e7a674b31e0f7d4c3aca84a8a",
"transactionIndex": "0x1",
"type": "0x2",
"v": "0x0",
"value": "0x0",
"yParity": "0x0"
}Example request
curl -s https://rpc.swiftnodes.io/rpc/xlayer?key=YOUR_API_KEY \
-X POST -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionByHash","params":["0xe937e8d3f6bf71115cc8a816e12b29a59e3623a094e1b5d16a2205bcc4e0ba86"]}'import { createPublicClient, http } from "viem";
const client = createPublicClient({
transport: http("https://rpc.swiftnodes.io/rpc/xlayer?key=YOUR_API_KEY"),
});
const tx = await client.getTransaction({ hash: "0xe937e8d3f6bf71115cc8a816e12b29a59e3623a094e1b5d16a2205bcc4e0ba86" });
if (tx.blockNumber === null) console.log("still pending");
console.log(tx.type, tx.from, tx.to, tx.value);Other methods on X Layer
- eth_blockNumberSupported
- eth_chainIdSupported
- eth_getBalanceSupported
- eth_getBlockByNumberSupported
- eth_getTransactionReceiptSupported
- eth_callSupported
- eth_estimateGasSupported
- eth_gasPriceSupported
- eth_feeHistorySupported
- eth_maxPriorityFeePerGasSupported
- eth_sendRawTransactionSupported
- eth_getTransactionCountSupported
- eth_getCodeSupported
- eth_subscribeSupported
- eth_getLogsSupported
- eth_getBlockReceiptsSupported
- eth_getProofSupported
- eth_createAccessListSupported
- debug_traceCallSupported
- trace_blockSupported
- trace_transactionSupported
eth_getTransactionByHash on other chains
- Ethereum
- Base
- Arbitrum
- Optimism
- Polygon
- BNB Smart Chain
- Avalanche
- Sonic
- Linea
- Scroll
- zkSync Era
- Mantle
- Gnosis
- Celo
- Berachain
- Monad
- Unichain
- Kaia
- PulseChain
- World Chain
- Ronin
- Abstract
- ApeChain
- MegaETH
- Fantom
- Lisk
- Hemi
- BOB
- Plasma
- Fraxtal
- Zora
- Story
- Soneium
- Sei
- Hyperliquid
- Taiko
- Morph
- Ink
- Katana
- Ethereum Classic
- opBNB
- Mode
- Flare
- Core
- Chiliz
- Telos EVM
- Tempo
- Cronos
- Manta Pacific
- Shibarium
- Boba Network
- Arbitrum Nova
- Immutable zkEVM
Frequently asked questions
Does X Layer support eth_getTransactionByHash?
Yes. eth_getTransactionByHash answered on the SwiftNodes X Layer endpoint when our weekly probe called it through the customer path (2026-11-29).
Which transaction types does X Layer use?
In five recent blocks: 5 × 0x7e (L1-to-L2 deposit (OP Stack)), 111 × 0x2 (EIP-1559), 2 × 0x0 (legacy).
Why does eth_getTransactionByHash return null on X Layer?
The node does not know the hash: it was never broadcast, it was dropped from the mempool, or it was sent to another chain. Check the hash and the chain ID before retrying.
X Layer endpoints, live block height and WebSocket status are on the X Layer RPC page.
One key covers every chain we serve, and SwiftNodes has a free tier.