@leofcoin/chain 1.5.67 → 1.5.68

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.
@@ -12430,55 +12430,56 @@ class ValidatorMessage extends FormatInterface {
12430
12430
  }
12431
12431
 
12432
12432
  var proto$1 = {
12433
- index: Number(),
12434
- previousHash: String(),
12435
- timestamp: Number(),
12436
- reward: BigNumber.from(0),
12437
- fees: BigNumber.from(0),
12438
- transactions: new Uint8Array(),
12439
- validators: new Uint8Array()
12433
+ index: Number(),
12434
+ previousHash: String(),
12435
+ timestamp: Number(),
12436
+ reward: BigNumber.from(0),
12437
+ fees: BigNumber.from(0),
12438
+ transactions: new Uint8Array(),
12439
+ validators: new Uint8Array()
12440
12440
  };
12441
12441
 
12442
12442
  class BlockMessage extends FormatInterface {
12443
- get messageName() {
12444
- return 'BlockMessage'
12445
- }
12446
- constructor(buffer) {
12447
- if (buffer instanceof BlockMessage) return buffer
12448
- const name = 'block-message';
12449
- super(buffer, proto$1, { name });
12450
- }
12451
- encode(decoded) {
12452
- decoded = decoded || this.decoded;
12453
- const validators = [];
12454
- const transactions = [];
12455
- for (const validator of decoded.validators) {
12456
- if (validator instanceof ValidatorMessage) validators.push(validator.encode());
12457
- else validators.push(new ValidatorMessage(validator).encode());
12458
- }
12459
- for (const transaction of decoded.transactions) {
12460
- if (transaction instanceof TransactionMessage) transactions.push(transaction.encode());
12461
- else transactions.push(new TransactionMessage(transaction).encode());
12462
- }
12463
- return super.encode({
12464
- ...decoded,
12465
- validators: index$5(validators),
12466
- transactions: index$5(transactions)
12467
- })
12468
- }
12469
- decode(encoded) {
12470
- encoded = encoded || this.encoded;
12471
- super.decode(encoded);
12472
- // @ts-ignore
12473
- this.decoded.transactions = index$4(this.decoded.transactions).map(
12474
- (transaction) => new TransactionMessage(transaction).decoded
12475
- );
12476
- // @ts-ignore
12477
- this.decoded.validators = index$4(this.decoded.validators).map(
12478
- (validator) => new ValidatorMessage(validator).decoded
12479
- );
12480
- return this.decoded
12481
- }
12443
+ get messageName() {
12444
+ return 'BlockMessage';
12445
+ }
12446
+ constructor(buffer) {
12447
+ if (buffer instanceof BlockMessage)
12448
+ return buffer;
12449
+ const name = 'block-message';
12450
+ super(buffer, proto$1, { name });
12451
+ }
12452
+ encode(decoded) {
12453
+ decoded = decoded || this.decoded;
12454
+ const validators = [];
12455
+ const transactions = [];
12456
+ for (const validator of decoded.validators) {
12457
+ if (validator instanceof ValidatorMessage)
12458
+ validators.push(validator.encode());
12459
+ else
12460
+ validators.push(new ValidatorMessage(validator).encode());
12461
+ }
12462
+ for (const transaction of decoded.transactions) {
12463
+ if (transaction instanceof TransactionMessage)
12464
+ transactions.push(transaction.encode());
12465
+ else
12466
+ transactions.push(new TransactionMessage(transaction).encode());
12467
+ }
12468
+ return super.encode({
12469
+ ...decoded,
12470
+ validators: index$5(validators),
12471
+ transactions: index$5(transactions)
12472
+ });
12473
+ }
12474
+ decode(encoded) {
12475
+ encoded = encoded || this.encoded;
12476
+ super.decode(encoded);
12477
+ // @ts-ignore
12478
+ this.decoded.transactions = index$4(this.decoded.transactions).map((transaction) => new TransactionMessage(transaction).decoded);
12479
+ // @ts-ignore
12480
+ this.decoded.validators = index$4(this.decoded.validators).map((validator) => new ValidatorMessage(validator).decoded);
12481
+ return this.decoded;
12482
+ }
12482
12483
  }
12483
12484
 
