Skip to content

Add helper for validating Stellar address format before persisting to database #611

Description

@Chucks1093

Summary

Stellar addresses submitted via API are stored in the database without format validation. An invalid address that passes into storage will cause downstream failures that are harder to diagnose. A validation helper should check the format at the API boundary before any write.

Scope

  • Add isValidStellarAddress(address: string): boolean helper
  • Valid addresses start with G, are exactly 56 characters, and contain only base32 alphanumeric characters
  • Apply the helper in all endpoints that accept a wallet or recipient address in the request body
  • Add unit tests: valid address returns true, wrong starting character, wrong length, invalid characters each return false

Acceptance Criteria

  • Valid Stellar address returns true
  • Wrong starting character returns false
  • Wrong length returns false
  • Invalid characters return false
  • Helper applied at all address-accepting endpoints

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