Skip to content

feat: add multi-token batch payment support to pool_pay#18

Merged
MarcusDavidG merged 2 commits into
stellar-sharpy:mainfrom
Marvy247:feat/pool-pay-multi-token
Jun 21, 2026
Merged

feat: add multi-token batch payment support to pool_pay#18
MarcusDavidG merged 2 commits into
stellar-sharpy:mainfrom
Marvy247:feat/pool-pay-multi-token

Conversation

@Marvy247

Copy link
Copy Markdown
Contributor

Description

Currently pool_pay assumes all invoices share the same token. This change groups payments by token (using each invoice's tokens.get(0) as the payment token), performs one transfer per unique token, then distributes to individual invoices.

Changes

  • lib.rs: Rewrote pool_pay to group payments by token using a Map<Address, i128> before transferring. Also fixed a missing escrow release timestamp when an escrow invoice is fully funded via pool_pay (the escrow state key was never written, unlike the single pay function).
  • test.rs: Added 3 new tests — test_pool_pay_multi_token, test_pool_pay_multi_token_same_token_grouped, and test_pool_pay_partial_multi_token — plus a setup_with_tokens helper that registers Stellar asset contracts and mints tokens to the payer.

Related issue

Closes #3

Marvy247 and others added 2 commits June 20, 2026 13:42
Group payments by token across invoices and perform one transfer per
token, enabling batch payment of invoices using different tokens in a
single pool_pay call. Also fixes missing escrow release timestamp when
an escrow invoice is fully funded via pool_pay.

Closes stellar-sharpy#3
@MarcusDavidG MarcusDavidG merged commit f0b0c81 into stellar-sharpy:main Jun 21, 2026
1 check failed
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.

Add batch payment support to pool_pay across different tokens

2 participants