miner_js.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package api
  2. const Miner_JS = `
  3. web3._extend({
  4. property: 'miner',
  5. methods:
  6. [
  7. new web3._extend.Method({
  8. name: 'start',
  9. call: 'miner_start',
  10. params: 1,
  11. inputFormatter: [null]
  12. }),
  13. new web3._extend.Method({
  14. name: 'stop',
  15. call: 'miner_stop',
  16. params: 1,
  17. inputFormatter: [null]
  18. }),
  19. new web3._extend.Method({
  20. name: 'setEtherbase',
  21. call: 'miner_setEtherbase',
  22. params: 1,
  23. inputFormatter: [web3._extend.formatters.formatInputInt],
  24. outputFormatter: web3._extend.formatters.formatOutputBool
  25. }),
  26. new web3._extend.Method({
  27. name: 'setExtra',
  28. call: 'miner_setExtra',
  29. params: 1,
  30. inputFormatter: [null]
  31. }),
  32. new web3._extend.Method({
  33. name: 'setGasPrice',
  34. call: 'miner_setGasPrice',
  35. params: 1,
  36. inputFormatter: [web3._extend.utils.fromDecial]
  37. }),
  38. new web3._extend.Method({
  39. name: 'startAutoDAG',
  40. call: 'miner_startAutoDAG',
  41. params: 0,
  42. inputFormatter: []
  43. }),
  44. new web3._extend.Method({
  45. name: 'stopAutoDAG',
  46. call: 'miner_stopAutoDAG',
  47. params: 0,
  48. inputFormatter: []
  49. }),
  50. new web3._extend.Method({
  51. name: 'makeDAG',
  52. call: 'miner_makeDAG',
  53. params: 1,
  54. inputFormatter: [web3._extend.formatters.inputDefaultBlockNumberFormatter]
  55. })
  56. ],
  57. properties:
  58. [
  59. new web3._extend.Property({
  60. name: 'hashrate',
  61. getter: 'miner_hashrate',
  62. outputFormatter: web3._extend.utils.toDecimal
  63. })
  64. ]
  65. });
  66. `