From 113eee6ecbe86ff7f61debeebe9c2e74a0cbb4aa Mon Sep 17 00:00:00 2001 From: Patrick Mulligan Date: Mon, 26 Jan 2026 12:40:17 -0500 Subject: [PATCH] docs: fix SDK references and update implementation status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix ndebit-cash-in-flow.md: replace @shocknet/clink-sdk with @lamassu/clink - Fix function names: decodeBech32 → decodeNdebit, ndebitEncode → encodeNdebit - Update decoded.data.* references to decoded.* (direct DebitPointer return) - Clarify SendNdebitRequest is wallet-side code, not in @lamassu/clink - Update CLAUDE.md state-machine test count: 9 → 14 - Update apps/machine status: (planned) → (in progress) - Update TROUBLESHOOTING.md issue count: 6 → 9 Closes #12, Closes #16 Co-Authored-By: Claude Opus 4.5 --- lamassu-next/CLAUDE.md | 8 +++---- lamassu-next/docs/ndebit-cash-in-flow.md | 28 +++++++++++++----------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/lamassu-next/CLAUDE.md b/lamassu-next/CLAUDE.md index fb37e96..cf100d1 100644 --- a/lamassu-next/CLAUDE.md +++ b/lamassu-next/CLAUDE.md @@ -16,7 +16,7 @@ This file provides guidance to Claude Code when working with the Lamassu Next co ``` lamassu-next/ ├── apps/ -│ ├── machine/ # Tauri + Vue 3 ATM kiosk application (planned) +│ ├── machine/ # Tauri + Vue 3 ATM kiosk application (in progress) │ ├── dashboard/ # Vue 3 operator dashboard (planned) │ └── relay/ # strfry relay configuration (planned) ├── packages/ @@ -39,7 +39,7 @@ lamassu-next/ | `@lamassu/nostr-client` | Nostr relay client with NIP-42 auth, NIP-44 encryption | 13 | | `@lamassu/clink` | CLINK protocol (kinds 21001-21003), noffer encoding | 7 | | `@lamassu/lightning` | Lightning.Pub RPC client (kind 21000) | 10 | -| `@lamassu/state-machine` | XState v5 ATM state machine (idle, cashIn, cashOut) | 9 | +| `@lamassu/state-machine` | XState v5 ATM state machine (idle, cashIn, cashOut) | 14 | ### Placeholder Packages @@ -50,13 +50,13 @@ lamassu-next/ ### Planned Components -- **apps/machine** - Tauri 2.x ATM kiosk with Vue 3 UI +- **apps/machine** - Tauri 2.x ATM kiosk with Vue 3 UI (UI shell implemented, HAL integration pending) - **apps/dashboard** - Operator dashboard for fleet management - **packages/hal** - Rust hardware drivers (bill validators, dispensers, printers) ### Critical Documentation -- **`packages/lightning/TROUBLESHOOTING.md`** - Lightning.Pub integration gotchas. Read this BEFORE debugging payment issues. Contains solutions to 6 non-obvious issues that took 3+ hours to diagnose. +- **`packages/lightning/TROUBLESHOOTING.md`** - Lightning.Pub integration gotchas. Read this BEFORE debugging payment issues. Contains solutions to 9 non-obvious issues that took 5+ hours to diagnose. ## Commands diff --git a/lamassu-next/docs/ndebit-cash-in-flow.md b/lamassu-next/docs/ndebit-cash-in-flow.md index 68464bf..c9b643f 100644 --- a/lamassu-next/docs/ndebit-cash-in-flow.md +++ b/lamassu-next/docs/ndebit-cash-in-flow.md @@ -120,7 +120,7 @@ export const NDEBIT_REGEX = new RegExp( ```typescript // In lib/types/parse.ts -import type { DebitPointer } from '@shocknet/clink-sdk' +import type { DebitPointer } from '@lamassu/clink' import type { Satoshi } from './units' export enum InputClassification { @@ -140,7 +140,7 @@ export interface ParsedNdebitInput { ```typescript // In lib/parse.ts -import { decodeBech32 } from '@shocknet/clink-sdk'; +import { decodeNdebit } from '@lamassu/clink' // Add to VALIDATORS array: { @@ -171,15 +171,15 @@ case InputClassification.NDEBIT: { } } - const decoded = decodeBech32(ndebitPart); - if (decoded.type !== "ndebit") { + const decoded = decodeNdebit(ndebitPart) + if (!decoded) { throw new Error("Invalid ndebit string"); } return { type: InputClassification.NDEBIT, data: ndebitPart, - ndebit: decoded.data, + ndebit: decoded, amount }; } @@ -190,7 +190,9 @@ case InputClassification.NDEBIT: { ```typescript // In State/scoped/backups/sources/history/claimNdebitThunk.ts import { getNostrClient } from '@/Api/nostr' -import { SendNdebitRequest } from '@shocknet/clink-sdk' +// Note: SendNdebitRequest is wallet-side code, not part of @lamassu/clink +// This example shows the wallet's implementation pattern +import { finalizeEvent } from 'nostr-tools' import { SimplePool } from 'nostr-tools' import { hexToBytes } from '@noble/hashes/utils' @@ -311,16 +313,16 @@ const ndebit = user.info.ndebit 2. **Rewrite relay for browser access** (if needed): ```javascript -import { decodeBech32, ndebitEncode } from '@shocknet/clink-sdk' +import { decodeNdebit, encodeNdebit } from '@lamassu/clink' function rewriteNdebitRelay(ndebitString, browserRelay) { - const decoded = decodeBech32(ndebitString) - if (decoded.type !== 'ndebit') return ndebitString + const decoded = decodeNdebit(ndebitString) + if (!decoded) return ndebitString - return ndebitEncode({ - pubkey: decoded.data.pubkey, + return encodeNdebit({ + pubkey: decoded.pubkey, relay: browserRelay, // e.g., 'ws://localhost:7777' - pointer: decoded.data.pointer, + pointer: decoded.pointer, }) } ``` @@ -445,7 +447,7 @@ lncli payinvoice ```json { - "@shocknet/clink-sdk": "^x.x.x", + "@lamassu/clink": "workspace:*", "nostr-tools": "^2.x.x", "@noble/hashes": "^1.x.x", "qrcode": "^1.x.x"