lumina-node-wasm 0.11.0 → 0.12.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.
@@ -384,10 +384,14 @@ export enum TxStatus {
384
384
  * The transaction was evicted from the mempool.
385
385
  */
386
386
  Evicted = 2,
387
+ /**
388
+ * The transaction was rejected
389
+ */
390
+ Rejected = 3,
387
391
  /**
388
392
  * The transaction was committed into the block.
389
393
  */
390
- Committed = 3,
394
+ Committed = 4,
391
395
  }
392
396
  /**
393
397
  * Types of votes
@@ -536,6 +540,13 @@ export class AbciMessageLog {
536
540
  export class AbciQueryResponse {
537
541
  private constructor();
538
542
  free(): void;
543
+ /**
544
+ * The block height from which data was derived.
545
+ *
546
+ * Note that this is the height of the block containing the application's Merkle root hash,
547
+ * which represents the state as it was after committing the block at height - 1.
548
+ */
549
+ readonly height: bigint;
539
550
  /**
540
551
  * Response code.
541
552
  */
@@ -579,13 +590,6 @@ export class AbciQueryResponse {
579
590
  * Additional information. May be non-deterministic.
580
591
  */
581
592
  info: string;
582
- /**
583
- * The block height from which data was derived.
584
- *
585
- * Note that this is the height of the block containing the application's Merkle root hash,
586
- * which represents the state as it was after committing the block at height - 1.
587
- */
588
- readonly height: bigint;
589
593
  }
590
594
  /**
591
595
  * Address of an account.
@@ -840,16 +844,16 @@ export class BroadcastMode {
840
844
  * zero-value for mode ordering
841
845
  */
842
846
  static readonly Unspecified: BroadcastMode;
843
- /**
844
- * DEPRECATED: use `BroadcastMode` `Sync` instead,
845
- * `BroadcastMode` `Block` is not supported by the SDK from v0.47.x onwards.
846
- */
847
- static readonly Block: BroadcastMode;
848
847
  /**
849
848
  * `BroadcastMode` `Sync` defines a tx broadcasting mode where the client waits for
850
849
  * a CheckTx execution response only.
851
850
  */
852
851
  static readonly Sync: BroadcastMode;
852
+ /**
853
+ * DEPRECATED: use `BroadcastMode` `Sync` instead,
854
+ * `BroadcastMode` `Block` is not supported by the SDK from v0.47.x onwards.
855
+ */
856
+ static readonly Block: BroadcastMode;
853
857
  /**
854
858
  * `BroadcastMode` `Async` defines a tx broadcasting mode where the client returns
855
859
  * immediately.
@@ -1026,6 +1030,9 @@ export class ConflictingBlock {
1026
1030
  */
1027
1031
  validator_set: ValidatorSet;
1028
1032
  }
1033
+ /**
1034
+ * Network connection information
1035
+ */
1029
1036
  export class ConnectionCountersSnapshot {
1030
1037
  private constructor();
1031
1038
  /**
@@ -1151,32 +1158,32 @@ export class DataAvailabilityHeader {
1151
1158
  */
1152
1159
  toString(): string;
1153
1160
  free(): void;
1161
+ /**
1162
+ * Get a root of the row with the given index.
1163
+ */
1164
+ rowRoot(row: number): any;
1154
1165
  /**
1155
1166
  * Merkle roots of the [`ExtendedDataSquare`] rows.
1156
1167
  */
1157
1168
  rowRoots(): Array<any>;
1158
1169
  /**
1159
- * Merkle roots of the [`ExtendedDataSquare`] columns.
1170
+ * Get the a root of the column with the given index.
1160
1171
  */
1161
- columnRoots(): Array<any>;
1172
+ columnRoot(column: number): any;
1162
1173
  /**
1163
- * Get a root of the row with the given index.
1174
+ * Merkle roots of the [`ExtendedDataSquare`] columns.
1164
1175
  */
1165
- rowRoot(row: number): any;
1176
+ columnRoots(): Array<any>;
1166
1177
  /**
1167
- * Get the a root of the column with the given index.
1178
+ * Get the size of the [`ExtendedDataSquare`] for which this header was built.
1168
1179
  */
1169
- columnRoot(column: number): any;
1180
+ squareWidth(): number;
1170
1181
  /**
1171
1182
  * Compute the combined hash of all rows and columns.
1172
1183
  *
1173
1184
  * This is the data commitment for the block.
1174
1185
  */
1175
1186
  hash(): any;
1176
- /**
1177
- * Get the size of the [`ExtendedDataSquare`] for which this header was built.
1178
- */
1179
- squareWidth(): number;
1180
1187
  }
1181
1188
  /**
1182
1189
  * Duplicate vote evidence
@@ -1252,40 +1259,10 @@ export class ExtendedHeader {
1252
1259
  */
1253
1260
  toString(): string;
1254
1261
  free(): void;
1255
- /**
1256
- * Clone a header producing a deep copy of it.
1257
- */
1258
- clone(): ExtendedHeader;
1259
- /**
1260
- * Get the block height.
1261
- */
1262
- height(): bigint;
1263
- /**
1264
- * Get the block time.
1265
- */
1266
- time(): number;
1267
- /**
1268
- * Get the block hash.
1269
- */
1270
- hash(): string;
1271
- /**
1272
- * Get the hash of the previous header.
1273
- */
1274
- previousHeaderHash(): string;
1275
1262
  /**
1276
1263
  * Decode protobuf encoded header and then validate it.
1277
1264
  */
