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

fix(stargate/allBalances): use pagination if there are more than 100 balances #1538

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

phips28
Copy link

@phips28 phips28 commented Jan 6, 2024

I have a Kujira wallet that has more than 100 balances/tokens (~116 at the time writing), therefore the allBalances function does not return all balances, only 100.

This PR changes check if there is a pagination key and gets the next page of balances.

Test I used locally:

    it("returns all balances > 100 with pagination", async () => {
      const client = await StargateClient.connect("https://rpc-kujira.synergynodes.com/");

      const balances = await client.getAllBalances("kujira1xww4yf8atl6sduqap74grkhxna5cw8r8jgw3fj");

      console.log("balances", balances);

      expect(balances.length).toBeGreaterThan(100);

      client.disconnect();
    });

But I cant add a test for it, as balances/tokens can change. If you have an idea how to add a test for it, let me know!

@phips28
Copy link
Author

phips28 commented Jan 20, 2024

@webmaster128 can you review/merge that pls?

@phips28
Copy link
Author

phips28 commented Jan 31, 2024

Can we get this merged pls? or any feedback what to imporove/change?

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.

None yet

1 participant