docs: fix SDK references and update implementation status
- 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 <noreply@anthropic.com>
This commit is contained in:
parent
7defc10444
commit
113eee6ecb
2 changed files with 19 additions and 17 deletions
|
|
@ -16,7 +16,7 @@ This file provides guidance to Claude Code when working with the Lamassu Next co
|
||||||
```
|
```
|
||||||
lamassu-next/
|
lamassu-next/
|
||||||
├── apps/
|
├── apps/
|
||||||
│ ├── machine/ # Tauri + Vue 3 ATM kiosk application (planned)
|
│ ├── machine/ # Tauri + Vue 3 ATM kiosk application (in progress)
|
||||||
│ ├── dashboard/ # Vue 3 operator dashboard (planned)
|
│ ├── dashboard/ # Vue 3 operator dashboard (planned)
|
||||||
│ └── relay/ # strfry relay configuration (planned)
|
│ └── relay/ # strfry relay configuration (planned)
|
||||||
├── packages/
|
├── packages/
|
||||||
|
|
@ -39,7 +39,7 @@ lamassu-next/
|
||||||
| `@lamassu/nostr-client` | Nostr relay client with NIP-42 auth, NIP-44 encryption | 13 |
|
| `@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/clink` | CLINK protocol (kinds 21001-21003), noffer encoding | 7 |
|
||||||
| `@lamassu/lightning` | Lightning.Pub RPC client (kind 21000) | 10 |
|
| `@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
|
### Placeholder Packages
|
||||||
|
|
||||||
|
|
@ -50,13 +50,13 @@ lamassu-next/
|
||||||
|
|
||||||
### Planned Components
|
### 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
|
- **apps/dashboard** - Operator dashboard for fleet management
|
||||||
- **packages/hal** - Rust hardware drivers (bill validators, dispensers, printers)
|
- **packages/hal** - Rust hardware drivers (bill validators, dispensers, printers)
|
||||||
|
|
||||||
### Critical Documentation
|
### 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
|
## Commands
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ export const NDEBIT_REGEX = new RegExp(
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// In lib/types/parse.ts
|
// In lib/types/parse.ts
|
||||||
import type { DebitPointer } from '@shocknet/clink-sdk'
|
import type { DebitPointer } from '@lamassu/clink'
|
||||||
import type { Satoshi } from './units'
|
import type { Satoshi } from './units'
|
||||||
|
|
||||||
export enum InputClassification {
|
export enum InputClassification {
|
||||||
|
|
@ -140,7 +140,7 @@ export interface ParsedNdebitInput {
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// In lib/parse.ts
|
// In lib/parse.ts
|
||||||
import { decodeBech32 } from '@shocknet/clink-sdk';
|
import { decodeNdebit } from '@lamassu/clink'
|
||||||
|
|
||||||
// Add to VALIDATORS array:
|
// Add to VALIDATORS array:
|
||||||
{
|
{
|
||||||
|
|
@ -171,15 +171,15 @@ case InputClassification.NDEBIT: {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const decoded = decodeBech32(ndebitPart);
|
const decoded = decodeNdebit(ndebitPart)
|
||||||
if (decoded.type !== "ndebit") {
|
if (!decoded) {
|
||||||
throw new Error("Invalid ndebit string");
|
throw new Error("Invalid ndebit string");
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
type: InputClassification.NDEBIT,
|
type: InputClassification.NDEBIT,
|
||||||
data: ndebitPart,
|
data: ndebitPart,
|
||||||
ndebit: decoded.data,
|
ndebit: decoded,
|
||||||
amount
|
amount
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -190,7 +190,9 @@ case InputClassification.NDEBIT: {
|
||||||
```typescript
|
```typescript
|
||||||
// In State/scoped/backups/sources/history/claimNdebitThunk.ts
|
// In State/scoped/backups/sources/history/claimNdebitThunk.ts
|
||||||
import { getNostrClient } from '@/Api/nostr'
|
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 { SimplePool } from 'nostr-tools'
|
||||||
import { hexToBytes } from '@noble/hashes/utils'
|
import { hexToBytes } from '@noble/hashes/utils'
|
||||||
|
|
||||||
|
|
@ -311,16 +313,16 @@ const ndebit = user.info.ndebit
|
||||||
2. **Rewrite relay for browser access** (if needed):
|
2. **Rewrite relay for browser access** (if needed):
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
import { decodeBech32, ndebitEncode } from '@shocknet/clink-sdk'
|
import { decodeNdebit, encodeNdebit } from '@lamassu/clink'
|
||||||
|
|
||||||
function rewriteNdebitRelay(ndebitString, browserRelay) {
|
function rewriteNdebitRelay(ndebitString, browserRelay) {
|
||||||
const decoded = decodeBech32(ndebitString)
|
const decoded = decodeNdebit(ndebitString)
|
||||||
if (decoded.type !== 'ndebit') return ndebitString
|
if (!decoded) return ndebitString
|
||||||
|
|
||||||
return ndebitEncode({
|
return encodeNdebit({
|
||||||
pubkey: decoded.data.pubkey,
|
pubkey: decoded.pubkey,
|
||||||
relay: browserRelay, // e.g., 'ws://localhost:7777'
|
relay: browserRelay, // e.g., 'ws://localhost:7777'
|
||||||
pointer: decoded.data.pointer,
|
pointer: decoded.pointer,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
@ -445,7 +447,7 @@ lncli payinvoice <invoice>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"@shocknet/clink-sdk": "^x.x.x",
|
"@lamassu/clink": "workspace:*",
|
||||||
"nostr-tools": "^2.x.x",
|
"nostr-tools": "^2.x.x",
|
||||||
"@noble/hashes": "^1.x.x",
|
"@noble/hashes": "^1.x.x",
|
||||||
"qrcode": "^1.x.x"
|
"qrcode": "^1.x.x"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue