Commit graph

13 commits

Author SHA1 Message Date
77e5772afd feat(extensions): add extension loader infrastructure (#3)
Some checks are pending
Docker Compose Actions Workflow / test (push) Waiting to run
## Summary

- Adds a modular extension system for Lightning.Pub enabling third-party plugins
- Provides isolated SQLite databases per extension for data safety
- Implements ExtensionContext API for accessing Lightning.Pub services (payments, Nostr, storage)
- Supports RPC method registration with automatic namespacing
- Includes HTTP route handling for protocols like LNURL
- Event routing for payment receipts and Nostr events
- Comprehensive documentation with architecture overview and working examples

## Key Components

- `src/extensions/types.ts` - Core extension interfaces
- `src/extensions/loader.ts` - Extension discovery, loading, and lifecycle management
- `src/extensions/context.ts` - Bridge between extensions and Lightning.Pub services
- `src/extensions/database.ts` - SQLite isolation with WAL mode
- `src/extensions/README.md` - Full documentation with examples

## ExtensionContext API

| Method | Description |
|--------|-------------|
| `getApplication()` | Get application info |
| `createInvoice()` | Create Lightning invoice |
| `payInvoice()` | Pay Lightning invoice |
| `getLnurlPayInfo()` | Get LNURL-pay info for a user (enables Lightning Address/zaps) |
| `sendEncryptedDM()` | Send Nostr DM (NIP-44) |
| `publishNostrEvent()` | Publish Nostr event |
| `registerMethod()` | Register RPC method |
| `onPaymentReceived()` | Subscribe to payment callbacks |
| `onNostrEvent()` | Subscribe to Nostr events |

## Test plan

- [x] Review extension loader code for correctness
- [x] Verify TypeScript compilation succeeds
- [x] Test extension discovery from `src/extensions/` directory
- [x] Test RPC method registration and routing
- [x] Test database isolation between extensions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: boufni95 <boufni95@gmail.com>
Co-authored-by: Patrick Mulligan <patjmulligan@protonmail.com>
Reviewed-on: #3
2026-04-02 18:47:55 +00:00
Justin (shocknet)
8084e51596 docker 2024-07-21 19:00:12 -04:00
polarDefender
90058deb1a fix ui responsive ness 2024-05-28 19:57:20 +09:00
Justin (shocknet)
a540ba674a ver 2024-05-08 16:47:22 -04:00
polarDefender
98dd2705b4 added docker file 2024-05-06 03:11:19 -07:00
hatim boufnichel
de2755f8ed wip 2022-05-15 21:24:50 +02:00
hatim boufnichel
4c17f033f5 up dockerfile 2021-09-08 18:02:18 +02:00
boufni95
c133f8ab26 Update Dockerfile 2021-09-03 20:35:46 +02:00
boufni95
2b5d70819e Update Dockerfile 2021-09-03 20:18:19 +02:00
boufni95
16cb1caf41 Update Dockerfile 2021-09-03 20:01:42 +02:00
boufni95
e88d26133e Update Dockerfile 2021-09-03 18:04:17 +02:00
Erfan Besharat
ffd87988c8 Add new CLI Dockerfile 2021-07-08 19:17:40 +04:30
boufni95
017dbab0c9 add docker files 2020-06-27 16:30:50 +02:00