feat: move batch utils into shared pkg - #211
Open
taran-a wants to merge 2 commits into
Open
Conversation
taran-a
force-pushed
the
feat/move-batch-utils-into-shared-pkg
branch
from
August 26, 2026 15:29
917041a to
d8a9b0e
Compare
Battambang
approved these changes
Aug 26, 2026
Battambang
left a comment
Contributor
There was a problem hiding this comment.
Have added some automatic description in the PR, feel free to remove if it's too much.
LGTM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consolidates shared async batching utilities into
@metamask/snap-networks-utils.The Solana and Tron token API clients now use the shared chunking helper instead of maintaining equivalent local logic. Stellar now imports the shared batching utilities and removes its duplicate implementation. The shared utility package includes the migrated Stellar test coverage, preserving chunk ordering, bounded batch concurrency, and rejected-request handling.
This pull request improves the sharing and reuse of async batching utilities across packages, updates their usage in wallet snaps, and adds new tests for chunked token metadata fetching. It also removes now-unnecessary local async helpers and makes minor related test and config updates.
Explanation
Async utilities centralization and exports:
batchesAll,batchesAllSettled,batchesAllSettledWithChunks,batchesAllWithChunks,chunks) to@metamask/snap-networks-utils, exporting them from a new entry point and updating the changelog to reflect this addition. [1] [2]stellar-wallet-snapto re-export these utilities from@metamask/snap-networks-utilsinstead of its own implementation.Refactoring usage in wallet snaps:
solana-wallet-snapandtron-wallet-snapto use the sharedchunksutility from@metamask/snap-networks-utilsfor batching token metadata requests, replacing local chunking logic. [1] [2] [3] [4]Test improvements:
Code cleanup:
retryutility fromsolana-wallet-snap.stellar-wallet-snapin favor of the centralized version.Manifest and config updates:
References
Checklist