Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ethDefaultProvider does not pass api key to PocketProvider #2890

Closed
tryba opened this issue Apr 12, 2022 · 3 comments
Closed

ethDefaultProvider does not pass api key to PocketProvider #2890

tryba opened this issue Apr 12, 2022 · 3 comments
Assignees
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@tryba
Copy link

tryba commented Apr 12, 2022

Ethers Version

main

Search Terms

defaultProvider, PocketProvider, api key

Describe the Problem

When constructing a default provider using the following:

ethers.getDefaultProvider(network.name, {infura: INFURA_ID, etherscan: ETHERSCAN_ID, alchemy: ALCHEMY_ID, pocket: POCKET_ID});

A fallback provider is created. Inspecting the resulting object shows that the Pocket Provider apiKey is the default (which exists in the code here) instead of my configured key.

We can see that the configuration is not passed to the constructor on this line.

Code Snippet

`
const provider = ethers.getDefaultProvider(network.name, {pocket: POCKET_ID});
if(provider.providerConfigs.find(x => { 
  return x.provider.constructor.name == "PocketProvider"
}).provider.applicationId !== POCKET_ID){
  console.error("These keys don't match");
}
`

Contract ABI

No response

Errors

No response

Environment

No response

Environment (Other)

No response

@tryba tryba added the investigate Under investigation and may be a bug. label Apr 12, 2022
@ricmoo ricmoo added bug Verified to be an issue. on-deck This Enhancement or Bug is currently being worked on. and removed investigate Under investigation and may be a bug. labels Apr 12, 2022
@ricmoo
Copy link
Member

ricmoo commented Apr 12, 2022

You are correct! This will go out in the next v5 release.

@tryba
Copy link
Author

tryba commented Apr 12, 2022

Awesome! Thanks so much!

@ricmoo
Copy link
Member

ricmoo commented Apr 13, 2022

This should be fixed in 5.6.3. Please try it out and let me know if there are still any problems.

Thanks! :)

@ricmoo ricmoo added fixed/complete This Bug is fixed or Enhancement is complete and published. and removed on-deck This Enhancement or Bug is currently being worked on. labels Apr 13, 2022
@ricmoo ricmoo closed this as completed May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

No branches or pull requests

2 participants