Skip to content

Add helper for validating Stellar wallet address format before database queries #447

Description

@Chucks1093

Summary

Several endpoints accept a wallet address as a path or query param. Each one currently validates separately or not at all. A shared helper that checks a string is a valid Stellar address format should be called at the start of any handler that accepts a wallet address.

Scope

  • Add isValidStellarAddress(address: string): boolean helper using the Stellar SDK or a regex for the base32 G-account format
  • Use the helper in: GET /wallets/:address/holdings, GET /wallets/:address/activity, POST /alerts
  • Return 400 with a descriptive message when validation fails
  • Add unit tests for: valid address, address with wrong prefix, too short, too long, empty string

Acceptance Criteria

  • Valid Stellar address passes validation
  • Invalid formats return 400 with descriptive error
  • Helper is used consistently across all wallet address params
  • Unit tests cover all invalid cases

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions