@siafoundation/sia-storage 0.0.14 → 0.1.1

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.
@@ -114,6 +114,22 @@ export class Builder {
114
114
  const ptr = this.__destroy_into_raw();
115
115
  wasm.__wbg_builder_free(ptr, 0);
116
116
  }
117
+ /**
118
+ * Connects using a pre-authorized key, bypassing the interactive approval
119
+ * flow, and returns a Sdk. `preAuthorizedKeySeed` is the 32-byte
120
+ * pre-authorized private key (Uint8Array); `mnemonic` derives the app key.
121
+ * @param {Uint8Array} pre_authorized_key_seed
122
+ * @param {string} mnemonic
123
+ * @returns {Promise<Sdk>}
124
+ */
125
+ connectPreAuthorized(pre_authorized_key_seed, mnemonic) {
126
+ const ptr0 = passArray8ToWasm0(pre_authorized_key_seed, wasm.__wbindgen_malloc);
127
+ const len0 = WASM_VECTOR_LEN;
128
+ const ptr1 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
129
+ const len1 = WASM_VECTOR_LEN;
130
+ const ret = wasm.builder_connectPreAuthorized(this.__wbg_ptr, ptr0, len0, ptr1, len1);
131
+ return ret;
132
+ }
117
133
  /**
118
134
  * Attempts to connect using an existing AppKey.
119
135
  * Returns a Sdk if the key is valid, or undefined if not registered.
@@ -125,6 +141,19 @@ export class Builder {
125
141
  const ret = wasm.builder_connected(this.__wbg_ptr, app_key.__wbg_ptr);
126
142
  return ret;
127
143
  }
144
+ /**
145
+ * Returns whether `mnemonic` derives an application key that is already
146
+ * registered with the indexer. Unlike `register`, the builder remains
147
+ * usable. Only valid after `waitForApproval` has resolved.
148
+ * @param {string} mnemonic
149
+ * @returns {Promise<boolean>}
150
+ */
151
+ matchesExistingAppKey(mnemonic) {
152
+ const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
153
+ const len0 = WASM_VECTOR_LEN;
154
+ const ret = wasm.builder_matchesExistingAppKey(this.__wbg_ptr, ptr0, len0);
155
+ return ret;
156
+ }
128
157
  /**
129
158
  * @param {string} indexer_url
130
159
  * @param {AppMetadata} app
@@ -140,8 +169,27 @@ export class Builder {
140
169
  BuilderFinalization.register(this, this.__wbg_ptr, this);
141
170
  return this;
142
171
  }
172
+ /**
173
+ * Returns whether the connect key the user approved with already has an
174
+ * account for this application. Only valid after `waitForApproval` has
175
+ * resolved.
176
+ *
177
+ * The connect key may have accounts under more than one recovery phrase.
178
+ * Use `matchesExistingAppKey` to check a particular phrase.
179
+ * @returns {boolean}
180
+ */
181
+ reconnecting() {
182
+ const ret = wasm.builder_reconnecting(this.__wbg_ptr);
183
+ if (ret[2]) {
184
+ throw takeFromExternrefTable0(ret[1]);
185
+ }
186
+ return ret[0] !== 0;
187
+ }
143
188
  /**
144
189
  * Completes registration and returns a Sdk instance.
190
+ *
191
+ * A different recovery phrase registers a new application key even when
192
+ * `reconnecting()` is true.
145
193
  * @param {string} mnemonic
146
194
  * @returns {Promise<Sdk>}
147
195
  */
@@ -309,6 +357,66 @@ export class IntoUnderlyingSource {
309
357
  }
310
358
  if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
311
359
 
