sealnet 2.0.3 → 3.0.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 +11 -8
- package/THIRD-PARTY-NOTICES.txt +1 -1
- package/dist/index.cjs +1924 -1043
- package/dist/index.d.cts +11 -8
- package/dist/index.d.ts +11 -8
- package/dist/index.js +1924 -1043
- package/dist/seal.global.js +3 -2
- package/dist/seal.global.js.sha384 +1 -1
- package/dist/seal_crypto.wasm +0 -0
- package/dist/seal_crypto.wasm.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/
|
|
24
|
-
integrity="sha384-
|
|
23
|
+
src="https://seal.net/sdk/v3.0.0/seal.js"
|
|
24
|
+
integrity="sha384-7QN3kkGFAQcUG+Jl0W4A9V1WSTzpaLHpbgPkUwF8c2MZExZR6LhPYIZASG3uXxUC"
|
|
25
25
|
crossorigin="anonymous"
|
|
26
26
|
></script>
|
|
27
27
|
<script>
|
|
@@ -135,7 +135,10 @@ that errored.
|
|
|
135
135
|
|
|
136
136
|
Reading a seal is open to Node and to pages served from seal.net. A browser
|
|
137
137
|
page on any other site sends and asks (`send`, `request`) but does not read:
|
|
138
|
-
the receiving endpoints answer no other origin.
|
|
138
|
+
the receiving endpoints answer no other origin. A page served from seal.net
|
|
139
|
+
reaches the API through the site's own `/api`, not `api.seal.net`:
|
|
140
|
+
`new SealClient({ apiUrl: 'https://seal.net/api' })`. Without `to` (Node only)
|
|
141
|
+
what you read lives in the page: leaving it loses an answer.
|
|
139
142
|
|
|
140
143
|
```typescript
|
|
141
144
|
const opened = await seal.open(link, { password: 'secret42' })
|
|
@@ -162,7 +165,7 @@ const ask = await seal.request({
|
|
|
162
165
|
kind: 'secret', // 'secret' | 'file' | 'any'
|
|
163
166
|
whereUrl: 'https://api.search.brave.com/app/keys', // where the key is created
|
|
164
167
|
})
|
|
165
|
-
show(ask.url, ask.words) // the page shows the same
|
|
168
|
+
show(ask.url, ask.words) // the page shows the same eight words
|
|
166
169
|
|
|
167
170
|
const answer = await seal.waitFor(ask.intakeId, { keyPair: keys, to: './secrets' })
|
|
168
171
|
answer.files[0].path // the value stays in the file
|
|
@@ -170,7 +173,7 @@ answer.files[0].path // the value stays in the file
|
|
|
170
173
|
|
|
171
174
|
A link addressed to your address opens with `open(link, { keyPair: keys })`.
|
|
172
175
|
|
|
173
|
-
The
|
|
176
|
+
The eight words name your address to the person (`fingerprint_words.json`):
|
|
174
177
|
the same address gives the same words in every SEAL client.
|
|
175
178
|
|
|
176
179
|
## Sending to an address, and your inbox
|
|
@@ -189,7 +192,7 @@ sent.delivered // true: it is in their inbox
|
|
|
189
192
|
|
|
190
193
|
const inbox = await seal.inbox({ keyPair: keys, wait: 60 }) // waits up to 60 s for something
|
|
191
194
|
for (const item of inbox.items) {
|
|
192
|
-
// item: { id, fromWords (
|
|
195
|
+
// item: { id, fromWords (eight words of the sender, or null), label, receivedAt, expiresAt }
|
|
193
196
|
const saved = await seal.open(item, { keyPair: keys, to: './downloads' })
|
|
194
197
|
await seal.dismiss(item, { keyPair: keys })
|
|
195
198
|
}
|
|
@@ -201,14 +204,14 @@ to wait for the next change instead of the next item.
|
|
|
201
204
|
## A person's SEAL inbox
|
|
202
205
|
|
|
203
206
|
A person keeps their own inbox at box.seal.net. Connect your address to it once:
|
|
204
|
-
they open the page, compare the
|
|
207
|
+
they open the page, compare the eight words and connect. From then on pass
|
|
205
208
|
their address as `owner` and every seal you send also lands in their inbox,
|
|
206
209
|
where they manage and revoke it; pass it as `to` to `request` and the request
|
|
207
210
|
waits there as a card.
|
|
208
211
|
|
|
209
212
|
```typescript
|
|
210
213
|
const pairing = await seal.pair({ keyPair: keys, name: 'Report bot' })
|
|
211
|
-
show(pairing.url, pairing.words) // the page shows the same
|
|
214
|
+
show(pairing.url, pairing.words) // the page shows the same eight words
|
|
212
215
|
const inbox = await pairing.wait() // { address, name }
|
|
213
216
|
|
|
214
217
|
const sent = await seal.send({ file, filename: 'report.pdf', ttl: '1d', owner: inbox.address, keyPair: keys })
|
package/THIRD-PARTY-NOTICES.txt
CHANGED