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

BUG: Returned values aren't valid #1

Open
firepol opened this issue Dec 8, 2022 · 3 comments
Open

BUG: Returned values aren't valid #1

firepol opened this issue Dec 8, 2022 · 3 comments

Comments

@firepol
Copy link

firepol commented Dec 8, 2022

Hi, please try the react example in this repo.

In the Form.tsx file

After const wrappedTrades = await (sdk.crossChain.calculateTrade(fromToken, String(amount), toToken))

Add: console.log(wrappedTrades)

Try to calculate a swap between BNB and Polygon, amount 1.

I get in the browser console a bunch of errors with trade set to null.

image

Errors for all trades:

Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.

Are you experiencing some issues right now or...?

I think a few days ago it was working...

@firepol
Copy link
Author

firepol commented Dec 8, 2022

Fun fact. it seems it was a temporary issue, works now (with not so many trades set as null + error). Still, if a trade has error I wonder why does it even show up in the results...

@firepol firepol closed this as completed Dec 8, 2022
@firepol firepol reopened this Dec 8, 2022
@firepol
Copy link
Author

firepol commented Dec 8, 2022

Actually, still having the same issue:

image

Trying to calculate a trade from Avalanche (AVAX) to Polygon (MATIC) and I get all trades null in the results, as in the screenshow above.

I I try the same trade using the official rubic exchange, of course there it works:

image

Can it be because I'm working on localhost?

UPDATE

You can test using my example, I added avalanche and more coins to test:

See PR #2

@firepol
Copy link
Author

firepol commented Dec 9, 2022

I also migrated the react example to rubic sdk v3, in case it helps:

https://github.com/firepol/rubic-sdk-example/tree/rubic-sdk-v3

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

1 participant