mutations.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import NP from 'number-precision'
  2. export const mutations = {
  3. setScatter (state, scatter) {
  4. state.scatter = scatter
  5. },
  6. setEos (state, eosjs) {
  7. state.eos = eosjs
  8. },
  9. setAccount (state, account) {
  10. state.account = account
  11. },
  12. setToAccount (state, name) {
  13. state.toAccount = name
  14. },
  15. setBalance (state, balance) {
  16. state.balance = balance
  17. },
  18. setMoney (state, money) {
  19. state.money = money
  20. },
  21. setGt (state, gt) {
  22. state.gt = gt
  23. },
  24. updateBalance (state, amount) {
  25. state.balance = NP.plus(state.balance, amount)
  26. },
  27. updateMoney (state, amount) {
  28. state.money = NP.plus(state.money, amount)
  29. },
  30. updateGt (state, amount) {
  31. state.gt = NP.plus(state.gt, amount)
  32. },
  33. setMainnet (state, mainnet) {
  34. state.mainnet = mainnet
  35. },
  36. setAuction (state, auctionInfo) {
  37. state.auctionInfo = auctionInfo
  38. },
  39. setInvitee (state, invitee) {
  40. state.invitee = invitee
  41. },
  42. setGTError (state, count) {
  43. state.gtErrorCount = count
  44. },
  45. setEOSError (state, count) {
  46. state.eosErrorCount = count
  47. },
  48. setLimit (state, data) {
  49. state.limit = {
  50. cpu: data.cpu,
  51. net: data.net
  52. }
  53. },
  54. setPublicKey (state, string) {
  55. state.publicKey = string
  56. },
  57. setGtRate (state, string) {
  58. state.gtRate = string
  59. },
  60. setNewOffer (state, newOffer) {
  61. state.newOffer = newOffer
  62. },
  63. setNewOpen (state, newOpen) {
  64. state.newOpen = newOpen
  65. }
  66. }