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
ETA: 12 hours
Coordinate on Telegram
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
isValidStellarAddress(address: string): booleanhelper using the Stellar SDK or a regex for the base32 G-account formatGET /wallets/:address/holdings,GET /wallets/:address/activity,POST /alertsAcceptance Criteria
ETA: 12 hours
Coordinate on Telegram