1278
1265
  validate(): void;
1279
- /**
1280
- * Verify a chain of adjacent untrusted headers and make sure
1281
- * they are adjacent to `self`.
1282
- *
1283
- * # Errors
1284
- *
1285
- * If verification fails, this function will return an error with a reason of failure.
1286
- * This function will also return an error if untrusted headers and `self` don't form contiguous range
1287
- */
1288
- verify(untrusted: ExtendedHeader): void;
1289
1266
  /**
1290
1267
  * Verify a chain of adjacent untrusted headers.
1291
1268
  *
@@ -1308,6 +1285,10 @@ export class ExtendedHeader {
1308
1285
  * to each other.
1309
1286
  */
1310
1287
  verifyRange(untrusted: ExtendedHeader[]): void;
1288
+ /**
1289
+ * Get the hash of the previous header.
1290
+ */
1291
+ previousHeaderHash(): string;
1311
1292
  /**
1312
1293
  * Verify a chain of adjacent untrusted headers and make sure
1313
1294
  * they are adjacent to `self`.
@@ -1331,21 +1312,47 @@ export class ExtendedHeader {
1331
1312
  */
1332
1313
  verifyAdjacentRange(untrusted: ExtendedHeader[]): void;
1333
1314
  /**
1334
- * Header of the block data availability.
1315
+ * Get the block hash.
1335
1316
  */
1336
- dah: DataAvailabilityHeader;
1317
+ hash(): string;
1337
1318
  /**
1338
- * Tendermint block header.
1319
+ * Get the block time.
1339
1320
  */
1340
- readonly header: any;
1321
+ time(): number;
1341
1322
  /**
1342
- * Commit metadata and signatures from validators committing the block.
1323
+ * Clone a header producing a deep copy of it.
1343
1324
  */
1344
- readonly commit: any;
1325
+ clone(): ExtendedHeader;
1326
+ /**
1327
+ * Get the block height.
1328
+ */
1329
+ height(): bigint;
1330
+ /**
1331
+ * Verify a chain of adjacent untrusted headers and make sure
1332
+ * they are adjacent to `self`.
1333
+ *
1334
+ * # Errors
1335
+ *
1336
+ * If verification fails, this function will return an error with a reason of failure.
1337
+ * This function will also return an error if untrusted headers and `self` don't form contiguous range
1338
+ */
1339
+ verify(untrusted: ExtendedHeader): void;
1345
1340
  /**
1346
1341
  * Information about the set of validators commiting the block.
1347
1342
  */
1348
1343
  readonly validatorSet: any;
1344
+ /**
1345
+ * Commit metadata and signatures from validators committing the block.
1346
+ */
1347
+ readonly commit: any;
1348
+ /**
1349
+ * Tendermint block header.
1350
+ */
1351
+ readonly header: any;
1352
+ /**
1353
+ * Header of the block data availability.
1354
+ */
1355
+ dah: DataAvailabilityHeader;
1349
1356
  }
1350
1357
  /**
1351
1358
  * Fee includes the amount of coins paid in fees and the maximum
@@ -1429,92 +1436,25 @@ export class GrpcClient {
1429
1436
  private constructor();
1430
1437
  free(): void;
1431
1438
  /**
1432
- * Create a builder for [`GrpcClient`] connected to `url`
1433
- */
1434
- static withUrl(url: string): GrpcClientBuilder;
1435
- /**
1436
- * Get auth params
1439
+ * Issue a direct ABCI query to the application
1437
1440
  */
1438
- getAuthParams(): Promise<AuthParams>;
1441
+ abciQuery(data: Uint8Array, path: string, height: bigint, prove: boolean): Promise<AbciQueryResponse>;
1439
1442
  /**
1440
1443
  * Get account
1441
1444
  */
1442
1445
  getAccount(account: string): Promise<BaseAccount>;
1443
- /**
1444
- * Get accounts
1445
- */
1446
- getAccounts(): Promise<BaseAccount[]>;
1447
- /**
1448
- * Retrieves the verified Celestia coin balance for the address.
1449
- *
1450
- * # Notes
1451
- *
1452
- * This returns the verified balance which is the one that was reported by
1453
- * the previous network block. In other words, if you transfer some coins,
1454
- * you need to wait 1 more block in order to see the new balance. If you want
1455
- * something more immediate then use [`GrpcClient::get_balance`].
1456
- */
1457
- getVerifiedBalance(address: string, header: ExtendedHeader): Promise<Coin>;
1458
1446
  /**
1459
1447
  * Retrieves the Celestia coin balance for the given address.
1460
1448
  */
1461
1449
  getBalance(address: string, denom: string): Promise<Coin>;
1462
- /**
1463
- * Get balance of all coins
1464
- */
1465
- getAllBalances(address: string): Promise<Coin[]>;
1466
- /**
1467
- * Get balance of all spendable coins
1468
- */
1469
- getSpendableBalances(address: string): Promise<Coin[]>;
1470
- /**
1471
- * Get total supply
1472
- */
1473
- getTotalSupply(): Promise<Coin[]>;
1474
- /**
1475
- * Get node configuration
1476
- */
1477
- get_node_config(): Promise<ConfigResponse>;
1478
- /**
1479
- * Get latest block
1480
- */
1481
- getLatestBlock(): Promise<Block>;
1482
- /**
1483
- * Get block by height
1484
- */
1485
- getBlockByHeight(height: bigint): Promise<Block>;
1486
- /**
1487
- * Issue a direct ABCI query to the application
1488
- */
1489
- abciQuery(data: Uint8Array, path: string, height: bigint, prove: boolean): Promise<AbciQueryResponse>;
1490
1450
  /**
1491
1451
  * Broadcast prepared and serialised transaction
1492
1452
  */
