admin_js.go 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. package api
  2. const Admin_JS = `
  3. web3._extend({
  4. property: 'admin',
  5. methods:
  6. [
  7. new web3._extend.Method({
  8. name: 'addPeer',
  9. call: 'admin_addPeer',
  10. params: 1,
  11. inputFormatter: [web3._extend.utils.formatInputString],
  12. outputFormatter: web3._extend.formatters.formatOutputBool
  13. }),
  14. new web3._extend.Method({
  15. name: 'exportChain',
  16. call: 'admin_exportChain',
  17. params: 1,
  18. inputFormatter: [web3._extend.utils.formatInputString],
  19. outputFormatter: function(obj) { return obj; }
  20. }),
  21. new web3._extend.Method({
  22. name: 'importChain',
  23. call: 'admin_importChain',
  24. params: 1,
  25. inputFormatter: [web3._extend.utils.formatInputString],
  26. outputFormatter: function(obj) { return obj; }
  27. }),
  28. new web3._extend.Method({
  29. name: 'sleepBlocks',
  30. call: 'admin_sleepBlocks',
  31. params: 2,
  32. inputFormatter: [web3._extend.utils.formatInputInt,web3._extend.utils.formatInputInt],
  33. outputFormatter: web3._extend.formatters.formatOutputInt
  34. }),
  35. new web3._extend.Method({
  36. name: 'verbosity',
  37. call: 'admin_verbosity',
  38. params: 1,
  39. inputFormatter: [web3._extend.utils.formatInputInt],
  40. outputFormatter: web3._extend.formatters.formatOutputBool
  41. }),
  42. new web3._extend.Method({
  43. name: 'setSolc',
  44. call: 'admin_setSolc',
  45. params: 1,
  46. inputFormatter: [web3._extend.utils.formatInputString],
  47. outputFormatter: web3._extend.formatters.formatOutputString
  48. }),
  49. new web3._extend.Method({
  50. name: 'startRPC',
  51. call: 'admin_startRPC',
  52. params: 4,
  53. inputFormatter: [web3._extend.utils.formatInputString,web3._extend.utils.formatInputInteger,web3._extend.utils.formatInputString,web3._extend.utils.formatInputString],
  54. outputFormatter: web3._extend.formatters.formatOutputBool
  55. }),
  56. new web3._extend.Method({
  57. name: 'stopRPC',
  58. call: 'admin_stopRPC',
  59. params: 2,
  60. inputFormatter: [],
  61. outputFormatter: web3._extend.formatters.formatOutputBool
  62. }),
  63. new web3._extend.Method({
  64. name: 'setGlobalRegistrar',
  65. call: 'admin_setGlobalRegistrar',
  66. params: 2,
  67. inputFormatter: [web3._extend.utils.formatInputString,web3._extend.utils.formatInputString],
  68. outputFormatter: web3._extend.formatters.formatOutputString
  69. }),
  70. new web3._extend.Method({
  71. name: 'setHashReg',
  72. call: 'admin_setHashReg',
  73. params: 2,
  74. inputFormatter: [web3._extend.utils.formatInputString,web3._extend.utils.formatInputString],
  75. outputFormatter: web3._extend.formatters.formatOutputString
  76. }),
  77. new web3._extend.Method({
  78. name: 'setUrlHint',
  79. call: 'admin_setUrlHint',
  80. params: 2,
  81. inputFormatter: [web3._extend.utils.formatInputString,web3._extend.utils.formatInputString],
  82. outputFormatter: web3._extend.formatters.formatOutputString
  83. }),
  84. new web3._extend.Method({
  85. name: 'saveInfo',
  86. call: 'admin_saveInfo',
  87. params: 2,
  88. inputFormatter: [function(obj) { return obj; },web3._extend.utils.formatInputString],
  89. outputFormatter: web3._extend.formatters.formatOutputString
  90. }),
  91. new web3._extend.Method({
  92. name: 'register',
  93. call: 'admin_register',
  94. params: 2,
  95. inputFormatter: [web3._extend.utils.formatInputString,web3._extend.utils.formatInputString],
  96. outputFormatter: web3._extend.formatters.formatOutputBool
  97. }),
  98. new web3._extend.Method({
  99. name: 'registerUrl',
  100. call: 'admin_registerUrl',
  101. params: 3,
  102. inputFormatter: [web3._extend.utils.formatInputString,web3._extend.utils.formatInputString,web3._extend.utils.formatInputString],
  103. outputFormatter: web3._extend.formatters.formatOutputBool
  104. }),
  105. new web3._extend.Method({
  106. name: 'startNatSpec',
  107. call: 'admin_startNatSpec',
  108. params: 0,
  109. inputFormatter: [],
  110. outputFormatter: web3._extend.formatters.formatOutputBool
  111. }),
  112. new web3._extend.Method({
  113. name: 'stopNatSpec',
  114. call: 'admin_stopNatSpec',
  115. params: 0,
  116. inputFormatter: [],
  117. outputFormatter: web3._extend.formatters.formatOutputBool
  118. }),
  119. new web3._extend.Method({
  120. name: 'getContractInfo',
  121. call: 'admin_getContractInfo',
  122. params: 1,
  123. inputFormatter: [web3._extend.utils.formatInputString],
  124. outputFormatter: function(obj) { return json.parse(obj); }
  125. }),
  126. new web3._extend.Method({
  127. name: 'httpGet',
  128. call: 'admin_httpGet',
  129. params: 2,
  130. inputFormatter: [web3._extend.utils.formatInputString,web3._extend.utils.formatInputString],
  131. outputFormatter: web3._extend.formatters.formatOutputString
  132. })
  133. ],
  134. properties:
  135. [
  136. new web3._extend.Property({
  137. name: 'nodeInfo',
  138. getter: 'admin_nodeInfo',
  139. outputFormatter: web3._extend.formatters.formatOutputString
  140. }),
  141. new web3._extend.Property({
  142. name: 'peers',
  143. getter: 'admin_peers',
  144. outputFormatter: function(obj) { return obj; }
  145. }),
  146. new web3._extend.Property({
  147. name: 'datadir',
  148. getter: 'admin_datadir',
  149. outputFormatter: web3._extend.formatters.formatOutputString
  150. }),
  151. new web3._extend.Property({
  152. name: 'chainSyncStatus',
  153. getter: 'admin_chainSyncStatus',
  154. outputFormatter: function(obj) { return obj; }
  155. })
  156. ]
  157. });
  158. `