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.

130 lines
3.6 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 ChartCountModel struct {
  97. Elem int `json:"elem"`
  98. Count int `json:"count"`
  99. }
  100. type ChartAnalysisResp struct {
  101. Labels []string `json:"labels"`
  102. Data []int `json:"data"`
  103. }
  104. type ChartAnalysisRespFloat64 struct {
  105. Labels []string `json:"labels"`
  106. Data []float64 `json:"data"`
  107. }
  108. type ChartSeriesAnalysisResp struct {
  109. Labels []string `json:"labels"`
  110. Data [][]int `json:"data"`
  111. Series []int `json:"series"`
  112. }
  113. type DateCountModel struct {
  114. Time int64 `json:"time"`
  115. Date string `json:"date"`
  116. Count int `json:"count"`
  117. }
  118. type StatsModel struct {
  119. Title string `json:"title"`
  120. RealBlockCount int `json:"realblockcount"`
  121. BlockCount int `json:"blockcount"`
  122. TxCount int `json:"txcount"`
  123. AddrCount int `json:"addrcount"`
  124. }