1493
1453
  broadcastTx(tx_bytes: Uint8Array, mode: BroadcastMode): Promise<TxResponse>;
1494
1454
  /**
1495
- * Get Tx
1496
- */
1497
- getTx(hash: string): Promise<GetTxResponse>;
1498
- /**
1499
- * Simulate prepared and serialised transaction, returning simulated gas usage
1500
- */
1501
- simulate(tx_bytes: Uint8Array): Promise<GasInfo>;
1502
- /**
1503
- * Get blob params
1504
- */
1505
- getBlobParams(): Promise<BlobParams>;
1506
- /**
1507
- * Get status of the transaction
1508
- */
1509
- txStatus(hash: string): Promise<TxStatusResponse>;
1510
- /**
1511
- * Estimate gas price for given transaction priority based
1512
- * on the gas prices of the transactions in the last five blocks.
1513
- *
1514
- * If no transaction is found in the last five blocks, return the network
1515
- * min gas price.
1455
+ * Get accounts
1516
1456
  */
1517
- estimateGasPrice(priority: TxPriority): Promise<number>;
1457
+ getAccounts(): Promise<BaseAccount[]>;
1518
1458
  /**
1519
1459
  * Submit blobs to the celestia network.
1520
1460
  *
@@ -1563,81 +1503,134 @@ export class GrpcClient {
1563
1503
  */
1564
1504
  submitMessage(message: ProtoAny, tx_config?: TxConfig | null): Promise<TxInfo>;
1565
1505
  /**
1566
- * Chain id of the client
1506
+ * Get auth params
1567
1507
  */
1568
- readonly chainId: Promise<string>;
1508
+ getAuthParams(): Promise<AuthParams>;
1569
1509
  /**
1570
- * AppVersion of the client
1510
+ * Get blob params
1571
1511
  */
