|
|
77e5772afd
|
feat(extensions): add extension loader infrastructure (#3)
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 |
|
boufni95
|
b5bd1a74d9
|
channel rpc
|
2024-08-23 20:20:10 +02:00 |
|
polarDefender
|
90058deb1a
|
fix ui responsive ness
|
2024-05-28 19:57:20 +09:00 |
|
boufni95
|
28183ed3ed
|
fix
|
2023-11-24 22:52:42 +01:00 |
|
boufni95
|
6c219c6f62
|
pending txs
|
2023-11-24 22:38:37 +01:00 |
|
hatim boufnichel
|
4fd8c0d71d
|
updates
|
2022-11-21 23:12:38 +01:00 |
|
hatim boufnichel
|
91d67ab4ee
|
lnurl withdraw + lnurl pay
|
2022-11-19 23:02:05 +01:00 |
|
hatim boufnichel
|
50ba34e050
|
initial nosrt integration
|
2022-11-15 22:35:24 +01:00 |
|
hatim boufnichel
|
f39025df53
|
wip
|
2022-11-06 20:26:14 +01:00 |
|
hatim boufnichel
|
de2755f8ed
|
wip
|
2022-05-15 21:24:50 +02:00 |
|