@leofcoin/chain 1.7.69 → 1.7.71
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/{browser-DQJ6xf_F-B2LPNwJ3.js → browser-DQJ6xf_F-BCS5wcAv.js} +1 -2
- package/exports/browser/browser-store.js +80 -76
- package/exports/browser/chain.js +109 -53
- package/exports/browser/{client-C0VVXIWm-03WylCa-.js → client-C0VVXIWm-DcqDljSm.js} +4 -3
- package/exports/browser/{node-browser-Bm1Y3-al.js → identity-CQ_ieRiz-CTM-_kGF.js} +118 -13264
- package/exports/browser/{index-BeqbCwUk-BbkInvhZ.js → index-BeqbCwUk-BNpn0JK0.js} +1 -2
- package/exports/browser/{index-CEwkDK9g-CSOjRfmt.js → index-CEwkDK9g-CHsuUR8y.js} +1 -2
- package/exports/browser/{messages-BdevLRCA-C7ieSv6K.js → messages-BdevLRCA-DCm-zGuC.js} +2 -1
- package/exports/browser/node-browser-DcYcGvEF.js +13160 -0
- package/exports/browser/node-browser.js +2 -1
- package/exports/browser/workers/machine-worker.js +5 -3
- package/exports/chain.js +3 -3
- package/exports/workers/machine-worker.js +5 -3
- package/package.json +19 -19
|
@@ -55,6 +55,8 @@ let Zeros = "0000";
|
|
|
55
55
|
while (Zeros.length < 80) {
|
|
56
56
|
Zeros += Zeros;
|
|
57
57
|
}
|
|
58
|
+
|
|
59
|
+
const jsonStringifyBigInt = (key, value) => (typeof value === 'bigint' ? { $bigint: value.toString() } : value);
|
|
58
60
|
const jsonParseBigInt = (key, value) => typeof value === 'object' && value.$bigint ? BigInt(value.$bigint) : value;
|
|
59
61
|
|
|
60
62
|
const byteFormats = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
@@ -344,7 +346,7 @@ const _ = {
|
|
|
344
346
|
throw new Error(`error: ${e.message}
|
|
345
347
|
contract: ${contract}
|
|
346
348
|
method: ${method}
|
|
347
|
-
params: ${JSON.stringify(params,
|
|
349
|
+
params: ${JSON.stringify(params, jsonStringifyBigInt, '\t')}
|
|
348
350
|
`);
|
|
349
351
|
}
|
|
350
352
|
},
|
|
@@ -406,8 +408,8 @@ const _ = {
|
|
|
406
408
|
}
|
|
407
409
|
else {
|
|
408
410
|
await Promise.all([contractFactoryMessage, nativeTokenMessage, nameServiceMessage, validatorsMessage].map(async (contract) => {
|
|
409
|
-
|
|
410
|
-
return _.runContract({ decoded:
|
|
411
|
+
const message = await new ContractMessage(new Uint8Array(contract.split(',')));
|
|
412
|
+
return _.runContract({ decoded: message.decoded, encoded: message.encoded, hash: await message.hash() });
|
|
411
413
|
}));
|
|
412
414
|
console.log({ blocks: message.blocks });
|
|
413
415
|
if (message.blocks?.length > 0) {
|
package/exports/chain.js
CHANGED
|
@@ -360,7 +360,7 @@ class Machine {
|
|
|
360
360
|
}
|
|
361
361
|
catch (error) {
|
|
362
362
|
console.error(error);
|
|
363
|
-
this.worker.postMessage({ id: data.id,
|
|
363
|
+
this.worker.postMessage({ id: data.id, error: `could not get ${data.question} @${data.input}` });
|
|
364
364
|
this.wantList.push(data.input);
|
|
365
365
|
}
|
|
366
366
|
}
|
|
@@ -1674,9 +1674,9 @@ class Chain extends VersionControl {
|
|
|
1674
1674
|
promises = await Promise.allSettled(promises);
|
|
1675
1675
|
const noncesByAddress = {};
|
|
1676
1676
|
for (let transaction of transactions) {
|
|
1677
|
-
globalThis.pubsub.publish('transaction-processed', transaction);
|
|
1677
|
+
globalThis.pubsub.publish('transaction-processed', transaction.encoded);
|
|
1678
1678
|
if (transaction.decoded.to === globalThis.peernet.selectedAccount)
|
|
1679
|
-
globalThis.pubsub.publish('account-transaction-processed', transaction);
|
|
1679
|
+
globalThis.pubsub.publish('account-transaction-processed', transaction.encoded);
|
|
1680
1680
|
if (!noncesByAddress[transaction.decoded.from] ||
|
|
1681
1681
|
noncesByAddress?.[transaction.decoded.from] < transaction.decoded.nonce) {
|
|
1682
1682
|
noncesByAddress[transaction.decoded.from] = transaction.decoded.nonce;
|
|
@@ -55,6 +55,8 @@ let Zeros = "0000";
|
|
|
55
55
|
while (Zeros.length < 80) {
|
|
56
56
|
Zeros += Zeros;
|
|
57
57
|
}
|
|
58
|
+
|
|
59
|
+
const jsonStringifyBigInt = (key, value) => (typeof value === 'bigint' ? { $bigint: value.toString() } : value);
|
|
58
60
|
const jsonParseBigInt = (key, value) => typeof value === 'object' && value.$bigint ? BigInt(value.$bigint) : value;
|
|
59
61
|
|
|
60
62
|
const byteFormats = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
@@ -344,7 +346,7 @@ const _ = {
|
|
|
344
346
|
throw new Error(`error: ${e.message}
|
|
345
347
|
contract: ${contract}
|
|
346
348
|
method: ${method}
|
|
347
|
-
params: ${JSON.stringify(params,
|
|
349
|
+
params: ${JSON.stringify(params, jsonStringifyBigInt, '\t')}
|
|
348
350
|
`);
|
|
349
351
|
}
|
|
350
352
|
},
|
|
@@ -406,8 +408,8 @@ const _ = {
|
|
|
406
408
|
}
|
|
407
409
|
else {
|
|
408
410
|
await Promise.all([contractFactoryMessage, nativeTokenMessage, nameServiceMessage, validatorsMessage].map(async (contract) => {
|
|
409
|
-
|
|
410
|
-
return _.runContract({ decoded:
|
|
411
|
+
const message = await new ContractMessage(new Uint8Array(contract.split(',')));
|
|
412
|
+
return _.runContract({ decoded: message.decoded, encoded: message.encoded, hash: await message.hash() });
|
|
411
413
|
}));
|
|
412
414
|
console.log({ blocks: message.blocks });
|
|
413
415
|
if (message.blocks?.length > 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leofcoin/chain",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.71",
|
|
4
4
|
"description": "Official javascript implementation",
|
|
5
5
|
"private": false,
|
|
6
6
|
"exports": {
|
|
@@ -49,32 +49,32 @@
|
|
|
49
49
|
"author": "",
|
|
50
50
|
"license": "MIT",
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@rollup/plugin-commonjs": "^28.0.
|
|
52
|
+
"@rollup/plugin-commonjs": "^28.0.6",
|
|
53
53
|
"@rollup/plugin-json": "^6.1.0",
|
|
54
|
-
"@rollup/plugin-node-resolve": "^
|
|
55
|
-
"@rollup/plugin-typescript": "^12.1.
|
|
56
|
-
"@types/semver": "^7.
|
|
57
|
-
"@vandeurenglenn/debug": "^1.2.
|
|
58
|
-
"rollup": "^4.
|
|
54
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
55
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
56
|
+
"@types/semver": "^7.7.0",
|
|
57
|
+
"@vandeurenglenn/debug": "^1.2.6",
|
|
58
|
+
"rollup": "^4.44.2",
|
|
59
59
|
"rollup-plugin-modify": "^3.0.0",
|
|
60
60
|
"tape": "^5.9.0",
|
|
61
|
-
"tslib": "^2.
|
|
61
|
+
"tslib": "^2.8.1"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@leofcoin/addresses": "^1.0.
|
|
64
|
+
"@leofcoin/addresses": "^1.0.53",
|
|
65
65
|
"@leofcoin/contracts": "^0.1.14",
|
|
66
|
-
"@leofcoin/crypto": "^0.2.
|
|
67
|
-
"@leofcoin/errors": "^1.0.
|
|
68
|
-
"@leofcoin/lib": "^1.2.
|
|
69
|
-
"@leofcoin/messages": "^1.4.
|
|
66
|
+
"@leofcoin/crypto": "^0.2.37",
|
|
67
|
+
"@leofcoin/errors": "^1.0.25",
|
|
68
|
+
"@leofcoin/lib": "^1.2.71",
|
|
69
|
+
"@leofcoin/messages": "^1.4.40",
|
|
70
70
|
"@leofcoin/multi-wallet": "^3.1.8",
|
|
71
|
-
"@leofcoin/networks": "^1.1.
|
|
72
|
-
"@leofcoin/peernet": "^1.1.
|
|
73
|
-
"@leofcoin/storage": "^3.5.
|
|
74
|
-
"@leofcoin/utils": "^1.1.
|
|
75
|
-
"@leofcoin/workers": "^1.5.
|
|
71
|
+
"@leofcoin/networks": "^1.1.25",
|
|
72
|
+
"@leofcoin/peernet": "^1.1.82",
|
|
73
|
+
"@leofcoin/storage": "^3.5.38",
|
|
74
|
+
"@leofcoin/utils": "^1.1.39",
|
|
75
|
+
"@leofcoin/workers": "^1.5.22",
|
|
76
76
|
"@vandeurenglenn/base58": "^1.1.9",
|
|
77
77
|
"@vandeurenglenn/easy-worker": "^1.0.2",
|
|
78
|
-
"semver": "^7.
|
|
78
|
+
"semver": "^7.7.2"
|
|
79
79
|
}
|
|
80
80
|
}
|