1572
- readonly appVersion: Promise<AppVersion>;
1573
- }
1574
- /**
1575
- * Builder for [`GrpcClient`] and [`TxClient`].
1576
- *
1577
- * Url must point to a [grpc-web proxy](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md).
1578
- *
1579
- * # Keyless client example
1580
- *
1581
- * ```js
1582
- * const client = await GrpcClient
1583
- * .withUrl("http://127.0.0.1:18080")
1584
- * .build()
1585
- * ```
1586
- *
1587
- * # Transaction client examples
1588
- *
1589
- * ## Example with noble/curves
1590
- * ```js
1591
- * import { secp256k1 } from "@noble/curves/secp256k1";
1592
- *
1593
- * const privKey = "fdc8ac75dfa1c142dbcba77938a14dd03078052ce0b49a529dcf72a9885a3abb";
1594
- * const pubKey = secp256k1.getPublicKey(privKey);
1595
- *
1596
- * const signer = (signDoc) => {
1597
- * const bytes = protoEncodeSignDoc(signDoc);
1598
- * const sig = secp256k1.sign(bytes, privKey, { prehash: true });
1599
- * return sig.toCompactRawBytes();
1600
- * };
1601
- *
1602
- * const client = await GrpcClient
1603
- * .withUrl("http://127.0.0.1:18080")
1604
- * .withPubkeyAndSigner(pubKey, signer)
1605
- * .build();
1606
- * ```
1607
- *
1608
- * ## Example with leap wallet
1609
- * ```js
1610
- * await window.leap.enable("mocha-4")
1611
- * const keys = await window.leap.getKey("mocha-4")
1612
- *
1613
- * const signer = (signDoc) => {
1614
- * return window.leap.signDirect("mocha-4", keys.bech32Address, signDoc, { preferNoSetFee: true })
1615
- * .then(sig => Uint8Array.from(atob(sig.signature.signature), c => c.charCodeAt(0)))
1616
- * }
1617
- *
1618
- * const client = await GrpcClient
1619
- * .withUrl("http://127.0.0.1:18080")
1620
- * .withPubkeyAndSigner(keys.pubKey, signer)
1621
- * .build()
1622
- * ```
1623
- */
1624
- export class GrpcClientBuilder {
1625
- private constructor();
1626
- free(): void;
1512
+ getBlobParams(): Promise<BlobParams>;
1627
1513
  /**
1628
- * Set the `url` of the grpc-web server to connect to
1514
+ * Get node configuration
1515
+ */
1516
+ get_node_config(): Promise<ConfigResponse>;
1517
+ /**
1518
+ * Get balance of all coins
1519
+ */
1520
+ getAllBalances(address: string): Promise<Coin[]>;
1521
+ /**
1522
+ * Get latest block
1523
+ */
1524
+ getLatestBlock(): Promise<Block>;
1525
+ /**
1526
+ * Get total supply
1527
+ */
1528
+ getTotalSupply(): Promise<Coin[]>;
1529
+ /**
1530
+ * Estimate gas price for given transaction priority based
1531
+ * on the gas prices of the transactions in the last five blocks.
1629
1532
  *
1630
- * Note that this method **consumes** builder and returns updated instance of it.
1631
- * Make sure to re-assign it if you keep builder in a variable.
1533
+ * If no transaction is found in the last five blocks, return the network
1534
+ * min gas price.
1632
1535
  */
1633
- withUrl(url: string): GrpcClientBuilder;
1536
+ estimateGasPrice(priority: TxPriority): Promise<number>;
1634
1537
  /**
1635
- * Add public key and signer to the client being built
1538
+ * Get block by height
1539
+ */
1540
+ getBlockByHeight(height: bigint): Promise<Block>;
1541
+ /**
1542
+ * Retrieves the verified Celestia coin balance for the address.
1636
1543
  *
1637
- * Note that this method **consumes** builder and returns updated instance of it.
1638
- * Make sure to re-assign it if you keep builder in a variable.
1544
+ * # Notes
1545
+ *
1546
+ * This returns the verified balance which is the one that was reported by
1547
+ * the previous network block. In other words, if you transfer some coins,
1548
+ * you need to wait 1 more block in order to see the new balance. If you want
1549
+ * something more immediate then use [`GrpcClient::get_balance`].
1639
1550
  */
1640
- withPubkeyAndSigner(account_pubkey: Uint8Array, signer_fn: SignerFn): GrpcClientBuilder;
1551
+ getVerifiedBalance(address: string, header: ExtendedHeader): Promise<Coin>;
1552
+ /**
1553
+ * Get balance of all spendable coins
1554
+ */
1555
+ getSpendableBalances(address: string): Promise<Coin[]>;
1556
+ /**
1557
+ * Get Tx
1558
+ */
1559
+ getTx(hash: string): Promise<GetTxResponse>;
1560
+ /**
1561
+ * Simulate prepared and serialised transaction, returning simulated gas usage
1562
+ */
1563
+ simulate(tx_bytes: Uint8Array): Promise<GasInfo>;
1564
+ /**
1565
+ * Create a builder for [`GrpcClient`] connected to `url`
1566
+ */
1567
+ static withUrl(url: string): GrpcClientBuilder;
1568
+ /**
1569
+ * Get status of the transaction
1570
+ */
1571
+ txStatus(hash: string): Promise<TxStatusResponse>;
1572
+ /**
1573
+ * AppVersion of the client
1574
+ */
1575
+ readonly appVersion: Promise<AppVersion>;
1576
+ /**
1577
+ * Chain id of the client
1578
+ */
1579
+ readonly chainId: Promise<string>;
1580
+ }
1581
+ /**
1582
+ * Builder for [`GrpcClient`] and [`TxClient`].
1583
+ *
1584
+ * Url must point to a [grpc-web proxy](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md).
1585
+ *
1586
+ * # Keyless client example
1587
+ *
1588
+ * ```js
1589
+ * const client = await GrpcClient
1590
+ * .withUrl("http://127.0.0.1:18080")
1591
+ * .build()
1592
+ * ```
1593
+ *
1594
+ * # Transaction client examples
1595
+ *
1596
+ * ## Example with noble/curves
1597
+ * ```js
1598
+ * import { secp256k1 } from "@noble/curves/secp256k1";
1599
+ *
1600
+ * const privKey = "fdc8ac75dfa1c142dbcba77938a14dd03078052ce0b49a529dcf72a9885a3abb";
1601
+ * const pubKey = secp256k1.getPublicKey(privKey);
1602
+ *
1603
+ * const signer = (signDoc) => {
1604
+ * const bytes = protoEncodeSignDoc(signDoc);
1605
+ * const sig = secp256k1.sign(bytes, privKey, { prehash: true });
1606
+ * return sig.toCompactRawBytes();
1607
+ * };
1608
+ *
1609
+ * const client = await GrpcClient
1610
+ * .withUrl("http://127.0.0.1:18080")
1611
+ * .withPubkeyAndSigner(pubKey, signer)
1612
+ * .build();
1613
+ * ```
1614
+ *
1615
+ * ## Example with leap wallet
1616
+ * ```js
1617
+ * await window.leap.enable("mocha-4")
1618
+ * const keys = await window.leap.getKey("mocha-4")
1619
+ *
1620
+ * const signer = (signDoc) => {
1621
+ * return window.leap.signDirect("mocha-4", keys.bech32Address, signDoc, { preferNoSetFee: true })
1622
+ * .then(sig => Uint8Array.from(atob(sig.signature.signature), c => c.charCodeAt(0)))
1623
+ * }
1624
+ *
1625
+ * const client = await GrpcClient
1626
+ * .withUrl("http://127.0.0.1:18080")
1627
+ * .withPubkeyAndSigner(keys.pubKey, signer)
1628
+ * .build()
1629
+ * ```
1630
+ */
1631
+ export class GrpcClientBuilder {
1632
+ private constructor();
1633
+ free(): void;
1641
1634
  /**
1642
1635
  * Appends ascii metadata to all requests made by the client.
1643
1636
  *
@@ -1654,10 +1647,24 @@ export class GrpcClientBuilder {
1654
1647
  * Make sure to re-assign it if you keep builder in a variable.
1655
1648
  */
1656
1649
  withMetadataBin(key: string, value: Uint8Array): GrpcClientBuilder;
1650
+ /**
1651
+ * Add public key and signer to the client being built
1652
+ *
1653
+ * Note that this method **consumes** builder and returns updated instance of it.
1654
+ * Make sure to re-assign it if you keep builder in a variable.
1655
+ */
1656
+ withPubkeyAndSigner(account_pubkey: Uint8Array, signer_fn: SignerFn): GrpcClientBuilder;
1657
1657
  /**
1658
1658
  * build gRPC client
1659
1659
  */
1660
1660
  build(): GrpcClient;
1661
+ /**
1662
+ * Set the `url` of the grpc-web server to connect to
1663
+ *
1664
+ * Note that this method **consumes** builder and returns updated instance of it.
1665
+ * Make sure to re-assign it if you keep builder in a variable.
1666
+ */
1667
+ withUrl(url: string): GrpcClientBuilder;
1661
1668
  }
