Skip to content

ethersjs

npm install -g ethers@5.3

Get Confirmations of BLock

TODO

// npm install --save ethers
const { ethers } = require("ethers");
mah_hash = ethers.utils.namehash("auth.eth")
mah_hash = ethers.utils.namehash("paulmullins.eth")
console.log(mah_hash)
const { ethers } = require("ethers");
async function getChainInfo() {
    let provider = new ethers.providers.JsonRpcProvider("http://127.0.0.1:8545")
    tmpBlockNumber = await provider.getBlockNumber()
    console.log(tmpBlockNumber)
    tmpChainID = await provider._networkPromise
    tmpChainID = tmpChainID.chainId
    console.log(tmpChainID)
}
getChainInfo()