I have list of transactions in a file & I have grabbed all of them & I confirmed that they all were grabbed, what I am trying to do is get infos on all transactions 1 by 1
This code is returning me an error
D:\NFT\codes\node_modules@project-serum\anchor\node_modules@solana\web3.js\lib\index.cjs.js:6853 throw new SolanaJSONRPCError(res.error, 'failed to get transaction'); ^
SolanaJSONRPCError: failed to get transaction: Invalid param: WrongSize
import * as anchor from "@project-serum/anchor";
import base58 from "bs58";
import * as fs from "fs";
const endpoint = "https://api.mainnet-beta.solana.com";
const connect = new anchor.web3.Connection(endpoint);
const txids = fs.readFileSync("Dragon.csv", "utf-8").split("\n");
const URLs = txids.map((txid) => txid.split(",")[2]);
// console.log(URLs)
async function main() {
for (let i = 0; i < URLs.length; i++) {
const txn = URLs[i].split("tx/")[1];
console.log(txn);
const tx = await connect.getParsedTransaction(txn);
console.log(tx);
}
}
main();