diff --git a/.agents/skills/nwc/SKILL.md b/.agents/skills/nwc/SKILL.md new file mode 100644 index 0000000..8533459 --- /dev/null +++ b/.agents/skills/nwc/SKILL.md @@ -0,0 +1,234 @@ +--- +name: nwc +description: Add Nostr Wallet Connect (NWC), WebLN wallet detection, and Lightning zap functionality (NIP-57) to the application. Use when the user wants to connect a Lightning wallet, send zaps, or display zap counts on Nostr events. +--- + +# Nostr Wallet Connect (NWC) & Lightning Zaps + +This skill adds Lightning wallet connectivity and zap (NIP-57) functionality. It is **not included in the project by default**. When the user wants to add wallet/zap features, follow the setup instructions below to install the files, wire up the provider, and add the required dependencies. + +## What This Skill Provides + +- **NWC** (Nostr Wallet Connect, NIP-47) — connect remote Lightning wallets via `nostr+walletconnect://` URIs +- **WebLN detection** — auto-detect browser extension wallets (Alby, Mutiny, etc.) +- **NIP-57 Zaps** — create zap requests, fetch LNURL invoices, pay them via NWC/WebLN/QR fallback +- **UI components** — `ZapButton`, `ZapDialog`, `WalletModal` ready to drop into the app + +## Files Provided by This Skill + +All files live under `.agents/skills/nwc/files/` and must be copied into `src/` preserving the directory structure: + +| Skill file | Copy to | +|---|---| +| `files/hooks/useNWC.ts` | `src/hooks/useNWC.ts` | +| `files/hooks/useNWCContext.ts` | `src/hooks/useNWCContext.ts` | +| `files/hooks/useWallet.ts` | `src/hooks/useWallet.ts` | +| `files/hooks/useZaps.ts` | `src/hooks/useZaps.ts` | +| `files/contexts/NWCContext.tsx` | `src/contexts/NWCContext.tsx` | +| `files/components/WalletModal.tsx` | `src/components/WalletModal.tsx` | +| `files/components/ZapDialog.tsx` | `src/components/ZapDialog.tsx` | +| `files/components/ZapButton.tsx` | `src/components/ZapButton.tsx` | + +## Setup Instructions + +### 1. Install Dependencies + +Add these packages to the project: + +```bash +npm install @getalby/sdk @webbtc/webln-types +``` + +- `@getalby/sdk` — NWC client used by `useNWC.ts` to open connections and pay invoices +- `@webbtc/webln-types` — TypeScript types for the browser WebLN provider + +`ZapDialog` also uses the `qrcode` package to render invoices. It should already be installed in the project (it's used by `src/components/ui/qrcode.tsx`). If it's missing for any reason, also run `npm install qrcode && npm install --save-dev @types/qrcode`. + +### 2. Copy the Skill Files Into `src/` + +Copy every file listed in the table above from `.agents/skills/nwc/files/` into its corresponding location under `src/`. Preserve the exact paths — the files use `@/hooks/...` / `@/contexts/...` / `@/components/...` imports that depend on these locations. + +### 3. Wire Up the `NWCProvider` in `src/App.tsx` + +The `NWCProvider` must wrap any component that uses NWC, wallet, or zap hooks/components. Place it inside `NostrProvider` (it depends on a logged-in user) and around `TooltipProvider`: + +```tsx +// Add this import near the other provider imports at the top of src/App.tsx +import { NWCProvider } from '@/contexts/NWCContext'; + +// Then wrap TooltipProvider with NWCProvider inside the existing provider tree: +export function App() { + return ( + + + + + + + + + + + + + + + + + + + + ); +} +``` + +### 4. Wire Up `NWCProvider` in `src/test/TestApp.tsx` (if tests need it) + +If you're writing tests that mount components depending on NWC/zap/wallet hooks, wrap `TestApp`'s provider tree the same way: + +```tsx +import { NWCProvider } from '@/contexts/NWCContext'; + +// ... + + + + {children} + + + +``` + +## Hooks + +Once installed and wired up, the following hooks are available: + +| Hook | Purpose | +|---|---| +| `useNWC` (from `@/hooks/useNWCContext`) | Manage NWC connections — `addConnection`, `removeConnection`, `setActiveConnection`, `getActiveConnection`, `sendPayment` | +| `useWallet` | Unified wallet status — returns `{ hasNWC, webln, activeNWC, preferredMethod }` | +| `useZaps` | Zap functionality — fetch zap receipts/totals, create invoices, pay via NWC/WebLN, fallback to QR | + +### `useNWC` + +```tsx +import { useNWC } from '@/hooks/useNWCContext'; + +function MyComponent() { + const { + connections, // NWCConnection[] + activeConnection, // string | null (connection string of active wallet) + addConnection, // (uri: string, alias?: string) => Promise + removeConnection, // (connectionString: string) => void + setActiveConnection,// (connectionString: string) => void + getActiveConnection,// () => NWCConnection | null + sendPayment, // (connection, invoice) => Promise<{ preimage: string }> + } = useNWC(); +} +``` + +Connections are persisted to `localStorage` under the keys `nwc-connections` and `nwc-active-connection`. + +### `useWallet` + +```tsx +import { useWallet } from '@/hooks/useWallet'; + +function ZapContext() { + const { hasNWC, webln, activeNWC, preferredMethod } = useWallet(); + // preferredMethod: 'nwc' | 'webln' | 'manual' +} +``` + +`useWallet` combines NWC connection state with the browser's global `window.webln` to give a single source of truth for "can this user pay a Lightning invoice right now, and how?" + +### `useZaps` + +```tsx +import { useZaps } from '@/hooks/useZaps'; +import { useWallet } from '@/hooks/useWallet'; +import type { Event } from 'nostr-tools'; + +function MyZapTotal({ event }: { event: Event }) { + const { webln, activeNWC } = useWallet(); + const { zapCount, totalSats, zap, isZapping, invoice } = useZaps(event, webln, activeNWC); + return
{totalSats} sats from {zapCount} zaps
; +} +``` + +The `zap(amount, comment)` function will: +1. Look up the author's LNURL endpoint from their profile's `lud16`/`lud06` +2. Create and sign a NIP-57 zap request +3. Fetch a Lightning invoice from the LNURL service +4. Try to pay it via NWC (preferred), then WebLN, then expose the invoice for QR/manual payment +5. Show toast feedback and invalidate zap query caches on success + +## Components + +### `ZapButton` + +Drop-in button that shows total sats for an event and opens a zap dialog when clicked. Hides itself automatically if the viewer isn't logged in, is the author, or the author has no Lightning address. + +```tsx +import { ZapButton } from '@/components/ZapButton'; + + +``` + +Pre-computed zap data can be passed in to avoid extra queries in feed views: + +```tsx + +``` + +### `ZapDialog` + +The full zap flow UI (amount presets, custom amount, comment, invoice QR). Usually rendered indirectly via `ZapButton`, but can be used standalone for custom triggers: + +```tsx +import { ZapDialog } from '@/components/ZapDialog'; + + + + +``` + +### `WalletModal` + +Settings UI for connecting/removing NWC wallets and viewing WebLN status. Good for a wallet settings page or a header icon: + +```tsx +import { WalletModal } from '@/components/WalletModal'; + +// Default trigger button + + +// Or custom trigger + + + +``` + +## Payment Method Priority + +When a user sends a zap, the skill tries payment methods in this order: + +1. **NWC** — if there is an active connection in `useNWC`, `sendPayment` is called with the fetched invoice +2. **WebLN** — if `window.webln` exists, it's `enable()`d (if needed) and used to pay the invoice +3. **Manual/QR** — the invoice is exposed as a QR code and `lightning:` URI; the user pays from any wallet + +Errors at each stage fall through to the next method, with a toast explaining what happened. + +## Protocol Notes + +- **NIP-47 (NWC)** — wallet connection strings start with `nostr+walletconnect://` (or legacy `nostrwalletconnect://`). The `@getalby/sdk` `LN` client handles the underlying encrypted request/response events with the wallet service pubkey over relays defined in the URI. +- **NIP-57 (Zaps)** — `nip57.makeZapRequest` builds the kind-9734 zap request. For addressable events (kinds 30000–39999) the skill passes the event object (so an `a` tag is included); for all other kinds it passes just the event id (so an `e` tag is included). The zap request is **signed but not published** — it's sent directly to the LNURL endpoint in the query string, which returns a BOLT11 invoice. +- **LNURL** — resolved from the author's `lud16` (email-style) or `lud06` (bech32) metadata field via `nip57.getZapEndpoint`. +- **Zap receipts** — kind 9735 events published by the LNURL service after payment. The skill queries them by `#e` (regular events) or `#a` (addressable events) and sums sats from the `amount` tag, BOLT11 invoice, or zap request description (in that order of preference). + +## Tips + +- **Loading the skill doesn't modify the project.** You must actually copy the files and edit `App.tsx` and `package.json` as described above. Without the provider, every hook will throw `"useNWC must be used within a NWCProvider"`. +- **Place `ZapButton` next to other engagement buttons** (reply, repost, like) on posts. It returns `null` for self-authored posts and authors without a Lightning address, so it's safe to render unconditionally. +- **Don't store connection strings anywhere else.** NWC connection strings contain a secret key. The skill keeps them in `localStorage` only; treat them like passwords. +- **The `WebLNProvider` type import is `import type { WebLNProvider } from '@webbtc/webln-types';`** — types-only, so it disappears at build time. diff --git a/src/components/WalletModal.tsx b/.agents/skills/nwc/files/components/WalletModal.tsx similarity index 100% rename from src/components/WalletModal.tsx rename to .agents/skills/nwc/files/components/WalletModal.tsx diff --git a/src/components/ZapButton.tsx b/.agents/skills/nwc/files/components/ZapButton.tsx similarity index 100% rename from src/components/ZapButton.tsx rename to .agents/skills/nwc/files/components/ZapButton.tsx diff --git a/src/components/ZapDialog.tsx b/.agents/skills/nwc/files/components/ZapDialog.tsx similarity index 100% rename from src/components/ZapDialog.tsx rename to .agents/skills/nwc/files/components/ZapDialog.tsx diff --git a/src/contexts/NWCContext.tsx b/.agents/skills/nwc/files/contexts/NWCContext.tsx similarity index 100% rename from src/contexts/NWCContext.tsx rename to .agents/skills/nwc/files/contexts/NWCContext.tsx diff --git a/src/hooks/useNWC.ts b/.agents/skills/nwc/files/hooks/useNWC.ts similarity index 100% rename from src/hooks/useNWC.ts rename to .agents/skills/nwc/files/hooks/useNWC.ts diff --git a/src/hooks/useNWCContext.ts b/.agents/skills/nwc/files/hooks/useNWCContext.ts similarity index 100% rename from src/hooks/useNWCContext.ts rename to .agents/skills/nwc/files/hooks/useNWCContext.ts diff --git a/src/hooks/useWallet.ts b/.agents/skills/nwc/files/hooks/useWallet.ts similarity index 100% rename from src/hooks/useWallet.ts rename to .agents/skills/nwc/files/hooks/useWallet.ts diff --git a/src/hooks/useZaps.ts b/.agents/skills/nwc/files/hooks/useZaps.ts similarity index 100% rename from src/hooks/useZaps.ts rename to .agents/skills/nwc/files/hooks/useZaps.ts diff --git a/AGENTS.md b/AGENTS.md index 5c6559c..975adba 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -19,7 +19,6 @@ This project is a Nostr client application built with React 19.x, TailwindCSS 3. - `/src/components/ui/`: shadcn/ui components (48+ components available) - `/src/components/auth/`: Authentication-related components (LoginArea, LoginDialog, etc.) - `/src/components/dm/`: Direct messaging UI components (DMMessagingInterface, DMConversationList, DMChatArea) - - Zap components: `ZapButton`, `ZapDialog`, `WalletModal` for Lightning payments - `/src/hooks/`: Custom hooks including: - `useNostr`: Core Nostr protocol integration - `useAuthor`: Fetch user profile data by pubkey @@ -33,14 +32,10 @@ This project is a Nostr client application built with React 19.x, TailwindCSS 3. - `useLoggedInAccounts`: Manage multiple accounts - `useLoginActions`: Authentication actions - `useIsMobile`: Responsive design helper - - `useZaps`: Lightning zap functionality with payment processing - - `useWallet`: Unified wallet detection (WebLN + NWC) - - `useNWC`: Nostr Wallet Connect connection management - - `useNWCContext`: Access NWC context provider - `useShakespeare`: AI chat completions with Shakespeare AI API - `/src/pages/`: Page components used by React Router (Index, NotFound) - `/src/lib/`: Utility functions and shared logic -- `/src/contexts/`: React context providers (AppContext, NWCContext, DMContext) +- `/src/contexts/`: React context providers (AppContext, DMContext) - `useDMContext`: Hook exported from DMContext for direct messaging (NIP-04 & NIP-17) - `useConversationMessages`: Hook exported from DMContext for paginated messages - `/src/test/`: Testing utilities including TestApp component diff --git a/package-lock.json b/package-lock.json index 701773e..6856d03 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,6 @@ "version": "0.0.0", "dependencies": { "@fontsource-variable/inter": "^5.2.6", - "@getalby/sdk": "^5.1.1", "@hookform/resolvers": "^5.2.2", "@nostrify/nostrify": "^0.51.0", "@nostrify/react": "^0.4.0", @@ -79,7 +78,6 @@ "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", "@vitejs/plugin-react": "^6.0.1", - "@webbtc/webln-types": "^3.0.0", "autoprefixer": "^10.4.20", "eslint": "^9.9.0", "eslint-plugin-react-hooks": "^5.1.0-rc.0", @@ -586,36 +584,6 @@ "url": "https://github.com/sponsors/ayuhito" } }, - "node_modules/@getalby/lightning-tools": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@getalby/lightning-tools/-/lightning-tools-5.2.0.tgz", - "integrity": "sha512-8kBvENBTMh541VjGKhw3I29+549/C02gLSh3AQaMfoMNSZaMxfQW+7dcMcc7vbFaCKEcEe18ST5bUveTRBuXCQ==", - "license": "MIT", - "engines": { - "node": ">=14" - }, - "funding": { - "type": "lightning", - "url": "lightning:hello@getalby.com" - } - }, - "node_modules/@getalby/sdk": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@getalby/sdk/-/sdk-5.1.1.tgz", - "integrity": "sha512-t/kg2ljPx86qRYKqEVc5VYhDICFKtVPRlQKIz5cI/AqOLYVguLJz1AkQlDBaiOz2PW5FxoyGlLkTGmX7ONHH/Q==", - "license": "MIT", - "dependencies": { - "@getalby/lightning-tools": "^5.1.2", - "nostr-tools": "2.15.0" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "type": "lightning", - "url": "lightning:hello@getalby.com" - } - }, "node_modules/@hookform/resolvers": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-5.2.2.tgz", @@ -4472,9 +4440,9 @@ } }, "node_modules/@types/qrcode": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@types/qrcode/-/qrcode-1.5.5.tgz", - "integrity": "sha512-CdfBi/e3Qk+3Z/fXYShipBT13OJ2fDO2Q2w5CIP5anLTLIndQG9z6P1cnm+8zCWSpm5dnxMFd/uREtb0EXuQzg==", + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/@types/qrcode/-/qrcode-1.5.6.tgz", + "integrity": "sha512-te7NQcV2BOvdj2b1hCAHzAoMNuj65kNBMz0KBaxM6c3VGBOhU0dURQKOtH8CFNI/dsKkwlv32p26qYQTWoB5bw==", "dev": true, "license": "MIT", "dependencies": { @@ -4942,17 +4910,6 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/@webbtc/webln-types": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@webbtc/webln-types/-/webln-types-3.0.0.tgz", - "integrity": "sha512-aXfTHLKz5lysd+6xTeWl+qHNh/p3qVYbeLo+yDN5cUDmhie2ZoGvkppfWxzbGkcFBzb6dJyQ2/i2cbmDHas+zQ==", - "dev": true, - "license": "MIT", - "funding": { - "type": "lightning", - "url": "lightning:hello@getalby.com" - } - }, "node_modules/acorn": { "version": "8.15.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", @@ -5002,6 +4959,15 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -5389,61 +5355,6 @@ "wrap-ansi": "^6.2.0" } }, - "node_modules/cliui/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" - }, - "node_modules/cliui/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "license": "MIT", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/clsx": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", @@ -5865,6 +5776,12 @@ "embla-carousel": "8.6.0" } }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, "node_modules/entities": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.0.tgz", @@ -7663,17 +7580,6 @@ "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, - "node_modules/pretty-format/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=8" - } - }, "node_modules/pretty-format/node_modules/ansi-styles": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", @@ -8283,6 +8189,32 @@ "dev": true, "license": "MIT" }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/strip-indent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", @@ -9175,6 +9107,20 @@ "node": ">=0.10.0" } }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/ws": { "version": "8.18.3", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", @@ -9269,21 +9215,6 @@ "node": ">=6" } }, - "node_modules/yargs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "license": "MIT" - }, "node_modules/yargs/node_modules/find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -9336,32 +9267,6 @@ "node": ">=8" } }, - "node_modules/yargs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "license": "MIT", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/yargs/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", diff --git a/package.json b/package.json index 0122508..5229402 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ }, "dependencies": { "@fontsource-variable/inter": "^5.2.6", - "@getalby/sdk": "^5.1.1", "@hookform/resolvers": "^5.2.2", "@nostrify/nostrify": "^0.51.0", "@nostrify/react": "^0.4.0", @@ -80,7 +79,6 @@ "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", "@vitejs/plugin-react": "^6.0.1", - "@webbtc/webln-types": "^3.0.0", "autoprefixer": "^10.4.20", "eslint": "^9.9.0", "eslint-plugin-react-hooks": "^5.1.0-rc.0", diff --git a/src/App.tsx b/src/App.tsx index c369d47..1bcf42c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -11,7 +11,6 @@ import { Toaster } from "@/components/ui/toaster"; import { TooltipProvider } from "@/components/ui/tooltip"; import { NostrLoginProvider } from '@nostrify/react/login'; import { AppProvider } from '@/components/AppProvider'; -import { NWCProvider } from '@/contexts/NWCContext'; import { AppConfig } from '@/contexts/AppContext'; import AppRouter from './AppRouter'; @@ -51,14 +50,12 @@ export function App() { - - - - - - - - + + + + + + diff --git a/src/test/TestApp.tsx b/src/test/TestApp.tsx index dabf4e9..5d87264 100644 --- a/src/test/TestApp.tsx +++ b/src/test/TestApp.tsx @@ -4,7 +4,6 @@ import { BrowserRouter } from 'react-router-dom'; import { NostrLoginProvider } from '@nostrify/react/login'; import NostrProvider from '@/components/NostrProvider'; import { AppProvider } from '@/components/AppProvider'; -import { NWCProvider } from '@/contexts/NWCContext'; import { AppConfig } from '@/contexts/AppContext'; interface TestAppProps { @@ -37,11 +36,9 @@ export function TestApp({ children }: TestAppProps) { - - - {children} - - + + {children} +