RPC method

eth_getTransactionReceipt on X Layer

Supported on SwiftNodes

Everything below was measured on 2026-10-13 by calling eth_getTransactionReceipt on X Layer through the same endpoint customers use, and is re-measured weekly.

What eth_getTransactionReceipt does

Returns the outcome of a mined transaction: status (1 success, 0 reverted), gas used, the effective gas price, the logs it emitted and any contract it created. It returns null until the transaction is in a block.

eth_getTransactionReceipt on X Layer: what we measured

Fields22 (7 beyond the Ethereum set)
Receipt for an unknown hashnull
Size of the sample receipt14.5 KB

Reading the fee and fields

Beyond the Ethereum fields, X Layer receipts carry 7 more. daFootprintGasScalar: the data-availability footprint scalar from the OP Stack fee configuration; l1BaseFeeScalar: the weight of Ethereum's execution base fee in the L1 fee (post-Ecotone formula); l1BlobBaseFee: the Ethereum blob base fee the L1 fee was priced with; l1BlobBaseFeeScalar: the weight of Ethereum's blob base fee in the L1 fee; l1Fee: the L1 data fee in wei, charged on top of gasUsed × effectiveGasPrice. Add it to get the real cost; l1GasPrice: the Ethereum base fee the L1 fee was priced with; l1GasUsed: the L1 gas the transaction's compressed data was estimated to use.

gasUsed × effectiveGasPrice is not the whole cost on X Layer. In the sample receipt below, execution cost 9,231,640,923,164 wei and the L1 data fee (l1Fee) 0 wei, so 0% of what the sender paid was the L1 fee. A wallet or accounting tool that ignores l1Fee understates fees.

A hash the node has not seen returns null, not an error, so poll until it is non-null (viem's waitForTransactionReceipt does this) and give up after a timeout.

A real X Layer receipt

As our endpoint returned it; logs collapsed to a count and long hex values shortened.

{
  "blobGasUsed": "0x122a0",
  "blockHash": "0x8974b172e91a708d9fa094c5fe36c129052eae9e972f4f1fa98b152aba080f2b",
  "blockNumber": "0x45bd73d",
  "contractAddress": null,
  "cumulativeGasUsed": "0x80234",
  "daFootprintGasScalar": "0x190",
  "effectiveGasPrice": "0x1312d02",
  "from": "0x1bd1fadb835efb2134a0b902eb6658afd7461df0",
  "gasUsed": "0x70b0e",
  "l1BaseFeeScalar": "0x0",
  "l1BlobBaseFee": "0x6c12b8",
  "l1BlobBaseFeeScalar": "0x0",
  "l1Fee": "0x0",
  "l1GasPrice": "0x755bdc5",
  "l1GasUsed": "0xba9",
  "logs": "21 logs",
  "logsBloom": "0x0020084000000040…(256 bytes)",
  "status": "0x1",
  "to": "0xe2e6774c784eb076551543e04f3059b4bc716fdd",
  "transactionHash": "0xf25cc4d548c197aaeb1909f361ed997be478bbc7ff36d1a50dab8192c34536c7",
  "transactionIndex": "0x1",
  "type": "0x2"
}

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_getTransactionReceipt","params":["0xf25cc4d548c197aaeb1909f361ed997be478bbc7ff36d1a50dab8192c34536c7"]}'
import { createPublicClient, http } from "viem";

const client = createPublicClient({
  transport: http("https://rpc.swiftnodes.io/rpc/xlayer?key=YOUR_API_KEY"),
});

const receipt = await client.waitForTransactionReceipt({ hash, timeout: 60_000 });
if (receipt.status !== "success") throw new Error("reverted");

// Total cost on X Layer: execution plus the L1 data fee
const execution = receipt.gasUsed * receipt.effectiveGasPrice;
const total = execution + (receipt.l1Fee ?? 0n);

Other methods on X Layer

eth_getTransactionReceipt on other chains

Frequently asked questions

Does X Layer support eth_getTransactionReceipt?

Yes. eth_getTransactionReceipt answered on the SwiftNodes X Layer endpoint when our weekly probe called it through the customer path (2026-10-13).

How do I get the total fee of a transaction on X Layer?

Add the receipt's l1Fee to gasUsed × effectiveGasPrice.

Why is the X Layer receipt null?

The transaction is not in a block yet, or the hash is unknown to the node. Keep polling with a timeout.

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.