-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.go
281 lines (251 loc) · 9.17 KB
/
models.go
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
package zb
// Code=1000 success
type GeneralResult struct {
Code int `json:"code"`
Message string `json:"message"`
}
type TickerData struct {
High float64 `json:"high,string"`
Vol float64 `json:"vol,string"`
Last float64 `json:"last,string"`
Low float64 `json:"low,string"`
Buy float64 `json:"buy,string"`
Sell float64 `json:"sell,string"`
}
type AllTicker map[string]TickerData
type Ticker struct {
Date int64 `json:"date,string"` // 1587952260502
Ticker TickerData `json:"ticker"`
}
type Depth struct {
Asks [][]float64 `json:"asks"`
Bids [][]float64 `json:"bids"`
Timestamp int64 `json:"timestamp"` // 1587953173
}
type Trade struct {
Amount float64 `json:"amount,string"`
Date int64 `json:"date"`
Price float64 `json:"price,string"`
Tid int64 `json:"tid"`
TradeType string `json:"trade_type"`
Type string `json:"type"`
}
type KLine struct {
Symbol string `json:"symbol"`
Data [][]float64 `json:"data"` // 时间戳(ms),Open,High,Low,Close,Volume
MoneyType string `json:"moneyType"`
}
type OrderResponse struct {
Code int `json:"code"`
Message string `json:"message"`
ID string `json:"id"`
}
type OrderMoreV2Response struct {
Code int `json:"code"`
Message string `json:"message"`
Data []int64 `json:"data"`
}
type Order struct {
Currency string `json:"currency"`
ID string `json:"id"`
Price float64 `json:"price"`
Status int `json:"status"`
TotalAmount float64 `json:"total_amount"`
TradeAmount float64 `json:"trade_amount"`
TradeDate int64 `json:"trade_date"`
TradeMoney float64 `json:"trade_money"`
Type int `json:"type"`
}
type AccountInfoCoin struct {
IsCanWithdraw bool `json:"isCanWithdraw"`
CanLoan bool `json:"canLoan"`
FundsType int `json:"fundstype"`
ShowName string `json:"showName"`
IsCanRecharge bool `json:"isCanRecharge"`
CnName string `json:"cnName"`
EnName string `json:"enName"`
Available float64 `json:"available,string"`
FreeZ float64 `json:"freez,string"`
UnitTag string `json:"unitTag"`
Key string `json:"key"`
UnitDecimal int `json:"unitDecimal"`
}
type AccountInfoBase struct {
AuthGoogleEnabled bool `json:"auth_google_enabled"`
AuthMobileEnabled bool `json:"auth_mobile_enabled"`
TradePasswordEnabled bool `json:"trade_password_enabled"`
Username string `json:"username"`
}
type AccountInfoResult struct {
Coins []AccountInfoCoin `json:"coins"`
Version int64 `json:"version"`
Base AccountInfoBase `json:"base"`
}
type AccountInfo struct {
Result AccountInfoResult `json:"result"`
LeverPerm bool `json:"leverPerm"`
OtcPerm bool `json:"otcPerm"`
AssetPerm bool `json:"assetPerm"`
MoneyPerm bool `json:"moneyPerm"`
SubUserPerm bool `json:"subUserPerm"`
EntrustPerm bool `json:"entrustPerm"`
}
type LeverAssetsInfoLever struct {
TotalConvertCNY string `json:"totalConvertCNY"`
LoanOutConvertUSD string `json:"loanOutConvertUSD"`
UnwindPrice string `json:"unwindPrice"`
FOverdraft string `json:"fOverdraft"`
FShowName string `json:"fShowName"`
StatusShow string `json:"statusShow"`
RepayLeverShow string `json:"repayLeverShow"`
CCanLoanIn int `json:"cCanLoanIn"`
FLoanIn string `json:"fLoanIn"`
COverdraft string `json:"cOverdraft"`
NetConvertUSD string `json:"netConvertUSD"`
LoanInConvertCNY string `json:"loanInConvertCNY"`
Key string `json:"key"`
FUnitDecimal int `json:"fUnitDecimal"`
RepayLevel int `json:"repayLevel"`
ShowName string `json:"showName"`
LoanInConvertUSD string `json:"loanInConvertUSD"`
Level int `json:"level"`
NetConvertCNY string `json:"netConvertCNY"`
CFreeze string `json:"cFreeze"`
CUnitTag string `json:"cUnitTag"`
CouldTransferOutCoin string `json:"couldTransferOutCoin"`
TotalConvertUSD string `json:"totalConvertUSD"`
CEnName string `json:"cEnName"`
LoanOutConvertCNY string `json:"loanOutConvertCNY"`
FAvailable string `json:"fAvailable"`
FEnName string `json:"fEnName"`
CShowName string `json:"cShowName"`
LeverMultiple string `json:"leverMultiple"`
CouldTransferOutFiat string `json:"couldTransferOutFiat"`
FFreeze string `json:"fFreeze"`
FCanLoanIn float64 `json:"fCanLoanIn"`
CLoanOut string `json:"cLoanOut"`
CUnitDecimal float64 `json:"cUnitDecimal"`
CLoanIn string `json:"cLoanIn"`
CAvailable string `json:"cAvailable"`
FLoanOut string `json:"fLoanOut"`
RepayLock bool `json:"repayLock"`
Status int `json:"status"`
}
type LeverAssetsInfoDatas struct {
LeverPerm bool `json:"leverPerm"`
Levers []LeverAssetsInfoLever `json:"levers"`
}
type LeverAssetsInfoData struct {
Des string `json:"des"`
IsSuc bool `json:"isSuc"`
Datas LeverAssetsInfoDatas `json:"datas"`
}
type LeverAssetsInfo struct {
Code int `json:"code"`
Message LeverAssetsInfoData `json:"message"`
}
type Loan struct {
Amount float64 `json:"amount,string"`
Balance float64 `json:"balance,string"`
CoinName string `json:"coinName"` // QC
RepaymentDay int `json:"repaymentDay"`
InterestRateOfDay float64 `json:"interestRateOfDay,string"`
LowestAmount float64 `json:"lowestAmount"`
RateOfDayShow string `json:"rateOfDayShow"` // 0.05 %
}
type LoansResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Result []Loan `json:"result"`
}
type LoanRecord struct {
CreateTime int64 `json:"createTime"`
StatusShow string `json:"statusShow"`
FreezID string `json:"freezId"`
Tstatus int `json:"tstatus"`
WithoutLxAmount string `json:"withoutLxAmount"`
InvestMark bool `json:"investMark"`
WithoutLxDays int `json:"withoutLxDays"`
HasRepay string `json:"hasRepay"`
Amount string `json:"amount"`
ID int64 `json:"id"`
FwfScale string `json:"fwfScale"`
Rate string `json:"rate"`
MarketName string `json:"marketName"`
HasLx string `json:"hasLx"`
IsIn bool `json:"isIn"`
BalanceAmount string `json:"balanceAmount"`
FundType int `json:"fundType"`
OutUserID int64 `json:"outUserId"`
InUserID int64 `json:"inUserId"`
RepayDate int64 `json:"repayDate"`
ZheLx string `json:"zheLx"`
OutUserFees string `json:"outUserFees"`
DikouLx string `json:"dikouLx"`
SourceType int `json:"sourceType"`
CoinName string `json:"coinName"`
Reward string `json:"reward"`
Status int `json:"status"`
ArrearsLx string `json:"arrearsLx"`
BalanceWithoutLxDays int `json:"balanceWithoutLxDays"`
RiskManage int `json:"riskManage"`
RateAddVal string `json:"rateAddVal"`
OutUserName string `json:"outUserName"`
InUserName string `json:"inUserName"`
InUserLock bool `json:"inUserLock"`
RateForm int `json:"rateForm"`
LoanID int64 `json:"loanId"`
NextRepayDate int64 `json:"nextRepayDate"`
}
type LoanRecordResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Result []LoanRecord `json:"result"`
}
type Repayment struct {
BenJin string `json:"benJin"`
ID int64 `json:"id"`
StatusShow string `json:"statusShow"`
Status int `json:"status"`
LiXi string `json:"liXi"`
ActureDate int64 `json:"actureDate"`
}
type RepaymentsResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Result []Repayment `json:"result"`
}
type WSTickerData struct {
High float64 `json:"high,string"`
Vol float64 `json:"vol,string"`
Last float64 `json:"last,string"`
Low float64 `json:"low,string"`
Buy float64 `json:"buy,string"`
Sell float64 `json:"sell,string"`
}
type WSTicker struct {
Date int64 `json:"date,string"` // (ms)
Ticker WSTickerData `json:"ticker"`
DataType string `json:"dataType"`
Channel string `json:"channel"`
}
type WSDepth struct {
Asks [][]float64 `json:"asks"`
DataType string `json:"dataType"`
Bids [][]float64 `json:"bids"`
Channel string `json:"channel"`
Timestamp int64 `json:"timestamp"`
}
type WSTrade struct {
Date int64 `json:"date"`
Amount float64 `json:"amount,string"`
Price float64 `json:"price,string"`
TradeType string `json:"trade_type"`
Type string `json:"type"`
Tid int64 `json:"tid"`
}
type WSTrades struct {
Data []WSTrade `json:"data"`
DataType string `json:"dataType"`
Channel string `json:"channel"`
}