Skip to content

Feature/issue 520 523 split features - #580

Merged
Kingsman-99 merged 5 commits into
Stellar-split:mainfrom
D-Ochuko:feature/issue-520-523-split-features
Jul 30, 2026
Merged

Feature/issue 520 523 split features#580
Kingsman-99 merged 5 commits into
Stellar-split:mainfrom
D-Ochuko:feature/issue-520-523-split-features

Conversation

@D-Ochuko

Copy link
Copy Markdown
Contributor

Summary

Adds four independent SDK primitives, each addressing one issue:

  • Split payment rollback coordinator (src/splitRollbackCoordinator.ts): records a per-leg checkpoint for multi-recipient split payments, lets callers mark each leg's application-layer acknowledgement outcome, and exposes initiateRollback to identify incomplete legs and persist a rollback record via src/snapshot.ts. Wired into StellarSplitClient.submitPayment's waterfall path (getRollbackCoordinator()), which now opens a checkpoint and marks all submitted legs successful immediately after an atomic on-chain submission.
  • Invoice payment progress tracker (src/paymentProgressTracker.ts): aggregates per-recipient payment status into a single InvoicePaymentProgress snapshot via subscribe(invoiceId, onProgress), polling each recipient leg independently with InvoiceStatusPoller and emitting invoiceProgressUpdated. Includes tranche progress when the invoice defines one (src/trancheProgress.ts).
  • XLM-to-fiat price oracle adapter (src/priceOracle.ts): defines the PriceOracleAdapter contract (src/types.ts) and ships CoinGeckoPriceOracle, a default implementation backed by CoinGecko's /simple/price endpoint, with a new TTL-based RateCache (src/rateCache.ts). convertFiatToAsset in src/currencyConverter.ts uses a supplied oracle to convert fiat amounts to asset amounts. StellarSplitClientConfig accepts an optional priceOracle.
  • Strict-send / strict-receive path query builder (src/pathQueryBuilder.ts): encapsulates Horizon path query assembly, validation, execution, and caching behind PathQueryBuilder. src/pathRouter.ts is refactored to delegate to it instead of duplicating query/caching logic inline.

Changes by commit

Test plan

  • npm run build
  • npm test
  • Manually exercise RollbackCoordinator.begin/markLegSuccess/markLegFailed/getIncomplete/initiateRollback against a simulated post-submission failure
  • Manually exercise PaymentProgressTracker.subscribe/unsubscribe against mocked per-recipient status responses and confirm percentComplete increments as legs settle
  • Manually exercise CoinGeckoPriceOracle.getPrice against mocked fetch responses, including a 429 (expect RateLimitError)
  • Manually exercise PathQueryBuilder.forStrictSend/forStrictReceive/execute against mocked Horizon responses, including invalid-parameter cases (expect InvalidPathQueryError)

Note: this repo currently has pre-existing TypeScript/build issues unrelated to this change (see npx tsc --noEmit on main), so CI may not be fully green independent of this PR.

Closes #520
Closes #521
Closes #522
Closes #523

@drips-wave

drips-wave Bot commented Jul 29, 2026

Copy link
Copy Markdown

@D-Ochuko 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

@Kingsman-99
Kingsman-99 merged commit 9576741 into Stellar-split:main Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants