@leofcoin/chain 1.0.6 → 1.0.9

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.
Files changed (133) hide show
  1. package/.jsdoc.json +29 -0
  2. package/chain.js +21 -0
  3. package/dist/chain.browser.js +21 -0
  4. package/dist/chain.js +21 -0
  5. package/dist/node.browser.js +1058 -1083
  6. package/dist/node.browser.min.js +1 -1
  7. package/docs/@leofcoin/chain/1.0.7/chain.js.html +738 -0
  8. package/docs/@leofcoin/chain/1.0.7/contracts_factory.js.html +182 -0
  9. package/docs/@leofcoin/chain/1.0.7/contracts_nameService.js.html +231 -0
  10. package/docs/@leofcoin/chain/1.0.7/contracts_proxies_factoryProxy.js.html +135 -0
  11. package/docs/@leofcoin/chain/1.0.7/contracts_proxies_nameServiceProxy.js.html +135 -0
  12. package/docs/@leofcoin/chain/1.0.7/contracts_proxies_nativeTokenProxy.js.html +135 -0
  13. package/docs/@leofcoin/chain/1.0.7/contracts_proxies_validatorsProxy.js.html +135 -0
  14. package/docs/@leofcoin/chain/1.0.7/contracts_proxies_votingProxy.js.html +135 -0
  15. package/docs/@leofcoin/chain/1.0.7/contracts_validators.js.html +242 -0
  16. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-Bold-webfont.eot +0 -0
  17. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-Bold-webfont.svg +1830 -0
  18. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-Bold-webfont.woff +0 -0
  19. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  20. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
  21. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  22. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-Italic-webfont.eot +0 -0
  23. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-Italic-webfont.svg +1830 -0
  24. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-Italic-webfont.woff +0 -0
  25. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-Light-webfont.eot +0 -0
  26. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-Light-webfont.svg +1831 -0
  27. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-Light-webfont.woff +0 -0
  28. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  29. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
  30. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  31. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-Regular-webfont.eot +0 -0
  32. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-Regular-webfont.svg +1831 -0
  33. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-Regular-webfont.woff +0 -0
  34. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-Semibold-webfont.eot +0 -0
  35. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-Semibold-webfont.svg +1830 -0
  36. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-Semibold-webfont.ttf +0 -0
  37. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-Semibold-webfont.woff +0 -0
  38. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
  39. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-SemiboldItalic-webfont.svg +1830 -0
  40. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
  41. package/docs/@leofcoin/chain/1.0.7/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
  42. package/docs/@leofcoin/chain/1.0.7/global.html +1153 -0
  43. package/docs/@leofcoin/chain/1.0.7/icons/home.svg +4 -0
  44. package/docs/@leofcoin/chain/1.0.7/icons/search.svg +4 -0
  45. package/docs/@leofcoin/chain/1.0.7/index.html +125 -0
  46. package/docs/@leofcoin/chain/1.0.7/machine.js.html +252 -0
  47. package/docs/@leofcoin/chain/1.0.7/scripts/linenumber.js +23 -0
  48. package/docs/@leofcoin/chain/1.0.7/scripts/pagelocation.js +89 -0
  49. package/docs/@leofcoin/chain/1.0.7/standards_roles.js.html +188 -0
  50. package/docs/@leofcoin/chain/1.0.7/standards_token.js.html +260 -0
  51. package/docs/@leofcoin/chain/1.0.7/styles/collapse.css +27 -0
  52. package/docs/@leofcoin/chain/1.0.7/styles/jsdoc-default.css +953 -0
  53. package/docs/@leofcoin/chain/1.0.7/styles/prettify-jsdoc.css +111 -0
  54. package/docs/@leofcoin/chain/1.0.7/styles/prettify-tomorrow.css +138 -0
  55. package/docs/@leofcoin/chain/1.0.8/chain.js.html +738 -0
  56. package/docs/@leofcoin/chain/1.0.8/contracts_factory.js.html +182 -0
  57. package/docs/@leofcoin/chain/1.0.8/contracts_nameService.js.html +231 -0
  58. package/docs/@leofcoin/chain/1.0.8/contracts_proxies_factoryProxy.js.html +135 -0
  59. package/docs/@leofcoin/chain/1.0.8/contracts_proxies_nameServiceProxy.js.html +135 -0
  60. package/docs/@leofcoin/chain/1.0.8/contracts_proxies_nativeTokenProxy.js.html +135 -0
  61. package/docs/@leofcoin/chain/1.0.8/contracts_proxies_validatorsProxy.js.html +135 -0
  62. package/docs/@leofcoin/chain/1.0.8/contracts_proxies_votingProxy.js.html +135 -0
  63. package/docs/@leofcoin/chain/1.0.8/contracts_validators.js.html +242 -0
  64. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Bold-webfont.eot +0 -0
  65. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Bold-webfont.svg +1830 -0
  66. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Bold-webfont.woff +0 -0
  67. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  68. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
  69. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  70. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Italic-webfont.eot +0 -0
  71. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Italic-webfont.svg +1830 -0
  72. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Italic-webfont.woff +0 -0
  73. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Light-webfont.eot +0 -0
  74. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Light-webfont.svg +1831 -0
  75. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Light-webfont.woff +0 -0
  76. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  77. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
  78. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  79. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Regular-webfont.eot +0 -0
  80. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Regular-webfont.svg +1831 -0
  81. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Regular-webfont.woff +0 -0
  82. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Semibold-webfont.eot +0 -0
  83. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Semibold-webfont.svg +1830 -0
  84. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Semibold-webfont.ttf +0 -0
  85. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-Semibold-webfont.woff +0 -0
  86. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
  87. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-SemiboldItalic-webfont.svg +1830 -0
  88. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
  89. package/docs/@leofcoin/chain/1.0.8/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
  90. package/docs/@leofcoin/chain/1.0.8/global.html +1153 -0
  91. package/docs/@leofcoin/chain/1.0.8/icons/home.svg +4 -0
  92. package/docs/@leofcoin/chain/1.0.8/icons/search.svg +4 -0
  93. package/docs/@leofcoin/chain/1.0.8/index.html +125 -0
  94. package/docs/@leofcoin/chain/1.0.8/machine.js.html +252 -0
  95. package/docs/@leofcoin/chain/1.0.8/scripts/linenumber.js +23 -0
  96. package/docs/@leofcoin/chain/1.0.8/scripts/pagelocation.js +89 -0
  97. package/docs/@leofcoin/chain/1.0.8/standards_roles.js.html +188 -0
  98. package/docs/@leofcoin/chain/1.0.8/standards_token.js.html +260 -0
  99. package/docs/@leofcoin/chain/1.0.8/styles/collapse.css +27 -0
  100. package/docs/@leofcoin/chain/1.0.8/styles/jsdoc-default.css +953 -0
  101. package/docs/@leofcoin/chain/1.0.8/styles/prettify-jsdoc.css +111 -0
  102. package/docs/@leofcoin/chain/1.0.8/styles/prettify-tomorrow.css +138 -0
  103. package/out/@leofcoin/chain/1.0.7/chain.js.html +645 -0
  104. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Bold-webfont.eot +0 -0
  105. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Bold-webfont.svg +1830 -0
  106. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Bold-webfont.woff +0 -0
  107. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  108. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
  109. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  110. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Italic-webfont.eot +0 -0
  111. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Italic-webfont.svg +1830 -0
  112. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Italic-webfont.woff +0 -0
  113. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Light-webfont.eot +0 -0
  114. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Light-webfont.svg +1831 -0
  115. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Light-webfont.woff +0 -0
  116. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  117. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
  118. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  119. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Regular-webfont.eot +0 -0
  120. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Regular-webfont.svg +1831 -0
  121. package/out/@leofcoin/chain/1.0.7/fonts/OpenSans-Regular-webfont.woff +0 -0
  122. package/out/@leofcoin/chain/1.0.7/global.html +477 -0
  123. package/out/@leofcoin/chain/1.0.7/index.html +69 -0
  124. package/out/@leofcoin/chain/1.0.7/machine.js.html +180 -0
  125. package/out/@leofcoin/chain/1.0.7/scripts/linenumber.js +25 -0
  126. package/out/@leofcoin/chain/1.0.7/scripts/prettify/Apache-License-2.0.txt +202 -0
  127. package/out/@leofcoin/chain/1.0.7/scripts/prettify/lang-css.js +2 -0
  128. package/out/@leofcoin/chain/1.0.7/scripts/prettify/prettify.js +28 -0
  129. package/out/@leofcoin/chain/1.0.7/styles/jsdoc-default.css +358 -0
  130. package/out/@leofcoin/chain/1.0.7/styles/prettify-jsdoc.css +111 -0
  131. package/out/@leofcoin/chain/1.0.7/styles/prettify-tomorrow.css +132 -0
  132. package/package.json +6 -3
  133. package/src/chain.js +21 -0
package/.jsdoc.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "tags": {
3
+ "allowUnknownTags": true,
4
+ "dictionaries": ["jsdoc"]
5
+ },
6
+ "source": {
7
+ "include": ["src", "package.json", "README.md"],
8
+ "includePattern": ".js$",
9
+ "excludePattern": "(node_modules/|docs)"
10
+ },
11
+ "plugins": [
12
+ "plugins/markdown"
13
+ ],
14
+ "templates": {
15
+ "referenceTitle": "@leofcoin/chain",
16
+ "disableSort": false,
17
+ "collapse": true,
18
+ "resources": {
19
+ "github": "https://github.com/arteontoken/monorepo/chain"
20
+ }
21
+ },
22
+ "opts": {
23
+ "destination": "./docs/",
24
+ "encoding": "utf8",
25
+ "private": true,
26
+ "recurse": true,
27
+ "template": "./node_modules/jsdoc-template"
28
+ }
29
+ }
package/chain.js CHANGED
@@ -788,6 +788,11 @@ class Chain {
788
788
  *
789
789
  * example: [hash]
790
790
  * createTransaction('0x0', 'createContract', [hash])
791
+ *
792
+ * @param {String} to - the contract address for the contract to interact with
793
+ * @param {String} method - the method/function to run
794
+ * @param {Array} params - array of paramters to apply to the contract method
795
+ * @param {Number} nonce - total transaction count [optional]
791
796
  */
792
797
  createTransaction(to, method, params, nonce) {
793
798
  return this.createTransactionFrom(peernet.id, to, method, params, nonce)
@@ -796,6 +801,12 @@ class Chain {
796
801
  * every tx done is trough contracts so no need for amount
797
802
  * data is undefined when nothing is returned
798
803
  * error is thrown on error so undefined data doesn't mean there is an error...
804
+ *
805
+ * @param {String} from - the sender address
806
+ * @param {String} to - the contract address for the contract to interact with
807
+ * @param {String} method - the method/function to run
808
+ * @param {Array} params - array of paramters to apply to the contract method
809
+ * @param {Number} nonce - total transaction count [optional]
799
810
  */
800
811
  async createTransactionFrom(from, to, method, params, nonce) {
801
812
  if (nonce === undefined) {
@@ -840,6 +851,7 @@ class Chain {
840
851
 
841
852
  /**
842
853
  *
854
+ * @param {String} contract - a contract string (see plugins/deployContract)
843
855
  */
844
856
  async deployContract(contract, params = []) {
845
857
  globalThis.msg = {sender: peernet.id, call: this.call};
@@ -909,6 +921,15 @@ class Chain {
909
921
  return this.#machine.deleteAll()
910
922
  }
911
923
 
924
+ /**
925
+ * lookup an address for a registered name using the builtin nameService
926
+ * @check nameService
927
+ *
928
+ * @param {String} - contractName
929
+ * @returns {String} - address
930
+ *
931
+ * @example chain.lookup('myCoolContractName') // qmqsfddfdgfg...
932
+ */
912
933
  lookup(name) {
913
934
  return this.call(lib.nameService, 'lookup', [name])
914
935
  }
@@ -17908,6 +17908,11 @@ class Chain {
17908
17908
  *
17909
17909
  * example: [hash]
17910
17910
  * createTransaction('0x0', 'createContract', [hash])
17911
+ *
17912
+ * @param {String} to - the contract address for the contract to interact with
17913
+ * @param {String} method - the method/function to run
17914
+ * @param {Array} params - array of paramters to apply to the contract method
17915
+ * @param {Number} nonce - total transaction count [optional]
17911
17916
  */
17912
17917
  createTransaction(to, method, params, nonce) {
17913
17918
  return this.createTransactionFrom(peernet.id, to, method, params, nonce)
@@ -17916,6 +17921,12 @@ class Chain {
17916
17921
  * every tx done is trough contracts so no need for amount
17917
17922
  * data is undefined when nothing is returned
17918
17923
  * error is thrown on error so undefined data doesn't mean there is an error...
17924
+ *
17925
+ * @param {String} from - the sender address
17926
+ * @param {String} to - the contract address for the contract to interact with
17927
+ * @param {String} method - the method/function to run
17928
+ * @param {Array} params - array of paramters to apply to the contract method
17929
+ * @param {Number} nonce - total transaction count [optional]
17919
17930
  */
17920
17931
  async createTransactionFrom(from, to, method, params, nonce) {
17921
17932
  if (nonce === undefined) {
@@ -17960,6 +17971,7 @@ class Chain {
17960
17971
 
17961
17972
  /**
17962
17973
  *
17974
+ * @param {String} contract - a contract string (see plugins/deployContract)
17963
17975
  */
17964
17976
  async deployContract(contract, params = []) {
17965
17977
  globalThis.msg = {sender: peernet.id, call: this.call}
@@ -18029,6 +18041,15 @@ class Chain {
18029
18041
  return this.#machine.deleteAll()
18030
18042
  }
18031
18043
 
18044
+ /**
18045
+ * lookup an address for a registered name using the builtin nameService
18046
+ * @check nameService
18047
+ *
18048
+ * @param {String} - contractName
18049
+ * @returns {String} - address
18050
+ *
18051
+ * @example chain.lookup('myCoolContractName') // qmqsfddfdgfg...
18052
+ */
18032
18053
  lookup(name) {
18033
18054
  return this.call(lib.nameService, 'lookup', [name])
18034
18055
  }
package/dist/chain.js CHANGED
@@ -788,6 +788,11 @@ class Chain {
788
788
  *
789
789
  * example: [hash]
790
790
  * createTransaction('0x0', 'createContract', [hash])
791
+ *
792
+ * @param {String} to - the contract address for the contract to interact with
793
+ * @param {String} method - the method/function to run
794
+ * @param {Array} params - array of paramters to apply to the contract method
795
+ * @param {Number} nonce - total transaction count [optional]
791
796
  */
792
797
  createTransaction(to, method, params, nonce) {
793
798
  return this.createTransactionFrom(peernet.id, to, method, params, nonce)
@@ -796,6 +801,12 @@ class Chain {
796
801
  * every tx done is trough contracts so no need for amount
797
802
  * data is undefined when nothing is returned
798
803
  * error is thrown on error so undefined data doesn't mean there is an error...
804
+ *
805
+ * @param {String} from - the sender address
806
+ * @param {String} to - the contract address for the contract to interact with
807
+ * @param {String} method - the method/function to run
808
+ * @param {Array} params - array of paramters to apply to the contract method
809
+ * @param {Number} nonce - total transaction count [optional]
799
810
  */
800
811
  async createTransactionFrom(from, to, method, params, nonce) {
801
812
  if (nonce === undefined) {
@@ -840,6 +851,7 @@ class Chain {
840
851
 
841
852
  /**
842
853
  *
854
+ * @param {String} contract - a contract string (see plugins/deployContract)
843
855
  */
844
856
  async deployContract(contract, params = []) {
845
857
  globalThis.msg = {sender: peernet.id, call: this.call};
@@ -909,6 +921,15 @@ class Chain {
909
921
  return this.#machine.deleteAll()
910
922
  }
911
923
 
924
+ /**
925
+ * lookup an address for a registered name using the builtin nameService
926
+ * @check nameService
927
+ *
928
+ * @param {String} - contractName
929
+ * @returns {String} - address
930
+ *
931
+ * @example chain.lookup('myCoolContractName') // qmqsfddfdgfg...
932
+ */
912
933
  lookup(name) {
913
934
  return this.call(lib.nameService, 'lookup', [name])
914
935
  }