Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

151
Views
How to connect to several specific backend services in ethers.js

What I want to achieve

I want to connect with my API keys to several providers. I use this code:

export const provider = ethers.getDefaultProvider(NETWORK, {
  etherscan: ETHERSCAN_API_TOKEN,
  infura: { applicationId: INFURA_PROJECT_ID, applicationSecretKey: INFURA_SECRET_KEY },
  pocket: { applicationId: POCKET_PORTAL_ID, applicationSecretKey: POCKET_SECRET_KEY },
});

Problem

When I log out the variable, I get this:

 providerConfigs: [
    {
      provider: [InfuraProvider],
      weight: 1,
      stallTimeout: 2000,
      priority: 1
    },
    {
      provider: [EtherscanProvider],
      weight: 1,
      stallTimeout: 750,
      priority: 1
    },
    {
      provider: [AlchemyProvider],
      weight: 1,
      stallTimeout: 2000,
      priority: 1
    }
  ],

So the pocket key was ignored and the AlchemyProvider comes out of nowhere, which makes me think that this way does not work. Is there another one?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!