1662
1669
  /**
1663
1670
  * Block Header values contain metadata about the block and about the consensus,
@@ -1747,18 +1754,18 @@ export class Header {
1747
1754
  export class IntoUnderlyingByteSource {
1748
1755
  private constructor();
1749
1756
  free(): void;
1750
- start(controller: ReadableByteStreamController): void;
1751
1757
  pull(controller: ReadableByteStreamController): Promise<any>;
1758
+ start(controller: ReadableByteStreamController): void;
1752
1759
  cancel(): void;
1753
- readonly type: ReadableStreamType;
1754
1760
  readonly autoAllocateChunkSize: number;
1761
+ readonly type: ReadableStreamType;
1755
1762
  }
1756
1763
  export class IntoUnderlyingSink {
1757
1764
  private constructor();
1758
1765
  free(): void;
1759
- write(chunk: any): Promise<any>;
1760
- close(): Promise<any>;
1761
1766
  abort(reason: any): Promise<any>;
1767
+ close(): Promise<any>;
1768
+ write(chunk: any): Promise<any>;
1762
1769
  }
1763
1770
  export class IntoUnderlyingSource {
1764
1771
  private constructor();
@@ -1860,6 +1867,12 @@ export class ModeInfo {
1860
1867
  * Return signature mode for the stored signature(s)
1861
1868
  */
1862
1869
  signature_mode(): SignatureMode;
1870
+ /**
1871
+ * Multi is the mode info for a multisig public key
1872
+ * mode_infos is the corresponding modes of the signers of the multisig
1873
+ * which could include nested multisig public keys
1874
+ */
1875
+ readonly mode_infos: ModeInfo[] | undefined;
1863
1876
  /**
1864
1877
  * Single is the mode info for a single signer. It is structured as a message
1865
1878
  * to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the
@@ -1871,12 +1884,6 @@ export class ModeInfo {
1871
1884
  * bitarray specifies which keys within the multisig are signing
1872
1885
  */
1873
1886
  readonly bitarray: JsBitVector | undefined;
1874
- /**
1875
- * Multi is the mode info for a multisig public key
1876
- * mode_infos is the corresponding modes of the signers of the multisig
1877
- * which could include nested multisig public keys
1878
- */
1879
- readonly mode_infos: ModeInfo[] | undefined;
1880
1887
  }
1881
1888
  /**
1882
1889
  * Namespace of the data published to the celestia network.
@@ -1911,13 +1918,9 @@ export class Namespace {
1911
1918
  toString(): string;
1912
1919
  free(): void;
1913
1920
  /**
1914
- * Create a new [`Namespace`] version `0` with given id.
1915
- *
1916
- * Check [`Namespace::new_v0`] for more details.
1917
- *
1918
- * [`Namespace::new_v0`]: https://docs.rs/celestia-types/latest/celestia_types/nmt/struct.Namespace.html#method.new_v0
1921
+ * Converts the [`Namespace`] to a byte slice.
1919
1922
  */
1920
- static newV0(id: Uint8Array): Namespace;
1923
+ asBytes(): Uint8Array;
1921
1924
  /**
1922
1925
  * Create a new [`Namespace`] from the raw bytes.
1923
1926
  *
@@ -1929,28 +1932,44 @@ export class Namespace {
1929
1932
  */
1930
1933
  static fromRaw(raw: Uint8Array): Namespace;
1931
1934
  /**
1932
- * Converts the [`Namespace`] to a byte slice.
1935
+ * Create a new [`Namespace`] version `0` with given id.
1936
+ *
1937
+ * Check [`Namespace::new_v0`] for more details.
1938
+ *
1939
+ * [`Namespace::new_v0`]: https://docs.rs/celestia-types/latest/celestia_types/nmt/struct.Namespace.html#method.new_v0
1933
1940
  */
1934
- asBytes(): Uint8Array;
1941
+ static newV0(id: Uint8Array): Namespace;
1935
1942
  /**
1936
1943
  * Namespace size in bytes.
1937
1944
  */
1938
1945
  static readonly NS_SIZE: number;
1946
+ /**
1947
+ * Returns the first byte indicating the version of the [`Namespace`].
1948
+ */
1949
+ readonly version: number;
1939
1950
  /**
1940
1951
  * Primary reserved [`Namespace`] for the compact `Share`s with `cosmos SDK` transactions.
1941
1952
  */
1942
1953
  static readonly TRANSACTION: Namespace;
