@leofcoin/chain 1.4.21 → 1.4.23
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/LICENSE +88 -88
- package/README.md +4 -4
- package/exports/chain.js +1071 -0
- package/exports/node.js +23 -0
- package/exports/typings/chain.d.ts +83 -0
- package/exports/typings/config/config.d.ts +1 -0
- package/exports/typings/config/main.d.ts +5 -0
- package/exports/typings/config/protocol.d.ts +6 -0
- package/exports/typings/contract.d.ts +29 -0
- package/exports/typings/fee/config.d.ts +4 -0
- package/exports/typings/machine.d.ts +26 -0
- package/exports/typings/node.d.ts +9 -0
- package/exports/typings/protocol.d.ts +4 -0
- package/exports/typings/state.d.ts +5 -0
- package/exports/typings/transaction.d.ts +47 -0
- package/exports/typings/typer.d.ts +6 -0
- package/package.json +77 -75
- package/CHANGELOG.md +0 -14
- package/block-worker.js +0 -1
- package/demo/865.browser.js +0 -10
- package/demo/chain.browser.js +0 -66842
- package/demo/generate-account.browser.js +0 -50
- package/demo/index.html +0 -25
- package/demo/messages.browser.js +0 -328
- package/demo/multi-wallet.browser.js +0 -15
- package/demo/node.browser.js +0 -9858
- package/demo/pako.browser.js +0 -6900
- package/demo/peernet-swarm.browser.js +0 -839
- package/demo/storage.browser.js +0 -3724
- package/demo/workers/865.js +0 -10
- package/demo/workers/block-worker.js +0 -13175
- package/demo/workers/machine-worker.js +0 -13385
- package/demo/workers/pool-worker.js +0 -8503
- package/demo/workers/transaction-worker.js +0 -8495
- package/demo/wrtc.browser.js +0 -28
- package/dist/browser/workers/865.js +0 -10
- package/dist/browser/workers/block-worker.js +0 -9460
- package/dist/browser/workers/machine-worker.js +0 -9670
- package/dist/browser/workers/pool-worker.js +0 -4608
- package/dist/browser/workers/transaction-worker.js +0 -4600
- package/dist/chain.js +0 -10128
- package/dist/client-80bc8156.js +0 -491
- package/dist/commonjs-7fe3c381.js +0 -270
- package/dist/contracts/factory.js +0 -1
- package/dist/contracts/name-service.js +0 -1
- package/dist/contracts/native-token.js +0 -1
- package/dist/contracts/validators.js +0 -1
- package/dist/generate-account-445db122.js +0 -46
- package/dist/index-57f93805.js +0 -718
- package/dist/messages-bce1b91d-81af3b00.js +0 -315
- package/dist/module/chain.js +0 -10091
- package/dist/module/client-8031ec88.js +0 -489
- package/dist/module/commonjs-9005d5c0.js +0 -268
- package/dist/module/generate-account-489552b6.js +0 -44
- package/dist/module/index-ac2285c4.js +0 -688
- package/dist/module/messages-bce1b91d-eaf75d83.js +0 -302
- package/dist/module/node.js +0 -7049
- package/dist/module/workers/block-worker.js +0 -94
- package/dist/module/workers/machine-worker.js +0 -304
- package/dist/module/workers/pool-worker.js +0 -55
- package/dist/module/workers/transaction-worker.js +0 -47
- package/dist/node.js +0 -7061
- package/dist/standards/token.js +0 -1
- package/dist/workers/machine-worker.js +0 -1
- package/dist/workers/pool-worker.js +0 -1
- package/dist/workers/transaction-worker.js +0 -1
- package/examples/contracts/token.js +0 -7
- package/plugins/bundle.js +0 -18
- package/rollup.config.js +0 -15
- package/src/chain.ts +0 -710
- package/src/config/config.js +0 -14
- package/src/config/main.js +0 -4
- package/src/config/protocol.js +0 -5
- package/src/contract.js +0 -52
- package/src/fee/config.js +0 -3
- package/src/machine.js +0 -215
- package/src/node.ts +0 -24
- package/src/protocol.js +0 -4
- package/src/state.js +0 -31
- package/src/transaction.ts +0 -182
- package/src/type.index.d.ts +0 -21
- package/src/typer.js +0 -19
- package/test/chain.js +0 -150
- package/test/contracts/token.js +0 -40
- package/test/create-genesis.js +0 -66
- package/test/index.js +0 -1
- package/tsconfig.json +0 -17
- package/workers/block-worker.js +0 -40
- package/workers/machine-worker.js +0 -219
- package/workers/pool-worker.js +0 -28
- package/workers/transaction-worker.js +0 -20
- package/workers/workers.js +0 -9
package/exports/node.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Peernet from '@leofcoin/peernet';
|
|
2
|
+
import nodeConfig from '@leofcoin/lib/node-config';
|
|
3
|
+
import networks from '@leofcoin/networks';
|
|
4
|
+
|
|
5
|
+
// import config from './config/config'
|
|
6
|
+
class Node {
|
|
7
|
+
constructor() {
|
|
8
|
+
return this._init();
|
|
9
|
+
}
|
|
10
|
+
async _init(config = {
|
|
11
|
+
network: 'leofcoin:peach',
|
|
12
|
+
networkName: 'leofcoin:peach',
|
|
13
|
+
networkVersion: 'peach',
|
|
14
|
+
stars: networks.leofcoin.peach.stars
|
|
15
|
+
}) {
|
|
16
|
+
globalThis.Peernet ? await new globalThis.Peernet(config) : await new Peernet(config);
|
|
17
|
+
await nodeConfig(config);
|
|
18
|
+
return this;
|
|
19
|
+
// this.config = await config()
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { Node as default };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import Contract from './contract.js';
|
|
2
|
+
import { BigNumberish } from '@ethersproject/bignumber';
|
|
3
|
+
export default class Chain extends Contract {
|
|
4
|
+
#private;
|
|
5
|
+
constructor();
|
|
6
|
+
get nativeMints(): number;
|
|
7
|
+
get nativeBurns(): number;
|
|
8
|
+
get nativeTransfers(): number;
|
|
9
|
+
get totalTransactions(): number;
|
|
10
|
+
get nativeCalls(): number;
|
|
11
|
+
get totalSize(): number;
|
|
12
|
+
get lib(): any;
|
|
13
|
+
get lastBlock(): {
|
|
14
|
+
index: number;
|
|
15
|
+
hash: string;
|
|
16
|
+
previousHash: string;
|
|
17
|
+
};
|
|
18
|
+
get nativeToken(): any;
|
|
19
|
+
get validators(): any[];
|
|
20
|
+
get blocks(): any[];
|
|
21
|
+
hasTransactionToHandle(): Promise<boolean>;
|
|
22
|
+
promiseRequests(promises: any): Promise<unknown>;
|
|
23
|
+
getLatestBlock(): Promise<{
|
|
24
|
+
index: number;
|
|
25
|
+
hash: string;
|
|
26
|
+
}>;
|
|
27
|
+
resolveBlock(hash: any): any;
|
|
28
|
+
resolveBlocks(): any;
|
|
29
|
+
participate(address: any): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* every tx done is trough contracts so no need for amount
|
|
32
|
+
* data is undefined when nothing is returned
|
|
33
|
+
* error is thrown on error so undefined data doesn't mean there is an error...
|
|
34
|
+
**/
|
|
35
|
+
sendTransaction(transaction: any): Promise<{
|
|
36
|
+
hash: any;
|
|
37
|
+
data: any;
|
|
38
|
+
fee: string | 0;
|
|
39
|
+
wait: Promise<unknown>;
|
|
40
|
+
message: any;
|
|
41
|
+
}>;
|
|
42
|
+
addContract(contractMessage: any): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @param {Address} sender
|
|
46
|
+
* @param {Address} contract
|
|
47
|
+
* @param {String} method
|
|
48
|
+
* @param {Array} parameters
|
|
49
|
+
* @returns
|
|
50
|
+
*/
|
|
51
|
+
internalCall(sender: any, contract: any, method: any, parameters: any): any;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @param {Address} contract
|
|
55
|
+
* @param {String} method
|
|
56
|
+
* @param {Array} parameters
|
|
57
|
+
* @returns
|
|
58
|
+
*/
|
|
59
|
+
call(contract: any, method: any, parameters: any): any;
|
|
60
|
+
staticCall(contract: any, method: any, parameters?: any): any;
|
|
61
|
+
delegate(contract: any, method: any, parameters: any): any;
|
|
62
|
+
staticDelegate(contract: Address, method: string, parameters: []): any;
|
|
63
|
+
mint(to: string, amount: BigNumberish): any;
|
|
64
|
+
transfer(from: string, to: string, amount: BigNumberish): any;
|
|
65
|
+
get balances(): {
|
|
66
|
+
address: BigNumberish;
|
|
67
|
+
};
|
|
68
|
+
get contracts(): any;
|
|
69
|
+
deleteAll(): any;
|
|
70
|
+
/**
|
|
71
|
+
* lookup an address for a registered name using the builtin nameService
|
|
72
|
+
* @check nameService
|
|
73
|
+
*
|
|
74
|
+
* @param {String} - contractName
|
|
75
|
+
* @returns {String} - address
|
|
76
|
+
*
|
|
77
|
+
* @example chain.lookup('myCoolContractName') // qmqsfddfdgfg...
|
|
78
|
+
*/
|
|
79
|
+
lookup(name: any): {
|
|
80
|
+
owner: string;
|
|
81
|
+
address: string;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @extends {Transaction}
|
|
3
|
+
*/
|
|
4
|
+
export default class Contract extends Transaction {
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* @param {Address} creator
|
|
8
|
+
* @param {String} contract
|
|
9
|
+
* @param {Array} constructorParameters
|
|
10
|
+
* @returns lib.createContractMessage
|
|
11
|
+
*/
|
|
12
|
+
createContractMessage(creator: Address, contract: string, constructorParameters?: any[]): Promise<import("@leofcoin/messages").ContractMessage>;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param {Address} creator
|
|
16
|
+
* @param {String} contract
|
|
17
|
+
* @param {Array} constructorParameters
|
|
18
|
+
* @returns {Address}
|
|
19
|
+
*/
|
|
20
|
+
createContractAddress(creator: Address, contract: string, constructorParameters?: any[]): Address;
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @param {String} contract
|
|
24
|
+
* @param {Array} parameters
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
deployContract(contract: string, constructorParameters?: any[]): Promise<any>;
|
|
28
|
+
}
|
|
29
|
+
import Transaction from "./transaction.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export default class Machine {
|
|
2
|
+
constructor(blocks: any);
|
|
3
|
+
lastBlock: {
|
|
4
|
+
index: number;
|
|
5
|
+
hash: string;
|
|
6
|
+
previousHash: string;
|
|
7
|
+
};
|
|
8
|
+
worker: any;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param {Address} contract
|
|
12
|
+
* @param {String} method
|
|
13
|
+
* @param {Array} parameters
|
|
14
|
+
* @returns Promise<message>
|
|
15
|
+
*/
|
|
16
|
+
execute(contract: Address, method: string, parameters: any[]): Promise<any>;
|
|
17
|
+
get(contract: any, method: any, parameters: any): Promise<any>;
|
|
18
|
+
has(address: any): Promise<any>;
|
|
19
|
+
delete(hash: any): Promise<any>;
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* @returns Promise
|
|
23
|
+
*/
|
|
24
|
+
deleteAll(): Promise<any>;
|
|
25
|
+
#private;
|
|
26
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import Protocol from "./protocol.js";
|
|
2
|
+
import { TransactionMessage } from "@leofcoin/messages";
|
|
3
|
+
export default class Transaction extends Protocol {
|
|
4
|
+
#private;
|
|
5
|
+
constructor();
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param {Address[]} transactions
|
|
9
|
+
* @returns transactions to include
|
|
10
|
+
*/
|
|
11
|
+
getTransactions(transactions: any): Promise<unknown>;
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @param {Transaction[]} transactions An array containing Transactions
|
|
15
|
+
* @returns {TransactionMessage}
|
|
16
|
+
*/
|
|
17
|
+
promiseTransactions(transactions: any): Promise<TransactionMessage[]>;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @param {Transaction[]} transactions An array containing Transactions
|
|
21
|
+
* @returns {Object} {transaction.decoded, transaction.hash}
|
|
22
|
+
*/
|
|
23
|
+
promiseTransactionsContent(transactions: any): Promise<any>;
|
|
24
|
+
/**
|
|
25
|
+
* Get amount of transactions by address
|
|
26
|
+
* @param {Address} address The address to get the nonce for
|
|
27
|
+
* @returns {Number} nonce
|
|
28
|
+
*/
|
|
29
|
+
getNonce(address: any): Promise<number>;
|
|
30
|
+
validateNonce(address: any, nonce: any): Promise<void>;
|
|
31
|
+
isTransactionMessage(message: any): boolean;
|
|
32
|
+
createTransaction(transaction: any): Promise<{
|
|
33
|
+
from: any;
|
|
34
|
+
to: any;
|
|
35
|
+
method: any;
|
|
36
|
+
params: any;
|
|
37
|
+
timestamp: any;
|
|
38
|
+
nonce: any;
|
|
39
|
+
}>;
|
|
40
|
+
sendTransaction(message: any): Promise<{
|
|
41
|
+
hash: any;
|
|
42
|
+
data: any;
|
|
43
|
+
fee: string | 0;
|
|
44
|
+
wait: Promise<unknown>;
|
|
45
|
+
message: any;
|
|
46
|
+
}>;
|
|
47
|
+
}
|
package/package.json
CHANGED
|
@@ -1,75 +1,77 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@leofcoin/chain",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"description": "Official javascript implementation",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@types/
|
|
39
|
-
"@types/
|
|
40
|
-
"@
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"@leofcoin/
|
|
52
|
-
"@leofcoin/
|
|
53
|
-
"@leofcoin/
|
|
54
|
-
"@leofcoin/
|
|
55
|
-
"@leofcoin/
|
|
56
|
-
"@leofcoin/
|
|
57
|
-
"@leofcoin/
|
|
58
|
-
"@leofcoin/
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
61
|
-
"@vandeurenglenn/
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@leofcoin/chain",
|
|
3
|
+
"version": "1.4.23",
|
|
4
|
+
"description": "Official javascript implementation",
|
|
5
|
+
"exports": {
|
|
6
|
+
"./node": "./exports/node.js",
|
|
7
|
+
"./chain": "./exports/chain.js"
|
|
8
|
+
},
|
|
9
|
+
"types": "./exports/types/chain.d.ts",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"files": [
|
|
12
|
+
"./exports",
|
|
13
|
+
"LICENSE.txt"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"np": "np",
|
|
17
|
+
"lint": "eslint src --fix",
|
|
18
|
+
"c": "rollup -c",
|
|
19
|
+
"w": "rollup -c -w",
|
|
20
|
+
"docs": "sh ./node_modules/.bin/esdoc src/chain.js",
|
|
21
|
+
"workers": "cp ./../workers/src/** ./workers",
|
|
22
|
+
"build": "npm run c",
|
|
23
|
+
"demo": "jsproject --serve ./demo --port 5478 --open demo",
|
|
24
|
+
"test": "node --openssl-legacy-provider test",
|
|
25
|
+
"pack": "webpack"
|
|
26
|
+
},
|
|
27
|
+
"np": {
|
|
28
|
+
"yarn": false,
|
|
29
|
+
"contents": "."
|
|
30
|
+
},
|
|
31
|
+
"browserslist": "> 0.5%, last 2 versions, not dead",
|
|
32
|
+
"keywords": [],
|
|
33
|
+
"author": "",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@rollup/plugin-json": "^6.0.0",
|
|
37
|
+
"@rollup/plugin-typescript": "^11.0.0",
|
|
38
|
+
"@types/bs58check": "^2.1.0",
|
|
39
|
+
"@types/pako": "^2.0.0",
|
|
40
|
+
"@types/randombytes": "^2.0.0",
|
|
41
|
+
"@types/varint": "^6.0.1",
|
|
42
|
+
"@vandeurenglenn/debug": "^1.0.0",
|
|
43
|
+
"eslint": "^8.28.0",
|
|
44
|
+
"eslint-plugin-unicorn": "^45.0.0",
|
|
45
|
+
"open": "^8.4.0",
|
|
46
|
+
"rollup": "^3.12.0",
|
|
47
|
+
"tape": "^5.5.2",
|
|
48
|
+
"tslib": "^2.4.1"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@leofcoin/addresses": "^1.0.4",
|
|
52
|
+
"@leofcoin/codec-format-interface": "^1.6.4",
|
|
53
|
+
"@leofcoin/lib": "^1.0.11",
|
|
54
|
+
"@leofcoin/messages": "^1.2.0",
|
|
55
|
+
"@leofcoin/multi-wallet": "^2.1.1",
|
|
56
|
+
"@leofcoin/networks": "^1.0.0",
|
|
57
|
+
"@leofcoin/peernet": "^1.0.0",
|
|
58
|
+
"@leofcoin/storage": "^3.0.6",
|
|
59
|
+
"@leofcoin/utils": "^1.1.4",
|
|
60
|
+
"@leofcoin/workers": "^1.3.5",
|
|
61
|
+
"@vandeurenglenn/base32": "^1.1.0",
|
|
62
|
+
"@vandeurenglenn/easy-worker": "^1.0.2",
|
|
63
|
+
"@vandeurenglenn/queue": "^1.0.0",
|
|
64
|
+
"chalk": "^4.0.0",
|
|
65
|
+
"pako": "^2.0.4"
|
|
66
|
+
},
|
|
67
|
+
"eslintConfig": {
|
|
68
|
+
"env": {
|
|
69
|
+
"es2022": true
|
|
70
|
+
},
|
|
71
|
+
"parserOptions": {
|
|
72
|
+
"ecmaVersion": "latest",
|
|
73
|
+
"sourceType": "module"
|
|
74
|
+
},
|
|
75
|
+
"extends": "plugin:unicorn/recommended"
|
|
76
|
+
}
|
|
77
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# changelog
|
|
2
|
-
------
|
|
3
|
-
|
|
4
|
-
## v1.1.0
|
|
5
|
-
- validators produce blocks
|
|
6
|
-
- syncs blocks with other nodes
|
|
7
|
-
- double contracts throw and are not added (no cost)
|
|
8
|
-
- transactions that fail are ignored (no cost and less resource usage)
|
|
9
|
-
- native contracts that are internally used by the chain (iow no need for a wrapped token)
|
|
10
|
-
- native voting system
|
|
11
|
-
- all native contracts are proxied (less hasle when upgrading a contract)
|
|
12
|
-
- can add/remove validators
|
|
13
|
-
- added stateStore (contracts can be loaded using the state now) (introduces breaking change, devs need to make the state of their contract exposable)
|
|
14
|
-
- added snapshotting (recover from state)
|
package/block-worker.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@leofcoin/codec-format-interface"),r=require("@ethersproject/bignumber");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("@ethersproject/units"),require("randombytes");var a=s(require("@vandeurenglenn/easy-worker"));class BlockMessage extends e.FormatInterface{get keys(){return["index","previousHash","timestamp","reward","fees","transactions","validators"]}get messageName(){return"BlockMessage"}constructor(e){super(e,"\nmessage ValidatorMessage {\n required string address = 1;\n required string reward = 2;\n}\n\nmessage Transaction {\n required string hash = 1;\n required uint64 timestamp = 2;\n required string from = 3;\n required string to = 4;\n required uint64 nonce = 5;\n required string method = 6;\n repeated string params = 7;\n}\n\nmessage BlockMessage {\n required uint64 index = 1;\n required string previousHash = 3;\n required uint64 timestamp = 4;\n required uint64 reward = 5;\n required string fees = 6;\n repeated Transaction transactions = 7;\n repeated ValidatorMessage validators = 8;\n}\n",{name:"block-message"})}}const n=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],t=new a.default;globalThis.BigNumber=r.BigNumber,globalThis.peernet=globalThis.peernet||{},globalThis.contracts={};const i=async e=>(e=(e=await Promise.all(e.map((e=>new BlockMessage(e))))).sort(((e,r)=>e.decoded.timestamp-r.decoded.timestamp)),e=await Promise.all(e.map((e=>new Promise((async(r,s)=>{const a=e.encoded.length||e.encoded.byteLength;console.log(`loaded block: ${await e.hash} @${e.decoded.index} ${((e,r=2)=>{if(0===e)return"0 Bytes";r<0&&(r=0);const s=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,s)).toFixed(r))} ${n[s]}`})(a)}`),r(e)}))))));t.onmessage((e=>(async e=>{globalThis.peernet.codecs={"block-message":{codec:parseInt("626d",16),hashAlg:"keccak-256"}},e=await i(e),t.postMessage(e)})(e)));
|