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.

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