Getting the balance with an ETH Testnet Wallet is not working anymore.
But the ETH Mainnet is still woking.
//My Code
const GetWalletInfo = async () => {
const account = new CryptoAccount(PrivKey, {
network: "goerli",
});
/* Print Balance */
console.log(await account.getBalance("ETH"));
}
GetWalletInfo()
// Console Error
var error = new Error(message);
^
Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.7.0)
at Logger.makeError (/Users/elisabethbangoura/Desktop/testingBTCAddress/node_modules/@ethersproject/logger/lib/index.js:238:21)
at Logger.throwError (/Users/elisabethbangoura/Desktop/testingBTCAddress/node_modules/@ethersproject/logger/lib/index.js:247:20)
at JsonRpcProvider. (/Users/elisabethbangoura/Desktop/testingBTCAddress/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:609:54)
at step (/Users/elisabethbangoura/Desktop/testingBTCAddress/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23)
at Object.throw (/Users/elisabethbangoura/Desktop/testingBTCAddress/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53)
at rejected (/Users/elisabethbangoura/Desktop/testingBTCAddress/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:21:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
reason: 'could not detect network',
code: 'NETWORK_ERROR',
event: 'noNetwork'
}
Node.js v18.16.0
....
Getting the balance with an ETH Testnet Wallet is not working anymore.
But the ETH Mainnet is still woking.
//My Code
const GetWalletInfo = async () => {
const account = new CryptoAccount(PrivKey, {
network: "goerli",
});
/* Print Balance */
console.log(await account.getBalance("ETH"));
}
GetWalletInfo()
// Console Error
Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.7.0)
at Logger.makeError (/Users/elisabethbangoura/Desktop/testingBTCAddress/node_modules/@ethersproject/logger/lib/index.js:238:21)
at Logger.throwError (/Users/elisabethbangoura/Desktop/testingBTCAddress/node_modules/@ethersproject/logger/lib/index.js:247:20)
at JsonRpcProvider. (/Users/elisabethbangoura/Desktop/testingBTCAddress/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:609:54)
at step (/Users/elisabethbangoura/Desktop/testingBTCAddress/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23)
at Object.throw (/Users/elisabethbangoura/Desktop/testingBTCAddress/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53)
at rejected (/Users/elisabethbangoura/Desktop/testingBTCAddress/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:21:65)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
reason: 'could not detect network',
code: 'NETWORK_ERROR',
event: 'noNetwork'
}
Node.js v18.16.0
....