Skip to content

feature: Ledger hardware wallet support - #174

Open
thelmaoffiong wants to merge 1 commit into
Dshield-xyz:devfrom
thelmaoffiong:feature/ledger-hardware-wallet
Open

feature: Ledger hardware wallet support#174
thelmaoffiong wants to merge 1 commit into
Dshield-xyz:devfrom
thelmaoffiong:feature/ledger-hardware-wallet

Conversation

@thelmaoffiong

@thelmaoffiong thelmaoffiong commented Sep 1, 2026

Copy link
Copy Markdown

Summary

Adds Ledger hardware wallet support to the frontend wallet integration (issue #148). Users can now connect a Ledger device through the StellarWalletsKit auth modal and sign every transaction on-device, keeping signing keys on cold storage instead of a hot wallet.

Changes

  • frontend/src/components/WalletProvider.tsx — registers the kit's LedgerModule alongside the five existing browser wallets and exposes isHardwareWallet on the wallet context (true when the actively connected wallet is a Ledger). The signing path was already fully async, so it resolves only after the on-device confirmation — no changes needed to the signing flow itself.
  • frontend/src/app/deposit/page.tsx — the deposit confirm modal now shows a "Check your Ledger device — approve the transaction there" state and a "Confirm on your device…" button label while a hardware signature is awaited.
  • frontend/src/app/withdraw/page.tsx — the signing progress step reads "Confirm on your Ledger device…" with a device hint when the connected wallet is hardware.
  • frontend/src/app/compliance/page.tsx — no change needed: this page never signs transactions (pure report/viewing-key proof generation), so there is no signing UX to make device-aware.
  • frontend/src/lib/errors.tsfriendlyError now maps hardware-specific failures to clear messages: locked device, Stellar app not open (0x6d00/0x6e00), on-device rejection, and missing/WebUSB-unreachable device.
  • TestsWalletProvider.test.tsx (connect + sign paths with a mocked Ledger transport, including software-wallet and disconnect cases) and errors.test.ts (hardware error mapping).
  • Docs — Ledger listed under Wallet Integration in README.md; CHANGELOG entry added.

Verification

  • New tests pass (10/10): pnpm vitest run src/components/WalletProvider.test.tsx src/lib/errors.test.ts
  • tsc --noEmit reports no errors in any changed file (the 17 remaining errors are pre-existing parse errors in recurring/page.tsx, Toast.tsx, and tone.ts, present on dev before this change)

Closes #148

Register the Ledger module from @creit.tech/stellar-wallets-kit so users can
connect a hardware device and sign every transaction on-device. The deposit
and withdraw pages now surface a "confirm on your device" state while a
hardware signature is awaited, and friendlyError maps Ledger-specific
failures (locked device, wrong app open, on-device rejection, missing
device) to clear, friendly messages instead of a generic error.

Tests cover the connect and sign paths using a mocked Ledger transport.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Ledger hardware wallet support

1 participant