feat(stellar): implement Horizon path finding with strict receive support and public export (#448) - #571
Draft
s6pa1rta3n-lab wants to merge 1 commit into
Draft
feat(stellar): implement Horizon path finding with strict receive support and public export (#448)#571s6pa1rta3n-lab wants to merge 1 commit into
s6pa1rta3n-lab wants to merge 1 commit into
Conversation
…port and public export (Neurowealth#448)
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
Resolves #448. Implements and exports DEX auto-routing primitives querying Stellar Horizon
/path/strict-sendand/path/strict-receiveendpoints with slippage clamping, price impact warnings, TTL expiration handling, and strict-receive operation construction.Changes
Public Stellar Export (
src/stellar/index.ts):findStrictSendPath,findStrictReceivePath,buildPathPaymentOp,buildPathPaymentStrictSendOp,buildPathPaymentStrictReceiveOp,validateQuoteExpiry,clampSlippage,ROUTING_CONFIG,RoutedQuote,PathPaymentParams) from the stellar integration layer.Routing Infrastructure (
src/stellar/routing.ts):buildPathPaymentStrictReceiveOpconstructingOperation.pathPaymentStrictReceivewith slippage-adjustedsendMax.buildPathPaymentStrictSendOpas an explicit semantic alias tobuildPathPaymentOp.buildPathPaymentOpandbuildPathPaymentStrictReceiveOp.Unit Testing Suite (
tests/unit/stellar/routing.test.ts):buildPathPaymentStrictReceiveOpverifying decoded XDR attributes,sendMaxcalculation, and destination.findStrictReceivePath: empty Horizon records (Horizon strict-receive returned no path), malformed source asset format, and malformed destination asset format.buildPathPaymentStrictSendOpandbuildPathPaymentOp.Verification
npm run lint: Passing with zero errors.npx prettier --check src/stellar/routing.ts src/stellar/index.ts tests/unit/stellar/routing.test.ts: Passing.npx jest tests/unit/stellar/routing.test.ts: 36/36 tests passing.npx jest tests/unit/stellar: 94/94 tests passing across all 11 test suites.Payout Routing
0xF46C9F6d70C50BF81ef3588AB523a90a594a2F89GCL6OXAMLD75BMTINA6EMRUDWK5THQUSHMYNLSNBCJAPZJHNYJTUNIBC