-
Couldn't load subscription status.
- Fork 1.1k
V2 Chain Assets #10820
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
base: master
Are you sure you want to change the base?
V2 Chain Assets #10820
Conversation
defi/l2/adapters/ada.ts
Outdated
| @@ -1,7 +1,7 @@ | |||
| import fetch from "node-fetch"; | |||
| import { cachedFetch } from "@defillama/sdk/build/util/cache"; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, no. Lets not use this path @defillama/sdk/build/... in the future, once the sdk is published, you can get it via sdk.cache.cachedFetch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for the runInPromisePool in the next file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks - I'll change these when the SDK is out
defi/l2/adapters/ada.ts
Outdated
|
|
||
| export async function fetchAdaTokens(): Promise<any[]> { | ||
| const res = await fetch(`https://api.muesliswap.com/token-list`).then((r) => r.json()); | ||
| const res = await cachedFetch({key: "muesliswap-token-list", endpoint: "https://api.muesliswap.com/token-list"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can skip the key here if you want, it gets computed from endpoint as hash if key is missing for get requests
defi/l2/excluded.ts
Outdated
| @@ -1,4 +1,4 @@ | |||
| import { getPrices } from "./utils"; | |||
| import { getPrices } from "@defillama/sdk/build/util/coinsApi"; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check if this function works the same as the one you are replacing, also, same comment about using the build/..
The reason is, if something is not exposed by the SDK, we assume it is not used anywhere and can nuke it by mistake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this here with the SDK branch and it works the same - I was planning on replacing the relevant code in other parts of the repo once the SDK changes have been released
No description provided.