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