@leofcoin/chain 1.0.12 → 1.0.13
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/node.browser.js +1046 -1048
- package/dist/node.browser.min.js +1 -1
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/chain.js.html +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/contracts_factory.js.html +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/contracts_nameService.js.html +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/contracts_proxies_factoryProxy.js.html +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/contracts_proxies_nameServiceProxy.js.html +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/contracts_proxies_nativeTokenProxy.js.html +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/contracts_proxies_validatorsProxy.js.html +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/contracts_proxies_votingProxy.js.html +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/contracts_validators.js.html +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-Bold-webfont.svg +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-BoldItalic-webfont.svg +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-Italic-webfont.svg +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-Light-webfont.svg +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-LightItalic-webfont.svg +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-Regular-webfont.svg +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-Semibold-webfont.eot +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-Semibold-webfont.svg +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-Semibold-webfont.ttf +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-Semibold-webfont.woff +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-SemiboldItalic-webfont.svg +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/global.html +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/icons/home.svg +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/icons/search.svg +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/index.html +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/machine.js.html +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/scripts/linenumber.js +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/scripts/pagelocation.js +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/standards_roles.js.html +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/standards_token.js.html +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/styles/collapse.css +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/styles/jsdoc-default.css +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/styles/prettify-jsdoc.css +0 -0
- package/docs/@leofcoin/chain/{1.0.10 → 1.0.12}/styles/prettify-tomorrow.css +0 -0
- package/package.json +2 -2
- package/rollup.config.js +0 -42
- package/_node.js +0 -1
- package/chain.js +0 -938
- package/docs/@leofcoin/chain/1.0.11/chain.js.html +0 -738
- package/docs/@leofcoin/chain/1.0.11/contracts_factory.js.html +0 -182
- package/docs/@leofcoin/chain/1.0.11/contracts_nameService.js.html +0 -231
- package/docs/@leofcoin/chain/1.0.11/contracts_proxies_factoryProxy.js.html +0 -135
- package/docs/@leofcoin/chain/1.0.11/contracts_proxies_nameServiceProxy.js.html +0 -135
- package/docs/@leofcoin/chain/1.0.11/contracts_proxies_nativeTokenProxy.js.html +0 -135
- package/docs/@leofcoin/chain/1.0.11/contracts_proxies_validatorsProxy.js.html +0 -135
- package/docs/@leofcoin/chain/1.0.11/contracts_proxies_votingProxy.js.html +0 -135
- package/docs/@leofcoin/chain/1.0.11/contracts_validators.js.html +0 -242
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-Bold-webfont.svg +0 -1830
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-Italic-webfont.svg +0 -1830
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-Light-webfont.svg +0 -1831
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-Regular-webfont.svg +0 -1831
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-Semibold-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-Semibold-webfont.svg +0 -1830
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-Semibold-webfont.ttf +0 -0
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-Semibold-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-SemiboldItalic-webfont.svg +0 -1830
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
- package/docs/@leofcoin/chain/1.0.11/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
- package/docs/@leofcoin/chain/1.0.11/global.html +0 -1153
- package/docs/@leofcoin/chain/1.0.11/icons/home.svg +0 -4
- package/docs/@leofcoin/chain/1.0.11/icons/search.svg +0 -4
- package/docs/@leofcoin/chain/1.0.11/index.html +0 -125
- package/docs/@leofcoin/chain/1.0.11/machine.js.html +0 -252
- package/docs/@leofcoin/chain/1.0.11/scripts/linenumber.js +0 -23
- package/docs/@leofcoin/chain/1.0.11/scripts/pagelocation.js +0 -89
- package/docs/@leofcoin/chain/1.0.11/standards_roles.js.html +0 -188
- package/docs/@leofcoin/chain/1.0.11/standards_token.js.html +0 -260
- package/docs/@leofcoin/chain/1.0.11/styles/collapse.css +0 -27
- package/docs/@leofcoin/chain/1.0.11/styles/jsdoc-default.css +0 -953
- package/docs/@leofcoin/chain/1.0.11/styles/prettify-jsdoc.css +0 -111
- package/docs/@leofcoin/chain/1.0.11/styles/prettify-tomorrow.css +0 -138
- package/lib.js +0 -1
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/>
|
|
3
|
-
<path d="M0 0h24v24H0z" fill="none"/>
|
|
4
|
-
</svg>
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
|
|
8
|
-
<title>
|
|
9
|
-
Home - Documentation
|
|
10
|
-
</title>
|
|
11
|
-
|
|
12
|
-
<link href="https://www.braintreepayments.com/images/favicon-ccda0b14.png" rel="icon" type="image/png">
|
|
13
|
-
|
|
14
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/highlight.min.js"></script>
|
|
15
|
-
<script>hljs.initHighlightingOnLoad();</script>
|
|
16
|
-
|
|
17
|
-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
|
|
18
|
-
|
|
19
|
-
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
20
|
-
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
21
|
-
|
|
22
|
-
<link type="text/css" rel="stylesheet" href="styles/collapse.css">
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<!-- start Mixpanel -->
|
|
28
|
-
<script type="text/javascript">(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,
|
|
29
|
-
0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
|
|
30
|
-
for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);
|
|
31
|
-
mixpanel.init("1919205b2da72e4da3b9b6639b444d59");</script>
|
|
32
|
-
<!-- end Mixpanel -->
|
|
33
|
-
</head>
|
|
34
|
-
|
|
35
|
-
<body>
|
|
36
|
-
<svg style="display: none;">
|
|
37
|
-
<defs>
|
|
38
|
-
<symbol id="linkIcon" fill="#706d77" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
39
|
-
<path d="M0 0h24v24H0z" fill="none"/>
|
|
40
|
-
<path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/>
|
|
41
|
-
</symbol>
|
|
42
|
-
</defs>
|
|
43
|
-
</svg>
|
|
44
|
-
|
|
45
|
-
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
46
|
-
<label for="nav-trigger" class="navicon-button x">
|
|
47
|
-
<div class="navicon"></div>
|
|
48
|
-
</label>
|
|
49
|
-
|
|
50
|
-
<label for="nav-trigger" class="overlay"></label>
|
|
51
|
-
|
|
52
|
-
<div class="top-nav-wrapper">
|
|
53
|
-
<ul>
|
|
54
|
-
<li class="active" >
|
|
55
|
-
<a href="index.html">
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<svg fill="#0095dd" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
59
|
-
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
|
|
60
|
-
<path d="M0 0h24v24H0z" fill="none"/>
|
|
61
|
-
</svg>
|
|
62
|
-
|
|
63
|
-
</a>
|
|
64
|
-
</li>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
</ul>
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
<nav>
|
|
72
|
-
<h3 class="reference-title">
|
|
73
|
-
@leofcoin/chain
|
|
74
|
-
</h3>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
<h3>
|
|
78
|
-
Resources
|
|
79
|
-
</h3>
|
|
80
|
-
|
|
81
|
-
<a href="https://github.com/arteontoken/monorepo/chain">github</a>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
<h3 id="global-nav">Global</h3><ul><li><a href="global.html#addContract">addContract</a></li><li><a href="global.html#createTransaction">createTransaction</a></li><li><a href="global.html#createTransactionFrom">createTransactionFrom</a></li><li><a href="global.html#deployContract">deployContract</a></li><li><a href="global.html#lookup">lookup</a></li><li><a href="global.html#state">state</a></li></ul>
|
|
86
|
-
</nav>
|
|
87
|
-
|
|
88
|
-
<div id="main">
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
<section class="readme">
|
|
102
|
-
<article>
|
|
103
|
-
<p><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>.</p>
|
|
104
|
-
</article>
|
|
105
|
-
</section>
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
</div>
|
|
112
|
-
|
|
113
|
-
<br class="clear">
|
|
114
|
-
|
|
115
|
-
<footer>
|
|
116
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a>
|
|
117
|
-
</footer>
|
|
118
|
-
|
|
119
|
-
<script src="scripts/linenumber.js"></script>
|
|
120
|
-
<script src="scripts/pagelocation.js"></script>
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
</body>
|
|
125
|
-
</html>
|
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<!DOCTYPE html>
|
|
4
|
-
<html lang="en">
|
|
5
|
-
<head>
|
|
6
|
-
|
|
7
|
-
<meta charset="utf-8">
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
|
-
|
|
10
|
-
<title>
|
|
11
|
-
machine.js - Documentation
|
|
12
|
-
</title>
|
|
13
|
-
|
|
14
|
-
<link href="https://www.braintreepayments.com/images/favicon-ccda0b14.png" rel="icon" type="image/png">
|
|
15
|
-
|
|
16
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/highlight.min.js"></script>
|
|
17
|
-
<script>hljs.initHighlightingOnLoad();</script>
|
|
18
|
-
|
|
19
|
-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
|
|
20
|
-
|
|
21
|
-
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
22
|
-
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
23
|
-
|
|
24
|
-
<link type="text/css" rel="stylesheet" href="styles/collapse.css">
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<!-- start Mixpanel -->
|
|
30
|
-
<script type="text/javascript">(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,
|
|
31
|
-
0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
|
|
32
|
-
for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);
|
|
33
|
-
mixpanel.init("1919205b2da72e4da3b9b6639b444d59");</script>
|
|
34
|
-
<!-- end Mixpanel -->
|
|
35
|
-
</head>
|
|
36
|
-
|
|
37
|
-
<body>
|
|
38
|
-
<svg style="display: none;">
|
|
39
|
-
<defs>
|
|
40
|
-
<symbol id="linkIcon" fill="#706d77" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
41
|
-
<path d="M0 0h24v24H0z" fill="none"/>
|
|
42
|
-
<path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/>
|
|
43
|
-
</symbol>
|
|
44
|
-
</defs>
|
|
45
|
-
</svg>
|
|
46
|
-
|
|
47
|
-
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
48
|
-
<label for="nav-trigger" class="navicon-button x">
|
|
49
|
-
<div class="navicon"></div>
|
|
50
|
-
</label>
|
|
51
|
-
|
|
52
|
-
<label for="nav-trigger" class="overlay"></label>
|
|
53
|
-
|
|
54
|
-
<div class="top-nav-wrapper">
|
|
55
|
-
<ul>
|
|
56
|
-
<li >
|
|
57
|
-
<a href="index.html">
|
|
58
|
-
|
|
59
|
-
<svg fill="#6D6D6D" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
|
60
|
-
<path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/>
|
|
61
|
-
<path d="M0 0h24v24H0z" fill="none"/>
|
|
62
|
-
</svg>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
</a>
|
|
66
|
-
</li>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</ul>
|
|
71
|
-
</div>
|
|
72
|
-
|
|
73
|
-
<nav>
|
|
74
|
-
<h3 class="reference-title">
|
|
75
|
-
@leofcoin/chain
|
|
76
|
-
</h3>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<h3>
|
|
80
|
-
Resources
|
|
81
|
-
</h3>
|
|
82
|
-
|
|
83
|
-
<a href="https://github.com/arteontoken/monorepo/chain">github</a>
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
<h3 id="global-nav">Global</h3><ul><li><a href="global.html#addContract">addContract</a></li><li><a href="global.html#createTransaction">createTransaction</a></li><li><a href="global.html#createTransactionFrom">createTransactionFrom</a></li><li><a href="global.html#deployContract">deployContract</a></li><li><a href="global.html#lookup">lookup</a></li><li><a href="global.html#state">state</a></li></ul>
|
|
88
|
-
</nav>
|
|
89
|
-
|
|
90
|
-
<div id="main">
|
|
91
|
-
|
|
92
|
-
<h1 class="page-title">
|
|
93
|
-
machine.js
|
|
94
|
-
</h1>
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<section>
|
|
101
|
-
<article>
|
|
102
|
-
<pre class="prettyprint source linenums"><code>import vm from 'vm'
|
|
103
|
-
import ContractMessage from './messages/contract'
|
|
104
|
-
import TransactionMessage from './messages/transaction'
|
|
105
|
-
import lib from './lib'
|
|
106
|
-
// import State from './state'
|
|
107
|
-
|
|
108
|
-
export default class Machine {
|
|
109
|
-
#contracts = {}
|
|
110
|
-
#nonces = {}
|
|
111
|
-
constructor() {
|
|
112
|
-
return this.#init()
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
#createMessage(sender = peernet.id) {
|
|
116
|
-
return {
|
|
117
|
-
sender,
|
|
118
|
-
call: this.execute,
|
|
119
|
-
staticCall: this.get.bind(this)
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
async #init() {
|
|
124
|
-
// return
|
|
125
|
-
try {
|
|
126
|
-
let contracts = [
|
|
127
|
-
contractStore.get(lib.contractFactory),
|
|
128
|
-
contractStore.get(lib.nativeToken),
|
|
129
|
-
contractStore.get(lib.validators),
|
|
130
|
-
contractStore.get(lib.nameService)
|
|
131
|
-
]
|
|
132
|
-
|
|
133
|
-
contracts = await Promise.all(contracts)
|
|
134
|
-
for (const contract of contracts) {
|
|
135
|
-
const message = new ContractMessage(new Uint8Array(contract.buffer, contract.buffer.byteOffset, contract.buffer.byteLength))
|
|
136
|
-
await this.#runContract(message)
|
|
137
|
-
}
|
|
138
|
-
} catch (e) {
|
|
139
|
-
console.log(e);
|
|
140
|
-
}
|
|
141
|
-
// const transactions = await transactionStore.get()
|
|
142
|
-
// console.log({transactions});
|
|
143
|
-
// for (const key of Object.keys(transactions)) {
|
|
144
|
-
// const message = new TransactionMessage(transactions[key])
|
|
145
|
-
// console.log({message});
|
|
146
|
-
// const {from, to, method, params} = message.decoded
|
|
147
|
-
// globalThis.msg = this.#createMessage(from)
|
|
148
|
-
//
|
|
149
|
-
// console.log({from, to, method, params});
|
|
150
|
-
// await this.execute(to, method, params)
|
|
151
|
-
// }
|
|
152
|
-
return this
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
async #runContract(contractMessage) {
|
|
156
|
-
const params = contractMessage.decoded.constructorParameters
|
|
157
|
-
try {
|
|
158
|
-
|
|
159
|
-
const func = new Function(new TextDecoder().decode(contractMessage.decoded.contract))
|
|
160
|
-
const Contract = func()
|
|
161
|
-
|
|
162
|
-
globalThis.msg = this.#createMessage(contractMessage.decoded.creator)
|
|
163
|
-
// globalThis.msg = {sender: contractMessage.decoded.creator}
|
|
164
|
-
this.#contracts[contractMessage.hash] = new Contract(...params)
|
|
165
|
-
debug(`loaded contract: ${contractMessage.hash}`);
|
|
166
|
-
debug(`size: ${Math.round((contractMessage.encoded.length / 1024) * 100) / 100} kb`);
|
|
167
|
-
} catch (e) {
|
|
168
|
-
console.log(e);
|
|
169
|
-
console.warn(`removing contract ${contractMessage.hash}`);
|
|
170
|
-
await contractStore.delete(contractMessage.hash, contractMessage.encoded)
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* @params {ContractMessage} - contractMessage
|
|
176
|
-
*/
|
|
177
|
-
async addContract(contractMessage) {
|
|
178
|
-
if (!await contractStore.has(contractMessage.hash)) {
|
|
179
|
-
await contractStore.put(contractMessage.hash, contractMessage.encoded)
|
|
180
|
-
await this.#runContract(contractMessage)
|
|
181
|
-
return contractMessage.hash
|
|
182
|
-
}
|
|
183
|
-
throw new Error('duplicate contract')
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
async execute(contract, method, params) {
|
|
187
|
-
try {
|
|
188
|
-
let result
|
|
189
|
-
// don't execute the method on a proxy
|
|
190
|
-
if (this.#contracts[contract].fallback) {
|
|
191
|
-
result = this.#contracts[contract].fallback(method, params)
|
|
192
|
-
} else {
|
|
193
|
-
result = await this.#contracts[contract][method](...params)
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
// this.#state.put(result)
|
|
197
|
-
return result
|
|
198
|
-
} catch (e) {
|
|
199
|
-
throw e
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
addJob(contract, method, params, from, nonce) {
|
|
204
|
-
if (!this.#nonces[from]) this.#nonces[from] = nonce
|
|
205
|
-
if (nonce === this.#nonces[from] + 1) return this.#contracts[contract][method](...params)
|
|
206
|
-
// return setTimeout(() => {
|
|
207
|
-
// return this.addJob(contract, method, params, from, nonce)
|
|
208
|
-
// }, 50)
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
get(contract, method, params) {
|
|
212
|
-
let result
|
|
213
|
-
if (params?.length > 0) {
|
|
214
|
-
result = this.#contracts[contract][method](...params)
|
|
215
|
-
} else {
|
|
216
|
-
result = this.#contracts[contract][method]
|
|
217
|
-
}
|
|
218
|
-
return result
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
async delete(hash) {
|
|
222
|
-
return contractStore.delete(hash)
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
async deleteAll() {
|
|
226
|
-
let hashes = await contractStore.get()
|
|
227
|
-
hashes = Object.keys(hashes).map(hash => this.delete(hash))
|
|
228
|
-
return Promise.all(hashes)
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
</code></pre>
|
|
232
|
-
</article>
|
|
233
|
-
</section>
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
</div>
|
|
239
|
-
|
|
240
|
-
<br class="clear">
|
|
241
|
-
|
|
242
|
-
<footer>
|
|
243
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a>
|
|
244
|
-
</footer>
|
|
245
|
-
|
|
246
|
-
<script src="scripts/linenumber.js"></script>
|
|
247
|
-
<script src="scripts/pagelocation.js"></script>
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
</body>
|
|
252
|
-
</html>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
(function () {
|
|
4
|
-
var lineId, lines, totalLines, anchorHash;
|
|
5
|
-
var source = document.getElementsByClassName('prettyprint source linenums');
|
|
6
|
-
var i = 0;
|
|
7
|
-
var lineNumber = 0;
|
|
8
|
-
|
|
9
|
-
if (source && source[0]) {
|
|
10
|
-
anchorHash = document.location.hash.substring(1);
|
|
11
|
-
lines = source[0].getElementsByTagName('li');
|
|
12
|
-
totalLines = lines.length;
|
|
13
|
-
|
|
14
|
-
for (; i < totalLines; i++) {
|
|
15
|
-
lineNumber++;
|
|
16
|
-
lineId = 'line' + lineNumber;
|
|
17
|
-
lines[i].id = lineId;
|
|
18
|
-
if (lineId === anchorHash) {
|
|
19
|
-
lines[i].className += ' selected';
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
})();
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
$(document).ready(function () {
|
|
4
|
-
var currentSectionNav, target;
|
|
5
|
-
|
|
6
|
-
// If an anchor hash is in the URL highlight the menu item
|
|
7
|
-
highlightActiveHash();
|
|
8
|
-
// If a specific page section is in the URL highlight the menu item
|
|
9
|
-
highlightActiveSection();
|
|
10
|
-
|
|
11
|
-
// If a specific page section is in the URL scroll that section up to the top
|
|
12
|
-
currentSectionNav = $('#' + getCurrentSectionName() + '-nav');
|
|
13
|
-
|
|
14
|
-
if (currentSectionNav.position()) {
|
|
15
|
-
$('nav').scrollTop(currentSectionNav.position().top);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// function to scroll to anchor when clicking an anchor linl
|
|
19
|
-
$('a[href*="#"]:not([href="#"])').click(function () {
|
|
20
|
-
/* eslint-disable no-invalid-this */
|
|
21
|
-
if (location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '') && location.hostname === this.hostname) {
|
|
22
|
-
target = $(this.hash);
|
|
23
|
-
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
|
|
24
|
-
if (target.length) {
|
|
25
|
-
$('html, body').animate({
|
|
26
|
-
scrollTop: target.offset().top
|
|
27
|
-
}, 1000);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/* eslint-enable no-invalid-this */
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
// If a new anchor section is selected, change the hightlighted menu item
|
|
35
|
-
$(window).bind('hashchange', function (event) {
|
|
36
|
-
highlightActiveHash(event);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
function highlightActiveHash(event) {
|
|
40
|
-
var oldUrl, oldSubSectionElement;
|
|
41
|
-
|
|
42
|
-
// check for and remove old hash active state
|
|
43
|
-
if (event && event.originalEvent.oldURL) {
|
|
44
|
-
oldUrl = event.originalEvent.oldURL;
|
|
45
|
-
|
|
46
|
-
if (oldUrl.indexOf('#') > -1) {
|
|
47
|
-
oldSubSectionElement = $('#' + getCurrentSectionName() + '-' + oldUrl.substring(oldUrl.indexOf('#') + 1) + '-nav');
|
|
48
|
-
|
|
49
|
-
if (oldSubSectionElement) {
|
|
50
|
-
oldSubSectionElement.removeClass('active');
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (getCurrentHashName()) {
|
|
56
|
-
$('#' + getCurrentSectionName() + '-' + getCurrentHashName() + '-nav').addClass('active');
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function highlightActiveSection() {
|
|
61
|
-
var pageId = getCurrentSectionName();
|
|
62
|
-
|
|
63
|
-
$('#' + pageId + '-nav').addClass('active');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function getCurrentSectionName() {
|
|
67
|
-
var path = window.location.pathname;
|
|
68
|
-
var pageUrl = path.split('/').pop();
|
|
69
|
-
|
|
70
|
-
var sectionName = pageUrl.substring(0, pageUrl.indexOf('.'));
|
|
71
|
-
|
|
72
|
-
// remove the wodr module- if its in the url
|
|
73
|
-
sectionName = sectionName.replace('module-', '');
|
|
74
|
-
|
|
75
|
-
return sectionName;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function getCurrentHashName() {
|
|
79
|
-
var pageSubSectionId;
|
|
80
|
-
var pageSubSectionHash = window.location.hash;
|
|
81
|
-
|
|
82
|
-
if (pageSubSectionHash) {
|
|
83
|
-
pageSubSectionId = pageSubSectionHash.substring(1).replace('.', '');
|
|
84
|
-
|
|
85
|
-
return pageSubSectionId;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return false;
|
|
89
|
-
}
|