What is Web3Provider any
parameter?
#3272
Replies: 3 comments
-
This is the TS type. I guess since the provider may come from many source. It would be hard to define the type of the provider. By setting it to any it allow any type to be passed. https://www.typescriptlang.org/docs/handbook/basic-types.html#any |
Beta Was this translation helpful? Give feedback.
-
Note that it's a JS string that is passed as a second parameter to the constructor and not removed by typescript compiler. It means that the provider network is allowed to change. See #866. |
Beta Was this translation helpful? Give feedback.
-
The documentation can certainly be expanded, but here is what is currently included. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Suggestion
const web3Provider = new ethers.providers.Web3Provider(provider, "any");
What is this
any
for in parameters? There is no mention of it in the main documentation.Beta Was this translation helpful? Give feedback.
All reactions