@leofcoin/chain 1.0.13 → 1.0.16
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/dist/chain.browser.js +15188 -15073
- package/dist/chain.browser.min.js +1 -1
- package/dist/chain.js +31 -219
- package/dist/node.browser.js +3697 -3688
- package/dist/node.browser.min.js +1 -1
- package/dist/node.js +1 -1
- package/docs/@leofcoin/chain/1.0.13/chain.js.html +738 -0
- package/docs/@leofcoin/chain/1.0.13/contracts_factory.js.html +182 -0
- package/docs/@leofcoin/chain/1.0.13/contracts_nameService.js.html +231 -0
- package/docs/@leofcoin/chain/1.0.13/contracts_proxies_factoryProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.13/contracts_proxies_nameServiceProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.13/contracts_proxies_nativeTokenProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.13/contracts_proxies_validatorsProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.13/contracts_proxies_votingProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.13/contracts_validators.js.html +242 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Bold-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Italic-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Light-webfont.svg +1831 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Regular-webfont.svg +1831 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Semibold-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Semibold-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Semibold-webfont.ttf +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-Semibold-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-SemiboldItalic-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
- package/docs/@leofcoin/chain/1.0.13/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.13/global.html +1153 -0
- package/docs/@leofcoin/chain/1.0.13/icons/home.svg +4 -0
- package/docs/@leofcoin/chain/1.0.13/icons/search.svg +4 -0
- package/docs/@leofcoin/chain/1.0.13/index.html +125 -0
- package/docs/@leofcoin/chain/1.0.13/machine.js.html +251 -0
- package/docs/@leofcoin/chain/1.0.13/scripts/linenumber.js +23 -0
- package/docs/@leofcoin/chain/1.0.13/scripts/pagelocation.js +89 -0
- package/docs/@leofcoin/chain/1.0.13/standards_roles.js.html +188 -0
- package/docs/@leofcoin/chain/1.0.13/standards_token.js.html +260 -0
- package/docs/@leofcoin/chain/1.0.13/styles/collapse.css +27 -0
- package/docs/@leofcoin/chain/1.0.13/styles/jsdoc-default.css +953 -0
- package/docs/@leofcoin/chain/1.0.13/styles/prettify-jsdoc.css +111 -0
- package/docs/@leofcoin/chain/1.0.13/styles/prettify-tomorrow.css +138 -0
- package/docs/@leofcoin/chain/1.0.14/chain.js.html +738 -0
- package/docs/@leofcoin/chain/1.0.14/contracts_factory.js.html +182 -0
- package/docs/@leofcoin/chain/1.0.14/contracts_nameService.js.html +231 -0
- package/docs/@leofcoin/chain/1.0.14/contracts_proxies_factoryProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.14/contracts_proxies_nameServiceProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.14/contracts_proxies_nativeTokenProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.14/contracts_proxies_validatorsProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.14/contracts_proxies_votingProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.14/contracts_validators.js.html +242 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-Bold-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-Italic-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-Light-webfont.svg +1831 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-Regular-webfont.svg +1831 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-Semibold-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-Semibold-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-Semibold-webfont.ttf +0 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-Semibold-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-SemiboldItalic-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
- package/docs/@leofcoin/chain/1.0.14/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.14/global.html +1153 -0
- package/docs/@leofcoin/chain/1.0.14/icons/home.svg +4 -0
- package/docs/@leofcoin/chain/1.0.14/icons/search.svg +4 -0
- package/docs/@leofcoin/chain/1.0.14/index.html +125 -0
- package/docs/@leofcoin/chain/1.0.14/machine.js.html +251 -0
- package/docs/@leofcoin/chain/1.0.14/scripts/linenumber.js +23 -0
- package/docs/@leofcoin/chain/1.0.14/scripts/pagelocation.js +89 -0
- package/docs/@leofcoin/chain/1.0.14/standards_roles.js.html +188 -0
- package/docs/@leofcoin/chain/1.0.14/standards_token.js.html +260 -0
- package/docs/@leofcoin/chain/1.0.14/styles/collapse.css +27 -0
- package/docs/@leofcoin/chain/1.0.14/styles/jsdoc-default.css +953 -0
- package/docs/@leofcoin/chain/1.0.14/styles/prettify-jsdoc.css +111 -0
- package/docs/@leofcoin/chain/1.0.14/styles/prettify-tomorrow.css +138 -0
- package/docs/@leofcoin/chain/1.0.15/chain.js.html +738 -0
- package/docs/@leofcoin/chain/1.0.15/contracts_factory.js.html +182 -0
- package/docs/@leofcoin/chain/1.0.15/contracts_nameService.js.html +231 -0
- package/docs/@leofcoin/chain/1.0.15/contracts_proxies_factoryProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.15/contracts_proxies_nameServiceProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.15/contracts_proxies_nativeTokenProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.15/contracts_proxies_validatorsProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.15/contracts_proxies_votingProxy.js.html +135 -0
- package/docs/@leofcoin/chain/1.0.15/contracts_validators.js.html +242 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-Bold-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-Italic-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-Light-webfont.svg +1831 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-Regular-webfont.svg +1831 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-Semibold-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-Semibold-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-Semibold-webfont.ttf +0 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-Semibold-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-SemiboldItalic-webfont.svg +1830 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
- package/docs/@leofcoin/chain/1.0.15/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.15/global.html +1153 -0
- package/docs/@leofcoin/chain/1.0.15/icons/home.svg +4 -0
- package/docs/@leofcoin/chain/1.0.15/icons/search.svg +4 -0
- package/docs/@leofcoin/chain/1.0.15/index.html +125 -0
- package/docs/@leofcoin/chain/1.0.15/machine.js.html +251 -0
- package/docs/@leofcoin/chain/1.0.15/scripts/linenumber.js +23 -0
- package/docs/@leofcoin/chain/1.0.15/scripts/pagelocation.js +89 -0
- package/docs/@leofcoin/chain/1.0.15/standards_roles.js.html +188 -0
- package/docs/@leofcoin/chain/1.0.15/standards_token.js.html +260 -0
- package/docs/@leofcoin/chain/1.0.15/styles/collapse.css +27 -0
- package/docs/@leofcoin/chain/1.0.15/styles/jsdoc-default.css +953 -0
- package/docs/@leofcoin/chain/1.0.15/styles/prettify-jsdoc.css +111 -0
- package/docs/@leofcoin/chain/1.0.15/styles/prettify-tomorrow.css +138 -0
- package/package.json +3 -1
- package/src/chain.js +2 -2
- package/src/machine.js +2 -3
- package/src/node.js +1 -1
- package/src/typer.js +1 -1
- package/src/addresses.json +0 -6
- package/src/bytecodes.json +0 -6
- package/src/lib.js +0 -67
- package/src/messages/block.js +0 -14
- package/src/messages/bw-request.js +0 -14
- package/src/messages/bw.js +0 -14
- package/src/messages/contract.js +0 -13
- package/src/messages/last-block-request.js +0 -14
- package/src/messages/last-block.js +0 -14
- package/src/messages/transaction.js +0 -14
- package/src/protos/block.proto.js +0 -26
- package/src/protos/bw-request.proto.js +0 -5
- package/src/protos/bw.proto.js +0 -7
- package/src/protos/contract.proto.js +0 -7
- package/src/protos/last-block-request.proto.js +0 -5
- package/src/protos/last-block.proto.js +0 -7
- package/src/protos/transaction.proto.js +0 -11
- package/src/utils/utils.js +0 -7
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/* JSDoc prettify.js theme */
|
|
2
|
+
|
|
3
|
+
/* plain text */
|
|
4
|
+
.pln {
|
|
5
|
+
color: #000000;
|
|
6
|
+
font-weight: normal;
|
|
7
|
+
font-style: normal;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* string content */
|
|
11
|
+
.str {
|
|
12
|
+
color: hsl(104, 100%, 24%);
|
|
13
|
+
font-weight: normal;
|
|
14
|
+
font-style: normal;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/* a keyword */
|
|
18
|
+
.kwd {
|
|
19
|
+
color: #000000;
|
|
20
|
+
font-weight: bold;
|
|
21
|
+
font-style: normal;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* a comment */
|
|
25
|
+
.com {
|
|
26
|
+
font-weight: normal;
|
|
27
|
+
font-style: italic;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* a type name */
|
|
31
|
+
.typ {
|
|
32
|
+
color: #000000;
|
|
33
|
+
font-weight: normal;
|
|
34
|
+
font-style: normal;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* a literal value */
|
|
38
|
+
.lit {
|
|
39
|
+
color: #006400;
|
|
40
|
+
font-weight: normal;
|
|
41
|
+
font-style: normal;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* punctuation */
|
|
45
|
+
.pun {
|
|
46
|
+
color: #000000;
|
|
47
|
+
font-weight: bold;
|
|
48
|
+
font-style: normal;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* lisp open bracket */
|
|
52
|
+
.opn {
|
|
53
|
+
color: #000000;
|
|
54
|
+
font-weight: bold;
|
|
55
|
+
font-style: normal;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* lisp close bracket */
|
|
59
|
+
.clo {
|
|
60
|
+
color: #000000;
|
|
61
|
+
font-weight: bold;
|
|
62
|
+
font-style: normal;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* a markup tag name */
|
|
66
|
+
.tag {
|
|
67
|
+
color: #006400;
|
|
68
|
+
font-weight: normal;
|
|
69
|
+
font-style: normal;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* a markup attribute name */
|
|
73
|
+
.atn {
|
|
74
|
+
color: #006400;
|
|
75
|
+
font-weight: normal;
|
|
76
|
+
font-style: normal;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* a markup attribute value */
|
|
80
|
+
.atv {
|
|
81
|
+
color: #006400;
|
|
82
|
+
font-weight: normal;
|
|
83
|
+
font-style: normal;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* a declaration */
|
|
87
|
+
.dec {
|
|
88
|
+
color: #000000;
|
|
89
|
+
font-weight: bold;
|
|
90
|
+
font-style: normal;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* a variable name */
|
|
94
|
+
.var {
|
|
95
|
+
color: #000000;
|
|
96
|
+
font-weight: normal;
|
|
97
|
+
font-style: normal;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* a function name */
|
|
101
|
+
.fun {
|
|
102
|
+
color: #000000;
|
|
103
|
+
font-weight: bold;
|
|
104
|
+
font-style: normal;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* Specify class=linenums on a pre to get line numbering */
|
|
108
|
+
ol.linenums {
|
|
109
|
+
margin-top: 0;
|
|
110
|
+
margin-bottom: 0;
|
|
111
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/* Tomorrow Theme */
|
|
2
|
+
/* Original theme - https://github.com/chriskempson/tomorrow-theme */
|
|
3
|
+
/* Pretty printing styles. Used with prettify.js. */
|
|
4
|
+
/* SPAN elements with the classes below are added by prettyprint. */
|
|
5
|
+
/* plain text */
|
|
6
|
+
.pln {
|
|
7
|
+
color: #4d4d4c; }
|
|
8
|
+
|
|
9
|
+
@media screen {
|
|
10
|
+
/* string content */
|
|
11
|
+
.str {
|
|
12
|
+
color: hsl(104, 100%, 24%); }
|
|
13
|
+
|
|
14
|
+
/* a keyword */
|
|
15
|
+
.kwd {
|
|
16
|
+
color: hsl(240, 100%, 50%); }
|
|
17
|
+
|
|
18
|
+
/* a comment */
|
|
19
|
+
.com {
|
|
20
|
+
color: hsl(0, 0%, 60%); }
|
|
21
|
+
|
|
22
|
+
/* a type name */
|
|
23
|
+
.typ {
|
|
24
|
+
color: hsl(240, 100%, 32%); }
|
|
25
|
+
|
|
26
|
+
/* a literal value */
|
|
27
|
+
.lit {
|
|
28
|
+
color: hsl(240, 100%, 40%); }
|
|
29
|
+
|
|
30
|
+
/* punctuation */
|
|
31
|
+
.pun {
|
|
32
|
+
color: #000000; }
|
|
33
|
+
|
|
34
|
+
/* lisp open bracket */
|
|
35
|
+
.opn {
|
|
36
|
+
color: #000000; }
|
|
37
|
+
|
|
38
|
+
/* lisp close bracket */
|
|
39
|
+
.clo {
|
|
40
|
+
color: #000000; }
|
|
41
|
+
|
|
42
|
+
/* a markup tag name */
|
|
43
|
+
.tag {
|
|
44
|
+
color: #c82829; }
|
|
45
|
+
|
|
46
|
+
/* a markup attribute name */
|
|
47
|
+
.atn {
|
|
48
|
+
color: #f5871f; }
|
|
49
|
+
|
|
50
|
+
/* a markup attribute value */
|
|
51
|
+
.atv {
|
|
52
|
+
color: #3e999f; }
|
|
53
|
+
|
|
54
|
+
/* a declaration */
|
|
55
|
+
.dec {
|
|
56
|
+
color: #f5871f; }
|
|
57
|
+
|
|
58
|
+
/* a variable name */
|
|
59
|
+
.var {
|
|
60
|
+
color: #c82829; }
|
|
61
|
+
|
|
62
|
+
/* a function name */
|
|
63
|
+
.fun {
|
|
64
|
+
color: #4271ae; } }
|
|
65
|
+
/* Use higher contrast and text-weight for printable form. */
|
|
66
|
+
@media print, projection {
|
|
67
|
+
.str {
|
|
68
|
+
color: #060; }
|
|
69
|
+
|
|
70
|
+
.kwd {
|
|
71
|
+
color: #006;
|
|
72
|
+
font-weight: bold; }
|
|
73
|
+
|
|
74
|
+
.com {
|
|
75
|
+
color: #600;
|
|
76
|
+
font-style: italic; }
|
|
77
|
+
|
|
78
|
+
.typ {
|
|
79
|
+
color: #404;
|
|
80
|
+
font-weight: bold; }
|
|
81
|
+
|
|
82
|
+
.lit {
|
|
83
|
+
color: #044; }
|
|
84
|
+
|
|
85
|
+
.pun, .opn, .clo {
|
|
86
|
+
color: #440; }
|
|
87
|
+
|
|
88
|
+
.tag {
|
|
89
|
+
color: #006;
|
|
90
|
+
font-weight: bold; }
|
|
91
|
+
|
|
92
|
+
.atn {
|
|
93
|
+
color: #404; }
|
|
94
|
+
|
|
95
|
+
.atv {
|
|
96
|
+
color: #060; } }
|
|
97
|
+
/* Style */
|
|
98
|
+
/*
|
|
99
|
+
pre.prettyprint {
|
|
100
|
+
background: white;
|
|
101
|
+
font-family: Consolas, Monaco, 'Andale Mono', monospace;
|
|
102
|
+
font-size: 12px;
|
|
103
|
+
line-height: 1.5;
|
|
104
|
+
border: 1px solid #ccc;
|
|
105
|
+
padding: 10px; }
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
/* Get LI elements to show when they are in the main article */
|
|
109
|
+
article ul li {
|
|
110
|
+
list-style-type: circle;
|
|
111
|
+
margin-left: 25px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Specify class=linenums on a pre to get line numbering */
|
|
115
|
+
ol.linenums {
|
|
116
|
+
margin-top: 0;
|
|
117
|
+
margin-bottom: 0; }
|
|
118
|
+
|
|
119
|
+
/* IE indents via margin-left */
|
|
120
|
+
li.L0,
|
|
121
|
+
li.L1,
|
|
122
|
+
li.L2,
|
|
123
|
+
li.L3,
|
|
124
|
+
li.L4,
|
|
125
|
+
li.L5,
|
|
126
|
+
li.L6,
|
|
127
|
+
li.L7,
|
|
128
|
+
li.L8,
|
|
129
|
+
li.L9 {
|
|
130
|
+
/* */ }
|
|
131
|
+
|
|
132
|
+
/* Alternate shading for lines */
|
|
133
|
+
li.L1,
|
|
134
|
+
li.L3,
|
|
135
|
+
li.L5,
|
|
136
|
+
li.L7,
|
|
137
|
+
li.L9 {
|
|
138
|
+
/* */ }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leofcoin/chain",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"description": "<a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc/4.0/\"><img alt=\"Creative Commons Licence\" style=\"border-width:0\" src=\"https://i.creativecommons.org/l/by-nc/4.0/88x31.png\" /></a><br />This work is licensed under a <a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc/4.0/\">Creative Commons Attribution-NonCommercial 4.0 International License</a>.",
|
|
5
5
|
"source": "./src/node.js",
|
|
6
6
|
"main": "./dist/node.js",
|
|
@@ -35,9 +35,11 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@ethersproject/bignumber": "^5.6.0",
|
|
37
37
|
"@ethersproject/units": "^5.6.0",
|
|
38
|
+
"@leofcoin/lib": "^1.0.1",
|
|
38
39
|
"@leofcoin/multi-wallet": "^2.1.1",
|
|
39
40
|
"@leofcoin/peernet": "^0.11.31",
|
|
40
41
|
"@leofcoin/storage": "^2.3.0",
|
|
42
|
+
"@leofcoin/utils": "^1.0.1",
|
|
41
43
|
"chalk": "^4.0.0",
|
|
42
44
|
"datastore-level": "^8.0.0",
|
|
43
45
|
"pako": "^2.0.4"
|
package/src/chain.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BigNumber, formatUnits, parseUnits } from '
|
|
1
|
+
import { BigNumber, formatUnits, parseUnits } from '@leofcoin/utils'
|
|
2
2
|
import Machine from './machine'
|
|
3
|
-
import lib from '
|
|
3
|
+
import lib from '@leofcoin/lib'
|
|
4
4
|
|
|
5
5
|
globalThis.BigNumber = BigNumber
|
|
6
6
|
|
package/src/machine.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import vm from 'vm'
|
|
2
|
-
import ContractMessage from '
|
|
3
|
-
import
|
|
4
|
-
import lib from './lib'
|
|
2
|
+
import { ContractMessage, TransactionMessage } from '@leofcoin/messages'
|
|
3
|
+
import lib from '@leofcoin/lib'
|
|
5
4
|
// import State from './state'
|
|
6
5
|
|
|
7
6
|
export default class Machine {
|
package/src/node.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// import config from './config/config'
|
|
2
2
|
import Peernet from '@leofcoin/peernet'
|
|
3
|
-
import lib from '
|
|
3
|
+
import lib from '@leofcoin/lib'
|
|
4
4
|
const { ContractMessage, TransactionMessage, BlockMessage, BWMessage, BWRequestMessage } = lib
|
|
5
5
|
|
|
6
6
|
export default class Node {
|
package/src/typer.js
CHANGED
package/src/addresses.json
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"contractFactory": "ba5xdads6vcjiwvf34npzh6xrlaivpjgtp3mit3hwhxeumybwspjrhez3e",
|
|
3
|
-
"nativeToken": "ba5xdadfmb6fw42j2paz734pubzwxn7rgiwwmgs3dcicr4u2ekhqevqvcu",
|
|
4
|
-
"nameService": "ba5xdadsx73i3tkuk6q5bz4mm5zcgqipha3szmuixgit46albm2inuarp6",
|
|
5
|
-
"validators": "ba5xdac7kvy3cjka4aex7bz7w6ryqxgfbmwstomseyonytbssl7sleriud"
|
|
6
|
-
}
|
package/src/bytecodes.json
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"contractFactory": "237,198,1,10,54,51,67,122,86,52,88,98,115,81,54,72,57,100,75,49,76,101,105,66,75,65,120,114,54,81,105,77,71,53,116,68,105,55,122,77,77,72,118,117,120,104,121,50,101,118,70,101,118,72,49,77,85,76,99,18,146,8,114,101,116,117,114,110,32,99,108,97,115,115,32,70,97,99,116,111,114,121,123,35,110,97,109,101,61,34,65,114,116,79,110,108,105,110,101,67,111,110,116,114,97,99,116,70,97,99,116,111,114,121,34,59,35,116,111,116,97,108,67,111,110,116,114,97,99,116,115,61,48,59,35,99,111,110,116,114,97,99,116,115,61,91,93,59,99,111,110,115,116,114,117,99,116,111,114,40,115,116,97,116,101,41,123,115,116,97,116,101,38,38,40,116,104,105,115,46,35,99,111,110,116,114,97,99,116,115,61,115,116,97,116,101,46,99,111,110,116,114,97,99,116,115,44,116,104,105,115,46,35,116,111,116,97,108,67,111,110,116,114,97,99,116,115,61,115,116,97,116,101,46,116,111,116,97,108,67,111,110,116,114,97,99,116,115,41,125,103,101,116,32,115,116,97,116,101,40,41,123,114,101,116,117,114,110,123,116,111,116,97,108,67,111,110,116,114,97,99,116,115,58,116,104,105,115,46,35,116,111,116,97,108,67,111,110,116,114,97,99,116,115,44,99,111,110,116,114,97,99,116,115,58,116,104,105,115,46,35,99,111,110,116,114,97,99,116,115,125,125,103,101,116,32,110,97,109,101,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,110,97,109,101,125,103,101,116,32,99,111,110,116,114,97,99,116,115,40,41,123,114,101,116,117,114,110,91,46,46,46,116,104,105,115,46,35,99,111,110,116,114,97,99,116,115,93,125,103,101,116,32,116,111,116,97,108,67,111,110,116,114,97,99,116,115,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,116,111,116,97,108,67,111,110,116,114,97,99,116,115,125,105,115,118,97,108,105,100,40,104,97,115,104,44,99,114,101,97,116,111,114,44,99,111,110,116,114,97,99,116,44,99,111,110,115,116,114,117,99,116,111,114,80,97,114,97,109,101,116,101,114,115,61,91,93,41,123,99,111,110,115,116,32,109,101,115,115,97,103,101,61,110,101,119,32,67,111,110,116,114,97,99,116,77,101,115,115,97,103,101,40,123,99,114,101,97,116,111,114,58,99,114,101,97,116,111,114,44,99,111,110,116,114,97,99,116,58,99,111,110,116,114,97,99,116,44,99,111,110,115,116,114,117,99,116,111,114,80,97,114,97,109,101,116,101,114,115,58,99,111,110,115,116,114,117,99,116,111,114,80,97,114,97,109,101,116,101,114,115,125,41,59,114,101,116,117,114,110,32,66,111,111,108,101,97,110,40,109,101,115,115,97,103,101,46,104,97,115,104,61,61,61,104,97,115,104,41,125,97,115,121,110,99,32,100,101,112,108,111,121,67,111,110,116,114,97,99,116,40,99,111,110,116,114,97,99,116,72,97,115,104,44,99,114,101,97,116,111,114,44,99,111,110,116,114,97,99,116,44,99,111,110,115,116,114,117,99,116,111,114,80,97,114,97,109,101,116,101,114,115,61,91,93,41,123,105,102,40,99,111,110,116,114,97,99,116,46,99,114,101,97,116,111,114,33,61,61,109,115,103,46,115,101,110,100,101,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,111,110,108,121,32,97,32,99,111,110,116,114,97,99,116,32,99,114,101,97,116,111,114,32,99,97,110,32,100,101,112,108,111,121,32,97,32,99,111,110,116,114,97,99,116,34,41,59,105,102,40,97,119,97,105,116,32,99,111,110,116,114,97,99,116,83,116,111,114,101,46,104,97,115,40,104,97,115,104,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,100,117,112,108,105,99,97,116,101,32,99,111,110,116,114,97,99,116,34,41,59,105,102,40,33,116,104,105,115,46,105,115,86,97,108,105,100,40,99,111,110,116,114,97,99,116,72,97,115,104,44,99,114,101,97,116,111,114,44,99,111,110,116,114,97,99,116,44,99,111,110,115,116,114,117,99,116,111,114,80,97,114,97,109,101,116,101,114,115,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,105,110,118,97,108,105,100,32,99,111,110,116,114,97,99,116,34,41,59,97,119,97,105,116,32,99,111,110,116,114,97,99,116,83,116,111,114,101,46,112,117,116,40,104,97,115,104,44,101,110,99,111,100,101,100,41,44,116,104,105,115,46,35,116,111,116,97,108,67,111,110,116,114,97,99,116,115,43,61,49,44,116,104,105,115,46,35,99,111,110,116,114,97,99,116,115,46,112,117,115,104,40,104,97,115,104,41,125,125,59,10",
|
|
3
|
-
"nativeToken": "237,198,1,10,54,51,67,122,86,52,88,98,115,81,54,72,57,100,75,49,76,101,105,66,75,65,120,114,54,81,105,77,71,53,116,68,105,55,122,77,77,72,118,117,120,104,121,50,101,118,70,101,118,72,49,77,85,76,99,18,152,26,114,101,116,117,114,110,32,99,108,97,115,115,32,65,114,116,79,110,108,105,110,101,32,101,120,116,101,110,100,115,32,99,108,97,115,115,32,84,111,107,101,110,32,101,120,116,101,110,100,115,32,99,108,97,115,115,32,82,111,108,101,115,123,35,114,111,108,101,115,61,123,79,87,78,69,82,58,91,93,44,77,73,78,84,58,91,93,44,66,85,82,78,58,91,93,125,59,99,111,110,115,116,114,117,99,116,111,114,40,114,111,108,101,115,41,123,105,102,40,114,111,108,101,115,41,123,105,102,40,33,40,114,111,108,101,115,32,105,110,115,116,97,110,99,101,111,102,32,79,98,106,101,99,116,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,101,120,112,101,99,116,101,100,32,114,111,108,101,115,32,116,111,32,98,101,32,97,110,32,111,98,106,101,99,116,34,41,59,116,104,105,115,46,35,114,111,108,101,115,61,123,46,46,46,114,111,108,101,115,44,46,46,46,116,104,105,115,46,35,114,111,108,101,115,125,125,101,108,115,101,32,116,104,105,115,46,35,103,114,97,110,116,82,111,108,101,40,109,115,103,46,115,101,110,100,101,114,44,34,79,87,78,69,82,34,41,125,103,101,116,32,115,116,97,116,101,40,41,123,114,101,116,117,114,110,123,114,111,108,101,115,58,116,104,105,115,46,114,111,108,101,115,125,125,103,101,116,32,114,111,108,101,115,40,41,123,114,101,116,117,114,110,123,46,46,46,116,104,105,115,46,35,114,111,108,101,115,125,125,104,97,115,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,123,114,101,116,117,114,110,33,33,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,38,38,45,49,33,61,61,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,46,105,110,100,101,120,79,102,40,97,100,100,114,101,115,115,41,125,35,103,114,97,110,116,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,123,105,102,40,116,104,105,115,46,104,97,115,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,36,123,114,111,108,101,125,32,114,111,108,101,32,97,108,114,101,97,100,121,32,103,114,97,110,116,101,100,32,102,111,114,32,36,123,97,100,100,114,101,115,115,125,96,41,59,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,46,112,117,115,104,40,97,100,100,114,101,115,115,41,125,35,114,101,118,111,107,101,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,123,105,102,40,33,116,104,105,115,46,104,97,115,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,36,123,114,111,108,101,125,32,114,111,108,101,32,97,108,114,101,97,100,121,32,114,101,118,111,107,101,100,32,102,111,114,32,36,123,97,100,100,114,101,115,115,125,96,41,59,105,102,40,34,79,87,78,69,82,34,61,61,61,114,111,108,101,38,38,49,61,61,61,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,46,108,101,110,103,116,104,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,97,116,108,101,97,115,116,32,111,110,101,32,111,119,110,101,114,32,105,115,32,110,101,101,100,101,100,33,34,41,59,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,46,115,112,108,105,99,101,40,116,104,105,115,46,35,114,111,108,101,115,91,114,111,108,101,93,46,105,110,100,101,120,79,102,40,97,100,100,114,101,115,115,41,41,125,103,114,97,110,116,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,123,105,102,40,33,116,104,105,115,46,104,97,115,82,111,108,101,40,97,100,100,114,101,115,115,44,34,79,87,78,69,82,34,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,78,111,116,32,97,108,108,111,119,101,100,34,41,59,116,104,105,115,46,35,103,114,97,110,116,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,125,114,101,118,111,107,101,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,123,105,102,40,33,116,104,105,115,46,104,97,115,82,111,108,101,40,97,100,100,114,101,115,115,44,34,79,87,78,69,82,34,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,78,111,116,32,97,108,108,111,119,101,100,34,41,59,116,104,105,115,46,35,114,101,118,111,107,101,82,111,108,101,40,97,100,100,114,101,115,115,44,114,111,108,101,41,125,125,123,35,110,97,109,101,59,35,115,121,109,98,111,108,59,35,104,111,108,100,101,114,115,61,48,59,35,98,97,108,97,110,99,101,115,61,123,125,59,35,97,112,112,114,111,118,97,108,115,61,123,125,59,35,100,101,99,105,109,97,108,115,61,49,56,59,35,116,111,116,97,108,83,117,112,112,108,121,61,66,105,103,78,117,109,98,101,114,46,102,114,111,109,40,48,41,59,99,111,110,115,116,114,117,99,116,111,114,40,110,97,109,101,44,115,121,109,98,111,108,44,100,101,99,105,109,97,108,115,61,49,56,44,115,116,97,116,101,41,123,105,102,40,33,110,97,109,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,110,97,109,101,32,117,110,100,101,102,105,110,101,100,34,41,59,105,102,40,33,115,121,109,98,111,108,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,115,121,109,98,111,108,32,117,110,100,101,102,105,110,101,100,34,41,59,115,117,112,101,114,40,115,116,97,116,101,63,46,114,111,108,101,115,41,44,116,104,105,115,46,35,110,97,109,101,61,110,97,109,101,44,116,104,105,115,46,35,115,121,109,98,111,108,61,115,121,109,98,111,108,44,116,104,105,115,46,35,100,101,99,105,109,97,108,115,61,100,101,99,105,109,97,108,115,125,103,101,116,32,115,116,97,116,101,40,41,123,114,101,116,117,114,110,123,46,46,46,115,117,112,101,114,46,115,116,97,116,101,44,104,111,108,100,101,114,115,58,116,104,105,115,46,104,111,108,100,101,114,115,44,98,97,108,97,110,99,101,115,58,116,104,105,115,46,98,97,108,97,110,99,101,115,44,97,112,112,114,111,118,97,108,115,58,123,46,46,46,116,104,105,115,46,35,97,112,112,114,111,118,97,108,115,125,44,116,111,116,97,108,83,117,112,112,108,121,58,116,104,105,115,46,116,111,116,97,108,83,117,112,112,108,121,125,125,103,101,116,32,116,111,116,97,108,83,117,112,112,108,121,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,116,111,116,97,108,83,117,112,112,108,121,125,103,101,116,32,110,97,109,101,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,110,97,109,101,125,103,101,116,32,115,121,109,98,111,108,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,115,121,109,98,111,108,125,103,101,116,32,104,111,108,100,101,114,115,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,104,111,108,100,101,114,115,125,103,101,116,32,98,97,108,97,110,99,101,115,40,41,123,114,101,116,117,114,110,123,46,46,46,116,104,105,115,46,35,98,97,108,97,110,99,101,115,125,125,109,105,110,116,40,116,111,44,97,109,111,117,110,116,41,123,105,102,40,33,116,104,105,115,46,104,97,115,82,111,108,101,40,109,115,103,46,115,101,110,100,101,114,44,34,77,73,78,84,34,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,110,111,116,32,97,108,108,111,119,101,100,34,41,59,116,104,105,115,46,35,116,111,116,97,108,83,117,112,112,108,121,61,116,104,105,115,46,35,116,111,116,97,108,83,117,112,112,108,121,46,97,100,100,40,97,109,111,117,110,116,41,44,116,104,105,115,46,35,105,110,99,114,101,97,115,101,66,97,108,97,110,99,101,40,116,111,44,97,109,111,117,110,116,41,125,98,117,114,110,40,116,111,44,97,109,111,117,110,116,41,123,105,102,40,33,116,104,105,115,46,104,97,115,82,111,108,101,40,109,115,103,46,115,101,110,100,101,114,44,34,66,85,82,78,34,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,110,111,116,32,97,108,108,111,119,101,100,34,41,59,116,104,105,115,46,35,116,111,116,97,108,83,117,112,112,108,121,61,116,104,105,115,46,35,116,111,116,97,108,83,117,112,112,108,121,46,115,117,98,40,97,109,111,117,110,116,41,44,116,104,105,115,46,35,100,101,99,114,101,97,115,101,66,97,108,97,110,99,101,40,116,111,44,97,109,111,117,110,116,41,125,35,98,101,102,111,114,101,84,114,97,110,115,102,101,114,40,102,114,111,109,44,116,111,44,97,109,111,117,110,116,41,123,105,102,40,33,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,102,114,111,109,93,124,124,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,102,114,111,109,93,60,97,109,111,117,110,116,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,97,109,111,117,110,116,32,101,120,99,101,101,100,115,32,98,97,108,97,110,99,101,34,41,125,35,117,112,100,97,116,101,72,111,108,100,101,114,115,40,97,100,100,114,101,115,115,44,112,114,101,118,105,111,117,115,66,97,108,97,110,99,101,41,123,34,48,120,48,48,34,61,61,61,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,46,116,111,72,101,120,83,116,114,105,110,103,40,41,63,116,104,105,115,46,35,104,111,108,100,101,114,115,45,61,49,58,34,48,120,48,48,34,33,61,61,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,46,116,111,72,101,120,83,116,114,105,110,103,40,41,38,38,34,48,120,48,48,34,61,61,61,112,114,101,118,105,111,117,115,66,97,108,97,110,99,101,46,116,111,72,101,120,83,116,114,105,110,103,40,41,38,38,40,116,104,105,115,46,35,104,111,108,100,101,114,115,43,61,49,41,125,35,105,110,99,114,101,97,115,101,66,97,108,97,110,99,101,40,97,100,100,114,101,115,115,44,97,109,111,117,110,116,41,123,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,124,124,40,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,61,66,105,103,78,117,109,98,101,114,46,102,114,111,109,40,48,41,41,59,99,111,110,115,116,32,112,114,101,118,105,111,117,115,66,97,108,97,110,99,101,61,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,59,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,61,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,46,97,100,100,40,97,109,111,117,110,116,41,44,116,104,105,115,46,35,117,112,100,97,116,101,72,111,108,100,101,114,115,40,97,100,100,114,101,115,115,44,112,114,101,118,105,111,117,115,66,97,108,97,110,99,101,41,125,35,100,101,99,114,101,97,115,101,66,97,108,97,110,99,101,40,97,100,100,114,101,115,115,44,97,109,111,117,110,116,41,123,99,111,110,115,116,32,112,114,101,118,105,111,117,115,66,97,108,97,110,99,101,61,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,59,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,61,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,46,115,117,98,40,97,109,111,117,110,116,41,44,116,104,105,115,46,35,117,112,100,97,116,101,72,111,108,100,101,114,115,40,97,100,100,114,101,115,115,44,112,114,101,118,105,111,117,115,66,97,108,97,110,99,101,41,125,98,97,108,97,110,99,101,79,102,40,97,100,100,114,101,115,115,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,98,97,108,97,110,99,101,115,91,97,100,100,114,101,115,115,93,125,115,101,116,65,112,112,114,111,118,97,108,40,111,112,101,114,97,116,111,114,44,97,109,111,117,110,116,41,123,99,111,110,115,116,32,111,119,110,101,114,61,103,108,111,98,97,108,84,104,105,115,46,109,115,103,46,115,101,110,100,101,114,59,116,104,105,115,46,35,97,112,112,114,111,118,97,108,115,91,111,119,110,101,114,93,124,124,40,116,104,105,115,46,35,97,112,112,114,111,118,97,108,115,91,111,119,110,101,114,93,61,123,125,41,44,116,104,105,115,46,35,97,112,112,114,111,118,97,108,115,91,111,119,110,101,114,93,91,111,112,101,114,97,116,111,114,93,61,97,109,111,117,110,116,125,97,112,112,114,111,118,101,100,40,111,119,110,101,114,44,111,112,101,114,97,116,111,114,44,97,109,111,117,110,116,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,97,112,112,114,111,118,97,108,115,91,111,119,110,101,114,93,91,111,112,101,114,97,116,111,114,93,61,61,61,97,109,111,117,110,116,125,116,114,97,110,115,102,101,114,40,102,114,111,109,44,116,111,44,97,109,111,117,110,116,41,123,97,109,111,117,110,116,61,66,105,103,78,117,109,98,101,114,46,102,114,111,109,40,97,109,111,117,110,116,41,44,116,104,105,115,46,35,98,101,102,111,114,101,84,114,97,110,115,102,101,114,40,102,114,111,109,44,116,111,44,97,109,111,117,110,116,41,44,116,104,105,115,46,35,100,101,99,114,101,97,115,101,66,97,108,97,110,99,101,40,102,114,111,109,44,97,109,111,117,110,116,41,44,116,104,105,115,46,35,105,110,99,114,101,97,115,101,66,97,108,97,110,99,101,40,116,111,44,97,109,111,117,110,116,41,125,125,123,99,111,110,115,116,114,117,99,116,111,114,40,115,116,97,116,101,41,123,115,117,112,101,114,40,34,65,114,116,79,110,108,105,110,101,34,44,34,65,82,84,34,44,49,56,44,115,116,97,116,101,41,125,125,59,10",
|
|
4
|
-
"nameService": "237,198,1,10,54,51,67,122,86,52,88,98,115,81,54,72,57,100,75,49,76,101,105,66,75,65,120,114,54,81,105,77,71,53,116,68,105,55,122,77,77,72,118,117,120,104,121,50,101,118,70,101,118,72,49,77,85,76,99,18,138,12,114,101,116,117,114,110,32,99,108,97,115,115,32,78,97,109,101,83,101,114,118,105,99,101,123,35,110,97,109,101,61,34,65,114,116,79,110,108,105,110,101,78,97,109,101,83,101,114,118,105,99,101,34,59,35,111,119,110,101,114,59,35,112,114,105,99,101,61,48,59,35,114,101,103,105,115,116,114,121,61,123,125,59,35,99,117,114,114,101,110,99,121,59,103,101,116,32,110,97,109,101,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,110,97,109,101,125,103,101,116,32,114,101,103,105,115,116,114,121,40,41,123,114,101,116,117,114,110,123,46,46,46,116,104,105,115,46,35,114,101,103,105,115,116,114,121,125,125,103,101,116,32,115,116,97,116,101,40,41,123,125,99,111,110,115,116,114,117,99,116,111,114,40,102,97,99,116,111,114,121,65,100,100,114,101,115,115,44,99,117,114,114,101,110,99,121,44,118,97,108,105,100,97,116,111,114,65,100,100,114,101,115,115,44,112,114,105,99,101,44,115,116,97,116,101,41,123,115,116,97,116,101,63,40,116,104,105,115,46,35,111,119,110,101,114,61,115,116,97,116,101,46,111,119,110,101,114,44,116,104,105,115,46,35,114,101,103,105,115,116,114,121,61,115,116,97,116,101,46,114,101,103,105,115,116,114,121,44,116,104,105,115,46,35,99,117,114,114,101,110,99,121,61,115,116,97,116,101,46,99,117,114,114,101,110,99,121,44,116,104,105,115,46,35,112,114,105,99,101,61,115,116,97,116,101,46,112,114,105,99,101,41,58,40,116,104,105,115,46,35,111,119,110,101,114,61,109,115,103,46,115,101,110,100,101,114,44,116,104,105,115,46,35,112,114,105,99,101,61,112,114,105,99,101,44,116,104,105,115,46,35,114,101,103,105,115,116,114,121,46,65,114,116,79,110,108,105,110,101,67,111,110,116,114,97,99,116,70,97,99,116,111,114,121,61,123,111,119,110,101,114,58,109,115,103,46,115,101,110,100,101,114,44,97,100,100,114,101,115,115,58,102,97,99,116,111,114,121,65,100,100,114,101,115,115,125,44,116,104,105,115,46,35,114,101,103,105,115,116,114,121,46,65,114,116,79,110,108,105,110,101,84,111,107,101,110,61,123,111,119,110,101,114,58,109,115,103,46,115,101,110,100,101,114,44,97,100,100,114,101,115,115,58,99,117,114,114,101,110,99,121,125,44,116,104,105,115,46,35,114,101,103,105,115,116,114,121,46,65,114,116,79,110,108,105,110,101,86,97,108,105,100,97,116,111,114,115,61,123,111,119,110,101,114,58,109,115,103,46,115,101,110,100,101,114,44,97,100,100,114,101,115,115,58,118,97,108,105,100,97,116,111,114,65,100,100,114,101,115,115,125,44,116,104,105,115,46,35,99,117,114,114,101,110,99,121,61,99,117,114,114,101,110,99,121,41,125,99,104,97,110,103,101,79,119,110,101,114,40,111,119,110,101,114,41,123,105,102,40,109,115,103,46,115,101,110,100,101,114,33,61,61,116,104,105,115,46,35,111,119,110,101,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,110,111,32,111,119,110,101,114,34,41,59,116,104,105,115,46,35,111,119,110,101,114,61,111,119,110,101,114,125,99,104,97,110,103,101,80,114,105,99,101,40,112,114,105,99,101,41,123,105,102,40,109,115,103,46,115,101,110,100,101,114,33,61,61,116,104,105,115,46,35,111,119,110,101,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,110,111,32,111,119,110,101,114,34,41,59,116,104,105,115,46,35,112,114,105,99,101,61,112,114,105,99,101,125,99,104,97,110,103,101,67,117,114,114,101,110,99,121,40,99,117,114,114,101,110,99,121,41,123,105,102,40,109,115,103,46,115,101,110,100,101,114,33,61,61,116,104,105,115,46,35,111,119,110,101,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,110,111,32,111,119,110,101,114,34,41,59,116,104,105,115,46,35,99,117,114,114,101,110,99,121,61,99,117,114,114,101,110,99,121,125,97,115,121,110,99,32,112,117,114,99,104,97,115,101,78,97,109,101,40,110,97,109,101,44,97,100,100,114,101,115,115,41,123,105,102,40,97,119,97,105,116,32,109,115,103,46,99,97,108,108,40,116,104,105,115,46,35,99,117,114,114,101,110,99,121,44,34,98,97,108,97,110,99,101,79,102,34,44,91,109,115,103,46,115,101,110,100,101,114,93,41,60,116,104,105,115,46,35,112,114,105,99,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,112,114,105,99,101,32,101,120,99,101,101,100,115,32,98,97,108,97,110,99,101,34,41,59,116,114,121,123,97,119,97,105,116,32,109,115,103,46,99,97,108,108,40,116,104,105,115,46,35,99,117,114,114,101,110,99,121,44,34,116,114,97,110,115,102,101,114,34,44,91,109,115,103,46,115,101,110,100,101,114,44,116,104,105,115,46,35,111,119,110,101,114,44,116,104,105,115,46,35,112,114,105,99,101,93,41,125,99,97,116,99,104,40,101,41,123,116,104,114,111,119,32,101,125,116,104,105,115,46,35,114,101,103,105,115,116,114,121,91,110,97,109,101,93,61,123,111,119,110,101,114,58,109,115,103,46,115,101,110,100,101,114,44,97,100,100,114,101,115,115,58,97,100,100,114,101,115,115,125,125,108,111,111,107,117,112,40,110,97,109,101,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,114,101,103,105,115,116,114,121,91,110,97,109,101,93,125,116,114,97,110,115,102,101,114,79,119,110,101,114,115,104,105,112,40,110,97,109,101,44,116,111,41,123,105,102,40,109,115,103,46,115,101,110,100,101,114,33,61,61,116,104,105,115,46,35,114,101,103,105,115,116,114,121,46,111,119,110,101,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,110,111,116,32,97,32,111,119,110,101,114,34,41,59,116,104,105,115,46,35,114,101,103,105,115,116,114,121,91,110,97,109,101,93,46,111,119,110,101,114,61,116,111,125,99,104,97,110,103,101,65,100,100,114,101,115,115,40,110,97,109,101,44,97,100,100,114,101,115,115,41,123,105,102,40,109,115,103,46,115,101,110,100,101,114,33,61,61,116,104,105,115,46,35,114,101,103,105,115,116,114,121,46,111,119,110,101,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,110,111,116,32,97,32,111,119,110,101,114,34,41,59,116,104,105,115,46,35,114,101,103,105,115,116,114,121,91,110,97,109,101,93,46,97,100,100,114,101,115,115,61,97,100,100,114,101,115,115,125,125,59,10,26,58,98,97,53,120,100,97,100,115,54,118,99,106,105,119,118,102,51,52,110,112,122,104,54,120,114,108,97,105,118,112,106,103,116,112,51,109,105,116,51,104,119,104,120,101,117,109,121,98,119,115,112,106,114,104,101,122,51,101,26,58,98,97,53,120,100,97,100,102,109,98,54,102,119,52,50,106,50,112,97,122,55,51,52,112,117,98,122,119,120,110,55,114,103,105,119,119,109,103,115,51,100,99,105,99,114,52,117,50,101,107,104,113,101,118,113,118,99,117,26,58,98,97,53,120,100,97,99,55,107,118,121,51,99,106,107,97,52,97,101,120,55,98,122,55,119,54,114,121,113,120,103,102,98,109,119,115,116,111,109,115,101,121,111,110,121,116,98,115,115,108,55,115,108,101,114,105,117,100,26,4,49,48,48,48",
|
|
5
|
-
"validators": "237,198,1,10,54,51,67,122,86,52,88,98,115,81,54,72,57,100,75,49,76,101,105,66,75,65,120,114,54,81,105,77,71,53,116,68,105,55,122,77,77,72,118,117,120,104,121,50,101,118,70,101,118,72,49,77,85,76,99,18,215,16,114,101,116,117,114,110,32,99,108,97,115,115,32,86,97,108,105,100,97,116,111,114,115,123,35,110,97,109,101,61,34,65,114,116,79,110,108,105,110,101,86,97,108,105,100,97,116,111,114,115,34,59,35,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,61,48,59,35,118,97,108,105,100,97,116,111,114,115,61,123,125,59,35,111,119,110,101,114,59,35,99,117,114,114,101,110,99,121,59,35,109,105,110,105,109,117,109,66,97,108,97,110,99,101,59,103,101,116,32,115,116,97,116,101,40,41,123,114,101,116,117,114,110,123,111,119,110,101,114,58,116,104,105,115,46,35,111,119,110,101,114,44,109,105,110,105,109,117,109,66,97,108,97,110,99,101,58,116,104,105,115,46,35,109,105,110,105,109,117,109,66,97,108,97,110,99,101,44,99,117,114,114,101,110,99,121,58,116,104,105,115,46,35,99,117,114,114,101,110,99,121,44,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,58,116,104,105,115,46,35,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,44,118,97,108,105,100,97,116,111,114,115,58,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,125,125,99,111,110,115,116,114,117,99,116,111,114,40,116,111,107,101,110,65,100,100,114,101,115,115,44,115,116,97,116,101,41,123,115,116,97,116,101,63,40,116,104,105,115,46,35,111,119,110,101,114,61,115,116,97,116,101,46,111,119,110,101,114,44,116,104,105,115,46,35,109,105,110,105,109,117,109,66,97,108,97,110,99,101,61,115,116,97,116,101,46,109,105,110,105,109,117,109,66,97,108,97,110,99,101,44,116,104,105,115,46,35,99,117,114,114,101,110,99,121,61,115,116,97,116,101,46,99,117,114,114,101,110,99,121,44,116,104,105,115,46,35,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,61,115,116,97,116,101,46,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,44,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,61,115,116,97,116,101,46,118,97,108,105,100,97,116,111,114,115,41,58,40,116,104,105,115,46,35,111,119,110,101,114,61,109,115,103,46,115,101,110,100,101,114,44,116,104,105,115,46,35,109,105,110,105,109,117,109,66,97,108,97,110,99,101,61,53,101,52,44,116,104,105,115,46,35,99,117,114,114,101,110,99,121,61,116,111,107,101,110,65,100,100,114,101,115,115,44,116,104,105,115,46,35,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,43,61,49,44,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,91,109,115,103,46,115,101,110,100,101,114,93,61,123,102,105,114,115,116,83,101,101,110,58,40,110,101,119,32,68,97,116,101,41,46,103,101,116,84,105,109,101,40,41,44,97,99,116,105,118,101,58,33,48,125,41,125,103,101,116,32,110,97,109,101,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,110,97,109,101,125,103,101,116,32,111,119,110,101,114,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,111,119,110,101,114,125,103,101,116,32,99,117,114,114,101,110,99,121,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,99,117,114,114,101,110,99,121,125,103,101,116,32,118,97,108,105,100,97,116,111,114,115,40,41,123,114,101,116,117,114,110,123,46,46,46,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,125,125,103,101,116,32,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,125,103,101,116,32,109,105,110,105,109,117,109,66,97,108,97,110,99,101,40,41,123,114,101,116,117,114,110,32,116,104,105,115,46,35,109,105,110,105,109,117,109,66,97,108,97,110,99,101,125,99,104,97,110,103,101,79,119,110,101,114,40,111,119,110,101,114,41,123,105,102,40,109,115,103,46,115,101,110,100,101,114,33,61,61,116,104,105,115,46,35,111,119,110,101,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,110,111,116,32,97,110,32,111,119,110,101,114,34,41,125,99,104,97,110,103,101,67,117,114,114,101,110,99,121,40,99,117,114,114,101,110,99,121,41,123,105,102,40,109,115,103,46,115,101,110,100,101,114,33,61,61,116,104,105,115,46,35,111,119,110,101,114,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,110,111,116,32,97,110,32,111,119,110,101,114,34,41,59,116,104,105,115,46,35,99,117,114,114,101,110,99,121,61,99,117,114,114,101,110,99,121,125,104,97,115,40,118,97,108,105,100,97,116,111,114,41,123,114,101,116,117,114,110,32,66,111,111,108,101,97,110,40,118,111,105,100,32,48,33,61,61,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,91,118,97,108,105,100,97,116,111,114,93,41,125,97,115,121,110,99,32,97,100,100,86,97,108,105,100,97,116,111,114,40,118,97,108,105,100,97,116,111,114,41,123,105,102,40,116,104,105,115,46,104,97,115,40,118,97,108,105,100,97,116,111,114,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,97,108,114,101,97,100,121,32,97,32,118,97,108,105,100,97,116,111,114,34,41,59,99,111,110,115,116,32,98,97,108,97,110,99,101,61,97,119,97,105,116,32,109,115,103,46,115,116,97,116,105,99,67,97,108,108,40,116,104,105,115,46,99,117,114,114,101,110,99,121,44,34,98,97,108,97,110,99,101,79,102,34,44,91,109,115,103,46,115,101,110,100,101,114,93,41,59,105,102,40,98,97,108,97,110,99,101,60,116,104,105,115,46,109,105,110,105,109,117,109,66,97,108,97,110,99,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,98,97,108,97,110,99,101,32,116,111,32,108,111,119,33,32,103,111,116,58,32,36,123,98,97,108,97,110,99,101,125,32,110,101,101,100,58,32,36,123,116,104,105,115,46,35,109,105,110,105,109,117,109,66,97,108,97,110,99,101,125,96,41,59,116,104,105,115,46,35,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,43,61,49,44,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,91,118,97,108,105,100,97,116,111,114,93,61,123,102,105,114,115,116,83,101,101,110,58,40,110,101,119,32,68,97,116,101,41,46,103,101,116,84,105,109,101,40,41,44,97,99,116,105,118,101,58,33,48,125,125,114,101,109,111,118,101,86,97,108,105,100,97,116,111,114,40,118,97,108,105,100,97,116,111,114,41,123,105,102,40,33,116,104,105,115,46,104,97,115,40,118,97,108,105,100,97,116,111,114,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,118,97,108,105,100,97,116,111,114,32,110,111,116,32,102,111,117,110,100,34,41,59,116,104,105,115,46,35,116,111,116,97,108,86,97,108,105,100,97,116,111,114,115,45,61,49,44,100,101,108,101,116,101,32,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,91,118,97,108,105,100,97,116,111,114,93,125,97,115,121,110,99,32,117,112,100,97,116,101,86,97,108,105,100,97,116,111,114,40,118,97,108,105,100,97,116,111,114,44,97,99,116,105,118,101,41,123,105,102,40,33,116,104,105,115,46,104,97,115,40,118,97,108,105,100,97,116,111,114,41,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,34,118,97,108,105,100,97,116,111,114,32,110,111,116,32,102,111,117,110,100,34,41,59,99,111,110,115,116,32,98,97,108,97,110,99,101,61,97,119,97,105,116,32,109,115,103,46,115,116,97,116,105,99,67,97,108,108,40,116,104,105,115,46,99,117,114,114,101,110,99,121,44,34,98,97,108,97,110,99,101,79,102,34,44,91,109,115,103,46,115,101,110,100,101,114,93,41,59,105,102,40,98,97,108,97,110,99,101,60,116,104,105,115,46,109,105,110,105,109,117,109,66,97,108,97,110,99,101,38,38,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,91,118,97,108,105,100,97,116,111,114,93,46,97,99,116,105,118,101,38,38,40,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,91,118,97,108,105,100,97,116,111,114,93,46,97,99,116,105,118,101,61,33,49,41,44,98,97,108,97,110,99,101,60,116,104,105,115,46,109,105,110,105,109,117,109,66,97,108,97,110,99,101,41,116,104,114,111,119,32,110,101,119,32,69,114,114,111,114,40,96,98,97,108,97,110,99,101,32,116,111,32,108,111,119,33,32,103,111,116,58,32,36,123,98,97,108,97,110,99,101,125,32,110,101,101,100,58,32,36,123,116,104,105,115,46,35,109,105,110,105,109,117,109,66,97,108,97,110,99,101,125,96,41,59,116,104,105,115,46,35,118,97,108,105,100,97,116,111,114,115,91,118,97,108,105,100,97,116,111,114,93,46,97,99,116,105,118,101,61,97,99,116,105,118,101,125,125,59,10,26,58,98,97,53,120,100,97,100,102,109,98,54,102,119,52,50,106,50,112,97,122,55,51,52,112,117,98,122,119,120,110,55,114,103,105,119,119,109,103,115,51,100,99,105,99,114,52,117,50,101,107,104,113,101,118,113,118,99,117"
|
|
6
|
-
}
|
package/src/lib.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import ContractMessage from './messages/contract'
|
|
2
|
-
import TransactionMessage from './messages/transaction'
|
|
3
|
-
import BlockMessage from './messages/block'
|
|
4
|
-
import BWMessage from './messages/bw'
|
|
5
|
-
import BWRequestMessage from './messages/bw-request'
|
|
6
|
-
import bs58 from '@vandeurenglenn/base58'
|
|
7
|
-
import bytecodes from './bytecodes.json'
|
|
8
|
-
import addresses from './addresses.json'
|
|
9
|
-
|
|
10
|
-
const { contractFactory, nativeToken, nameService, validators } = addresses
|
|
11
|
-
|
|
12
|
-
const contractFactoryMessage = new Uint8Array(bytecodes.contractFactory.split(','))
|
|
13
|
-
const nativeTokenMessage = new Uint8Array(bytecodes.nativeToken.split(','))
|
|
14
|
-
|
|
15
|
-
const nameServiceMessage = new Uint8Array(bytecodes.nameService.split(','))
|
|
16
|
-
const validatorsMessage = new Uint8Array(bytecodes.validators.split(','))
|
|
17
|
-
|
|
18
|
-
const calculateFee = transaction => {
|
|
19
|
-
// excluded from fees
|
|
20
|
-
if (transaction.decoded.to === validators) return 0
|
|
21
|
-
// fee per gb
|
|
22
|
-
let fee = transaction.encoded.length
|
|
23
|
-
fee = fee / 1024
|
|
24
|
-
fee = fee / 1000000
|
|
25
|
-
const parts = String(fee).split('.')
|
|
26
|
-
let decimals = 0
|
|
27
|
-
if (parts[1]) {
|
|
28
|
-
const potentional = parts[1].split('e')
|
|
29
|
-
parts[1] = potentional[0]
|
|
30
|
-
decimals = Number(potentional[1].replace(/\-|\+/g, '')) + Number(potentional[0].length)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return Number.parseFloat(fee.toString()).toFixed(decimals)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const calculateTransactionFee = transaction => {
|
|
37
|
-
transaction = new TransactionMessage(transaction)
|
|
38
|
-
return calculateFee(transaction)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const calculateReward = (validators, fees) => {
|
|
42
|
-
validators = Object.keys(validators).reduce((set, key) => {
|
|
43
|
-
if (validators[key].active) set.push({
|
|
44
|
-
address: key,
|
|
45
|
-
reward: 0
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
}, [])
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export default {
|
|
52
|
-
nativeToken,
|
|
53
|
-
nameService,
|
|
54
|
-
contractFactory,
|
|
55
|
-
validators,
|
|
56
|
-
contractFactoryMessage,
|
|
57
|
-
nativeTokenMessage,
|
|
58
|
-
nameServiceMessage,
|
|
59
|
-
validatorsMessage,
|
|
60
|
-
TransactionMessage,
|
|
61
|
-
ContractMessage,
|
|
62
|
-
BlockMessage,
|
|
63
|
-
BWMessage,
|
|
64
|
-
BWRequestMessage,
|
|
65
|
-
calculateFee,
|
|
66
|
-
calculateTransactionFee
|
|
67
|
-
}
|
package/src/messages/block.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import protons from 'protons'
|
|
2
|
-
import proto from './../protos/block.proto.js'
|
|
3
|
-
import { FormatInterface as CodecFormat } from '@leofcoin/codec-format-interface'
|
|
4
|
-
|
|
5
|
-
export default class BlockMessage extends CodecFormat {
|
|
6
|
-
get keys() {
|
|
7
|
-
return ['index', 'previousHash', 'timestamp', 'reward', 'fees', 'transactions', 'validators']
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
constructor(buffer) {
|
|
11
|
-
const name = 'block-message'
|
|
12
|
-
super(buffer, protons(proto).BlockMessage, {name})
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import protons from 'protons'
|
|
2
|
-
import proto from './../protos/bw-request.proto.js'
|
|
3
|
-
import {FormatInterface as CodecFormat} from '@leofcoin/codec-format-interface'
|
|
4
|
-
|
|
5
|
-
export default class BWRequestMessage extends CodecFormat {
|
|
6
|
-
get keys() {
|
|
7
|
-
return []
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
constructor(buffer) {
|
|
11
|
-
const name = 'bw-request-message'
|
|
12
|
-
super(buffer, protons(proto).BWRequestMessage, {name})
|
|
13
|
-
}
|
|
14
|
-
}
|
package/src/messages/bw.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import protons from 'protons'
|
|
2
|
-
import proto from './../protos/bw.proto.js'
|
|
3
|
-
import { FormatInterface as CodecFormat } from '@leofcoin/codec-format-interface'
|
|
4
|
-
|
|
5
|
-
export default class BWMessage extends CodecFormat {
|
|
6
|
-
get keys() {
|
|
7
|
-
return ['up', 'down']
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
constructor(buffer) {
|
|
11
|
-
const name = 'bw-message'
|
|
12
|
-
super(buffer, protons(proto).BWMessage, {name})
|
|
13
|
-
}
|
|
14
|
-
}
|
package/src/messages/contract.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import protons from 'protons'
|
|
2
|
-
import proto from './../protos/contract.proto.js'
|
|
3
|
-
import { FormatInterface as CodecFormat } from '@leofcoin/codec-format-interface'
|
|
4
|
-
|
|
5
|
-
export default class ContractMessage extends CodecFormat {
|
|
6
|
-
get keys() {
|
|
7
|
-
return ['creator', 'contract', 'constructorParameters']
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
constructor(buffer) {
|
|
11
|
-
super(buffer, protons(proto).ContractMessage, {name: 'contract-message'})
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import protons from 'protons'
|
|
2
|
-
import proto from './../protos/last-block-request.proto.js'
|
|
3
|
-
import { FormatInterface as CodecFormat } from '@leofcoin/codec-format-interface'
|
|
4
|
-
|
|
5
|
-
export default class LastBlockRequestMessage extends CodecFormat {
|
|
6
|
-
get keys() {
|
|
7
|
-
return []
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
constructor(buffer) {
|
|
11
|
-
const name = 'last-block-request-message'
|
|
12
|
-
super(buffer, protons(proto).LastBlockRequestMessage, {name})
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import protons from 'protons'
|
|
2
|
-
import proto from './../protos/last-block.proto.js'
|
|
3
|
-
import { FormatInterface as CodecFormat } from '@leofcoin/codec-format-interface'
|
|
4
|
-
|
|
5
|
-
export default class LastBlockMessage extends CodecFormat {
|
|
6
|
-
get keys() {
|
|
7
|
-
return ['hash', 'index']
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
constructor(buffer) {
|
|
11
|
-
const name = 'last-block-message'
|
|
12
|
-
super(buffer, protons(proto).LastBlockMessage, {name})
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import protons from 'protons'
|
|
2
|
-
import proto from './../protos/transaction.proto.js'
|
|
3
|
-
import { FormatInterface as CodecFormat } from '@leofcoin/codec-format-interface'
|
|
4
|
-
|
|
5
|
-
export default class TransactionMessage extends CodecFormat {
|
|
6
|
-
get keys() {
|
|
7
|
-
return ['timestamp', 'from', 'to', 'nonce', 'method', 'params']
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
constructor(buffer) {
|
|
11
|
-
const name = 'transaction-message'
|
|
12
|
-
super(buffer, protons(proto).TransactionMessage, {name})
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default `
|
|
2
|
-
message ValidatorMessage {
|
|
3
|
-
required string address = 1;
|
|
4
|
-
required string reward = 2;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
message Transaction {
|
|
8
|
-
required string hash = 1;
|
|
9
|
-
required uint64 timestamp = 2;
|
|
10
|
-
required string from = 3;
|
|
11
|
-
required string to = 4;
|
|
12
|
-
required uint64 nonce = 5;
|
|
13
|
-
required string method = 6;
|
|
14
|
-
repeated string params = 7;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
message BlockMessage {
|
|
18
|
-
required uint64 index = 1;
|
|
19
|
-
required string previousHash = 3;
|
|
20
|
-
required uint64 timestamp = 4;
|
|
21
|
-
required uint64 reward = 5;
|
|
22
|
-
required string fees = 6;
|
|
23
|
-
repeated Transaction transactions = 7;
|
|
24
|
-
repeated ValidatorMessage validators = 8;
|
|
25
|
-
}
|
|
26
|
-
`
|
package/src/protos/bw.proto.js
DELETED
package/src/utils/utils.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// import { promisify } from 'util'
|
|
2
|
-
// import { writeFile, readFile } from 'fs'
|
|
3
|
-
export { BigNumber } from "@ethersproject/bignumber";
|
|
4
|
-
export { formatUnits, parseUnits } from '@ethersproject/units'
|
|
5
|
-
|
|
6
|
-
// export const write = promisify(writeFile)
|
|
7
|
-
// export const read = promisify(readFile)
|