feat(stellar): add buildStellarSwapAndStealth helper#96
Merged
truthixify merged 1 commit intoJun 25, 2026
Merged
Conversation
Atomic transaction that swaps fromAsset → toAsset via pathPaymentStrictReceive and delivers the output to a one-time stealth address, with an on-chain announcement in the same envelope. - Native XLM toAsset: 2 ops (pathPayment directly to stealth + announce) - Non-native toAsset: 3 ops (pathPayment to sender + claimableBalance + announce) - sendMax provides configurable slippage protection - Exports: buildStellarSwapAndStealth, BuildStellarSwapAndStealthOptions, SwapAndStealthResult - Unit tests (7) and integration tests (3, INTEGRATION=1 gated) - Docs: docs/guides/stellar-swap-and-stealth.mdx
|
@Mathew2k-hash 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! 🚀 |
Contributor
|
Clean merge. |
emarkees
pushed a commit
to emarkees/sdk
that referenced
this pull request
Jun 26, 2026
Atomic transaction that swaps fromAsset → toAsset via pathPaymentStrictReceive and delivers the output to a one-time stealth address, with an on-chain announcement in the same envelope. - Native XLM toAsset: 2 ops (pathPayment directly to stealth + announce) - Non-native toAsset: 3 ops (pathPayment to sender + claimableBalance + announce) - sendMax provides configurable slippage protection - Exports: buildStellarSwapAndStealth, BuildStellarSwapAndStealthOptions, SwapAndStealthResult - Unit tests (7) and integration tests (3, INTEGRATION=1 gated) - Docs: docs/guides/stellar-swap-and-stealth.mdx
emarkees
pushed a commit
to emarkees/sdk
that referenced
this pull request
Jun 26, 2026
Atomic transaction that swaps fromAsset → toAsset via pathPaymentStrictReceive and delivers the output to a one-time stealth address, with an on-chain announcement in the same envelope. - Native XLM toAsset: 2 ops (pathPayment directly to stealth + announce) - Non-native toAsset: 3 ops (pathPayment to sender + claimableBalance + announce) - sendMax provides configurable slippage protection - Exports: buildStellarSwapAndStealth, BuildStellarSwapAndStealthOptions, SwapAndStealthResult - Unit tests (7) and integration tests (3, INTEGRATION=1 gated) - Docs: docs/guides/stellar-swap-and-stealth.mdx
emarkees
pushed a commit
to emarkees/sdk
that referenced
this pull request
Jun 26, 2026
Atomic transaction that swaps fromAsset → toAsset via pathPaymentStrictReceive and delivers the output to a one-time stealth address, with an on-chain announcement in the same envelope. - Native XLM toAsset: 2 ops (pathPayment directly to stealth + announce) - Non-native toAsset: 3 ops (pathPayment to sender + claimableBalance + announce) - sendMax provides configurable slippage protection - Exports: buildStellarSwapAndStealth, BuildStellarSwapAndStealthOptions, SwapAndStealthResult - Unit tests (7) and integration tests (3, INTEGRATION=1 gated) - Docs: docs/guides/stellar-swap-and-stealth.mdx
truthixify
pushed a commit
that referenced
this pull request
Jun 26, 2026
* feat(stellar): buildStellarSwapAndStealth helper (#96) Atomic transaction that swaps fromAsset → toAsset via pathPaymentStrictReceive and delivers the output to a one-time stealth address, with an on-chain announcement in the same envelope. - Native XLM toAsset: 2 ops (pathPayment directly to stealth + announce) - Non-native toAsset: 3 ops (pathPayment to sender + claimableBalance + announce) - sendMax provides configurable slippage protection - Exports: buildStellarSwapAndStealth, BuildStellarSwapAndStealthOptions, SwapAndStealthResult - Unit tests (7) and integration tests (3, INTEGRATION=1 gated) - Docs: docs/guides/stellar-swap-and-stealth.mdx * style: apply consistent code formatting and downgrade expo-crypto version --------- Co-authored-by: Mathew2k-hash <ochoalaurie74@gmail.com>
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.
feat(stellar): atomic swap + stealth payment helper
Adds buildStellarSwapAndStealth — a single-envelope Stellar transaction that swaps one asset
for another via the AMM and delivers the output to a one-time stealth address, with a Wraith
announcement, all atomically.
What's in the transaction
address (creating the account if needed) + invokeHostFunction announcement.
createClaimableBalance claimable by the stealth address (no trustline required), +
announcement.
Slippage protection
sendMax caps the maximum spend. If the AMM path costs more, Stellar rejects the transaction
before any funds move. The docs include a snippet for deriving sendMax from a Horizon
/paths/strict-receive quote with a configurable basis-point tolerance.
Files changed
BuildStellarSwapAndStealthOptions, SwapAndStealthResult
encoding, determinism, announcement always present)
(skipped unless INTEGRATION=1)
slippage calculation, and recipient claim flow
Testing
pnpm test test/chains/stellar/swap.test.ts # 7/7 passing
INTEGRATION=1 pnpm exec vitest run test/chains/stellar/swap.integration.test.ts
closes #85