1954
+ /**
1955
+ * The [`Namespace`] for `parity shares`.
1956
+ *
1957
+ * It is the namespace with which all the `parity shares` from
1958
+ * `ExtendedDataSquare` are inserted to the `Nmt` when computing
1959
+ * merkle roots.
1960
+ */
1961
+ static readonly PARITY_SHARE: Namespace;
1943
1962
  /**
1944
1963
  * Primary reserved [`Namespace`] for the compact Shares with MsgPayForBlobs transactions.
1945
1964
  */
1946
1965
  static readonly PAY_FOR_BLOB: Namespace;
1947
1966
  /**
1948
- * Primary reserved [`Namespace`] for the `Share`s used for padding.
1967
+ * Secondary reserved [`Namespace`] used for padding after the blobs.
1949
1968
  *
1950
- * `Share`s with this namespace are inserted after other shares from primary reserved namespace
1951
- * so that user-defined namespaces are correctly aligned in `ExtendedDataSquare`
1969
+ * It is used to fill up the `original data square` after all user-submitted
1970
+ * blobs before the parity data is generated for the `ExtendedDataSquare`.
1952
1971
  */
1953
- static readonly PRIMARY_RESERVED_PADDING: Namespace;
1972
+ static readonly TAIL_PADDING: Namespace;
1954
1973
  /**
1955
1974
  * Maximal primary reserved [`Namespace`].
1956
1975
  *
@@ -1964,24 +1983,12 @@ export class Namespace {
1964
1983
  */
1965
1984
  static readonly MIN_SECONDARY_RESERVED: Namespace;
1966
1985
  /**
1967
- * Secondary reserved [`Namespace`] used for padding after the blobs.
1968
- *
1969
- * It is used to fill up the `original data square` after all user-submitted
1970
- * blobs before the parity data is generated for the `ExtendedDataSquare`.
1971
- */
1972
- static readonly TAIL_PADDING: Namespace;
1973
- /**
1974
- * The [`Namespace`] for `parity shares`.
1986
+ * Primary reserved [`Namespace`] for the `Share`s used for padding.
1975
1987
  *
1976
- * It is the namespace with which all the `parity shares` from
1977
- * `ExtendedDataSquare` are inserted to the `Nmt` when computing
1978
- * merkle roots.
1979
- */
1980
- static readonly PARITY_SHARE: Namespace;
1981
- /**
1982
- * Returns the first byte indicating the version of the [`Namespace`].
1988
+ * `Share`s with this namespace are inserted after other shares from primary reserved namespace
1989
+ * so that user-defined namespaces are correctly aligned in `ExtendedDataSquare`
1983
1990
  */
1984
- readonly version: number;
1991
+ static readonly PRIMARY_RESERVED_PADDING: Namespace;
1985
1992
  /**
1986
1993
  * Returns the trailing 28 bytes indicating the id of the [`Namespace`].
1987
1994
  */
