-
Hi guys, What does that means and when should we declare new? Don't want to visit that page I got you, those 3 lines of code is bellow. Code :- let provider = new ethers.providers.JsonRpcProvider(process.env.RPC_URL);
let wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider);
const contractFactory = new ethers.ContractFactory(abi, binary, wallet); I found answer in stack overflown https://stackoverflow.com/a/30478240 but I didn't understood what does the window object mean?? I'm facing some issue with opening the link please try to copy it and then paste. Sorry for the inconvenience.. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The Ethers allow you to create a provider to connect to your Blockchain, so you can instantiate a new provider with new ethers.providers.JsonRpcProvider(process.env.RPC_URL); and then you safe it your own declared variable Do you need a Wallet, then make a new Wallet with if you dont want to create something, because you just want something, like a string then you just call a function. f.e. LikeThis |
Beta Was this translation helpful? Give feedback.
The
new
Keyword says that you intaniate a new Object.I guess the best way to explain it is to refer to this Video.
He explains the new Keyword and what does it mean.
FireShip Javascript - Refresher
Ethers allow you to create a provider to connect to your Blockchain, so you can instantiate a new provider with
and then you safe it your own declared variable
Do you need a Wallet, then make a new Wallet with
new ethers.Wallet()
Do you need a XY, then make a new XY with
new XY()
and so on
if you dont want to create something, because you just want something, like a string then you just call a function. f.e. LikeThis