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