Skip to main content

eth_getTransactionByBlockNumberAndIndex

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

Params

(2)

1. Block (required)

(one of)
string
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$

2. Transaction index (required)

string
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$

Result

(Transaction information)
(one of)
blockHash
string
required
Match pattern:
^0x[0-9a-f]{64}$
blockNumber
string
required
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$
from
string
required
Match pattern:
^0x[0-9,a-f,A-F]{40}$
hash
string
required
Match pattern:
^0x[0-9a-f]{64}$
transactionIndex
string
required
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$
type
string
required
Match pattern:
^0x([0-9,a-f,A-F]?){1,2}$
nonce
string
required
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$
to
string
Match pattern:
^0x[0-9,a-f,A-F]{40}$
gas
string
required
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$
value
string
required
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$
input
string
required
Match pattern:
^0x[0-9a-f]*$
maxPriorityFeePerGas
string
required

Maximum fee per gas the sender is willing to pay to miners in wei

Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$
maxFeePerGas
string
required

The 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([1-9a-f]+[0-9a-f]*|0)$
accessList
array[Access list entry]
required

EIP-2930 access list

address
string
Match pattern:
^0x[0-9,a-f,A-F]{40}$
storageKeys
array[string]
chainId
string
required

Chain ID that this transaction is valid on.

Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$
yParity
string
required

The parity (0 for even, 1 for odd) of the y-value of the secp256k1 signature.

Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$
r
string
required
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$
s
string
required
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$

Params

Block

Transaction index


Request

await window.ethereum.request({
"method": "eth_getTransactionByBlockNumberAndIndex",
"params": [
null,
null
]
});