Skip to content

feat(sdk): implement multicall batching for read-only queries - #33

Merged
p3ris0n merged 1 commit into
BCPathway:mainfrom
EDOHWARES:feat/sdk-batching
Apr 24, 2026
Merged

feat(sdk): implement multicall batching for read-only queries#33
p3ris0n merged 1 commit into
BCPathway:mainfrom
EDOHWARES:feat/sdk-batching

Conversation

@EDOHWARES

Copy link
Copy Markdown
Contributor

Description

This PR augments the @bc-forge/sdk with batching capabilities for read-only contract queries. It addresses the overhead of sequential RPC calls when querying multiple data points (e.g., balances for a list of holders) by consolidating requests into asynchronous groupings.

Key Changes

  • Batch Execution Engine: Added an internal executeBatch helper to bcForgeClient that processes arrays in configurable chunks using Promise.all.
  • Native Balance Batching: Implemented getBalances(addresses[], batchSize) for efficient multi-address lookups.
  • RPC Protection: Integrated batch limits (default: 10) to prevent aggressive rate-limiting from Soroban RPC endpoints.

Acceptance Criteria

  • Map arrays iterating explicitly requesting Promise.all logic.
  • Consolidate query limits protecting RPC configurations.
  • Ensure SDK output variants format object results relative to requests.

Closes #28

@drips-wave

drips-wave Bot commented Apr 22, 2026

Copy link
Copy Markdown

@EDOHWARES Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@EDOHWARES

EDOHWARES commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

@p3ris0n , pls approve workflow so I confirm if it passes.

@p3ris0n
p3ris0n merged commit 80c9c6a into BCPathway:main Apr 24, 2026
2 checks passed
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.

[SDK]: Implement multicall/batching for read-only queries

2 participants