sealnet 1.1.2 → 1.3.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 +44 -2
- package/THIRD-PARTY-NOTICES.txt +1 -1
- package/dist/index.cjs +568 -114
- package/dist/index.d.cts +99 -12
- package/dist/index.d.ts +99 -12
- package/dist/index.js +563 -109
- package/dist/seal.global.js +2 -2
- package/dist/seal.global.js.sha384 +1 -1
- package/package.json +1 -1
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.
|
|
24
|
-
integrity="sha384-
|
|
23
|
+
src="https://seal.net/sdk/v1.3.0/seal.js"
|
|
24
|
+
integrity="sha384-CJIB2VIieqftNMeDtRlqjDL+8bXDWZerJvz+W2qSTNkj4k9HrK4Qljcfghiku+cQ"
|
|
25
25
|
crossorigin="anonymous"
|
|
26
26
|
></script>
|
|
27
27
|
<script>
|
|
@@ -170,6 +170,48 @@ 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
|
+
## Sending to a key, and your inbox
|
|
174
|
+
|
|
175
|
+
Your key's public half is your address. `secretKey` is the same value as
|
|
176
|
+
`SEAL_SEED` of the `seal` CLI and of `sealnet-mcp`, so one key gives one
|
|
177
|
+
address in every client. `send({ to })` addresses the link to
|
|
178
|
+
someone's address: it opens only with their key, and it lands in their inbox,
|
|
179
|
+
so nobody has to pass the link on.
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
const sent = await seal.send({ file, filename: 'report.pdf', ttl: '30m', to: theirAddress })
|
|
183
|
+
sent.delivered // true: it is in their inbox
|
|
184
|
+
|
|
185
|
+
const inbox = await seal.inbox({ keyPair: keys, wait: 60 }) // waits up to 60 s for something
|
|
186
|
+
for (const item of inbox.items) {
|
|
187
|
+
// item: { id, from (three emoji of the sender, or null), label, receivedAt, expiresAt }
|
|
188
|
+
const saved = await seal.open(item, { keyPair: keys, to: './downloads' })
|
|
189
|
+
await seal.dismiss(item, { keyPair: keys })
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
The inbox is shown only to the holder of the key. Pass `seen: inbox.version`
|
|
194
|
+
to wait for the next change instead of the next item.
|
|
195
|
+
|
|
196
|
+
## A person's SEAL inbox
|
|
197
|
+
|
|
198
|
+
A person keeps their own inbox at box.seal.net. Connect your key to it once:
|
|
199
|
+
they open the page, compare the three emoji and connect. From then on pass
|
|
200
|
+
their address as `owner` and every seal you send also lands in their inbox,
|
|
201
|
+
where they manage and revoke it; pass it as `to` to `request` and the request
|
|
202
|
+
waits there as a card.
|
|
203
|
+
|
|
204
|
+
```typescript
|
|
205
|
+
const pairing = await seal.pair({ keyPair: keys, name: 'Report bot' })
|
|
206
|
+
show(pairing.url, pairing.emoji) // the page shows the same three emoji
|
|
207
|
+
const inbox = await pairing.wait() // { address, name }
|
|
208
|
+
|
|
209
|
+
const sent = await seal.send({ file, filename: 'report.pdf', ttl: '1d', owner: inbox.address, keyPair: keys })
|
|
210
|
+
sent.ownerCopy // true: it is in their inbox (false if the inbox refused; the seal is sent anyway)
|
|
211
|
+
|
|
212
|
+
await seal.request({ what: 'Brave API key', recipientKey: keys.publicKey, to: inbox.address })
|
|
213
|
+
```
|
|
214
|
+
|
|
173
215
|
## Error handling
|
|
174
216
|
|
|
175
217
|
```typescript
|
package/THIRD-PARTY-NOTICES.txt
CHANGED