Skip to content

feat(frontend): build Stellar wallet connect UI with secret key signing and disconnect support #282

@portableDD

Description

@portableDD

Description

The backend Stellar wallet linking API is fully implemented but there is no frontend UI to connect, disconnect, or display a linked wallet. This issue builds the wallet connect UI in the settings page using the @stellar/stellar-sdk for in-browser signing.

Background

  • Backend: POST /api/v1/users/me/wallet/challenge, POST /api/v1/users/me/wallet/verify, DELETE /api/v1/users/me/wallet, GET /api/v1/users/me/wallet
  • Flow: call challenge endpoint, sign challenge with Stellar secret key, submit signature to verify
  • @stellar/stellar-sdk must be installed in the frontend

Implementation Guide

Install @stellar/stellar-sdk in the frontend.

Create frontend/components/wallet/wallet-connect-card.tsx: if no wallet linked show "Connect Stellar Wallet" button opening modal; if linked show truncated address GABCD...WXYZ with copy button, Stellar explorer link, and Disconnect button.

Create frontend/components/wallet/wallet-connect-modal.tsx: secret key input with security warning, Sign and Connect button that: calls challenge endpoint, signs with Keypair.fromSecret(key).sign(Buffer.from(challenge)), calls verify with base64 signature, then immediately clears key from state.

Validate input with StrKey.isValidEd25519SecretSeed() before any API call.

Acceptance Criteria

  • @stellar/stellar-sdk installed in frontend
  • WalletConnectCard shows correct connected or disconnected state
  • Signing flow: challenge then sign then verify in sequence
  • Secret key cleared from state immediately after signing
  • Invalid key format validated before any API call
  • Linked address shown truncated with copy-to-clipboard button
  • Disconnect removes wallet from account

Complexity: High - 200 points
Join: https://t.me/ByteChainAcademy | Contact: contact@nexacore.org

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions