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