Skip to content

fix: validate Stellar address in account endpoints#376

Merged
thecodedcoder merged 1 commit intoThinkLikeAFounder:mainfrom
0xDeon:fix/address-validation-routes
Mar 30, 2026
Merged

fix: validate Stellar address in account endpoints#376
thecodedcoder merged 1 commit intoThinkLikeAFounder:mainfrom
0xDeon:fix/address-validation-routes

Conversation

@0xDeon
Copy link
Copy Markdown
Contributor

@0xDeon 0xDeon commented Mar 28, 2026

Closes #337

Changes

  • Added validateAddress middleware using Keypair.fromPublicKey from @stellar/stellar-sdk
  • Applied to GET /account/:address and GET /account/:address/transactions routes
  • Invalid addresses return 400 before reaching Horizon SDK
  • Normalized limit query param parsing with Number.isNaN check to avoid NaN silently passing
  • Updated test to use a properly valid Stellar public key

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 28, 2026

@0xDeon 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! 🚀

Learn more about application limits

- Added validateAddress middleware using Keypair.fromPublicKey
- Applied to /:address and /:address/transactions routes
- Prevents invalid inputs from reaching Horizon SDK
- Normalized limit parsing with Number.isNaN check
- Updated test to use a valid Stellar public key

Closes ThinkLikeAFounder#337
@0xDeon 0xDeon force-pushed the fix/address-validation-routes branch from 2b68270 to dabf485 Compare March 28, 2026 22:38
@thecodedcoder thecodedcoder merged commit 6cca109 into ThinkLikeAFounder:main Mar 30, 2026
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: Account transactions endpoint has no input validation for address param

2 participants