Feature/issue 520 523 split features - #580
Merged
Kingsman-99 merged 5 commits intoJul 30, 2026
Merged
Conversation
|
@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! 🚀 |
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.
Summary
Adds four independent SDK primitives, each addressing one issue:
src/splitRollbackCoordinator.ts): records a per-leg checkpoint for multi-recipient split payments, lets callers mark each leg's application-layer acknowledgement outcome, and exposesinitiateRollbackto identify incomplete legs and persist a rollback record viasrc/snapshot.ts. Wired intoStellarSplitClient.submitPayment's waterfall path (getRollbackCoordinator()), which now opens a checkpoint and marks all submitted legs successful immediately after an atomic on-chain submission.src/paymentProgressTracker.ts): aggregates per-recipient payment status into a singleInvoicePaymentProgresssnapshot viasubscribe(invoiceId, onProgress), polling each recipient leg independently withInvoiceStatusPollerand emittinginvoiceProgressUpdated. Includes tranche progress when the invoice defines one (src/trancheProgress.ts).src/priceOracle.ts): defines thePriceOracleAdaptercontract (src/types.ts) and shipsCoinGeckoPriceOracle, a default implementation backed by CoinGecko's/simple/priceendpoint, with a new TTL-basedRateCache(src/rateCache.ts).convertFiatToAssetinsrc/currencyConverter.tsuses a supplied oracle to convert fiat amounts to asset amounts.StellarSplitClientConfigaccepts an optionalpriceOracle.src/pathQueryBuilder.ts): encapsulates Horizon path query assembly, validation, execution, and caching behindPathQueryBuilder.src/pathRouter.tsis refactored to delegate to it instead of duplicating query/caching logic inline.Changes by commit
Add RollbackCoordinator for split payment rollback reconciliation— closes Atomic Split Payment Rollback Coordinator #520Add PaymentProgressTracker for aggregated invoice payment progress— closes Invoice Payment Progress Tracker #521Add CoinGeckoPriceOracle default XLM-to-fiat price oracle adapter— closes XLM-to-Fiat Price Oracle Adapter #522Add PathQueryBuilder and refactor PathRouter to use it— closes Strict-Send and Strict-Receive Path Query Builder #523Test plan
npm run buildnpm testRollbackCoordinator.begin/markLegSuccess/markLegFailed/getIncomplete/initiateRollbackagainst a simulated post-submission failurePaymentProgressTracker.subscribe/unsubscribeagainst mocked per-recipient status responses and confirmpercentCompleteincrements as legs settleCoinGeckoPriceOracle.getPriceagainst mockedfetchresponses, including a 429 (expectRateLimitError)PathQueryBuilder.forStrictSend/forStrictReceive/executeagainst mocked Horizon responses, including invalid-parameter cases (expectInvalidPathQueryError)Note: this repo currently has pre-existing TypeScript/build issues unrelated to this change (see
npx tsc --noEmitonmain), so CI may not be fully green independent of this PR.Closes #520
Closes #521
Closes #522
Closes #523