Parameters
- blockHashstringREQUIRED
The block hash
- indexstringREQUIRED
An integer of the transaction index position encoded as a hexadecimal
Returns
- objectobject
The transaction response object or null if no transaction is found
- blockHashstring
The hash of the block where this transaction was included, null when pending
- blockNumberstring
The block number where this transaction was included, null when pending
- fromstring
The address of the sender
- gasstring
The gas provided by the sender encoded as hexadecimal
- gasPricestring
The gas price provided by the sender in wei encoded as hexadecimal
- hashstring
The hash of the transaction
- inputstring
The data sent along with the transaction
- noncestring
The number of transactions made by the sender before this one encoded as hexadecimal
- tostring
The address of the receiver, null when the transaction created a contract
- transactionIndexstring
The index position of the transaction in the block, null when pending
- valuestring
The value transferred in wei encoded as hexadecimal
- typestring
The transaction type
- chainIdstring
The chain id of the transaction if present
- vstring
The standardized V field of the transaction signature
- rstring
The R field of the transaction signature
- sstring
The S field of the transaction signature
1curl -X POST "https://docs-demo.xlayer-mainnet.quiknode.pro/" \2-H "Content-Type: application/json" \3-d '{4"jsonrpc": "2.0",5"method": "eth_getTransactionByBlockHashAndIndex",6"params": [7"0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1",8"0x0"9],10"id": 111}'
1curl -X POST "https://docs-demo.xlayer-mainnet.quiknode.pro/" \2-H "Content-Type: application/json" \3-d '{4"jsonrpc": "2.0",5"method": "eth_getTransactionByBlockHashAndIndex",6"params": [7"0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1",8"0x0"9],10"id": 111}'
1import { ethers } from "ethers";23async function main() {4const provider = new ethers.JsonRpcProvider("https://docs-demo.xlayer-mainnet.quiknode.pro/");5const response = await provider.send("eth_getTransactionByBlockHashAndIndex", [6"0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1",7"0x0"8]);9console.log(response);10}1112main();
1import { ethers } from "ethers";23async function main() {4const provider = new ethers.JsonRpcProvider("https://docs-demo.xlayer-mainnet.quiknode.pro/");5const response = await provider.send("eth_getTransactionByBlockHashAndIndex", [6"0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1",7"0x0"8]);9console.log(response);10}1112main();
1import json2from web3 import Web3, HTTPProvider3w3 = Web3(HTTPProvider('https://docs-demo.xlayer-mainnet.quiknode.pro/'))4response = w3.provider.make_request("eth_getTransactionByBlockHashAndIndex", ["0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1","0x0"])5print(response)
1import json2from web3 import Web3, HTTPProvider3w3 = Web3(HTTPProvider('https://docs-demo.xlayer-mainnet.quiknode.pro/'))4response = w3.provider.make_request("eth_getTransactionByBlockHashAndIndex", ["0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1","0x0"])5print(response)
1import { createPublicClient, http } from 'viem'23async function main() {4const client = createPublicClient({5transport: http('https://docs-demo.xlayer-mainnet.quiknode.pro/')6})78const result = await client.request({9method: 'eth_getTransactionByBlockHashAndIndex',10params: [11"0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1",12"0x0"13]14})1516console.log(result)17}1819main()
1import { createPublicClient, http } from 'viem'23async function main() {4const client = createPublicClient({5transport: http('https://docs-demo.xlayer-mainnet.quiknode.pro/')6})78const result = await client.request({9method: 'eth_getTransactionByBlockHashAndIndex',10params: [11"0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1",12"0x0"13]14})1516console.log(result)17}1819main()
1import { QuicknodeSdk } from '@quicknode/sdk'23const qn = new QuicknodeSdk({})45const result = await qn.rpc.call(6'eth_getTransactionByBlockHashAndIndex',7[8"0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1",9"0x0"10],11undefined,12'https://docs-demo.xlayer-mainnet.quiknode.pro/'13)1415console.log(result)
1import { QuicknodeSdk } from '@quicknode/sdk'23const qn = new QuicknodeSdk({})45const result = await qn.rpc.call(6'eth_getTransactionByBlockHashAndIndex',7[8"0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1",9"0x0"10],11undefined,12'https://docs-demo.xlayer-mainnet.quiknode.pro/'13)1415console.log(result)
1import asyncio2from quicknode_sdk import QuicknodeSdk, SdkFullConfig34async def main():5qn = QuicknodeSdk(SdkFullConfig(api_key=None))6result = await qn.rpc.call(7"eth_getTransactionByBlockHashAndIndex",8[9"0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1",10"0x0"11],12endpoint_url="https://docs-demo.xlayer-mainnet.quiknode.pro/",13)14print(result)1516asyncio.run(main())
1import asyncio2from quicknode_sdk import QuicknodeSdk, SdkFullConfig34async def main():5qn = QuicknodeSdk(SdkFullConfig(api_key=None))6result = await qn.rpc.call(7"eth_getTransactionByBlockHashAndIndex",8[9"0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1",10"0x0"11],12endpoint_url="https://docs-demo.xlayer-mainnet.quiknode.pro/",13)14print(result)1516asyncio.run(main())
1require "quicknode_sdk"23qn = QuicknodeSdk::SDK.from_config(api_key: nil)45result = qn.rpc.call(6method: "eth_getTransactionByBlockHashAndIndex",7params: [8"0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1",9"0x0"10],11endpoint_url: "https://docs-demo.xlayer-mainnet.quiknode.pro/"12)1314puts result
1require "quicknode_sdk"23qn = QuicknodeSdk::SDK.from_config(api_key: nil)45result = qn.rpc.call(6method: "eth_getTransactionByBlockHashAndIndex",7params: [8"0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1",9"0x0"10],11endpoint_url: "https://docs-demo.xlayer-mainnet.quiknode.pro/"12)1314puts result
1use quicknode_sdk::{QuicknodeSdk, SdkFullConfig};23#[tokio::main]4async fn main() -> Result<(), Box<dyn std::error::Error>> {5let qn = QuicknodeSdk::new(&SdkFullConfig::keyless())?;6let result = qn7.rpc8.call(9"eth_getTransactionByBlockHashAndIndex",10Some(serde_json::json!([11"0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1",12"0x0"13])),14None,15Some("https://docs-demo.xlayer-mainnet.quiknode.pro/".into()),16)17.await?;1819println!("{result}");20Ok(())21}
1use quicknode_sdk::{QuicknodeSdk, SdkFullConfig};23#[tokio::main]4async fn main() -> Result<(), Box<dyn std::error::Error>> {5let qn = QuicknodeSdk::new(&SdkFullConfig::keyless())?;6let result = qn7.rpc8.call(9"eth_getTransactionByBlockHashAndIndex",10Some(serde_json::json!([11"0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1",12"0x0"13])),14None,15Some("https://docs-demo.xlayer-mainnet.quiknode.pro/".into()),16)17.await?;1819println!("{result}");20Ok(())21}
1const body = {2jsonrpc: '2.0',3method: 'eth_getTransactionByBlockHashAndIndex',4params: ["0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1","0x0"],5id: 16}78async function main() {9const response = await fetch('https://docs-demo.xlayer-mainnet.quiknode.pro/', {10method: 'POST',11headers: {'Content-Type': 'application/json'},12body: JSON.stringify(body)13})14const data = await response.json()15console.log(data)16}1718main()
1const body = {2jsonrpc: '2.0',3method: 'eth_getTransactionByBlockHashAndIndex',4params: ["0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1","0x0"],5id: 16}78async function main() {9const response = await fetch('https://docs-demo.xlayer-mainnet.quiknode.pro/', {10method: 'POST',11headers: {'Content-Type': 'application/json'},12body: JSON.stringify(body)13})14const data = await response.json()15console.log(data)16}1718main()
1import requests2import json34url = "https://docs-demo.xlayer-mainnet.quiknode.pro/"56payload = json.dumps(json.loads("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByBlockHashAndIndex\",\"params\":[\"0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1\",\"0x0\"],\"id\":1}"))7headers = {8'Content-Type': 'application/json'9}1011response = requests.request("POST", url, headers=headers, data=payload)1213print(response.text)
1import requests2import json34url = "https://docs-demo.xlayer-mainnet.quiknode.pro/"56payload = json.dumps(json.loads("{\"jsonrpc\":\"2.0\",\"method\":\"eth_getTransactionByBlockHashAndIndex\",\"params\":[\"0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1\",\"0x0\"],\"id\":1}"))7headers = {8'Content-Type': 'application/json'9}1011response = requests.request("POST", url, headers=headers, data=payload)1213print(response.text)
1require "uri"2require "json"3require "net/http"45uri = URI("https://docs-demo.xlayer-mainnet.quiknode.pro/")67payload = {8jsonrpc: "2.0",9id: 1,10method: "eth_getTransactionByBlockHashAndIndex",11params: ["0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1","0x0"]12}1314request = Net::HTTP::Post.new(uri)15request["Content-Type"] = "application/json"16request.body = JSON.generate(payload)1718response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|19http.request(request)20end2122puts response.body
1require "uri"2require "json"3require "net/http"45uri = URI("https://docs-demo.xlayer-mainnet.quiknode.pro/")67payload = {8jsonrpc: "2.0",9id: 1,10method: "eth_getTransactionByBlockHashAndIndex",11params: ["0x6a370a193c5ccb811abf53e162a870a8f96c6cbc5b61eb8e6add51b983e407f1","0x0"]12}1314request = Net::HTTP::Post.new(uri)15request["Content-Type"] = "application/json"16request.body = JSON.generate(payload)1718response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|19http.request(request)20end2122puts response.body
1{2"jsonrpc": "2.0",3"id": 1,4"result": null5}
1{2"jsonrpc": "2.0",3"id": 1,4"result": null5}