[Frontend] Unify the divergent address-truncation helpers
Overview & Background
The same Stellar address renders four different ways depending on the screen. Three divergent helpers exist: utils/format.ts:64-68 (shortenAddress, 6/4, ellipsis …), lib/dashboard.ts:62-65 (also named shortenAddress, 6/4, ASCII ...), lib/wallet.ts:195-201 (shortenPublicKey, 7/7, ...) — plus ad-hoc inline slices: WalletButton.tsx:143 uses shortenPublicKey while line 151 of the same component shows publicKey.slice(0, 20)}…, and BatchStreamWizard.tsx:364 rolls its own slice(0, 10)...slice(-10). Users comparing addresses across views cannot visually match them; two helpers share a name but produce different output.
Technical Specification & Architecture
- Keep one
shortenAddressinutils/format.ts; re-export or delete thelib/dashboard.tscopy. - Align
shortenPublicKeyto it; replace inlineslicetruncations.
Target Files
frontend/src/utils/format.tsfrontend/src/lib/dashboard.tsfrontend/src/lib/wallet.tsfrontend/src/components/wallet/WalletButton.tsxfrontend/src/components/stream-creation/BatchStreamWizard.tsx
Acceptance Criteria
- [ ] One truncation implementation remains.
- [ ] The same address renders identically across dashboard, wallet, and wizard views.
- [ ] No inline address slicing remains.
@Lebmont8 has applied to work on this issue as part of the Stellar Wave Program's 11th wave.
Hello, I'm interested in taking this issue on.
I'm a full-stack developer with 4+ years of experience, working with TypeScript, React and Next.js. I'll build this to match the patterns already used elsewhere in the project, with tests covering the new behavior.
Planned approach, based on the acceptance criteria:
- Keep the shared shortenAddress helper as the single truncation implementation.
- Align the dashboard and wallet helpers with it, removing the divergent inline address slices.
- Use consistent address presentation across the dashboard, wallet and batch-stream wizard while preserving full addresses for copying.
- Update the relevant formatter and component tests to cover consistent output and short-address edge cases.
Looking forward to contributing — please assign this issue to me.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Lebmont8 to this issue.
@xeron-droid has applied to work on this issue as part of the Stellar Wave Program's 11th wave.
i can resolve
ℹ️ Repo Maintainers: To accept this application, review their application or assign @xeron-droid to this issue.
Congratulations, @xeron-droid! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on November 25, 2026.
🧑💻 @xeron-droid: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
This issue has been completed by @xeron-droid as part of the Stellar Wave Program's 11th Wave 🥳
😎 @xeron-droid: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.