Validate the client address properly (checksum, not just "G" + length 56)

Aperta
#11 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@nilhn9660 ci sta già lavorando.

Dal 21/11/2026.

  • #48 di @nilhn9660 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
74/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
nextjs, react, typescript

Direzione di ricerca

Start in web/app/create/page.tsx at the current validate() check for startsWith("G") && length === 56; replace it with StrKey.isValidEd25519PublicKey from @stellar/stellar-sdk and branch the error messages for muxed, contract and malformed input. Read the test setup from #13 before adding unit tests for a one-character typo, a valid key, and the three rejected address forms. Done means inline validation rejects bad checksums, accepts valid Ed25519 keys, shows a visible valid state, and the new tests pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

difficulty: intermediate enhancement help wanted Stellar Wave ux web

Difficulty: Intermediate

Description

validate() in web/app/create/page.tsx only checks startsWith("G") && length === 56. A mistyped address with a bad checksum passes validation and fails later. This matters because the client address is stored in an immutable on-chain invoice that cannot be edited.

Implementation suggestions

Use StrKey.isValidEd25519PublicKey from @stellar/stellar-sdk. Reject muxed (M...) and contract (C...) addresses with a specific message. Add a visible "valid" state. Optionally warn when the address looks unfunded (Horizon 404).

Acceptance criteria

  • A one-character typo is rejected inline.
  • Valid keys pass.
  • Messages differ for muxed, contract and malformed input.
  • Unit tests are included.

Dependencies / related

Uses the test setup from #13. Shares validation conventions with #6.

Lingua principale
TypeScript
Stelle
0
Fork
4
Merge medio
54m
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Yormee-103/PayLoop

Tutte le issue di Yormee-103/PayLoop

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.