Skip to content

fix(schemas): reject whitespace-padded amount strings in EscrowParamsSchema - #824

Closed
ElNeMeR70 wants to merge 1 commit into
trustflow-protocol:mainfrom
ElNeMeR70:fix/schemas-amount-whitespace-808
Closed

ElNeMeR70 wants to merge 1 commit into
trustflow-protocol:mainfrom
ElNeMeR70:fix/schemas-amount-whitespace-808

Conversation

@ElNeMeR70

Copy link
Copy Markdown

Summary

  • Adds XlmAmountSchema and EscrowParamsSchema (EscrowParamsInput) in src/schemas.ts that strictly reject leading or trailing whitespace (e.g. ' 50 ') using anchored decimal validation (val === val.trim() && isValidXLMAmount(val)).
  • Re-exports XlmAmountSchema, EscrowParamsSchema, and EscrowParamsInput from src/index.ts, documents them in docs/API.md, and adds unit tests in tests/schemas.test.ts.

Fixes #808

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] schemas.ts Zod schema for EscrowParams allows an amount string containing leading/trailing whitespace, which then fails downstream BigInt parsing

2 participants