Skip to content

Conversation

@waynebruce0x
Copy link
Collaborator

No description provided.

@waynebruce0x
Copy link
Collaborator Author

@@ -1,7 +1,7 @@
import fetch from "node-fetch";
import { cachedFetch } from "@defillama/sdk/build/util/cache";
Copy link
Member

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

Copy link
Member

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

Copy link
Collaborator Author

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


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"})
Copy link
Member

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

@@ -1,4 +1,4 @@
import { getPrices } from "./utils";
import { getPrices } from "@defillama/sdk/build/util/coinsApi";
Copy link
Member

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

Copy link
Collaborator Author

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

@waynebruce0x waynebruce0x marked this pull request as ready for review October 27, 2025 13:14
@waynebruce0x waynebruce0x marked this pull request as draft October 27, 2025 13:17
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

Successfully merging this pull request may close these issues.

2 participants