traderjoe-xyz / joe-sdk

🛠 An SDK for building applications on top of Trader Joe.
MIT License
34 stars 29 forks source link

Only a stupid question... #30

Open salahawk opened 2 years ago

salahawk commented 2 years ago

I just tried to get token data from "@traderjoe-xyz/sdk" When I tried using Fetcher.fetchTokenData(ChainId.AVALANCHE, Token1); it shows the following error:

"Unsupported getDefaultProvider network"

Were you able to help me how I can fix this issue?

I read source code of "joe-sdk" and I can see it's backed by @ethersproject and the problem I found is it does not support Avalanche.

Any help/advice is appreciated!

burgossrodrigo commented 2 years ago

You need to change from getDefaultProvider to jsonRpcProvider because getDefaultProvider doesn't cover avalanche. Btw i think that this packcage as wrecked because they are returning contracts.

salahawk commented 2 years ago

Thanks for your reply, @burgossrodrigo Definitely agree with your idea. And yes, the package is wrecked! That's why I built the library myself and using the custom traderjoe-xyz/sdk for my project.

Thanks again!