-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructs.go
More file actions
217 lines (194 loc) · 4.19 KB
/
structs.go
File metadata and controls
217 lines (194 loc) · 4.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
package main
import (
"encoding/json"
"time"
"github.com/gorilla/websocket"
"github.com/lib/pq"
)
type NewSubtrade struct {
CreatedAt string `json:"CreatedAt"`
Type string `json:"Type"`
Reason string `json:"Reason"`
Quantity json.Number `json:"Quantity"`
AvgPrice json.Number `json:"AvgPrice"`
Total json.Number `json:"Total"`
UserWallet string
}
type NewTrade struct {
Exchange string `json:"Exchange"`
FirstPairId int `json:"FirstPair"`
SecondPairId int `json:"SecondPair"`
Subtrades []NewSubtrade `json:"Subtrades"`
UserWallet string
Code string
}
type WsTrade struct {
Observer User
Observed User
SessionId string
Channel chan TradesSnapshot
Ws *websocket.Conn
}
type Session struct {
Code string
UserWallet string
Origin string
Timezone string
CreatedAt time.Time
}
type User struct {
Wallet string
JoinTime string
Username string
Twitter string
Discord string
Github string
Privacy string
ProfilePicture string
Followers int
Followings int
Subscribers int
MonthlyFee string
Visibility VisibilityStatus
}
type Connection struct {
Observer User
Observed User
Privacy PrivacyStatus
IsFollower bool
IsSubscriber bool
}
type OnlineUser struct {
Wallet string
Observed []string
}
type OnlineUsers struct {
Count int
Users []OnlineUser
}
type DbListener struct {
Listener *pq.Listener
}
type UserWallet struct {
Wallet string `validate:"eth_addr"`
}
type PairInfo struct {
Symbol string
Name string
Slug string
}
type Follower struct {
ProfilePicture string
CountTrades int
Wallet string
}
type Following struct {
ProfilePicture string
CountTrades int
Wallet string
}
type Relations struct {
Followers []Follower
Following []Following
Privacy PrivacyStatus
}
type UserDetails struct {
Username string
Twitter string
Github string
Discord string
Followers int
Followings int
Subscribers int
ProfilePicture string
JoinTime string
}
type Subtrade struct {
Code string
TradeCode string
CreatedAt string
Type string
Reason string
Quantity float64
AvgPrice float64
Total float64
}
type Trade struct {
Code string
Username string
Userwallet string
Exchange string
FirstPairId int
SecondPairId int
FirstPairName string
SecondPairName string
FirstPairSymbol string
SecondPairSymbol string
FirstPairPrice float64
SecondPairPrice float64
FirstPairUrlIcon string
SecondPairUrlIcon string
CurrentPrice string
QtyBuys float64
QtySells float64
QtyAvailable string
TotalBuys float64
TotalBuysBtc float64
TotalBuysUsd float64
TotalSells float64
TotalSellsBtc float64
TotalSellsUsd float64
ActualReturn float64
FutureReturn float64
FutureReturnBtc float64
FutureReturnUsd float64
TotalReturn float64
TotalReturnS string
TotalReturnBtc float64
TotalReturnUsd float64
TotalValueUsd float64
TotalValueUsdS string
Roi float64
BtcPrice float64
Subtrades []Subtrade
}
type PrivacyStatus struct {
Status string
Reason string
Message string
}
type VisibilityStatus struct {
TotalCountTrades bool
TotalPortfolio bool
TotalReturn bool
TotalRoi bool
TradeQtyAvailable bool
TradeValue bool
TradeReturn bool
TradeRoi bool
SubtradesAll bool
SubtradeReasons bool
SubtradeQuantity bool
SubtradeAvgPrice bool
SubtradeTotal bool
}
type TradesSnapshot struct {
UserDetails UserDetails
PrivacyStatus PrivacyStatus
VisibilityStatus VisibilityStatus
IsFollower bool
IsSubscriber bool
Trades []Trade
CountTrades int
TotalReturnUsd string
TotalReturnBtc string
Roi float64
TotalPortfolioUsd string
}
type SmartContract struct {
Contract string `json:"contract"`
Event []struct {
Signature string `json:"signature"`
Name string `json:"name"`
} `json:"event"`
}