eth_getTransactionByBlockNumberAndIndex
Returns information about a transaction by block number and transaction index position.
Parameters (by position)
Block string or string required
Show Option 1 Block number string
Block number stringShow Option 2 Block tag string
Block tag stringBlock tag fields
earliest: The lowest numbered block the client has available; 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 may 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 latest and containing the set of transactions usually taken from local mempool. Before the merge transition is finalized, any call querying for finalized or safe block MUST be responded to with -39001: Unknown block error
Block string required
earliest: The lowest numbered block the client has available; 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 may 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 latest and containing the set of transactions usually taken from local mempool. Before the merge transition is finalized, any call querying for finalized or safe block MUST be responded to with -39001: Unknown block error
Allowed values: earliest finalized safe latest pending
Transaction index string required
Result
Transaction information null or object
Show Option 1 Not Found (null) null
Not Found (null) nullShow Option 2 Transaction information object
Transaction information objectTransaction information fields
Transaction information object or object or object or object or object
Show Option 1 Signed 7702 Transaction object
Signed 7702 Transaction objectSigned 7702 Transaction fields
Transaction information object
Signed 7702 Transaction
Show Transaction information object
Transaction information objectTransaction information fields
-
type
stringrequiredtype
Match pattern:
^0x4$
-
nonce
stringrequirednonce
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
to
stringrequiredto address
Match pattern:
^0x[0-9a-fA-F]{40}$
-
gas
stringrequiredgas limit
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
value
stringrequiredvalue
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
input
stringrequiredinput data
Match pattern:
^0x[0-9a-f]*$
-
maxPriorityFeePerGas
stringrequiredMaximum fee per gas the sender is willing to pay to miners in wei
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
maxFeePerGas
stringrequiredThe maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
gasPrice
stringThe effective gas price paid by the sender in wei. For transactions not yet included in a block, this value should be set equal to the max fee per gas. This field is DEPRECATED, please transition to using effectiveGasPrice in the receipt object going forward.
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
accessList
array<object>requiredEIP-2930 access lists
Show
accessListobjectaccessListfieldsEIP-2930 access lists
-
address
stringrequiredhex encoded address
Match pattern:
^0x[0-9a-fA-F]{40}$
-
storageKeys
array<string>required32 byte hex value
Match pattern:
^0x[0-9a-f]{64}$
-
additionalProperties
false
-
-
chainId
stringrequiredChain ID that this transaction is valid on
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
authorizationList
array<object>requiredList of authorizations for the transaction
Show
authorizationListobjectauthorizationListfieldsList of authorizations for the transaction
-
chainId
stringrequiredChain ID on which this transaction is valid
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
nonce
stringrequirednonce
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
address
stringrequiredhex encoded address
Match pattern:
^0x[0-9a-fA-F]{40}$
-
yParity
stringrequiredThe parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature
Match pattern:
^0x([0-9a-fA-F]?){1,2}$
-
r
stringrequiredr
Match pattern:
^0x(0|[1-9a-f][0-9a-f]{0,63})$
-
s
stringrequireds
Match pattern:
^0x(0|[1-9a-f][0-9a-f]{0,63})$
-
additionalProperties
true
-
-
yParity
stringrequiredThe parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.
Match pattern:
^0x([0-9a-fA-F]?){1,2}$
-
v
stringFor backwards compatibility,
vis optionally provided as an alternative toyParity. This field is DEPRECATED and all use of it should migrate toyParity.Match pattern:
^0x([0-9a-fA-F]?){1,2}$
-
r
stringrequiredr
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
s
stringrequireds
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
additionalProperties
true
Show Option 2 Signed 4844 Transaction object
Signed 4844 Transaction objectSigned 4844 Transaction fields
Transaction information object
Signed 4844 Transaction
Show Transaction information object
Transaction information objectTransaction information fields
-
type
stringrequiredtype
Match pattern:
^0x3$
-
nonce
stringrequirednonce
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
to
stringrequiredto address
Match pattern:
^0x[0-9a-fA-F]{40}$
-
gas
stringrequiredgas limit
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
value
stringrequiredvalue
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
input
stringrequiredinput data
Match pattern:
^0x[0-9a-f]*$
-
maxPriorityFeePerGas
stringrequiredMaximum fee per gas the sender is willing to pay to miners in wei
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
maxFeePerGas
stringrequiredThe maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
maxFeePerBlobGas
stringrequiredThe maximum total fee per gas the sender is willing to pay for blob gas in wei
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
gasPrice
stringThe effective gas price paid by the sender in wei. For transactions not yet included in a block, this value should be set equal to the max fee per gas. This field is DEPRECATED, please transition to using effectiveGasPrice in the receipt object going forward.
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
accessList
array<object>requiredEIP-2930 access list
Show
accessListobjectaccessListfieldsEIP-2930 access list
-
address
stringrequiredhex encoded address
Match pattern:
^0x[0-9a-fA-F]{40}$
-
storageKeys
array<string>required32 byte hex value
Match pattern:
^0x[0-9a-f]{64}$
-
additionalProperties
false
-
-
blobVersionedHashes
array<string>requiredList of versioned blob hashes associated with the transaction's EIP-4844 data blobs
Match pattern:
^0x[0-9a-f]{64}$
-
chainId
stringrequiredChain ID that this transaction is valid on
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
yParity
stringrequiredThe parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.
Match pattern:
^0x([0-9a-fA-F]?){1,2}$
-
v
stringFor backwards compatibility,
vis optionally provided as an alternative toyParity. This field is DEPRECATED and all use of it should migrate toyParity.Match pattern:
^0x([0-9a-fA-F]?){1,2}$
-
r
stringrequiredr
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
s
stringrequireds
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
additionalProperties
true
Show Option 3 Signed 1559 Transaction object
Signed 1559 Transaction objectSigned 1559 Transaction fields
Transaction information object
Signed 1559 Transaction
Show Transaction information object
Transaction information objectTransaction information fields
-
type
stringrequiredtype
Match pattern:
^0x2$
-
nonce
stringrequirednonce
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
to
null or string
Show Option 1
Contract Creation (null)nullShow Option 2
Addressstring -
gas
stringrequiredgas limit
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
value
stringrequiredvalue
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
input
stringrequiredinput data
Match pattern:
^0x[0-9a-f]*$
-
maxPriorityFeePerGas
stringrequiredMaximum fee per gas the sender is willing to pay to miners in wei
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
maxFeePerGas
stringrequiredThe maximum total fee per gas the sender is willing to pay (includes the network / base fee and miner / priority fee) in wei
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
gasPrice
stringrequiredThe effective gas price paid by the sender in wei. For transactions not yet included in a block, this value should be set equal to the max fee per gas. This field is DEPRECATED, please transition to using effectiveGasPrice in the receipt object going forward.
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
accessList
array<object>requiredEIP-2930 access list
Show
accessListobjectaccessListfieldsEIP-2930 access list
-
address
stringrequiredhex encoded address
Match pattern:
^0x[0-9a-fA-F]{40}$
-
storageKeys
array<string>required32 byte hex value
Match pattern:
^0x[0-9a-f]{64}$
-
additionalProperties
false
-
-
chainId
stringrequiredChain ID that this transaction is valid on.
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
yParity
stringrequiredThe parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.
Match pattern:
^0x([0-9a-fA-F]?){1,2}$
-
v
stringFor backwards compatibility,
vis optionally provided as an alternative toyParity. This field is DEPRECATED and all use of it should migrate toyParity.Match pattern:
^0x([0-9a-fA-F]?){1,2}$
-
r
stringrequiredr
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
s
stringrequireds
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
additionalProperties
true
Show Option 4 Signed 2930 Transaction object
Signed 2930 Transaction objectSigned 2930 Transaction fields
Transaction information object
Signed 2930 Transaction
Show Transaction information object
Transaction information objectTransaction information fields
-
type
stringrequiredtype
Match pattern:
^0x1$
-
nonce
stringrequirednonce
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
to
null or string
Show Option 1
Contract Creation (null)nullShow Option 2
Addressstring -
gas
stringrequiredgas limit
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
value
stringrequiredvalue
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
input
stringrequiredinput data
Match pattern:
^0x[0-9a-f]*$
-
gasPrice
stringrequiredThe gas price willing to be paid by the sender in wei
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
accessList
array<object>requiredEIP-2930 access list
Show
accessListobjectaccessListfieldsEIP-2930 access list
-
address
stringrequiredhex encoded address
Match pattern:
^0x[0-9a-fA-F]{40}$
-
storageKeys
array<string>required32 byte hex value
Match pattern:
^0x[0-9a-f]{64}$
-
additionalProperties
false
-
-
chainId
stringrequiredChain ID that this transaction is valid on.
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
yParity
stringrequiredThe parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.
Match pattern:
^0x([0-9a-fA-F]?){1,2}$
-
v
stringFor backwards compatibility,
vis optionally provided as an alternative toyParity. This field is DEPRECATED and all use of it should migrate toyParity.Match pattern:
^0x([0-9a-fA-F]?){1,2}$
-
r
stringrequiredr
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
s
stringrequireds
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
additionalProperties
true
Show Option 5 Signed Legacy Transaction object
Signed Legacy Transaction objectSigned Legacy Transaction fields
Transaction information object
Signed Legacy Transaction
Show Transaction information object
Transaction information objectTransaction information fields
-
type
stringrequiredtype
Match pattern:
^0x0$
-
nonce
stringrequirednonce
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
to
null or string
Show Option 1
Contract Creation (null)nullShow Option 2
Addressstring -
gas
stringrequiredgas limit
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
value
stringrequiredvalue
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
input
stringrequiredinput data
Match pattern:
^0x[0-9a-f]*$
-
gasPrice
stringrequiredThe gas price willing to be paid by the sender in wei
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
chainId
stringChain ID that this transaction is valid on.
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
v
stringrequiredv
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
r
stringrequiredr
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
s
stringrequireds
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
-
additionalProperties
true
Errors
Error code: 4444
-
code
4444
-
message
Pruned history unavailable
Examples
eth_getTransactionByBlockNumberAndIndex example
Request
{
"params": [
"0x1442e",
"0x2"
]
}
Response
{
"blockHash": "0x510efccf44a192e6e34bcb439a1947e24b86244280762cbb006858c237093fda",
"blockNumber": "0x422",
"chainId": "0x7e2",
"from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",
"gas": "0x5208",
"gasPrice": "0x3b9aca00",
"hash": "0xa52be92809541220ee0aaaede6047d9a6c5d0cd96a517c854d944ee70a0ebb44",
"input": "0x",
"nonce": "0x1",
"to": "0x627306090abab3a6e1400e9345bc60c78a8bef57",
"transactionIndex": "0x0",
"value": "0x4e1003b28d9280000",
"v": "0xfe7",
"r": "0x84caf09aefbd5e539295acc67217563438a4efb224879b6855f56857fa2037d3",
"s": "0x5e863be3829812c81439f0ae9d8ecb832b531d651fb234c848d1bf45e62be8b9"
}