@leofcoin/chain 1.8.29 → 1.9.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.
- package/exports/browser/chain.js +780 -225
- package/exports/browser/{constants-BKKQytjd.js → constants-BTdMMS4w.js} +172 -132
- package/exports/browser/node-browser.js +1 -1
- package/exports/browser/workers/block-worker.js +1 -1
- package/exports/browser/workers/machine-worker.js +2 -2
- package/exports/browser/workers/{worker-iOnLaHA--iOnLaHA-.js → worker-BrtyXRJ7-BrtyXRJ7.js} +287 -208
- package/exports/chain.js +662 -146
- package/exports/constants.d.ts +1 -0
- package/exports/types.d.ts +5 -14
- package/exports/version-control.d.ts +1 -0
- package/exports/workers/block-worker.js +1 -1
- package/exports/workers/machine-worker.js +2 -2
- package/exports/workers/{worker-iOnLaHA--iOnLaHA-.js → worker-BrtyXRJ7-BrtyXRJ7.js} +287 -208
- package/package.json +6 -6
package/exports/constants.d.ts
CHANGED
package/exports/types.d.ts
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { base58String } from '@vandeurenglenn/base58';
|
|
2
2
|
export type Address = base58String;
|
|
3
3
|
export type BlockHash = base58String;
|
|
4
|
-
interface Transaction {
|
|
5
|
-
to: Address;
|
|
6
|
-
from: Address;
|
|
7
|
-
method: String;
|
|
8
|
-
params: string[];
|
|
9
|
-
nonce: Number;
|
|
10
|
-
}
|
|
11
|
-
interface RawTransaction extends Transaction {
|
|
12
|
-
timestamp: Number;
|
|
13
|
-
}
|
|
14
4
|
export interface globalMessage {
|
|
15
5
|
sender: Address;
|
|
16
6
|
call: Function;
|
|
@@ -20,14 +10,15 @@ export interface globalMessage {
|
|
|
20
10
|
}
|
|
21
11
|
export declare type BlockInMemory = {
|
|
22
12
|
index: number;
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
hash: string;
|
|
14
|
+
transactions: string[];
|
|
15
|
+
loaded?: boolean;
|
|
25
16
|
};
|
|
26
17
|
export declare type RawBlock = {
|
|
27
18
|
index: number;
|
|
28
|
-
|
|
19
|
+
hash: string;
|
|
20
|
+
transactions: string[];
|
|
29
21
|
};
|
|
30
22
|
export declare type ChainConfig = {
|
|
31
23
|
resolveTimeout?: number;
|
|
32
24
|
};
|
|
33
|
-
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EasyWorker, C as ContractMessage, T as TransactionMessage } from './worker-
|
|
1
|
+
import { E as EasyWorker, C as ContractMessage, T as TransactionMessage } from './worker-BrtyXRJ7-BrtyXRJ7.js';
|
|
2
2
|
|
|
3
3
|
/* Do NOT modify this file; see /src.ts/_admin/update-version.ts */
|
|
4
4
|
/**
|
|
@@ -57,7 +57,7 @@ while (Zeros.length < 80) {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
const jsonStringifyBigInt = (key, value) => (typeof value === 'bigint' ? { $bigint: value.toString() } : value);
|
|
60
|
-
const jsonParseBigInt = (key, value) => typeof value === 'object' && value
|
|
60
|
+
const jsonParseBigInt = (key, value) => typeof value === 'object' && value?.$bigint ? BigInt(value.$bigint) : value;
|
|
61
61
|
|
|
62
62
|
const byteFormats = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
63
63
|
const formatBytes = (bytes, decimals = 2) => {
|