360
+ /**
361
+ * The indexer's record for a sharing key, including how many objects it grants
362
+ * access to and how much space they use. The counts are a snapshot, not a live
363
+ * view.
364
+ */
365
+ export class KeyRecord {
366
+ static __wrap(ptr) {
367
+ const obj = Object.create(KeyRecord.prototype);
368
+ obj.__wbg_ptr = ptr;
369
+ KeyRecordFinalization.register(obj, obj.__wbg_ptr, obj);
370
+ return obj;
371
+ }
372
+ __destroy_into_raw() {
373
+ const ptr = this.__wbg_ptr;
374
+ this.__wbg_ptr = 0;
375
+ KeyRecordFinalization.unregister(this);
376
+ return ptr;
377
+ }
378
+ free() {
379
+ const ptr = this.__destroy_into_raw();
380
+ wasm.__wbg_keyrecord_free(ptr, 0);
381
+ }
382
+ /**
383
+ * @returns {string}
384
+ */
385
+ get description() {
386
+ let deferred1_0;
387
+ let deferred1_1;
388
+ try {
389
+ const ret = wasm.keyrecord_description(this.__wbg_ptr);
390
+ deferred1_0 = ret[0];
391
+ deferred1_1 = ret[1];
392
+ return getStringFromWasm0(ret[0], ret[1]);
393
+ } finally {
394
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
395
+ }
396
+ }
397
+ /**
398
+ * The key this record describes.
399
+ * @returns {SharingKey}
400
+ */
401
+ get key() {
402
+ const ret = wasm.keyrecord_key(this.__wbg_ptr);
403
+ return SharingKey.__wrap(ret);
404
+ }
405
+ /**
406
+ * A snapshot of how many objects the key grants access to and how much
407
+ * space they use.
408
+ * @returns {KeyStats}
409
+ */
410
+ get stats() {
411
+ const ret = wasm.keyrecord_stats(this.__wbg_ptr);
412
+ if (ret[2]) {
413
+ throw takeFromExternrefTable0(ret[1]);
414
+ }
415
+ return takeFromExternrefTable0(ret[0]);
416
+ }
417
+ }
418
+ if (Symbol.dispose) KeyRecord.prototype[Symbol.dispose] = KeyRecord.prototype.free;
419
+
312
420
  /**
313
421
  * An object event from the indexer.
314
422
  */
