Build the /api/validate endpoint that uses stellar-address-kit package to detect address type (G, M, C), validate the address, and return structured feedback including whether memo fields should be disabled.
Contribution Guide
- PRs go to the
dev branch, not main
- Application must explain your specific approach to this task ; generic applications will not be assigned
- PR description must clearly describe what you built and changed
- Link your PR to the correct issue number (e.g.
Closes #12)
Implementation Guidelines
Key files: examples/ts-backend/exchange-withdrawal-validator/src/server.ts
- POST
/api/validate accepts { address: string, memoType?: string, memoValue?: string }.
- Use
detect(), validate(), and parse() from stellar-address-kit.
- M-address: return
{ valid: true, addressKind: "muxed", muxedId: "...", memoDisabled: true, reason: "Muxed addresses carry their own routing ID" }.
- C-address: return
{ valid: false, addressKind: "contract", error: "Contract addresses cannot receive direct exchange withdrawals" }.
- G-address: return
{ valid: true, addressKind: "classic", memoDisabled: false }.
- Invalid address: return
{ valid: false, error: "Invalid Stellar address" }.
Expectations
What done looks like: Each address type returns the correct structured response. Invalid addresses are rejected cleanly.
Discord for questions: codeze_us
Build the
/api/validateendpoint that usesstellar-address-kitpackage to detect address type (G, M, C), validate the address, and return structured feedback including whether memo fields should be disabled.Contribution Guide
devbranch, notmainCloses #12)Implementation Guidelines
Key files:
examples/ts-backend/exchange-withdrawal-validator/src/server.ts/api/validateaccepts{ address: string, memoType?: string, memoValue?: string }.detect(),validate(), andparse()fromstellar-address-kit.{ valid: true, addressKind: "muxed", muxedId: "...", memoDisabled: true, reason: "Muxed addresses carry their own routing ID" }.{ valid: false, addressKind: "contract", error: "Contract addresses cannot receive direct exchange withdrawals" }.{ valid: true, addressKind: "classic", memoDisabled: false }.{ valid: false, error: "Invalid Stellar address" }.Expectations
What done looks like: Each address type returns the correct structured response. Invalid addresses are rejected cleanly.
Discord for questions: codeze_us