@quilibrium/quilibrium-js-sdk-channels 2.1.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/LICENSE +21 -0
- package/dist/channel/channel.d.ts +332 -0
- package/dist/components/context/PasskeysContext.d.ts +34 -0
- package/dist/components/modals/PasskeyModal.d.ts +10 -0
- package/dist/index.d.ts +1011 -0
- package/dist/index.esm.js +7059 -0
- package/dist/index.js +7067 -0
- package/dist/passkeys/types.d.ts +69 -0
- package/package.json +44 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1011 @@
|
|
|
1
|
+
import React, { FC, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
/**
|
|
6
|
+
* @param {string} input
|
|
7
|
+
* @returns {string}
|
|
8
|
+
*/
|
|
9
|
+
declare function js_decrypt_inbox_message(input: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* @param {string} input
|
|
12
|
+
* @returns {string}
|
|
13
|
+
*/
|
|
14
|
+
declare function js_encrypt_inbox_message(input: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* @param {string} input
|
|
17
|
+
* @returns {string}
|
|
18
|
+
*/
|
|
19
|
+
declare function js_sender_x3dh(input: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* @param {string} input
|
|
22
|
+
* @returns {string}
|
|
23
|
+
*/
|
|
24
|
+
declare function js_receiver_x3dh(input: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* @returns {string}
|
|
27
|
+
*/
|
|
28
|
+
declare function js_generate_x448(): string;
|
|
29
|
+
/**
|
|
30
|
+
* @returns {string}
|
|
31
|
+
*/
|
|
32
|
+
declare function js_generate_ed448(): string;
|
|
33
|
+
/**
|
|
34
|
+
* @param {string} key
|
|
35
|
+
* @returns {string}
|
|
36
|
+
*/
|
|
37
|
+
declare function js_get_pubkey_ed448(key: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* @param {string} key
|
|
40
|
+
* @returns {string}
|
|
41
|
+
*/
|
|
42
|
+
declare function js_get_pubkey_x448(key: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* @param {string} key
|
|
45
|
+
* @param {string} message
|
|
46
|
+
* @returns {string}
|
|
47
|
+
*/
|
|
48
|
+
declare function js_sign_ed448(key: string, message: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* @param {string} public_key
|
|
51
|
+
* @param {string} message
|
|
52
|
+
* @param {string} signature
|
|
53
|
+
* @returns {string}
|
|
54
|
+
*/
|
|
55
|
+
declare function js_verify_ed448(
|
|
56
|
+
public_key: string,
|
|
57
|
+
message: string,
|
|
58
|
+
signature: string
|
|
59
|
+
): string;
|
|
60
|
+
/**
|
|
61
|
+
* @param {string} params
|
|
62
|
+
* @returns {string}
|
|
63
|
+
*/
|
|
64
|
+
declare function js_new_double_ratchet(params: string): string;
|
|
65
|
+
/**
|
|
66
|
+
* @param {string} params
|
|
67
|
+
* @returns {string}
|
|
68
|
+
*/
|
|
69
|
+
declare function js_double_ratchet_encrypt(params: string): string;
|
|
70
|
+
/**
|
|
71
|
+
* @param {string} params
|
|
72
|
+
* @returns {string}
|
|
73
|
+
*/
|
|
74
|
+
declare function js_double_ratchet_decrypt(params: string): string;
|
|
75
|
+
/**
|
|
76
|
+
* @param {string} params
|
|
77
|
+
* @returns {string}
|
|
78
|
+
*/
|
|
79
|
+
declare function js_new_triple_ratchet(params: string): string;
|
|
80
|
+
/**
|
|
81
|
+
* @param {string} params
|
|
82
|
+
* @returns {string}
|
|
83
|
+
*/
|
|
84
|
+
declare function js_triple_ratchet_init_round_1(params: string): string;
|
|
85
|
+
/**
|
|
86
|
+
* @param {string} params
|
|
87
|
+
* @returns {string}
|
|
88
|
+
*/
|
|
89
|
+
declare function js_triple_ratchet_init_round_2(params: string): string;
|
|
90
|
+
/**
|
|
91
|
+
* @param {string} params
|
|
92
|
+
* @returns {string}
|
|
93
|
+
*/
|
|
94
|
+
declare function js_triple_ratchet_init_round_3(params: string): string;
|
|
95
|
+
/**
|
|
96
|
+
* @param {string} params
|
|
97
|
+
* @returns {string}
|
|
98
|
+
*/
|
|
99
|
+
declare function js_triple_ratchet_init_round_4(params: string): string;
|
|
100
|
+
/**
|
|
101
|
+
* @param {string} params
|
|
102
|
+
* @returns {string}
|
|
103
|
+
*/
|
|
104
|
+
declare function js_triple_ratchet_encrypt(params: string): string;
|
|
105
|
+
/**
|
|
106
|
+
* @param {string} params
|
|
107
|
+
* @returns {string}
|
|
108
|
+
*/
|
|
109
|
+
declare function js_triple_ratchet_decrypt(params: string): string;
|
|
110
|
+
/**
|
|
111
|
+
* @param {string} params
|
|
112
|
+
* @returns {string}
|
|
113
|
+
*/
|
|
114
|
+
declare function js_triple_ratchet_resize(params: string): string;
|
|
115
|
+
/**
|
|
116
|
+
* @param {string} params
|
|
117
|
+
* @returns {string}
|
|
118
|
+
*/
|
|
119
|
+
declare function js_verify_point(params: string): string;
|
|
120
|
+
|
|
121
|
+
type InitInput =
|
|
122
|
+
| RequestInfo
|
|
123
|
+
| URL
|
|
124
|
+
| Response
|
|
125
|
+
| BufferSource
|
|
126
|
+
| WebAssembly.Module;
|
|
127
|
+
|
|
128
|
+
interface InitOutput {
|
|
129
|
+
readonly memory: WebAssembly.Memory;
|
|
130
|
+
readonly js_decrypt_inbox_message: (a: number, b: number, c: number) => void;
|
|
131
|
+
readonly js_encrypt_inbox_message: (a: number, b: number, c: number) => void;
|
|
132
|
+
readonly js_sender_x3dh: (a: number, b: number, c: number) => void;
|
|
133
|
+
readonly js_receiver_x3dh: (a: number, b: number, c: number) => void;
|
|
134
|
+
readonly js_generate_x448: (a: number) => void;
|
|
135
|
+
readonly js_generate_ed448: (a: number) => void;
|
|
136
|
+
readonly js_get_pubkey_ed448: (a: number, b: number, c: number) => void;
|
|
137
|
+
readonly js_get_pubkey_x448: (a: number, b: number, c: number) => void;
|
|
138
|
+
readonly js_sign_ed448: (
|
|
139
|
+
a: number,
|
|
140
|
+
b: number,
|
|
141
|
+
c: number,
|
|
142
|
+
d: number,
|
|
143
|
+
e: number
|
|
144
|
+
) => void;
|
|
145
|
+
readonly js_verify_ed448: (
|
|
146
|
+
a: number,
|
|
147
|
+
b: number,
|
|
148
|
+
c: number,
|
|
149
|
+
d: number,
|
|
150
|
+
e: number,
|
|
151
|
+
f: number,
|
|
152
|
+
g: number
|
|
153
|
+
) => void;
|
|
154
|
+
readonly js_new_double_ratchet: (a: number, b: number, c: number) => void;
|
|
155
|
+
readonly js_double_ratchet_encrypt: (a: number, b: number, c: number) => void;
|
|
156
|
+
readonly js_double_ratchet_decrypt: (a: number, b: number, c: number) => void;
|
|
157
|
+
readonly js_new_triple_ratchet: (a: number, b: number, c: number) => void;
|
|
158
|
+
readonly js_triple_ratchet_init_round_1: (
|
|
159
|
+
a: number,
|
|
160
|
+
b: number,
|
|
161
|
+
c: number
|
|
162
|
+
) => void;
|
|
163
|
+
readonly js_triple_ratchet_init_round_2: (
|
|
164
|
+
a: number,
|
|
165
|
+
b: number,
|
|
166
|
+
c: number
|
|
167
|
+
) => void;
|
|
168
|
+
readonly js_triple_ratchet_init_round_3: (
|
|
169
|
+
a: number,
|
|
170
|
+
b: number,
|
|
171
|
+
c: number
|
|
172
|
+
) => void;
|
|
173
|
+
readonly js_triple_ratchet_init_round_4: (
|
|
174
|
+
a: number,
|
|
175
|
+
b: number,
|
|
176
|
+
c: number
|
|
177
|
+
) => void;
|
|
178
|
+
readonly js_triple_ratchet_encrypt: (a: number, b: number, c: number) => void;
|
|
179
|
+
readonly js_triple_ratchet_decrypt: (a: number, b: number, c: number) => void;
|
|
180
|
+
readonly js_triple_ratchet_resize: (a: number, b: number, c: number) => void;
|
|
181
|
+
readonly js_verify_point: (a: number, b: number, c: number) => void;
|
|
182
|
+
readonly uniffi_channel_checksum_func_double_ratchet_decrypt: () => number;
|
|
183
|
+
readonly uniffi_channel_checksum_func_double_ratchet_encrypt: () => number;
|
|
184
|
+
readonly uniffi_channel_checksum_func_new_double_ratchet: () => number;
|
|
185
|
+
readonly uniffi_channel_checksum_func_new_triple_ratchet: () => number;
|
|
186
|
+
readonly uniffi_channel_checksum_func_triple_ratchet_decrypt: () => number;
|
|
187
|
+
readonly uniffi_channel_checksum_func_triple_ratchet_encrypt: () => number;
|
|
188
|
+
readonly uniffi_channel_checksum_func_triple_ratchet_init_round_1: () => number;
|
|
189
|
+
readonly uniffi_channel_checksum_func_triple_ratchet_init_round_2: () => number;
|
|
190
|
+
readonly uniffi_channel_checksum_func_triple_ratchet_init_round_3: () => number;
|
|
191
|
+
readonly uniffi_channel_checksum_func_triple_ratchet_init_round_4: () => number;
|
|
192
|
+
readonly ffi_channel_uniffi_contract_version: () => number;
|
|
193
|
+
readonly ffi_channel_rustbuffer_alloc: (
|
|
194
|
+
a: number,
|
|
195
|
+
b: number,
|
|
196
|
+
c: number
|
|
197
|
+
) => void;
|
|
198
|
+
readonly ffi_channel_rustbuffer_from_bytes: (
|
|
199
|
+
a: number,
|
|
200
|
+
b: number,
|
|
201
|
+
c: number,
|
|
202
|
+
d: number
|
|
203
|
+
) => void;
|
|
204
|
+
readonly ffi_channel_rustbuffer_free: (
|
|
205
|
+
a: number,
|
|
206
|
+
b: number,
|
|
207
|
+
c: number,
|
|
208
|
+
d: number
|
|
209
|
+
) => void;
|
|
210
|
+
readonly ffi_channel_rustbuffer_reserve: (
|
|
211
|
+
a: number,
|
|
212
|
+
b: number,
|
|
213
|
+
c: number,
|
|
214
|
+
d: number,
|
|
215
|
+
e: number,
|
|
216
|
+
f: number
|
|
217
|
+
) => void;
|
|
218
|
+
readonly ffi_channel_foreign_executor_callback_set: (a: number) => void;
|
|
219
|
+
readonly ffi_channel_rust_future_continuation_callback_set: (
|
|
220
|
+
a: number
|
|
221
|
+
) => void;
|
|
222
|
+
readonly ffi_channel_rust_future_complete_u8: (
|
|
223
|
+
a: number,
|
|
224
|
+
b: number
|
|
225
|
+
) => number;
|
|
226
|
+
readonly ffi_channel_rust_future_complete_i8: (
|
|
227
|
+
a: number,
|
|
228
|
+
b: number
|
|
229
|
+
) => number;
|
|
230
|
+
readonly ffi_channel_rust_future_complete_u16: (
|
|
231
|
+
a: number,
|
|
232
|
+
b: number
|
|
233
|
+
) => number;
|
|
234
|
+
readonly ffi_channel_rust_future_complete_i16: (
|
|
235
|
+
a: number,
|
|
236
|
+
b: number
|
|
237
|
+
) => number;
|
|
238
|
+
readonly ffi_channel_rust_future_complete_i32: (
|
|
239
|
+
a: number,
|
|
240
|
+
b: number
|
|
241
|
+
) => number;
|
|
242
|
+
readonly ffi_channel_rust_future_complete_i64: (
|
|
243
|
+
a: number,
|
|
244
|
+
b: number
|
|
245
|
+
) => number;
|
|
246
|
+
readonly ffi_channel_rust_future_poll_f32: (a: number, b: number) => void;
|
|
247
|
+
readonly ffi_channel_rust_future_cancel_f32: (a: number) => void;
|
|
248
|
+
readonly ffi_channel_rust_future_complete_f32: (
|
|
249
|
+
a: number,
|
|
250
|
+
b: number
|
|
251
|
+
) => number;
|
|
252
|
+
readonly ffi_channel_rust_future_free_f32: (a: number) => void;
|
|
253
|
+
readonly ffi_channel_rust_future_complete_f64: (
|
|
254
|
+
a: number,
|
|
255
|
+
b: number
|
|
256
|
+
) => number;
|
|
257
|
+
readonly ffi_channel_rust_future_complete_rust_buffer: (
|
|
258
|
+
a: number,
|
|
259
|
+
b: number,
|
|
260
|
+
c: number
|
|
261
|
+
) => void;
|
|
262
|
+
readonly ffi_channel_rust_future_complete_void: (
|
|
263
|
+
a: number,
|
|
264
|
+
b: number
|
|
265
|
+
) => void;
|
|
266
|
+
readonly uniffi_channel_fn_func_double_ratchet_decrypt: (
|
|
267
|
+
a: number,
|
|
268
|
+
b: number,
|
|
269
|
+
c: number,
|
|
270
|
+
d: number,
|
|
271
|
+
e: number
|
|
272
|
+
) => void;
|
|
273
|
+
readonly uniffi_channel_fn_func_double_ratchet_encrypt: (
|
|
274
|
+
a: number,
|
|
275
|
+
b: number,
|
|
276
|
+
c: number,
|
|
277
|
+
d: number,
|
|
278
|
+
e: number
|
|
279
|
+
) => void;
|
|
280
|
+
readonly uniffi_channel_fn_func_new_double_ratchet: (
|
|
281
|
+
a: number,
|
|
282
|
+
b: number,
|
|
283
|
+
c: number,
|
|
284
|
+
d: number,
|
|
285
|
+
e: number,
|
|
286
|
+
f: number,
|
|
287
|
+
g: number,
|
|
288
|
+
h: number,
|
|
289
|
+
i: number,
|
|
290
|
+
j: number,
|
|
291
|
+
k: number,
|
|
292
|
+
l: number,
|
|
293
|
+
m: number,
|
|
294
|
+
n: number,
|
|
295
|
+
o: number,
|
|
296
|
+
p: number,
|
|
297
|
+
q: number,
|
|
298
|
+
r: number
|
|
299
|
+
) => void;
|
|
300
|
+
readonly uniffi_channel_fn_func_new_triple_ratchet: (
|
|
301
|
+
a: number,
|
|
302
|
+
b: number,
|
|
303
|
+
c: number,
|
|
304
|
+
d: number,
|
|
305
|
+
e: number,
|
|
306
|
+
f: number,
|
|
307
|
+
g: number,
|
|
308
|
+
h: number,
|
|
309
|
+
i: number,
|
|
310
|
+
j: number,
|
|
311
|
+
k: number,
|
|
312
|
+
l: number,
|
|
313
|
+
m: number,
|
|
314
|
+
n: number,
|
|
315
|
+
o: number,
|
|
316
|
+
p: number
|
|
317
|
+
) => void;
|
|
318
|
+
readonly uniffi_channel_fn_func_triple_ratchet_decrypt: (
|
|
319
|
+
a: number,
|
|
320
|
+
b: number,
|
|
321
|
+
c: number,
|
|
322
|
+
d: number,
|
|
323
|
+
e: number
|
|
324
|
+
) => void;
|
|
325
|
+
readonly uniffi_channel_fn_func_triple_ratchet_encrypt: (
|
|
326
|
+
a: number,
|
|
327
|
+
b: number,
|
|
328
|
+
c: number,
|
|
329
|
+
d: number,
|
|
330
|
+
e: number
|
|
331
|
+
) => void;
|
|
332
|
+
readonly uniffi_channel_fn_func_triple_ratchet_init_round_1: (
|
|
333
|
+
a: number,
|
|
334
|
+
b: number,
|
|
335
|
+
c: number,
|
|
336
|
+
d: number,
|
|
337
|
+
e: number
|
|
338
|
+
) => void;
|
|
339
|
+
readonly uniffi_channel_fn_func_triple_ratchet_init_round_2: (
|
|
340
|
+
a: number,
|
|
341
|
+
b: number,
|
|
342
|
+
c: number,
|
|
343
|
+
d: number,
|
|
344
|
+
e: number
|
|
345
|
+
) => void;
|
|
346
|
+
readonly uniffi_channel_fn_func_triple_ratchet_init_round_3: (
|
|
347
|
+
a: number,
|
|
348
|
+
b: number,
|
|
349
|
+
c: number,
|
|
350
|
+
d: number,
|
|
351
|
+
e: number
|
|
352
|
+
) => void;
|
|
353
|
+
readonly uniffi_channel_fn_func_triple_ratchet_init_round_4: (
|
|
354
|
+
a: number,
|
|
355
|
+
b: number,
|
|
356
|
+
c: number,
|
|
357
|
+
d: number,
|
|
358
|
+
e: number
|
|
359
|
+
) => void;
|
|
360
|
+
readonly ffi_channel_rust_future_free_u8: (a: number) => void;
|
|
361
|
+
readonly ffi_channel_rust_future_free_u16: (a: number) => void;
|
|
362
|
+
readonly ffi_channel_rust_future_free_i8: (a: number) => void;
|
|
363
|
+
readonly ffi_channel_rust_future_free_u32: (a: number) => void;
|
|
364
|
+
readonly ffi_channel_rust_future_free_i32: (a: number) => void;
|
|
365
|
+
readonly ffi_channel_rust_future_free_u64: (a: number) => void;
|
|
366
|
+
readonly ffi_channel_rust_future_free_i64: (a: number) => void;
|
|
367
|
+
readonly ffi_channel_rust_future_free_i16: (a: number) => void;
|
|
368
|
+
readonly ffi_channel_rust_future_free_f64: (a: number) => void;
|
|
369
|
+
readonly ffi_channel_rust_future_free_pointer: (a: number) => void;
|
|
370
|
+
readonly ffi_channel_rust_future_free_rust_buffer: (a: number) => void;
|
|
371
|
+
readonly ffi_channel_rust_future_free_void: (a: number) => void;
|
|
372
|
+
readonly ffi_channel_rust_future_poll_u8: (a: number, b: number) => void;
|
|
373
|
+
readonly ffi_channel_rust_future_poll_u16: (a: number, b: number) => void;
|
|
374
|
+
readonly ffi_channel_rust_future_poll_i8: (a: number, b: number) => void;
|
|
375
|
+
readonly ffi_channel_rust_future_poll_u32: (a: number, b: number) => void;
|
|
376
|
+
readonly ffi_channel_rust_future_poll_i32: (a: number, b: number) => void;
|
|
377
|
+
readonly ffi_channel_rust_future_poll_u64: (a: number, b: number) => void;
|
|
378
|
+
readonly ffi_channel_rust_future_poll_i64: (a: number, b: number) => void;
|
|
379
|
+
readonly ffi_channel_rust_future_poll_i16: (a: number, b: number) => void;
|
|
380
|
+
readonly ffi_channel_rust_future_poll_f64: (a: number, b: number) => void;
|
|
381
|
+
readonly ffi_channel_rust_future_poll_pointer: (a: number, b: number) => void;
|
|
382
|
+
readonly ffi_channel_rust_future_poll_rust_buffer: (
|
|
383
|
+
a: number,
|
|
384
|
+
b: number
|
|
385
|
+
) => void;
|
|
386
|
+
readonly ffi_channel_rust_future_poll_void: (a: number, b: number) => void;
|
|
387
|
+
readonly ffi_channel_rust_future_complete_u32: (
|
|
388
|
+
a: number,
|
|
389
|
+
b: number
|
|
390
|
+
) => number;
|
|
391
|
+
readonly ffi_channel_rust_future_complete_u64: (
|
|
392
|
+
a: number,
|
|
393
|
+
b: number
|
|
394
|
+
) => number;
|
|
395
|
+
readonly ffi_channel_rust_future_complete_pointer: (
|
|
396
|
+
a: number,
|
|
397
|
+
b: number
|
|
398
|
+
) => number;
|
|
399
|
+
readonly ffi_channel_rust_future_cancel_u8: (a: number) => void;
|
|
400
|
+
readonly ffi_channel_rust_future_cancel_u16: (a: number) => void;
|
|
401
|
+
readonly ffi_channel_rust_future_cancel_i8: (a: number) => void;
|
|
402
|
+
readonly ffi_channel_rust_future_cancel_u32: (a: number) => void;
|
|
403
|
+
readonly ffi_channel_rust_future_cancel_i32: (a: number) => void;
|
|
404
|
+
readonly ffi_channel_rust_future_cancel_u64: (a: number) => void;
|
|
405
|
+
readonly ffi_channel_rust_future_cancel_i64: (a: number) => void;
|
|
406
|
+
readonly ffi_channel_rust_future_cancel_i16: (a: number) => void;
|
|
407
|
+
readonly ffi_channel_rust_future_cancel_f64: (a: number) => void;
|
|
408
|
+
readonly ffi_channel_rust_future_cancel_pointer: (a: number) => void;
|
|
409
|
+
readonly ffi_channel_rust_future_cancel_rust_buffer: (a: number) => void;
|
|
410
|
+
readonly ffi_channel_rust_future_cancel_void: (a: number) => void;
|
|
411
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
412
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
413
|
+
readonly __wbindgen_realloc: (
|
|
414
|
+
a: number,
|
|
415
|
+
b: number,
|
|
416
|
+
c: number,
|
|
417
|
+
d: number
|
|
418
|
+
) => number;
|
|
419
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
420
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
424
|
+
/**
|
|
425
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
426
|
+
* a precompiled `WebAssembly.Module`.
|
|
427
|
+
*
|
|
428
|
+
* @param {SyncInitInput} module
|
|
429
|
+
*
|
|
430
|
+
* @returns {InitOutput}
|
|
431
|
+
*/
|
|
432
|
+
declare function initSync(module: SyncInitInput): InitOutput;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
436
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
437
|
+
*
|
|
438
|
+
* @param {InitInput | Promise<InitInput>} module_or_path
|
|
439
|
+
*
|
|
440
|
+
* @returns {Promise<InitOutput>}
|
|
441
|
+
*/
|
|
442
|
+
declare function __wbg_init(
|
|
443
|
+
module_or_path?: InitInput | Promise<InitInput>
|
|
444
|
+
): Promise<InitOutput>;
|
|
445
|
+
|
|
446
|
+
type channelwasm_d_InitInput = InitInput;
|
|
447
|
+
type channelwasm_d_InitOutput = InitOutput;
|
|
448
|
+
type channelwasm_d_SyncInitInput = SyncInitInput;
|
|
449
|
+
declare const channelwasm_d_initSync: typeof initSync;
|
|
450
|
+
declare const channelwasm_d_js_decrypt_inbox_message: typeof js_decrypt_inbox_message;
|
|
451
|
+
declare const channelwasm_d_js_double_ratchet_decrypt: typeof js_double_ratchet_decrypt;
|
|
452
|
+
declare const channelwasm_d_js_double_ratchet_encrypt: typeof js_double_ratchet_encrypt;
|
|
453
|
+
declare const channelwasm_d_js_encrypt_inbox_message: typeof js_encrypt_inbox_message;
|
|
454
|
+
declare const channelwasm_d_js_generate_ed448: typeof js_generate_ed448;
|
|
455
|
+
declare const channelwasm_d_js_generate_x448: typeof js_generate_x448;
|
|
456
|
+
declare const channelwasm_d_js_get_pubkey_ed448: typeof js_get_pubkey_ed448;
|
|
457
|
+
declare const channelwasm_d_js_get_pubkey_x448: typeof js_get_pubkey_x448;
|
|
458
|
+
declare const channelwasm_d_js_new_double_ratchet: typeof js_new_double_ratchet;
|
|
459
|
+
declare const channelwasm_d_js_new_triple_ratchet: typeof js_new_triple_ratchet;
|
|
460
|
+
declare const channelwasm_d_js_receiver_x3dh: typeof js_receiver_x3dh;
|
|
461
|
+
declare const channelwasm_d_js_sender_x3dh: typeof js_sender_x3dh;
|
|
462
|
+
declare const channelwasm_d_js_sign_ed448: typeof js_sign_ed448;
|
|
463
|
+
declare const channelwasm_d_js_triple_ratchet_decrypt: typeof js_triple_ratchet_decrypt;
|
|
464
|
+
declare const channelwasm_d_js_triple_ratchet_encrypt: typeof js_triple_ratchet_encrypt;
|
|
465
|
+
declare const channelwasm_d_js_triple_ratchet_init_round_1: typeof js_triple_ratchet_init_round_1;
|
|
466
|
+
declare const channelwasm_d_js_triple_ratchet_init_round_2: typeof js_triple_ratchet_init_round_2;
|
|
467
|
+
declare const channelwasm_d_js_triple_ratchet_init_round_3: typeof js_triple_ratchet_init_round_3;
|
|
468
|
+
declare const channelwasm_d_js_triple_ratchet_init_round_4: typeof js_triple_ratchet_init_round_4;
|
|
469
|
+
declare const channelwasm_d_js_triple_ratchet_resize: typeof js_triple_ratchet_resize;
|
|
470
|
+
declare const channelwasm_d_js_verify_ed448: typeof js_verify_ed448;
|
|
471
|
+
declare const channelwasm_d_js_verify_point: typeof js_verify_point;
|
|
472
|
+
declare namespace channelwasm_d {
|
|
473
|
+
export { type channelwasm_d_InitInput as InitInput, type channelwasm_d_InitOutput as InitOutput, type channelwasm_d_SyncInitInput as SyncInitInput, __wbg_init as default, channelwasm_d_initSync as initSync, channelwasm_d_js_decrypt_inbox_message as js_decrypt_inbox_message, channelwasm_d_js_double_ratchet_decrypt as js_double_ratchet_decrypt, channelwasm_d_js_double_ratchet_encrypt as js_double_ratchet_encrypt, channelwasm_d_js_encrypt_inbox_message as js_encrypt_inbox_message, channelwasm_d_js_generate_ed448 as js_generate_ed448, channelwasm_d_js_generate_x448 as js_generate_x448, channelwasm_d_js_get_pubkey_ed448 as js_get_pubkey_ed448, channelwasm_d_js_get_pubkey_x448 as js_get_pubkey_x448, channelwasm_d_js_new_double_ratchet as js_new_double_ratchet, channelwasm_d_js_new_triple_ratchet as js_new_triple_ratchet, channelwasm_d_js_receiver_x3dh as js_receiver_x3dh, channelwasm_d_js_sender_x3dh as js_sender_x3dh, channelwasm_d_js_sign_ed448 as js_sign_ed448, channelwasm_d_js_triple_ratchet_decrypt as js_triple_ratchet_decrypt, channelwasm_d_js_triple_ratchet_encrypt as js_triple_ratchet_encrypt, channelwasm_d_js_triple_ratchet_init_round_1 as js_triple_ratchet_init_round_1, channelwasm_d_js_triple_ratchet_init_round_2 as js_triple_ratchet_init_round_2, channelwasm_d_js_triple_ratchet_init_round_3 as js_triple_ratchet_init_round_3, channelwasm_d_js_triple_ratchet_init_round_4 as js_triple_ratchet_init_round_4, channelwasm_d_js_triple_ratchet_resize as js_triple_ratchet_resize, channelwasm_d_js_verify_ed448 as js_verify_ed448, channelwasm_d_js_verify_point as js_verify_point };
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
type NewDoubleRatchetParameters = {
|
|
477
|
+
session_key: number[];
|
|
478
|
+
sending_header_key: number[];
|
|
479
|
+
next_receiving_header_key: number[];
|
|
480
|
+
is_sender: boolean;
|
|
481
|
+
sending_ephemeral_private_key: number[];
|
|
482
|
+
receiving_ephemeral_key?: number[];
|
|
483
|
+
};
|
|
484
|
+
type NewTripleRatchetParameters = {
|
|
485
|
+
peers: number[][];
|
|
486
|
+
peer_key: number[];
|
|
487
|
+
identity_key: number[];
|
|
488
|
+
signed_pre_key: number[];
|
|
489
|
+
threshold: number;
|
|
490
|
+
async_dkg_ratchet: boolean;
|
|
491
|
+
};
|
|
492
|
+
type EncryptionKeyPair = {
|
|
493
|
+
public_key: number[];
|
|
494
|
+
private_key: number[];
|
|
495
|
+
};
|
|
496
|
+
type SigningKeyPair = {
|
|
497
|
+
public_key: number[];
|
|
498
|
+
private_key: number[];
|
|
499
|
+
};
|
|
500
|
+
type SenderX3DH = {
|
|
501
|
+
sending_identity_private_key: number[];
|
|
502
|
+
sending_ephemeral_private_key: number[];
|
|
503
|
+
receiving_identity_key: number[];
|
|
504
|
+
receiving_signed_pre_key: number[];
|
|
505
|
+
session_key_length: number;
|
|
506
|
+
};
|
|
507
|
+
type ReceiverX3DH = {
|
|
508
|
+
sending_identity_private_key: number[];
|
|
509
|
+
sending_signed_private_key: number[];
|
|
510
|
+
receiving_identity_key: number[];
|
|
511
|
+
receiving_ephemeral_key: number[];
|
|
512
|
+
session_key_length: number;
|
|
513
|
+
};
|
|
514
|
+
type DoubleRatchetStateAndEnvelope = {
|
|
515
|
+
ratchet_state: string;
|
|
516
|
+
envelope: string;
|
|
517
|
+
};
|
|
518
|
+
type DoubleRatchetStateAndMessage = {
|
|
519
|
+
ratchet_state: string;
|
|
520
|
+
message: number[];
|
|
521
|
+
};
|
|
522
|
+
type TripleRatchetStateAndMetadata = {
|
|
523
|
+
ratchet_state: string;
|
|
524
|
+
metadata: {
|
|
525
|
+
[key: string]: string;
|
|
526
|
+
};
|
|
527
|
+
};
|
|
528
|
+
type TripleRatchetStateAndEnvelope = {
|
|
529
|
+
ratchet_state: string;
|
|
530
|
+
envelope: string;
|
|
531
|
+
};
|
|
532
|
+
type TripleRatchetStateAndMessage = {
|
|
533
|
+
ratchet_state: string;
|
|
534
|
+
message: number[];
|
|
535
|
+
};
|
|
536
|
+
type DoubleRatchetParticipant = {
|
|
537
|
+
sending_ephemeral_private_key: string;
|
|
538
|
+
receiving_ephemeral_key: string;
|
|
539
|
+
root_key: string;
|
|
540
|
+
sending_chain_key: string;
|
|
541
|
+
current_sending_header_key: string;
|
|
542
|
+
current_receiving_header_key: string;
|
|
543
|
+
next_sending_header_key: string;
|
|
544
|
+
next_receiving_header_key: string;
|
|
545
|
+
receiving_chain_key: string;
|
|
546
|
+
current_sending_chain_length: number;
|
|
547
|
+
previous_sending_chain_length: number;
|
|
548
|
+
current_receiving_chain_length: number;
|
|
549
|
+
previous_receiving_chain_length: number;
|
|
550
|
+
skipped_keys_map: {
|
|
551
|
+
[key: string]: {
|
|
552
|
+
[key: number]: string;
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
};
|
|
556
|
+
type MessageCiphertext = {
|
|
557
|
+
ciphertext: string;
|
|
558
|
+
initialization_vector: string;
|
|
559
|
+
associated_data?: string;
|
|
560
|
+
};
|
|
561
|
+
type SealedInboxMessageDecryptRequest = {
|
|
562
|
+
inbox_private_key: number[];
|
|
563
|
+
ephemeral_public_key: number[];
|
|
564
|
+
ciphertext: MessageCiphertext;
|
|
565
|
+
};
|
|
566
|
+
type SealedInboxMessageEncryptRequest = {
|
|
567
|
+
inbox_public_key: number[];
|
|
568
|
+
ephemeral_private_key: number[];
|
|
569
|
+
plaintext: number[];
|
|
570
|
+
};
|
|
571
|
+
type Ed448Keypair = {
|
|
572
|
+
type: 'ed448';
|
|
573
|
+
public_key: number[];
|
|
574
|
+
private_key: number[];
|
|
575
|
+
};
|
|
576
|
+
type X448Keypair = {
|
|
577
|
+
type: 'x448';
|
|
578
|
+
public_key: number[];
|
|
579
|
+
private_key: number[];
|
|
580
|
+
};
|
|
581
|
+
type Keypair = X448Keypair | Ed448Keypair;
|
|
582
|
+
type UserKeyset = {
|
|
583
|
+
user_key: Ed448Keypair;
|
|
584
|
+
peer_key: X448Keypair;
|
|
585
|
+
};
|
|
586
|
+
type DeviceKeyset = {
|
|
587
|
+
identity_key: X448Keypair;
|
|
588
|
+
pre_key: X448Keypair;
|
|
589
|
+
inbox_keyset: InboxKeyset;
|
|
590
|
+
};
|
|
591
|
+
type InboxKeyset = {
|
|
592
|
+
inbox_address: string;
|
|
593
|
+
inbox_key: Ed448Keypair;
|
|
594
|
+
inbox_encryption_key: X448Keypair;
|
|
595
|
+
};
|
|
596
|
+
type InboxRegistration = {
|
|
597
|
+
inbox_address: string;
|
|
598
|
+
inbox_encryption_public_key: string;
|
|
599
|
+
};
|
|
600
|
+
type DeviceRegistration = {
|
|
601
|
+
identity_public_key: string;
|
|
602
|
+
pre_public_key: string;
|
|
603
|
+
inbox_registration: InboxRegistration;
|
|
604
|
+
};
|
|
605
|
+
type UserRegistration = {
|
|
606
|
+
user_address: string;
|
|
607
|
+
user_public_key: string;
|
|
608
|
+
peer_public_key: string;
|
|
609
|
+
device_registrations: DeviceRegistration[];
|
|
610
|
+
signature: string;
|
|
611
|
+
};
|
|
612
|
+
type SpaceRegistration = {
|
|
613
|
+
space_address: string;
|
|
614
|
+
space_public_key: string;
|
|
615
|
+
owner_public_keys: string[];
|
|
616
|
+
config_public_key: string;
|
|
617
|
+
timestamp: number;
|
|
618
|
+
space_signature: string;
|
|
619
|
+
owner_signatures: string[];
|
|
620
|
+
};
|
|
621
|
+
type SpaceManifest = {
|
|
622
|
+
space_address: string;
|
|
623
|
+
space_manifest: string;
|
|
624
|
+
timestamp: number;
|
|
625
|
+
ephemeral_public_key: string;
|
|
626
|
+
owner_public_key: string;
|
|
627
|
+
owner_signature: string;
|
|
628
|
+
};
|
|
629
|
+
type SealedMessageWithNetworkTimestamp = {
|
|
630
|
+
inbox_address: string;
|
|
631
|
+
ephemeral_public_key: string;
|
|
632
|
+
envelope: string;
|
|
633
|
+
inbox_public_key: string;
|
|
634
|
+
inbox_signature: string;
|
|
635
|
+
timestamp: number;
|
|
636
|
+
};
|
|
637
|
+
type OwnerSealedMessage = {
|
|
638
|
+
inbox_address: string;
|
|
639
|
+
hub_address: string;
|
|
640
|
+
ephemeral_public_key: string;
|
|
641
|
+
envelope: string;
|
|
642
|
+
owner_public_key: string;
|
|
643
|
+
owner_signature: string;
|
|
644
|
+
};
|
|
645
|
+
type HubSealedMessage = {
|
|
646
|
+
hub_address: string;
|
|
647
|
+
ephemeral_public_key: string;
|
|
648
|
+
envelope: string;
|
|
649
|
+
hub_public_key: string;
|
|
650
|
+
hub_signature: string;
|
|
651
|
+
};
|
|
652
|
+
type HubControlMessage = {
|
|
653
|
+
hub_address: string;
|
|
654
|
+
inbox_public_key: string;
|
|
655
|
+
hub_public_key: string;
|
|
656
|
+
hub_signature: string;
|
|
657
|
+
inbox_signature: string;
|
|
658
|
+
};
|
|
659
|
+
type UserConfig = {
|
|
660
|
+
user_address: string;
|
|
661
|
+
user_public_key: string;
|
|
662
|
+
user_config: string;
|
|
663
|
+
timestamp: number;
|
|
664
|
+
signature: string;
|
|
665
|
+
};
|
|
666
|
+
type UserAttestation = {
|
|
667
|
+
user_address: string;
|
|
668
|
+
attestation: string;
|
|
669
|
+
attestation_valid_until: number;
|
|
670
|
+
attestation_public_key: string;
|
|
671
|
+
attestation_signature: string;
|
|
672
|
+
};
|
|
673
|
+
type SealedMessage = {
|
|
674
|
+
inbox_address: string;
|
|
675
|
+
ephemeral_public_key: string;
|
|
676
|
+
envelope: string;
|
|
677
|
+
inbox_public_key?: string;
|
|
678
|
+
inbox_signature?: string;
|
|
679
|
+
};
|
|
680
|
+
type DeleteMessages = {
|
|
681
|
+
inbox_address: string;
|
|
682
|
+
timestamps: number[];
|
|
683
|
+
inbox_public_key: string;
|
|
684
|
+
inbox_signature: string;
|
|
685
|
+
};
|
|
686
|
+
type SealedMessageAndMetadata = {
|
|
687
|
+
sealed_message: SealedMessage;
|
|
688
|
+
ratchet_state: string;
|
|
689
|
+
receiving_inbox: InboxKeyset;
|
|
690
|
+
sending_inbox: SendingInbox;
|
|
691
|
+
tag: string;
|
|
692
|
+
sent_accept?: boolean;
|
|
693
|
+
};
|
|
694
|
+
type SendingInbox = {
|
|
695
|
+
inbox_address: string;
|
|
696
|
+
inbox_encryption_key: string;
|
|
697
|
+
inbox_public_key: string;
|
|
698
|
+
inbox_private_key: string;
|
|
699
|
+
};
|
|
700
|
+
type SignedInboxEnvelopeAndMetadata = {
|
|
701
|
+
inbox_address: string;
|
|
702
|
+
inbox_public_key: string;
|
|
703
|
+
inbox_signature: string;
|
|
704
|
+
envelope: string;
|
|
705
|
+
ratchet_state: string;
|
|
706
|
+
};
|
|
707
|
+
type UserProfile = {
|
|
708
|
+
user_address: string;
|
|
709
|
+
display_name?: string;
|
|
710
|
+
user_icon?: string;
|
|
711
|
+
};
|
|
712
|
+
type InitializationEnvelope = UserProfile & {
|
|
713
|
+
return_inbox_address: string;
|
|
714
|
+
return_inbox_encryption_key: string;
|
|
715
|
+
return_inbox_public_key: string;
|
|
716
|
+
return_inbox_private_key: string;
|
|
717
|
+
identity_public_key: string;
|
|
718
|
+
tag: string;
|
|
719
|
+
message: string;
|
|
720
|
+
type: string;
|
|
721
|
+
};
|
|
722
|
+
type UnsealedEnvelope = InitializationEnvelope & {
|
|
723
|
+
ephemeral_public_key: string;
|
|
724
|
+
};
|
|
725
|
+
type InboxAndEncryptionState = {
|
|
726
|
+
inbox_address: string;
|
|
727
|
+
encryption_state: string;
|
|
728
|
+
};
|
|
729
|
+
declare const NewUserKeyset: (user_key: Ed448Keypair) => UserKeyset;
|
|
730
|
+
declare const NewDeviceKeyset: () => Promise<DeviceKeyset>;
|
|
731
|
+
declare const NewInboxKeyset: () => Promise<InboxKeyset>;
|
|
732
|
+
declare const ConstructUserRegistration: (userKeyset: UserKeyset, existing_device_keysets: DeviceRegistration[], device_keysets: DeviceKeyset[]) => Promise<UserRegistration>;
|
|
733
|
+
declare const NewDoubleRatchetSenderSession: (keyset: DeviceKeyset, sender_address: string, device: DeviceRegistration, initial_message: string, sender_name?: string, sender_photo?: string) => Promise<SealedMessageAndMetadata[]>;
|
|
734
|
+
declare const SealSyncEnvelope: (inbox_address: string, hub_address: string, hub_keyset: Ed448Keypair, owner_keyset: Ed448Keypair, message: string) => Promise<OwnerSealedMessage>;
|
|
735
|
+
declare const UnsealSyncEnvelope: (hub_keyset: Ed448Keypair, envelope: OwnerSealedMessage) => Promise<any>;
|
|
736
|
+
declare const UnsealInboxEnvelope: (privKey: number[], envelope: {
|
|
737
|
+
inbox_public_key: string;
|
|
738
|
+
ephemeral_public_key: string;
|
|
739
|
+
envelope: string;
|
|
740
|
+
}) => Promise<any>;
|
|
741
|
+
declare const SealInboxEnvelope: (pubKey: string, message: string) => Promise<{
|
|
742
|
+
inbox_public_key: string;
|
|
743
|
+
ephemeral_public_key: string;
|
|
744
|
+
envelope: string;
|
|
745
|
+
}>;
|
|
746
|
+
declare const SealHubEnvelope: (address: string, keyset: Ed448Keypair, message: string) => Promise<HubSealedMessage>;
|
|
747
|
+
declare const UnsealHubEnvelope: (keyset: Ed448Keypair, envelope: HubSealedMessage) => Promise<any>;
|
|
748
|
+
declare const UnsealInitializationEnvelope: (keyset: DeviceKeyset, initial_message: SealedMessage) => UnsealedEnvelope;
|
|
749
|
+
type NewDoubleRatchetRecipientSession = {
|
|
750
|
+
state: string;
|
|
751
|
+
message: string;
|
|
752
|
+
tag: string;
|
|
753
|
+
return_inbox_address: string;
|
|
754
|
+
return_inbox_encryption_key: string;
|
|
755
|
+
return_inbox_public_key: string;
|
|
756
|
+
return_inbox_private_key: string;
|
|
757
|
+
user_address: string;
|
|
758
|
+
identity_public_key: string;
|
|
759
|
+
};
|
|
760
|
+
declare const NewDoubleRatchetRecipientSession: (keyset: DeviceKeyset, initial_message: UnsealedEnvelope) => Promise<NewDoubleRatchetRecipientSession>;
|
|
761
|
+
type DoubleRatchetStateAndInboxKeys = {
|
|
762
|
+
ratchet_state: string;
|
|
763
|
+
receiving_inbox: InboxKeyset;
|
|
764
|
+
sending_inbox: SendingInbox;
|
|
765
|
+
tag: string;
|
|
766
|
+
sent_accept?: boolean;
|
|
767
|
+
};
|
|
768
|
+
declare const DoubleRatchetInboxEncryptForceSenderInit: (device_keyset: DeviceKeyset, encryption_states: DoubleRatchetStateAndInboxKeys[], message: string, acceptee: UserRegistration, sender_name?: string, sender_photo?: string) => SealedMessageAndMetadata[];
|
|
769
|
+
declare const DoubleRatchetInboxEncrypt: (device_keyset: DeviceKeyset, encryption_states: DoubleRatchetStateAndInboxKeys[], message: string, acceptee: UserRegistration, sender_name?: string, sender_photo?: string) => SealedMessageAndMetadata[];
|
|
770
|
+
declare const ConfirmDoubleRatchetSenderSession: (encryption_state: DoubleRatchetStateAndInboxKeys, message: SealedMessage) => {
|
|
771
|
+
receiving_inbox: InboxKeyset;
|
|
772
|
+
user_profile: UserProfile;
|
|
773
|
+
tag: string;
|
|
774
|
+
sending_inbox: SendingInbox;
|
|
775
|
+
ratchet_state: string;
|
|
776
|
+
message: string;
|
|
777
|
+
};
|
|
778
|
+
declare const DoubleRatchetInboxDecrypt: (encryption_state: DoubleRatchetStateAndInboxKeys, message: SealedMessage) => {
|
|
779
|
+
ratchet_state: string;
|
|
780
|
+
message: string;
|
|
781
|
+
} | {
|
|
782
|
+
receiving_inbox: InboxKeyset;
|
|
783
|
+
user_profile: UserProfile;
|
|
784
|
+
tag: any;
|
|
785
|
+
sending_inbox: SendingInbox;
|
|
786
|
+
ratchet_state: string;
|
|
787
|
+
message: string;
|
|
788
|
+
};
|
|
789
|
+
type PeerMessageSet = {
|
|
790
|
+
[peer: string]: string;
|
|
791
|
+
};
|
|
792
|
+
type TripleRatchetInitializationBundle = {
|
|
793
|
+
ratchet_state: string;
|
|
794
|
+
metadata: PeerMessageSet;
|
|
795
|
+
};
|
|
796
|
+
declare const EstablishTripleRatchetSessionForSpace: (user_keyset: UserKeyset, device_keyset: DeviceKeyset, registration: UserRegistration, total?: number) => Promise<{
|
|
797
|
+
state: string;
|
|
798
|
+
template: any;
|
|
799
|
+
evals: number[][];
|
|
800
|
+
}>;
|
|
801
|
+
declare const TripleRatchetInitRound1: typeof js_triple_ratchet_init_round_1;
|
|
802
|
+
declare const TripleRatchetInitRound2: typeof js_triple_ratchet_init_round_2;
|
|
803
|
+
declare const TripleRatchetInitRound3: typeof js_triple_ratchet_init_round_3;
|
|
804
|
+
declare const TripleRatchetInitRound4: typeof js_triple_ratchet_init_round_4;
|
|
805
|
+
declare const TripleRatchetEncrypt: typeof js_triple_ratchet_encrypt;
|
|
806
|
+
declare const TripleRatchetDecrypt: typeof js_triple_ratchet_decrypt;
|
|
807
|
+
|
|
808
|
+
declare const channel_ConfirmDoubleRatchetSenderSession: typeof ConfirmDoubleRatchetSenderSession;
|
|
809
|
+
declare const channel_ConstructUserRegistration: typeof ConstructUserRegistration;
|
|
810
|
+
type channel_DeleteMessages = DeleteMessages;
|
|
811
|
+
type channel_DeviceKeyset = DeviceKeyset;
|
|
812
|
+
type channel_DeviceRegistration = DeviceRegistration;
|
|
813
|
+
declare const channel_DoubleRatchetInboxDecrypt: typeof DoubleRatchetInboxDecrypt;
|
|
814
|
+
declare const channel_DoubleRatchetInboxEncrypt: typeof DoubleRatchetInboxEncrypt;
|
|
815
|
+
declare const channel_DoubleRatchetInboxEncryptForceSenderInit: typeof DoubleRatchetInboxEncryptForceSenderInit;
|
|
816
|
+
type channel_DoubleRatchetParticipant = DoubleRatchetParticipant;
|
|
817
|
+
type channel_DoubleRatchetStateAndEnvelope = DoubleRatchetStateAndEnvelope;
|
|
818
|
+
type channel_DoubleRatchetStateAndInboxKeys = DoubleRatchetStateAndInboxKeys;
|
|
819
|
+
type channel_DoubleRatchetStateAndMessage = DoubleRatchetStateAndMessage;
|
|
820
|
+
type channel_Ed448Keypair = Ed448Keypair;
|
|
821
|
+
type channel_EncryptionKeyPair = EncryptionKeyPair;
|
|
822
|
+
declare const channel_EstablishTripleRatchetSessionForSpace: typeof EstablishTripleRatchetSessionForSpace;
|
|
823
|
+
type channel_HubControlMessage = HubControlMessage;
|
|
824
|
+
type channel_HubSealedMessage = HubSealedMessage;
|
|
825
|
+
type channel_InboxAndEncryptionState = InboxAndEncryptionState;
|
|
826
|
+
type channel_InboxKeyset = InboxKeyset;
|
|
827
|
+
type channel_InboxRegistration = InboxRegistration;
|
|
828
|
+
type channel_InitializationEnvelope = InitializationEnvelope;
|
|
829
|
+
type channel_Keypair = Keypair;
|
|
830
|
+
type channel_MessageCiphertext = MessageCiphertext;
|
|
831
|
+
declare const channel_NewDeviceKeyset: typeof NewDeviceKeyset;
|
|
832
|
+
type channel_NewDoubleRatchetParameters = NewDoubleRatchetParameters;
|
|
833
|
+
declare const channel_NewDoubleRatchetRecipientSession: typeof NewDoubleRatchetRecipientSession;
|
|
834
|
+
declare const channel_NewDoubleRatchetSenderSession: typeof NewDoubleRatchetSenderSession;
|
|
835
|
+
declare const channel_NewInboxKeyset: typeof NewInboxKeyset;
|
|
836
|
+
type channel_NewTripleRatchetParameters = NewTripleRatchetParameters;
|
|
837
|
+
declare const channel_NewUserKeyset: typeof NewUserKeyset;
|
|
838
|
+
type channel_OwnerSealedMessage = OwnerSealedMessage;
|
|
839
|
+
type channel_PeerMessageSet = PeerMessageSet;
|
|
840
|
+
type channel_ReceiverX3DH = ReceiverX3DH;
|
|
841
|
+
declare const channel_SealHubEnvelope: typeof SealHubEnvelope;
|
|
842
|
+
declare const channel_SealInboxEnvelope: typeof SealInboxEnvelope;
|
|
843
|
+
declare const channel_SealSyncEnvelope: typeof SealSyncEnvelope;
|
|
844
|
+
type channel_SealedInboxMessageDecryptRequest = SealedInboxMessageDecryptRequest;
|
|
845
|
+
type channel_SealedInboxMessageEncryptRequest = SealedInboxMessageEncryptRequest;
|
|
846
|
+
type channel_SealedMessage = SealedMessage;
|
|
847
|
+
type channel_SealedMessageAndMetadata = SealedMessageAndMetadata;
|
|
848
|
+
type channel_SealedMessageWithNetworkTimestamp = SealedMessageWithNetworkTimestamp;
|
|
849
|
+
type channel_SenderX3DH = SenderX3DH;
|
|
850
|
+
type channel_SendingInbox = SendingInbox;
|
|
851
|
+
type channel_SignedInboxEnvelopeAndMetadata = SignedInboxEnvelopeAndMetadata;
|
|
852
|
+
type channel_SigningKeyPair = SigningKeyPair;
|
|
853
|
+
type channel_SpaceManifest = SpaceManifest;
|
|
854
|
+
type channel_SpaceRegistration = SpaceRegistration;
|
|
855
|
+
declare const channel_TripleRatchetDecrypt: typeof TripleRatchetDecrypt;
|
|
856
|
+
declare const channel_TripleRatchetEncrypt: typeof TripleRatchetEncrypt;
|
|
857
|
+
declare const channel_TripleRatchetInitRound1: typeof TripleRatchetInitRound1;
|
|
858
|
+
declare const channel_TripleRatchetInitRound2: typeof TripleRatchetInitRound2;
|
|
859
|
+
declare const channel_TripleRatchetInitRound3: typeof TripleRatchetInitRound3;
|
|
860
|
+
declare const channel_TripleRatchetInitRound4: typeof TripleRatchetInitRound4;
|
|
861
|
+
type channel_TripleRatchetInitializationBundle = TripleRatchetInitializationBundle;
|
|
862
|
+
type channel_TripleRatchetStateAndEnvelope = TripleRatchetStateAndEnvelope;
|
|
863
|
+
type channel_TripleRatchetStateAndMessage = TripleRatchetStateAndMessage;
|
|
864
|
+
type channel_TripleRatchetStateAndMetadata = TripleRatchetStateAndMetadata;
|
|
865
|
+
declare const channel_UnsealHubEnvelope: typeof UnsealHubEnvelope;
|
|
866
|
+
declare const channel_UnsealInboxEnvelope: typeof UnsealInboxEnvelope;
|
|
867
|
+
declare const channel_UnsealInitializationEnvelope: typeof UnsealInitializationEnvelope;
|
|
868
|
+
declare const channel_UnsealSyncEnvelope: typeof UnsealSyncEnvelope;
|
|
869
|
+
type channel_UnsealedEnvelope = UnsealedEnvelope;
|
|
870
|
+
type channel_UserAttestation = UserAttestation;
|
|
871
|
+
type channel_UserConfig = UserConfig;
|
|
872
|
+
type channel_UserKeyset = UserKeyset;
|
|
873
|
+
type channel_UserProfile = UserProfile;
|
|
874
|
+
type channel_UserRegistration = UserRegistration;
|
|
875
|
+
type channel_X448Keypair = X448Keypair;
|
|
876
|
+
declare namespace channel {
|
|
877
|
+
export { channel_ConfirmDoubleRatchetSenderSession as ConfirmDoubleRatchetSenderSession, channel_ConstructUserRegistration as ConstructUserRegistration, type channel_DeleteMessages as DeleteMessages, type channel_DeviceKeyset as DeviceKeyset, type channel_DeviceRegistration as DeviceRegistration, channel_DoubleRatchetInboxDecrypt as DoubleRatchetInboxDecrypt, channel_DoubleRatchetInboxEncrypt as DoubleRatchetInboxEncrypt, channel_DoubleRatchetInboxEncryptForceSenderInit as DoubleRatchetInboxEncryptForceSenderInit, type channel_DoubleRatchetParticipant as DoubleRatchetParticipant, type channel_DoubleRatchetStateAndEnvelope as DoubleRatchetStateAndEnvelope, type channel_DoubleRatchetStateAndInboxKeys as DoubleRatchetStateAndInboxKeys, type channel_DoubleRatchetStateAndMessage as DoubleRatchetStateAndMessage, type channel_Ed448Keypair as Ed448Keypair, type channel_EncryptionKeyPair as EncryptionKeyPair, channel_EstablishTripleRatchetSessionForSpace as EstablishTripleRatchetSessionForSpace, type channel_HubControlMessage as HubControlMessage, type channel_HubSealedMessage as HubSealedMessage, type channel_InboxAndEncryptionState as InboxAndEncryptionState, type channel_InboxKeyset as InboxKeyset, type channel_InboxRegistration as InboxRegistration, type channel_InitializationEnvelope as InitializationEnvelope, type channel_Keypair as Keypair, type channel_MessageCiphertext as MessageCiphertext, channel_NewDeviceKeyset as NewDeviceKeyset, type channel_NewDoubleRatchetParameters as NewDoubleRatchetParameters, channel_NewDoubleRatchetRecipientSession as NewDoubleRatchetRecipientSession, channel_NewDoubleRatchetSenderSession as NewDoubleRatchetSenderSession, channel_NewInboxKeyset as NewInboxKeyset, type channel_NewTripleRatchetParameters as NewTripleRatchetParameters, channel_NewUserKeyset as NewUserKeyset, type channel_OwnerSealedMessage as OwnerSealedMessage, type channel_PeerMessageSet as PeerMessageSet, type channel_ReceiverX3DH as ReceiverX3DH, channel_SealHubEnvelope as SealHubEnvelope, channel_SealInboxEnvelope as SealInboxEnvelope, channel_SealSyncEnvelope as SealSyncEnvelope, type channel_SealedInboxMessageDecryptRequest as SealedInboxMessageDecryptRequest, type channel_SealedInboxMessageEncryptRequest as SealedInboxMessageEncryptRequest, type channel_SealedMessage as SealedMessage, type channel_SealedMessageAndMetadata as SealedMessageAndMetadata, type channel_SealedMessageWithNetworkTimestamp as SealedMessageWithNetworkTimestamp, type channel_SenderX3DH as SenderX3DH, type channel_SendingInbox as SendingInbox, type channel_SignedInboxEnvelopeAndMetadata as SignedInboxEnvelopeAndMetadata, type channel_SigningKeyPair as SigningKeyPair, type channel_SpaceManifest as SpaceManifest, type channel_SpaceRegistration as SpaceRegistration, channel_TripleRatchetDecrypt as TripleRatchetDecrypt, channel_TripleRatchetEncrypt as TripleRatchetEncrypt, channel_TripleRatchetInitRound1 as TripleRatchetInitRound1, channel_TripleRatchetInitRound2 as TripleRatchetInitRound2, channel_TripleRatchetInitRound3 as TripleRatchetInitRound3, channel_TripleRatchetInitRound4 as TripleRatchetInitRound4, type channel_TripleRatchetInitializationBundle as TripleRatchetInitializationBundle, type channel_TripleRatchetStateAndEnvelope as TripleRatchetStateAndEnvelope, type channel_TripleRatchetStateAndMessage as TripleRatchetStateAndMessage, type channel_TripleRatchetStateAndMetadata as TripleRatchetStateAndMetadata, channel_UnsealHubEnvelope as UnsealHubEnvelope, channel_UnsealInboxEnvelope as UnsealInboxEnvelope, channel_UnsealInitializationEnvelope as UnsealInitializationEnvelope, channel_UnsealSyncEnvelope as UnsealSyncEnvelope, type channel_UnsealedEnvelope as UnsealedEnvelope, type channel_UserAttestation as UserAttestation, type channel_UserConfig as UserConfig, type channel_UserKeyset as UserKeyset, type channel_UserProfile as UserProfile, type channel_UserRegistration as UserRegistration, type channel_X448Keypair as X448Keypair };
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
declare const getStoredPasskeys: () => Promise<StoredPasskey[]>;
|
|
881
|
+
declare function encrypt(data: any, keys: any): Promise<{
|
|
882
|
+
iv: Uint8Array<ArrayBuffer>;
|
|
883
|
+
ciphertext: ArrayBuffer;
|
|
884
|
+
}>;
|
|
885
|
+
declare function decrypt(data: any, iv: any, keys: any): Promise<Uint8Array<ArrayBuffer>>;
|
|
886
|
+
declare function createKeyFromBuffer(buffer: ArrayBuffer): Promise<CryptoKey>;
|
|
887
|
+
declare function encryptDataSaveKey(id: number, data: Buffer): Promise<void>;
|
|
888
|
+
declare function loadKeyDecryptData(id: number): Promise<Uint8Array<ArrayBuffer>>;
|
|
889
|
+
declare const updateStoredPasskey: (credentialId: string, storedPasskey: StoredPasskey) => Promise<boolean>;
|
|
890
|
+
declare const register: (fqAppPrefix: string, account: string) => Promise<{
|
|
891
|
+
id: string;
|
|
892
|
+
rawId: string;
|
|
893
|
+
}>;
|
|
894
|
+
declare const completeRegistration: (fqAppPrefix: string, request: PasskeyAuthenticationRequestLargeBlob) => Promise<{
|
|
895
|
+
id: string;
|
|
896
|
+
rawId: string;
|
|
897
|
+
response: {
|
|
898
|
+
authenticatorData: string;
|
|
899
|
+
clientDataJSON: string;
|
|
900
|
+
signature: string;
|
|
901
|
+
userHandle: string;
|
|
902
|
+
};
|
|
903
|
+
}>;
|
|
904
|
+
declare const authenticate: (fqAppPrefix: string, request: PasskeyAuthenticationRequest) => Promise<{
|
|
905
|
+
id: string;
|
|
906
|
+
rawId: string;
|
|
907
|
+
response: {
|
|
908
|
+
authenticatorData: string;
|
|
909
|
+
clientDataJSON: string;
|
|
910
|
+
signature: string;
|
|
911
|
+
userHandle: string;
|
|
912
|
+
};
|
|
913
|
+
largeBlob: string;
|
|
914
|
+
}>;
|
|
915
|
+
declare const isPasskeysSupported: () => Promise<"PRF" | "LargeBlob" | null>;
|
|
916
|
+
interface PasskeyRegistrationResult {
|
|
917
|
+
id: string;
|
|
918
|
+
}
|
|
919
|
+
interface PasskeyAuthenticationRequestLargeBlob {
|
|
920
|
+
credentialId: string;
|
|
921
|
+
address: string;
|
|
922
|
+
publicKey: string;
|
|
923
|
+
largeBlob: string;
|
|
924
|
+
displayName?: string;
|
|
925
|
+
}
|
|
926
|
+
interface PasskeyAuthenticationRequest {
|
|
927
|
+
credentialId: string;
|
|
928
|
+
}
|
|
929
|
+
interface PasskeyAuthenticationResult {
|
|
930
|
+
id: string;
|
|
931
|
+
rawId: string;
|
|
932
|
+
type?: string;
|
|
933
|
+
response: {
|
|
934
|
+
authenticatorData: string;
|
|
935
|
+
clientDataJSON: string;
|
|
936
|
+
signature: string;
|
|
937
|
+
userHandle: string;
|
|
938
|
+
};
|
|
939
|
+
largeBlob?: string;
|
|
940
|
+
}
|
|
941
|
+
interface StoredPasskey {
|
|
942
|
+
credentialId: string;
|
|
943
|
+
address: string;
|
|
944
|
+
publicKey: string;
|
|
945
|
+
displayName?: string;
|
|
946
|
+
pfpUrl?: string;
|
|
947
|
+
completedOnboarding: boolean;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
type types_PasskeyAuthenticationRequest = PasskeyAuthenticationRequest;
|
|
951
|
+
type types_PasskeyAuthenticationRequestLargeBlob = PasskeyAuthenticationRequestLargeBlob;
|
|
952
|
+
type types_PasskeyAuthenticationResult = PasskeyAuthenticationResult;
|
|
953
|
+
type types_PasskeyRegistrationResult = PasskeyRegistrationResult;
|
|
954
|
+
type types_StoredPasskey = StoredPasskey;
|
|
955
|
+
declare const types_authenticate: typeof authenticate;
|
|
956
|
+
declare const types_completeRegistration: typeof completeRegistration;
|
|
957
|
+
declare const types_createKeyFromBuffer: typeof createKeyFromBuffer;
|
|
958
|
+
declare const types_decrypt: typeof decrypt;
|
|
959
|
+
declare const types_encrypt: typeof encrypt;
|
|
960
|
+
declare const types_encryptDataSaveKey: typeof encryptDataSaveKey;
|
|
961
|
+
declare const types_getStoredPasskeys: typeof getStoredPasskeys;
|
|
962
|
+
declare const types_isPasskeysSupported: typeof isPasskeysSupported;
|
|
963
|
+
declare const types_loadKeyDecryptData: typeof loadKeyDecryptData;
|
|
964
|
+
declare const types_register: typeof register;
|
|
965
|
+
declare const types_updateStoredPasskey: typeof updateStoredPasskey;
|
|
966
|
+
declare namespace types {
|
|
967
|
+
export { type types_PasskeyAuthenticationRequest as PasskeyAuthenticationRequest, type types_PasskeyAuthenticationRequestLargeBlob as PasskeyAuthenticationRequestLargeBlob, type types_PasskeyAuthenticationResult as PasskeyAuthenticationResult, type types_PasskeyRegistrationResult as PasskeyRegistrationResult, type types_StoredPasskey as StoredPasskey, types_authenticate as authenticate, types_completeRegistration as completeRegistration, types_createKeyFromBuffer as createKeyFromBuffer, types_decrypt as decrypt, types_encrypt as encrypt, types_encryptDataSaveKey as encryptDataSaveKey, types_getStoredPasskeys as getStoredPasskeys, types_isPasskeysSupported as isPasskeysSupported, types_loadKeyDecryptData as loadKeyDecryptData, types_register as register, types_updateStoredPasskey as updateStoredPasskey };
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
type PasskeysContextValue = {
|
|
971
|
+
currentPasskeyInfo: {
|
|
972
|
+
credentialId: string;
|
|
973
|
+
address: string;
|
|
974
|
+
publicKey: string;
|
|
975
|
+
displayName?: string;
|
|
976
|
+
pfpUrl?: string;
|
|
977
|
+
completedOnboarding: boolean;
|
|
978
|
+
} | undefined;
|
|
979
|
+
showPasskeyPrompt: {
|
|
980
|
+
value: boolean;
|
|
981
|
+
importMode?: boolean;
|
|
982
|
+
};
|
|
983
|
+
setShowPasskeyPrompt: (state: {
|
|
984
|
+
value: boolean;
|
|
985
|
+
importMode?: boolean;
|
|
986
|
+
}) => void;
|
|
987
|
+
passkeyRegistrationComplete?: boolean;
|
|
988
|
+
setPasskeyRegistrationComplete: (value: boolean | undefined) => void;
|
|
989
|
+
passkeyRegistrationError?: string;
|
|
990
|
+
setPasskeyRegistrationError: (value: string | undefined) => void;
|
|
991
|
+
signWithPasskey: (credentialId: string, payload: string) => Promise<string>;
|
|
992
|
+
exportKey: (credentialId: string) => Promise<string>;
|
|
993
|
+
updateStoredPasskey: (credentialId: string, storedPasskey: StoredPasskey) => void;
|
|
994
|
+
};
|
|
995
|
+
type PasskeysContextProps = {
|
|
996
|
+
fqAppPrefix: string;
|
|
997
|
+
children: ReactNode;
|
|
998
|
+
};
|
|
999
|
+
declare const PasskeysProvider: FC<PasskeysContextProps>;
|
|
1000
|
+
declare const usePasskeysContext: () => PasskeysContextValue;
|
|
1001
|
+
|
|
1002
|
+
declare const PasskeyModal: ({ fqAppPrefix, getUserRegistration, uploadRegistration, }: {
|
|
1003
|
+
fqAppPrefix: string;
|
|
1004
|
+
getUserRegistration: (address: string) => Promise<UserRegistration>;
|
|
1005
|
+
uploadRegistration: ({ address, registration, }: {
|
|
1006
|
+
address: string;
|
|
1007
|
+
registration: UserRegistration;
|
|
1008
|
+
}) => Promise<void>;
|
|
1009
|
+
}) => React.JSX.Element;
|
|
1010
|
+
|
|
1011
|
+
export { PasskeyModal, PasskeysProvider, channel, channelwasm_d as channel_raw, types as passkey, usePasskeysContext };
|