miner_js.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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: 'setExtra',
  21. call: 'miner_setExtra',
  22. params: 1,
  23. inputFormatter: [null]
  24. }),
  25. new web3._extend.Method({
  26. name: 'setGasPrice',
  27. call: 'miner_setGasPrice',
  28. params: 1,
  29. inputFormatter: [null]
  30. }),
  31. new web3._extend.Method({
  32. name: 'startAutoDAG',
  33. call: 'miner_startAutoDAG',
  34. params: 0,
  35. inputFormatter: []
  36. }),
  37. new web3._extend.Method({
  38. name: 'stopAutoDAG',
  39. call: 'miner_stopAutoDAG',
  40. params: 0,
  41. inputFormatter: []
  42. }),
  43. new web3._extend.Method({
  44. name: 'makeDAG',
  45. call: 'miner_makeDAG',
  46. params: 1,
  47. inputFormatter: [web3._extend.formatters.inputDefaultBlockNumberFormatter]
  48. })
  49. ],
  50. properties:
  51. [
  52. new web3._extend.Property({
  53. name: 'hashrate',
  54. getter: 'miner_hashrate',
  55. outputFormatter: web3._extend.utils.toDecimal
  56. })
  57. ]
  58. });
  59. `