forked from openware/gocryptotrader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bithumb_types.go
292 lines (269 loc) · 8.7 KB
/
bithumb_types.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
282
283
284
285
286
287
288
289
290
291
292
package bithumb
import (
"encoding/json"
"github.com/thrasher-corp/gocryptotrader/currency"
)
// Ticker holds ticker data
type Ticker struct {
OpeningPrice float64 `json:"opening_price,string"`
ClosingPrice float64 `json:"closing_price,string"`
MinPrice float64 `json:"min_price,string"`
MaxPrice float64 `json:"max_price,string"`
UnitsTraded float64 `json:"units_traded,string"`
AccumulatedTradeValue float64 `json:"acc_trade_value,string"`
PreviousClosingPrice float64 `json:"prev_closing_price,string"`
UnitsTraded24Hr float64 `json:"units_traded_24H,string"`
AccumulatedTradeValue24hr float64 `json:"acc_trade_value_24H,string"`
Fluctuate24Hr float64 `json:"fluctate_24H,string"`
FluctuateRate24hr float64 `json:"fluctate_rate_24H,string"`
Date int64 `json:"date,string"`
}
// TickerResponse holds the standard ticker response
type TickerResponse struct {
Status string `json:"status"`
Data Ticker `json:"data"`
Message string `json:"message"`
}
// TickersResponse holds the standard ticker response
type TickersResponse struct {
Status string `json:"status"`
Data map[string]json.RawMessage `json:"data"`
Message string `json:"message"`
}
// Orderbook holds full range of order book information
type Orderbook struct {
Status string `json:"status"`
Data struct {
Timestamp int64 `json:"timestamp,string"`
OrderCurrency string `json:"order_currency"`
PaymentCurrency string `json:"payment_currency"`
Bids []struct {
Quantity float64 `json:"quantity,string"`
Price float64 `json:"price,string"`
} `json:"bids"`
Asks []struct {
Quantity float64 `json:"quantity,string"`
Price float64 `json:"price,string"`
} `json:"asks"`
} `json:"data"`
Message string `json:"message"`
}
// TransactionHistory holds history of completed transaction data
type TransactionHistory struct {
Status string `json:"status"`
Data []struct {
ContNumber int64 `json:"cont_no,string"`
TransactionDate string `json:"transaction_date"`
Type string `json:"type"`
UnitsTraded float64 `json:"units_traded,string"`
Price float64 `json:"price,string"`
Total float64 `json:"total,string"`
} `json:"data"`
Message string `json:"message"`
}
// Account holds account details
type Account struct {
Status string `json:"status"`
Data struct {
Created int64 `json:"created,string"`
AccountID string `json:"account_id"`
TradeFee float64 `json:"trade_fee,string"`
Balance float64 `json:"balance,string"`
} `json:"data"`
Message string `json:"message"`
}
// Balance holds balance details
type Balance struct {
Status string `json:"status"`
Data map[string]interface{} `json:"data"`
Message string `json:"message"`
}
// WalletAddressRes contains wallet address information
type WalletAddressRes struct {
Status string `json:"status"`
Data struct {
WalletAddress string `json:"wallet_address"`
Currency string `json:"currency"`
} `json:"data"`
Message string `json:"message"`
}
// LastTransactionTicker holds customer last transaction information
type LastTransactionTicker struct {
Status string `json:"status"`
Data struct {
OpeningPrice float64 `json:"opening_price,string"`
ClosingPrice float64 `json:"closing_price,string"`
MinPrice float64 `json:"min_price,string"`
MaxPrice float64 `json:"max_price,string"`
AveragePrice float64 `json:"average_price,string"`
UnitsTraded float64 `json:"units_traded,string"`
Volume1Day float64 `json:"volume_1day,string"`
Volume7Day float64 `json:"volume_7day,string"`
BuyPrice int64 `json:"buy_price,string"`
SellPrice int64 `json:"sell_price,string"`
Date int64 `json:"date,string"`
} `json:"data"`
Message string `json:"message"`
}
// Orders contains information about your current orders
type Orders struct {
Status string `json:"status"`
Data []OrderData `json:"data"`
Message string `json:"message"`
}
// OrderData contains all individual order details
type OrderData struct {
OrderID string `json:"order_id"`
OrderCurrency string `json:"order_currency"`
OrderDate int64 `json:"order_date"`
PaymentCurrency string `json:"payment_currency"`
Type string `json:"type"`
Status string `json:"status"`
Units float64 `json:"units,string"`
UnitsRemaining float64 `json:"units_remaining,string"`
Price float64 `json:"price,string"`
Fee float64 `json:"fee,string"`
Total float64 `json:"total,string"`
DateCompleted int64 `json:"date_completed"`
}
// UserTransactions holds users full transaction list
type UserTransactions struct {
Status string `json:"status"`
Data []struct {
Search string `json:"search"`
TransferDate int64 `json:"transfer_date"`
Units string `json:"units"`
Price float64 `json:"price,string"`
BTC1KRW float64 `json:"btc1krw,string"`
Fee string `json:"fee"`
BTCRemain float64 `json:"btc_remain,string"`
KRWRemain float64 `json:"krw_remain,string"`
} `json:"data"`
Message string `json:"message"`
}
// OrderPlace contains order information
type OrderPlace struct {
Status string `json:"status"`
Data []struct {
ContID string `json:"cont_id"`
Units float64 `json:"units,string"`
Price float64 `json:"price,string"`
Total float64 `json:"total,string"`
Fee float64 `json:"fee,string"`
} `json:"data"`
Message string `json:"message"`
}
// OrderDetails contains specific order information
type OrderDetails struct {
Status string `json:"status"`
Data []struct {
TransactionDate int64 `json:"transaction_date,string"`
Type string `json:"type"`
OrderCurrency string `json:"order_currency"`
PaymentCurrency string `json:"payment_currency"`
UnitsTraded float64 `json:"units_traded,string"`
Price float64 `json:"price,string"`
Total float64 `json:"total,string"`
} `json:"data"`
Message string `json:"message"`
}
// ActionStatus holds the return status
type ActionStatus struct {
Status string `json:"status"`
Message string `json:"message"`
}
// KRWDeposit resp type for a KRW deposit
type KRWDeposit struct {
Status string `json:"status"`
Account string `json:"account"`
Bank string `json:"bank"`
BankUser string `json:"BankUser"`
Message string `json:"message"`
}
// MarketBuy holds market buy order information
type MarketBuy struct {
Status string `json:"status"`
OrderID string `json:"order_id"`
Data []struct {
ContID string `json:"cont_id"`
Units float64 `json:"units,string"`
Price float64 `json:"price,string"`
Total float64 `json:"total,string"`
Fee float64 `json:"fee,string"`
} `json:"data"`
Message string `json:"message"`
}
// MarketSell holds market buy order information
type MarketSell struct {
Status string `json:"status"`
OrderID string `json:"order_id"`
Data []struct {
ContID string `json:"cont_id"`
Units float64 `json:"units,string"`
Price float64 `json:"price,string"`
Total float64 `json:"total,string"`
Fee float64 `json:"fee,string"`
} `json:"data"`
Message string `json:"message"`
}
// WithdrawalFees the large list of predefined withdrawal fees
// Prone to change
var WithdrawalFees = map[currency.Code]float64{
currency.KRW: 1000,
currency.BTC: 0.001,
currency.ETH: 0.01,
currency.DASH: 0.01,
currency.LTC: 0.01,
currency.ETC: 0.01,
currency.XRP: 1,
currency.BCH: 0.001,
currency.XMR: 0.05,
currency.ZEC: 0.001,
currency.QTUM: 0.05,
currency.BTG: 0.001,
currency.ICX: 1,
currency.TRX: 5,
currency.ELF: 5,
currency.MITH: 5,
currency.MCO: 0.5,
currency.OMG: 0.4,
currency.KNC: 3,
currency.GNT: 12,
currency.HSR: 0.2,
currency.ZIL: 30,
currency.ETHOS: 2,
currency.PAY: 2.4,
currency.WAX: 5,
currency.POWR: 5,
currency.LRC: 10,
currency.GTO: 15,
currency.STEEM: 0.01,
currency.STRAT: 0.2,
currency.PPT: 0.5,
currency.CTXC: 4,
currency.CMT: 20,
currency.THETA: 24,
currency.WTC: 0.7,
currency.ITC: 5,
currency.TRUE: 4,
currency.ABT: 5,
currency.RNT: 20,
currency.PLY: 20,
currency.WAVES: 0.01,
currency.LINK: 10,
currency.ENJ: 35,
currency.PST: 30,
}
// FullBalance defines a return type with full balance data
type FullBalance struct {
InUse map[string]float64
Misu map[string]float64
Total map[string]float64
Xcoin map[string]float64
Available map[string]float64
}
// OHLCVResponse holds returned kline data
type OHLCVResponse struct {
Status string `json:"status"`
Data [][6]interface{} `json:"data"`
}