You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
3.7 KiB

  1. package main
  2. import "time"
  3. type AddressModel struct {
  4. Hash string `json:"hash"`
  5. Amount float64 `json:"amount"`
  6. InBittrex bool `json:"inbittrex"`
  7. Txs []TxModel `json:"txs"`
  8. Blocks []BlockModel `json:"blocks"`
  9. }
  10. type DateModel struct {
  11. Hour int `json:"hour"`
  12. Day int `json:"day"`
  13. Month int `json:"month"`
  14. Year int `json:"year"`
  15. /*Amount float64 `json:"amount"`
  16. BlockHash string `json:"blockhash"`
  17. BlockHeight string `json:"blockheight"`*/
  18. }
  19. type Vin struct {
  20. Txid string `json:"txid"`
  21. Vout uint32 `json:"vout"`
  22. Amount float64 `json:"amount"`
  23. Address string `json:"address"`
  24. }
  25. type Vout struct {
  26. Value float64 `json:"value"`
  27. Address string `json:"address"`
  28. }
  29. type TxModel struct {
  30. Hex string `json:"hex"`
  31. Txid string `json:"txid"`
  32. Hash string `json:"hash"`
  33. /*From string `json:"from"` //hash of address
  34. To string `json:"to"` //hash of address*/
  35. Vin []Vin `json:"vin"`
  36. Vout []Vout `json:"vout"`
  37. Amount float64 `json:"amount"`
  38. BlockHash string `json:"blockhash"`
  39. BlockHeight string `json:"blockheight"`
  40. Time int64 `json:"time"`
  41. DateT time.Time `json:"datet"` //date formated
  42. Date DateModel
  43. }
  44. type BlockModel struct {
  45. Hash string `json:"hash"`
  46. Confirmations uint64 `json:"confirmations"`
  47. Size int32 `json:"size"`
  48. Height int64 `json:"height"`
  49. //Amount float64 `json:"amount"`
  50. //Fee float64 `json:"fee"`
  51. Tx []string `json:"txid"` //txid of the TxModel
  52. Txs []TxModel `json:"txs"`
  53. PreviousHash string `json:"previoushash"`
  54. NextHash string `json:"nexthash"`
  55. Time int64 `json:"time"`
  56. DateT time.Time `json:"datet"` //date formated
  57. Date DateModel
  58. }
  59. type NodeModel struct {
  60. Id string `json:"id"`
  61. Label string `json:"label"`
  62. Title string `json:"title"`
  63. Group string `json:"group"`
  64. Value int `json:"value"`
  65. Shape string `json:"shape"`
  66. Type string `json:"type"`
  67. }
  68. type EdgeModel struct {
  69. Txid string `json:"txid"`
  70. From string `json:"from"`
  71. To string `json:"to"`
  72. Label float64 `json:"label"` //the value of transaction
  73. Arrows string `json:"arrows"`
  74. BlockHeight int64 `json:"blockheight"`
  75. }
  76. type NetworkModel struct {
  77. Nodes []NodeModel `json:"nodes"`
  78. Edges []EdgeModel `json:"edges"`
  79. }
  80. type SankeyNodeModel struct {
  81. //StringNode string `json:"stringnode"`
  82. Node int `json:"node"`
  83. Name string `json:"name"`
  84. }
  85. type SankeyLinkModel struct {
  86. //StringSource string `json:"stringsource"`
  87. Source int `json:"source"`
  88. //StringTarget string `json:"stringtarget"`
  89. Target int `json:"target"`
  90. Value float64 `json:"value"`
  91. }
  92. type SankeyModel struct {
  93. Nodes []SankeyNodeModel `json:"nodes"`
  94. Links []SankeyLinkModel `json:"links"`
  95. }
  96. type ChartCountFloat64Model struct {
  97. Elem float64 `json:"elem"`
  98. Count int `json:"count"`
  99. }
  100. type ChartCountModel struct {
  101. Elem int `json:"elem"`
  102. Count int `json:"count"`
  103. }
  104. type ChartAnalysisResp struct {
  105. Labels []string `json:"labels"`
  106. Data []int `json:"data"`
  107. }
  108. type ChartAnalysisRespFloat64 struct {
  109. Labels []string `json:"labels"`
  110. Data []float64 `json:"data"`
  111. }
  112. type ChartSeriesAnalysisResp struct {
  113. Labels []string `json:"labels"`
  114. Data [][]int `json:"data"`
  115. Series []int `json:"series"`
  116. }
  117. type DateCountModel struct {
  118. Time int64 `json:"time"`
  119. Date string `json:"date"`
  120. Count int `json:"count"`
  121. }
  122. type StatsModel struct {
  123. Title string `json:"title"`
  124. RealBlockCount int `json:"realblockcount"`
  125. BlockCount int `json:"blockcount"`
  126. TxCount int `json:"txcount"`
  127. AddrCount int `json:"addrcount"`
  128. }