@leofcoin/chain 1.7.36 → 1.7.37

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.
@@ -3585,6 +3585,9 @@ class Machine {
3585
3585
  get lastBlock() {
3586
3586
  return this.#askWorker('lastBlock');
3587
3587
  }
3588
+ get lastBlockHeight() {
3589
+ return this.#askWorker('lastBlockHeight');
3590
+ }
3588
3591
  getBlocks(from, to) {
3589
3592
  return this.#askWorker('blocks', { from, to });
3590
3593
  }
@@ -3720,6 +3723,9 @@ class State extends Contract {
3720
3723
  get lastBlock() {
3721
3724
  return this.#machine ? this.#machine.lastBlock : { index: 0, hash: '0x0', previousHash: '0x0' };
3722
3725
  }
3726
+ get lastBlockHeight() {
3727
+ return this.#machine ? this.#machine.lastBlockHeight : 0;
3728
+ }
3723
3729
  getBlock(index) {
3724
3730
  return this.#machine.getBlock(index);
3725
3731
  }
package/exports/chain.js CHANGED
@@ -686,6 +686,9 @@ class Machine {
686
686
  get lastBlock() {
687
687
  return this.#askWorker('lastBlock');
688
688
  }
689
+ get lastBlockHeight() {
690
+ return this.#askWorker('lastBlockHeight');
691
+ }
689
692
  getBlocks(from, to) {
690
693
  return this.#askWorker('blocks', { from, to });
691
694
  }
@@ -821,6 +824,9 @@ class State extends Contract {
821
824
  get lastBlock() {
822
825
  return this.#machine ? this.#machine.lastBlock : { index: 0, hash: '0x0', previousHash: '0x0' };
823
826
  }
827
+ get lastBlockHeight() {
828
+ return this.#machine ? this.#machine.lastBlockHeight : 0;
829
+ }
824
830
  getBlock(index) {
825
831
  return this.#machine.getBlock(index);
826
832
  }
@@ -48,6 +48,7 @@ export default class Machine {
48
48
  get totalBlocks(): Promise<any>;
49
49
  get blocks(): Promise<[]>;
50
50
  get lastBlock(): Promise<any>;
51
+ get lastBlockHeight(): Promise<any>;
51
52
  getBlocks(from?: any, to?: any): Promise<[]>;
52
53
  getBlock(index: any): Promise<any>;
53
54
  addLoadedBlock(block: any): Promise<any>;
@@ -38,6 +38,7 @@ export default class State extends Contract {
38
38
  hash: string;
39
39
  previousHash: string;
40
40
  };
41
+ get lastBlockHeight(): 0 | Promise<any>;
41
42
  getBlock(index: any): Promise<any>;
42
43
  getBlocks(from?: any, to?: any): Promise<[]>;
43
44
  get totalSize(): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/chain",
3
- "version": "1.7.36",
3
+ "version": "1.7.37",
4
4
  "description": "Official javascript implementation",
5
5
  "private": false,
6
6
  "exports": {
@@ -72,7 +72,7 @@
72
72
  "@leofcoin/peernet": "^1.1.79",
73
73
  "@leofcoin/storage": "^3.5.31",
74
74
  "@leofcoin/utils": "^1.1.18",
75
- "@leofcoin/workers": "^1.5.3",
75
+ "@leofcoin/workers": "^1.5.4",
76
76
  "@vandeurenglenn/base58": "^1.1.9",
77
77
  "@vandeurenglenn/easy-worker": "^1.0.2",
78
78
  "semver": "^7.6.3"