For AI agents: an LLM-friendly Markdown version of every page is available by appending .md to its URL or by sending an Accept: text/markdown request header. The full documentation index is at https://www.ankr.com/docs/llms.txt
Skip to main content

Mantle — web3, net, eth (3/3)

API reference for Mantle. All methods ->

Part 3 of 3: 1 · 2 · 3

eth_getTransactionByBlockNumberAndIndex

Returns information on a transaction by block number and transaction index position.

Parameters

  • id (integer; required): a request ID (example: 1).

  • jsonrpc (string; required): a JSON RPC spec used (example: 2.0).

  • method (string; required): a method used for the request.

  • params (array; required):

    1. <string> (quantity|tag): either the hex value of a block number or one of the following block tags:
      • earliest: the lowest numbered block available on the client.
      • finalized: the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination.
      • safe: the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions.
      • latest: the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions.
      • pending: a sample next block built by the client on top of the latest and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet.
    2. <string> (quantity): the transaction index position.

Returns

  • blockHash (string; data, 32 bytes): a hash of the block containing the transaction; null when it's pending.
  • blockNumber (string; quantity): a number of the block containing the transaction; null when it's pending.
  • from (string; data, 20 bytes): an address of the sender.
  • gas (string; quantity): the gas provided by the sender.
  • gasPrice (string; quantity): the gas price provided by the sender in wei.
  • hash (string; data, 32 bytes): the hash of the transaction.
  • input (string; data): the data send along with the transaction.
  • nonce (string; quantity): the number of transactions made by the sender prior to this one.
  • to (string: data, 20 bytes): an address of the receiver: null when it's a contract creation transaction.
  • transactionIndex (string; quantity): the transaction index position in the block; null when it's pending.
  • value (string; quantity): the value transferred in wei.
  • v (string; quantity): ECDSA recovery ID.
  • r (string; quantity): ECDSA signature r.
  • s (string; quantity): ECDSA signature s.

Request example

curl -X POST https://rpc.ankr.com/mantle/YOUR_ANKR_API_KEY \
-H 'Content-Type: application/json' \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionByBlockNumberAndIndex",
"params": ["0x3F6B8E", "0x0"],
"id": 1
}'

Response example

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x2ab0f417c21b777a7023ffbac9a0996d670e00b2315b7b95f6791e78265cbb46",
"blockNumber": "0x3f6b8e",
"from": "0x1c528053ed6b6144c6ad1cfa1a8133e07907105a",
"gas": "0x37471",
"gasPrice": "0x1",
"hash": "0x87444df6b0ab2925e78871838dac5cb6d7d99a78895370a07c1888004400d794",
"input": "0x7ff36ab500000000000000000000000000000000000000000000000002e33d61635e09b000000000000000000000000000000000000000000000000000000000000000800000000000000000000000001c528053ed6b6144c6ad1cfa1a8133e07907105a00000000000000000000000000000000000000000000000000000000643fd1e100000000000000000000000000000000000000000000000000000000000000030000000000000000000000008734110e5e1dcf439c7f549db740e546fea82d66000000000000000000000000a9b72ccc9968afec98a96239b5aa48d828e8d8270000000000000000000000006dfb16bc471982f19db32dee9b6fb40db4503cbf",
"nonce": "0xe",
"to": "0x45e6f621c5ed8616ccfb9bbaebacf9638abb0033",
"transactionIndex": "0x0",
"value": "0x1158e460913d00000",
"v": "0x2736",
"r": "0x4c45a74f48e991d58e52d20dee5b6913fa787d92f7883be9cda06a76f4b93444",
"s": "0x9d723569080e7b6e69914d6d9bb557227337aa68ae45e0dc9d9b9aadd811df3",
"queueOrigin": "sequencer",
"l1TxOrigin": null,
"l1BlockNumber": "0x871ee0",
"l1Timestamp": "0x643fcd3c",
"index": "0x3f6b8d",
"queueIndex": null,
"rawTransaction": "0xf901710e01830374719445e6f621c5ed8616ccfb9bbaebacf9638abb00338901158e460913d00000b901047ff36ab500000000000000000000000000000000000000000000000002e33d61635e09b000000000000000000000000000000000000000000000000000000000000000800000000000000000000000001c528053ed6b6144c6ad1cfa1a8133e07907105a00000000000000000000000000000000000000000000000000000000643fd1e100000000000000000000000000000000000000000000000000000000000000030000000000000000000000008734110e5e1dcf439c7f549db740e546fea82d66000000000000000000000000a9b72ccc9968afec98a96239b5aa48d828e8d8270000000000000000000000006dfb16bc471982f19db32dee9b6fb40db4503cbf822736a04c45a74f48e991d58e52d20dee5b6913fa787d92f7883be9cda06a76f4b93444a009d723569080e7b6e69914d6d9bb557227337aa68ae45e0dc9d9b9aadd811df3"
}
}