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

API doesn't fetch the Factory Pools #143

Open
FJ-Riveros opened this issue Mar 14, 2023 · 1 comment
Open

API doesn't fetch the Factory Pools #143

FJ-Riveros opened this issue Mar 14, 2023 · 1 comment

Comments

@FJ-Riveros
Copy link

FJ-Riveros commented Mar 14, 2023

Hi! Have been experiencing this issue since a couple days (this worked before). Hope anyone can help me with this.
Here is a live example of the error: Sandbox

API doesn't fetch the Factory Pools

In order to get some routes I need to fetch the Factory Pools and the Crypto Factory Pools, as stated in the docs, but since a couple days I can't fetch the Factory Pools, instead it throws an error.

Expected Behavior

Connects to the Factory Pools.

Actual Behavior

Throws this error:

TypeError: Cannot read properties of undefined (reading 'map')
     at new Interface (/src/packages/service/node_modules/@ethersproject/abi/lib/interface.js:100:65)
     at BaseContract.getInterface (/src/packages/service/node_modules/@ethersproject/contracts/lib/index.js:764:16)
     at Contract.BaseContract (/src/packages/service/node_modules/@ethersproject/contracts/lib/index.js:616:116)
     at new Contract (/src/packages/service/node_modules/@ethersproject/contracts/lib/index.js:1053:42)
     at /src/packages/service/node_modules/@curvefi/api/lib/factory/factory-api.js:113:27
     at Array.forEach (<anonymous>)
     at Curve.setFactorySwapContracts (/src/packages/service/node_modules/@curvefi/api/lib/factory/factory-api.js:110:21)
     at Curve.<anonymous> (/src/packages/service/node_modules/@curvefi/api/lib/factory/factory-api.js:186:45)
     at step (/src/packages/service/node_modules/@curvefi/api/lib/factory/factory-api.js:44:23)
     at Object.next (/src/packages/service/node_modules/@curvefi/api/lib/factory/factory-api.js:25:53)
     at fulfilled (/src/packages/service/node_modules/@curvefi/api/lib/factory/factory-api.js:16:58)
     at processTicksAndRejections (node:internal/process/task_queues:96:5)

Steps to Reproduce

Step 1: Connect to curve API with the RPC provider and specifying the chain id, 1 in this case (mainnet).

await curve.init(
    'JsonRpc',
    { url: getRpcProvider() },
    {
      chainId: 1,
    },
  );

Step 2: Try the connection to the Factory Pools.

await curve.fetchFactoryPools();

Additional Information

  • To be clear, this worked for me before, but now is throwing the error.
  • The version that I'm using is the 2.23.0, also tried the latest version 2.28.3 but facing the same error.
  • Running this on Mainnet.
@Macket
Copy link
Contributor

Macket commented Aug 1, 2023

It should work now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants