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

Issue with Curve Function #124

Open
soumyadeeproy12 opened this issue Dec 21, 2022 · 2 comments
Open

Issue with Curve Function #124

soumyadeeproy12 opened this issue Dec 21, 2022 · 2 comments

Comments

@soumyadeeproy12
Copy link

Hello, I'm new using Curve Finance API and also in JS. I'm trying to the replicate the same code that has been given in the example - https://github.com/curvefi/curve-js#general-methods
I'm getting this error in my console:

TypeError: curve.getTVL is not a function
    at file:///Users/new.ts:4:17
    at Generator.next (<anonymous>)
    at file:///Users/new.ts:7:71
    at new Promise (<anonymous>)
    at __awaiter (file:///Users/new.ts:3:12)
    at file:///Users/new.ts:3:13
    at file:///Users/new.ts:33:3
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:530:24)

Does anyone know why is it showing this error?

@neilFtr
Copy link

neilFtr commented Jan 31, 2023

GM sir. I had the same issue with the current release (2.26.3) on Windows.
I was able to solve it by replacing curve.init(parameters) with curve.default.init(parameters) .
You basically need to replace every "curve" call by a curve.default .
Hope it'll works for you

@Macket
Copy link
Contributor

Macket commented Feb 16, 2023

There is no curve.init in that example. It works like this:

(async () => {
    await curve.init('JsonRpc', { url: ETH_RPC }, { gasPrice: 0 });

    console.log(await curve.getTVL());
}()

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

3 participants