new ethers.JsonRpcProvider('http://127.0.0.1:8545') #4328
Unanswered
gurwindersinghdev
asked this question in
Q&A
Replies: 2 comments 1 reply
-
I believe it's logging an empty object for the base object because v6 uses Proxy objects, so the console can't directly print the underlying object's properties. If you just want to see a list of all the properties you can call, you can loop through the prototypes with For example: function logAllProperties(obj) {
if (Object.getPrototypeOf(obj) === null) {
return;
}
console.log(Object.getOwnPropertyNames(obj));
logAllProperties(Object.getPrototypeOf(obj));
}
logAllProperties(hardhat);
[]
[ 'constructor', '_getConnection', 'send', '_send' ]
[ 'constructor', '_getSubscriber', 'pollingInterval' ]
[
'constructor', '_getOption',
'_network', '_perform',
'_detectNetwork', '_start',
'_waitUntilReady', '_getSubscriber',
'ready', 'getRpcTransaction',
'getRpcRequest', 'getRpcError',
'send', 'getSigner',
'listAccounts', 'destroy'
]
... |
Beta Was this translation helpful? Give feedback.
1 reply
-
"devDependencies": { NPX HARDHAT CONSOLE
it is only working in hardhat oldest version |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Local hardhat test network
npx hardhat console
const hardhat = new ethers.JsonRpcProvider('http://127.0.0.1:8545')
it doesn't fetch the json object and its properties, instead of that it is only showing me as the output ( JsonRpcProvider {} )
it works totally fine in ethers 5.7.2 library ( no issue so far there)
how can i fetch the all json object and its propeties.
Welcome to Node.js v16.17.0.
Type ".help" for more information.
Beta Was this translation helpful? Give feedback.
All reactions