@hypawave/sdk 0.3.0 → 0.4.0

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
@@ -96,7 +96,7 @@ For Paths 3a / 3b, there is no SDK — use raw HTTP with pubkey signatures per t
96
96
  3. **Funds flow buyer→seller directly.** Never route principal through any Hypawave endpoint. Only activation fees (small, Hypawave-issued bolt11s) go to Hypawave.
97
97
  4. **Honor `terms_hash`** on Path 3b offers. If the server returns `409 terms_changed`, re-read the offer before paying.
98
98
  5. **Do not invent endpoints.** If a field or path is not in openapi.json, it does not exist.
99
- 6. **Encrypt client-side** for file attachments. AES-256-GCM. Hypawave never sees plaintext.
99
+ 6. **Encrypt client-side** for file attachments. AES-256-GCM. Hypawave never sees plaintext. `storeFile` requires `ciphertext_sha256` (SHA-256 hex of the bytes you upload) — Hypawave verifies + seals it so buyers can verify what they download.
100
100
 
101
101
  ## When you hit something the manual doesn't cover
102
102
 
package/CHANGELOG.md CHANGED
@@ -5,6 +5,20 @@ 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.0]
9
+
10
+ ### Added
11
+ - `StoreFileParams.ciphertext_sha256` (**required**) — the lowercase-hex SHA-256
12
+ of the exact ciphertext you upload. Hypawave verifies it against the stored
13
+ bytes and seals them at the first bolt11 mint, and returns it at key retrieval
14
+ so buyers can verify downloaded bytes before decrypting (content integrity /
15
+ anti-bait-and-switch).
16
+
17
+ ### Changed
18
+ - `storeFile()` now requires `ciphertext_sha256`. Compute `sha256` over the same
19
+ bytes you PUT to the presigned upload URL and pass it through. Calls without it
20
+ are rejected by the API with `400 validation_error`.
21
+
8
22
  ## [0.3.0]
9
23
 
10
24
  ### Added
package/README.md CHANGED
@@ -384,7 +384,7 @@ Additional methods available — see types for full signatures, or [openapi.json
384
384
  - `listInvoices(params?)` — list invoices with filters and pagination
385
385
  - `getPayerReceipt(invoiceId, preimage)` — payer receipt fetch using the Lightning preimage as proof of payment (no API key needed)
386
386
  - `getUploadUrl(params)` — signed URL for encrypted file upload (creator side)
387
- - `storeFile(params)` — register an uploaded file against an invoice
387
+ - `storeFile(params)` — register an uploaded file against an invoice (requires `ciphertext_sha256`: the SHA-256 hex of the bytes you uploaded; Hypawave verifies + seals it so buyers can verify what they download)
388
388
  - `storeFileKey(params)` — register a file's encryption key against an invoice
389
389
 
390
390
  ## Error Handling
package/dist/index.d.mts CHANGED
@@ -108,6 +108,13 @@ interface StoreFileParams {
108
108
  file_name: string;
109
109
  encrypted_file_url: string;
110
110
  iv_hex: string;
111
+ /**
112
+ * Lowercase-hex SHA-256 of the exact ciphertext uploaded to storage. Required.
113
+ * Hypawave verifies it against the stored bytes and seals them at the first
114
+ * bolt11 mint, and returns it at key retrieval so buyers can verify what they
115
+ * download. Compute over the same bytes you PUT to the presigned upload URL.
116
+ */
117
+ ciphertext_sha256: string;
111
118
  key_hash?: string;
112
119
  size?: number;
113
120
  }
package/dist/index.d.ts CHANGED
@@ -108,6 +108,13 @@ interface StoreFileParams {
108
108
  file_name: string;
109
109
  encrypted_file_url: string;
110
110
  iv_hex: string;
111
+ /**
112
+ * Lowercase-hex SHA-256 of the exact ciphertext uploaded to storage. Required.
113
+ * Hypawave verifies it against the stored bytes and seals them at the first
114
+ * bolt11 mint, and returns it at key retrieval so buyers can verify what they
115
+ * download. Compute over the same bytes you PUT to the presigned upload URL.
116
+ */
117
+ ciphertext_sha256: string;
111
118
  key_hash?: string;
112
119
  size?: number;
113
120
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hypawave/sdk",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
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",
@@ -91,7 +91,7 @@ For Paths 3a / 3b, there is no SDK — use raw HTTP with pubkey signatures per t
91
91
  3. **Funds flow buyer→seller directly.** Never route principal through any Hypawave endpoint. Only activation fees (small, Hypawave-issued bolt11s) go to Hypawave.
92
92
  4. **Honor `terms_hash`** on Path 3b offers. If the server returns `409 terms_changed`, re-read the offer before paying.
93
93
  5. **Do not invent endpoints.** If a field or path is not in openapi.json, it does not exist.
94
- 6. **Encrypt client-side** for file attachments. AES-256-GCM. Hypawave never sees plaintext.
94
+ 6. **Encrypt client-side** for file attachments. AES-256-GCM. Hypawave never sees plaintext. `storeFile` requires `ciphertext_sha256` (SHA-256 hex of the bytes you upload) — Hypawave verifies + seals it so buyers can verify what they download.
95
95
 
96
96
  ## When you hit something the manual doesn't cover
97
97