This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require("path"); | |
require("dotenv").config({ path: path.resolve(process.cwd(), ".env") }); | |
const infuraRPC = `${process.env.INFURA_URL}${ process.env.INFURA_KEY }`; | |
const ethers = require("ethers"); | |
const provider = new ethers.providers.JsonRpcProvider(infuraRPC); | |
const args = process.argv.slice(2); | |
const hash = (args.length >= 1)? args[0] : process.env.HASH; | |
console.log("tx hash:", hash); | |
console.log("provider:", infuraRPC); |