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

feat!: implement pagination for Account methods #2408

Merged
merged 80 commits into from
Jul 10, 2024

Conversation

Torres-ssf
Copy link
Contributor

@Torres-ssf Torres-ssf commented May 28, 2024

Release notes

In this release, we:

  • Added pagination support to Provider and Account classes

Summary

This PR introduces the following enhancements:

  1. Pagination Support:

    • Added pagination to the getMessages and getCoins methods in both the Provider and Account classes.
    • Implemented pagination for the getBlocks method in the Provider class.
  2. Return Format Update:

    • Updated the return format of the getBalances method in both the Provider and Account classes.

Breaking Changes

// before
const coins = await myWallet.getCoins(baseAssetId); 
const messages = await myWallet.getMessages();
const balances = await myWallet.getBalances();
const blocks = await provider.getBlocks();

// after
const { coins, pageInfo } = await myWallet.getCoins(baseAssetId); 
const { messages, pageInfo } = await myWallet.getMessages();
const { balances } = await myWallet.getBalances();
const { blocks, pageInfo } = await provider.getBlocks();

/*
  The `pageInfo` object contains cursor pagination information one
  can use to fetch subsequent pages selectively and on demand.
*/

Checklist

  • I addedtests to prove my changes
  • I updated — all the necessary docs
  • I reviewed — the entire PR myself, using the GitHub UI
  • I described — all breaking changes and the Migration Guide

@Torres-ssf Torres-ssf added the chore Issue is a chore label May 28, 2024
@Torres-ssf Torres-ssf self-assigned this May 28, 2024
@arboleya arboleya added this to the 0.x post-launch milestone Jun 12, 2024
nedsalk
nedsalk previously approved these changes Jul 8, 2024
Copy link
Contributor

@petertonysmith94 petertonysmith94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📗

Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
79.63%(-0.03%) 71.61%(+0.21%) 77.3%(-0.03%) 79.71%(-0.04%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/account.ts 81.15%
(-3.09%)
63.93%
(-3.23%)
81.81%
(+0%)
80.85%
(-3.07%)
🔴 packages/account/src/providers/provider.ts 68.84%
(+1.27%)
63.82%
(+5.54%)
73.8%
(-0.61%)
68.79%
(+0.98%)

@Torres-ssf Torres-ssf merged commit aa7e656 into master Jul 10, 2024
24 of 34 checks passed
@Torres-ssf Torres-ssf deleted the st/feat/implement-pagination-get-coins branch July 10, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Issue is a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement pagination on Wallet for getCoins / getBalances
7 participants