@@ -2019,118 +2026,121 @@ export class NetworkInfoSnapshot {
2019
2026
  export class NodeClient {
2020
2027
  free(): void;
2021
2028
  /**
2022
- * Create a new connection to a Lumina node running in [`NodeWorker`]. Provided `port` is
2023
- * expected to have `MessagePort`-like interface for sending and receiving messages.
2029
+ * Check whether Lumina is currently running
2024
2030
  */
2025
- constructor(port: any);
2031
+ isRunning(): Promise<boolean>;
2026
2032
  /**
2027
- * Establish a new connection to the existing worker over provided port
2033
+ * Get synced headers from the given heights range.
2034
+ *
2035
+ * If start of the range is undefined (None), the first returned header will be of height 1.
2036
+ * If end of the range is undefined (None), the last returned header will be the last header in the
2037
+ * store.
2038
+ *
2039
+ * # Errors
2040
+ *
2041
+ * If range contains a height of a header that is not found in the store.
2028
2042
  */
2029
- addConnectionToWorker(port: any): Promise<void>;
2043
+ getHeaders(start_height?: bigint | null, end_height?: bigint | null): Promise<ExtendedHeader[]>;
2030
2044
  /**
2031
- * Check whether Lumina is currently running
2045
+ * Get current header syncing info.
2032
2046
  */
2033
- isRunning(): Promise<boolean>;
2047
+ syncerInfo(): Promise<SyncingInfoSnapshot>;
2034
2048
  /**
2035
- * Start a node with the provided config, if it's not running
2049
+ * Get current network info.
2036
2050
  */
2037
- start(config: NodeConfig): Promise<void>;
2038
- stop(): Promise<void>;
2051
+ networkInfo(): Promise<NetworkInfoSnapshot>;
2039
2052
  /**
2040
2053
  * Get node's local peer ID.
2041
2054
  */
2042
2055
  localPeerId(): Promise<string>;
2043
2056
  /**
2044
- * Get current [`PeerTracker`] info.
2057
+ * Returns a [`BroadcastChannel`] for events generated by [`Node`].
2045
2058
  */
2046
- peerTrackerInfo(): Promise<PeerTrackerInfoSnapshot>;
2059
+ eventsChannel(): Promise<BroadcastChannel>;
2047
2060
  /**
2048
- * Wait until the node is connected to at least 1 peer.
2061
+ * Trust or untrust the peer with a given ID.
2049
2062
  */
2050
- waitConnected(): Promise<void>;
2063
+ setPeerTrust(peer_id: string, is_trusted: boolean): Promise<void>;
2051
2064
  /**
2052
- * Wait until the node is connected to at least 1 trusted peer.
2065
+ * Wait until the node is connected to at least 1 peer.
2053
2066
  */
2054
- waitConnectedTrusted(): Promise<void>;
2067
+ waitConnected(): Promise<void>;
2055
2068
  /**
2056
- * Get current network info.
2069
+ * Get all the peers that node is connected to.
2057
2070
  */
2058
- networkInfo(): Promise<NetworkInfoSnapshot>;
2071
+ connectedPeers(): Promise<Array<any>>;
2059
2072
  /**
2060
- * Get all the multiaddresses on which the node listens.
2073
+ * Get current [`PeerTracker`] info.
2061
2074
  */
2062
- listeners(): Promise<Array<any>>;
2075
+ peerTrackerInfo(): Promise<PeerTrackerInfoSnapshot>;
2063
2076
  /**
2064
- * Get all the peers that node is connected to.
2077
+ * Request all blobs with provided namespace in the block corresponding to this header
2078
+ * using bitswap protocol.
2065
2079
  */
2066
- connectedPeers(): Promise<Array<any>>;
2080
+ requestAllBlobs(namespace: Namespace, block_height: bigint, timeout_secs?: number | null): Promise<Blob[]>;
2067
2081
  /**
2068
- * Trust or untrust the peer with a given ID.
2082
+ * Get a synced header for the block with a given hash.
2069
2083
  */
2070
- setPeerTrust(peer_id: string, is_trusted: boolean): Promise<void>;
2084
+ getHeaderByHash(hash: string): Promise<ExtendedHeader>;
2071
2085
  /**
2072
2086
  * Request the head header from the network.
2073
2087
  */
2074
2088
  requestHeadHeader(): Promise<ExtendedHeader>;
2075
2089
  /**
2076
- * Request a header for the block with a given hash from the network.
2090
+ * Get a synced header for the block with a given height.
2077
2091
  */
2078
- requestHeaderByHash(hash: string): Promise<ExtendedHeader>;
2092
+ getHeaderByHeight(height: bigint): Promise<ExtendedHeader>;
2079
2093
  /**
2080
- * Request a header for the block with a given height from the network.
2094
+ * Get the latest locally synced header.
2081
2095
  */
2082
- requestHeaderByHeight(height: bigint): Promise<ExtendedHeader>;
2096
+ getLocalHeadHeader(): Promise<ExtendedHeader>;
2083
2097
  /**
2084
- * Request headers in range (from, from + amount] from the network.
2085
- *
2086
- * The headers will be verified with the `from` header.
2098
+ * Get data sampling metadata of an already sampled height.
2087
2099
  */
2088
- requestVerifiedHeaders(from: ExtendedHeader, amount: bigint): Promise<ExtendedHeader[]>;
2100
+ getSamplingMetadata(height: bigint): Promise<SamplingMetadata | undefined>;
2089
2101
  /**
2090
- * Request all blobs with provided namespace in the block corresponding to this header
2091
- * using bitswap protocol.
2102
+ * Request a header for the block with a given hash from the network.
2092
2103
  */
2093
- requestAllBlobs(namespace: Namespace, block_height: bigint, timeout_secs?: number | null): Promise<Blob[]>;
2104
+ requestHeaderByHash(hash: string): Promise<ExtendedHeader>;
2094
2105
  /**
2095
- * Get current header syncing info.
2106
+ * Wait until the node is connected to at least 1 trusted peer.
2096
2107
  */
2097
- syncerInfo(): Promise<SyncingInfoSnapshot>;
2108
+ waitConnectedTrusted(): Promise<void>;
2098
2109
  /**
2099
2110
  * Get the latest header announced in the network.
2100
2111
  */
2101
2112
  getNetworkHeadHeader(): Promise<ExtendedHeader | undefined>;
2102
2113
  /**
2103
- * Get the latest locally synced header.
2114
+ * Establish a new connection to the existing worker over provided port
2104
2115
  */
2105
- getLocalHeadHeader(): Promise<ExtendedHeader>;
2116
+ addConnectionToWorker(port: any): Promise<void>;
2106
2117
  /**
2107
- * Get a synced header for the block with a given hash.
2118
+ * Request a header for the block with a given height from the network.
2108
2119
  */
2109
- getHeaderByHash(hash: string): Promise<ExtendedHeader>;
2120
+ requestHeaderByHeight(height: bigint): Promise<ExtendedHeader>;
2110
2121
  /**
2111
- * Get a synced header for the block with a given height.
2122
+ * Request headers in range (from, from + amount] from the network.
2123
+ *
2124
+ * The headers will be verified with the `from` header.
2112
2125
  */
2113
- getHeaderByHeight(height: bigint): Promise<ExtendedHeader>;
2126
+ requestVerifiedHeaders(from: ExtendedHeader, amount: bigint): Promise<ExtendedHeader[]>;
2114
2127
  /**
2115
- * Get synced headers from the given heights range.
2116
- *
2117
- * If start of the range is undefined (None), the first returned header will be of height 1.
2118
- * If end of the range is undefined (None), the last returned header will be the last header in the
2119
- * store.
2120
- *
2121
- * # Errors
2122
- *
2123
- * If range contains a height of a header that is not found in the store.
2128
+ * Create a new connection to a Lumina node running in [`NodeWorker`]. Provided `port` is
2129
+ * expected to have `MessagePort`-like interface for sending and receiving messages.
2124
2130
  */
2125
- getHeaders(start_height?: bigint | null, end_height?: bigint | null): Promise<ExtendedHeader[]>;
2131
+ constructor(port: any);
2126
2132
  /**
2127
- * Get data sampling metadata of an already sampled height.
2133
+ * Stop the node.
2128
2134
  */
2129
- getSamplingMetadata(height: bigint): Promise<SamplingMetadata | undefined>;
2135
+ stop(): Promise<void>;
2130
2136
  /**
2131
- * Returns a [`BroadcastChannel`] for events generated by [`Node`].
2137
+ * Start the node with the provided config, if it's not running
2132
2138
  */
2133
- eventsChannel(): Promise<BroadcastChannel>;
2139
+ start(config: NodeConfig): Promise<void>;
2140
+ /**
2141
+ * Get all the multiaddresses on which the node listens.
2142
+ */
2143
+ listeners(): Promise<Array<any>>;
2134
2144
  }
2135
2145
  /**
2136
2146
  * Config for the lumina wasm node.
@@ -2209,7 +2219,13 @@ export class NodeConfig {
2209
2219
  */
2210
2220
  export class NodeWorker {
2211
2221
  free(): void;
2222
+ /**
2223
+ * Create a new `NodeWorker` with a port-like JS object.
2224
+ */
2212
2225
  constructor(port_like_object: any);
2226
+ /**
2227
+ * Run `NodeWorker` main loop.
2228
+ */
2213
2229
  run(): Promise<void>;
2214
2230
  }
2215
2231
  /**
@@ -2410,17 +2426,6 @@ export class Tx {
2410
2426
  export class TxBody {
2411
2427
  private constructor();
2412
2428
  free(): void;
2413
- /**
2414
- * `messages` is a list of messages to be executed. The required signers of
2415
- * those messages define the number and order of elements in `AuthInfo`'s
2416
- * signer_infos and Tx's signatures. Each required signer address is added to
2417
- * the list only the first time it occurs.
2418
- *
2419
- * By convention, the first required signer (usually from the first message)
2420
- * is referred to as the primary signer and pays the fee for the whole
2421
- * transaction.
2422
- */
2423
- messages(): ProtoAny[];
2424
2429
  /**
2425
2430
  * `extension_options` are arbitrary options that can be added by chains
2426
2431
  * when the default options are not sufficient. If any of these are present
@@ -2433,6 +2438,17 @@ export class TxBody {
2433
2438
  * and can't be handled, they will be ignored
2434
2439
  */
2435
2440
  non_critical_extension_options(): ProtoAny[];
2441
+ /**
2442
+ * `messages` is a list of messages to be executed. The required signers of
2443
+ * those messages define the number and order of elements in `AuthInfo`'s
2444
+ * signer_infos and Tx's signatures. Each required signer address is added to
2445
+ * the list only the first time it occurs.
2446
+ *
2447
+ * By convention, the first required signer (usually from the first message)
2448
+ * is referred to as the primary signer and pays the fee for the whole
2449
+ * transaction.
2450
+ */
2451
+ messages(): ProtoAny[];
2436
2452
  /**
2437
2453
  * `memo` is any arbitrary memo to be added to the transaction.
2438
2454
  */
@@ -2449,6 +2465,17 @@ export class TxBody {
2449
2465
  export class TxResponse {
2450
2466
  private constructor();
2451
2467
  free(): void;
2468
+ /**
2469
+ * Events defines all the events emitted by processing a transaction. Note,
2470
+ * these events include those emitted by processing all the messages and those
2471
+ * emitted from the ante. Whereas Logs contains the events, with
2472
+ * additional metadata, emitted only by processing the messages.
2473
+ */
2474
+ readonly events: JsEvent[];
2475
+ /**
2476
+ * The block height
2477
+ */
2478
+ readonly height: bigint;
2452
2479
  /**
2453
2480
  * Namespace for the Code
2454
2481
  */
@@ -2488,17 +2515,6 @@ export class TxResponse {
2488
2515
  * it's genesis time.
2489
2516
  */
2490
2517
  timestamp: string;
2491
- /**
2492
- * The block height
2493
- */
2494
- readonly height: bigint;
2495
- /**
2496
- * Events defines all the events emitted by processing a transaction. Note,
2497
- * these events include those emitted by processing all the messages and those
2498
- * emitted from the ante. Whereas Logs contains the events, with
2499
- * additional metadata, emitted only by processing the messages.
2500
- */
2501
- readonly events: JsEvent[];
2502
2518
  }
2503
2519
  /**
2504
2520
  * Response to a tx status query
@@ -2506,6 +2522,10 @@ export class TxResponse {
2506
2522
  export class TxStatusResponse {
2507
2523
  private constructor();
2508
2524
  free(): void;
2525
+ /**
2526
+ * Height of the block in which the transaction was committed.
2527
+ */
2528
+ readonly height: bigint;
2509
2529
  /**
2510
2530
  * Index of the transaction in block.
2511
2531
  */
@@ -2524,10 +2544,6 @@ export class TxStatusResponse {
2524
2544
  * Status of the transaction.
2525
2545
  */
2526
2546
  status: TxStatus;
2527
- /**
2528
- * Height of the block in which the transaction was committed.
2529
- */
2530
- readonly height: bigint;
2531
2547
  }
2532
2548
  /**
2533
2549
  * Address of a validator.