@xmtp/wasm-bindings 1.7.0-rc1 → 1.7.0-rc2
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/dist/bindings_wasm.d.ts +292 -237
- package/dist/bindings_wasm.js +311 -243
- package/dist/bindings_wasm_bg.wasm +0 -0
- package/dist/bindings_wasm_bg.wasm.d.ts +71 -66
- package/package.json +1 -1
package/dist/bindings_wasm.js
CHANGED
|
@@ -225,12 +225,6 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
225
225
|
return real;
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
function takeFromExternrefTable0(idx) {
|
|
229
|
-
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
230
|
-
wasm.__externref_table_dealloc(idx);
|
|
231
|
-
return value;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
228
|
function passArrayJsValueToWasm0(array, malloc) {
|
|
235
229
|
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
236
230
|
for (let i = 0; i < array.length; i++) {
|
|
@@ -240,6 +234,71 @@ function passArrayJsValueToWasm0(array, malloc) {
|
|
|
240
234
|
WASM_VECTOR_LEN = array.length;
|
|
241
235
|
return ptr;
|
|
242
236
|
}
|
|
237
|
+
|
|
238
|
+
function takeFromExternrefTable0(idx) {
|
|
239
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
240
|
+
wasm.__externref_table_dealloc(idx);
|
|
241
|
+
return value;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* @param {string} host
|
|
245
|
+
* @param {string | null | undefined} gatewayHost
|
|
246
|
+
* @param {Identifier} recoveryIdentifier
|
|
247
|
+
* @param {string} inboxId
|
|
248
|
+
* @param {Uint8Array[]} installationIds
|
|
249
|
+
* @returns {SignatureRequestHandle}
|
|
250
|
+
*/
|
|
251
|
+
export function revokeInstallationsSignatureRequest(host, gatewayHost, recoveryIdentifier, inboxId, installationIds) {
|
|
252
|
+
const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
253
|
+
const len0 = WASM_VECTOR_LEN;
|
|
254
|
+
var ptr1 = isLikeNone(gatewayHost) ? 0 : passStringToWasm0(gatewayHost, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
255
|
+
var len1 = WASM_VECTOR_LEN;
|
|
256
|
+
const ptr2 = passStringToWasm0(inboxId, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
257
|
+
const len2 = WASM_VECTOR_LEN;
|
|
258
|
+
const ptr3 = passArrayJsValueToWasm0(installationIds, wasm.__wbindgen_malloc);
|
|
259
|
+
const len3 = WASM_VECTOR_LEN;
|
|
260
|
+
const ret = wasm.revokeInstallationsSignatureRequest(ptr0, len0, ptr1, len1, recoveryIdentifier, ptr2, len2, ptr3, len3);
|
|
261
|
+
if (ret[2]) {
|
|
262
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
263
|
+
}
|
|
264
|
+
return SignatureRequestHandle.__wrap(ret[0]);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* @param {string} signatureText
|
|
269
|
+
* @param {Uint8Array} signatureBytes
|
|
270
|
+
* @param {Uint8Array} publicKey
|
|
271
|
+
*/
|
|
272
|
+
export function verifySignedWithPublicKey(signatureText, signatureBytes, publicKey) {
|
|
273
|
+
const ptr0 = passStringToWasm0(signatureText, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
274
|
+
const len0 = WASM_VECTOR_LEN;
|
|
275
|
+
const ret = wasm.verifySignedWithPublicKey(ptr0, len0, signatureBytes, publicKey);
|
|
276
|
+
if (ret[1]) {
|
|
277
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
function _assertClass(instance, klass) {
|
|
282
|
+
if (!(instance instanceof klass)) {
|
|
283
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* @param {string} host
|
|
288
|
+
* @param {string | null | undefined} gatewayHost
|
|
289
|
+
* @param {SignatureRequestHandle} signatureRequest
|
|
290
|
+
* @returns {Promise<void>}
|
|
291
|
+
*/
|
|
292
|
+
export function applySignatureRequest(host, gatewayHost, signatureRequest) {
|
|
293
|
+
const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
294
|
+
const len0 = WASM_VECTOR_LEN;
|
|
295
|
+
var ptr1 = isLikeNone(gatewayHost) ? 0 : passStringToWasm0(gatewayHost, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
296
|
+
var len1 = WASM_VECTOR_LEN;
|
|
297
|
+
_assertClass(signatureRequest, SignatureRequestHandle);
|
|
298
|
+
const ret = wasm.applySignatureRequest(ptr0, len0, ptr1, len1, signatureRequest.__wbg_ptr);
|
|
299
|
+
return ret;
|
|
300
|
+
}
|
|
301
|
+
|
|
243
302
|
/**
|
|
244
303
|
* @param {Attachment} attachment
|
|
245
304
|
* @returns {EncodedContent}
|
|
@@ -309,18 +368,45 @@ export function encodeRemoteAttachment(remote_attachment) {
|
|
|
309
368
|
}
|
|
310
369
|
|
|
311
370
|
/**
|
|
312
|
-
*
|
|
371
|
+
* Encrypts an attachment for storage as a remote attachment.
|
|
372
|
+
* @param {Attachment} attachment
|
|
373
|
+
* @returns {EncryptedAttachment}
|
|
313
374
|
*/
|
|
314
|
-
export function
|
|
315
|
-
const ret = wasm.
|
|
316
|
-
|
|
375
|
+
export function encryptAttachment(attachment) {
|
|
376
|
+
const ret = wasm.encryptAttachment(attachment);
|
|
377
|
+
if (ret[2]) {
|
|
378
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
379
|
+
}
|
|
380
|
+
return takeFromExternrefTable0(ret[0]);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
384
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
385
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
386
|
+
WASM_VECTOR_LEN = arg.length;
|
|
387
|
+
return ptr;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Decrypts an encrypted payload from a remote attachment.
|
|
391
|
+
* @param {Uint8Array} encryptedBytes
|
|
392
|
+
* @param {RemoteAttachment} remoteAttachment
|
|
393
|
+
* @returns {Attachment}
|
|
394
|
+
*/
|
|
395
|
+
export function decryptAttachment(encryptedBytes, remoteAttachment) {
|
|
396
|
+
const ptr0 = passArray8ToWasm0(encryptedBytes, wasm.__wbindgen_malloc);
|
|
397
|
+
const len0 = WASM_VECTOR_LEN;
|
|
398
|
+
const ret = wasm.decryptAttachment(ptr0, len0, remoteAttachment);
|
|
399
|
+
if (ret[2]) {
|
|
400
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
401
|
+
}
|
|
402
|
+
return takeFromExternrefTable0(ret[0]);
|
|
317
403
|
}
|
|
318
404
|
|
|
319
405
|
/**
|
|
320
406
|
* @returns {ContentTypeId}
|
|
321
407
|
*/
|
|
322
|
-
export function
|
|
323
|
-
const ret = wasm.
|
|
408
|
+
export function remoteAttachmentContentType() {
|
|
409
|
+
const ret = wasm.remoteAttachmentContentType();
|
|
324
410
|
return ret;
|
|
325
411
|
}
|
|
326
412
|
|
|
@@ -337,15 +423,11 @@ export function encodeWalletSendCalls(wallet_send_calls) {
|
|
|
337
423
|
}
|
|
338
424
|
|
|
339
425
|
/**
|
|
340
|
-
* @
|
|
341
|
-
* @returns {EncodedContent}
|
|
426
|
+
* @returns {ContentTypeId}
|
|
342
427
|
*/
|
|
343
|
-
export function
|
|
344
|
-
const ret = wasm.
|
|
345
|
-
|
|
346
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
347
|
-
}
|
|
348
|
-
return takeFromExternrefTable0(ret[0]);
|
|
428
|
+
export function walletSendCallsContentType() {
|
|
429
|
+
const ret = wasm.walletSendCallsContentType();
|
|
430
|
+
return ret;
|
|
349
431
|
}
|
|
350
432
|
|
|
351
433
|
/**
|
|
@@ -357,11 +439,15 @@ export function transactionReferenceContentType() {
|
|
|
357
439
|
}
|
|
358
440
|
|
|
359
441
|
/**
|
|
360
|
-
* @
|
|
442
|
+
* @param {TransactionReference} transaction_reference
|
|
443
|
+
* @returns {EncodedContent}
|
|
361
444
|
*/
|
|
362
|
-
export function
|
|
363
|
-
const ret = wasm.
|
|
364
|
-
|
|
445
|
+
export function encodeTransactionReference(transaction_reference) {
|
|
446
|
+
const ret = wasm.encodeTransactionReference(transaction_reference);
|
|
447
|
+
if (ret[2]) {
|
|
448
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
449
|
+
}
|
|
450
|
+
return takeFromExternrefTable0(ret[0]);
|
|
365
451
|
}
|
|
366
452
|
|
|
367
453
|
/**
|
|
@@ -376,6 +462,14 @@ export function encodeMultiRemoteAttachment(multi_remote_attachment) {
|
|
|
376
462
|
return takeFromExternrefTable0(ret[0]);
|
|
377
463
|
}
|
|
378
464
|
|
|
465
|
+
/**
|
|
466
|
+
* @returns {ContentTypeId}
|
|
467
|
+
*/
|
|
468
|
+
export function multiRemoteAttachmentContentType() {
|
|
469
|
+
const ret = wasm.multiRemoteAttachmentContentType();
|
|
470
|
+
return ret;
|
|
471
|
+
}
|
|
472
|
+
|
|
379
473
|
/**
|
|
380
474
|
* @param {string} text
|
|
381
475
|
* @returns {EncodedContent}
|
|
@@ -426,14 +520,6 @@ export function intentContentType() {
|
|
|
426
520
|
return ret;
|
|
427
521
|
}
|
|
428
522
|
|
|
429
|
-
/**
|
|
430
|
-
* @returns {ContentTypeId}
|
|
431
|
-
*/
|
|
432
|
-
export function actionsContentType() {
|
|
433
|
-
const ret = wasm.actionsContentType();
|
|
434
|
-
return ret;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
523
|
/**
|
|
438
524
|
* @param {Actions} actions
|
|
439
525
|
* @returns {EncodedContent}
|
|
@@ -449,11 +535,33 @@ export function encodeActions(actions) {
|
|
|
449
535
|
/**
|
|
450
536
|
* @returns {ContentTypeId}
|
|
451
537
|
*/
|
|
452
|
-
export function
|
|
453
|
-
const ret = wasm.
|
|
538
|
+
export function actionsContentType() {
|
|
539
|
+
const ret = wasm.actionsContentType();
|
|
454
540
|
return ret;
|
|
455
541
|
}
|
|
456
542
|
|
|
543
|
+
/**
|
|
544
|
+
* @returns {ContentTypeId}
|
|
545
|
+
*/
|
|
546
|
+
export function markdownContentType() {
|
|
547
|
+
const ret = wasm.markdownContentType();
|
|
548
|
+
return ret;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* @param {string} text
|
|
553
|
+
* @returns {EncodedContent}
|
|
554
|
+
*/
|
|
555
|
+
export function encodeMarkdown(text) {
|
|
556
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
557
|
+
const len0 = WASM_VECTOR_LEN;
|
|
558
|
+
const ret = wasm.encodeMarkdown(ptr0, len0);
|
|
559
|
+
if (ret[2]) {
|
|
560
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
561
|
+
}
|
|
562
|
+
return takeFromExternrefTable0(ret[0]);
|
|
563
|
+
}
|
|
564
|
+
|
|
457
565
|
/**
|
|
458
566
|
* @param {Reaction} reaction
|
|
459
567
|
* @returns {EncodedContent}
|
|
@@ -466,11 +574,14 @@ export function encodeReaction(reaction) {
|
|
|
466
574
|
return takeFromExternrefTable0(ret[0]);
|
|
467
575
|
}
|
|
468
576
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
577
|
+
/**
|
|
578
|
+
* @returns {ContentTypeId}
|
|
579
|
+
*/
|
|
580
|
+
export function reactionContentType() {
|
|
581
|
+
const ret = wasm.reactionContentType();
|
|
582
|
+
return ret;
|
|
473
583
|
}
|
|
584
|
+
|
|
474
585
|
/**
|
|
475
586
|
* @param {string} host
|
|
476
587
|
* @param {string} inboxId
|
|
@@ -511,77 +622,6 @@ export function createClient(host, inboxId, accountIdentifier, dbPath, encryptio
|
|
|
511
622
|
return ret;
|
|
512
623
|
}
|
|
513
624
|
|
|
514
|
-
/**
|
|
515
|
-
* @param {string} host
|
|
516
|
-
* @param {string | null | undefined} gatewayHost
|
|
517
|
-
* @param {Identifier} recoveryIdentifier
|
|
518
|
-
* @param {string} inboxId
|
|
519
|
-
* @param {Uint8Array[]} installationIds
|
|
520
|
-
* @returns {SignatureRequestHandle}
|
|
521
|
-
*/
|
|
522
|
-
export function revokeInstallationsSignatureRequest(host, gatewayHost, recoveryIdentifier, inboxId, installationIds) {
|
|
523
|
-
const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
524
|
-
const len0 = WASM_VECTOR_LEN;
|
|
525
|
-
var ptr1 = isLikeNone(gatewayHost) ? 0 : passStringToWasm0(gatewayHost, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
526
|
-
var len1 = WASM_VECTOR_LEN;
|
|
527
|
-
const ptr2 = passStringToWasm0(inboxId, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
528
|
-
const len2 = WASM_VECTOR_LEN;
|
|
529
|
-
const ptr3 = passArrayJsValueToWasm0(installationIds, wasm.__wbindgen_malloc);
|
|
530
|
-
const len3 = WASM_VECTOR_LEN;
|
|
531
|
-
const ret = wasm.revokeInstallationsSignatureRequest(ptr0, len0, ptr1, len1, recoveryIdentifier, ptr2, len2, ptr3, len3);
|
|
532
|
-
if (ret[2]) {
|
|
533
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
534
|
-
}
|
|
535
|
-
return SignatureRequestHandle.__wrap(ret[0]);
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
/**
|
|
539
|
-
* @param {string} signatureText
|
|
540
|
-
* @param {Uint8Array} signatureBytes
|
|
541
|
-
* @param {Uint8Array} publicKey
|
|
542
|
-
*/
|
|
543
|
-
export function verifySignedWithPublicKey(signatureText, signatureBytes, publicKey) {
|
|
544
|
-
const ptr0 = passStringToWasm0(signatureText, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
545
|
-
const len0 = WASM_VECTOR_LEN;
|
|
546
|
-
const ret = wasm.verifySignedWithPublicKey(ptr0, len0, signatureBytes, publicKey);
|
|
547
|
-
if (ret[1]) {
|
|
548
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
/**
|
|
553
|
-
* @param {string} host
|
|
554
|
-
* @param {string | null | undefined} gatewayHost
|
|
555
|
-
* @param {SignatureRequestHandle} signatureRequest
|
|
556
|
-
* @returns {Promise<void>}
|
|
557
|
-
*/
|
|
558
|
-
export function applySignatureRequest(host, gatewayHost, signatureRequest) {
|
|
559
|
-
const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
560
|
-
const len0 = WASM_VECTOR_LEN;
|
|
561
|
-
var ptr1 = isLikeNone(gatewayHost) ? 0 : passStringToWasm0(gatewayHost, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
562
|
-
var len1 = WASM_VECTOR_LEN;
|
|
563
|
-
_assertClass(signatureRequest, SignatureRequestHandle);
|
|
564
|
-
const ret = wasm.applySignatureRequest(ptr0, len0, ptr1, len1, signatureRequest.__wbg_ptr);
|
|
565
|
-
return ret;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
/**
|
|
569
|
-
* @param {string} host
|
|
570
|
-
* @param {string | null | undefined} gatewayHost
|
|
571
|
-
* @param {string[]} inboxIds
|
|
572
|
-
* @returns {Promise<InboxState[]>}
|
|
573
|
-
*/
|
|
574
|
-
export function inboxStateFromInboxIds(host, gatewayHost, inboxIds) {
|
|
575
|
-
const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
576
|
-
const len0 = WASM_VECTOR_LEN;
|
|
577
|
-
var ptr1 = isLikeNone(gatewayHost) ? 0 : passStringToWasm0(gatewayHost, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
578
|
-
var len1 = WASM_VECTOR_LEN;
|
|
579
|
-
const ptr2 = passArrayJsValueToWasm0(inboxIds, wasm.__wbindgen_malloc);
|
|
580
|
-
const len2 = WASM_VECTOR_LEN;
|
|
581
|
-
const ret = wasm.inboxStateFromInboxIds(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
582
|
-
return ret;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
625
|
/**
|
|
586
626
|
* @param {string} host
|
|
587
627
|
* @param {string | null | undefined} gatewayHost
|
|
@@ -621,6 +661,23 @@ export function generateInboxId(accountIdentifier, nonce) {
|
|
|
621
661
|
}
|
|
622
662
|
}
|
|
623
663
|
|
|
664
|
+
/**
|
|
665
|
+
* @param {string} host
|
|
666
|
+
* @param {string | null | undefined} gatewayHost
|
|
667
|
+
* @param {string[]} inboxIds
|
|
668
|
+
* @returns {Promise<InboxState[]>}
|
|
669
|
+
*/
|
|
670
|
+
export function inboxStateFromInboxIds(host, gatewayHost, inboxIds) {
|
|
671
|
+
const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
672
|
+
const len0 = WASM_VECTOR_LEN;
|
|
673
|
+
var ptr1 = isLikeNone(gatewayHost) ? 0 : passStringToWasm0(gatewayHost, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
674
|
+
var len1 = WASM_VECTOR_LEN;
|
|
675
|
+
const ptr2 = passArrayJsValueToWasm0(inboxIds, wasm.__wbindgen_malloc);
|
|
676
|
+
const len2 = WASM_VECTOR_LEN;
|
|
677
|
+
const ret = wasm.inboxStateFromInboxIds(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
678
|
+
return ret;
|
|
679
|
+
}
|
|
680
|
+
|
|
624
681
|
/**
|
|
625
682
|
* Entry point invoked by JavaScript in a worker.
|
|
626
683
|
* @param {number} ptr
|
|
@@ -632,16 +689,16 @@ export function task_worker_entry_point(ptr) {
|
|
|
632
689
|
}
|
|
633
690
|
}
|
|
634
691
|
|
|
635
|
-
function
|
|
636
|
-
wasm.
|
|
692
|
+
function wasm_bindgen__convert__closures_____invoke__h956b60152b2cf005(arg0, arg1) {
|
|
693
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h956b60152b2cf005(arg0, arg1);
|
|
637
694
|
}
|
|
638
695
|
|
|
639
696
|
function wasm_bindgen__convert__closures_____invoke__hdff293b41f2cecc6(arg0, arg1, arg2) {
|
|
640
697
|
wasm.wasm_bindgen__convert__closures_____invoke__hdff293b41f2cecc6(arg0, arg1, arg2);
|
|
641
698
|
}
|
|
642
699
|
|
|
643
|
-
function
|
|
644
|
-
wasm.
|
|
700
|
+
function wasm_bindgen__convert__closures_____invoke__hceddd2b8fc291040(arg0, arg1) {
|
|
701
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hceddd2b8fc291040(arg0, arg1);
|
|
645
702
|
}
|
|
646
703
|
|
|
647
704
|
function wasm_bindgen__convert__closures_____invoke__h6af3cd86eb56f4b1(arg0, arg1) {
|
|
@@ -731,24 +788,98 @@ export class Client {
|
|
|
731
788
|
wasm.__wbg_client_free(ptr, 0);
|
|
732
789
|
}
|
|
733
790
|
/**
|
|
734
|
-
* @param {
|
|
735
|
-
* @
|
|
736
|
-
* @returns {Promise<ConsentState>}
|
|
791
|
+
* @param {SignatureRequestHandle} signatureRequest
|
|
792
|
+
* @returns {Promise<void>}
|
|
737
793
|
*/
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
const ret = wasm.
|
|
794
|
+
registerIdentity(signatureRequest) {
|
|
795
|
+
_assertClass(signatureRequest, SignatureRequestHandle);
|
|
796
|
+
var ptr0 = signatureRequest.__destroy_into_raw();
|
|
797
|
+
const ret = wasm.client_registerIdentity(this.__wbg_ptr, ptr0);
|
|
742
798
|
return ret;
|
|
743
799
|
}
|
|
744
800
|
/**
|
|
745
|
-
* @param {
|
|
801
|
+
* @param {SignatureRequestHandle} signatureRequest
|
|
746
802
|
* @returns {Promise<void>}
|
|
747
803
|
*/
|
|
748
|
-
|
|
749
|
-
|
|
804
|
+
applySignatureRequest(signatureRequest) {
|
|
805
|
+
_assertClass(signatureRequest, SignatureRequestHandle);
|
|
806
|
+
const ret = wasm.client_applySignatureRequest(this.__wbg_ptr, signatureRequest.__wbg_ptr);
|
|
807
|
+
return ret;
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* @param {string} signatureText
|
|
811
|
+
* @returns {Uint8Array}
|
|
812
|
+
*/
|
|
813
|
+
signWithInstallationKey(signatureText) {
|
|
814
|
+
const ptr0 = passStringToWasm0(signatureText, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
750
815
|
const len0 = WASM_VECTOR_LEN;
|
|
751
|
-
const ret = wasm.
|
|
816
|
+
const ret = wasm.client_signWithInstallationKey(this.__wbg_ptr, ptr0, len0);
|
|
817
|
+
if (ret[2]) {
|
|
818
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
819
|
+
}
|
|
820
|
+
return takeFromExternrefTable0(ret[0]);
|
|
821
|
+
}
|
|
822
|
+
/**
|
|
823
|
+
* @returns {SignatureRequestHandle | undefined}
|
|
824
|
+
*/
|
|
825
|
+
createInboxSignatureRequest() {
|
|
826
|
+
const ret = wasm.client_createInboxSignatureRequest(this.__wbg_ptr);
|
|
827
|
+
if (ret[2]) {
|
|
828
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
829
|
+
}
|
|
830
|
+
return ret[0] === 0 ? undefined : SignatureRequestHandle.__wrap(ret[0]);
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* @param {Identifier} newIdentifier
|
|
834
|
+
* @returns {Promise<SignatureRequestHandle>}
|
|
835
|
+
*/
|
|
836
|
+
addWalletSignatureRequest(newIdentifier) {
|
|
837
|
+
const ret = wasm.client_addWalletSignatureRequest(this.__wbg_ptr, newIdentifier);
|
|
838
|
+
return ret;
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* @param {Identifier} identifier
|
|
842
|
+
* @returns {Promise<SignatureRequestHandle>}
|
|
843
|
+
*/
|
|
844
|
+
revokeWalletSignatureRequest(identifier) {
|
|
845
|
+
const ret = wasm.client_revokeWalletSignatureRequest(this.__wbg_ptr, identifier);
|
|
846
|
+
return ret;
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* @param {string} signatureText
|
|
850
|
+
* @param {Uint8Array} signatureBytes
|
|
851
|
+
*/
|
|
852
|
+
verifySignedWithInstallationKey(signatureText, signatureBytes) {
|
|
853
|
+
const ptr0 = passStringToWasm0(signatureText, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
854
|
+
const len0 = WASM_VECTOR_LEN;
|
|
855
|
+
const ret = wasm.client_verifySignedWithInstallationKey(this.__wbg_ptr, ptr0, len0, signatureBytes);
|
|
856
|
+
if (ret[1]) {
|
|
857
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* @param {Uint8Array[]} installationIds
|
|
862
|
+
* @returns {Promise<SignatureRequestHandle>}
|
|
863
|
+
*/
|
|
864
|
+
revokeInstallationsSignatureRequest(installationIds) {
|
|
865
|
+
const ptr0 = passArrayJsValueToWasm0(installationIds, wasm.__wbindgen_malloc);
|
|
866
|
+
const len0 = WASM_VECTOR_LEN;
|
|
867
|
+
const ret = wasm.client_revokeInstallationsSignatureRequest(this.__wbg_ptr, ptr0, len0);
|
|
868
|
+
return ret;
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* @param {Identifier} newRecoveryIdentifier
|
|
872
|
+
* @returns {Promise<SignatureRequestHandle>}
|
|
873
|
+
*/
|
|
874
|
+
changeRecoveryIdentifierSignatureRequest(newRecoveryIdentifier) {
|
|
875
|
+
const ret = wasm.client_changeRecoveryIdentifierSignatureRequest(this.__wbg_ptr, newRecoveryIdentifier);
|
|
876
|
+
return ret;
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* @returns {Promise<SignatureRequestHandle | undefined>}
|
|
880
|
+
*/
|
|
881
|
+
revokeAllOtherInstallationsSignatureRequest() {
|
|
882
|
+
const ret = wasm.client_revokeAllOtherInstallationsSignatureRequest(this.__wbg_ptr);
|
|
752
883
|
return ret;
|
|
753
884
|
}
|
|
754
885
|
/**
|
|
@@ -915,101 +1046,6 @@ export class Client {
|
|
|
915
1046
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
916
1047
|
}
|
|
917
1048
|
}
|
|
918
|
-
/**
|
|
919
|
-
* @param {SignatureRequestHandle} signatureRequest
|
|
920
|
-
* @returns {Promise<void>}
|
|
921
|
-
*/
|
|
922
|
-
registerIdentity(signatureRequest) {
|
|
923
|
-
_assertClass(signatureRequest, SignatureRequestHandle);
|
|
924
|
-
var ptr0 = signatureRequest.__destroy_into_raw();
|
|
925
|
-
const ret = wasm.client_registerIdentity(this.__wbg_ptr, ptr0);
|
|
926
|
-
return ret;
|
|
927
|
-
}
|
|
928
|
-
/**
|
|
929
|
-
* @param {SignatureRequestHandle} signatureRequest
|
|
930
|
-
* @returns {Promise<void>}
|
|
931
|
-
*/
|
|
932
|
-
applySignatureRequest(signatureRequest) {
|
|
933
|
-
_assertClass(signatureRequest, SignatureRequestHandle);
|
|
934
|
-
const ret = wasm.client_applySignatureRequest(this.__wbg_ptr, signatureRequest.__wbg_ptr);
|
|
935
|
-
return ret;
|
|
936
|
-
}
|
|
937
|
-
/**
|
|
938
|
-
* @param {string} signatureText
|
|
939
|
-
* @returns {Uint8Array}
|
|
940
|
-
*/
|
|
941
|
-
signWithInstallationKey(signatureText) {
|
|
942
|
-
const ptr0 = passStringToWasm0(signatureText, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
943
|
-
const len0 = WASM_VECTOR_LEN;
|
|
944
|
-
const ret = wasm.client_signWithInstallationKey(this.__wbg_ptr, ptr0, len0);
|
|
945
|
-
if (ret[2]) {
|
|
946
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
947
|
-
}
|
|
948
|
-
return takeFromExternrefTable0(ret[0]);
|
|
949
|
-
}
|
|
950
|
-
/**
|
|
951
|
-
* @returns {SignatureRequestHandle | undefined}
|
|
952
|
-
*/
|
|
953
|
-
createInboxSignatureRequest() {
|
|
954
|
-
const ret = wasm.client_createInboxSignatureRequest(this.__wbg_ptr);
|
|
955
|
-
if (ret[2]) {
|
|
956
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
957
|
-
}
|
|
958
|
-
return ret[0] === 0 ? undefined : SignatureRequestHandle.__wrap(ret[0]);
|
|
959
|
-
}
|
|
960
|
-
/**
|
|
961
|
-
* @param {Identifier} newIdentifier
|
|
962
|
-
* @returns {Promise<SignatureRequestHandle>}
|
|
963
|
-
*/
|
|
964
|
-
addWalletSignatureRequest(newIdentifier) {
|
|
965
|
-
const ret = wasm.client_addWalletSignatureRequest(this.__wbg_ptr, newIdentifier);
|
|
966
|
-
return ret;
|
|
967
|
-
}
|
|
968
|
-
/**
|
|
969
|
-
* @param {Identifier} identifier
|
|
970
|
-
* @returns {Promise<SignatureRequestHandle>}
|
|
971
|
-
*/
|
|
972
|
-
revokeWalletSignatureRequest(identifier) {
|
|
973
|
-
const ret = wasm.client_revokeWalletSignatureRequest(this.__wbg_ptr, identifier);
|
|
974
|
-
return ret;
|
|
975
|
-
}
|
|
976
|
-
/**
|
|
977
|
-
* @param {string} signatureText
|
|
978
|
-
* @param {Uint8Array} signatureBytes
|
|
979
|
-
*/
|
|
980
|
-
verifySignedWithInstallationKey(signatureText, signatureBytes) {
|
|
981
|
-
const ptr0 = passStringToWasm0(signatureText, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
982
|
-
const len0 = WASM_VECTOR_LEN;
|
|
983
|
-
const ret = wasm.client_verifySignedWithInstallationKey(this.__wbg_ptr, ptr0, len0, signatureBytes);
|
|
984
|
-
if (ret[1]) {
|
|
985
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
/**
|
|
989
|
-
* @param {Uint8Array[]} installationIds
|
|
990
|
-
* @returns {Promise<SignatureRequestHandle>}
|
|
991
|
-
*/
|
|
992
|
-
revokeInstallationsSignatureRequest(installationIds) {
|
|
993
|
-
const ptr0 = passArrayJsValueToWasm0(installationIds, wasm.__wbindgen_malloc);
|
|
994
|
-
const len0 = WASM_VECTOR_LEN;
|
|
995
|
-
const ret = wasm.client_revokeInstallationsSignatureRequest(this.__wbg_ptr, ptr0, len0);
|
|
996
|
-
return ret;
|
|
997
|
-
}
|
|
998
|
-
/**
|
|
999
|
-
* @param {Identifier} newRecoveryIdentifier
|
|
1000
|
-
* @returns {Promise<SignatureRequestHandle>}
|
|
1001
|
-
*/
|
|
1002
|
-
changeRecoveryIdentifierSignatureRequest(newRecoveryIdentifier) {
|
|
1003
|
-
const ret = wasm.client_changeRecoveryIdentifierSignatureRequest(this.__wbg_ptr, newRecoveryIdentifier);
|
|
1004
|
-
return ret;
|
|
1005
|
-
}
|
|
1006
|
-
/**
|
|
1007
|
-
* @returns {Promise<SignatureRequestHandle | undefined>}
|
|
1008
|
-
*/
|
|
1009
|
-
revokeAllOtherInstallationsSignatureRequest() {
|
|
1010
|
-
const ret = wasm.client_revokeAllOtherInstallationsSignatureRequest(this.__wbg_ptr);
|
|
1011
|
-
return ret;
|
|
1012
|
-
}
|
|
1013
1049
|
/**
|
|
1014
1050
|
*
|
|
1015
1051
|
* * Get the client's inbox state.
|
|
@@ -1049,6 +1085,27 @@ export class Client {
|
|
|
1049
1085
|
const ret = wasm.client_getKeyPackageStatusesForInstallationIds(this.__wbg_ptr, ptr0, len0);
|
|
1050
1086
|
return ret;
|
|
1051
1087
|
}
|
|
1088
|
+
/**
|
|
1089
|
+
* @param {ConsentEntityType} entityType
|
|
1090
|
+
* @param {string} entity
|
|
1091
|
+
* @returns {Promise<ConsentState>}
|
|
1092
|
+
*/
|
|
1093
|
+
getConsentState(entityType, entity) {
|
|
1094
|
+
const ptr0 = passStringToWasm0(entity, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1095
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1096
|
+
const ret = wasm.client_getConsentState(this.__wbg_ptr, entityType, ptr0, len0);
|
|
1097
|
+
return ret;
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
1100
|
+
* @param {Consent[]} records
|
|
1101
|
+
* @returns {Promise<void>}
|
|
1102
|
+
*/
|
|
1103
|
+
setConsentStates(records) {
|
|
1104
|
+
const ptr0 = passArrayJsValueToWasm0(records, wasm.__wbindgen_malloc);
|
|
1105
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1106
|
+
const ret = wasm.client_setConsentStates(this.__wbg_ptr, ptr0, len0);
|
|
1107
|
+
return ret;
|
|
1108
|
+
}
|
|
1052
1109
|
}
|
|
1053
1110
|
if (Symbol.dispose) Client.prototype[Symbol.dispose] = Client.prototype.free;
|
|
1054
1111
|
|
|
@@ -1203,6 +1260,17 @@ export class Conversation {
|
|
|
1203
1260
|
}
|
|
1204
1261
|
return takeFromExternrefTable0(ret[0]);
|
|
1205
1262
|
}
|
|
1263
|
+
/**
|
|
1264
|
+
* @param {string} markdown
|
|
1265
|
+
* @param {boolean | null} [optimistic]
|
|
1266
|
+
* @returns {Promise<string>}
|
|
1267
|
+
*/
|
|
1268
|
+
sendMarkdown(markdown, optimistic) {
|
|
1269
|
+
const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1270
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1271
|
+
const ret = wasm.conversation_sendMarkdown(this.__wbg_ptr, ptr0, len0, isLikeNone(optimistic) ? 0xFFFFFF : optimistic ? 1 : 0);
|
|
1272
|
+
return ret;
|
|
1273
|
+
}
|
|
1206
1274
|
/**
|
|
1207
1275
|
* @param {Reaction} reaction
|
|
1208
1276
|
* @param {boolean | null} [optimistic]
|
|
@@ -1613,7 +1681,7 @@ export class Conversation {
|
|
|
1613
1681
|
}
|
|
1614
1682
|
/**
|
|
1615
1683
|
* @param {Uint8Array} envelopeBytes
|
|
1616
|
-
* @returns {Promise<Message>}
|
|
1684
|
+
* @returns {Promise<Message[]>}
|
|
1617
1685
|
*/
|
|
1618
1686
|
processStreamedGroupMessage(envelopeBytes) {
|
|
1619
1687
|
const ret = wasm.conversation_processStreamedGroupMessage(this.__wbg_ptr, envelopeBytes);
|
|
@@ -2979,26 +3047,23 @@ function __wbg_get_imports() {
|
|
|
2979
3047
|
const ret = Date.now();
|
|
2980
3048
|
return ret;
|
|
2981
3049
|
};
|
|
2982
|
-
imports.wbg.
|
|
3050
|
+
imports.wbg.__wbg_on_auth_required_e368aaddaa60794a = function() { return handleError(function (arg0) {
|
|
2983
3051
|
const ret = arg0.on_auth_required();
|
|
2984
3052
|
return ret;
|
|
2985
3053
|
}, arguments) };
|
|
2986
|
-
imports.wbg.
|
|
3054
|
+
imports.wbg.__wbg_on_close_d69734f43badf0eb = function(arg0) {
|
|
2987
3055
|
arg0.on_close();
|
|
2988
3056
|
};
|
|
2989
|
-
imports.wbg.
|
|
3057
|
+
imports.wbg.__wbg_on_consent_update_4208639345abe4bc = function(arg0, arg1) {
|
|
2990
3058
|
arg0.on_consent_update(arg1);
|
|
2991
3059
|
};
|
|
2992
|
-
imports.wbg.
|
|
3060
|
+
imports.wbg.__wbg_on_conversation_3f44180a0d9b4cea = function(arg0, arg1) {
|
|
2993
3061
|
arg0.on_conversation(Conversation.__wrap(arg1));
|
|
2994
3062
|
};
|
|
2995
|
-
imports.wbg.
|
|
3063
|
+
imports.wbg.__wbg_on_error_d7ae86c5b7c32997 = function(arg0, arg1) {
|
|
2996
3064
|
arg0.on_error(arg1);
|
|
2997
3065
|
};
|
|
2998
|
-
imports.wbg.
|
|
2999
|
-
arg0.on_message(arg1);
|
|
3000
|
-
};
|
|
3001
|
-
imports.wbg.__wbg_on_message_deleted_73d3fb76668ad7c9 = function(arg0, arg1, arg2) {
|
|
3066
|
+
imports.wbg.__wbg_on_message_deleted_96ff70f0f1607b68 = function(arg0, arg1, arg2) {
|
|
3002
3067
|
let deferred0_0;
|
|
3003
3068
|
let deferred0_1;
|
|
3004
3069
|
try {
|
|
@@ -3009,7 +3074,10 @@ function __wbg_get_imports() {
|
|
|
3009
3074
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
3010
3075
|
}
|
|
3011
3076
|
};
|
|
3012
|
-
imports.wbg.
|
|
3077
|
+
imports.wbg.__wbg_on_message_f4d392e5315b2bcd = function(arg0, arg1) {
|
|
3078
|
+
arg0.on_message(arg1);
|
|
3079
|
+
};
|
|
3080
|
+
imports.wbg.__wbg_on_user_preference_update_ee6c6db0e041f04d = function(arg0, arg1, arg2) {
|
|
3013
3081
|
var v0 = getArrayJsValueFromWasm0(arg1, arg2).slice();
|
|
3014
3082
|
wasm.__wbindgen_free(arg1, arg2 * 4, 4);
|
|
3015
3083
|
arg0.on_user_preference_update(v0);
|
|
@@ -3273,9 +3341,9 @@ function __wbg_get_imports() {
|
|
|
3273
3341
|
const ret = arg0.write(arg1, arg2);
|
|
3274
3342
|
return ret;
|
|
3275
3343
|
}, arguments) };
|
|
3276
|
-
imports.wbg.
|
|
3277
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
3278
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
3344
|
+
imports.wbg.__wbindgen_cast_211e08c655cf62bf = function(arg0, arg1) {
|
|
3345
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 6889, function: Function { arguments: [], shim_idx: 6890, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3346
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he7b712e0eb1b5ac1, wasm_bindgen__convert__closures_____invoke__h6af3cd86eb56f4b1);
|
|
3279
3347
|
return ret;
|
|
3280
3348
|
};
|
|
3281
3349
|
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
@@ -3295,8 +3363,13 @@ function __wbg_get_imports() {
|
|
|
3295
3363
|
const ret = v0;
|
|
3296
3364
|
return ret;
|
|
3297
3365
|
};
|
|
3298
|
-
imports.wbg.
|
|
3299
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
3366
|
+
imports.wbg.__wbindgen_cast_653b194fefadb0d3 = function(arg0, arg1) {
|
|
3367
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 7298, function: Function { arguments: [Externref], shim_idx: 7299, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3368
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hed8af60076250245, wasm_bindgen__convert__closures_____invoke__hdff293b41f2cecc6);
|
|
3369
|
+
return ret;
|
|
3370
|
+
};
|
|
3371
|
+
imports.wbg.__wbindgen_cast_71b65f902d88c9ed = function(arg0, arg1) {
|
|
3372
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 7265, function: Function { arguments: [], shim_idx: 7266, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3300
3373
|
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h3c5639ee43c80f22, wasm_bindgen__convert__closures_____invoke__h956b60152b2cf005);
|
|
3301
3374
|
return ret;
|
|
3302
3375
|
};
|
|
@@ -3319,14 +3392,9 @@ function __wbg_get_imports() {
|
|
|
3319
3392
|
const ret = arg0;
|
|
3320
3393
|
return ret;
|
|
3321
3394
|
};
|
|
3322
|
-
imports.wbg.
|
|
3323
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
3324
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
3325
|
-
return ret;
|
|
3326
|
-
};
|
|
3327
|
-
imports.wbg.__wbindgen_cast_c06d34399c7c349c = function(arg0, arg1) {
|
|
3328
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 6859, function: Function { arguments: [], shim_idx: 6860, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3329
|
-
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he7b712e0eb1b5ac1, wasm_bindgen__convert__closures_____invoke__h6af3cd86eb56f4b1);
|
|
3395
|
+
imports.wbg.__wbindgen_cast_c57c2f5798589a39 = function(arg0, arg1) {
|
|
3396
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 7106, function: Function { arguments: [], shim_idx: 7107, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3397
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hfbd660e60d498df9, wasm_bindgen__convert__closures_____invoke__hceddd2b8fc291040);
|
|
3330
3398
|
return ret;
|
|
3331
3399
|
};
|
|
3332
3400
|
imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
|