sealnet 1.2.0 → 1.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/README.md CHANGED
@@ -20,8 +20,8 @@ and the SDK arrives as one global.
20
20
 
21
21
  ```html
22
22
  <script
23
- src="https://seal.net/sdk/v1.2.0/seal.js"
24
- integrity="sha384-Z9JT8V6dg70AeS2wMJiHucnsDHMrpgKm0nl2x5I4qp6Rpm0IVAQe/z9eTKEKumRP"
23
+ src="https://seal.net/sdk/v1.4.0/seal.js"
24
+ integrity="sha384-tLe4sOcc/DDwe9iof3rJafPeSusTQaHeiGfS4nrsrfVTCk/rudbOq/uEmvudg9re"
25
25
  crossorigin="anonymous"
26
26
  ></script>
27
27
  <script>
@@ -162,7 +162,7 @@ const ask = await seal.request({
162
162
  kind: 'secret', // 'secret' | 'file' | 'any'
163
163
  whereUrl: 'https://api.search.brave.com/app/keys', // where the key is created
164
164
  })
165
- show(ask.url, ask.emoji) // the page shows the same three emoji
165
+ show(ask.url, ask.words) // the page shows the same three words
166
166
 
167
167
  const answer = await seal.waitFor(ask.intakeId, { keyPair: keys, to: './secrets' })
168
168
  answer.files[0].path // the value stays in the file
@@ -170,6 +170,11 @@ answer.files[0].path // the value stays in the file
170
170
 
171
171
  A link addressed to your key opens with `open(link, { keyPair: keys })`.
172
172
 
173
+ The three words name your key to the person (`fingerprint_words.json`): the
174
+ same key gives the same words in every SEAL client. Before 1.4 the SDK gave
175
+ three emoji; `emoji` and an inbox item's `from` still carry them, deprecated,
176
+ until 2.0.
177
+
173
178
  ## Sending to a key, and your inbox
174
179
 
175
180
  Your key's public half is your address. `secretKey` is the same value as
@@ -184,7 +189,7 @@ sent.delivered // true: it is in their inbox
184
189
 
185
190
  const inbox = await seal.inbox({ keyPair: keys, wait: 60 }) // waits up to 60 s for something
186
191
  for (const item of inbox.items) {
187
- // item: { id, from (three emoji of the sender, or null), label, receivedAt, expiresAt }
192
+ // item: { id, fromWords (three words of the sender, or null), label, receivedAt, expiresAt }
188
193
  const saved = await seal.open(item, { keyPair: keys, to: './downloads' })
189
194
  await seal.dismiss(item, { keyPair: keys })
190
195
  }
@@ -193,6 +198,25 @@ for (const item of inbox.items) {
193
198
  The inbox is shown only to the holder of the key. Pass `seen: inbox.version`
194
199
  to wait for the next change instead of the next item.
195
200
 
201
+ ## A person's SEAL inbox
202
+
203
+ A person keeps their own inbox at box.seal.net. Connect your key to it once:
204
+ they open the page, compare the three words and connect. From then on pass
205
+ their address as `owner` and every seal you send also lands in their inbox,
206
+ where they manage and revoke it; pass it as `to` to `request` and the request
207
+ waits there as a card.
208
+
209
+ ```typescript
210
+ const pairing = await seal.pair({ keyPair: keys, name: 'Report bot' })
211
+ show(pairing.url, pairing.words) // the page shows the same three words
212
+ const inbox = await pairing.wait() // { address, name }
213
+
214
+ const sent = await seal.send({ file, filename: 'report.pdf', ttl: '1d', owner: inbox.address, keyPair: keys })
215
+ sent.ownerCopy // true: it is in their inbox (false if the inbox refused; the seal is sent anyway)
216
+
217
+ await seal.request({ what: 'Brave API key', recipientKey: keys.publicKey, to: inbox.address })
218
+ ```
219
+
196
220
  ## Error handling
197
221
 
198
222
  ```typescript
@@ -1,4 +1,4 @@
1
- sealnet 1.2.0 — third-party notices
1
+ sealnet 1.4.0 — third-party notices
2
2
 
3
3
  The standalone browser build (dist/seal.global.js, also published at
4
4
  https://seal.net/sdk/v<version>/seal.js) bundles the software below.