@hypawave/sdk 0.4.0 → 0.4.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/AGENTS.md CHANGED
@@ -89,9 +89,13 @@ The SDK exposes flat methods (`pp.createInvoice`, `pp.getBolt11`, `pp.confirmPay
89
89
 
90
90
  For Paths 3a / 3b, there is no SDK — use raw HTTP with pubkey signatures per the manual.
91
91
 
92
+ ## Selling execution (paid APIs / compute)
93
+
94
+ Settlement can gate execution, not just files. Set `execution_webhook` on the offer/invoice: on settlement Hypawave delivers the payment preimage to the seller's server, and the buyer holds the same preimage — a shared secret established by the payment. Buyer presents it to the seller's API as the credential; seller verifies and runs the job on their own infrastructure. Works on Path 2 (`execution_webhook` on create-invoice), Path 3a, and Path 3b. See Recipe 6 in llms.txt and the "Sell API Calls & Compute" docs section; the live Hypawave Compute demo (hypawave.com/offers) is this exact pattern.
95
+
92
96
  ## Non-negotiables
93
97
 
94
- 1. **Preimage is mandatory** for principal settlements. Pay via a wallet that returns the preimage (LND, Core Lightning, LNbits admin key, Alby/NWC, Phoenixd). Consumer wallets like Wallet of Satoshi or Phoenix mobile cannot satisfy this.
98
+ 1. **Preimage is mandatory** for principal settlements. Pay via a wallet that returns the preimage (LND, Core Lightning, LNbits admin key, Alby/NWC, Phoenixd). Consumer wallets like Wallet of Satoshi or Phoenix mobile cannot satisfy this. The wallet also needs **funded outbound liquidity ≥ amount + fees** — a fresh/empty node or "fee-credit" balance can't pay even when total balance ≥ price. For small or test payments, a **custodial wallet over NWC (e.g. Coinos)** skips channel setup entirely — only funding is needed.
95
99
  2. **Confirm before unlocking.** Always submit preimage to the confirm endpoint before requesting file keys or download URLs.
96
100
  3. **Funds flow buyer→seller directly.** Never route principal through any Hypawave endpoint. Only activation fees (small, Hypawave-issued bolt11s) go to Hypawave.
97
101
  4. **Honor `terms_hash`** on Path 3b offers. If the server returns `409 terms_changed`, re-read the offer before paying.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,29 @@ All notable changes to `@hypawave/sdk` are documented here.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.4.2]
9
+
10
+ ### Changed
11
+ - Docs only — no API changes. Added the **paid-execution pattern** ("Sell Paid
12
+ APIs & Compute") to `README.md`, `AGENTS.md`, and the bundled
13
+ `skills/hypawave/SKILL.md`: setting `execution_webhook` delivers the payment
14
+ preimage to the seller on settlement, and the buyer holds the same preimage —
15
+ payment itself establishes the buyer's credential for the seller's own API,
16
+ compute, or service. Links the "Sell API Calls & Compute" docs section,
17
+ Recipe 6 in `llms.txt`, and the live Hypawave Compute demo
18
+ (hypawave.com/offers) as the worked example.
19
+
20
+ ## [0.4.1]
21
+
22
+ ### Changed
23
+ - Docs only — no API changes. Clarified payer-wallet requirements in `README.md`,
24
+ `AGENTS.md`, and the bundled `skills/hypawave/SKILL.md`: the wallet needs
25
+ **funded outbound liquidity ≥ amount + fees** (a fresh/empty node or Phoenix
26
+ "fee-credit" balance can't pay even when total balance ≥ price), and for small
27
+ or test payments a **custodial wallet over NWC (e.g. Coinos)** avoids channel
28
+ setup entirely — only funding is needed. Mirrors the buyer-wallet guidance in
29
+ `llms.txt`.
30
+
8
31
  ## [0.4.0]
9
32
 
10
33
  ### Added
package/README.md CHANGED
@@ -44,6 +44,8 @@ This SDK requires **programmable Lightning infrastructure** that exposes the pre
44
44
 
45
45
  - LND, CLN, Alby API, LNbits, NWC, or equivalent
46
46
 
47
+ The wallet also needs **funded outbound liquidity ≥ amount + routing fees** — a fresh/empty node or a "fee-credit" balance (e.g. Phoenix below the channel-open threshold) cannot pay even when total balance ≥ price; only spendable channel liquidity counts. For small or test payments, a **custodial wallet over NWC (e.g. Coinos)** skips channel setup entirely — no liquidity minimum, only funding is needed.
48
+
47
49
  **Consumer wallets (Wallet of Satoshi, Phoenix, etc.) do not reliably expose the preimage and are not suitable for agent integrations.** Files and data will not unlock without a preimage.
48
50
 
49
51
  ## Install
@@ -109,6 +111,14 @@ createInvoice ──▶ getBolt11 ──▶ pay (your node) ──▶ confirmPay
109
111
 
110
112
  Three calls to Hypawave, one call to your Lightning node. Preimage from your node closes the loop.
111
113
 
114
+ ## Sell Paid APIs & Compute
115
+
116
+ Settlement can gate **execution**, not just file delivery. Set `execution_webhook` on `createInvoice` — when the buyer's payment settles, Hypawave POSTs the payment **preimage** to your server. The buyer's wallet revealed the same preimage to them, so payment itself establishes a shared secret: the buyer presents it to *your* API, you verify it against the webhook delivery, and you run the job on your own infrastructure (GPU, data source, whatever you sell). No accounts or API keys needed on the buyer side.
117
+
118
+ This is how the live [Hypawave Compute demo](https://hypawave.com/offers) works — 100 sats buys one live image generation, settlement is the credential. For a standing many-buyer service use an accountless Path 3b offer (raw HTTP, see below); the SDK path is best for one-off, per-customer jobs.
119
+
120
+ Full pattern: [Sell API Calls & Compute docs](https://hypawave.com/docs#sell-execution) · Recipe 6 in [llms.txt](https://hypawave.com/llms.txt)
121
+
112
122
  ## SDK for ergonomics. Raw HTTP for accountless agents.
113
123
 
114
124
  The SDK handles types, retries, polling, error parsing, and self-describing payload generation for **Path 2** (account-based agent API). Use raw HTTP when you need:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypawave/sdk",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "TypeScript SDK for Lightning settlement, preimage proof, and execution unlocks for AI agents.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -84,9 +84,13 @@ The SDK exposes flat methods (`pp.createInvoice`, `pp.getBolt11`, `pp.confirmPay
84
84
 
85
85
  For Paths 3a / 3b, there is no SDK — use raw HTTP with pubkey signatures per the manual.
86
86
 
87
+ ## Selling execution (paid APIs / compute)
88
+
89
+ Settlement can gate execution, not just files. Set `execution_webhook` on the offer/invoice: on settlement Hypawave delivers the payment preimage to the seller's server, and the buyer holds the same preimage — a shared secret established by the payment. Buyer presents it to the seller's API as the credential; seller verifies and runs the job on their own infrastructure. Works on Path 2 (`execution_webhook` on create-invoice), Path 3a, and Path 3b. See Recipe 6 in llms.txt and the "Sell API Calls & Compute" docs section; the live Hypawave Compute demo (hypawave.com/offers) is this exact pattern.
90
+
87
91
  ## Non-negotiables
88
92
 
89
- 1. **Preimage is mandatory** for principal settlements. Pay via a wallet that returns the preimage (LND, Core Lightning, LNbits admin key, Alby/NWC, Phoenixd). Consumer wallets like Wallet of Satoshi or Phoenix mobile cannot satisfy this.
93
+ 1. **Preimage is mandatory** for principal settlements. Pay via a wallet that returns the preimage (LND, Core Lightning, LNbits admin key, Alby/NWC, Phoenixd). Consumer wallets like Wallet of Satoshi or Phoenix mobile cannot satisfy this. The wallet also needs **funded outbound liquidity ≥ amount + fees** — a fresh/empty node or "fee-credit" balance can't pay even when total balance ≥ price. For small or test payments, a **custodial wallet over NWC (e.g. Coinos)** skips channel setup entirely — only funding is needed.
90
94
  2. **Confirm before unlocking.** Always submit preimage to the confirm endpoint before requesting file keys or download URLs.
91
95
  3. **Funds flow buyer→seller directly.** Never route principal through any Hypawave endpoint. Only activation fees (small, Hypawave-issued bolt11s) go to Hypawave.
92
96
  4. **Honor `terms_hash`** on Path 3b offers. If the server returns `409 terms_changed`, re-read the offer before paying.