fix(payments): define and export createQuote and executePayment request schemas - #277
Merged
David-patrick-chuks-02 merged 2 commits intoSep 6, 2026
Merged
Conversation
…st schemas - Add stellarAssetCodeSchema for 1-12 alphanumeric asset codes - Add stellarAddressSchema and isValidStellarAddress helper using StrKey - Add stellarAssetOrAddressSchema to support asset codes or 56-char account addresses - Add positiveDecimalSchema with normalizeAmount transform and positive validation - Define and export createQuoteSchema and executePaymentSchema for route validation - Update quoteSchema to preserve compatibility with existing unit tests - Add comprehensive unit and route validation tests for all schemas and endpoints Closes Lilly-Protocol#257
David-patrick-chuks-02
marked this pull request as ready for review
September 6, 2026 08:21
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 #257 by defining and exporting
createQuoteSchemaandexecutePaymentSchemainsrc/modules/payments/payments.schema.tsas expected bysrc/modules/payments/payments.routes.ts.Changes
stellarAssetCodeSchema: Enforces 1-12 alphanumeric characters (e.g.,XLM,USDC), strictly rejecting whitespace, punctuation, hyphens, and emojis.stellarAddressSchema&isValidStellarAddress: Enforces 56-character Ed25519 Stellar public key format using@stellar/stellar-sdk'sStrKey.isValidEd25519PublicKey.stellarAssetOrAddressSchema: Supports either a standard Stellar asset code or a 56-character account address.positiveDecimalSchema: Trims input, validates positive decimal representation, and normalizes leading zeros vianormalizeAmount.createQuoteSchema: ValidatessourceAsset,destinationAsset, and positive normalizedsourceAmount, with optional destination properties.executePaymentSchema: ValidatesquoteIdas non-empty string andconfirmedas boolean flag.quoteSchema: Backwards-compatible schema supporting both legacy and route structures.tests/payments.schema.test.tsto test all schemas, edge cases, and HTTP route responses withVALIDATION_ERRORenvelopes.Payout Routing
0xF46C9F6d70C50BF81ef3588AB523a90a594a2F89GCL6OXAMLD75BMTINA6EMRUDWK5THQUSHMYNLSNBCJAPZJHNYJTUNIBC