You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add split payments support for Tempo charges (#104)
* feat: add split payments support for Tempo charges
Port of mpp-rs PR #180. Allows a single charge to be split across
multiple recipients.
Changes:
- Split model and splits field on MethodDetails (schemas)
- get_transfers() computes ordered transfer list (primary + splits)
- Multi-transfer verification in receipt logs and transaction calldata
- Order-insensitive matching with memo-specificity sorting
- Client builds multiple Call objects when splits present
- Server charge() accepts splits parameter
- Scope binding: memo and splits compared in verify flow
* chore: add changelog
* fix: address cyclops review findings for split payments
- _parse_memo_bytes: raise VerificationError on invalid explicit memos
instead of silently downgrading to None (fail-closed)
- Memo-less transfers strictly require TRANSFER_SELECTOR only, rejecting
transferWithMemo to prevent cross-intent double spending
- Gas estimation sums estimates across all calls in split batches
instead of using only the first call
- Reject splits + fee_payer=True until a split-aware sponsor is available
* test: add coverage for cyclops fix behaviors
- _parse_memo_bytes: valid input, invalid hex, wrong length, empty
- _match_single_transfer_calldata: memo strictness, no-memo rejection
- Log verification: memo-less single/multi rejects TransferWithMemo
- splits + fee_payer: raises ValueError
- get_transfers: invalid/short memos on primary and split
* fix: resolve split-payments lint failures
* fix: avoid unbound gas estimate data
* fix: return MatchedTransferLog lists from verify methods for memo binding
* fix: update split payment tests for list return type
_verify_transfer_logs and _verify_single_transfer_log now return
list[MatchedTransferLog] instead of bool (for memo binding support).
Update assertions from identity checks (is True/is False) to
truthiness checks (assert result/assert not result).
Also fix test_single_transfer_rejects_transfer_with_memo_log: when
memo=None, TransferWithMemo logs ARE accepted in the single-transfer
path — memo binding is checked later by _assert_challenge_bound_memo.
* style: format intents.py with ruff
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Added split payments support for Tempo charges, allowing a single charge to be split across multiple recipients. Port of [mpp-rs PR #180](https://github.com/tempoxyz/mpp-rs/pull/180).
Added split payments support for Tempo charges, allowing a single charge to be split across multiple recipients. Port of [mpp-rs PR #180](https://github.com/tempoxyz/mpp-rs/pull/180).
0 commit comments