Closed herryho closed 10 months ago
I guess that problem is related to ETH_ENDPOINT
and that's why throws the ENS error. I have just tested it on mainnet
and works correctly.
const provider = Provider.getDefaultProvider(types.Network.Mainnet);
const ethProvider = ethers.getDefaultProvider("mainnet");
const PUBLIC_KEY = "0x082b1BB53fE43810f646dDd71AA2AB201b4C6b04";
const PRIVATE_KEY = process.env.PRIVATE_KEY;
const wallet = new Wallet(PRIVATE_KEY, provider, ethProvider);
console.log(`Balance: ${await wallet.getBalance()}`);
Output:
Balance: 43927295500000000
Problem solved. Thanks a lot!
🐛 Bug Report for zksync2-js JavaScript SDK
📝 Description
Provide a clear and concise description of the bug.
When I create a wallet, and try to get the balance of my zkwallet, it throws "Error: an ENS name used for a contract target must be correctly configured (value="", code=UNCONFIGURED_NAME, version=6.8.1)".
🔄 Reproduction Steps
🤔 Expected Behavior
To get the ETH balance of my zkWallet
😯 Current Behavior
Throws Error: an ENS name used for a contract target must be correctly configured (value="", code=UNCONFIGURED_NAME, version=6.8.1)
🖥️ Environment