12484
12485
  var proto = {
package/package.json CHANGED
@@ -1,109 +1,110 @@
1
- {
2
- "name": "@leofcoin/chain",
3
- "version": "1.5.67",
4
- "description": "Official javascript implementation",
5
- "exports": {
6
- "./node": {
7
- "import": "./exports/node.js",
8
- "types": "./exports/node.d.ts"
9
- },
10
- "./chain": {
11
- "import": "./exports/chain.js",
12
- "types": "./exports/chain.d.ts"
13
- },
14
- "./browser/node": {
15
- "import": "./exports/browser/node.js",
16
- "types": "./exports/node.d.ts"
17
- },
18
- "./browser/chain": {
19
- "import": "./exports/browser/chain.js",
20
- "types": "./exports/chain.d.ts"
21
- },
22
- "./workers/machine-worker": "./exports/workers/machine-worker.js"
23
- },
24
- "type": "module",
25
- "files": [
26
- "./exports",
27
- "LICENSE.txt"
28
- ],
29
- "scripts": {
30
- "np": "np",
31
- "watch": "rollup -c -w --silent error --cache true",
32
- "lint": "eslint src --fix",
33
- "prettier": "prettier src --config ./../../.prettierrc --write",
34
- "w": "rollup -c -w",
35
- "docs": "sh ./node_modules/.bin/esdoc src/chain.js",
36
- "workers": "cp ./../workers/src/** ./workers",
37
- "demo": "jsproject --serve ./ --port 5478 --open demo",
38
- "test": "node --inspect test",
39
- "pack": "webpack",
40
- "build": "rollup -c"
41
- },
42
- "np": {
43
- "yarn": false,
44
- "contents": "."
45
- },
46
- "browserslist": "> 0.5%, last 2 versions, not dead",
47
- "keywords": [],
48
- "author": "",
49
- "license": "MIT",
50
- "devDependencies": {
51
- "@rollup/plugin-commonjs": "^24.0.1",
52
- "@rollup/plugin-json": "^6.0.0",
53
- "@rollup/plugin-node-resolve": "^15.0.1",
54
- "@rollup/plugin-typescript": "^11.1.1",
55
- "@types/bs58check": "^2.1.0",
56
- "@types/pako": "^2.0.0",
57
- "@types/randombytes": "^2.0.0",
58
- "@types/semver": "^7.5.6",
59
- "@types/varint": "^6.0.1",
60
- "@vandeurenglenn/debug": "^1.1.1",
61
- "eslint": "^8.28.0",
62
- "eslint-plugin-unicorn": "^45.0.0",
63
- "open": "^8.4.0",
64
- "rimraf": "^4.4.0",
65
- "rollup": "^4.9.2",
66
- "rollup-plugin-modify": "^3.0.0",
67
- "rollup-plugin-node-builtins": "^2.1.2",
68
- "rollup-plugin-node-globals": "^1.4.0",
69
- "rollup-plugin-polyfill-node": "^0.13.0",
70
- "tape": "^5.5.2",
71
- "tslib": "^2.5.3",
72
- "typescript": "^5.2.2",
73
- "wireit": "^0.9.5"
74
- },
75
- "dependencies": {
76
- "@leofcoin/addresses": "^1.0.4",
77
- "@leofcoin/errors": "^1.0.0",
78
- "@leofcoin/lib": "^1.0.11",
79
- "@leofcoin/messages": "^1.3.17",
80
- "@leofcoin/multi-wallet": "^2.1.1",
81
- "@leofcoin/networks": "^1.0.0",
82
- "@leofcoin/peernet": "^1.1.73",
83
- "@leofcoin/peernet-swarm": "^1.0.0",
84
- "@leofcoin/storage": "^3.0.6",
85
- "@leofcoin/utils": "^1.1.4",
86
- "@leofcoin/workers": "^1.3.13",
87
- "@netpeer/p2pt-swarm": "^1.3.5",
88
- "@netpeer/swarm": "^0.8.9",
89
- "@vandeurenglenn/base32": "^1.1.0",
90
- "@vandeurenglenn/easy-worker": "^1.0.2",
91
- "@vandeurenglenn/queue": "^1.0.0",
92
- "chalk": "^4.0.0",
93
- "p-queue": "^7.3.4",
94
- "p2pt": "^1.5.1",
95
- "pako": "^2.0.4",
96
- "semver": "^7.5.4",
97
- "simple-peer": "^9.11.1"
98
- },
99
- "eslintConfig": {
100
- "env": {
101
- "es2022": true
102
- },
103
- "parserOptions": {
104
- "ecmaVersion": "latest",
105
- "sourceType": "module"
106
- },
107
- "extends": "plugin:unicorn/recommended"
108
- }
109
- }
1
+ {
2
+ "name": "@leofcoin/chain",
3
+ "version": "1.5.68",
4
+ "description": "Official javascript implementation",
5
+ "private": false,
6
+ "exports": {
7
+ "./node": {
8
+ "import": "./exports/node.js",
9
+ "types": "./exports/node.d.ts"
10
+ },
11
+ "./chain": {
12
+ "import": "./exports/chain.js",
13
+ "types": "./exports/chain.d.ts"
14
+ },
15
+ "./browser/node": {
16
+ "import": "./exports/browser/node.js",
17
+ "types": "./exports/node.d.ts"
18
+ },
19
+ "./browser/chain": {
20
+ "import": "./exports/browser/chain.js",
21
+ "types": "./exports/chain.d.ts"
22
+ },
23
+ "./workers/machine-worker": "./exports/workers/machine-worker.js"
24
+ },
25
+ "type": "module",
26
+ "files": [
27
+ "./exports",
28
+ "LICENSE.txt"
29
+ ],
30
+ "scripts": {
31
+ "np": "np",
32
+ "watch": "rollup -c -w --silent error --cache true",
33
+ "lint": "eslint src --fix",
34
+ "prettier": "prettier src --config ./../../.prettierrc --write",
35
+ "w": "rollup -c -w",
36
+ "docs": "sh ./node_modules/.bin/esdoc src/chain.js",
37
+ "workers": "cp ./../workers/src/** ./workers",
38
+ "demo": "jsproject --serve ./ --port 5478 --open demo",
39
+ "test": "node --inspect test",
40
+ "pack": "webpack",
41
+ "build": "rollup -c"
42
+ },
43
+ "np": {
44
+ "yarn": false,
45
+ "contents": "."
46
+ },
47
+ "browserslist": "> 0.5%, last 2 versions, not dead",
48
+ "keywords": [],
49
+ "author": "",
50
+ "license": "MIT",
51
+ "devDependencies": {
52
+ "@rollup/plugin-commonjs": "^24.0.1",
53
+ "@rollup/plugin-json": "^6.0.0",
54
+ "@rollup/plugin-node-resolve": "^15.0.1",
55
+ "@rollup/plugin-typescript": "^11.1.1",
56
+ "@types/bs58check": "^2.1.0",
57
+ "@types/pako": "^2.0.0",
58
+ "@types/randombytes": "^2.0.0",
59
+ "@types/semver": "^7.5.6",
60
+ "@types/varint": "^6.0.1",
61
+ "@vandeurenglenn/debug": "^1.1.1",
62
+ "eslint": "^8.28.0",
63
+ "eslint-plugin-unicorn": "^45.0.0",
64
+ "open": "^8.4.0",
65
+ "rimraf": "^4.4.0",
66
+ "rollup": "^4.9.2",
67
+ "rollup-plugin-modify": "^3.0.0",
68
+ "rollup-plugin-node-builtins": "^2.1.2",
69
+ "rollup-plugin-node-globals": "^1.4.0",
70
+ "rollup-plugin-polyfill-node": "^0.13.0",
71
+ "tape": "^5.5.2",
72
+ "tslib": "^2.5.3",
73
+ "typescript": "^5.2.2",
74
+ "wireit": "^0.9.5"
75
+ },
76
+ "dependencies": {
77
+ "@leofcoin/addresses": "^1.0.18",
78
+ "@leofcoin/errors": "^1.0.0",
79
+ "@leofcoin/lib": "^1.2.38",
80
+ "@leofcoin/messages": "^1.3.17",
81
+ "@leofcoin/multi-wallet": "^2.1.1",
82
+ "@leofcoin/networks": "^1.0.0",
83
+ "@leofcoin/peernet": "^1.1.73",
84
+ "@leofcoin/peernet-swarm": "^1.0.0",
85
+ "@leofcoin/storage": "^3.0.6",
86
+ "@leofcoin/utils": "^1.1.4",
87
+ "@leofcoin/workers": "^1.4.13",
88
+ "@netpeer/p2pt-swarm": "^1.3.5",
89
+ "@netpeer/swarm": "^0.8.9",
90
+ "@vandeurenglenn/base32": "^1.1.0",
91
+ "@vandeurenglenn/easy-worker": "^1.0.2",
92
+ "@vandeurenglenn/queue": "^1.0.0",
93
+ "chalk": "^4.0.0",
94
+ "p-queue": "^7.3.4",
95
+ "p2pt": "^1.5.1",
96
+ "pako": "^2.0.4",
97
+ "semver": "^7.5.4",
98
+ "simple-peer": "^9.11.1"
99
+ },
100
+ "eslintConfig": {
101
+ "env": {
102
+ "es2022": true
103
+ },
104
+ "parserOptions": {
105
+ "ecmaVersion": "latest",
106
+ "sourceType": "module"
107
+ },
108
+ "extends": "plugin:unicorn/recommended"
109
+ }
110
+ }