@leofcoin/chain 1.4.86 → 1.4.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/exports/browser/chain.js +3 -0
- package/exports/chain.js +3 -0
- package/exports/types/state.d.ts +38 -0
- package/exports/types/types.d.ts +2 -1
- package/package.json +1 -1
package/exports/browser/chain.js
CHANGED
package/exports/chain.js
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BlockMessage } from '@leofcoin/messages';
|
|
2
|
+
import Contract from './contract.js';
|
|
3
|
+
import Machine from './machine.js';
|
|
4
|
+
import { BlockHash } from './types.js';
|
|
5
|
+
declare type SyncState = 'syncing' | 'synced' | 'errored' | 'connectionless';
|
|
6
|
+
export default class State extends Contract {
|
|
7
|
+
#private;
|
|
8
|
+
knownBlocks: BlockHash[];
|
|
9
|
+
get blockHashMap(): IterableIterator<[any, any]>;
|
|
10
|
+
get loaded(): boolean;
|
|
11
|
+
get resolving(): boolean;
|
|
12
|
+
get nativeMints(): number;
|
|
13
|
+
get nativeBurns(): number;
|
|
14
|
+
get nativeTransfers(): number;
|
|
15
|
+
get totalTransactions(): number;
|
|
16
|
+
get nativeCalls(): number;
|
|
17
|
+
get blocks(): any[];
|
|
18
|
+
get lastBlock(): {
|
|
19
|
+
index: number;
|
|
20
|
+
hash: string;
|
|
21
|
+
previousHash: string;
|
|
22
|
+
};
|
|
23
|
+
get totalSize(): number;
|
|
24
|
+
get machine(): Machine;
|
|
25
|
+
constructor();
|
|
26
|
+
init(): Promise<void>;
|
|
27
|
+
updateState(message: any): Promise<void>;
|
|
28
|
+
getLatestBlock(): Promise<BlockMessage.decoded>;
|
|
29
|
+
getAndPutBlock(hash: string): BlockMessage;
|
|
30
|
+
resolveBlock(hash: any): any;
|
|
31
|
+
resolveBlocks(): Promise<void>;
|
|
32
|
+
syncChain(lastBlock?: any): Promise<SyncState>;
|
|
33
|
+
promiseRequests(promises: any): Promise<unknown>;
|
|
34
|
+
get canSync(): boolean;
|
|
35
|
+
get shouldSync(): boolean;
|
|
36
|
+
triggerSync(): Promise<SyncState>;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
package/exports/types/types.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export type Address =
|
|
1
|
+
export type Address = base58String;
|
|
2
|
+
export type BlockHash = base58String;
|