lightning-agent 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/lib/wallet.js +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# ⚡ lightning-agent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Settle this transaction without a platform.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
You can't transact without a payment rail. lightning-agent is the rail — payments, auth, escrow, and streaming micropayments over [Nostr Wallet Connect (NWC)](https://nwc.dev). No browser, no UI, no bank accounts, no Stripe. Connect to any NWC-compatible wallet (Alby Hub, Mutiny, etc.) and two agents can exchange value directly.
|
|
6
|
+
|
|
7
|
+
Part of the constraint chain: [agent-discovery](https://github.com/jeletor/agent-discovery) (find) → [ai-wot](https://github.com/jeletor/ai-wot) (verify) → **lightning-agent** (pay) → [lightning-toll](https://github.com/jeletor/lightning-toll) (gate).
|
|
6
8
|
|
|
7
9
|
## Install
|
|
8
10
|
|
package/lib/wallet.js
CHANGED
|
@@ -265,12 +265,14 @@ class NWCWallet {
|
|
|
265
265
|
* @param {number} [opts.timeoutMs] - Request timeout
|
|
266
266
|
*/
|
|
267
267
|
async createInvoice(opts = {}) {
|
|
268
|
-
|
|
268
|
+
// Accept both amountSats and amount for convenience
|
|
269
|
+
const sats = opts.amountSats || opts.amount;
|
|
270
|
+
if (!sats || sats <= 0) {
|
|
269
271
|
throw new Error('amountSats is required and must be positive');
|
|
270
272
|
}
|
|
271
273
|
|
|
272
274
|
const params = {
|
|
273
|
-
amount:
|
|
275
|
+
amount: sats * 1000, // NWC uses millisats
|
|
274
276
|
};
|
|
275
277
|
if (opts.description) params.description = opts.description;
|
|
276
278
|
if (opts.expiry) params.expiry = opts.expiry;
|