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]: sdk.getTokenBalances() error: unreachable #354

Open
1 task done
rsodre opened this issue Dec 9, 2024 · 0 comments
Open
1 task done

[Bug]: sdk.getTokenBalances() error: unreachable #354

rsodre opened this issue Dec 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@rsodre
Copy link
Contributor

rsodre commented Dec 9, 2024

Dojo.js Version

1.0.2

What happened?

Calling sdk.getTokenBalances() with empty (or valid) account_addresses: string[] returns the error:

Uncaught RuntimeError: unreachable

Screenshot 2024-12-09 at 20 30 18

What is the expected behavior?

We should be able to fetch all tokens without errors.

Steps to reproduce

Note: I am using the latest torii from main branch, which includes dojo#2777

These snippets will raise the error.
It looks like the error happens every time there is a result from torii.

  useEffect(() => {
    const _fetch = async () => {
      // const response: Token[] = await sdk.getTokens([])
      const response: TokenBalance[] = await sdk.getTokenBalances(
        [], // accounts
        [], // contracts
      )
      console.log("sdk.getTokens() =>>>>>>>>>", response)
    }
    if (sdk) {
      _fetch()
    }
  }, [sdk])
  const { address } = useAccount()
  useEffect(() => {
    const _fetch = async () => {
      // const response: Token[] = await sdk.getTokens([])
      const response: TokenBalance[] = await sdk.getTokenBalances(
        [address], // accounts
        [], // contracts
      )
      console.log("sdk.getTokens() =>>>>>>>>>", response)
    }
    if (SDK && address) {
      _fetch()
    }
  }, [SDK, address])

Additional context

Looks like requests are processed Torii and received by the client:

Screenshot 2024-12-09 at 20 56 38

Screenshot 2024-12-09 at 20 56 28

Is there an existing issue for this?

  • I have searched the existing issues and verified no issue exits for this problem.
@rsodre rsodre added the bug Something isn't working label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant