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