lumina-node-wasm 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -199,22 +199,11 @@ function debugString(val) {
199
199
  return className;
200
200
  }
201
201
 
202
- function getArrayJsValueFromWasm0(ptr, len) {
203
- ptr = ptr >>> 0;
204
- const mem = getDataViewMemory0();
205
- const result = [];
206
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
207
- result.push(wasm.__wbindgen_export_4.get(mem.getUint32(i, true)));
208
- }
209
- wasm.__externref_drop_slice(ptr, len);
210
- return result;
211
- }
212
-
213
202
  const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
214
203
  ? { register: () => {}, unregister: () => {} }
215
204
  : new FinalizationRegistry(
216
205
  state => {
217
- wasm.__wbindgen_export_7.get(state.dtor)(state.a, state.b);
206
+ wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b);
218
207
  }
219
208
  );
220
209
 
@@ -232,7 +221,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
232
221
  return f(a, state.b, ...args);
233
222
  } finally {
234
223
  if (--state.cnt === 0) {
235
- wasm.__wbindgen_export_7.get(state.dtor)(a, state.b);
224
+ wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
236
225
  CLOSURE_DTORS.unregister(state);
237
226
  } else {
238
227
  state.a = a;
@@ -244,6 +233,17 @@ function makeMutClosure(arg0, arg1, dtor, f) {
244
233
  return real;
245
234
  }
246
235
 
236
+ function getArrayJsValueFromWasm0(ptr, len) {
237
+ ptr = ptr >>> 0;
238
+ const mem = getDataViewMemory0();
239
+ const result = [];
240
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
241
+ result.push(wasm.__wbindgen_export_4.get(mem.getUint32(i, true)));
242
+ }
243
+ wasm.__externref_drop_slice(ptr, len);
244
+ return result;
245
+ }
246
+
247
247
  function makeClosure(arg0, arg1, dtor, f) {
248
248
  const state = { a: arg0, b: arg1, cnt: 1, dtor };
249
249
  const real = (...args) => {
@@ -256,7 +256,7 @@ function makeClosure(arg0, arg1, dtor, f) {
256
256
  return f(state.a, state.b, ...args);
257
257
  } finally {
258
258
  if (--state.cnt === 0) {
259
- wasm.__wbindgen_export_7.get(state.dtor)(state.a, state.b); state.a = 0;
259
+ wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b); state.a = 0;
260
260
  CLOSURE_DTORS.unregister(state);
261
261
  }
262
262
  }
@@ -265,12 +265,6 @@ function makeClosure(arg0, arg1, dtor, f) {
265
265
  CLOSURE_DTORS.register(real, state, state);
266
266
  return real;
267
267
  }
268
- /**
269
- * Set up a logging layer that direct logs to the browser's console.
270
- */
271
- export function setup_logging() {
272
- wasm.setup_logging();
273
- }
274
268
 
275
269
  function _assertClass(instance, klass) {
276
270
  if (!(instance instanceof klass)) {
@@ -287,6 +281,12 @@ function passArrayJsValueToWasm0(array, malloc) {
287
281
  WASM_VECTOR_LEN = array.length;
288
282
  return ptr;
289
283
  }
284
+ /**
285
+ * Set up a logging layer that direct logs to the browser's console.
286
+ */
287
+ export function setup_logging() {
288
+ wasm.setup_logging();
289
+ }
290
290
 
291
291
  function takeFromExternrefTable0(idx) {
292
292
  const value = wasm.__wbindgen_export_4.get(idx);
@@ -305,41 +305,46 @@ export function protoEncodeSignDoc(sign_doc) {
305
305
  return v1;
306
306
  }
307
307
 
308
- function __wbg_adapter_8(arg0, arg1) {
309
- wasm.wasm_bindgen__convert__closures_____invoke__hfede219244329fd3(arg0, arg1);
308
+ function __wbg_adapter_6(arg0, arg1, arg2) {
309
+ wasm.closure313_externref_shim(arg0, arg1, arg2);
310
310
  }
311
311
 
312
- function __wbg_adapter_11(arg0, arg1, arg2) {
313
- wasm.closure1749_externref_shim(arg0, arg1, arg2);
312
+ function __wbg_adapter_9(arg0, arg1, arg2) {
313
+ wasm.closure1892_externref_shim(arg0, arg1, arg2);
314
314
  }
315
315
 
316
- function __wbg_adapter_20(arg0, arg1, arg2) {
317
- wasm.closure731_externref_shim(arg0, arg1, arg2);
316
+ function __wbg_adapter_14(arg0, arg1, arg2) {
317
+ wasm.closure2958_externref_shim(arg0, arg1, arg2);
318
318
  }
319
319
 
320
- function __wbg_adapter_23(arg0, arg1, arg2) {
321
- wasm.closure2841_externref_shim(arg0, arg1, arg2);
320
+ function __wbg_adapter_23(arg0, arg1) {
321
+ wasm.wasm_bindgen__convert__closures_____invoke__hbc27f06da80e4608(arg0, arg1);
322
322
  }
323
323
 
324
- function __wbg_adapter_26(arg0, arg1, arg2) {
325
- wasm.closure727_externref_shim(arg0, arg1, arg2);
324
+ function __wbg_adapter_28(arg0, arg1, arg2) {
325
+ wasm.closure311_externref_shim(arg0, arg1, arg2);
326
326
  }
327
327
 
328
328
  function __wbg_adapter_31(arg0, arg1, arg2) {
329
- wasm.closure2961_externref_shim(arg0, arg1, arg2);
329
+ const ret = wasm.closure308_externref_shim(arg0, arg1, arg2);
330
+ return ret;
330
331
  }
331
332
 
332
- function __wbg_adapter_44(arg0, arg1, arg2) {
333
- const ret = wasm.closure729_externref_shim(arg0, arg1, arg2);
334
- return ret;
333
+ function __wbg_adapter_34(arg0, arg1, arg2) {
334
+ wasm.closure3066_externref_shim(arg0, arg1, arg2);
335
335
  }
336
336
 
337
337
  function __wbg_adapter_47(arg0, arg1) {
338
- wasm.wasm_bindgen__convert__closures_____invoke__h7953c2fdc3875afe(arg0, arg1);
338
+ const ret = wasm.closure315_externref_shim(arg0, arg1);
339
+ return ret;
340
+ }
341
+
342
+ function __wbg_adapter_52(arg0, arg1) {
343
+ wasm.wasm_bindgen__convert__closures_____invoke__h4a5ee0ea235e8a7d(arg0, arg1);
339
344
  }
340
345
 
341
- function __wbg_adapter_960(arg0, arg1, arg2, arg3) {
342
- wasm.closure2981_externref_shim(arg0, arg1, arg2, arg3);
346
+ function __wbg_adapter_940(arg0, arg1, arg2, arg3) {
347
+ wasm.closure3085_externref_shim(arg0, arg1, arg2, arg3);
343
348
  }
344
349
 
345
350
  /**
@@ -714,7 +719,7 @@ export const TxPriority = Object.freeze({
714
719
  });
715
720
  /**
716
721
  * Represents state of the transaction in the mempool
717
- * @enum {0 | 1 | 2 | 3}
722
+ * @enum {0 | 1 | 2 | 3 | 4}
718
723
  */
719
724
  export const TxStatus = Object.freeze({
720
725
  /**
@@ -729,10 +734,14 @@ export const TxStatus = Object.freeze({
729
734
  * The transaction was evicted from the mempool.
730
735
  */
731
736
  Evicted: 2, "2": "Evicted",
737
+ /**
738
+ * The transaction was rejected
739
+ */
740
+ Rejected: 3, "3": "Rejected",
732
741
  /**
733
742
  * The transaction was committed into the block.
734
743
  */
735
- Committed: 3, "3": "Committed",
744
+ Committed: 4, "4": "Committed",
736
745
  });
737
746
  /**
738
747
  * Types of votes
@@ -887,6 +896,17 @@ export class AbciQueryResponse {
887
896
  const ptr = this.__destroy_into_raw();
888
897
  wasm.__wbg_abciqueryresponse_free(ptr, 0);
889
898
  }
899
+ /**
900
+ * The block height from which data was derived.
901
+ *
902
+ * Note that this is the height of the block containing the application's Merkle root hash,
903
+ * which represents the state as it was after committing the block at height - 1.
904
+ * @returns {bigint}
905
+ */
906
+ get height() {
907
+ const ret = wasm.abciqueryresponse_height(this.__wbg_ptr);
908
+ return BigInt.asUintN(64, ret);
909
+ }
890
910
  /**
891
911
  * Response code.
892
912
  * @returns {ErrorCode}
@@ -1058,17 +1078,6 @@ export class AbciQueryResponse {
1058
1078
  const len0 = WASM_VECTOR_LEN;
1059
1079
  wasm.__wbg_set_abciqueryresponse_info(this.__wbg_ptr, ptr0, len0);
1060
1080
  }
1061
- /**
1062
- * The block height from which data was derived.
1063
- *
1064
- * Note that this is the height of the block containing the application's Merkle root hash,
1065
- * which represents the state as it was after committing the block at height - 1.
1066
- * @returns {bigint}
1067
- */
1068
- get height() {
1069
- const ret = wasm.abciqueryresponse_height(this.__wbg_ptr);
1070
- return BigInt.asUintN(64, ret);
1071
- }
1072
1081
  }
1073
1082
 
1074
1083
  const AccAddressFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -1194,6 +1203,47 @@ export class AppVersion {
1194
1203
  }
1195
1204
  }
1196
1205
 
1206
+ const AsyncIteratorImplFinalization = (typeof FinalizationRegistry === 'undefined')
1207
+ ? { register: () => {}, unregister: () => {} }
1208
+ : new FinalizationRegistry(ptr => wasm.__wbg_asynciteratorimpl_free(ptr >>> 0, 1));
1209
+
1210
+ export class AsyncIteratorImpl {
1211
+
1212
+ static __wrap(ptr) {
1213
+ ptr = ptr >>> 0;
1214
+ const obj = Object.create(AsyncIteratorImpl.prototype);
1215
+ obj.__wbg_ptr = ptr;
1216
+ AsyncIteratorImplFinalization.register(obj, obj.__wbg_ptr, obj);
1217
+ return obj;
1218
+ }
1219
+
1220
+ __destroy_into_raw() {
1221
+ const ptr = this.__wbg_ptr;
1222
+ this.__wbg_ptr = 0;
1223
+ AsyncIteratorImplFinalization.unregister(this);
1224
+ return ptr;
1225
+ }
1226
+
1227
+ free() {
1228
+ const ptr = this.__destroy_into_raw();
1229
+ wasm.__wbg_asynciteratorimpl_free(ptr, 0);
1230
+ }
1231
+ /**
1232
+ * @returns {any}
1233
+ */
1234
+ return_self() {
1235
+ const ret = wasm.asynciteratorimpl_return_self(this.__wbg_ptr);
1236
+ return ret;
1237
+ }
1238
+ /**
1239
+ * @returns {Promise<any>}
1240
+ */
1241
+ next() {
1242
+ const ret = wasm.asynciteratorimpl_next(this.__wbg_ptr);
1243
+ return ret;
1244
+ }
1245
+ }
1246
+
1197
1247
  const AttributeFinalization = (typeof FinalizationRegistry === 'undefined')
1198
1248
  ? { register: () => {}, unregister: () => {} }
1199
1249
  : new FinalizationRegistry(ptr => wasm.__wbg_attribute_free(ptr >>> 0, 1));
@@ -1613,6 +1663,80 @@ export class BlobParams {
1613
1663
  }
1614
1664
  }
1615
1665
 
1666
+ const BlobsAtHeightFinalization = (typeof FinalizationRegistry === 'undefined')
1667
+ ? { register: () => {}, unregister: () => {} }
1668
+ : new FinalizationRegistry(ptr => wasm.__wbg_blobsatheight_free(ptr >>> 0, 1));
1669
+ /**
1670
+ * List of blobs together with height they were published at
1671
+ */
1672
+ export class BlobsAtHeight {
1673
+
1674
+ static __wrap(ptr) {
1675
+ ptr = ptr >>> 0;
1676
+ const obj = Object.create(BlobsAtHeight.prototype);
1677
+ obj.__wbg_ptr = ptr;
1678
+ BlobsAtHeightFinalization.register(obj, obj.__wbg_ptr, obj);
1679
+ return obj;
1680
+ }
1681
+
1682
+ toJSON() {
1683
+ return {
1684
+ height: this.height,
1685
+ blobs: this.blobs,
1686
+ };
1687
+ }
1688
+
1689
+ toString() {
1690
+ return JSON.stringify(this);
1691
+ }
1692
+
1693
+ __destroy_into_raw() {
1694
+ const ptr = this.__wbg_ptr;
1695
+ this.__wbg_ptr = 0;
1696
+ BlobsAtHeightFinalization.unregister(this);
1697
+ return ptr;
1698
+ }
1699
+
1700
+ free() {
1701
+ const ptr = this.__destroy_into_raw();
1702
+ wasm.__wbg_blobsatheight_free(ptr, 0);
1703
+ }
1704
+ /**
1705
+ * Height the blobs were published at
1706
+ * @returns {bigint}
1707
+ */
1708
+ get height() {
1709
+ const ret = wasm.__wbg_get_blobparams_gov_max_square_size(this.__wbg_ptr);
1710
+ return BigInt.asUintN(64, ret);
1711
+ }
1712
+ /**
1713
+ * Height the blobs were published at
1714
+ * @param {bigint} arg0
1715
+ */
1716
+ set height(arg0) {
1717
+ wasm.__wbg_set_blobparams_gov_max_square_size(this.__wbg_ptr, arg0);
1718
+ }
1719
+ /**
1720
+ * Published blobs
1721
+ * @returns {Blob[]}
1722
+ */
1723
+ get blobs() {
1724
+ const ret = wasm.__wbg_get_blobsatheight_blobs(this.__wbg_ptr);
1725
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
1726
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
1727
+ return v1;
1728
+ }
1729
+ /**
1730
+ * Published blobs
1731
+ * @param {Blob[]} arg0
1732
+ */
1733
+ set blobs(arg0) {
1734
+ const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
1735
+ const len0 = WASM_VECTOR_LEN;
1736
+ wasm.__wbg_set_blobsatheight_blobs(this.__wbg_ptr, ptr0, len0);
1737
+ }
1738
+ }
1739
+
1616
1740
  const BlockFinalization = (typeof FinalizationRegistry === 'undefined')
1617
1741
  ? { register: () => {}, unregister: () => {} }
1618
1742
  : new FinalizationRegistry(ptr => wasm.__wbg_block_free(ptr >>> 0, 1));
@@ -1899,21 +2023,21 @@ export class BroadcastMode {
1899
2023
  return BroadcastMode.__wrap(ret);
1900
2024
  }
1901
2025
  /**
1902
- * DEPRECATED: use `BroadcastMode` `Sync` instead,
1903
- * `BroadcastMode` `Block` is not supported by the SDK from v0.47.x onwards.
2026
+ * `BroadcastMode` `Sync` defines a tx broadcasting mode where the client waits for
2027
+ * a CheckTx execution response only.
1904
2028
  * @returns {BroadcastMode}
1905
2029
  */
1906
- static get Block() {
1907
- const ret = wasm.broadcastmode_Block();
2030
+ static get Sync() {
2031
+ const ret = wasm.broadcastmode_Sync();
1908
2032
  return BroadcastMode.__wrap(ret);
1909
2033
  }
1910
2034
  /**
1911
- * `BroadcastMode` `Sync` defines a tx broadcasting mode where the client waits for
1912
- * a CheckTx execution response only.
2035
+ * DEPRECATED: use `BroadcastMode` `Sync` instead,
2036
+ * `BroadcastMode` `Block` is not supported by the SDK from v0.47.x onwards.
1913
2037
  * @returns {BroadcastMode}
1914
2038
  */
1915
- static get Sync() {
1916
- const ret = wasm.broadcastmode_Sync();
2039
+ static get Block() {
2040
+ const ret = wasm.broadcastmode_Block();
1917
2041
  return BroadcastMode.__wrap(ret);
1918
2042
  }
1919
2043
  /**
@@ -2468,7 +2592,9 @@ export class ConflictingBlock {
2468
2592
  const ConnectionCountersSnapshotFinalization = (typeof FinalizationRegistry === 'undefined')
2469
2593
  ? { register: () => {}, unregister: () => {} }
2470
2594
  : new FinalizationRegistry(ptr => wasm.__wbg_connectioncounterssnapshot_free(ptr >>> 0, 1));
2471
-
2595
+ /**
2596
+ * Network connection information
2597
+ */
2472
2598
  export class ConnectionCountersSnapshot {
2473
2599
 
2474
2600
  static __wrap(ptr) {
@@ -2743,7 +2869,7 @@ const DataAvailabilityHeaderFinalization = (typeof FinalizationRegistry === 'und
2743
2869
  * # fn extended_header() -> ExtendedHeader {
2744
2870
  * # unimplemented!();
2745
2871
  * # }
2746
- * # fn shares_with_proof(_: Height, _: &Namespace) -> (Vec<Share>, NamespaceProof) {
2872
+ * # fn shares_with_proof(_: u64, _: &Namespace) -> (Vec<Share>, NamespaceProof) {
2747
2873
  * # unimplemented!();
2748
2874
  * # }
2749
2875
  * // fetch the block header and data for your namespace
@@ -2792,51 +2918,59 @@ export class DataAvailabilityHeader {
2792
2918
  wasm.__wbg_dataavailabilityheader_free(ptr, 0);
2793
2919
  }
2794
2920
  /**
2795
- * Merkle roots of the [`ExtendedDataSquare`] rows.
2796
- * @returns {Array<any>}
2921
+ * Get a root of the row with the given index.
2922
+ * @param {number} row
2923
+ * @returns {any}
2797
2924
  */
2798
- rowRoots() {
2799
- const ret = wasm.dataavailabilityheader_rowRoots(this.__wbg_ptr);
2925
+ rowRoot(row) {
2926
+ const ret = wasm.dataavailabilityheader_rowRoot(this.__wbg_ptr, row);
2800
2927
  if (ret[2]) {
2801
2928
  throw takeFromExternrefTable0(ret[1]);
2802
2929
  }
2803
2930
  return takeFromExternrefTable0(ret[0]);
2804
2931
  }
2805
2932
  /**
2806
- * Merkle roots of the [`ExtendedDataSquare`] columns.
2933
+ * Merkle roots of the [`ExtendedDataSquare`] rows.
2807
2934
  * @returns {Array<any>}
2808
2935
  */
2809
- columnRoots() {
2810
- const ret = wasm.dataavailabilityheader_columnRoots(this.__wbg_ptr);
2936
+ rowRoots() {
2937
+ const ret = wasm.dataavailabilityheader_rowRoots(this.__wbg_ptr);
2811
2938
  if (ret[2]) {
2812
2939
  throw takeFromExternrefTable0(ret[1]);
2813
2940
  }
2814
2941
  return takeFromExternrefTable0(ret[0]);
2815
2942
  }
2816
2943
  /**
2817
- * Get a root of the row with the given index.
2818
- * @param {number} row
2944
+ * Get the a root of the column with the given index.
2945
+ * @param {number} column
2819
2946
  * @returns {any}
2820
2947
  */
2821
- rowRoot(row) {
2822
- const ret = wasm.dataavailabilityheader_rowRoot(this.__wbg_ptr, row);
2948
+ columnRoot(column) {
2949
+ const ret = wasm.dataavailabilityheader_columnRoot(this.__wbg_ptr, column);
2823
2950
  if (ret[2]) {
2824
2951
  throw takeFromExternrefTable0(ret[1]);
2825
2952
  }
2826
2953
  return takeFromExternrefTable0(ret[0]);
2827
2954
  }
2828
2955
  /**
2829
- * Get the a root of the column with the given index.
2830
- * @param {number} column
2831
- * @returns {any}
2956
+ * Merkle roots of the [`ExtendedDataSquare`] columns.
2957
+ * @returns {Array<any>}
2832
2958
  */
2833
- columnRoot(column) {
2834
- const ret = wasm.dataavailabilityheader_columnRoot(this.__wbg_ptr, column);
2959
+ columnRoots() {
2960
+ const ret = wasm.dataavailabilityheader_columnRoots(this.__wbg_ptr);
2835
2961
  if (ret[2]) {
2836
2962
  throw takeFromExternrefTable0(ret[1]);
2837
2963
  }
2838
2964
  return takeFromExternrefTable0(ret[0]);
2839
2965
  }
2966
+ /**
2967
+ * Get the size of the [`ExtendedDataSquare`] for which this header was built.
2968
+ * @returns {number}
2969
+ */
2970
+ squareWidth() {
2971
+ const ret = wasm.dataavailabilityheader_squareWidth(this.__wbg_ptr);
2972
+ return ret;
2973
+ }
2840
2974
  /**
2841
2975
  * Compute the combined hash of all rows and columns.
2842
2976
  *
@@ -2850,14 +2984,6 @@ export class DataAvailabilityHeader {
2850
2984
  }
2851
2985
  return takeFromExternrefTable0(ret[0]);
2852
2986
  }
2853
- /**
2854
- * Get the size of the [`ExtendedDataSquare`] for which this header was built.
2855
- * @returns {number}
2856
- */
2857
- squareWidth() {
2858
- const ret = wasm.dataavailabilityheader_squareWidth(this.__wbg_ptr);
2859
- return ret;
2860
- }
2861
2987
  }
2862
2988
 
2863
2989
  const DuplicateVoteEvidenceFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -3058,10 +3184,10 @@ export class ExtendedHeader {
3058
3184
 
3059
3185
  toJSON() {
3060
3186
  return {
3061
- dah: this.dah,
3062
- header: this.header,
3063
- commit: this.commit,
3064
3187
  validatorSet: this.validatorSet,
3188
+ commit: this.commit,
3189
+ header: this.header,
3190
+ dah: this.dah,
3065
3191
  };
3066
3192
  }
3067
3193
 
@@ -3081,58 +3207,64 @@ export class ExtendedHeader {
3081
3207
  wasm.__wbg_extendedheader_free(ptr, 0);
3082
3208
  }
3083
3209
  /**
3084
- * Header of the block data availability.
3085
- * @returns {DataAvailabilityHeader}
3210
+ * Decode protobuf encoded header and then validate it.
3086
3211
  */
3087
- get dah() {
3088
- const ret = wasm.__wbg_get_extendedheader_dah(this.__wbg_ptr);
3089
- return DataAvailabilityHeader.__wrap(ret);
3212
+ validate() {
3213
+ const ret = wasm.extendedheader_validate(this.__wbg_ptr);
3214
+ if (ret[1]) {
3215
+ throw takeFromExternrefTable0(ret[0]);
3216
+ }
3090
3217
  }
3091
3218
  /**
3092
- * Header of the block data availability.
3093
- * @param {DataAvailabilityHeader} arg0
3219
+ * Verify a chain of adjacent untrusted headers.
3220
+ *
3221
+ * # Note
3222
+ *
3223
+ * Provided headers will be consumed by this method, meaning
3224
+ * they will no longer be accessible. If this behavior is not desired,
3225
+ * consider using `ExtendedHeader.clone()`.
3226
+ *
3227
+ * ```js
3228
+ * const genesis = hdr0;
3229
+ * const headers = [hrd1, hdr2, hdr3];
3230
+ * genesis.verifyRange(headers.map(h => h.clone()));
3231
+ * ```
3232
+ *
3233
+ * # Errors
3234
+ *
3235
+ * If verification fails, this function will return an error with a reason of failure.
3236
+ * This function will also return an error if untrusted headers are not adjacent
3237
+ * to each other.
3238
+ * @param {ExtendedHeader[]} untrusted
3094
3239
  */
3095
- set dah(arg0) {
3096
- _assertClass(arg0, DataAvailabilityHeader);
3097
- var ptr0 = arg0.__destroy_into_raw();
3098
- wasm.__wbg_set_extendedheader_dah(this.__wbg_ptr, ptr0);
3099
- }
3100
- /**
3101
- * Clone a header producing a deep copy of it.
3102
- * @returns {ExtendedHeader}
3103
- */
3104
- clone() {
3105
- const ret = wasm.extendedheader_clone(this.__wbg_ptr);
3106
- return ExtendedHeader.__wrap(ret);
3107
- }
3108
- /**
3109
- * Get the block height.
3110
- * @returns {bigint}
3111
- */
3112
- height() {
3113
- const ret = wasm.extendedheader_height(this.__wbg_ptr);
3114
- return BigInt.asUintN(64, ret);
3240
+ verifyRange(untrusted) {
3241
+ const ptr0 = passArrayJsValueToWasm0(untrusted, wasm.__wbindgen_malloc);
3242
+ const len0 = WASM_VECTOR_LEN;
3243
+ const ret = wasm.extendedheader_verifyRange(this.__wbg_ptr, ptr0, len0);
3244
+ if (ret[1]) {
3245
+ throw takeFromExternrefTable0(ret[0]);
3246
+ }
3115
3247
  }
3116
3248
  /**
3117
- * Get the block time.
3118
- * @returns {number}
3249
+ * Information about the set of validators commiting the block.
3250
+ * @returns {any}
3119
3251
  */
3120
- time() {
3121
- const ret = wasm.extendedheader_time(this.__wbg_ptr);
3252
+ get validatorSet() {
3253
+ const ret = wasm.extendedheader_validatorSet(this.__wbg_ptr);
3122
3254
  if (ret[2]) {
3123
3255
  throw takeFromExternrefTable0(ret[1]);
3124
3256
  }
3125
- return ret[0];
3257
+ return takeFromExternrefTable0(ret[0]);
3126
3258
  }
3127
3259
  /**
3128
- * Get the block hash.
3260
+ * Get the hash of the previous header.
3129
3261
  * @returns {string}
3130
3262
  */
3131
- hash() {
3263
+ previousHeaderHash() {
3132
3264
  let deferred1_0;
3133
3265
  let deferred1_1;
3134
3266
  try {
3135
- const ret = wasm.extendedheader_hash(this.__wbg_ptr);
3267
+ const ret = wasm.extendedheader_previousHeaderHash(this.__wbg_ptr);
3136
3268
  deferred1_0 = ret[0];
3137
3269
  deferred1_1 = ret[1];
3138
3270
  return getStringFromWasm0(ret[0], ret[1]);
@@ -3141,14 +3273,44 @@ export class ExtendedHeader {
3141
3273
  }
3142
3274
  }
3143
3275
  /**
3144
- * Get the hash of the previous header.
3276
+ * Verify a chain of adjacent untrusted headers and make sure
3277
+ * they are adjacent to `self`.
3278
+ *
3279
+ * # Note
3280
+ *
3281
+ * Provided headers will be consumed by this method, meaning
3282
+ * they will no longer be accessible. If this behavior is not desired,
3283
+ * consider using `ExtendedHeader.clone()`.
3284
+ *
3285
+ * ```js
3286
+ * const genesis = hdr0;
3287
+ * const headers = [hrd1, hdr2, hdr3];
3288
+ * genesis.verifyAdjacentRange(headers.map(h => h.clone()));
3289
+ * ```
3290
+ *
3291
+ * # Errors
3292
+ *
3293
+ * If verification fails, this function will return an error with a reason of failure.
3294
+ * This function will also return an error if untrusted headers and `self` don't form contiguous range
3295
+ * @param {ExtendedHeader[]} untrusted
3296
+ */
3297
+ verifyAdjacentRange(untrusted) {
3298
+ const ptr0 = passArrayJsValueToWasm0(untrusted, wasm.__wbindgen_malloc);
3299
+ const len0 = WASM_VECTOR_LEN;
3300
+ const ret = wasm.extendedheader_verifyAdjacentRange(this.__wbg_ptr, ptr0, len0);
3301
+ if (ret[1]) {
3302
+ throw takeFromExternrefTable0(ret[0]);
3303
+ }
3304
+ }
3305
+ /**
3306
+ * Get the block hash.
3145
3307
  * @returns {string}
3146
3308
  */
3147
- previousHeaderHash() {
3309
+ hash() {
3148
3310
  let deferred1_0;
3149
3311
  let deferred1_1;
3150
3312
  try {
3151
- const ret = wasm.extendedheader_previousHeaderHash(this.__wbg_ptr);
3313
+ const ret = wasm.extendedheader_hash(this.__wbg_ptr);
3152
3314
  deferred1_0 = ret[0];
3153
3315
  deferred1_1 = ret[1];
3154
3316
  return getStringFromWasm0(ret[0], ret[1]);
@@ -3157,15 +3319,23 @@ export class ExtendedHeader {
3157
3319
  }
3158
3320
  }
3159
3321
  /**
3160
- * Tendermint block header.
3161
- * @returns {any}
3322
+ * Get the block time.
3323
+ * @returns {number}
3162
3324
  */
3163
- get header() {
3164
- const ret = wasm.extendedheader_header(this.__wbg_ptr);
3325
+ time() {
3326
+ const ret = wasm.extendedheader_time(this.__wbg_ptr);
3165
3327
  if (ret[2]) {
3166
3328
  throw takeFromExternrefTable0(ret[1]);
3167
3329
  }
3168
- return takeFromExternrefTable0(ret[0]);
3330
+ return ret[0];
3331
+ }
3332
+ /**
3333
+ * Clone a header producing a deep copy of it.
3334
+ * @returns {ExtendedHeader}
3335
+ */
3336
+ clone() {
3337
+ const ret = wasm.extendedheader_clone(this.__wbg_ptr);
3338
+ return ExtendedHeader.__wrap(ret);
3169
3339
  }
3170
3340
  /**
3171
3341
  * Commit metadata and signatures from validators committing the block.
@@ -3179,24 +3349,23 @@ export class ExtendedHeader {
3179
3349
  return takeFromExternrefTable0(ret[0]);
3180
3350
  }
3181
3351
  /**
3182
- * Information about the set of validators commiting the block.
3352
+ * Tendermint block header.
3183
3353
  * @returns {any}
3184
3354
  */
3185
- get validatorSet() {
3186
- const ret = wasm.extendedheader_validatorSet(this.__wbg_ptr);
3355
+ get header() {
3356
+ const ret = wasm.extendedheader_header(this.__wbg_ptr);
3187
3357
  if (ret[2]) {
3188
3358
  throw takeFromExternrefTable0(ret[1]);
3189
3359
  }
3190
3360
  return takeFromExternrefTable0(ret[0]);
3191
3361
  }
3192
3362
  /**
3193
- * Decode protobuf encoded header and then validate it.
3363
+ * Get the block height.
3364
+ * @returns {bigint}
3194
3365
  */
3195
- validate() {
3196
- const ret = wasm.extendedheader_validate(this.__wbg_ptr);
3197
- if (ret[1]) {
3198
- throw takeFromExternrefTable0(ret[0]);
3199
- }
3366
+ height() {
3367
+ const ret = wasm.extendedheader_height(this.__wbg_ptr);
3368
+ return BigInt.asUintN(64, ret);
3200
3369
  }
3201
3370
  /**
3202
3371
  * Verify a chain of adjacent untrusted headers and make sure
@@ -3216,64 +3385,21 @@ export class ExtendedHeader {
3216
3385
  }
3217
3386
  }
3218
3387
  /**
3219
- * Verify a chain of adjacent untrusted headers.
3220
- *
3221
- * # Note
3222
- *
3223
- * Provided headers will be consumed by this method, meaning
3224
- * they will no longer be accessible. If this behavior is not desired,
3225
- * consider using `ExtendedHeader.clone()`.
3226
- *
3227
- * ```js
3228
- * const genesis = hdr0;
3229
- * const headers = [hrd1, hdr2, hdr3];
3230
- * genesis.verifyRange(headers.map(h => h.clone()));
3231
- * ```
3232
- *
3233
- * # Errors
3234
- *
3235
- * If verification fails, this function will return an error with a reason of failure.
3236
- * This function will also return an error if untrusted headers are not adjacent
3237
- * to each other.
3238
- * @param {ExtendedHeader[]} untrusted
3388
+ * Header of the block data availability.
3389
+ * @returns {DataAvailabilityHeader}
3239
3390
  */
3240
- verifyRange(untrusted) {
3241
- const ptr0 = passArrayJsValueToWasm0(untrusted, wasm.__wbindgen_malloc);
3242
- const len0 = WASM_VECTOR_LEN;
3243
- const ret = wasm.extendedheader_verifyRange(this.__wbg_ptr, ptr0, len0);
3244
- if (ret[1]) {
3245
- throw takeFromExternrefTable0(ret[0]);
3246
- }
3391
+ get dah() {
3392
+ const ret = wasm.__wbg_get_extendedheader_dah(this.__wbg_ptr);
3393
+ return DataAvailabilityHeader.__wrap(ret);
3247
3394
  }
3248
3395
  /**
3249
- * Verify a chain of adjacent untrusted headers and make sure
3250
- * they are adjacent to `self`.
3251
- *
3252
- * # Note
3253
- *
3254
- * Provided headers will be consumed by this method, meaning
3255
- * they will no longer be accessible. If this behavior is not desired,
3256
- * consider using `ExtendedHeader.clone()`.
3257
- *
3258
- * ```js
3259
- * const genesis = hdr0;
3260
- * const headers = [hrd1, hdr2, hdr3];
3261
- * genesis.verifyAdjacentRange(headers.map(h => h.clone()));
3262
- * ```
3263
- *
3264
- * # Errors
3265
- *
3266
- * If verification fails, this function will return an error with a reason of failure.
3267
- * This function will also return an error if untrusted headers and `self` don't form contiguous range
3268
- * @param {ExtendedHeader[]} untrusted
3396
+ * Header of the block data availability.
3397
+ * @param {DataAvailabilityHeader} arg0
3269
3398
  */
3270
- verifyAdjacentRange(untrusted) {
3271
- const ptr0 = passArrayJsValueToWasm0(untrusted, wasm.__wbindgen_malloc);
3272
- const len0 = WASM_VECTOR_LEN;
3273
- const ret = wasm.extendedheader_verifyAdjacentRange(this.__wbg_ptr, ptr0, len0);
3274
- if (ret[1]) {
3275
- throw takeFromExternrefTable0(ret[0]);
3276
- }
3399
+ set dah(arg0) {
3400
+ _assertClass(arg0, DataAvailabilityHeader);
3401
+ var ptr0 = arg0.__destroy_into_raw();
3402
+ wasm.__wbg_set_extendedheader_dah(this.__wbg_ptr, ptr0);
3277
3403
  }
3278
3404
  }
3279
3405
 
@@ -3575,22 +3701,49 @@ export class GrpcClient {
3575
3701
  wasm.__wbg_grpcclient_free(ptr, 0);
3576
3702
  }
3577
3703
  /**
3578
- * Create a builder for [`GrpcClient`] connected to `url`
3579
- * @param {string} url
3580
- * @returns {GrpcClientBuilder}
3704
+ * Issue a direct ABCI query to the application
3705
+ * @param {Uint8Array} data
3706
+ * @param {string} path
3707
+ * @param {bigint} height
3708
+ * @param {boolean} prove
3709
+ * @returns {Promise<AbciQueryResponse>}
3581
3710
  */
3582
- static withUrl(url) {
3583
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3711
+ abciQuery(data, path, height, prove) {
3712
+ const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
3584
3713
  const len0 = WASM_VECTOR_LEN;
3585
- const ret = wasm.grpcclient_withUrl(ptr0, len0);
3586
- return GrpcClientBuilder.__wrap(ret);
3714
+ const ptr1 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3715
+ const len1 = WASM_VECTOR_LEN;
3716
+ const ret = wasm.grpcclient_abciQuery(this.__wbg_ptr, ptr0, len0, ptr1, len1, height, prove);
3717
+ return ret;
3587
3718
  }
3588
3719
  /**
3589
- * Get auth params
3590
- * @returns {Promise<AuthParams>}
3720
+ * Confirm transaction broadcasted with [`broadcast_blobs`] or [`broadcast_message`].
3721
+ *
3722
+ * # Example
3723
+ * ```js
3724
+ * const ns = Namespace.newV0(new Uint8Array([97, 98, 99]));
3725
+ * const data = new Uint8Array([100, 97, 116, 97]);
3726
+ * const blob = new Blob(ns, data, AppVersion.latest());
3727
+ *
3728
+ * const broadcastedTx = await txClient.broadcastBlobs([blob]);
3729
+ * console.log("Tx hash:", broadcastedTx.hash);
3730
+ * const txInfo = await txClient.confirmTx(broadcastedTx);
3731
+ * console.log("Confirmed at height:", txInfo.height);
3732
+ * ```
3733
+ * @param {BroadcastedTx} broadcasted_tx
3734
+ * @param {TxConfig | null} [tx_config]
3735
+ * @returns {Promise<TxInfo>}
3591
3736
  */
3592
- getAuthParams() {
3593
- const ret = wasm.grpcclient_getAuthParams(this.__wbg_ptr);
3737
+ confirmTx(broadcasted_tx, tx_config) {
3738
+ const ret = wasm.grpcclient_confirmTx(this.__wbg_ptr, broadcasted_tx, isLikeNone(tx_config) ? 0 : addToExternrefTable0(tx_config));
3739
+ return ret;
3740
+ }
3741
+ /**
3742
+ * AppVersion of the client
3743
+ * @returns {Promise<AppVersion>}
3744
+ */
3745
+ get appVersion() {
3746
+ const ret = wasm.grpcclient_appVersion(this.__wbg_ptr);
3594
3747
  return ret;
3595
3748
  }
3596
3749
  /**
@@ -3604,34 +3757,6 @@ export class GrpcClient {
3604
3757
  const ret = wasm.grpcclient_getAccount(this.__wbg_ptr, ptr0, len0);
3605
3758
  return ret;
3606
3759
  }
3607
- /**
3608
- * Get accounts
3609
- * @returns {Promise<BaseAccount[]>}
3610
- */
3611
- getAccounts() {
3612
- const ret = wasm.grpcclient_getAccounts(this.__wbg_ptr);
3613
- return ret;
3614
- }
3615
- /**
3616
- * Retrieves the verified Celestia coin balance for the address.
3617
- *
3618
- * # Notes
3619
- *
3620
- * This returns the verified balance which is the one that was reported by
3621
- * the previous network block. In other words, if you transfer some coins,
3622
- * you need to wait 1 more block in order to see the new balance. If you want
3623
- * something more immediate then use [`GrpcClient::get_balance`].
3624
- * @param {string} address
3625
- * @param {ExtendedHeader} header
3626
- * @returns {Promise<Coin>}
3627
- */
3628
- getVerifiedBalance(address, header) {
3629
- const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3630
- const len0 = WASM_VECTOR_LEN;
3631
- _assertClass(header, ExtendedHeader);
3632
- const ret = wasm.grpcclient_getVerifiedBalance(this.__wbg_ptr, ptr0, len0, header.__wbg_ptr);
3633
- return ret;
3634
- }
3635
3760
  /**
3636
3761
  * Retrieves the Celestia coin balance for the given address.
3637
3762
  * @param {string} address
@@ -3647,33 +3772,135 @@ export class GrpcClient {
3647
3772
  return ret;
3648
3773
  }
3649
3774
  /**
3650
- * Get balance of all coins
3651
- * @param {string} address
3652
- * @returns {Promise<Coin[]>}
3775
+ * Broadcast prepared and serialised transaction
3776
+ * @param {Uint8Array} tx_bytes
3777
+ * @param {BroadcastMode} mode
3778
+ * @returns {Promise<TxResponse>}
3653
3779
  */
3654
- getAllBalances(address) {
3655
- const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3656
- const len0 = WASM_VECTOR_LEN;
3657
- const ret = wasm.grpcclient_getAllBalances(this.__wbg_ptr, ptr0, len0);
3780
+ broadcastTx(tx_bytes, mode) {
3781
+ const ptr0 = passArray8ToWasm0(tx_bytes, wasm.__wbindgen_malloc);
3782
+ const len0 = WASM_VECTOR_LEN;
3783
+ _assertClass(mode, BroadcastMode);
3784
+ const ret = wasm.grpcclient_broadcastTx(this.__wbg_ptr, ptr0, len0, mode.__wbg_ptr);
3658
3785
  return ret;
3659
3786
  }
3660
3787
  /**
3661
- * Get balance of all spendable coins
3662
- * @param {string} address
3663
- * @returns {Promise<Coin[]>}
3788
+ * Get accounts
3789
+ * @returns {Promise<BaseAccount[]>}
3664
3790
  */
3665
- getSpendableBalances(address) {
3666
- const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3791
+ getAccounts() {
3792
+ const ret = wasm.grpcclient_getAccounts(this.__wbg_ptr);
3793
+ return ret;
3794
+ }
3795
+ /**
3796
+ * Submit blobs to the celestia network.
3797
+ *
3798
+ * # Example
3799
+ * ```js
3800
+ * const ns = Namespace.newV0(new Uint8Array([97, 98, 99]));
3801
+ * const data = new Uint8Array([100, 97, 116, 97]);
3802
+ * const blob = new Blob(ns, data, AppVersion.latest());
3803
+ *
3804
+ * const txInfo = await txClient.submitBlobs([blob]);
3805
+ * await txClient.submitBlobs([blob], { gasLimit: 100000n, gasPrice: 0.02, memo: "foo" });
3806
+ * ```
3807
+ *
3808
+ * # Note
3809
+ *
3810
+ * Provided blobs will be consumed by this method, meaning
3811
+ * they will no longer be accessible. If this behavior is not desired,
3812
+ * consider using `Blob.clone()`.
3813
+ *
3814
+ * ```js
3815
+ * const blobs = [blob1, blob2, blob3];
3816
+ * await txClient.submitBlobs(blobs.map(b => b.clone()));
3817
+ * ```
3818
+ * @param {Blob[]} blobs
3819
+ * @param {TxConfig | null} [tx_config]
3820
+ * @returns {Promise<TxInfo>}
3821
+ */
3822
+ submitBlobs(blobs, tx_config) {
3823
+ const ptr0 = passArrayJsValueToWasm0(blobs, wasm.__wbindgen_malloc);
3667
3824
  const len0 = WASM_VECTOR_LEN;
3668
- const ret = wasm.grpcclient_getSpendableBalances(this.__wbg_ptr, ptr0, len0);
3825
+ const ret = wasm.grpcclient_submitBlobs(this.__wbg_ptr, ptr0, len0, isLikeNone(tx_config) ? 0 : addToExternrefTable0(tx_config));
3669
3826
  return ret;
3670
3827
  }
3671
3828
  /**
3672
- * Get total supply
3673
- * @returns {Promise<Coin[]>}
3829
+ * Submit message to the celestia network.
3830
+ *
3831
+ * # Example
3832
+ * ```js
3833
+ * import { Registry } from "@cosmjs/proto-signing";
3834
+ *
3835
+ * const registry = new Registry();
3836
+ * const sendMsg = {
3837
+ * typeUrl: "/cosmos.bank.v1beta1.MsgSend",
3838
+ * value: {
3839
+ * fromAddress: "celestia169s50psyj2f4la9a2235329xz7rk6c53zhw9mm",
3840
+ * toAddress: "celestia1t52q7uqgnjfzdh3wx5m5phvma3umrq8k6tq2p9",
3841
+ * amount: [{ denom: "utia", amount: "10000" }],
3842
+ * },
3843
+ * };
3844
+ * const sendMsgAny = registry.encodeAsAny(sendMsg);
3845
+ *
3846
+ * const txInfo = await txClient.submitMessage(sendMsgAny);
3847
+ * ```
3848
+ * @param {ProtoAny} message
3849
+ * @param {TxConfig | null} [tx_config]
3850
+ * @returns {Promise<TxInfo>}
3674
3851
  */
3675
- getTotalSupply() {
3676
- const ret = wasm.grpcclient_getTotalSupply(this.__wbg_ptr);
3852
+ submitMessage(message, tx_config) {
3853
+ const ret = wasm.grpcclient_submitMessage(this.__wbg_ptr, message, isLikeNone(tx_config) ? 0 : addToExternrefTable0(tx_config));
3854
+ return ret;
3855
+ }
3856
+ /**
3857
+ * Broadcast blobs to the celestia network, and return without confirming.
3858
+ *
3859
+ * # Example
3860
+ * ```js
3861
+ * const ns = Namespace.newV0(new Uint8Array([97, 98, 99]));
3862
+ * const data = new Uint8Array([100, 97, 116, 97]);
3863
+ * const blob = new Blob(ns, data, AppVersion.latest());
3864
+ *
3865
+ * const broadcastedTx = await txClient.broadcastBlobs([blob]);
3866
+ * console.log("Tx hash:", broadcastedTx.hash);
3867
+ * const txInfo = await txClient.confirmTx(broadcastedTx);
3868
+ * ```
3869
+ *
3870
+ * # Note
3871
+ *
3872
+ * Provided blobs will be consumed by this method, meaning
3873
+ * they will no longer be accessible. If this behavior is not desired,
3874
+ * consider using `Blob.clone()`.
3875
+ *
3876
+ * ```js
3877
+ * const blobs = [blob1, blob2, blob3];
3878
+ * await txClient.broadcastBlobs(blobs.map(b => b.clone()));
3879
+ * ```
3880
+ * @param {Blob[]} blobs
3881
+ * @param {TxConfig | null} [tx_config]
3882
+ * @returns {Promise<BroadcastedTx>}
3883
+ */
3884
+ broadcastBlobs(blobs, tx_config) {
3885
+ const ptr0 = passArrayJsValueToWasm0(blobs, wasm.__wbindgen_malloc);
3886
+ const len0 = WASM_VECTOR_LEN;
3887
+ const ret = wasm.grpcclient_broadcastBlobs(this.__wbg_ptr, ptr0, len0, isLikeNone(tx_config) ? 0 : addToExternrefTable0(tx_config));
3888
+ return ret;
3889
+ }
3890
+ /**
3891
+ * Get auth params
3892
+ * @returns {Promise<AuthParams>}
3893
+ */
3894
+ getAuthParams() {
3895
+ const ret = wasm.grpcclient_getAuthParams(this.__wbg_ptr);
3896
+ return ret;
3897
+ }
3898
+ /**
3899
+ * Get blob params
3900
+ * @returns {Promise<BlobParams>}
3901
+ */
3902
+ getBlobParams() {
3903
+ const ret = wasm.grpcclient_getBlobParams(this.__wbg_ptr);
3677
3904
  return ret;
3678
3905
  }
3679
3906
  /**
@@ -3684,6 +3911,17 @@ export class GrpcClient {
3684
3911
  const ret = wasm.grpcclient_get_node_config(this.__wbg_ptr);
3685
3912
  return ret;
3686
3913
  }
3914
+ /**
3915
+ * Get balance of all coins
3916
+ * @param {string} address
3917
+ * @returns {Promise<Coin[]>}
3918
+ */
3919
+ getAllBalances(address) {
3920
+ const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3921
+ const len0 = WASM_VECTOR_LEN;
3922
+ const ret = wasm.grpcclient_getAllBalances(this.__wbg_ptr, ptr0, len0);
3923
+ return ret;
3924
+ }
3687
3925
  /**
3688
3926
  * Get latest block
3689
3927
  * @returns {Promise<Block>}
@@ -3692,6 +3930,57 @@ export class GrpcClient {
3692
3930
  const ret = wasm.grpcclient_getLatestBlock(this.__wbg_ptr);
3693
3931
  return ret;
3694
3932
  }
3933
+ /**
3934
+ * Get total supply
3935
+ * @returns {Promise<Coin[]>}
3936
+ */
3937
+ getTotalSupply() {
3938
+ const ret = wasm.grpcclient_getTotalSupply(this.__wbg_ptr);
3939
+ return ret;
3940
+ }
3941
+ /**
3942
+ * Broadcast message to the celestia network, and return without confirming.
3943
+ *
3944
+ * # Example
3945
+ * ```js
3946
+ * import { Registry } from "@cosmjs/proto-signing";
3947
+ *
3948
+ * const registry = new Registry();
3949
+ * const sendMsg = {
3950
+ * typeUrl: "/cosmos.bank.v1beta1.MsgSend",
3951
+ * value: {
3952
+ * fromAddress: "celestia169s50psyj2f4la9a2235329xz7rk6c53zhw9mm",
3953
+ * toAddress: "celestia1t52q7uqgnjfzdh3wx5m5phvma3umrq8k6tq2p9",
3954
+ * amount: [{ denom: "utia", amount: "10000" }],
3955
+ * },
3956
+ * };
3957
+ * const sendMsgAny = registry.encodeAsAny(sendMsg);
3958
+ *
3959
+ * const broadcastedTx = await txClient.broadcastMessage(sendMsgAny);
3960
+ * console.log("Tx hash:", broadcastedTx.hash);
3961
+ * const txInfo = await txClient.confirmTx(broadcastedTx);
3962
+ * ```
3963
+ * @param {ProtoAny} message
3964
+ * @param {TxConfig | null} [tx_config]
3965
+ * @returns {Promise<BroadcastedTx>}
3966
+ */
3967
+ broadcastMessage(message, tx_config) {
3968
+ const ret = wasm.grpcclient_broadcastMessage(this.__wbg_ptr, message, isLikeNone(tx_config) ? 0 : addToExternrefTable0(tx_config));
3969
+ return ret;
3970
+ }
3971
+ /**
3972
+ * Estimate gas price for given transaction priority based
3973
+ * on the gas prices of the transactions in the last five blocks.
3974
+ *
3975
+ * If no transaction is found in the last five blocks, return the network
3976
+ * min gas price.
3977
+ * @param {TxPriority} priority
3978
+ * @returns {Promise<number>}
3979
+ */
3980
+ estimateGasPrice(priority) {
3981
+ const ret = wasm.grpcclient_estimateGasPrice(this.__wbg_ptr, priority);
3982
+ return ret;
3983
+ }
3695
3984
  /**
3696
3985
  * Get block by height
3697
3986
  * @param {bigint} height
@@ -3702,32 +3991,34 @@ export class GrpcClient {
3702
3991
  return ret;
3703
3992
  }
3704
3993
  /**
3705
- * Issue a direct ABCI query to the application
3706
- * @param {Uint8Array} data
3707
- * @param {string} path
3708
- * @param {bigint} height
3709
- * @param {boolean} prove
3710
- * @returns {Promise<AbciQueryResponse>}
3994
+ * Retrieves the verified Celestia coin balance for the address.
3995
+ *
3996
+ * # Notes
3997
+ *
3998
+ * This returns the verified balance which is the one that was reported by
3999
+ * the previous network block. In other words, if you transfer some coins,
4000
+ * you need to wait 1 more block in order to see the new balance. If you want
4001
+ * something more immediate then use [`GrpcClient::get_balance`].
4002
+ * @param {string} address
4003
+ * @param {ExtendedHeader} header
4004
+ * @returns {Promise<Coin>}
3711
4005
  */
3712
- abciQuery(data, path, height, prove) {
3713
- const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
4006
+ getVerifiedBalance(address, header) {
4007
+ const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3714
4008
  const len0 = WASM_VECTOR_LEN;
3715
- const ptr1 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3716
- const len1 = WASM_VECTOR_LEN;
3717
- const ret = wasm.grpcclient_abciQuery(this.__wbg_ptr, ptr0, len0, ptr1, len1, height, prove);
4009
+ _assertClass(header, ExtendedHeader);
4010
+ const ret = wasm.grpcclient_getVerifiedBalance(this.__wbg_ptr, ptr0, len0, header.__wbg_ptr);
3718
4011
  return ret;
3719
4012
  }
3720
4013
  /**
3721
- * Broadcast prepared and serialised transaction
3722
- * @param {Uint8Array} tx_bytes
3723
- * @param {BroadcastMode} mode
3724
- * @returns {Promise<TxResponse>}
4014
+ * Get balance of all spendable coins
4015
+ * @param {string} address
4016
+ * @returns {Promise<Coin[]>}
3725
4017
  */
3726
- broadcastTx(tx_bytes, mode) {
3727
- const ptr0 = passArray8ToWasm0(tx_bytes, wasm.__wbindgen_malloc);
4018
+ getSpendableBalances(address) {
4019
+ const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3728
4020
  const len0 = WASM_VECTOR_LEN;
3729
- _assertClass(mode, BroadcastMode);
3730
- const ret = wasm.grpcclient_broadcastTx(this.__wbg_ptr, ptr0, len0, mode.__wbg_ptr);
4021
+ const ret = wasm.grpcclient_getSpendableBalances(this.__wbg_ptr, ptr0, len0);
3731
4022
  return ret;
3732
4023
  }
3733
4024
  /**
@@ -3741,6 +4032,14 @@ export class GrpcClient {
3741
4032
  const ret = wasm.grpcclient_getTx(this.__wbg_ptr, ptr0, len0);
3742
4033
  return ret;
3743
4034
  }
4035
+ /**
4036
+ * Chain id of the client
4037
+ * @returns {Promise<string>}
4038
+ */
4039
+ get chainId() {
4040
+ const ret = wasm.grpcclient_chainId(this.__wbg_ptr);
4041
+ return ret;
4042
+ }
3744
4043
  /**
3745
4044
  * Simulate prepared and serialised transaction, returning simulated gas usage
3746
4045
  * @param {Uint8Array} tx_bytes
@@ -3753,12 +4052,15 @@ export class GrpcClient {
3753
4052
  return ret;
3754
4053
  }
3755
4054
  /**
3756
- * Get blob params
3757
- * @returns {Promise<BlobParams>}
4055
+ * Create a builder for [`GrpcClient`] connected to `url`
4056
+ * @param {string} url
4057
+ * @returns {GrpcClientBuilder}
3758
4058
  */
3759
- getBlobParams() {
3760
- const ret = wasm.grpcclient_getBlobParams(this.__wbg_ptr);
3761
- return ret;
4059
+ static withUrl(url) {
4060
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4061
+ const len0 = WASM_VECTOR_LEN;
4062
+ const ret = wasm.grpcclient_withUrl(ptr0, len0);
4063
+ return GrpcClientBuilder.__wrap(ret);
3762
4064
  }
3763
4065
  /**
3764
4066
  * Get status of the transaction
@@ -3772,94 +4074,18 @@ export class GrpcClient {
3772
4074
  return ret;
3773
4075
  }
3774
4076
  /**
3775
- * Estimate gas price for given transaction priority based
3776
- * on the gas prices of the transactions in the last five blocks.
4077
+ * Create a builder for [`GrpcClient`] with multiple URL endpoints for fallback support.
3777
4078
  *
3778
- * If no transaction is found in the last five blocks, return the network
3779
- * min gas price.
3780
- * @param {TxPriority} priority
3781
- * @returns {Promise<number>}
3782
- */
3783
- estimateGasPrice(priority) {
3784
- const ret = wasm.grpcclient_estimateGasPrice(this.__wbg_ptr, priority);
3785
- return ret;
3786
- }
3787
- /**
3788
- * Chain id of the client
3789
- * @returns {Promise<string>}
3790
- */
3791
- get chainId() {
3792
- const ret = wasm.grpcclient_chainId(this.__wbg_ptr);
3793
- return ret;
3794
- }
3795
- /**
3796
- * AppVersion of the client
3797
- * @returns {Promise<AppVersion>}
3798
- */
3799
- get appVersion() {
3800
- const ret = wasm.grpcclient_appVersion(this.__wbg_ptr);
3801
- return ret;
3802
- }
3803
- /**
3804
- * Submit blobs to the celestia network.
3805
- *
3806
- * # Example
3807
- * ```js
3808
- * const ns = Namespace.newV0(new Uint8Array([97, 98, 99]));
3809
- * const data = new Uint8Array([100, 97, 116, 97]);
3810
- * const blob = new Blob(ns, data, AppVersion.latest());
3811
- *
3812
- * const txInfo = await txClient.submitBlobs([blob]);
3813
- * await txClient.submitBlobs([blob], { gasLimit: 100000n, gasPrice: 0.02, memo: "foo" });
3814
- * ```
3815
- *
3816
- * # Note
3817
- *
3818
- * Provided blobs will be consumed by this method, meaning
3819
- * they will no longer be accessible. If this behavior is not desired,
3820
- * consider using `Blob.clone()`.
3821
- *
3822
- * ```js
3823
- * const blobs = [blob1, blob2, blob3];
3824
- * await txClient.submitBlobs(blobs.map(b => b.clone()));
3825
- * ```
3826
- * @param {Blob[]} blobs
3827
- * @param {TxConfig | null} [tx_config]
3828
- * @returns {Promise<TxInfo>}
4079
+ * When multiple endpoints are configured, the client will automatically
4080
+ * fall back to the next endpoint if a network-related error occurs.
4081
+ * @param {string[]} urls
4082
+ * @returns {GrpcClientBuilder}
3829
4083
  */
3830
- submitBlobs(blobs, tx_config) {
3831
- const ptr0 = passArrayJsValueToWasm0(blobs, wasm.__wbindgen_malloc);
4084
+ static withUrls(urls) {
4085
+ const ptr0 = passArrayJsValueToWasm0(urls, wasm.__wbindgen_malloc);
3832
4086
  const len0 = WASM_VECTOR_LEN;
3833
- const ret = wasm.grpcclient_submitBlobs(this.__wbg_ptr, ptr0, len0, isLikeNone(tx_config) ? 0 : addToExternrefTable0(tx_config));
3834
- return ret;
3835
- }
3836
- /**
3837
- * Submit message to the celestia network.
3838
- *
3839
- * # Example
3840
- * ```js
3841
- * import { Registry } from "@cosmjs/proto-signing";
3842
- *
3843
- * const registry = new Registry();
3844
- * const sendMsg = {
3845
- * typeUrl: "/cosmos.bank.v1beta1.MsgSend",
3846
- * value: {
3847
- * fromAddress: "celestia169s50psyj2f4la9a2235329xz7rk6c53zhw9mm",
3848
- * toAddress: "celestia1t52q7uqgnjfzdh3wx5m5phvma3umrq8k6tq2p9",
3849
- * amount: [{ denom: "utia", amount: "10000" }],
3850
- * },
3851
- * };
3852
- * const sendMsgAny = registry.encodeAsAny(sendMsg);
3853
- *
3854
- * const txInfo = await txClient.submitMessage(sendMsgAny);
3855
- * ```
3856
- * @param {ProtoAny} message
3857
- * @param {TxConfig | null} [tx_config]
3858
- * @returns {Promise<TxInfo>}
3859
- */
3860
- submitMessage(message, tx_config) {
3861
- const ret = wasm.grpcclient_submitMessage(this.__wbg_ptr, message, isLikeNone(tx_config) ? 0 : addToExternrefTable0(tx_config));
3862
- return ret;
4087
+ const ret = wasm.grpcclient_withUrls(ptr0, len0);
4088
+ return GrpcClientBuilder.__wrap(ret);
3863
4089
  }
3864
4090
  }
3865
4091
 
@@ -3876,6 +4102,7 @@ const GrpcClientBuilderFinalization = (typeof FinalizationRegistry === 'undefine
3876
4102
  * ```js
3877
4103
  * const client = await GrpcClient
3878
4104
  * .withUrl("http://127.0.0.1:18080")
4105
+ * .withTimeout(5000) // Optional: 5 second timeout
3879
4106
  * .build()
3880
4107
  * ```
3881
4108
  *
@@ -3938,18 +4165,52 @@ export class GrpcClientBuilder {
3938
4165
  wasm.__wbg_grpcclientbuilder_free(ptr, 0);
3939
4166
  }
3940
4167
  /**
3941
- * Set the `url` of the grpc-web server to connect to
4168
+ * Sets the request timeout in milliseconds, overriding default one from the transport.
3942
4169
  *
3943
4170
  * Note that this method **consumes** builder and returns updated instance of it.
3944
4171
  * Make sure to re-assign it if you keep builder in a variable.
3945
- * @param {string} url
4172
+ * @param {bigint} timeout_ms
3946
4173
  * @returns {GrpcClientBuilder}
3947
4174
  */
3948
- withUrl(url) {
4175
+ withTimeout(timeout_ms) {
3949
4176
  const ptr = this.__destroy_into_raw();
3950
- const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4177
+ const ret = wasm.grpcclientbuilder_withTimeout(ptr, timeout_ms);
4178
+ return GrpcClientBuilder.__wrap(ret);
4179
+ }
4180
+ /**
4181
+ * Appends ascii metadata to all requests made by the client.
4182
+ *
4183
+ * Note that this method **consumes** builder and returns updated instance of it.
4184
+ * Make sure to re-assign it if you keep builder in a variable.
4185
+ * @param {string} key
4186
+ * @param {string} value
4187
+ * @returns {GrpcClientBuilder}
4188
+ */
4189
+ withMetadata(key, value) {
4190
+ const ptr = this.__destroy_into_raw();
4191
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3951
4192
  const len0 = WASM_VECTOR_LEN;
3952
- const ret = wasm.grpcclientbuilder_withUrl(ptr, ptr0, len0);
4193
+ const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4194
+ const len1 = WASM_VECTOR_LEN;
4195
+ const ret = wasm.grpcclientbuilder_withMetadata(ptr, ptr0, len0, ptr1, len1);
4196
+ return GrpcClientBuilder.__wrap(ret);
4197
+ }
4198
+ /**
4199
+ * Appends binary metadata to all requests made by the client.
4200
+ *
4201
+ * Keys for binary metadata must have `-bin` suffix.
4202
+ *
4203
+ * Note that this method **consumes** builder and returns updated instance of it.
4204
+ * Make sure to re-assign it if you keep builder in a variable.
4205
+ * @param {string} key
4206
+ * @param {Uint8Array} value
4207
+ * @returns {GrpcClientBuilder}
4208
+ */
4209
+ withMetadataBin(key, value) {
4210
+ const ptr = this.__destroy_into_raw();
4211
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4212
+ const len0 = WASM_VECTOR_LEN;
4213
+ const ret = wasm.grpcclientbuilder_withMetadataBin(ptr, ptr0, len0, value);
3953
4214
  return GrpcClientBuilder.__wrap(ret);
3954
4215
  }
3955
4216
  /**
@@ -3970,53 +4231,50 @@ export class GrpcClientBuilder {
3970
4231
  return GrpcClientBuilder.__wrap(ret[0]);
3971
4232
  }
3972
4233
  /**
3973
- * Appends ascii metadata to all requests made by the client.
4234
+ * build gRPC client
4235
+ * @returns {GrpcClient}
4236
+ */
4237
+ build() {
4238
+ const ptr = this.__destroy_into_raw();
4239
+ const ret = wasm.grpcclientbuilder_build(ptr);
4240
+ if (ret[2]) {
4241
+ throw takeFromExternrefTable0(ret[1]);
4242
+ }
4243
+ return GrpcClient.__wrap(ret[0]);
4244
+ }
4245
+ /**
4246
+ * Set the `url` of the grpc-web server to connect to
3974
4247
  *
3975
4248
  * Note that this method **consumes** builder and returns updated instance of it.
3976
4249
  * Make sure to re-assign it if you keep builder in a variable.
3977
- * @param {string} key
3978
- * @param {string} value
4250
+ * @param {string} url
3979
4251
  * @returns {GrpcClientBuilder}
3980
4252
  */
3981
- withMetadata(key, value) {
4253
+ withUrl(url) {
3982
4254
  const ptr = this.__destroy_into_raw();
3983
- const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3984
- const len0 = WASM_VECTOR_LEN;
3985
- const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3986
- const len1 = WASM_VECTOR_LEN;
3987
- const ret = wasm.grpcclientbuilder_withMetadata(ptr, ptr0, len0, ptr1, len1);
4255
+ const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4256
+ const len0 = WASM_VECTOR_LEN;
4257
+ const ret = wasm.grpcclientbuilder_withUrl(ptr, ptr0, len0);
3988
4258
  return GrpcClientBuilder.__wrap(ret);
3989
4259
  }
3990
4260
  /**
3991
- * Appends binary metadata to all requests made by the client.
4261
+ * Add multiple URL endpoints at once for fallback support.
3992
4262
  *
3993
- * Keys for binary metadata must have `-bin` suffix.
4263
+ * When multiple endpoints are configured, the client will automatically
4264
+ * fall back to the next endpoint if a network-related error occurs.
3994
4265
  *
3995
4266
  * Note that this method **consumes** builder and returns updated instance of it.
3996
4267
  * Make sure to re-assign it if you keep builder in a variable.
3997
- * @param {string} key
3998
- * @param {Uint8Array} value
4268
+ * @param {string[]} urls
3999
4269
  * @returns {GrpcClientBuilder}
4000
4270
  */
4001
- withMetadataBin(key, value) {
4271
+ withUrls(urls) {
4002
4272
  const ptr = this.__destroy_into_raw();
4003
- const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4273
+ const ptr0 = passArrayJsValueToWasm0(urls, wasm.__wbindgen_malloc);
4004
4274
  const len0 = WASM_VECTOR_LEN;
4005
- const ret = wasm.grpcclientbuilder_withMetadataBin(ptr, ptr0, len0, value);
4275
+ const ret = wasm.grpcclientbuilder_withUrls(ptr, ptr0, len0);
4006
4276
  return GrpcClientBuilder.__wrap(ret);
4007
4277
  }
4008
- /**
4009
- * build gRPC client
4010
- * @returns {GrpcClient}
4011
- */
4012
- build() {
4013
- const ptr = this.__destroy_into_raw();
4014
- const ret = wasm.grpcclientbuilder_build(ptr);
4015
- if (ret[2]) {
4016
- throw takeFromExternrefTable0(ret[1]);
4017
- }
4018
- return GrpcClient.__wrap(ret[0]);
4019
- }
4020
4278
  }
4021
4279
 
4022
4280
  const HeaderFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -4382,13 +4640,6 @@ export class IntoUnderlyingByteSource {
4382
4640
  const ptr = this.__destroy_into_raw();
4383
4641
  wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
4384
4642
  }
4385
- /**
4386
- * @returns {ReadableStreamType}
4387
- */
4388
- get type() {
4389
- const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
4390
- return __wbindgen_enum_ReadableStreamType[ret];
4391
- }
4392
4643
  /**
4393
4644
  * @returns {number}
4394
4645
  */
@@ -4396,6 +4647,14 @@ export class IntoUnderlyingByteSource {
4396
4647
  const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
4397
4648
  return ret >>> 0;
4398
4649
  }
4650
+ /**
4651
+ * @param {ReadableByteStreamController} controller
4652
+ * @returns {Promise<any>}
4653
+ */
4654
+ pull(controller) {
4655
+ const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, controller);
4656
+ return ret;
4657
+ }
4399
4658
  /**
4400
4659
  * @param {ReadableByteStreamController} controller
4401
4660
  */
@@ -4403,12 +4662,11 @@ export class IntoUnderlyingByteSource {
4403
4662
  wasm.intounderlyingbytesource_start(this.__wbg_ptr, controller);
4404
4663
  }
4405
4664
  /**
4406
- * @param {ReadableByteStreamController} controller
4407
- * @returns {Promise<any>}
4665
+ * @returns {ReadableStreamType}
4408
4666
  */
4409
- pull(controller) {
4410
- const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, controller);
4411
- return ret;
4667
+ get type() {
4668
+ const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
4669
+ return __wbindgen_enum_ReadableStreamType[ret];
4412
4670
  }
4413
4671
  cancel() {
4414
4672
  const ptr = this.__destroy_into_raw();
@@ -4434,11 +4692,12 @@ export class IntoUnderlyingSink {
4434
4692
  wasm.__wbg_intounderlyingsink_free(ptr, 0);
4435
4693
  }
4436
4694
  /**
4437
- * @param {any} chunk
4695
+ * @param {any} reason
4438
4696
  * @returns {Promise<any>}
4439
4697
  */
4440
- write(chunk) {
4441
- const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, chunk);
4698
+ abort(reason) {
4699
+ const ptr = this.__destroy_into_raw();
4700
+ const ret = wasm.intounderlyingsink_abort(ptr, reason);
4442
4701
  return ret;
4443
4702
  }
4444
4703
  /**
@@ -4450,12 +4709,11 @@ export class IntoUnderlyingSink {
4450
4709
  return ret;
4451
4710
  }
4452
4711
  /**
4453
- * @param {any} reason
4712
+ * @param {any} chunk
4454
4713
  * @returns {Promise<any>}
4455
4714
  */
4456
- abort(reason) {
4457
- const ptr = this.__destroy_into_raw();
4458
- const ret = wasm.intounderlyingsink_abort(ptr, reason);
4715
+ write(chunk) {
4716
+ const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, chunk);
4459
4717
  return ret;
4460
4718
  }
4461
4719
  }
@@ -4491,6 +4749,69 @@ export class IntoUnderlyingSource {
4491
4749
  }
4492
4750
  }
4493
4751
 
4752
+ const IteratorResultObjectFinalization = (typeof FinalizationRegistry === 'undefined')
4753
+ ? { register: () => {}, unregister: () => {} }
4754
+ : new FinalizationRegistry(ptr => wasm.__wbg_iteratorresultobject_free(ptr >>> 0, 1));
4755
+
4756
+ export class IteratorResultObject {
4757
+
4758
+ static __wrap(ptr) {
4759
+ ptr = ptr >>> 0;
4760
+ const obj = Object.create(IteratorResultObject.prototype);
4761
+ obj.__wbg_ptr = ptr;
4762
+ IteratorResultObjectFinalization.register(obj, obj.__wbg_ptr, obj);
4763
+ return obj;
4764
+ }
4765
+
4766
+ __destroy_into_raw() {
4767
+ const ptr = this.__wbg_ptr;
4768
+ this.__wbg_ptr = 0;
4769
+ IteratorResultObjectFinalization.unregister(this);
4770
+ return ptr;
4771
+ }
4772
+
4773
+ free() {
4774
+ const ptr = this.__destroy_into_raw();
4775
+ wasm.__wbg_iteratorresultobject_free(ptr, 0);
4776
+ }
4777
+ /**
4778
+ * Has the value true if the iterator is past the end of the
4779
+ * iterated sequence. In this case value optionally specifies
4780
+ * the return value of the iterator.
4781
+ * @returns {boolean}
4782
+ */
4783
+ get done() {
4784
+ const ret = wasm.__wbg_get_iteratorresultobject_done(this.__wbg_ptr);
4785
+ return ret !== 0;
4786
+ }
4787
+ /**
4788
+ * Has the value true if the iterator is past the end of the
4789
+ * iterated sequence. In this case value optionally specifies
4790
+ * the return value of the iterator.
4791
+ * @param {boolean} arg0
4792
+ */
4793
+ set done(arg0) {
4794
+ wasm.__wbg_set_iteratorresultobject_done(this.__wbg_ptr, arg0);
4795
+ }
4796
+ /**
4797
+ * Any JavaScript value returned by the iterator.
4798
+ * Can be omitted when done is true.
4799
+ * @returns {any}
4800
+ */
4801
+ get value() {
4802
+ const ret = wasm.__wbg_get_iteratorresultobject_value(this.__wbg_ptr);
4803
+ return ret;
4804
+ }
4805
+ /**
4806
+ * Any JavaScript value returned by the iterator.
4807
+ * Can be omitted when done is true.
4808
+ * @param {any} arg0
4809
+ */
4810
+ set value(arg0) {
4811
+ wasm.__wbg_set_iteratorresultobject_value(this.__wbg_ptr, arg0);
4812
+ }
4813
+ }
4814
+
4494
4815
  const JsBitVectorFinalization = (typeof FinalizationRegistry === 'undefined')
4495
4816
  ? { register: () => {}, unregister: () => {} }
4496
4817
  : new FinalizationRegistry(ptr => wasm.__wbg_jsbitvector_free(ptr >>> 0, 1));
@@ -4823,7 +5144,7 @@ export class JsValidatorInfo {
4823
5144
  * @returns {bigint}
4824
5145
  */
4825
5146
  get power() {
4826
- const ret = wasm.__wbg_get_data_square_size(this.__wbg_ptr);
5147
+ const ret = wasm.__wbg_get_jsvalidatorinfo_power(this.__wbg_ptr);
4827
5148
  return BigInt.asUintN(64, ret);
4828
5149
  }
4829
5150
  /**
@@ -4831,7 +5152,7 @@ export class JsValidatorInfo {
4831
5152
  * @param {bigint} arg0
4832
5153
  */
4833
5154
  set power(arg0) {
4834
- wasm.__wbg_set_data_square_size(this.__wbg_ptr, arg0);
5155
+ wasm.__wbg_set_jsvalidatorinfo_power(this.__wbg_ptr, arg0);
4835
5156
  }
4836
5157
  /**
4837
5158
  * Validator name
@@ -5019,6 +5340,21 @@ export class ModeInfo {
5019
5340
  const ptr = this.__destroy_into_raw();
5020
5341
  wasm.__wbg_modeinfo_free(ptr, 0);
5021
5342
  }
5343
+ /**
5344
+ * Multi is the mode info for a multisig public key
5345
+ * mode_infos is the corresponding modes of the signers of the multisig
5346
+ * which could include nested multisig public keys
5347
+ * @returns {ModeInfo[] | undefined}
5348
+ */
5349
+ get mode_infos() {
5350
+ const ret = wasm.modeinfo_mode_infos(this.__wbg_ptr);
5351
+ let v1;
5352
+ if (ret[0] !== 0) {
5353
+ v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
5354
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
5355
+ }
5356
+ return v1;
5357
+ }
5022
5358
  /**
5023
5359
  * Return signature mode for the stored signature(s)
5024
5360
  * @returns {SignatureMode}
@@ -5046,21 +5382,6 @@ export class ModeInfo {
5046
5382
  const ret = wasm.modeinfo_bitarray(this.__wbg_ptr);
5047
5383
  return ret === 0 ? undefined : JsBitVector.__wrap(ret);
5048
5384
  }
5049
- /**
5050
- * Multi is the mode info for a multisig public key
5051
- * mode_infos is the corresponding modes of the signers of the multisig
5052
- * which could include nested multisig public keys
5053
- * @returns {ModeInfo[] | undefined}
5054
- */
5055
- get mode_infos() {
5056
- const ret = wasm.modeinfo_mode_infos(this.__wbg_ptr);
5057
- let v1;
5058
- if (ret[0] !== 0) {
5059
- v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
5060
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
5061
- }
5062
- return v1;
5063
- }
5064
5385
  }
5065
5386
 
5066
5387
  const NamespaceFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -5100,14 +5421,14 @@ export class Namespace {
5100
5421
  toJSON() {
5101
5422
  return {
5102
5423
  NS_SIZE: this.NS_SIZE,
5424
+ version: this.version,
5103
5425
  TRANSACTION: this.TRANSACTION,
5426
+ PARITY_SHARE: this.PARITY_SHARE,
5104
5427
  PAY_FOR_BLOB: this.PAY_FOR_BLOB,
5105
- PRIMARY_RESERVED_PADDING: this.PRIMARY_RESERVED_PADDING,
5428
+ TAIL_PADDING: this.TAIL_PADDING,
5106
5429
  MAX_PRIMARY_RESERVED: this.MAX_PRIMARY_RESERVED,
5107
5430
  MIN_SECONDARY_RESERVED: this.MIN_SECONDARY_RESERVED,
5108
- TAIL_PADDING: this.TAIL_PADDING,
5109
- PARITY_SHARE: this.PARITY_SHARE,
5110
- version: this.version,
5431
+ PRIMARY_RESERVED_PADDING: this.PRIMARY_RESERVED_PADDING,
5111
5432
  id: this.id,
5112
5433
  };
5113
5434
  }
@@ -5136,50 +5457,69 @@ export class Namespace {
5136
5457
  return ret >>> 0;
5137
5458
  }
5138
5459
  /**
5139
- * Primary reserved [`Namespace`] for the compact `Share`s with `cosmos SDK` transactions.
5140
- * @returns {Namespace}
5460
+ * Returns the first byte indicating the version of the [`Namespace`].
5461
+ * @returns {number}
5141
5462
  */
5142
- static get TRANSACTION() {
5143
- const ret = wasm.namespace_TRANSACTION();
5144
- return Namespace.__wrap(ret);
5463
+ get version() {
5464
+ const ret = wasm.namespace_version(this.__wbg_ptr);
5465
+ return ret;
5145
5466
  }
5146
5467
  /**
5147
- * Primary reserved [`Namespace`] for the compact Shares with MsgPayForBlobs transactions.
5148
- * @returns {Namespace}
5468
+ * Converts the [`Namespace`] to a byte slice.
5469
+ * @returns {Uint8Array}
5149
5470
  */
5150
- static get PAY_FOR_BLOB() {
5151
- const ret = wasm.namespace_PAY_FOR_BLOB();
5152
- return Namespace.__wrap(ret);
5471
+ asBytes() {
5472
+ const ret = wasm.namespace_asBytes(this.__wbg_ptr);
5473
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
5474
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
5475
+ return v1;
5153
5476
  }
5154
5477
  /**
5155
- * Primary reserved [`Namespace`] for the `Share`s used for padding.
5478
+ * Create a new [`Namespace`] from the raw bytes.
5156
5479
  *
5157
- * `Share`s with this namespace are inserted after other shares from primary reserved namespace
5158
- * so that user-defined namespaces are correctly aligned in `ExtendedDataSquare`
5480
+ * # Errors
5481
+ *
5482
+ * This function will return an error if the slice length is different than
5483
+ * [`NS_SIZE`] or if the namespace is invalid. If you are constructing the
5484
+ * version `0` namespace, check [`newV0`].
5485
+ * @param {Uint8Array} raw
5159
5486
  * @returns {Namespace}
5160
5487
  */
5161
- static get PRIMARY_RESERVED_PADDING() {
5162
- const ret = wasm.namespace_MAX_PRIMARY_RESERVED();
5488
+ static fromRaw(raw) {
5489
+ const ptr0 = passArray8ToWasm0(raw, wasm.__wbindgen_malloc);
5490
+ const len0 = WASM_VECTOR_LEN;
5491
+ const ret = wasm.namespace_fromRaw(ptr0, len0);
5492
+ if (ret[2]) {
5493
+ throw takeFromExternrefTable0(ret[1]);
5494
+ }
5495
+ return Namespace.__wrap(ret[0]);
5496
+ }
5497
+ /**
5498
+ * Primary reserved [`Namespace`] for the compact `Share`s with `cosmos SDK` transactions.
5499
+ * @returns {Namespace}
5500
+ */
5501
+ static get TRANSACTION() {
5502
+ const ret = wasm.namespace_TRANSACTION();
5163
5503
  return Namespace.__wrap(ret);
5164
5504
  }
5165
5505
  /**
5166
- * Maximal primary reserved [`Namespace`].
5506
+ * The [`Namespace`] for `parity shares`.
5167
5507
  *
5168
- * Used to indicate the end of the primary reserved group.
5508
+ * It is the namespace with which all the `parity shares` from
5509
+ * `ExtendedDataSquare` are inserted to the `Nmt` when computing
5510
+ * merkle roots.
5169
5511
  * @returns {Namespace}
5170
5512
  */
5171
- static get MAX_PRIMARY_RESERVED() {
5172
- const ret = wasm.namespace_MAX_PRIMARY_RESERVED();
5513
+ static get PARITY_SHARE() {
5514
+ const ret = wasm.namespace_PARITY_SHARE();
5173
5515
  return Namespace.__wrap(ret);
5174
5516
  }
5175
5517
  /**
5176
- * Minimal secondary reserved [`Namespace`].
5177
- *
5178
- * Used to indicate the beginning of the secondary reserved group.
5518
+ * Primary reserved [`Namespace`] for the compact Shares with MsgPayForBlobs transactions.
5179
5519
  * @returns {Namespace}
5180
5520
  */
5181
- static get MIN_SECONDARY_RESERVED() {
5182
- const ret = wasm.namespace_MIN_SECONDARY_RESERVED();
5521
+ static get PAY_FOR_BLOB() {
5522
+ const ret = wasm.namespace_PAY_FOR_BLOB();
5183
5523
  return Namespace.__wrap(ret);
5184
5524
  }
5185
5525
  /**
@@ -5194,72 +5534,35 @@ export class Namespace {
5194
5534
  return Namespace.__wrap(ret);
5195
5535
  }
5196
5536
  /**
5197
- * The [`Namespace`] for `parity shares`.
5537
+ * Maximal primary reserved [`Namespace`].
5198
5538
  *
5199
- * It is the namespace with which all the `parity shares` from
5200
- * `ExtendedDataSquare` are inserted to the `Nmt` when computing
5201
- * merkle roots.
5539
+ * Used to indicate the end of the primary reserved group.
5202
5540
  * @returns {Namespace}
5203
5541
  */
5204
- static get PARITY_SHARE() {
5205
- const ret = wasm.namespace_PARITY_SHARE();
5542
+ static get MAX_PRIMARY_RESERVED() {
5543
+ const ret = wasm.namespace_MAX_PRIMARY_RESERVED();
5206
5544
  return Namespace.__wrap(ret);
5207
5545
  }
5208
5546
  /**
5209
- * Create a new [`Namespace`] version `0` with given id.
5210
- *
5211
- * Check [`Namespace::new_v0`] for more details.
5212
- *
5213
- * [`Namespace::new_v0`]: https://docs.rs/celestia-types/latest/celestia_types/nmt/struct.Namespace.html#method.new_v0
5214
- * @param {Uint8Array} id
5215
- * @returns {Namespace}
5216
- */
5217
- static newV0(id) {
5218
- const ptr0 = passArray8ToWasm0(id, wasm.__wbindgen_malloc);
5219
- const len0 = WASM_VECTOR_LEN;
5220
- const ret = wasm.namespace_newV0(ptr0, len0);
5221
- if (ret[2]) {
5222
- throw takeFromExternrefTable0(ret[1]);
5223
- }
5224
- return Namespace.__wrap(ret[0]);
5225
- }
5226
- /**
5227
- * Create a new [`Namespace`] from the raw bytes.
5228
- *
5229
- * # Errors
5230
- *
5231
- * This function will return an error if the slice length is different than
5232
- * [`NS_SIZE`] or if the namespace is invalid. If you are constructing the
5233
- * version `0` namespace, check [`newV0`].
5234
- * @param {Uint8Array} raw
5235
- * @returns {Namespace}
5236
- */
5237
- static fromRaw(raw) {
5238
- const ptr0 = passArray8ToWasm0(raw, wasm.__wbindgen_malloc);
5239
- const len0 = WASM_VECTOR_LEN;
5240
- const ret = wasm.namespace_fromRaw(ptr0, len0);
5241
- if (ret[2]) {
5242
- throw takeFromExternrefTable0(ret[1]);
5243
- }
5244
- return Namespace.__wrap(ret[0]);
5245
- }
5246
- /**
5247
- * Converts the [`Namespace`] to a byte slice.
5248
- * @returns {Uint8Array}
5547
+ * Minimal secondary reserved [`Namespace`].
5548
+ *
5549
+ * Used to indicate the beginning of the secondary reserved group.
5550
+ * @returns {Namespace}
5249
5551
  */
5250
- asBytes() {
5251
- const ret = wasm.namespace_asBytes(this.__wbg_ptr);
5252
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
5253
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
5254
- return v1;
5552
+ static get MIN_SECONDARY_RESERVED() {
5553
+ const ret = wasm.namespace_MIN_SECONDARY_RESERVED();
5554
+ return Namespace.__wrap(ret);
5255
5555
  }
5256
5556
  /**
5257
- * Returns the first byte indicating the version of the [`Namespace`].
5258
- * @returns {number}
5557
+ * Primary reserved [`Namespace`] for the `Share`s used for padding.
5558
+ *
5559
+ * `Share`s with this namespace are inserted after other shares from primary reserved namespace
5560
+ * so that user-defined namespaces are correctly aligned in `ExtendedDataSquare`
5561
+ * @returns {Namespace}
5259
5562
  */
5260
- get version() {
5261
- const ret = wasm.namespace_version(this.__wbg_ptr);
5262
- return ret;
5563
+ static get PRIMARY_RESERVED_PADDING() {
5564
+ const ret = wasm.namespace_MAX_PRIMARY_RESERVED();
5565
+ return Namespace.__wrap(ret);
5263
5566
  }
5264
5567
  /**
5265
5568
  * Returns the trailing 28 bytes indicating the id of the [`Namespace`].
@@ -5271,6 +5574,24 @@ export class Namespace {
5271
5574
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
5272
5575
  return v1;
5273
5576
  }
5577
+ /**
5578
+ * Create a new [`Namespace`] version `0` with given id.
5579
+ *
5580
+ * Check [`Namespace::new_v0`] for more details.
5581
+ *
5582
+ * [`Namespace::new_v0`]: https://docs.rs/celestia-types/latest/celestia_types/nmt/struct.Namespace.html#method.new_v0
5583
+ * @param {Uint8Array} id
5584
+ * @returns {Namespace}
5585
+ */
5586
+ static newV0(id) {
5587
+ const ptr0 = passArray8ToWasm0(id, wasm.__wbindgen_malloc);
5588
+ const len0 = WASM_VECTOR_LEN;
5589
+ const ret = wasm.namespace_newV0(ptr0, len0);
5590
+ if (ret[2]) {
5591
+ throw takeFromExternrefTable0(ret[1]);
5592
+ }
5593
+ return Namespace.__wrap(ret[0]);
5594
+ }
5274
5595
  }
5275
5596
 
5276
5597
  const NetworkInfoSnapshotFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -5375,24 +5696,6 @@ export class NodeClient {
5375
5696
  const ptr = this.__destroy_into_raw();
5376
5697
  wasm.__wbg_nodeclient_free(ptr, 0);
5377
5698
  }
5378
- /**
5379
- * Create a new connection to a Lumina node running in [`NodeWorker`]. Provided `port` is
5380
- * expected to have `MessagePort`-like interface for sending and receiving messages.
5381
- * @param {any} port
5382
- */
5383
- constructor(port) {
5384
- const ret = wasm.nodeclient_new(port);
5385
- return ret;
5386
- }
5387
- /**
5388
- * Establish a new connection to the existing worker over provided port
5389
- * @param {any} port
5390
- * @returns {Promise<void>}
5391
- */
5392
- addConnectionToWorker(port) {
5393
- const ret = wasm.nodeclient_addConnectionToWorker(this.__wbg_ptr, port);
5394
- return ret;
5395
- }
5396
5699
  /**
5397
5700
  * Check whether Lumina is currently running
5398
5701
  * @returns {Promise<boolean>}
@@ -5402,20 +5705,37 @@ export class NodeClient {
5402
5705
  return ret;
5403
5706
  }
5404
5707
  /**
5405
- * Start a node with the provided config, if it's not running
5406
- * @param {NodeConfig} config
5407
- * @returns {Promise<void>}
5708
+ * Get synced headers from the given heights range.
5709
+ *
5710
+ * If start of the range is undefined (None), the first returned header will be of height 1.
5711
+ * If end of the range is undefined (None), the last returned header will be the last header in the
5712
+ * store.
5713
+ *
5714
+ * # Errors
5715
+ *
5716
+ * If range contains a height of a header that is not found in the store.
5717
+ * @param {bigint | null} [start_height]
5718
+ * @param {bigint | null} [end_height]
5719
+ * @returns {Promise<ExtendedHeader[]>}
5408
5720
  */
5409
- start(config) {
5410
- _assertClass(config, NodeConfig);
5411
- const ret = wasm.nodeclient_start(this.__wbg_ptr, config.__wbg_ptr);
5721
+ getHeaders(start_height, end_height) {
5722
+ const ret = wasm.nodeclient_getHeaders(this.__wbg_ptr, !isLikeNone(start_height), isLikeNone(start_height) ? BigInt(0) : start_height, !isLikeNone(end_height), isLikeNone(end_height) ? BigInt(0) : end_height);
5412
5723
  return ret;
5413
5724
  }
5414
5725
  /**
5415
- * @returns {Promise<void>}
5726
+ * Get current header syncing info.
5727
+ * @returns {Promise<SyncingInfoSnapshot>}
5416
5728
  */
5417
- stop() {
5418
- const ret = wasm.nodeclient_stop(this.__wbg_ptr);
5729
+ syncerInfo() {
5730
+ const ret = wasm.nodeclient_syncerInfo(this.__wbg_ptr);
5731
+ return ret;
5732
+ }
5733
+ /**
5734
+ * Get current network info.
5735
+ * @returns {Promise<NetworkInfoSnapshot>}
5736
+ */
5737
+ networkInfo() {
5738
+ const ret = wasm.nodeclient_networkInfo(this.__wbg_ptr);
5419
5739
  return ret;
5420
5740
  }
5421
5741
  /**
@@ -5427,11 +5747,37 @@ export class NodeClient {
5427
5747
  return ret;
5428
5748
  }
5429
5749
  /**
5430
- * Get current [`PeerTracker`] info.
5431
- * @returns {Promise<PeerTrackerInfoSnapshot>}
5750
+ * Subscribe to the shares from the namespace, as new headers are received by the node
5751
+ *
5752
+ * Return an async iterator which will yield all the blobs from the namespace, as the new headers
5753
+ * are being received by the node, starting from the first header received after the call.
5754
+ * @param {Namespace} namespace
5755
+ * @returns {AsyncIterable<BlobsAtHeight | SubscriptionError>}
5432
5756
  */
5433
- peerTrackerInfo() {
5434
- const ret = wasm.nodeclient_peerTrackerInfo(this.__wbg_ptr);
5757
+ blobSubscribe(namespace) {
5758
+ _assertClass(namespace, Namespace);
5759
+ var ptr0 = namespace.__destroy_into_raw();
5760
+ const ret = wasm.nodeclient_blobSubscribe(this.__wbg_ptr, ptr0);
5761
+ return ret;
5762
+ }
5763
+ /**
5764
+ * Returns a [`BroadcastChannel`] for events generated by [`Node`].
5765
+ * @returns {Promise<BroadcastChannel>}
5766
+ */
5767
+ eventsChannel() {
5768
+ const ret = wasm.nodeclient_eventsChannel(this.__wbg_ptr);
5769
+ return ret;
5770
+ }
5771
+ /**
5772
+ * Trust or untrust the peer with a given ID.
5773
+ * @param {string} peer_id
5774
+ * @param {boolean} is_trusted
5775
+ * @returns {Promise<void>}
5776
+ */
5777
+ setPeerTrust(peer_id, is_trusted) {
5778
+ const ptr0 = passStringToWasm0(peer_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5779
+ const len0 = WASM_VECTOR_LEN;
5780
+ const ret = wasm.nodeclient_setPeerTrust(this.__wbg_ptr, ptr0, len0, is_trusted);
5435
5781
  return ret;
5436
5782
  }
5437
5783
  /**
@@ -5443,47 +5789,68 @@ export class NodeClient {
5443
5789
  return ret;
5444
5790
  }
5445
5791
  /**
5446
- * Wait until the node is connected to at least 1 trusted peer.
5447
- * @returns {Promise<void>}
5792
+ * Get all the peers that node is connected to.
5793
+ * @returns {Promise<Array<any>>}
5448
5794
  */
5449
- waitConnectedTrusted() {
5450
- const ret = wasm.nodeclient_waitConnectedTrusted(this.__wbg_ptr);
5795
+ connectedPeers() {
5796
+ const ret = wasm.nodeclient_connectedPeers(this.__wbg_ptr);
5451
5797
  return ret;
5452
5798
  }
5453
5799
  /**
5454
- * Get current network info.
5455
- * @returns {Promise<NetworkInfoSnapshot>}
5800
+ * Subscribe to new headers received by the node from the network.
5801
+ *
5802
+ * Return an async iterator which will yield all the headers, as they are being received by the
5803
+ * node, starting from the first header received after the call.
5804
+ * @returns {AsyncIterable<ExtendedHeader | SubscriptionError>}
5456
5805
  */
5457
- networkInfo() {
5458
- const ret = wasm.nodeclient_networkInfo(this.__wbg_ptr);
5806
+ headerSubscribe() {
5807
+ const ret = wasm.nodeclient_headerSubscribe(this.__wbg_ptr);
5459
5808
  return ret;
5460
5809
  }
5461
5810
  /**
5462
- * Get all the multiaddresses on which the node listens.
5463
- * @returns {Promise<Array<any>>}
5811
+ * Get current [`PeerTracker`] info.
5812
+ * @returns {Promise<PeerTrackerInfoSnapshot>}
5464
5813
  */
5465
- listeners() {
5466
- const ret = wasm.nodeclient_listeners(this.__wbg_ptr);
5814
+ peerTrackerInfo() {
5815
+ const ret = wasm.nodeclient_peerTrackerInfo(this.__wbg_ptr);
5467
5816
  return ret;
5468
5817
  }
5469
5818
  /**
5470
- * Get all the peers that node is connected to.
5471
- * @returns {Promise<Array<any>>}
5819
+ * Request all blobs with provided namespace in the block corresponding to this header
5820
+ * using bitswap protocol.
5821
+ * @param {Namespace} namespace
5822
+ * @param {bigint} block_height
5823
+ * @param {number | null} [timeout_secs]
5824
+ * @returns {Promise<Blob[]>}
5472
5825
  */
5473
- connectedPeers() {
5474
- const ret = wasm.nodeclient_connectedPeers(this.__wbg_ptr);
5826
+ requestAllBlobs(namespace, block_height, timeout_secs) {
5827
+ _assertClass(namespace, Namespace);
5828
+ const ret = wasm.nodeclient_requestAllBlobs(this.__wbg_ptr, namespace.__wbg_ptr, block_height, !isLikeNone(timeout_secs), isLikeNone(timeout_secs) ? 0 : timeout_secs);
5475
5829
  return ret;
5476
5830
  }
5477
5831
  /**
5478
- * Trust or untrust the peer with a given ID.
5479
- * @param {string} peer_id
5480
- * @param {boolean} is_trusted
5481
- * @returns {Promise<void>}
5832
+ * Get a synced header for the block with a given hash.
5833
+ * @param {string} hash
5834
+ * @returns {Promise<ExtendedHeader>}
5482
5835
  */
5483
- setPeerTrust(peer_id, is_trusted) {
5484
- const ptr0 = passStringToWasm0(peer_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5836
+ getHeaderByHash(hash) {
5837
+ const ptr0 = passStringToWasm0(hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5485
5838
  const len0 = WASM_VECTOR_LEN;
5486
- const ret = wasm.nodeclient_setPeerTrust(this.__wbg_ptr, ptr0, len0, is_trusted);
5839
+ const ret = wasm.nodeclient_getHeaderByHash(this.__wbg_ptr, ptr0, len0);
5840
+ return ret;
5841
+ }
5842
+ /**
5843
+ * Subscribe to the blobs from the namespace, as new headers are received by the node
5844
+ *
5845
+ * Return an async iterator which will yield all the shares from the namespace, as the new headers
5846
+ * are being received by the node, starting from the first header received after the call.
5847
+ * @param {Namespace} namespace
5848
+ * @returns {AsyncIterable<SharesAtHeight | SubscriptionError>}
5849
+ */
5850
+ namespaceSubscribe(namespace) {
5851
+ _assertClass(namespace, Namespace);
5852
+ var ptr0 = namespace.__destroy_into_raw();
5853
+ const ret = wasm.nodeclient_namespaceSubscribe(this.__wbg_ptr, ptr0);
5487
5854
  return ret;
5488
5855
  }
5489
5856
  /**
@@ -5495,57 +5862,48 @@ export class NodeClient {
5495
5862
  return ret;
5496
5863
  }
5497
5864
  /**
5498
- * Request a header for the block with a given hash from the network.
5499
- * @param {string} hash
5865
+ * Get a synced header for the block with a given height.
5866
+ * @param {bigint} height
5500
5867
  * @returns {Promise<ExtendedHeader>}
5501
5868
  */
5502
- requestHeaderByHash(hash) {
5503
- const ptr0 = passStringToWasm0(hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5504
- const len0 = WASM_VECTOR_LEN;
5505
- const ret = wasm.nodeclient_requestHeaderByHash(this.__wbg_ptr, ptr0, len0);
5869
+ getHeaderByHeight(height) {
5870
+ const ret = wasm.nodeclient_getHeaderByHeight(this.__wbg_ptr, height);
5506
5871
  return ret;
5507
5872
  }
5508
5873
  /**
5509
- * Request a header for the block with a given height from the network.
5510
- * @param {bigint} height
5874
+ * Get the latest locally synced header.
5511
5875
  * @returns {Promise<ExtendedHeader>}
5512
5876
  */
5513
- requestHeaderByHeight(height) {
5514
- const ret = wasm.nodeclient_requestHeaderByHeight(this.__wbg_ptr, height);
5877
+ getLocalHeadHeader() {
5878
+ const ret = wasm.nodeclient_getLocalHeadHeader(this.__wbg_ptr);
5515
5879
  return ret;
5516
5880
  }
5517
5881
  /**
5518
- * Request headers in range (from, from + amount] from the network.
5519
- *
5520
- * The headers will be verified with the `from` header.
5521
- * @param {ExtendedHeader} from
5522
- * @param {bigint} amount
5523
- * @returns {Promise<ExtendedHeader[]>}
5882
+ * Get data sampling metadata of an already sampled height.
5883
+ * @param {bigint} height
5884
+ * @returns {Promise<SamplingMetadata | undefined>}
5524
5885
  */
5525
- requestVerifiedHeaders(from, amount) {
5526
- _assertClass(from, ExtendedHeader);
5527
- const ret = wasm.nodeclient_requestVerifiedHeaders(this.__wbg_ptr, from.__wbg_ptr, amount);
5886
+ getSamplingMetadata(height) {
5887
+ const ret = wasm.nodeclient_getSamplingMetadata(this.__wbg_ptr, height);
5528
5888
  return ret;
5529
5889
  }
5530
5890
  /**
5531
- * Request all blobs with provided namespace in the block corresponding to this header
5532
- * using bitswap protocol.
5533
- * @param {Namespace} namespace
5534
- * @param {bigint} block_height
5535
- * @param {number | null} [timeout_secs]
5536
- * @returns {Promise<Blob[]>}
5891
+ * Request a header for the block with a given hash from the network.
5892
+ * @param {string} hash
5893
+ * @returns {Promise<ExtendedHeader>}
5537
5894
  */
5538
- requestAllBlobs(namespace, block_height, timeout_secs) {
5539
- _assertClass(namespace, Namespace);
5540
- const ret = wasm.nodeclient_requestAllBlobs(this.__wbg_ptr, namespace.__wbg_ptr, block_height, !isLikeNone(timeout_secs), isLikeNone(timeout_secs) ? 0 : timeout_secs);
5895
+ requestHeaderByHash(hash) {
5896
+ const ptr0 = passStringToWasm0(hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5897
+ const len0 = WASM_VECTOR_LEN;
5898
+ const ret = wasm.nodeclient_requestHeaderByHash(this.__wbg_ptr, ptr0, len0);
5541
5899
  return ret;
5542
5900
  }
5543
5901
  /**
5544
- * Get current header syncing info.
5545
- * @returns {Promise<SyncingInfoSnapshot>}
5902
+ * Wait until the node is connected to at least 1 trusted peer.
5903
+ * @returns {Promise<void>}
5546
5904
  */
5547
- syncerInfo() {
5548
- const ret = wasm.nodeclient_syncerInfo(this.__wbg_ptr);
5905
+ waitConnectedTrusted() {
5906
+ const ret = wasm.nodeclient_waitConnectedTrusted(this.__wbg_ptr);
5549
5907
  return ret;
5550
5908
  }
5551
5909
  /**
@@ -5557,66 +5915,69 @@ export class NodeClient {
5557
5915
  return ret;
5558
5916
  }
5559
5917
  /**
5560
- * Get the latest locally synced header.
5561
- * @returns {Promise<ExtendedHeader>}
5918
+ * Establish a new connection to the existing worker over provided port
5919
+ * @param {any} port
5920
+ * @returns {Promise<void>}
5562
5921
  */
5563
- getLocalHeadHeader() {
5564
- const ret = wasm.nodeclient_getLocalHeadHeader(this.__wbg_ptr);
5922
+ addConnectionToWorker(port) {
5923
+ const ret = wasm.nodeclient_addConnectionToWorker(this.__wbg_ptr, port);
5565
5924
  return ret;
5566
5925
  }
5567
5926
  /**
5568
- * Get a synced header for the block with a given hash.
5569
- * @param {string} hash
5927
+ * Request a header for the block with a given height from the network.
5928
+ * @param {bigint} height
5570
5929
  * @returns {Promise<ExtendedHeader>}
5571
5930
  */
5572
- getHeaderByHash(hash) {
5573
- const ptr0 = passStringToWasm0(hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5574
- const len0 = WASM_VECTOR_LEN;
5575
- const ret = wasm.nodeclient_getHeaderByHash(this.__wbg_ptr, ptr0, len0);
5931
+ requestHeaderByHeight(height) {
5932
+ const ret = wasm.nodeclient_requestHeaderByHeight(this.__wbg_ptr, height);
5933
+ return ret;
5934
+ }
5935
+ /**
5936
+ * Request headers in range (from, from + amount] from the network.
5937
+ *
5938
+ * The headers will be verified with the `from` header.
5939
+ * @param {ExtendedHeader} from
5940
+ * @param {bigint} amount
5941
+ * @returns {Promise<ExtendedHeader[]>}
5942
+ */
5943
+ requestVerifiedHeaders(from, amount) {
5944
+ _assertClass(from, ExtendedHeader);
5945
+ const ret = wasm.nodeclient_requestVerifiedHeaders(this.__wbg_ptr, from.__wbg_ptr, amount);
5576
5946
  return ret;
5577
5947
  }
5578
5948
  /**
5579
- * Get a synced header for the block with a given height.
5580
- * @param {bigint} height
5581
- * @returns {Promise<ExtendedHeader>}
5949
+ * Create a new connection to a Lumina node running in [`NodeWorker`]. Provided `port` is
5950
+ * expected to have `MessagePort`-like interface for sending and receiving messages.
5951
+ * @param {any} port
5582
5952
  */
5583
- getHeaderByHeight(height) {
5584
- const ret = wasm.nodeclient_getHeaderByHeight(this.__wbg_ptr, height);
5953
+ constructor(port) {
5954
+ const ret = wasm.nodeclient_new(port);
5585
5955
  return ret;
5586
5956
  }
5587
5957
  /**
5588
- * Get synced headers from the given heights range.
5589
- *
5590
- * If start of the range is undefined (None), the first returned header will be of height 1.
5591
- * If end of the range is undefined (None), the last returned header will be the last header in the
5592
- * store.
5593
- *
5594
- * # Errors
5595
- *
5596
- * If range contains a height of a header that is not found in the store.
5597
- * @param {bigint | null} [start_height]
5598
- * @param {bigint | null} [end_height]
5599
- * @returns {Promise<ExtendedHeader[]>}
5958
+ * Stop the node.
5959
+ * @returns {Promise<void>}
5600
5960
  */
5601
- getHeaders(start_height, end_height) {
5602
- const ret = wasm.nodeclient_getHeaders(this.__wbg_ptr, !isLikeNone(start_height), isLikeNone(start_height) ? BigInt(0) : start_height, !isLikeNone(end_height), isLikeNone(end_height) ? BigInt(0) : end_height);
5961
+ stop() {
5962
+ const ret = wasm.nodeclient_stop(this.__wbg_ptr);
5603
5963
  return ret;
5604
5964
  }
5605
5965
  /**
5606
- * Get data sampling metadata of an already sampled height.
5607
- * @param {bigint} height
5608
- * @returns {Promise<SamplingMetadata | undefined>}
5966
+ * Start the node with the provided config, if it's not running
5967
+ * @param {NodeConfig} config
5968
+ * @returns {Promise<void>}
5609
5969
  */
5610
- getSamplingMetadata(height) {
5611
- const ret = wasm.nodeclient_getSamplingMetadata(this.__wbg_ptr, height);
5970
+ start(config) {
5971
+ _assertClass(config, NodeConfig);
5972
+ const ret = wasm.nodeclient_start(this.__wbg_ptr, config.__wbg_ptr);
5612
5973
  return ret;
5613
5974
  }
5614
5975
  /**
5615
- * Returns a [`BroadcastChannel`] for events generated by [`Node`].
5616
- * @returns {Promise<BroadcastChannel>}
5976
+ * Get all the multiaddresses on which the node listens.
5977
+ * @returns {Promise<Array<any>>}
5617
5978
  */
5618
- eventsChannel() {
5619
- const ret = wasm.nodeclient_eventsChannel(this.__wbg_ptr);
5979
+ listeners() {
5980
+ const ret = wasm.nodeclient_listeners(this.__wbg_ptr);
5620
5981
  return ret;
5621
5982
  }
5622
5983
  }
@@ -5662,6 +6023,15 @@ export class NodeConfig {
5662
6023
  const ptr = this.__destroy_into_raw();
5663
6024
  wasm.__wbg_nodeconfig_free(ptr, 0);
5664
6025
  }
6026
+ /**
6027
+ * Get the configuration with default bootnodes for provided network
6028
+ * @param {Network} network
6029
+ * @returns {NodeConfig}
6030
+ */
6031
+ static default(network) {
6032
+ const ret = wasm.nodeconfig_default(network);
6033
+ return NodeConfig.__wrap(ret);
6034
+ }
5665
6035
  /**
5666
6036
  * A network to connect to.
5667
6037
  * @returns {Network}
@@ -5772,15 +6142,6 @@ export class NodeConfig {
5772
6142
  set customPruningWindowSecs(arg0) {
5773
6143
  wasm.__wbg_set_nodeconfig_customPruningWindowSecs(this.__wbg_ptr, isLikeNone(arg0) ? 0x100000001 : (arg0) >>> 0);
5774
6144
  }
5775
- /**
5776
- * Get the configuration with default bootnodes for provided network
5777
- * @param {Network} network
5778
- * @returns {NodeConfig}
5779
- */
5780
- static default(network) {
5781
- const ret = wasm.nodeconfig_default(network);
5782
- return NodeConfig.__wrap(ret);
5783
- }
5784
6145
  }
5785
6146
 
5786
6147
  const NodeWorkerFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -5806,6 +6167,7 @@ export class NodeWorker {
5806
6167
  wasm.__wbg_nodeworker_free(ptr, 0);
5807
6168
  }
5808
6169
  /**
6170
+ * Create a new `NodeWorker` with a port-like JS object.
5809
6171
  * @param {any} port_like_object
5810
6172
  */
5811
6173
  constructor(port_like_object) {
@@ -5815,6 +6177,7 @@ export class NodeWorker {
5815
6177
  return this;
5816
6178
  }
5817
6179
  /**
6180
+ * Run `NodeWorker` main loop.
5818
6181
  * @returns {Promise<void>}
5819
6182
  */
5820
6183
  run() {
@@ -5888,7 +6251,7 @@ export class PartsHeader {
5888
6251
  set hash(arg0) {
5889
6252
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
5890
6253
  const len0 = WASM_VECTOR_LEN;
5891
- wasm.__wbg_set_jsbitvector_0(this.__wbg_ptr, ptr0, len0);
6254
+ wasm.__wbg_set_partsheader_hash(this.__wbg_ptr, ptr0, len0);
5892
6255
  }
5893
6256
  }
5894
6257
 
@@ -6207,6 +6570,139 @@ export class SamplingMetadata {
6207
6570
  }
6208
6571
  }
6209
6572
 
6573
+ const ShareFinalization = (typeof FinalizationRegistry === 'undefined')
6574
+ ? { register: () => {}, unregister: () => {} }
6575
+ : new FinalizationRegistry(ptr => wasm.__wbg_share_free(ptr >>> 0, 1));
6576
+ /**
6577
+ * A single fixed-size chunk of data which is used to form an [`ExtendedDataSquare`].
6578
+ *
6579
+ * All data in Celestia is split into [`Share`]s before being put into a
6580
+ * block's data square. See [`Blob::to_shares`].
6581
+ *
6582
+ * All shares have the fixed size of 512 bytes and the following structure:
6583
+ *
6584
+ * ```text
6585
+ * | Namespace | InfoByte | (optional) sequence length | data |
6586
+ * ```
6587
+ *
6588
+ * `sequence length` is the length of the original data in bytes and is present only in the first of the shares the data was split into.
6589
+ *
6590
+ * [`ExtendedDataSquare`]: crate::eds::ExtendedDataSquare
6591
+ * [`Blob::to_shares`]: crate::Blob::to_shares
6592
+ */
6593
+ export class Share {
6594
+
6595
+ static __wrap(ptr) {
6596
+ ptr = ptr >>> 0;
6597
+ const obj = Object.create(Share.prototype);
6598
+ obj.__wbg_ptr = ptr;
6599
+ ShareFinalization.register(obj, obj.__wbg_ptr, obj);
6600
+ return obj;
6601
+ }
6602
+
6603
+ static __unwrap(jsValue) {
6604
+ if (!(jsValue instanceof Share)) {
6605
+ return 0;
6606
+ }
6607
+ return jsValue.__destroy_into_raw();
6608
+ }
6609
+
6610
+ toJSON() {
6611
+ return {
6612
+ };
6613
+ }
6614
+
6615
+ toString() {
6616
+ return JSON.stringify(this);
6617
+ }
6618
+
6619
+ __destroy_into_raw() {
6620
+ const ptr = this.__wbg_ptr;
6621
+ this.__wbg_ptr = 0;
6622
+ ShareFinalization.unregister(this);
6623
+ return ptr;
6624
+ }
6625
+
6626
+ free() {
6627
+ const ptr = this.__destroy_into_raw();
6628
+ wasm.__wbg_share_free(ptr, 0);
6629
+ }
6630
+ }
6631
+
6632
+ const SharesAtHeightFinalization = (typeof FinalizationRegistry === 'undefined')
6633
+ ? { register: () => {}, unregister: () => {} }
6634
+ : new FinalizationRegistry(ptr => wasm.__wbg_sharesatheight_free(ptr >>> 0, 1));
6635
+ /**
6636
+ * A list of shares that were published at particular height.
6637
+ */
6638
+ export class SharesAtHeight {
6639
+
6640
+ static __wrap(ptr) {
6641
+ ptr = ptr >>> 0;
6642
+ const obj = Object.create(SharesAtHeight.prototype);
6643
+ obj.__wbg_ptr = ptr;
6644
+ SharesAtHeightFinalization.register(obj, obj.__wbg_ptr, obj);
6645
+ return obj;
6646
+ }
6647
+
6648
+ toJSON() {
6649
+ return {
6650
+ height: this.height,
6651
+ shares: this.shares,
6652
+ };
6653
+ }
6654
+
6655
+ toString() {
6656
+ return JSON.stringify(this);
6657
+ }
6658
+
6659
+ __destroy_into_raw() {
6660
+ const ptr = this.__wbg_ptr;
6661
+ this.__wbg_ptr = 0;
6662
+ SharesAtHeightFinalization.unregister(this);
6663
+ return ptr;
6664
+ }
6665
+
6666
+ free() {
6667
+ const ptr = this.__destroy_into_raw();
6668
+ wasm.__wbg_sharesatheight_free(ptr, 0);
6669
+ }
6670
+ /**
6671
+ * height the shares were published at
6672
+ * @returns {bigint}
6673
+ */
6674
+ get height() {
6675
+ const ret = wasm.__wbg_get_sharesatheight_height(this.__wbg_ptr);
6676
+ return BigInt.asUintN(64, ret);
6677
+ }
6678
+ /**
6679
+ * height the shares were published at
6680
+ * @param {bigint} arg0
6681
+ */
6682
+ set height(arg0) {
6683
+ wasm.__wbg_set_sharesatheight_height(this.__wbg_ptr, arg0);
6684
+ }
6685
+ /**
6686
+ * shares published
6687
+ * @returns {Share[]}
6688
+ */
6689
+ get shares() {
6690
+ const ret = wasm.__wbg_get_sharesatheight_shares(this.__wbg_ptr);
6691
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
6692
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
6693
+ return v1;
6694
+ }
6695
+ /**
6696
+ * shares published
6697
+ * @param {Share[]} arg0
6698
+ */
6699
+ set shares(arg0) {
6700
+ const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
6701
+ const len0 = WASM_VECTOR_LEN;
6702
+ wasm.__wbg_set_sharesatheight_shares(this.__wbg_ptr, ptr0, len0);
6703
+ }
6704
+ }
6705
+
6210
6706
  const SignatureFinalization = (typeof FinalizationRegistry === 'undefined')
6211
6707
  ? { register: () => {}, unregister: () => {} }
6212
6708
  : new FinalizationRegistry(ptr => wasm.__wbg_signature_free(ptr >>> 0, 1));
@@ -6347,6 +6843,16 @@ export class SignerInfo {
6347
6843
  const ptr = this.__destroy_into_raw();
6348
6844
  wasm.__wbg_signerinfo_free(ptr, 0);
6349
6845
  }
6846
+ /**
6847
+ * public_key is the public key of the signer. It is optional for accounts
6848
+ * that already exist in state. If unset, the verifier can use the required \
6849
+ * signer address for this position and lookup the public key.
6850
+ * @returns {ProtoAny | undefined}
6851
+ */
6852
+ public_key() {
6853
+ const ret = wasm.signerinfo_public_key(this.__wbg_ptr);
6854
+ return ret;
6855
+ }
6350
6856
  /**
6351
6857
  * mode_info describes the signing mode of the signer and is a nested
6352
6858
  * structure to support nested multisig pubkey's
@@ -6385,61 +6891,136 @@ export class SignerInfo {
6385
6891
  set sequence(arg0) {
6386
6892
  wasm.__wbg_set_signerinfo_sequence(this.__wbg_ptr, arg0);
6387
6893
  }
6894
+ }
6895
+
6896
+ const StringEventFinalization = (typeof FinalizationRegistry === 'undefined')
6897
+ ? { register: () => {}, unregister: () => {} }
6898
+ : new FinalizationRegistry(ptr => wasm.__wbg_stringevent_free(ptr >>> 0, 1));
6899
+ /**
6900
+ * StringEvent defines en Event object wrapper where all the attributes
6901
+ * contain key/value pairs that are strings instead of raw bytes.
6902
+ */
6903
+ export class StringEvent {
6904
+
6905
+ static __wrap(ptr) {
6906
+ ptr = ptr >>> 0;
6907
+ const obj = Object.create(StringEvent.prototype);
6908
+ obj.__wbg_ptr = ptr;
6909
+ StringEventFinalization.register(obj, obj.__wbg_ptr, obj);
6910
+ return obj;
6911
+ }
6912
+
6913
+ static __unwrap(jsValue) {
6914
+ if (!(jsValue instanceof StringEvent)) {
6915
+ return 0;
6916
+ }
6917
+ return jsValue.__destroy_into_raw();
6918
+ }
6919
+
6920
+ __destroy_into_raw() {
6921
+ const ptr = this.__wbg_ptr;
6922
+ this.__wbg_ptr = 0;
6923
+ StringEventFinalization.unregister(this);
6924
+ return ptr;
6925
+ }
6926
+
6927
+ free() {
6928
+ const ptr = this.__destroy_into_raw();
6929
+ wasm.__wbg_stringevent_free(ptr, 0);
6930
+ }
6388
6931
  /**
6389
- * public_key is the public key of the signer. It is optional for accounts
6390
- * that already exist in state. If unset, the verifier can use the required \
6391
- * signer address for this position and lookup the public key.
6392
- * @returns {ProtoAny | undefined}
6932
+ * @returns {string}
6393
6933
  */
6394
- public_key() {
6395
- const ret = wasm.signerinfo_public_key(this.__wbg_ptr);
6396
- return ret;
6934
+ get type() {
6935
+ let deferred1_0;
6936
+ let deferred1_1;
6937
+ try {
6938
+ const ret = wasm.__wbg_get_stringevent_type(this.__wbg_ptr);
6939
+ deferred1_0 = ret[0];
6940
+ deferred1_1 = ret[1];
6941
+ return getStringFromWasm0(ret[0], ret[1]);
6942
+ } finally {
6943
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
6944
+ }
6945
+ }
6946
+ /**
6947
+ * @param {string} arg0
6948
+ */
6949
+ set type(arg0) {
6950
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6951
+ const len0 = WASM_VECTOR_LEN;
6952
+ wasm.__wbg_set_abcimessagelog_log(this.__wbg_ptr, ptr0, len0);
6953
+ }
6954
+ /**
6955
+ * @returns {Attribute[]}
6956
+ */
6957
+ get attributes() {
6958
+ const ret = wasm.__wbg_get_stringevent_attributes(this.__wbg_ptr);
6959
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
6960
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
6961
+ return v1;
6962
+ }
6963
+ /**
6964
+ * @param {Attribute[]} arg0
6965
+ */
6966
+ set attributes(arg0) {
6967
+ const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
6968
+ const len0 = WASM_VECTOR_LEN;
6969
+ wasm.__wbg_set_stringevent_attributes(this.__wbg_ptr, ptr0, len0);
6397
6970
  }
6398
6971
  }
6399
6972
 
6400
- const StringEventFinalization = (typeof FinalizationRegistry === 'undefined')
6973
+ const SubscriptionErrorFinalization = (typeof FinalizationRegistry === 'undefined')
6401
6974
  ? { register: () => {}, unregister: () => {} }
6402
- : new FinalizationRegistry(ptr => wasm.__wbg_stringevent_free(ptr >>> 0, 1));
6975
+ : new FinalizationRegistry(ptr => wasm.__wbg_subscriptionerror_free(ptr >>> 0, 1));
6403
6976
  /**
6404
- * StringEvent defines en Event object wrapper where all the attributes
6405
- * contain key/value pairs that are strings instead of raw bytes.
6977
+ * Error thrown while processing subscription
6406
6978
  */
6407
- export class StringEvent {
6979
+ export class SubscriptionError {
6408
6980
 
6409
6981
  static __wrap(ptr) {
6410
6982
  ptr = ptr >>> 0;
6411
- const obj = Object.create(StringEvent.prototype);
6983
+ const obj = Object.create(SubscriptionError.prototype);
6412
6984
  obj.__wbg_ptr = ptr;
6413
- StringEventFinalization.register(obj, obj.__wbg_ptr, obj);
6985
+ SubscriptionErrorFinalization.register(obj, obj.__wbg_ptr, obj);
6414
6986
  return obj;
6415
6987
  }
6416
6988
 
6417
- static __unwrap(jsValue) {
6418
- if (!(jsValue instanceof StringEvent)) {
6419
- return 0;
6420
- }
6421
- return jsValue.__destroy_into_raw();
6422
- }
6423
-
6424
6989
  __destroy_into_raw() {
6425
6990
  const ptr = this.__wbg_ptr;
6426
6991
  this.__wbg_ptr = 0;
6427
- StringEventFinalization.unregister(this);
6992
+ SubscriptionErrorFinalization.unregister(this);
6428
6993
  return ptr;
6429
6994
  }
6430
6995
 
6431
6996
  free() {
6432
6997
  const ptr = this.__destroy_into_raw();
6433
- wasm.__wbg_stringevent_free(ptr, 0);
6998
+ wasm.__wbg_subscriptionerror_free(ptr, 0);
6999
+ }
7000
+ /**
7001
+ * Height at which the error occurred, if applicable
7002
+ * @returns {bigint | undefined}
7003
+ */
7004
+ get height() {
7005
+ const ret = wasm.__wbg_get_subscriptionerror_height(this.__wbg_ptr);
7006
+ return ret[0] === 0 ? undefined : BigInt.asUintN(64, ret[1]);
7007
+ }
7008
+ /**
7009
+ * Height at which the error occurred, if applicable
7010
+ * @param {bigint | null} [arg0]
7011
+ */
7012
+ set height(arg0) {
7013
+ wasm.__wbg_set_subscriptionerror_height(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? BigInt(0) : arg0);
6434
7014
  }
6435
7015
  /**
7016
+ * error message
6436
7017
  * @returns {string}
6437
7018
  */
6438
- get type() {
7019
+ get error() {
6439
7020
  let deferred1_0;
6440
7021
  let deferred1_1;
6441
7022
  try {
6442
- const ret = wasm.__wbg_get_stringevent_type(this.__wbg_ptr);
7023
+ const ret = wasm.__wbg_get_subscriptionerror_error(this.__wbg_ptr);
6443
7024
  deferred1_0 = ret[0];
6444
7025
  deferred1_1 = ret[1];
6445
7026
  return getStringFromWasm0(ret[0], ret[1]);
@@ -6448,29 +7029,13 @@ export class StringEvent {
6448
7029
  }
6449
7030
  }
6450
7031
  /**
7032
+ * error message
6451
7033
  * @param {string} arg0
6452
7034
  */
6453
- set type(arg0) {
7035
+ set error(arg0) {
6454
7036
  const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
6455
7037
  const len0 = WASM_VECTOR_LEN;
6456
- wasm.__wbg_set_abcimessagelog_log(this.__wbg_ptr, ptr0, len0);
6457
- }
6458
- /**
6459
- * @returns {Attribute[]}
6460
- */
6461
- get attributes() {
6462
- const ret = wasm.__wbg_get_stringevent_attributes(this.__wbg_ptr);
6463
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
6464
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
6465
- return v1;
6466
- }
6467
- /**
6468
- * @param {Attribute[]} arg0
6469
- */
6470
- set attributes(arg0) {
6471
- const ptr0 = passArrayJsValueToWasm0(arg0, wasm.__wbindgen_malloc);
6472
- const len0 = WASM_VECTOR_LEN;
6473
- wasm.__wbg_set_stringevent_attributes(this.__wbg_ptr, ptr0, len0);
7038
+ wasm.__wbg_set_subscriptionerror_error(this.__wbg_ptr, ptr0, len0);
6474
7039
  }
6475
7040
  }
6476
7041
 
@@ -6676,23 +7241,6 @@ export class TxBody {
6676
7241
  const len0 = WASM_VECTOR_LEN;
6677
7242
  wasm.__wbg_set_txbody_memo(this.__wbg_ptr, ptr0, len0);
6678
7243
  }
6679
- /**
6680
- * `messages` is a list of messages to be executed. The required signers of
6681
- * those messages define the number and order of elements in `AuthInfo`'s
6682
- * signer_infos and Tx's signatures. Each required signer address is added to
6683
- * the list only the first time it occurs.
6684
- *
6685
- * By convention, the first required signer (usually from the first message)
6686
- * is referred to as the primary signer and pays the fee for the whole
6687
- * transaction.
6688
- * @returns {ProtoAny[]}
6689
- */
6690
- messages() {
6691
- const ret = wasm.txbody_messages(this.__wbg_ptr);
6692
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
6693
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
6694
- return v1;
6695
- }
6696
7244
  /**
6697
7245
  * `timeout` is the block height after which this transaction will not
6698
7246
  * be processed by the chain
@@ -6726,6 +7274,23 @@ export class TxBody {
6726
7274
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
6727
7275
  return v1;
6728
7276
  }
7277
+ /**
7278
+ * `messages` is a list of messages to be executed. The required signers of
7279
+ * those messages define the number and order of elements in `AuthInfo`'s
7280
+ * signer_infos and Tx's signatures. Each required signer address is added to
7281
+ * the list only the first time it occurs.
7282
+ *
7283
+ * By convention, the first required signer (usually from the first message)
7284
+ * is referred to as the primary signer and pays the fee for the whole
7285
+ * transaction.
7286
+ * @returns {ProtoAny[]}
7287
+ */
7288
+ messages() {
7289
+ const ret = wasm.txbody_messages(this.__wbg_ptr);
7290
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
7291
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
7292
+ return v1;
7293
+ }
6729
7294
  }
6730
7295
 
6731
7296
  const TxResponseFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -6755,6 +7320,27 @@ export class TxResponse {
6755
7320
  const ptr = this.__destroy_into_raw();
6756
7321
  wasm.__wbg_txresponse_free(ptr, 0);
6757
7322
  }
7323
+ /**
7324
+ * Events defines all the events emitted by processing a transaction. Note,
7325
+ * these events include those emitted by processing all the messages and those
7326
+ * emitted from the ante. Whereas Logs contains the events, with
7327
+ * additional metadata, emitted only by processing the messages.
7328
+ * @returns {JsEvent[]}
7329
+ */
7330
+ get events() {
7331
+ const ret = wasm.txresponse_events(this.__wbg_ptr);
7332
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
7333
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
7334
+ return v1;
7335
+ }
7336
+ /**
7337
+ * The block height
7338
+ * @returns {bigint}
7339
+ */
7340
+ get height() {
7341
+ const ret = wasm.txbody_timeout_height(this.__wbg_ptr);
7342
+ return BigInt.asUintN(64, ret);
7343
+ }
6758
7344
  /**
6759
7345
  * Namespace for the Code
6760
7346
  * @returns {string}
@@ -6950,27 +7536,6 @@ export class TxResponse {
6950
7536
  const len0 = WASM_VECTOR_LEN;
6951
7537
  wasm.__wbg_set_txresponse_timestamp(this.__wbg_ptr, ptr0, len0);
6952
7538
  }
6953
- /**
6954
- * The block height
6955
- * @returns {bigint}
6956
- */
6957
- get height() {
6958
- const ret = wasm.txbody_timeout_height(this.__wbg_ptr);
6959
- return BigInt.asUintN(64, ret);
6960
- }
6961
- /**
6962
- * Events defines all the events emitted by processing a transaction. Note,
6963
- * these events include those emitted by processing all the messages and those
6964
- * emitted from the ante. Whereas Logs contains the events, with
6965
- * additional metadata, emitted only by processing the messages.
6966
- * @returns {JsEvent[]}
6967
- */
6968
- get events() {
6969
- const ret = wasm.txresponse_events(this.__wbg_ptr);
6970
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
6971
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
6972
- return v1;
6973
- }
6974
7539
  }
6975
7540
 
6976
7541
  const TxStatusResponseFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -7000,6 +7565,14 @@ export class TxStatusResponse {
7000
7565
  const ptr = this.__destroy_into_raw();
7001
7566
  wasm.__wbg_txstatusresponse_free(ptr, 0);
7002
7567
  }
7568
+ /**
7569
+ * Height of the block in which the transaction was committed.
7570
+ * @returns {bigint}
7571
+ */
7572
+ get height() {
7573
+ const ret = wasm.txstatusresponse_height(this.__wbg_ptr);
7574
+ return BigInt.asUintN(64, ret);
7575
+ }
7003
7576
  /**
7004
7577
  * Index of the transaction in block.
7005
7578
  * @returns {number}
@@ -7074,14 +7647,6 @@ export class TxStatusResponse {
7074
7647
  set status(arg0) {
7075
7648
  wasm.__wbg_set_txstatusresponse_status(this.__wbg_ptr, arg0);
7076
7649
  }
7077
- /**
7078
- * Height of the block in which the transaction was committed.
7079
- * @returns {bigint}
7080
- */
7081
- get height() {
7082
- const ret = wasm.txstatusresponse_height(this.__wbg_ptr);
7083
- return BigInt.asUintN(64, ret);
7084
- }
7085
7650
  }
7086
7651
 
7087
7652
  const ValAddressFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -7413,6 +7978,11 @@ export class Vote {
7413
7978
  }
7414
7979
  }
7415
7980
 
7981
+ export function __wbg_BigInt_d53045318206d695(arg0) {
7982
+ const ret = BigInt(arg0);
7983
+ return ret;
7984
+ };
7985
+
7416
7986
  export function __wbg_Error_1f3748b298f99708(arg0, arg1) {
7417
7987
  const ret = Error(getStringFromWasm0(arg0, arg1));
7418
7988
  return ret;
@@ -7455,7 +8025,7 @@ export function __wbg_abort_496881624c2d80da() { return handleError(function (ar
7455
8025
  arg0.abort();
7456
8026
  }, arguments) };
7457
8027
 
7458
- export function __wbg_accountNumber_39d1c298f9e5c082(arg0) {
8028
+ export function __wbg_accountNumber_e4a313c9dfc978c5(arg0) {
7459
8029
  const ret = arg0.accountNumber;
7460
8030
  return ret;
7461
8031
  };
@@ -7488,6 +8058,16 @@ export function __wbg_appversion_new(arg0) {
7488
8058
  return ret;
7489
8059
  };
7490
8060
 
8061
+ export function __wbg_asyncIterator_787398a275d49dae() {
8062
+ const ret = Symbol.asyncIterator;
8063
+ return ret;
8064
+ };
8065
+
8066
+ export function __wbg_asynciteratorimpl_new(arg0) {
8067
+ const ret = AsyncIteratorImpl.__wrap(arg0);
8068
+ return ret;
8069
+ };
8070
+
7491
8071
  export function __wbg_attribute_new(arg0) {
7492
8072
  const ret = Attribute.__wrap(arg0);
7493
8073
  return ret;
@@ -7498,7 +8078,7 @@ export function __wbg_attribute_unwrap(arg0) {
7498
8078
  return ret;
7499
8079
  };
7500
8080
 
7501
- export function __wbg_authInfoBytes_b318cc80cf9d2ff8(arg0, arg1) {
8081
+ export function __wbg_authInfoBytes_5c381613b1053434(arg0, arg1) {
7502
8082
  const ret = arg1.authInfoBytes;
7503
8083
  const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
7504
8084
  const len1 = WASM_VECTOR_LEN;
@@ -7521,6 +8101,11 @@ export function __wbg_blobparams_new(arg0) {
7521
8101
  return ret;
7522
8102
  };
7523
8103
 
8104
+ export function __wbg_blobsatheight_new(arg0) {
8105
+ const ret = BlobsAtHeight.__wrap(arg0);
8106
+ return ret;
8107
+ };
8108
+
7524
8109
  export function __wbg_block_new(arg0) {
7525
8110
  const ret = Block.__wrap(arg0);
7526
8111
  return ret;
@@ -7536,7 +8121,7 @@ export function __wbg_blockrange_unwrap(arg0) {
7536
8121
  return ret;
7537
8122
  };
7538
8123
 
7539
- export function __wbg_bodyBytes_cd75eac0b845f014(arg0, arg1) {
8124
+ export function __wbg_bodyBytes_b4d1c4630cd77e30(arg0, arg1) {
7540
8125
  const ret = arg1.bodyBytes;
7541
8126
  const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
7542
8127
  const len1 = WASM_VECTOR_LEN;
@@ -7549,11 +8134,6 @@ export function __wbg_body_be60ee806470b990(arg0) {
7549
8134
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
7550
8135
  };
7551
8136
 
7552
- export function __wbg_bound_5807fb7ebc427c03() { return handleError(function (arg0, arg1, arg2, arg3) {
7553
- const ret = IDBKeyRange.bound(arg0, arg1, arg2 !== 0, arg3 !== 0);
7554
- return ret;
7555
- }, arguments) };
7556
-
7557
8137
  export function __wbg_buffer_1f897e9f3ed6b41d(arg0) {
7558
8138
  const ret = arg0.buffer;
7559
8139
  return ret;
@@ -7604,7 +8184,7 @@ export function __wbg_cause_94f62e1c92956ce2(arg0) {
7604
8184
  return ret;
7605
8185
  };
7606
8186
 
7607
- export function __wbg_chainId_2d57400a28824c3f(arg0, arg1) {
8187
+ export function __wbg_chainId_27f066fe40ecb0f5(arg0, arg1) {
7608
8188
  const ret = arg1.chainId;
7609
8189
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
7610
8190
  const len1 = WASM_VECTOR_LEN;
@@ -7635,7 +8215,7 @@ export function __wbg_clearTimeout_96804de0ab838f26(arg0) {
7635
8215
  return ret;
7636
8216
  };
7637
8217
 
7638
- export function __wbg_clearTimeout_e1b14c330a6c41a6(arg0) {
8218
+ export function __wbg_clearTimeout_da6ef1364d77d96a(arg0) {
7639
8219
  clearTimeout(arg0);
7640
8220
  };
7641
8221
 
@@ -7652,7 +8232,7 @@ export function __wbg_close_62eb30084a8993bf() { return handleError(function (ar
7652
8232
  arg0.close(arg1, getStringFromWasm0(arg2, arg3));
7653
8233
  }, arguments) };
7654
8234
 
7655
- export function __wbg_close_7dcca1557b5bd08b(arg0) {
8235
+ export function __wbg_close_6f082e93cbded9b8(arg0) {
7656
8236
  arg0.close();
7657
8237
  };
7658
8238
 
@@ -7669,12 +8249,12 @@ export function __wbg_close_f602227805f17f95() { return handleError(function (ar
7669
8249
  arg0.close();
7670
8250
  }, arguments) };
7671
8251
 
7672
- export function __wbg_closed_2934f4ed093a9d95(arg0) {
8252
+ export function __wbg_closed_8b9d023c2484076c(arg0) {
7673
8253
  const ret = arg0.closed;
7674
8254
  return ret;
7675
8255
  };
7676
8256
 
7677
- export function __wbg_closed_8b9d023c2484076c(arg0) {
8257
+ export function __wbg_closed_964e107ead6defb4(arg0) {
7678
8258
  const ret = arg0.closed;
7679
8259
  return ret;
7680
8260
  };
@@ -7736,7 +8316,7 @@ export function __wbg_count_ee083e36b5119925() { return handleError(function (ar
7736
8316
  return ret;
7737
8317
  }, arguments) };
7738
8318
 
7739
- export function __wbg_createBidirectionalStream_2b56e05ee223119c(arg0) {
8319
+ export function __wbg_createBidirectionalStream_5eee908ceaaa9e36(arg0) {
7740
8320
  const ret = arg0.createBidirectionalStream();
7741
8321
  return ret;
7742
8322
  };
@@ -7844,7 +8424,7 @@ export function __wbg_fetch_4fae101547df73b6(arg0, arg1, arg2) {
7844
8424
  return ret;
7845
8425
  };
7846
8426
 
7847
- export function __wbg_fetch_b21de99222e9f4e1(arg0) {
8427
+ export function __wbg_fetch_ed9498ce5d2cc14d(arg0) {
7848
8428
  const ret = fetch(arg0);
7849
8429
  return ret;
7850
8430
  };
@@ -7859,13 +8439,13 @@ export function __wbg_from_237b1ad767238d8b(arg0) {
7859
8439
  return ret;
7860
8440
  };
7861
8441
 
7862
- export function __wbg_gasLimit_c7b776728a12cf83(arg0, arg1) {
8442
+ export function __wbg_gasLimit_e6cc908a06e35f02(arg0, arg1) {
7863
8443
  const ret = arg1.gasLimit;
7864
8444
  getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
7865
8445
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
7866
8446
  };
7867
8447
 
7868
- export function __wbg_gasPrice_9c07555b88b11910(arg0, arg1) {
8448
+ export function __wbg_gasPrice_0591321ee8ff7383(arg0, arg1) {
7869
8449
  const ret = arg1.gasPrice;
7870
8450
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
7871
8451
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
@@ -7987,6 +8567,14 @@ export function __wbg_has_85abdd8aeb8edebf() { return handleError(function (arg0
7987
8567
  return ret;
7988
8568
  }, arguments) };
7989
8569
 
8570
+ export function __wbg_hash_8e74ca0df9d12a2f(arg0, arg1) {
8571
+ const ret = arg1.hash;
8572
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8573
+ const len1 = WASM_VECTOR_LEN;
8574
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
8575
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
8576
+ };
8577
+
7990
8578
  export function __wbg_headers_177bc880a5823968(arg0) {
7991
8579
  const ret = arg0.headers;
7992
8580
  return ret;
@@ -7997,7 +8585,7 @@ export function __wbg_headers_391e2f64884c873b(arg0) {
7997
8585
  return ret;
7998
8586
  };
7999
8587
 
8000
- export function __wbg_incomingBidirectionalStreams_ed7915830e8f8998(arg0) {
8588
+ export function __wbg_incomingBidirectionalStreams_6ba630fafda86b63(arg0) {
8001
8589
  const ret = arg0.incomingBidirectionalStreams;
8002
8590
  return ret;
8003
8591
  };
@@ -8192,7 +8780,7 @@ export function __wbg_instanceof_Uint8Array_91f3c5adee7e6672(arg0) {
8192
8780
  return ret;
8193
8781
  };
8194
8782
 
8195
- export function __wbg_instanceof_WebTransportBidirectionalStream_65ff63c49f91f97a(arg0) {
8783
+ export function __wbg_instanceof_WebTransportBidirectionalStream_2a24a578d4c55677(arg0) {
8196
8784
  let result;
8197
8785
  try {
8198
8786
  result = arg0 instanceof WebTransportBidirectionalStream;
@@ -8234,6 +8822,11 @@ export function __wbg_iterator_96378c3c9a17347c() {
8234
8822
  return ret;
8235
8823
  };
8236
8824
 
8825
+ export function __wbg_iteratorresultobject_new(arg0) {
8826
+ const ret = IteratorResultObject.__wrap(arg0);
8827
+ return ret;
8828
+ };
8829
+
8237
8830
  export function __wbg_jsevent_new(arg0) {
8238
8831
  const ret = JsEvent.__wrap(arg0);
8239
8832
  return ret;
@@ -8289,7 +8882,7 @@ export function __wbg_length_904c0910ed998bf3(arg0) {
8289
8882
  return ret;
8290
8883
  };
8291
8884
 
8292
- export function __wbg_memo_48d219ed93452445(arg0, arg1) {
8885
+ export function __wbg_memo_fc769b7610d2662c(arg0, arg1) {
8293
8886
  const ret = arg1.memo;
8294
8887
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8295
8888
  var len1 = WASM_VECTOR_LEN;
@@ -8357,6 +8950,16 @@ export function __wbg_new_56407f99198feff7() {
8357
8950
  return ret;
8358
8951
  };
8359
8952
 
8953
+ export function __wbg_new_6c91424bc2a93552() { return handleError(function (arg0, arg1) {
8954
+ const ret = new WebTransport(getStringFromWasm0(arg0, arg1));
8955
+ return ret;
8956
+ }, arguments) };
8957
+
8958
+ export function __wbg_new_700f5e18c06513d6() { return handleError(function () {
8959
+ const ret = new MessageChannel();
8960
+ return ret;
8961
+ }, arguments) };
8962
+
8360
8963
  export function __wbg_new_8a6f238a6ece86ea() {
8361
8964
  const ret = new Error();
8362
8965
  return ret;
@@ -8379,7 +8982,7 @@ export function __wbg_new_d5e3800b120e37e1(arg0, arg1) {
8379
8982
  const a = state0.a;
8380
8983
  state0.a = 0;
8381
8984
  try {
8382
- return __wbg_adapter_960(a, state0.b, arg0, arg1);
8985
+ return __wbg_adapter_940(a, state0.b, arg0, arg1);
8383
8986
  } finally {
8384
8987
  state0.a = a;
8385
8988
  }
@@ -8391,11 +8994,6 @@ export function __wbg_new_d5e3800b120e37e1(arg0, arg1) {
8391
8994
  }
8392
8995
  };
8393
8996
 
8394
- export function __wbg_new_d85e20a34917132b() { return handleError(function (arg0, arg1) {
8395
- const ret = new WebTransport(getStringFromWasm0(arg0, arg1));
8396
- return ret;
8397
- }, arguments) };
8398
-
8399
8997
  export function __wbg_new_e969dc3f68d25093() {
8400
8998
  const ret = new Array();
8401
8999
  return ret;
@@ -8431,7 +9029,7 @@ export function __wbg_newwithlength_ed0ee6c1edca86fc(arg0) {
8431
9029
  return ret;
8432
9030
  };
8433
9031
 
8434
- export function __wbg_newwithoptions_1ba541b69f220543() { return handleError(function (arg0, arg1, arg2) {
9032
+ export function __wbg_newwithoptions_54c812898eb97a22() { return handleError(function (arg0, arg1, arg2) {
8435
9033
  const ret = new WebTransport(getStringFromWasm0(arg0, arg1), arg2);
8436
9034
  return ret;
8437
9035
  }, arguments) };
@@ -8536,6 +9134,16 @@ export function __wbg_persist_1bb8fe4abf4a1238() { return handleError(function (
8536
9134
  return ret;
8537
9135
  }, arguments) };
8538
9136
 
9137
+ export function __wbg_port1_0618b5fb086e0c75(arg0) {
9138
+ const ret = arg0.port1;
9139
+ return ret;
9140
+ };
9141
+
9142
+ export function __wbg_port2_11f233fda4932fc1(arg0) {
9143
+ const ret = arg0.port2;
9144
+ return ret;
9145
+ };
9146
+
8539
9147
  export function __wbg_ports_9c55c10a9e47462c(arg0) {
8540
9148
  const ret = arg0.ports;
8541
9149
  return ret;
@@ -8545,15 +9153,15 @@ export function __wbg_postMessage_3b4fb1cda6756bf0() { return handleError(functi
8545
9153
  arg0.postMessage(arg1);
8546
9154
  }, arguments) };
8547
9155
 
8548
- export function __wbg_postMessage_6c2e3d58e6b58b4a() { return handleError(function (arg0, arg1, arg2) {
9156
+ export function __wbg_postMessage_3b56bfba80404bfb() { return handleError(function (arg0, arg1, arg2) {
8549
9157
  arg0.postMessage(arg1, arg2);
8550
9158
  }, arguments) };
8551
9159
 
8552
- export function __wbg_postMessage_748559745b3b6020() { return handleError(function (arg0, arg1) {
9160
+ export function __wbg_postMessage_ceb4f5a96dc39ace() { return handleError(function (arg0, arg1) {
8553
9161
  arg0.postMessage(arg1);
8554
9162
  }, arguments) };
8555
9163
 
8556
- export function __wbg_priority_e414ab055c0d0a08(arg0) {
9164
+ export function __wbg_priority_b4a3ae75003a0632(arg0) {
8557
9165
  const ret = arg0.priority;
8558
9166
  return isLikeNone(ret) ? 0 : ret;
8559
9167
  };
@@ -8615,7 +9223,7 @@ export function __wbg_read_dc3d89b58ce2ae65(arg0) {
8615
9223
  return ret;
8616
9224
  };
8617
9225
 
8618
- export function __wbg_readable_e39b6396dce1aa98(arg0) {
9226
+ export function __wbg_readable_0e549655ea988517(arg0) {
8619
9227
  const ret = arg0.readable;
8620
9228
  return ret;
8621
9229
  };
@@ -8630,7 +9238,7 @@ export function __wbg_ready_a624cdffdc1b39dc(arg0) {
8630
9238
  return ret;
8631
9239
  };
8632
9240
 
8633
- export function __wbg_ready_a8d2b97e1fe33dcb(arg0) {
9241
+ export function __wbg_ready_cc3fb68899282d02(arg0) {
8634
9242
  const ret = arg0.ready;
8635
9243
  return ret;
8636
9244
  };
@@ -8639,7 +9247,7 @@ export function __wbg_releaseLock_fbec365467db2e6c(arg0) {
8639
9247
  arg0.releaseLock();
8640
9248
  };
8641
9249
 
8642
- export function __wbg_request_537c0a65e46ce7cb(arg0, arg1, arg2, arg3, arg4) {
9250
+ export function __wbg_request_596555d7d2f95c6b(arg0, arg1, arg2, arg3, arg4) {
8643
9251
  const ret = arg0.request(getStringFromWasm0(arg1, arg2), arg3, arg4);
8644
9252
  return ret;
8645
9253
  };
@@ -8677,6 +9285,11 @@ export function __wbg_send_f0af552dcc5d8183() { return handleError(function (arg
8677
9285
  arg0.send(getArrayU8FromWasm0(arg1, arg2));
8678
9286
  }, arguments) };
8679
9287
 
9288
+ export function __wbg_sequence_73d147c1f7e4790c(arg0) {
9289
+ const ret = arg0.sequence;
9290
+ return ret;
9291
+ };
9292
+
8680
9293
  export function __wbg_setInterval_a708e6782af78d02() { return handleError(function (arg0, arg1, arg2, arg3) {
8681
9294
  const ret = arg0.setInterval(arg1, arg2, ...arg3);
8682
9295
  return ret;
@@ -8692,7 +9305,7 @@ export function __wbg_setInterval_ed3b5e3c3ebb8a6d() { return handleError(functi
8692
9305
  return ret;
8693
9306
  }, arguments) };
8694
9307
 
8695
- export function __wbg_setTimeout_6d5804197b438320(arg0, arg1) {
9308
+ export function __wbg_setTimeout_8d0ca6852dbf5ded(arg0, arg1) {
8696
9309
  const ret = setTimeout(arg0, arg1 >>> 0);
8697
9310
  return ret;
8698
9311
  };
@@ -8841,6 +9454,21 @@ export function __wbg_setunique_bccba0d1ccd21f16(arg0, arg1) {
8841
9454
  arg0.unique = arg1 !== 0;
8842
9455
  };
8843
9456
 
9457
+ export function __wbg_share_new(arg0) {
9458
+ const ret = Share.__wrap(arg0);
9459
+ return ret;
9460
+ };
9461
+
9462
+ export function __wbg_share_unwrap(arg0) {
9463
+ const ret = Share.__unwrap(arg0);
9464
+ return ret;
9465
+ };
9466
+
9467
+ export function __wbg_sharesatheight_new(arg0) {
9468
+ const ret = SharesAtHeight.__wrap(arg0);
9469
+ return ret;
9470
+ };
9471
+
8844
9472
  export function __wbg_signature_new(arg0) {
8845
9473
  const ret = Signature.__wrap(arg0);
8846
9474
  return ret;
@@ -8919,6 +9547,11 @@ export function __wbg_subarray_a219824899e59712(arg0, arg1, arg2) {
8919
9547
  return ret;
8920
9548
  };
8921
9549
 
9550
+ export function __wbg_subscriptionerror_new(arg0) {
9551
+ const ret = SubscriptionError.__wrap(arg0);
9552
+ return ret;
9553
+ };
9554
+
8922
9555
  export function __wbg_syncinginfosnapshot_new(arg0) {
8923
9556
  const ret = SyncingInfoSnapshot.__wrap(arg0);
8924
9557
  return ret;
@@ -8949,6 +9582,14 @@ export function __wbg_toString_1588a16751ba3f70(arg0) {
8949
9582
  return ret;
8950
9583
  };
8951
9584
 
9585
+ export function __wbg_toString_22c84ec5b4e33ea4(arg0, arg1, arg2) {
9586
+ const ret = arg1.toString(arg2);
9587
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9588
+ const len1 = WASM_VECTOR_LEN;
9589
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
9590
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
9591
+ };
9592
+
8952
9593
  export function __wbg_transaction_8267254fd462a1bb(arg0) {
8953
9594
  const ret = arg0.transaction;
8954
9595
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
@@ -8959,6 +9600,14 @@ export function __wbg_transaction_fca796495943f7a5() { return handleError(functi
8959
9600
  return ret;
8960
9601
  }, arguments) };
8961
9602
 
9603
+ export function __wbg_tx_a9e8b830cc737b89(arg0, arg1) {
9604
+ const ret = arg1.tx;
9605
+ const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
9606
+ const len1 = WASM_VECTOR_LEN;
9607
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
9608
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
9609
+ };
9610
+
8962
9611
  export function __wbg_txresponse_new(arg0) {
8963
9612
  const ret = TxResponse.__wrap(arg0);
8964
9613
  return ret;
@@ -8969,7 +9618,7 @@ export function __wbg_txstatusresponse_new(arg0) {
8969
9618
  return ret;
8970
9619
  };
8971
9620
 
8972
- export function __wbg_typeUrl_f02514616b090ac1(arg0, arg1) {
9621
+ export function __wbg_typeUrl_4c4eb539151a91f5(arg0, arg1) {
8973
9622
  const ret = arg1.typeUrl;
8974
9623
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
8975
9624
  const len1 = WASM_VECTOR_LEN;
@@ -9003,7 +9652,12 @@ export function __wbg_value_09d0b4eaab48b91d(arg0) {
9003
9652
  return ret;
9004
9653
  };
9005
9654
 
9006
- export function __wbg_value_3c6f117eabb16ab3(arg0, arg1) {
9655
+ export function __wbg_value_3e45d77a58bc804d() { return handleError(function (arg0) {
9656
+ const ret = arg0.value;
9657
+ return ret;
9658
+ }, arguments) };
9659
+
9660
+ export function __wbg_value_91f0ed317ab02220(arg0, arg1) {
9007
9661
  const ret = arg1.value;
9008
9662
  const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
9009
9663
  const len1 = WASM_VECTOR_LEN;
@@ -9011,11 +9665,6 @@ export function __wbg_value_3c6f117eabb16ab3(arg0, arg1) {
9011
9665
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
9012
9666
  };
9013
9667
 
9014
- export function __wbg_value_3e45d77a58bc804d() { return handleError(function (arg0) {
9015
- const ret = arg0.value;
9016
- return ret;
9017
- }, arguments) };
9018
-
9019
9668
  export function __wbg_versions_c01dfd4722a88165(arg0) {
9020
9669
  const ret = arg0.versions;
9021
9670
  return ret;
@@ -9112,6 +9761,16 @@ export function __wbg_wbindgenjsvallooseeq_9dd7bb4b95ac195c(arg0, arg1) {
9112
9761
  return ret;
9113
9762
  };
9114
9763
 
9764
+ export function __wbg_wbindgenlt_ab7deb4a53ea1252(arg0, arg1) {
9765
+ const ret = arg0 < arg1;
9766
+ return ret;
9767
+ };
9768
+
9769
+ export function __wbg_wbindgenneg_32dfec7df2a39998(arg0) {
9770
+ const ret = -arg0;
9771
+ return ret;
9772
+ };
9773
+
9115
9774
  export function __wbg_wbindgennumberget_d855f947247a3fbc(arg0, arg1) {
9116
9775
  const obj = arg1;
9117
9776
  const ret = typeof(obj) === 'number' ? obj : undefined;
@@ -9137,7 +9796,7 @@ export function __wbg_wbindgentypeof_7219206940ac0898(arg0) {
9137
9796
  return ret;
9138
9797
  };
9139
9798
 
9140
- export function __wbg_writable_4f9d2cae62a7c0cb(arg0) {
9799
+ export function __wbg_writable_64e3474e78cea2a6(arg0) {
9141
9800
  const ret = arg0.writable;
9142
9801
  return ret;
9143
9802
  };
@@ -9147,6 +9806,12 @@ export function __wbg_write_39d7c51f917777a5(arg0, arg1) {
9147
9806
  return ret;
9148
9807
  };
9149
9808
 
9809
+ export function __wbindgen_cast_104c8ef10f0d551e(arg0, arg1) {
9810
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1891, function: Function { arguments: [NamedExternref("Event")], shim_idx: 1892, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
9811
+ const ret = makeMutClosure(arg0, arg1, 1891, __wbg_adapter_9);
9812
+ return ret;
9813
+ };
9814
+
9150
9815
  export function __wbindgen_cast_13f728beb3308701(arg0, arg1) {
9151
9816
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
9152
9817
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
@@ -9155,51 +9820,51 @@ export function __wbindgen_cast_13f728beb3308701(arg0, arg1) {
9155
9820
  return ret;
9156
9821
  };
9157
9822
 
9158
- export function __wbindgen_cast_17625ed3b4da24cb(arg0, arg1) {
9159
- // Cast intrinsic for `Closure(Closure { dtor_idx: 1748, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 1749, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
9160
- const ret = makeMutClosure(arg0, arg1, 1748, __wbg_adapter_11);
9161
- return ret;
9162
- };
9163
-
9164
9823
  export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
9165
9824
  // Cast intrinsic for `Ref(String) -> Externref`.
9166
9825
  const ret = getStringFromWasm0(arg0, arg1);
9167
9826
  return ret;
9168
9827
  };
9169
9828
 
9170
- export function __wbindgen_cast_3d27ec27b68ba2cd(arg0, arg1) {
9171
- // Cast intrinsic for `Closure(Closure { dtor_idx: 1748, function: Function { arguments: [NamedExternref("Event")], shim_idx: 1749, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
9172
- const ret = makeMutClosure(arg0, arg1, 1748, __wbg_adapter_11);
9829
+ export function __wbindgen_cast_2def26224b93ce84(arg0, arg1) {
9830
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 307, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 311, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
9831
+ const ret = makeClosure(arg0, arg1, 307, __wbg_adapter_28);
9173
9832
  return ret;
9174
9833
  };
9175
9834
 
9176
- export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
9177
- // Cast intrinsic for `U64 -> Externref`.
9178
- const ret = BigInt.asUintN(64, arg0);
9835
+ export function __wbindgen_cast_3ed92e68b5dc4732(arg0, arg1) {
9836
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 2957, function: Function { arguments: [Externref], shim_idx: 2958, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
9837
+ const ret = makeMutClosure(arg0, arg1, 2957, __wbg_adapter_14);
9838
+ return ret;
9839
+ };
9840
+
9841
+ export function __wbindgen_cast_41034090fdd410c2(arg0, arg1) {
9842
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 307, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 313, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
9843
+ const ret = makeMutClosure(arg0, arg1, 307, __wbg_adapter_6);
9179
9844
  return ret;
9180
9845
  };
9181
9846
 
9182
- export function __wbindgen_cast_4b1e345b770365a0(arg0, arg1) {
9183
- // Cast intrinsic for `Closure(Closure { dtor_idx: 726, function: Function { arguments: [Externref], shim_idx: 729, ret: NamedExternref("Promise<any>"), inner_ret: Some(NamedExternref("Promise<any>")) }, mutable: true }) -> Externref`.
9184
- const ret = makeMutClosure(arg0, arg1, 726, __wbg_adapter_44);
9847
+ export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
9848
+ // Cast intrinsic for `U64 -> Externref`.
9849
+ const ret = BigInt.asUintN(64, arg0);
9185
9850
  return ret;
9186
9851
  };
9187
9852
 
9188
- export function __wbindgen_cast_6cadf2dadb047667(arg0, arg1) {
9189
- // Cast intrinsic for `Closure(Closure { dtor_idx: 2840, function: Function { arguments: [Externref], shim_idx: 2841, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
9190
- const ret = makeMutClosure(arg0, arg1, 2840, __wbg_adapter_23);
9853
+ export function __wbindgen_cast_4cd69de52ef2f041(arg0, arg1) {
9854
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1891, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 1892, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
9855
+ const ret = makeMutClosure(arg0, arg1, 1891, __wbg_adapter_9);
9191
9856
  return ret;
9192
9857
  };
9193
9858
 
9194
- export function __wbindgen_cast_7052a031800ef013(arg0, arg1) {
9195
- // Cast intrinsic for `Closure(Closure { dtor_idx: 726, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 727, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
9196
- const ret = makeClosure(arg0, arg1, 726, __wbg_adapter_26);
9859
+ export function __wbindgen_cast_569c038971c23e28(arg0, arg1) {
9860
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 307, function: Function { arguments: [Externref], shim_idx: 308, ret: NamedExternref("Promise<any>"), inner_ret: Some(NamedExternref("Promise<any>")) }, mutable: true }) -> Externref`.
9861
+ const ret = makeMutClosure(arg0, arg1, 307, __wbg_adapter_31);
9197
9862
  return ret;
9198
9863
  };
9199
9864
 
9200
- export function __wbindgen_cast_70bf32696ce323a8(arg0, arg1) {
9201
- // Cast intrinsic for `Closure(Closure { dtor_idx: 2852, function: Function { arguments: [], shim_idx: 2853, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
9202
- const ret = makeMutClosure(arg0, arg1, 2852, __wbg_adapter_47);
9865
+ export function __wbindgen_cast_6411431e1279b11e(arg0, arg1) {
9866
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 3065, function: Function { arguments: [NamedExternref("Event")], shim_idx: 3066, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
9867
+ const ret = makeMutClosure(arg0, arg1, 3065, __wbg_adapter_34);
9203
9868
  return ret;
9204
9869
  };
9205
9870
 
@@ -9211,9 +9876,15 @@ export function __wbindgen_cast_76a0f6231a633ad2(arg0, arg1) {
9211
9876
  return ret;
9212
9877
  };
9213
9878
 
9214
- export function __wbindgen_cast_780e81115060bad4(arg0, arg1) {
9215
- // Cast intrinsic for `Closure(Closure { dtor_idx: 1748, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 1749, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
9216
- const ret = makeMutClosure(arg0, arg1, 1748, __wbg_adapter_11);
9879
+ export function __wbindgen_cast_82126c3d553ff7c6(arg0, arg1) {
9880
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 307, function: Function { arguments: [], shim_idx: 315, ret: NamedExternref("Promise<any>"), inner_ret: Some(NamedExternref("Promise<any>")) }, mutable: true }) -> Externref`.
9881
+ const ret = makeMutClosure(arg0, arg1, 307, __wbg_adapter_47);
9882
+ return ret;
9883
+ };
9884
+
9885
+ export function __wbindgen_cast_82adbf85e8d83012(arg0, arg1) {
9886
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1891, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 1892, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
9887
+ const ret = makeMutClosure(arg0, arg1, 1891, __wbg_adapter_9);
9217
9888
  return ret;
9218
9889
  };
9219
9890
 
@@ -9231,15 +9902,15 @@ export function __wbindgen_cast_9ae0607507abb057(arg0) {
9231
9902
  return ret;
9232
9903
  };
9233
9904
 
9234
- export function __wbindgen_cast_cb9088102bce6b30(arg0, arg1) {
9235
- // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
9236
- const ret = getArrayU8FromWasm0(arg0, arg1);
9905
+ export function __wbindgen_cast_c2988c7e5684370a(arg0, arg1) {
9906
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 2969, function: Function { arguments: [], shim_idx: 2970, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
9907
+ const ret = makeMutClosure(arg0, arg1, 2969, __wbg_adapter_23);
9237
9908
  return ret;
9238
9909
  };
9239
9910
 
9240
- export function __wbindgen_cast_d144656a3d1ab4ad(arg0, arg1) {
9241
- // Cast intrinsic for `Closure(Closure { dtor_idx: 2960, function: Function { arguments: [NamedExternref("Event")], shim_idx: 2961, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
9242
- const ret = makeMutClosure(arg0, arg1, 2960, __wbg_adapter_31);
9911
+ export function __wbindgen_cast_cb9088102bce6b30(arg0, arg1) {
9912
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
9913
+ const ret = getArrayU8FromWasm0(arg0, arg1);
9243
9914
  return ret;
9244
9915
  };
9245
9916
 
@@ -9249,12 +9920,6 @@ export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
9249
9920
  return ret;
9250
9921
  };
9251
9922
 
9252
- export function __wbindgen_cast_d81407fed0b5a02d(arg0, arg1) {
9253
- // Cast intrinsic for `Closure(Closure { dtor_idx: 2294, function: Function { arguments: [], shim_idx: 2295, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
9254
- const ret = makeMutClosure(arg0, arg1, 2294, __wbg_adapter_8);
9255
- return ret;
9256
- };
9257
-
9258
9923
  export function __wbindgen_cast_da0d185114cf54d4(arg0, arg1) {
9259
9924
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
9260
9925
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
@@ -9263,9 +9928,9 @@ export function __wbindgen_cast_da0d185114cf54d4(arg0, arg1) {
9263
9928
  return ret;
9264
9929
  };
9265
9930
 
9266
- export function __wbindgen_cast_f2aa4ac7119e14c0(arg0, arg1) {
9267
- // Cast intrinsic for `Closure(Closure { dtor_idx: 726, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 731, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
9268
- const ret = makeMutClosure(arg0, arg1, 726, __wbg_adapter_20);
9931
+ export function __wbindgen_cast_f3fc3c7dffa96b4b(arg0, arg1) {
9932
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 2441, function: Function { arguments: [], shim_idx: 2442, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
9933
+ const ret = makeMutClosure(arg0, arg1, 2441, __wbg_adapter_52);
9269
9934
  return ret;
9270
9935
  };
9271
9936