Skip to content

ethDefaultProvider does not pass api key to PocketProvider #2890

@tryba

Description

@tryba

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

Metadata

Metadata

Assignees

Labels

bugVerified to be an issue.fixed/completeThis Bug is fixed or Enhancement is complete and published.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions