@xmtp/wasm-bindings 1.0.0-rc3 → 1.0.0-rc4
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 +216 -225
- package/dist/bindings_wasm.js +212 -320
- package/dist/bindings_wasm_bg.wasm +0 -0
- package/dist/bindings_wasm_bg.wasm.d.ts +188 -194
- package/package.json +1 -1
package/dist/bindings_wasm.js
CHANGED
|
@@ -230,62 +230,11 @@ function _assertClass(instance, klass) {
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
234
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
235
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
236
|
-
WASM_VECTOR_LEN = arg.length;
|
|
237
|
-
return ptr;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
233
|
function takeFromExternrefTable0(idx) {
|
|
241
234
|
const value = wasm.__wbindgen_export_4.get(idx);
|
|
242
235
|
wasm.__externref_table_dealloc(idx);
|
|
243
236
|
return value;
|
|
244
237
|
}
|
|
245
|
-
/**
|
|
246
|
-
* @param {string} host
|
|
247
|
-
* @param {string} inbox_id
|
|
248
|
-
* @param {Identifier} account_identifier
|
|
249
|
-
* @param {string | null} [db_path]
|
|
250
|
-
* @param {Uint8Array | null} [encryption_key]
|
|
251
|
-
* @param {string | null} [history_sync_url]
|
|
252
|
-
* @param {LogOptions | null} [log_options]
|
|
253
|
-
* @returns {Promise<Client>}
|
|
254
|
-
*/
|
|
255
|
-
export function createClient(host, inbox_id, account_identifier, db_path, encryption_key, history_sync_url, log_options) {
|
|
256
|
-
const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
257
|
-
const len0 = WASM_VECTOR_LEN;
|
|
258
|
-
const ptr1 = passStringToWasm0(inbox_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
259
|
-
const len1 = WASM_VECTOR_LEN;
|
|
260
|
-
_assertClass(account_identifier, Identifier);
|
|
261
|
-
var ptr2 = account_identifier.__destroy_into_raw();
|
|
262
|
-
var ptr3 = isLikeNone(db_path) ? 0 : passStringToWasm0(db_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
263
|
-
var len3 = WASM_VECTOR_LEN;
|
|
264
|
-
var ptr4 = isLikeNone(history_sync_url) ? 0 : passStringToWasm0(history_sync_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
265
|
-
var len4 = WASM_VECTOR_LEN;
|
|
266
|
-
let ptr5 = 0;
|
|
267
|
-
if (!isLikeNone(log_options)) {
|
|
268
|
-
_assertClass(log_options, LogOptions);
|
|
269
|
-
ptr5 = log_options.__destroy_into_raw();
|
|
270
|
-
}
|
|
271
|
-
const ret = wasm.createClient(ptr0, len0, ptr1, len1, ptr2, ptr3, len3, isLikeNone(encryption_key) ? 0 : addToExternrefTable0(encryption_key), ptr4, len4, ptr5);
|
|
272
|
-
return ret;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* @param {string} signature_text
|
|
277
|
-
* @param {Uint8Array} signature_bytes
|
|
278
|
-
* @param {Uint8Array} public_key
|
|
279
|
-
*/
|
|
280
|
-
export function verifySignedWithPublicKey(signature_text, signature_bytes, public_key) {
|
|
281
|
-
const ptr0 = passStringToWasm0(signature_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
282
|
-
const len0 = WASM_VECTOR_LEN;
|
|
283
|
-
const ret = wasm.verifySignedWithPublicKey(ptr0, len0, signature_bytes, public_key);
|
|
284
|
-
if (ret[1]) {
|
|
285
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
|
|
289
238
|
/**
|
|
290
239
|
* @param {MultiRemoteAttachment} multiRemoteAttachment
|
|
291
240
|
* @returns {Uint8Array}
|
|
@@ -338,6 +287,48 @@ export function decodeReaction(bytes) {
|
|
|
338
287
|
return Reaction.__wrap(ret[0]);
|
|
339
288
|
}
|
|
340
289
|
|
|
290
|
+
/**
|
|
291
|
+
* @param {string} signature_text
|
|
292
|
+
* @param {Uint8Array} signature_bytes
|
|
293
|
+
* @param {Uint8Array} public_key
|
|
294
|
+
*/
|
|
295
|
+
export function verifySignedWithPublicKey(signature_text, signature_bytes, public_key) {
|
|
296
|
+
const ptr0 = passStringToWasm0(signature_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
297
|
+
const len0 = WASM_VECTOR_LEN;
|
|
298
|
+
const ret = wasm.verifySignedWithPublicKey(ptr0, len0, signature_bytes, public_key);
|
|
299
|
+
if (ret[1]) {
|
|
300
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* @param {string} host
|
|
306
|
+
* @param {string} inbox_id
|
|
307
|
+
* @param {Identifier} account_identifier
|
|
308
|
+
* @param {string | null} [db_path]
|
|
309
|
+
* @param {Uint8Array | null} [encryption_key]
|
|
310
|
+
* @param {string | null} [history_sync_url]
|
|
311
|
+
* @param {LogOptions | null} [log_options]
|
|
312
|
+
* @returns {Promise<Client>}
|
|
313
|
+
*/
|
|
314
|
+
export function createClient(host, inbox_id, account_identifier, db_path, encryption_key, history_sync_url, log_options) {
|
|
315
|
+
const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
316
|
+
const len0 = WASM_VECTOR_LEN;
|
|
317
|
+
const ptr1 = passStringToWasm0(inbox_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
318
|
+
const len1 = WASM_VECTOR_LEN;
|
|
319
|
+
var ptr2 = isLikeNone(db_path) ? 0 : passStringToWasm0(db_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
320
|
+
var len2 = WASM_VECTOR_LEN;
|
|
321
|
+
var ptr3 = isLikeNone(history_sync_url) ? 0 : passStringToWasm0(history_sync_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
322
|
+
var len3 = WASM_VECTOR_LEN;
|
|
323
|
+
let ptr4 = 0;
|
|
324
|
+
if (!isLikeNone(log_options)) {
|
|
325
|
+
_assertClass(log_options, LogOptions);
|
|
326
|
+
ptr4 = log_options.__destroy_into_raw();
|
|
327
|
+
}
|
|
328
|
+
const ret = wasm.createClient(ptr0, len0, ptr1, len1, account_identifier, ptr2, len2, isLikeNone(encryption_key) ? 0 : addToExternrefTable0(encryption_key), ptr3, len3, ptr4);
|
|
329
|
+
return ret;
|
|
330
|
+
}
|
|
331
|
+
|
|
341
332
|
/**
|
|
342
333
|
* @param {string} host
|
|
343
334
|
* @param {Identifier} accountIdentifier
|
|
@@ -346,9 +337,7 @@ export function decodeReaction(bytes) {
|
|
|
346
337
|
export function getInboxIdForIdentifier(host, accountIdentifier) {
|
|
347
338
|
const ptr0 = passStringToWasm0(host, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
348
339
|
const len0 = WASM_VECTOR_LEN;
|
|
349
|
-
|
|
350
|
-
var ptr1 = accountIdentifier.__destroy_into_raw();
|
|
351
|
-
const ret = wasm.getInboxIdForIdentifier(ptr0, len0, ptr1);
|
|
340
|
+
const ret = wasm.getInboxIdForIdentifier(ptr0, len0, accountIdentifier);
|
|
352
341
|
return ret;
|
|
353
342
|
}
|
|
354
343
|
|
|
@@ -357,41 +346,45 @@ export function getInboxIdForIdentifier(host, accountIdentifier) {
|
|
|
357
346
|
* @returns {string}
|
|
358
347
|
*/
|
|
359
348
|
export function generateInboxId(accountIdentifier) {
|
|
360
|
-
let
|
|
361
|
-
let
|
|
349
|
+
let deferred2_0;
|
|
350
|
+
let deferred2_1;
|
|
362
351
|
try {
|
|
363
|
-
|
|
364
|
-
var
|
|
365
|
-
|
|
366
|
-
var ptr2 = ret[0];
|
|
367
|
-
var len2 = ret[1];
|
|
352
|
+
const ret = wasm.generateInboxId(accountIdentifier);
|
|
353
|
+
var ptr1 = ret[0];
|
|
354
|
+
var len1 = ret[1];
|
|
368
355
|
if (ret[3]) {
|
|
369
|
-
|
|
356
|
+
ptr1 = 0; len1 = 0;
|
|
370
357
|
throw takeFromExternrefTable0(ret[2]);
|
|
371
358
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
return getStringFromWasm0(
|
|
359
|
+
deferred2_0 = ptr1;
|
|
360
|
+
deferred2_1 = len1;
|
|
361
|
+
return getStringFromWasm0(ptr1, len1);
|
|
375
362
|
} finally {
|
|
376
|
-
wasm.__wbindgen_free(
|
|
363
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
377
364
|
}
|
|
378
365
|
}
|
|
379
366
|
|
|
380
|
-
function
|
|
367
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
368
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
369
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
370
|
+
WASM_VECTOR_LEN = arg.length;
|
|
371
|
+
return ptr;
|
|
372
|
+
}
|
|
373
|
+
function __wbg_adapter_48(arg0, arg1) {
|
|
381
374
|
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hff1927556d6713ec(arg0, arg1);
|
|
382
375
|
}
|
|
383
376
|
|
|
384
|
-
function
|
|
385
|
-
wasm.
|
|
377
|
+
function __wbg_adapter_51(arg0, arg1, arg2) {
|
|
378
|
+
wasm.closure3753_externref_shim(arg0, arg1, arg2);
|
|
386
379
|
}
|
|
387
380
|
|
|
388
|
-
function
|
|
389
|
-
const ret = wasm.
|
|
381
|
+
function __wbg_adapter_585(arg0, arg1, arg2, arg3, arg4) {
|
|
382
|
+
const ret = wasm.closure4762_externref_shim(arg0, arg1, arg2, arg3, arg4);
|
|
390
383
|
return ret !== 0;
|
|
391
384
|
}
|
|
392
385
|
|
|
393
|
-
function
|
|
394
|
-
wasm.
|
|
386
|
+
function __wbg_adapter_686(arg0, arg1, arg2, arg3) {
|
|
387
|
+
wasm.closure4761_externref_shim(arg0, arg1, arg2, arg3);
|
|
395
388
|
}
|
|
396
389
|
|
|
397
390
|
/**
|
|
@@ -463,13 +456,6 @@ export const GroupPermissionsOptions = Object.freeze({
|
|
|
463
456
|
AdminOnly: 1, "1": "AdminOnly",
|
|
464
457
|
CustomPolicy: 2, "2": "CustomPolicy",
|
|
465
458
|
});
|
|
466
|
-
/**
|
|
467
|
-
* @enum {0 | 1}
|
|
468
|
-
*/
|
|
469
|
-
export const IdentifierKind = Object.freeze({
|
|
470
|
-
Ethereum: 0, "0": "Ethereum",
|
|
471
|
-
Passkey: 1, "1": "Passkey",
|
|
472
|
-
});
|
|
473
459
|
/**
|
|
474
460
|
* @enum {0 | 1 | 2 | 3 | 4}
|
|
475
461
|
*/
|
|
@@ -577,35 +563,122 @@ export class Client {
|
|
|
577
563
|
wasm.__wbg_client_free(ptr, 0);
|
|
578
564
|
}
|
|
579
565
|
/**
|
|
580
|
-
*
|
|
581
|
-
* * Get the client's inbox state.
|
|
582
|
-
* *
|
|
583
|
-
* * If `refresh_from_network` is true, the client will go to the network first to refresh the state.
|
|
584
|
-
* * Otherwise, the state will be read from the local database.
|
|
585
|
-
*
|
|
586
|
-
* @param {boolean} refresh_from_network
|
|
587
|
-
* @returns {Promise<InboxState>}
|
|
566
|
+
* @returns {string | undefined}
|
|
588
567
|
*/
|
|
589
|
-
|
|
590
|
-
const ret = wasm.
|
|
568
|
+
createInboxSignatureText() {
|
|
569
|
+
const ret = wasm.client_createInboxSignatureText(this.__wbg_ptr);
|
|
570
|
+
if (ret[3]) {
|
|
571
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
572
|
+
}
|
|
573
|
+
let v1;
|
|
574
|
+
if (ret[0] !== 0) {
|
|
575
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
576
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
577
|
+
}
|
|
578
|
+
return v1;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* @param {Identifier} new_identifier
|
|
582
|
+
* @returns {Promise<string>}
|
|
583
|
+
*/
|
|
584
|
+
addWalletSignatureText(new_identifier) {
|
|
585
|
+
const ret = wasm.client_addWalletSignatureText(this.__wbg_ptr, new_identifier);
|
|
591
586
|
return ret;
|
|
592
587
|
}
|
|
593
588
|
/**
|
|
594
|
-
* @param {
|
|
595
|
-
* @returns {Promise<
|
|
589
|
+
* @param {Identifier} identifier
|
|
590
|
+
* @returns {Promise<string>}
|
|
596
591
|
*/
|
|
597
|
-
|
|
598
|
-
const
|
|
592
|
+
revokeWalletSignatureText(identifier) {
|
|
593
|
+
const ret = wasm.client_revokeWalletSignatureText(this.__wbg_ptr, identifier);
|
|
594
|
+
return ret;
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* @returns {Promise<string>}
|
|
598
|
+
*/
|
|
599
|
+
revokeAllOtherInstallationsSignatureText() {
|
|
600
|
+
const ret = wasm.client_revokeAllOtherInstallationsSignatureText(this.__wbg_ptr);
|
|
601
|
+
return ret;
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* @param {Uint8Array[]} installation_ids
|
|
605
|
+
* @returns {Promise<string>}
|
|
606
|
+
*/
|
|
607
|
+
revokeInstallationsSignatureText(installation_ids) {
|
|
608
|
+
const ptr0 = passArrayJsValueToWasm0(installation_ids, wasm.__wbindgen_malloc);
|
|
599
609
|
const len0 = WASM_VECTOR_LEN;
|
|
600
|
-
const ret = wasm.
|
|
610
|
+
const ret = wasm.client_revokeInstallationsSignatureText(this.__wbg_ptr, ptr0, len0);
|
|
601
611
|
return ret;
|
|
602
612
|
}
|
|
613
|
+
/**
|
|
614
|
+
* @param {SignatureRequestType} signature_type
|
|
615
|
+
* @param {Uint8Array} signature_bytes
|
|
616
|
+
* @returns {Promise<void>}
|
|
617
|
+
*/
|
|
618
|
+
addEcdsaSignature(signature_type, signature_bytes) {
|
|
619
|
+
const ret = wasm.client_addEcdsaSignature(this.__wbg_ptr, signature_type, signature_bytes);
|
|
620
|
+
return ret;
|
|
621
|
+
}
|
|
622
|
+
/**
|
|
623
|
+
* @param {SignatureRequestType} signature_type
|
|
624
|
+
* @param {PasskeySignature} signature
|
|
625
|
+
* @returns {Promise<void>}
|
|
626
|
+
*/
|
|
627
|
+
addPasskeySignature(signature_type, signature) {
|
|
628
|
+
_assertClass(signature, PasskeySignature);
|
|
629
|
+
var ptr0 = signature.__destroy_into_raw();
|
|
630
|
+
const ret = wasm.client_addPasskeySignature(this.__wbg_ptr, signature_type, ptr0);
|
|
631
|
+
return ret;
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* @param {SignatureRequestType} signature_type
|
|
635
|
+
* @param {Uint8Array} signature_bytes
|
|
636
|
+
* @param {bigint} chain_id
|
|
637
|
+
* @param {bigint | null} [block_number]
|
|
638
|
+
* @returns {Promise<void>}
|
|
639
|
+
*/
|
|
640
|
+
addScwSignature(signature_type, signature_bytes, chain_id, block_number) {
|
|
641
|
+
const ret = wasm.client_addScwSignature(this.__wbg_ptr, signature_type, signature_bytes, chain_id, !isLikeNone(block_number), isLikeNone(block_number) ? BigInt(0) : block_number);
|
|
642
|
+
return ret;
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* @returns {Promise<void>}
|
|
646
|
+
*/
|
|
647
|
+
applySignatureRequests() {
|
|
648
|
+
const ret = wasm.client_applySignatureRequests(this.__wbg_ptr);
|
|
649
|
+
return ret;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* @param {string} signature_text
|
|
653
|
+
* @returns {Uint8Array}
|
|
654
|
+
*/
|
|
655
|
+
signWithInstallationKey(signature_text) {
|
|
656
|
+
const ptr0 = passStringToWasm0(signature_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
657
|
+
const len0 = WASM_VECTOR_LEN;
|
|
658
|
+
const ret = wasm.client_signWithInstallationKey(this.__wbg_ptr, ptr0, len0);
|
|
659
|
+
if (ret[2]) {
|
|
660
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
661
|
+
}
|
|
662
|
+
return takeFromExternrefTable0(ret[0]);
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* @param {string} signature_text
|
|
666
|
+
* @param {Uint8Array} signature_bytes
|
|
667
|
+
*/
|
|
668
|
+
verifySignedWithInstallationKey(signature_text, signature_bytes) {
|
|
669
|
+
const ptr0 = passStringToWasm0(signature_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
670
|
+
const len0 = WASM_VECTOR_LEN;
|
|
671
|
+
const ret = wasm.client_verifySignedWithInstallationKey(this.__wbg_ptr, ptr0, len0, signature_bytes);
|
|
672
|
+
if (ret[1]) {
|
|
673
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
603
676
|
/**
|
|
604
677
|
* @returns {Identifier}
|
|
605
678
|
*/
|
|
606
679
|
get accountIdentifier() {
|
|
607
680
|
const ret = wasm.client_accountIdentifier(this.__wbg_ptr);
|
|
608
|
-
return
|
|
681
|
+
return ret;
|
|
609
682
|
}
|
|
610
683
|
/**
|
|
611
684
|
* @returns {string}
|
|
@@ -688,9 +761,7 @@ export class Client {
|
|
|
688
761
|
* @returns {Promise<string | undefined>}
|
|
689
762
|
*/
|
|
690
763
|
findInboxIdByIdentifier(identifier) {
|
|
691
|
-
|
|
692
|
-
var ptr0 = identifier.__destroy_into_raw();
|
|
693
|
-
const ret = wasm.client_findInboxIdByIdentifier(this.__wbg_ptr, ptr0);
|
|
764
|
+
const ret = wasm.client_findInboxIdByIdentifier(this.__wbg_ptr, identifier);
|
|
694
765
|
return ret;
|
|
695
766
|
}
|
|
696
767
|
/**
|
|
@@ -701,120 +772,29 @@ export class Client {
|
|
|
701
772
|
return Conversations.__wrap(ret);
|
|
702
773
|
}
|
|
703
774
|
/**
|
|
704
|
-
*
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
if (ret[0] !== 0) {
|
|
713
|
-
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
714
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
715
|
-
}
|
|
716
|
-
return v1;
|
|
717
|
-
}
|
|
718
|
-
/**
|
|
719
|
-
* @param {Identifier} new_identifier
|
|
720
|
-
* @returns {Promise<string>}
|
|
721
|
-
*/
|
|
722
|
-
addWalletSignatureText(new_identifier) {
|
|
723
|
-
_assertClass(new_identifier, Identifier);
|
|
724
|
-
var ptr0 = new_identifier.__destroy_into_raw();
|
|
725
|
-
const ret = wasm.client_addWalletSignatureText(this.__wbg_ptr, ptr0);
|
|
726
|
-
return ret;
|
|
727
|
-
}
|
|
728
|
-
/**
|
|
729
|
-
* @param {Identifier} identifier
|
|
730
|
-
* @returns {Promise<string>}
|
|
731
|
-
*/
|
|
732
|
-
revokeWalletSignatureText(identifier) {
|
|
733
|
-
_assertClass(identifier, Identifier);
|
|
734
|
-
var ptr0 = identifier.__destroy_into_raw();
|
|
735
|
-
const ret = wasm.client_revokeWalletSignatureText(this.__wbg_ptr, ptr0);
|
|
736
|
-
return ret;
|
|
737
|
-
}
|
|
738
|
-
/**
|
|
739
|
-
* @returns {Promise<string>}
|
|
775
|
+
*
|
|
776
|
+
* * Get the client's inbox state.
|
|
777
|
+
* *
|
|
778
|
+
* * If `refresh_from_network` is true, the client will go to the network first to refresh the state.
|
|
779
|
+
* * Otherwise, the state will be read from the local database.
|
|
780
|
+
*
|
|
781
|
+
* @param {boolean} refresh_from_network
|
|
782
|
+
* @returns {Promise<InboxState>}
|
|
740
783
|
*/
|
|
741
|
-
|
|
742
|
-
const ret = wasm.
|
|
784
|
+
inboxState(refresh_from_network) {
|
|
785
|
+
const ret = wasm.client_inboxState(this.__wbg_ptr, refresh_from_network);
|
|
743
786
|
return ret;
|
|
744
787
|
}
|
|
745
788
|
/**
|
|
746
|
-
* @param {
|
|
747
|
-
* @returns {Promise<
|
|
789
|
+
* @param {string} inbox_id
|
|
790
|
+
* @returns {Promise<InboxState>}
|
|
748
791
|
*/
|
|
749
|
-
|
|
750
|
-
const ptr0 =
|
|
792
|
+
getLatestInboxState(inbox_id) {
|
|
793
|
+
const ptr0 = passStringToWasm0(inbox_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
751
794
|
const len0 = WASM_VECTOR_LEN;
|
|
752
|
-
const ret = wasm.
|
|
753
|
-
return ret;
|
|
754
|
-
}
|
|
755
|
-
/**
|
|
756
|
-
* @param {SignatureRequestType} signature_type
|
|
757
|
-
* @param {Uint8Array} signature_bytes
|
|
758
|
-
* @returns {Promise<void>}
|
|
759
|
-
*/
|
|
760
|
-
addEcdsaSignature(signature_type, signature_bytes) {
|
|
761
|
-
const ret = wasm.client_addEcdsaSignature(this.__wbg_ptr, signature_type, signature_bytes);
|
|
762
|
-
return ret;
|
|
763
|
-
}
|
|
764
|
-
/**
|
|
765
|
-
* @param {SignatureRequestType} signature_type
|
|
766
|
-
* @param {PasskeySignature} signature
|
|
767
|
-
* @returns {Promise<void>}
|
|
768
|
-
*/
|
|
769
|
-
addPasskeySignature(signature_type, signature) {
|
|
770
|
-
_assertClass(signature, PasskeySignature);
|
|
771
|
-
var ptr0 = signature.__destroy_into_raw();
|
|
772
|
-
const ret = wasm.client_addPasskeySignature(this.__wbg_ptr, signature_type, ptr0);
|
|
773
|
-
return ret;
|
|
774
|
-
}
|
|
775
|
-
/**
|
|
776
|
-
* @param {SignatureRequestType} signature_type
|
|
777
|
-
* @param {Uint8Array} signature_bytes
|
|
778
|
-
* @param {bigint} chain_id
|
|
779
|
-
* @param {bigint | null} [block_number]
|
|
780
|
-
* @returns {Promise<void>}
|
|
781
|
-
*/
|
|
782
|
-
addScwSignature(signature_type, signature_bytes, chain_id, block_number) {
|
|
783
|
-
const ret = wasm.client_addScwSignature(this.__wbg_ptr, signature_type, signature_bytes, chain_id, !isLikeNone(block_number), isLikeNone(block_number) ? BigInt(0) : block_number);
|
|
784
|
-
return ret;
|
|
785
|
-
}
|
|
786
|
-
/**
|
|
787
|
-
* @returns {Promise<void>}
|
|
788
|
-
*/
|
|
789
|
-
applySignatureRequests() {
|
|
790
|
-
const ret = wasm.client_applySignatureRequests(this.__wbg_ptr);
|
|
795
|
+
const ret = wasm.client_getLatestInboxState(this.__wbg_ptr, ptr0, len0);
|
|
791
796
|
return ret;
|
|
792
797
|
}
|
|
793
|
-
/**
|
|
794
|
-
* @param {string} signature_text
|
|
795
|
-
* @returns {Uint8Array}
|
|
796
|
-
*/
|
|
797
|
-
signWithInstallationKey(signature_text) {
|
|
798
|
-
const ptr0 = passStringToWasm0(signature_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
799
|
-
const len0 = WASM_VECTOR_LEN;
|
|
800
|
-
const ret = wasm.client_signWithInstallationKey(this.__wbg_ptr, ptr0, len0);
|
|
801
|
-
if (ret[2]) {
|
|
802
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
803
|
-
}
|
|
804
|
-
return takeFromExternrefTable0(ret[0]);
|
|
805
|
-
}
|
|
806
|
-
/**
|
|
807
|
-
* @param {string} signature_text
|
|
808
|
-
* @param {Uint8Array} signature_bytes
|
|
809
|
-
*/
|
|
810
|
-
verifySignedWithInstallationKey(signature_text, signature_bytes) {
|
|
811
|
-
const ptr0 = passStringToWasm0(signature_text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
812
|
-
const len0 = WASM_VECTOR_LEN;
|
|
813
|
-
const ret = wasm.client_verifySignedWithInstallationKey(this.__wbg_ptr, ptr0, len0, signature_bytes);
|
|
814
|
-
if (ret[1]) {
|
|
815
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
798
|
/**
|
|
819
799
|
* @param {Consent[]} records
|
|
820
800
|
* @returns {Promise<void>}
|
|
@@ -1707,14 +1687,12 @@ export class Conversations {
|
|
|
1707
1687
|
* @returns {Promise<Conversation>}
|
|
1708
1688
|
*/
|
|
1709
1689
|
createDm(account_identifier, options) {
|
|
1710
|
-
|
|
1711
|
-
var ptr0 = account_identifier.__destroy_into_raw();
|
|
1712
|
-
let ptr1 = 0;
|
|
1690
|
+
let ptr0 = 0;
|
|
1713
1691
|
if (!isLikeNone(options)) {
|
|
1714
1692
|
_assertClass(options, CreateDMOptions);
|
|
1715
|
-
|
|
1693
|
+
ptr0 = options.__destroy_into_raw();
|
|
1716
1694
|
}
|
|
1717
|
-
const ret = wasm.conversations_createDm(this.__wbg_ptr,
|
|
1695
|
+
const ret = wasm.conversations_createDm(this.__wbg_ptr, account_identifier, ptr0);
|
|
1718
1696
|
return ret;
|
|
1719
1697
|
}
|
|
1720
1698
|
/**
|
|
@@ -2524,88 +2502,6 @@ export class HmacKey {
|
|
|
2524
2502
|
}
|
|
2525
2503
|
}
|
|
2526
2504
|
|
|
2527
|
-
const IdentifierFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2528
|
-
? { register: () => {}, unregister: () => {} }
|
|
2529
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_identifier_free(ptr >>> 0, 1));
|
|
2530
|
-
|
|
2531
|
-
export class Identifier {
|
|
2532
|
-
|
|
2533
|
-
static __wrap(ptr) {
|
|
2534
|
-
ptr = ptr >>> 0;
|
|
2535
|
-
const obj = Object.create(Identifier.prototype);
|
|
2536
|
-
obj.__wbg_ptr = ptr;
|
|
2537
|
-
IdentifierFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2538
|
-
return obj;
|
|
2539
|
-
}
|
|
2540
|
-
|
|
2541
|
-
static __unwrap(jsValue) {
|
|
2542
|
-
if (!(jsValue instanceof Identifier)) {
|
|
2543
|
-
return 0;
|
|
2544
|
-
}
|
|
2545
|
-
return jsValue.__destroy_into_raw();
|
|
2546
|
-
}
|
|
2547
|
-
|
|
2548
|
-
__destroy_into_raw() {
|
|
2549
|
-
const ptr = this.__wbg_ptr;
|
|
2550
|
-
this.__wbg_ptr = 0;
|
|
2551
|
-
IdentifierFinalization.unregister(this);
|
|
2552
|
-
return ptr;
|
|
2553
|
-
}
|
|
2554
|
-
|
|
2555
|
-
free() {
|
|
2556
|
-
const ptr = this.__destroy_into_raw();
|
|
2557
|
-
wasm.__wbg_identifier_free(ptr, 0);
|
|
2558
|
-
}
|
|
2559
|
-
/**
|
|
2560
|
-
* @returns {string}
|
|
2561
|
-
*/
|
|
2562
|
-
get identifier() {
|
|
2563
|
-
let deferred1_0;
|
|
2564
|
-
let deferred1_1;
|
|
2565
|
-
try {
|
|
2566
|
-
const ret = wasm.__wbg_get_identifier_identifier(this.__wbg_ptr);
|
|
2567
|
-
deferred1_0 = ret[0];
|
|
2568
|
-
deferred1_1 = ret[1];
|
|
2569
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
2570
|
-
} finally {
|
|
2571
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2572
|
-
}
|
|
2573
|
-
}
|
|
2574
|
-
/**
|
|
2575
|
-
* @param {string} arg0
|
|
2576
|
-
*/
|
|
2577
|
-
set identifier(arg0) {
|
|
2578
|
-
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2579
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2580
|
-
wasm.__wbg_set_consent_entity(this.__wbg_ptr, ptr0, len0);
|
|
2581
|
-
}
|
|
2582
|
-
/**
|
|
2583
|
-
* @returns {IdentifierKind}
|
|
2584
|
-
*/
|
|
2585
|
-
get identifierKind() {
|
|
2586
|
-
const ret = wasm.__wbg_get_identifier_identifierKind(this.__wbg_ptr);
|
|
2587
|
-
return ret;
|
|
2588
|
-
}
|
|
2589
|
-
/**
|
|
2590
|
-
* @param {IdentifierKind} arg0
|
|
2591
|
-
*/
|
|
2592
|
-
set identifierKind(arg0) {
|
|
2593
|
-
wasm.__wbg_set_identifier_identifierKind(this.__wbg_ptr, arg0);
|
|
2594
|
-
}
|
|
2595
|
-
/**
|
|
2596
|
-
* @param {string} identifier
|
|
2597
|
-
* @param {IdentifierKind} identifierKind
|
|
2598
|
-
*/
|
|
2599
|
-
constructor(identifier, identifierKind) {
|
|
2600
|
-
const ptr0 = passStringToWasm0(identifier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2601
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2602
|
-
const ret = wasm.identifier_new(ptr0, len0, identifierKind);
|
|
2603
|
-
this.__wbg_ptr = ret >>> 0;
|
|
2604
|
-
IdentifierFinalization.register(this, this.__wbg_ptr, this);
|
|
2605
|
-
return this;
|
|
2606
|
-
}
|
|
2607
|
-
}
|
|
2608
|
-
|
|
2609
2505
|
const InboxStateFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2610
2506
|
? { register: () => {}, unregister: () => {} }
|
|
2611
2507
|
: new FinalizationRegistry(ptr => wasm.__wbg_inboxstate_free(ptr >>> 0, 1));
|
|
@@ -2652,22 +2548,20 @@ export class InboxState {
|
|
|
2652
2548
|
set inboxId(arg0) {
|
|
2653
2549
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2654
2550
|
const len0 = WASM_VECTOR_LEN;
|
|
2655
|
-
wasm.
|
|
2551
|
+
wasm.__wbg_set_inboxstate_inboxId(this.__wbg_ptr, ptr0, len0);
|
|
2656
2552
|
}
|
|
2657
2553
|
/**
|
|
2658
2554
|
* @returns {Identifier}
|
|
2659
2555
|
*/
|
|
2660
2556
|
get recoveryIdentifier() {
|
|
2661
2557
|
const ret = wasm.__wbg_get_inboxstate_recoveryIdentifier(this.__wbg_ptr);
|
|
2662
|
-
return
|
|
2558
|
+
return ret;
|
|
2663
2559
|
}
|
|
2664
2560
|
/**
|
|
2665
2561
|
* @param {Identifier} arg0
|
|
2666
2562
|
*/
|
|
2667
2563
|
set recoveryIdentifier(arg0) {
|
|
2668
|
-
|
|
2669
|
-
var ptr0 = arg0.__destroy_into_raw();
|
|
2670
|
-
wasm.__wbg_set_inboxstate_recoveryIdentifier(this.__wbg_ptr, ptr0);
|
|
2564
|
+
wasm.__wbg_set_inboxstate_recoveryIdentifier(this.__wbg_ptr, arg0);
|
|
2671
2565
|
}
|
|
2672
2566
|
/**
|
|
2673
2567
|
* @returns {Installation[]}
|
|
@@ -2712,13 +2606,11 @@ export class InboxState {
|
|
|
2712
2606
|
constructor(inbox_id, recovery_identifier, installations, account_identifiers) {
|
|
2713
2607
|
const ptr0 = passStringToWasm0(inbox_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2714
2608
|
const len0 = WASM_VECTOR_LEN;
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
const ptr2 = passArrayJsValueToWasm0(
|
|
2609
|
+
const ptr1 = passArrayJsValueToWasm0(installations, wasm.__wbindgen_malloc);
|
|
2610
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2611
|
+
const ptr2 = passArrayJsValueToWasm0(account_identifiers, wasm.__wbindgen_malloc);
|
|
2718
2612
|
const len2 = WASM_VECTOR_LEN;
|
|
2719
|
-
const
|
|
2720
|
-
const len3 = WASM_VECTOR_LEN;
|
|
2721
|
-
const ret = wasm.inboxstate_new(ptr0, len0, ptr1, ptr2, len2, ptr3, len3);
|
|
2613
|
+
const ret = wasm.inboxstate_new(ptr0, len0, recovery_identifier, ptr1, len1, ptr2, len2);
|
|
2722
2614
|
this.__wbg_ptr = ret >>> 0;
|
|
2723
2615
|
InboxStateFinalization.register(this, this.__wbg_ptr, this);
|
|
2724
2616
|
return this;
|
|
@@ -2995,7 +2887,7 @@ export class ListConversationsOptions {
|
|
|
2995
2887
|
* @param {bigint | null} [arg0]
|
|
2996
2888
|
*/
|
|
2997
2889
|
set createdAfterNs(arg0) {
|
|
2998
|
-
wasm.
|
|
2890
|
+
wasm.__wbg_set_listconversationsoptions_createdAfterNs(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? BigInt(0) : arg0);
|
|
2999
2891
|
}
|
|
3000
2892
|
/**
|
|
3001
2893
|
* @returns {bigint | undefined}
|
|
@@ -3101,7 +2993,7 @@ export class ListMessagesOptions {
|
|
|
3101
2993
|
* @param {bigint | null} [arg0]
|
|
3102
2994
|
*/
|
|
3103
2995
|
set sentBeforeNs(arg0) {
|
|
3104
|
-
wasm.
|
|
2996
|
+
wasm.__wbg_set_listconversationsoptions_createdAfterNs(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? BigInt(0) : arg0);
|
|
3105
2997
|
}
|
|
3106
2998
|
/**
|
|
3107
2999
|
* @returns {bigint | undefined}
|
|
@@ -4371,7 +4263,7 @@ function __wbg_get_imports() {
|
|
|
4371
4263
|
const a = state0.a;
|
|
4372
4264
|
state0.a = 0;
|
|
4373
4265
|
try {
|
|
4374
|
-
return
|
|
4266
|
+
return __wbg_adapter_585(a, state0.b, arg0, arg1, arg2);
|
|
4375
4267
|
} finally {
|
|
4376
4268
|
state0.a = a;
|
|
4377
4269
|
}
|
|
@@ -4401,7 +4293,7 @@ function __wbg_get_imports() {
|
|
|
4401
4293
|
const a = state0.a;
|
|
4402
4294
|
state0.a = 0;
|
|
4403
4295
|
try {
|
|
4404
|
-
return
|
|
4296
|
+
return __wbg_adapter_585(a, state0.b, arg0, arg1, arg2);
|
|
4405
4297
|
} finally {
|
|
4406
4298
|
state0.a = a;
|
|
4407
4299
|
}
|
|
@@ -4510,6 +4402,10 @@ function __wbg_get_imports() {
|
|
|
4510
4402
|
const ret = arg0.value;
|
|
4511
4403
|
return ret;
|
|
4512
4404
|
};
|
|
4405
|
+
imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
|
|
4406
|
+
const ret = arg0[arg1];
|
|
4407
|
+
return ret;
|
|
4408
|
+
};
|
|
4513
4409
|
imports.wbg.__wbg_groupmetadata_new = function(arg0) {
|
|
4514
4410
|
const ret = GroupMetadata.__wrap(arg0);
|
|
4515
4411
|
return ret;
|
|
@@ -4526,14 +4422,6 @@ function __wbg_get_imports() {
|
|
|
4526
4422
|
const ret = arg0.headers;
|
|
4527
4423
|
return ret;
|
|
4528
4424
|
};
|
|
4529
|
-
imports.wbg.__wbg_identifier_new = function(arg0) {
|
|
4530
|
-
const ret = Identifier.__wrap(arg0);
|
|
4531
|
-
return ret;
|
|
4532
|
-
};
|
|
4533
|
-
imports.wbg.__wbg_identifier_unwrap = function(arg0) {
|
|
4534
|
-
const ret = Identifier.__unwrap(arg0);
|
|
4535
|
-
return ret;
|
|
4536
|
-
};
|
|
4537
4425
|
imports.wbg.__wbg_inboxstate_new = function(arg0) {
|
|
4538
4426
|
const ret = InboxState.__wrap(arg0);
|
|
4539
4427
|
return ret;
|
|
@@ -4693,7 +4581,7 @@ function __wbg_get_imports() {
|
|
|
4693
4581
|
const a = state0.a;
|
|
4694
4582
|
state0.a = 0;
|
|
4695
4583
|
try {
|
|
4696
|
-
return
|
|
4584
|
+
return __wbg_adapter_686(a, state0.b, arg0, arg1);
|
|
4697
4585
|
} finally {
|
|
4698
4586
|
state0.a = a;
|
|
4699
4587
|
}
|
|
@@ -5092,12 +4980,12 @@ function __wbg_get_imports() {
|
|
|
5092
4980
|
const ret = false;
|
|
5093
4981
|
return ret;
|
|
5094
4982
|
};
|
|
5095
|
-
imports.wbg.
|
|
5096
|
-
const ret = makeMutClosure(arg0, arg1, 3682,
|
|
4983
|
+
imports.wbg.__wbindgen_closure_wrapper16206 = function(arg0, arg1, arg2) {
|
|
4984
|
+
const ret = makeMutClosure(arg0, arg1, 3682, __wbg_adapter_48);
|
|
5097
4985
|
return ret;
|
|
5098
4986
|
};
|
|
5099
|
-
imports.wbg.
|
|
5100
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
4987
|
+
imports.wbg.__wbindgen_closure_wrapper16502 = function(arg0, arg1, arg2) {
|
|
4988
|
+
const ret = makeMutClosure(arg0, arg1, 3754, __wbg_adapter_51);
|
|
5101
4989
|
return ret;
|
|
5102
4990
|
};
|
|
5103
4991
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
@@ -5111,6 +4999,10 @@ function __wbg_get_imports() {
|
|
|
5111
4999
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
5112
5000
|
return ret;
|
|
5113
5001
|
};
|
|
5002
|
+
imports.wbg.__wbindgen_in = function(arg0, arg1) {
|
|
5003
|
+
const ret = arg0 in arg1;
|
|
5004
|
+
return ret;
|
|
5005
|
+
};
|
|
5114
5006
|
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
5115
5007
|
const table = wasm.__wbindgen_export_4;
|
|
5116
5008
|
const offset = table.grow(4);
|