eos.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import axios from '../httpDice'
  2. export default {
  3. /**
  4. * 转账EOS
  5. * @param {object} data
  6. * @param {string} data.transaction_id 充值交易id
  7. * @param {number} data.block_num 区块id
  8. * @param {string} data.player 用户名
  9. * @param {number} data.amount 充值数量,Eos * 10000
  10. * @param {string} data.appid 项目id
  11. */
  12. deposit (data) {
  13. return axios.request({
  14. url: 'eos/deposit',
  15. method: 'post',
  16. needLogin: true,
  17. data: data
  18. })
  19. },
  20. /**
  21. * 提现EOS
  22. * @param {Object} data
  23. */
  24. withDraw (data) {
  25. return axios.request({
  26. url: 'eos/withDraw',
  27. method: 'post',
  28. needLogin: true,
  29. data: data
  30. })
  31. },
  32. /**
  33. * 获取今天的剩余提现次数
  34. * @param {Object} params
  35. * @param {string} params.player 用户名
  36. */
  37. getLeftTimes (params) {
  38. return axios.request({
  39. url: 'eos/leftTimes',
  40. method: 'get',
  41. needLogin: true,
  42. params: params
  43. })
  44. },
  45. /**
  46. * 获取我的余额记录
  47. * @param {Object} params
  48. * @param {string} params.appid {sicbo, box}
  49. */
  50. getBalanceLog (params) {
  51. return axios.request({
  52. url: 'eos/balanceLog',
  53. method: 'get',
  54. needLogin: true,
  55. params: params
  56. })
  57. },
  58. /**
  59. * 抽奖上报交易信息
  60. * @param {Object} params
  61. */
  62. sendLuckTrx (params) {
  63. return axios.request({
  64. url: 'eos/luckdrawReport',
  65. method: 'post',
  66. data: params
  67. })
  68. },
  69. /**
  70. * 获取抽奖信息
  71. * @param {Object} params
  72. */
  73. getLuckInfo (params) {
  74. return axios.request({
  75. url: 'eos/luckdrawInfo',
  76. method: 'get',
  77. params
  78. })
  79. },
  80. /**
  81. * 提现合约上报交易信息
  82. * @param {Object} params
  83. */
  84. sendWithDraw (params) {
  85. return axios.request({
  86. url: 'eos/withdrawReport',
  87. method: 'post',
  88. data: params
  89. })
  90. }
  91. }