@@ -573,7 +681,10 @@ export class PinnedObject {
573
681
  seal(app_key) {
574
682
  _assertClass(app_key, AppKey);
575
683
  const ret = wasm.pinnedobject_seal(this.__wbg_ptr, app_key.__wbg_ptr);
576
- return ret;
684
+ if (ret[2]) {
685
+ throw takeFromExternrefTable0(ret[1]);
686
+ }
687
+ return takeFromExternrefTable0(ret[0]);
577
688
  }
578
689
  /**
579
690
  * Returns the total size of the object in bytes.
@@ -594,6 +705,15 @@ export class PinnedObject {
594
705
  }
595
706
  return takeFromExternrefTable0(ret[0]);
596
707
  }
708
+ /**
709
+ * Returns a new object truncated to the requested length.
710
+ * @param {bigint} length
711
+ * @returns {PinnedObject}
712
+ */
713
+ truncate(length) {
714
+ const ret = wasm.pinnedobject_truncate(this.__wbg_ptr, length);
715
+ return PinnedObject.__wrap(ret);
716
+ }
597
717
  /**
598
718
  * Updates the object's metadata.
599
719
  * @param {Uint8Array} metadata
@@ -651,6 +771,18 @@ export class Sdk {
651
771
  const ret = wasm.sdk_appKey(this.__wbg_ptr);
652
772
  return AppKey.__wrap(ret);
653
773
  }
774
+ /**
775
+ * Creates a sharing key. Attach objects to it with `Sdk.shareObject`.
776
+ * @param {string} description
777
+ * @param {Date | null} [expires_at]
778
+ * @returns {Promise<SharingKey>}
779
+ */
780
+ createSharingKey(description, expires_at) {
781
+ const ptr0 = passStringToWasm0(description, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
782
+ const len0 = WASM_VECTOR_LEN;
783
+ const ret = wasm.sdk_createSharingKey(this.__wbg_ptr, ptr0, len0, isLikeNone(expires_at) ? 0 : addToExternrefTable0(expires_at));
784
+ return ret;
785
+ }
654
786
  /**
655
787
  * Deletes an object from the indexer by its hex ID.
656
788
  * @param {string} key_hex
@@ -719,21 +851,16 @@ export class Sdk {
719
851
  return ret;
720
852
  }
721
853
  /**
722
- * Pins an object to the indexer so it persists beyond temporary storage.
723
- * @param {PinnedObject} object
724
- * @returns {Promise<void>}
725
- */
726
- pinObject(object) {
727
- _assertClass(object, PinnedObject);
728
- const ret = wasm.sdk_pinObject(this.__wbg_ptr, object.__wbg_ptr);
729
- return ret;
730
- }
731
- /**
732
- * Prunes unused slabs from the indexer.
733
- * @returns {Promise<void>}
854
+ * Resolves a share URL (sia://...) and returns the shared object.
855
+ * The encryption key is extracted from the URL fragment (never sent
856
+ * to the indexer).
857
+ * @param {string} share_url
858
+ * @returns {Promise<PinnedObject>}
734
859
  */
735
- pruneSlabs() {
736
- const ret = wasm.sdk_pruneSlabs(this.__wbg_ptr);
860
+ objectFromShareUrl(share_url) {
861
+ const ptr0 = passStringToWasm0(share_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
862
+ const len0 = WASM_VECTOR_LEN;
863
+ const ret = wasm.sdk_objectFromShareUrl(this.__wbg_ptr, ptr0, len0);
737
864
  return ret;
738
865
  }
739
866
  /**
@@ -743,12 +870,12 @@ export class Sdk {
743
870
  * @param {Date} valid_until
744
871
  * @returns {string}
745
872
  */
746
- shareObject(object, valid_until) {
873
+ objectShareUrl(object, valid_until) {
747
874
  let deferred2_0;
748
875
  let deferred2_1;
749
876
  try {
750
877
  _assertClass(object, PinnedObject);
751
- const ret = wasm.sdk_shareObject(this.__wbg_ptr, object.__wbg_ptr, valid_until);
878
+ const ret = wasm.sdk_objectShareUrl(this.__wbg_ptr, object.__wbg_ptr, valid_until);
752
879
  var ptr1 = ret[0];
753
880
  var len1 = ret[1];
754
881
  if (ret[3]) {
@@ -763,16 +890,79 @@ export class Sdk {
763
890
  }
764
891
  }
765
892
  /**
766
- * Resolves a share URL (sia://...) and returns the shared object.
767
- * The encryption key is extracted from the URL fragment (never sent
768
- * to the indexer).
769
- * @param {string} share_url
770
- * @returns {Promise<PinnedObject>}
893
+ * Pins an object to the indexer so it persists beyond temporary storage.
894
+ * @param {PinnedObject} object
895
+ * @returns {Promise<void>}
771
896
  */
772
- sharedObject(share_url) {
773
- const ptr0 = passStringToWasm0(share_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
774
- const len0 = WASM_VECTOR_LEN;
775
- const ret = wasm.sdk_sharedObject(this.__wbg_ptr, ptr0, len0);
897
+ pinObject(object) {
898
+ _assertClass(object, PinnedObject);
899
+ const ret = wasm.sdk_pinObject(this.__wbg_ptr, object.__wbg_ptr);
900
+ return ret;
901
+ }
902
+ /**
903
+ * Prunes unused slabs from the indexer.
904
+ * @returns {Promise<void>}
905
+ */
906
+ pruneSlabs() {
907
+ const ret = wasm.sdk_pruneSlabs(this.__wbg_ptr);
908
+ return ret;
909
+ }
910
+ /**
911
+ * Deletes a sharing key along with all of its attachments, revoking
912
+ * recipients' access. Account tokens already issued stay valid until they
913
+ * expire, so a download in flight can keep reading for up to five minutes.
914
+ * @param {SharingKey} key
915
+ * @returns {Promise<void>}
916
+ */
917
+ revokeSharingKey(key) {
918
+ _assertClass(key, SharingKey);
919
+ const ret = wasm.sdk_revokeSharingKey(this.__wbg_ptr, key.__wbg_ptr);
920
+ return ret;
921
+ }
922
+ /**
923
+ * Attaches an object to a sharing key, re-sealing its encryption keys under
924
+ * the key so recipients can decrypt it. Attaching an already-attached
925
+ * object replaces its re-sealed keys, so a failed call can be retried.
926
+ * @param {SharingKey} key
927
+ * @param {PinnedObject} object
928
+ * @returns {Promise<void>}
929
+ */
930
+ shareObject(key, object) {
931
+ _assertClass(key, SharingKey);
932
+ _assertClass(object, PinnedObject);
933
+ const ret = wasm.sdk_shareObject(this.__wbg_ptr, key.__wbg_ptr, object.__wbg_ptr);
934
+ return ret;
935
+ }
936
+ /**
937
+ * Lists and decrypts a page of the objects a sharing key grants access to.
938
+ * @param {SharingKey} key
939
+ * @param {number} offset
940
+ * @param {number} limit
941
+ * @returns {Promise<PinnedObject[]>}
942
+ */
943
+ sharedObjects(key, offset, limit) {
944
+ _assertClass(key, SharingKey);
945
+ const ret = wasm.sdk_sharedObjects(this.__wbg_ptr, key.__wbg_ptr, offset, limit);
946
+ return ret;
947
+ }
948
+ /**
949
+ * Fetches the indexer's record for a key, including its counts.
950
+ * @param {SharingKey} key
951
+ * @returns {Promise<KeyRecord>}
952
+ */
953
+ sharingKey(key) {
954
+ _assertClass(key, SharingKey);
955
+ const ret = wasm.sdk_sharingKey(this.__wbg_ptr, key.__wbg_ptr);
956
+ return ret;
957
+ }
958
+ /**
959
+ * Lists the account's sharing keys, most recently created first.
960
+ * @param {number} offset
961
+ * @param {number} limit
962
+ * @returns {Promise<KeyRecord[]>}
963
+ */
964
+ sharingKeys(offset, limit) {
965
+ const ret = wasm.sdk_sharingKeys(this.__wbg_ptr, offset, limit);
776
966
  return ret;
777
967
  }
778
968
  /**
@@ -786,6 +976,20 @@ export class Sdk {
786
976
  const ret = wasm.sdk_slab(this.__wbg_ptr, ptr0, len0);
787
977
  return ret;
788
978
  }
979
+ /**
980
+ * Detaches an object from a sharing key, leaving the key and its other
981
+ * attachments in place.
982
+ * @param {SharingKey} key
983
+ * @param {string} id
984
+ * @returns {Promise<void>}
985
+ */
986
+ unshareObject(key, id) {
987
+ _assertClass(key, SharingKey);
988
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
989
+ const len0 = WASM_VECTOR_LEN;
990
+ const ret = wasm.sdk_unshareObject(this.__wbg_ptr, key.__wbg_ptr, ptr0, len0);
991
+ return ret;
992
+ }
789
993
  /**
790
994
  * Updates an object's metadata on the indexer.
791
995
  * @param {PinnedObject} object
@@ -836,6 +1040,177 @@ export class Sdk {
836
1040
  }
837
1041
  if (Symbol.dispose) Sdk.prototype[Symbol.dispose] = Sdk.prototype.free;
838
1042
 
1043
+ /**
1044
+ * A read-only SDK for the objects a sharing key grants access to.
1045
+ *
1046
+ * Unlike `Sdk`, it authenticates with a sharing key rather than an app key and
1047
+ * cannot upload, pin, or delete. Downloads are paid for by the key's owner.
1048
+ */
1049
+ export class SharedSdk {
1050
+ static __wrap(ptr) {
1051
+ const obj = Object.create(SharedSdk.prototype);
1052
+ obj.__wbg_ptr = ptr;
1053
+ SharedSdkFinalization.register(obj, obj.__wbg_ptr, obj);
1054
+ return obj;
1055
+ }
1056
+ __destroy_into_raw() {
1057
+ const ptr = this.__wbg_ptr;
1058
+ this.__wbg_ptr = 0;
1059
+ SharedSdkFinalization.unregister(this);
1060
+ return ptr;
1061
+ }
1062
+ free() {
1063
+ const ptr = this.__destroy_into_raw();
1064
+ wasm.__wbg_sharedsdk_free(ptr, 0);
1065
+ }
1066
+ /**
1067
+ * Connects to `indexerUrl` as the recipient of the sharing key derived
1068
+ * from `seed`, which is the hex string the key's owner handed out.
1069
+ * @param {string} indexer_url
1070
+ * @param {string} seed
1071
+ * @returns {Promise<SharedSdk>}
1072
+ */
1073
+ static connect(indexer_url, seed) {
1074
+ const ptr0 = passStringToWasm0(indexer_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1075
+ const len0 = WASM_VECTOR_LEN;
1076
+ const ptr1 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1077
+ const len1 = WASM_VECTOR_LEN;
1078
+ const ret = wasm.sharedsdk_connect(ptr0, len0, ptr1, len1);
1079
+ return ret;
1080
+ }
1081
+ /**
1082
+ * Streams a shared object's data.
1083
+ * @param {PinnedObject} object
1084
+ * @param {any | null} [options]
1085
+ * @returns {ReadableStream}
1086
+ */
1087
+ download(object, options) {
1088
+ _assertClass(object, PinnedObject);
1089
+ const ret = wasm.sharedsdk_download(this.__wbg_ptr, object.__wbg_ptr, isLikeNone(options) ? 0 : addToExternrefTable0(options));
1090
+ if (ret[2]) {
1091
+ throw takeFromExternrefTable0(ret[1]);
1092
+ }
1093
+ return takeFromExternrefTable0(ret[0]);
1094
+ }
1095
+ /**
1096
+ * Returns the hosts serving this key's objects, optionally filtered by a
1097
+ * HostQuery. Mirrors `Sdk.hosts()` but is scoped to the sharing key, so the
1098
+ * set is already limited to hosts holding its objects.
1099
+ * @param {HostQuery | null} [query]
1100
+ * @returns {Host[]}
1101
+ */
1102
+ hosts(query) {
1103
+ const ret = wasm.sharedsdk_hosts(this.__wbg_ptr, isLikeNone(query) ? 0 : addToExternrefTable0(query));
1104
+ return ret;
1105
+ }
1106
+ /**
1107
+ * Fetches and decrypts one object the key grants access to.
1108
+ * @param {string} id
1109
+ * @returns {Promise<PinnedObject>}
1110
+ */
1111
+ object(id) {
1112
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1113
+ const len0 = WASM_VECTOR_LEN;
1114
+ const ret = wasm.sharedsdk_object(this.__wbg_ptr, ptr0, len0);
1115
+ return ret;
1116
+ }
1117
+ /**
1118
+ * Lists and decrypts a page of the objects the key grants access to.
1119
+ * @param {number} offset
1120
+ * @param {number} limit
1121
+ * @returns {Promise<PinnedObject[]>}
1122
+ */
1123
+ objects(offset, limit) {
1124
+ const ret = wasm.sharedsdk_objects(this.__wbg_ptr, offset, limit);
1125
+ return ret;
1126
+ }
1127
+ /**
1128
+ * Fetches the sharing key's stats from the indexer.
1129
+ * @returns {Promise<KeyStats>}
1130
+ */
1131
+ stats() {
1132
+ const ret = wasm.sharedsdk_stats(this.__wbg_ptr);
1133
+ return ret;
1134
+ }
1135
+ }
1136
+ if (Symbol.dispose) SharedSdk.prototype[Symbol.dispose] = SharedSdk.prototype.free;
1137
+
1138
+ /**
1139
+ * A sharing key, granting read-only access to the objects attached to it.
1140
+ *
1141
+ * It is just the credential; the operations that use it live on `Sdk`.
1142
+ */
1143
+ export class SharingKey {
1144
+ static __wrap(ptr) {
1145
+ const obj = Object.create(SharingKey.prototype);
1146
+ obj.__wbg_ptr = ptr;
1147
+ SharingKeyFinalization.register(obj, obj.__wbg_ptr, obj);
1148
+ return obj;
1149
+ }
1150
+ __destroy_into_raw() {
1151
+ const ptr = this.__wbg_ptr;
1152
+ this.__wbg_ptr = 0;
1153
+ SharingKeyFinalization.unregister(this);
1154
+ return ptr;
1155
+ }
1156
+ free() {
1157
+ const ptr = this.__destroy_into_raw();
1158
+ wasm.__wbg_sharingkey_free(ptr, 0);
1159
+ }
1160
+ /**
1161
+ * Imports a sharing key from the hex seed its owner handed out.
1162
+ *
1163
+ * Pass the string returned by [seed](Self::seed).
1164
+ * @param {string} seed
1165
+ * @returns {SharingKey}
1166
+ */
1167
+ static fromSeed(seed) {
1168
+ const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1169
+ const len0 = WASM_VECTOR_LEN;
1170
+ const ret = wasm.sharingkey_fromSeed(ptr0, len0);
1171
+ if (ret[2]) {
1172
+ throw takeFromExternrefTable0(ret[1]);
1173
+ }
1174
+ return SharingKey.__wrap(ret[0]);
1175
+ }
1176
+ /**
1177
+ * The key's public half, which identifies it.
1178
+ * @returns {string}
1179
+ */
1180
+ get publicKey() {
1181
+ let deferred1_0;
1182
+ let deferred1_1;
1183
+ try {
1184
+ const ret = wasm.sharingkey_publicKey(this.__wbg_ptr);
1185
+ deferred1_0 = ret[0];
1186
+ deferred1_1 = ret[1];
1187
+ return getStringFromWasm0(ret[0], ret[1]);
1188
+ } finally {
1189
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1190
+ }
1191
+ }
1192
+ /**
1193
+ * Returns the seed a recipient needs to read the key's objects, as hex.
1194
+ *
1195
+ * It is the whole credential. Pair it with the indexer's url in
1196
+ * `SharedSdk.connect`.
1197
+ * @returns {string}
1198
+ */
1199
+ seed() {
1200
+ let deferred1_0;
1201
+ let deferred1_1;
1202
+ try {
1203
+ const ret = wasm.sharingkey_seed(this.__wbg_ptr);
1204
+ deferred1_0 = ret[0];
1205
+ deferred1_1 = ret[1];
1206
+ return getStringFromWasm0(ret[0], ret[1]);
1207
+ } finally {
1208
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1209
+ }
1210
+ }
1211
+ }
1212
+ if (Symbol.dispose) SharingKey.prototype[Symbol.dispose] = SharingKey.prototype.free;
1213
+
839
1214
  /**
840
1215
  * Calculates the encoded size of data after erasure coding.
841
1216
  * @param {number} data_size
@@ -1065,11 +1440,11 @@ function __wbg_get_imports() {
1065
1440
  const ret = arg0.createBidirectionalStream();
1066
1441
  return ret;
1067
1442
  },
1068
- __wbg_done_4ead556d01fd3011: function(arg0) {
1443
+ __wbg_done_89b2b13e91a60321: function(arg0) {
1069
1444
  const ret = arg0.done;
1070
1445
  return ret;
1071
1446
  },
1072
- __wbg_done_89b2b13e91a60321: function(arg0) {
1447
+ __wbg_done_c68bf4f8d2d475af: function(arg0) {
1073
1448
  const ret = arg0.done;
1074
1449
  return ret;
1075
1450
  },
@@ -1212,6 +1587,10 @@ function __wbg_get_imports() {
1212
1587
  const ret = Symbol.iterator;
1213
1588
  return ret;
1214
1589
  },
1590
+ __wbg_keyrecord_new: function(arg0) {
1591
+ const ret = KeyRecord.__wrap(arg0);
1592
+ return ret;
1593
+ },
1215
1594
  __wbg_length_1f0964f4a5e2c6d8: function(arg0) {
1216
1595
  const ret = arg0.length;
1217
1596
  return ret;
@@ -1251,7 +1630,7 @@ function __wbg_get_imports() {
1251
1630
  const a = state0.a;
1252
1631
  state0.a = 0;
1253
1632
  try {
1254
- return wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___js_sys_2b0a4a9337300fde___Function_fn_wasm_bindgen_94d9ab53edc6bea3___JsValue_____wasm_bindgen_94d9ab53edc6bea3___sys__Undefined___js_sys_2b0a4a9337300fde___Function_fn_wasm_bindgen_94d9ab53edc6bea3___JsValue_____wasm_bindgen_94d9ab53edc6bea3___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1633
+ return wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___js_sys_bdd470c3fe1f6d69___Function_fn_wasm_bindgen_baa1b51bcdcd1a91___JsValue_____wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined___js_sys_bdd470c3fe1f6d69___Function_fn_wasm_bindgen_baa1b51bcdcd1a91___JsValue_____wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1255
1634
  } finally {
1256
1635
  state0.a = a;
1257
1636
  }
@@ -1289,7 +1668,7 @@ function __wbg_get_imports() {
1289
1668
  const a = state0.a;
1290
1669
  state0.a = 0;
1291
1670
  try {
1292
- return wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___js_sys_2b0a4a9337300fde___Function_fn_wasm_bindgen_94d9ab53edc6bea3___JsValue_____wasm_bindgen_94d9ab53edc6bea3___sys__Undefined___js_sys_2b0a4a9337300fde___Function_fn_wasm_bindgen_94d9ab53edc6bea3___JsValue_____wasm_bindgen_94d9ab53edc6bea3___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1671
+ return wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___js_sys_bdd470c3fe1f6d69___Function_fn_wasm_bindgen_baa1b51bcdcd1a91___JsValue_____wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined___js_sys_bdd470c3fe1f6d69___Function_fn_wasm_bindgen_baa1b51bcdcd1a91___JsValue_____wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1293
1672
  } finally {
1294
1673
  state0.a = a;
1295
1674
  }
@@ -1424,6 +1803,14 @@ function __wbg_get_imports() {
1424
1803
  __wbg_set_signal_c4ef8faddb4c1446: function(arg0, arg1) {
1425
1804
  arg0.signal = arg1;
1426
1805
  },
1806
+ __wbg_sharedsdk_new: function(arg0) {
1807
+ const ret = SharedSdk.__wrap(arg0);
1808
+ return ret;
1809
+ },
1810
+ __wbg_sharingkey_new: function(arg0) {
1811
+ const ret = SharingKey.__wrap(arg0);
1812
+ return ret;
1813
+ },
1427
1814
  __wbg_signal_dad7cb35193abd31: function(arg0) {
1428
1815
  const ret = arg0.signal;
1429
1816
  return ret;
@@ -1486,11 +1873,11 @@ function __wbg_get_imports() {
1486
1873
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1487
1874
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1488
1875
  },
1489
- __wbg_value_a5d5488a9589444a: function(arg0) {
1876
+ __wbg_value_707a9727a4e0b640: function(arg0) {
1490
1877
  const ret = arg0.value;
1491
1878
  return ret;
1492
1879
  },
1493
- __wbg_value_da5243f0032ab973: function(arg0) {
1880
+ __wbg_value_a5d5488a9589444a: function(arg0) {
1494
1881
  const ret = arg0.value;
1495
1882
  return ret;
1496
1883
  },
@@ -1507,33 +1894,33 @@ function __wbg_get_imports() {
1507
1894
  return ret;
1508
1895
  },
1509
1896
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1510
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 395, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1511
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___JsValue______true_);
1897
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1058, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1898
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true_);
1512
1899
  return ret;
1513
1900
  },
1514
1901
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
1515
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 446, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1516
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true_);
1902
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 525, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1903
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___JsValue______true_);
1517
1904
  return ret;
1518
1905
  },
1519
1906
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
1520
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 916, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1521
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true_);
1907
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 581, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1908
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true_);
1522
1909
  return ret;
1523
1910
  },
1524
1911
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
1525
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("WebTransportBidirectionalStream")], shim_idx: 446, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1526
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true__3);
1912
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("WebTransportBidirectionalStream")], shim_idx: 581, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1913
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true__3);
1527
1914
  return ret;
1528
1915
  },
1529
1916
  __wbindgen_cast_0000000000000005: function(arg0, arg1) {
1530
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 446, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1531
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true__4);
1917
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 581, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1918
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true__4);
1532
1919
  return ret;
1533
1920
  },
1534
1921
  __wbindgen_cast_0000000000000006: function(arg0, arg1) {
1535
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 729, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1536
- const ret = makeMutClosure(arg0, arg1, wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke_______true_);
1922
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 870, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1923
+ const ret = makeMutClosure(arg0, arg1, wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke_______true_);
1537
1924
  return ret;
1538
1925
  },
1539
1926
  __wbindgen_cast_0000000000000007: function(arg0) {
@@ -1554,11 +1941,18 @@ function __wbg_get_imports() {
1554
1941
  __wbindgen_cast_000000000000000a: function(arg0, arg1) {
1555
1942
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
1556
1943
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
1557
- // Cast intrinsic for `Vector(NamedExternref("ObjectEvent")) -> Externref`.
1944
+ // Cast intrinsic for `Vector(NamedExternref("KeyRecord")) -> Externref`.
1558
1945
  const ret = v0;
1559
1946
  return ret;
1560
1947
  },
1561
1948
  __wbindgen_cast_000000000000000b: function(arg0, arg1) {
1949
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
1950
+ wasm.__wbindgen_free(arg0, arg1 * 4, 4);
1951
+ // Cast intrinsic for `Vector(NamedExternref("ObjectEvent")) -> Externref`.
1952
+ const ret = v0;
1953
+ return ret;
1954
+ },
1955
+ __wbindgen_cast_000000000000000c: function(arg0, arg1) {
1562
1956
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
1563
1957
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
1564
1958
  // Cast intrinsic for `Vector(NamedExternref("PinnedObject")) -> Externref`.
@@ -1581,44 +1975,44 @@ function __wbg_get_imports() {
1581
1975
  };
1582
1976
  }
1583
1977
 
1584
- function wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke_______true_(arg0, arg1) {
1585
- wasm.wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke_______true_(arg0, arg1);
1978
+ function wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke_______true_(arg0, arg1) {
1979
+ wasm.wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke_______true_(arg0, arg1);
1586
1980
  }
1587
1981
 
1588
- function wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___JsValue______true_(arg0, arg1, arg2) {
1589
- wasm.wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___JsValue______true_(arg0, arg1, arg2);
1982
+ function wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___JsValue______true_(arg0, arg1, arg2) {
1983
+ wasm.wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___JsValue______true_(arg0, arg1, arg2);
1590
1984
  }
1591
1985
 
1592
- function wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true_(arg0, arg1, arg2) {
1593
- const ret = wasm.wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true_(arg0, arg1, arg2);
1986
+ function wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true_(arg0, arg1, arg2) {
1987
+ const ret = wasm.wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true_(arg0, arg1, arg2);
1594
1988
  if (ret[1]) {
1595
1989
  throw takeFromExternrefTable0(ret[0]);
1596
1990
  }
1597
1991
  }
1598
1992
 
1599
- function wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true_(arg0, arg1, arg2) {
1600
- const ret = wasm.wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true_(arg0, arg1, arg2);
1993
+ function wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true_(arg0, arg1, arg2) {
1994
+ const ret = wasm.wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true_(arg0, arg1, arg2);
1601
1995
  if (ret[1]) {
1602
1996
  throw takeFromExternrefTable0(ret[0]);
1603
1997
  }
1604
1998
  }
1605
1999
 
1606
- function wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true__3(arg0, arg1, arg2) {
1607
- const ret = wasm.wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true__3(arg0, arg1, arg2);
2000
+ function wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true__3(arg0, arg1, arg2) {
2001
+ const ret = wasm.wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true__3(arg0, arg1, arg2);
1608
2002
  if (ret[1]) {
1609
2003
  throw takeFromExternrefTable0(ret[0]);
1610
2004
  }
1611
2005
  }
1612
2006
 
1613
- function wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true__4(arg0, arg1, arg2) {
1614
- const ret = wasm.wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___wasm_bindgen_94d9ab53edc6bea3___sys__Undefined__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_94d9ab53edc6bea3___JsError___true__4(arg0, arg1, arg2);
2007
+ function wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true__4(arg0, arg1, arg2) {
2008
+ const ret = wasm.wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_baa1b51bcdcd1a91___JsError___true__4(arg0, arg1, arg2);
1615
2009
  if (ret[1]) {
1616
2010
  throw takeFromExternrefTable0(ret[0]);
1617
2011
  }
1618
2012
  }
1619
2013
 
1620
- function wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___js_sys_2b0a4a9337300fde___Function_fn_wasm_bindgen_94d9ab53edc6bea3___JsValue_____wasm_bindgen_94d9ab53edc6bea3___sys__Undefined___js_sys_2b0a4a9337300fde___Function_fn_wasm_bindgen_94d9ab53edc6bea3___JsValue_____wasm_bindgen_94d9ab53edc6bea3___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
1621
- wasm.wasm_bindgen_94d9ab53edc6bea3___convert__closures_____invoke___js_sys_2b0a4a9337300fde___Function_fn_wasm_bindgen_94d9ab53edc6bea3___JsValue_____wasm_bindgen_94d9ab53edc6bea3___sys__Undefined___js_sys_2b0a4a9337300fde___Function_fn_wasm_bindgen_94d9ab53edc6bea3___JsValue_____wasm_bindgen_94d9ab53edc6bea3___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
2014
+ function wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___js_sys_bdd470c3fe1f6d69___Function_fn_wasm_bindgen_baa1b51bcdcd1a91___JsValue_____wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined___js_sys_bdd470c3fe1f6d69___Function_fn_wasm_bindgen_baa1b51bcdcd1a91___JsValue_____wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
2015
+ wasm.wasm_bindgen_baa1b51bcdcd1a91___convert__closures_____invoke___js_sys_bdd470c3fe1f6d69___Function_fn_wasm_bindgen_baa1b51bcdcd1a91___JsValue_____wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined___js_sys_bdd470c3fe1f6d69___Function_fn_wasm_bindgen_baa1b51bcdcd1a91___JsValue_____wasm_bindgen_baa1b51bcdcd1a91___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
1622
2016
  }
1623
2017
 
1624
2018
 
@@ -1650,6 +2044,9 @@ const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefin
1650
2044
  const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined')
1651
2045
  ? { register: () => {}, unregister: () => {} }
1652
2046
  : new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr, 1));
2047
+ const KeyRecordFinalization = (typeof FinalizationRegistry === 'undefined')
2048
+ ? { register: () => {}, unregister: () => {} }
2049
+ : new FinalizationRegistry(ptr => wasm.__wbg_keyrecord_free(ptr, 1));
1653
2050
  const ObjectEventFinalization = (typeof FinalizationRegistry === 'undefined')
1654
2051
  ? { register: () => {}, unregister: () => {} }
1655
2052
  : new FinalizationRegistry(ptr => wasm.__wbg_objectevent_free(ptr, 1));
@@ -1662,6 +2059,12 @@ const PinnedObjectFinalization = (typeof FinalizationRegistry === 'undefined')
1662
2059
  const SdkFinalization = (typeof FinalizationRegistry === 'undefined')
1663
2060
  ? { register: () => {}, unregister: () => {} }
1664
2061
  : new FinalizationRegistry(ptr => wasm.__wbg_sdk_free(ptr, 1));
2062
+ const SharedSdkFinalization = (typeof FinalizationRegistry === 'undefined')
2063
+ ? { register: () => {}, unregister: () => {} }
2064
+ : new FinalizationRegistry(ptr => wasm.__wbg_sharedsdk_free(ptr, 1));
2065
+ const SharingKeyFinalization = (typeof FinalizationRegistry === 'undefined')
2066
+ ? { register: () => {}, unregister: () => {} }
2067
+ : new FinalizationRegistry(ptr => wasm.__wbg_sharingkey_free(ptr, 1));
1665
2068
 
1666
2069
  function addToExternrefTable0(obj) {
1667
2070
  const idx = wasm.__externref_table_alloc();