forked from thrasher-corp/gocryptotrader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
coinut_types.go
709 lines (639 loc) · 23.3 KB
/
coinut_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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
package coinut
import (
"sync"
"github.com/thrasher-corp/gocryptotrader/currency"
"github.com/thrasher-corp/gocryptotrader/exchanges/order"
)
// GenericResponse is the generic response you will get from coinut
type GenericResponse struct {
Nonce int64 `json:"nonce"`
Reply string `json:"reply"`
Status []string `json:"status"`
TransactionID int64 `json:"trans_id"`
}
// InstrumentBase holds information on base currency
type InstrumentBase struct {
Base string `json:"base"`
DecimalPlaces int `json:"decimal_places"`
InstrumentID int64 `json:"inst_id"`
Quote string `json:"quote"`
}
// Instruments holds the full information on base currencies
type Instruments struct {
Instruments map[string][]InstrumentBase `json:"SPOT"`
}
// Ticker holds ticker information
type Ticker struct {
High24 float64 `json:"high24,string"`
HighestBuy float64 `json:"highest_buy,string"`
InstrumentID int `json:"inst_id"`
Last float64 `json:"last,string"`
Low24 float64 `json:"low24,string"`
LowestSell float64 `json:"lowest_sell,string"`
PreviousTransactionID int64 `json:"prev_trans_id"`
PriceChange24 float64 `json:"price_change_24,string"`
Reply string `json:"reply"`
OpenInterest float64 `json:"open_interest,string"`
Timestamp int64 `json:"timestamp"`
TransactionID int64 `json:"trans_id"`
Volume float64 `json:"volume,string"`
Volume24 float64 `json:"volume24,string"`
Volume24Quote float64 `json:"volume24_quote,string"`
VolumeQuote float64 `json:"volume_quote,string"`
}
// OrderbookBase is a sub-type holding price and quantity
type OrderbookBase struct {
Count int `json:"count"`
Price float64 `json:"price,string"`
Quantity float64 `json:"qty,string"`
}
// Orderbook is the full order book
type Orderbook struct {
Buy []OrderbookBase `json:"buy"`
Sell []OrderbookBase `json:"sell"`
InstrumentID int `json:"inst_id"`
TotalBuy float64 `json:"total_buy,string"`
TotalSell float64 `json:"total_sell,string"`
TransactionID int64 `json:"trans_id"`
}
// TradeBase is a sub-type holding information on trades
type TradeBase struct {
Price float64 `json:"price,string"`
Quantity float64 `json:"qty,string"`
Side string `json:"side"`
Timestamp int64 `json:"timestamp"`
TransactionID int64 `json:"trans_id"`
}
// Trades holds the full amount of trades associated with API keys
type Trades struct {
Trades []TradeBase `json:"trades"`
}
// UserBalance holds user balances on the exchange
type UserBalance struct {
BCH float64 `json:"BCH,string"`
BTC float64 `json:"BTC,string"`
BTG float64 `json:"BTG,string"`
CAD float64 `json:"CAD,string"`
ETC float64 `json:"ETC,string"`
ETH float64 `json:"ETH,string"`
LCH float64 `json:"LCH,string"`
LTC float64 `json:"LTC,string"`
MYR float64 `json:"MYR,string"`
SGD float64 `json:"SGD,string"`
USD float64 `json:"USD,string"`
USDT float64 `json:"USDT,string"`
XMR float64 `json:"XMR,string"`
ZEC float64 `json:"ZEC,string"`
Nonce int64 `json:"nonce"`
Reply string `json:"reply"`
Status []string `json:"status"`
TransID int64 `json:"trans_id"`
}
// Order holds order information
type Order struct {
InstrumentID int64 `json:"inst_id"`
Price float64 `json:"price,string"`
Quantity float64 `json:"qty,string"`
ClientOrderID int `json:"client_ord_id"`
Side string `json:"side,string"`
}
// OrderResponse is a response for orders
type OrderResponse struct {
OrderID int64 `json:"order_id"`
OpenQuantity float64 `json:"open_qty,string"`
Price float64 `json:"price,string"`
Quantity float64 `json:"qty,string"`
InstrumentID int64 `json:"inst_id"`
ClientOrderID int64 `json:"client_ord_id"`
Timestamp int64 `json:"timestamp"`
OrderPrice float64 `json:"order_price,string"`
Side string `json:"side"`
}
// Commission holds trade commission structure
type Commission struct {
Currency currency.Pair `json:"currency"`
Amount float64 `json:"amount,string"`
}
// OrderFilledResponse contains order filled response
type OrderFilledResponse struct {
GenericResponse
Commission Commission `json:"commission"`
FillPrice float64 `json:"fill_price,string"`
FillQuantity float64 `json:"fill_qty,string"`
Order OrderResponse `json:"order"`
}
// OrderRejectResponse holds information on a rejected order
type OrderRejectResponse struct {
OrderResponse
Reasons []string `json:"reasons"`
}
// OrdersBase contains generic response and order responses
type OrdersBase struct {
GenericResponse
OrderResponse
}
// GetOpenOrdersResponse holds all order data from GetOpenOrders request
type GetOpenOrdersResponse struct {
Nonce int `json:"nonce"`
Orders []OrderResponse `json:"orders"`
Reply string `json:"reply"`
Status []string `json:"status"`
TransactionID int `json:"trans_id"`
}
// OrdersResponse holds the full data range on orders
type OrdersResponse struct {
Data []OrdersBase
}
// CancelOrders holds information about a cancelled order
type CancelOrders struct {
InstrumentID int64 `json:"inst_id"`
OrderID int64 `json:"order_id"`
}
// CancelOrdersResponse is response for a cancelled order
type CancelOrdersResponse struct {
GenericResponse
Results []struct {
OrderID int64 `json:"order_id"`
Status string `json:"status"`
InstrumentID int64 `json:"inst_id"`
} `json:"results"`
}
// TradeHistory holds trade history information
type TradeHistory struct {
TotalNumber int64 `json:"total_number"`
Trades []OrderFilledResponse `json:"trades"`
}
// IndexTicker holds indexed ticker inforamtion
type IndexTicker struct {
Asset string `json:"asset"`
Price float64 `json:"price,string"`
}
// Option holds options information
type Option struct {
HighestBuy float64 `json:"highest_buy,string"`
InstrumentID int `json:"inst_id"`
Last float64 `json:"last,string"`
LowestSell float64 `json:"lowest_sell,string"`
OpenInterest float64 `json:"open_interest,string"`
}
// OptionChainResponse is the response type for options
type OptionChainResponse struct {
ExpiryTime int64 `json:"expiry_time"`
SecurityType string `json:"sec_type"`
Asset string `json:"asset"`
Entries []struct {
Call Option `json:"call"`
Put Option `json:"put"`
Strike float64 `json:"strike,string"`
}
}
// OptionChainUpdate contains information on the chain update options
type OptionChainUpdate struct {
Option
GenericResponse
Asset string `json:"asset"`
ExpiryTime int64 `json:"expiry_time"`
SecurityType string `json:"sec_type"`
Volume float64 `json:"volume,string"`
}
// PositionHistory holds the complete position history
type PositionHistory struct {
Positions []struct {
PositionID int `json:"position_id"`
Records []struct {
Commission Commission `json:"commission"`
FillPrice float64 `json:"fill_price,string,omitempty"`
TransactionID int `json:"trans_id"`
FillQuantity float64 `json:"fill_qty,omitempty"`
Position struct {
Commission Commission `json:"commission"`
Timestamp int64 `json:"timestamp"`
OpenPrice float64 `json:"open_price,string"`
RealizedPL float64 `json:"realized_pl,string"`
Quantity float64 `json:"qty,string"`
} `json:"position"`
AssetAtExpiry float64 `json:"asset_at_expiry,string,omitempty"`
} `json:"records"`
Instrument struct {
ExpiryTime int64 `json:"expiry_time"`
ContractSize float64 `json:"contract_size,string"`
ConversionRate float64 `json:"conversion_rate,string"`
OptionType string `json:"option_type"`
InstrumentID int `json:"inst_id"`
SecType string `json:"sec_type"`
Asset string `json:"asset"`
Strike float64 `json:"strike,string"`
} `json:"inst"`
OpenTimestamp int64 `json:"open_timestamp"`
} `json:"positions"`
TotalNumber int `json:"total_number"`
}
// OpenPosition holds information on an open position
type OpenPosition struct {
PositionID int `json:"position_id"`
Commission Commission `json:"commission"`
OpenPrice float64 `json:"open_price,string"`
RealizedPL float64 `json:"realized_pl,string"`
Quantity float64 `json:"qty,string"`
OpenTimestamp int64 `json:"open_timestamp"`
InstrumentID int `json:"inst_id"`
}
type wsRequest struct {
Request string `json:"request"`
SecurityType string `json:"sec_type,omitempty"`
InstrumentID int64 `json:"inst_id,omitempty"`
TopN int64 `json:"top_n,omitempty"`
Subscribe bool `json:"subscribe,omitempty"`
Nonce int64 `json:"nonce,omitempty"`
}
type wsResponse struct {
Nonce int64 `json:"nonce,omitempty"`
Reply string `json:"reply"`
}
type wsHeartbeatResp struct {
Nonce int64 `json:"nonce"`
Reply string `json:"reply"`
Status []interface{} `json:"status"`
}
// WsTicker defines the resp for ticker updates from the websocket connection
type WsTicker struct {
High24 float64 `json:"high24,string"`
HighestBuy float64 `json:"highest_buy,string"`
InstID int64 `json:"inst_id"`
Last float64 `json:"last,string"`
Low24 float64 `json:"low24,string"`
LowestSell float64 `json:"lowest_sell,string"`
Nonce int64 `json:"nonce"`
PrevTransID int64 `json:"prev_trans_id"`
PriceChange24 float64 `json:"price_change_24,string"`
Reply string `json:"reply"`
Status []string `json:"status"`
Timestamp int64 `json:"timestamp"`
TransID int64 `json:"trans_id"`
Volume float64 `json:"volume,string"`
Volume24 float64 `json:"volume24,string"`
Volume24Quote float64 `json:"volume24_quote,string"`
VolumeQuote float64 `json:"volume_quote,string"`
}
// WsOrderbookSnapshot defines the resp for orderbook snapshot updates from
// the websocket connection
type WsOrderbookSnapshot struct {
Buy []WsOrderbookData `json:"buy"`
Sell []WsOrderbookData `json:"sell"`
InstID int64 `json:"inst_id"`
Nonce int64 `json:"nonce"`
TotalBuy float64 `json:"total_buy,string"`
TotalSell float64 `json:"total_sell,string"`
Reply string `json:"reply"`
Status []interface{} `json:"status"`
}
// WsOrderbookData defines singular orderbook data
type WsOrderbookData struct {
Count int64 `json:"count"`
Price float64 `json:"price,string"`
Volume float64 `json:"qty,string"`
}
// WsOrderbookUpdate defines orderbook update response from the websocket
// connection
type WsOrderbookUpdate struct {
Count int64 `json:"count"`
InstID int64 `json:"inst_id"`
Price float64 `json:"price,string"`
Volume float64 `json:"qty,string"`
TotalBuy float64 `json:"total_buy,string"`
Reply string `json:"reply"`
Side string `json:"side"`
TransID int64 `json:"trans_id"`
}
// WsTradeSnapshot defines Market trade response from the websocket
// connection
type WsTradeSnapshot struct {
InstrumentID int64 `json:"inst_id"`
Nonce int64 `json:"nonce"`
Reply string `json:"reply"`
Status []interface{} `json:"status"`
Trades []WsTradeData `json:"trades"`
}
// WsTradeData defines market trade data
type WsTradeData struct {
InstID int64 `json:"inst_id"`
TransID int64 `json:"trans_id"`
Price float64 `json:"price,string"`
Quantity float64 `json:"qty,string"`
Side string `json:"side"`
Timestamp int64 `json:"timestamp"`
}
// WsTradeUpdate defines trade update response from the websocket connection
type WsTradeUpdate struct {
InstID int64 `json:"inst_id"`
TransID int64 `json:"trans_id"`
Price float64 `json:"price,string"`
Quantity float64 `json:"qty,string"`
Side string `json:"side"`
Timestamp int64 `json:"timestamp"`
Reply string `json:"reply"`
}
// WsInstrumentList defines instrument list
type WsInstrumentList struct {
Spot map[string][]InstrumentBase `json:"SPOT"`
Nonce int64 `json:"nonce,omitempty"`
Reply string `json:"inst_list,omitempty"`
Status []interface{} `json:"status,omitempty"`
}
// WsSupportedCurrency defines supported currency on the exchange
type WsSupportedCurrency struct {
Base string `json:"base"`
InstID int64 `json:"inst_id"`
DecimalPlaces int64 `json:"decimal_places"`
Quote string `json:"quote"`
}
// WsRequest base request
type WsRequest struct {
Request string `json:"request"`
Nonce int64 `json:"nonce"`
}
// WsTradeHistoryRequest ws request
type WsTradeHistoryRequest struct {
InstID int64 `json:"inst_id"`
Start int64 `json:"start,omitempty"`
Limit int64 `json:"limit,omitempty"`
WsRequest
}
// WsCancelOrdersRequest ws request
type WsCancelOrdersRequest struct {
Entries []WsCancelOrdersRequestEntry `json:"entries"`
WsRequest
}
// WsCancelOrdersRequestEntry ws request entry
type WsCancelOrdersRequestEntry struct {
InstID int64 `json:"inst_id"`
OrderID int64 `json:"order_id"`
}
// WsCancelOrderParameters ws request parameters
type WsCancelOrderParameters struct {
Currency currency.Pair
OrderID int64
}
// WsCancelOrderRequest data required for cancelling an order
type WsCancelOrderRequest struct {
InstrumentID int64 `json:"inst_id"`
OrderID int64 `json:"order_id"`
WsRequest
}
// WsCancelOrderResponse contains cancelled order data
type WsCancelOrderResponse struct {
Nonce int64 `json:"nonce"`
Reply string `json:"reply"`
OrderID int64 `json:"order_id"`
ClientOrderID int64 `json:"client_ord_id"`
Status []string `json:"status"`
}
// WsCancelOrdersResponse contains all cancelled order data
type WsCancelOrdersResponse struct {
Nonce int64 `json:"nonce"`
Reply string `json:"reply"`
Results []WsCancelOrdersResponseData `json:"results"`
Status []string `json:"status"`
TransactionID int64 `json:"trans_id"`
}
// WsCancelOrdersResponseData individual cancellation response data
type WsCancelOrdersResponseData struct {
InstrumentID int64 `json:"inst_id"`
OrderID int64 `json:"order_id"`
Status string `json:"status"`
}
// WsGetOpenOrdersRequest ws request
type WsGetOpenOrdersRequest struct {
InstrumentID int64 `json:"inst_id"`
WsRequest
}
// WsSubmitOrdersRequest ws request
type WsSubmitOrdersRequest struct {
Orders []WsSubmitOrdersRequestData `json:"orders"`
WsRequest
}
// WsSubmitOrdersRequestData ws request data
type WsSubmitOrdersRequestData struct {
InstrumentID int64 `json:"inst_id"`
Price float64 `json:"price,string"`
Quantity float64 `json:"qty,string"`
ClientOrderID int `json:"client_ord_id"`
Side string `json:"side"`
}
// WsSubmitOrderRequest ws request
type WsSubmitOrderRequest struct {
InstrumentID int64 `json:"inst_id"`
Price float64 `json:"price,string"`
Quantity float64 `json:"qty,string"`
OrderID int64 `json:"client_ord_id"`
Side string `json:"side"`
WsRequest
}
// WsSubmitOrderParameters ws request parameters
type WsSubmitOrderParameters struct {
Currency currency.Pair
Side order.Side
Amount, Price float64
OrderID int64
}
// WsUserBalanceResponse ws response
type WsUserBalanceResponse struct {
Nonce int64 `json:"nonce"`
Status []string `json:"status"`
Btc float64 `json:"BTC,string"`
Ltc float64 `json:"LTC,string"`
Etc float64 `json:"ETC,string"`
Eth float64 `json:"ETH,string"`
FloatingProfitLoss float64 `json:"floating_pl,string"`
InitialMargin float64 `json:"initial_margin,string"`
RealisedProfitLoss float64 `json:"realized_pl,string"`
MaintenanceMargin float64 `json:"maintenance_margin,string"`
Equity float64 `json:"equity,string"`
Reply string `json:"reply"`
TransactionID int64 `json:"trans_id"`
}
// WsOrderAcceptedResponse ws response
type WsOrderAcceptedResponse struct {
Nonce int64 `json:"nonce"`
Status []string `json:"status"`
OrderID int64 `json:"order_id"`
OpenQuantity float64 `json:"open_qty,string"`
InstrumentID int64 `json:"inst_id"`
Quantity float64 `json:"qty,string"`
ClientOrderID int64 `json:"client_ord_id"`
OrderPrice float64 `json:"order_price,string"`
Reply string `json:"reply"`
Side string `json:"side"`
TransactionID int64 `json:"trans_id"`
}
// WsOrderFilledResponse ws response
type WsOrderFilledResponse struct {
Commission WsOrderFilledCommissionData `json:"commission"`
FillPrice float64 `json:"fill_price,string"`
FillQuantity float64 `json:"fill_qty,string"`
Nonce int64 `json:"nonce"`
Order WsOrderData `json:"order"`
Reply string `json:"reply"`
Status []string `json:"status"`
Timestamp int64 `json:"timestamp"`
TransactionID int64 `json:"trans_id"`
}
// WsOrderData ws response data
type WsOrderData struct {
ClientOrderID int64 `json:"client_ord_id"`
InstrumentID int64 `json:"inst_id"`
OpenQuantity float64 `json:"open_qty,string"`
OrderID int64 `json:"order_id"`
Price float64 `json:"price,string"`
Quantity float64 `json:"qty,string"`
Side string `json:"side"`
Timestamp int64 `json:"timestamp"`
Status []string `json:"status"`
}
// WsOrderFilledCommissionData ws response data
type WsOrderFilledCommissionData struct {
Amount float64 `json:"amount,string"`
Currency currency.Pair `json:"currency"`
}
// WsOrderRejectedResponse ws response
type WsOrderRejectedResponse struct {
Nonce int64 `json:"nonce"`
Status []string `json:"status"`
OrderID int64 `json:"order_id"`
OpenQuantity float64 `json:"open_qty,string"`
Price float64 `json:"price,string"`
InstrumentID int64 `json:"inst_id"`
Reasons []string `json:"reasons"`
ClientOrderID int64 `json:"client_ord_id"`
Timestamp int64 `json:"timestamp"`
Reply string `json:"reply"`
Quantity float64 `json:"qty,string"`
Side string `json:"side"`
TransactionID int64 `json:"trans_id"`
}
type wsInstList struct {
Spot map[string][]struct {
Base string `json:"base"`
DecimalPlaces int64 `json:"decimal_places"`
InstrumentID int64 `json:"inst_id"`
Quote string `json:"quote"`
} `json:"spot"`
}
// WsUserOpenOrdersResponse ws response
type WsUserOpenOrdersResponse struct {
Nonce int64 `json:"nonce"`
Reply string `json:"reply"`
Status []string `json:"status"`
Orders []WsOrderData `json:"orders"`
}
// WsTradeHistoryResponse ws response
type WsTradeHistoryResponse struct {
Nonce int64 `json:"nonce"`
Reply string `json:"reply"`
Status []string `json:"status"`
TotalNumber int64 `json:"total_number"`
Trades []WsOrderData `json:"trades"`
}
// WsTradeHistoryCommissionData ws response data
type WsTradeHistoryCommissionData struct {
Amount float64 `json:"amount,string"`
Currency currency.Pair `json:"currency"`
}
// WsTradeHistoryTradeData ws response data
type WsTradeHistoryTradeData struct {
Commission WsTradeHistoryCommissionData `json:"commission"`
Order WsOrderData `json:"order"`
FillPrice float64 `json:"fill_price,string"`
FillQuantity float64 `json:"fill_qty,string"`
Timestamp int64 `json:"timestamp"`
TransactionID int64 `json:"trans_id"`
}
// WsLoginResponse ws response data
type WsLoginResponse struct {
APIKey string `json:"api_key"`
Country string `json:"country"`
DepositEnabled bool `json:"deposit_enabled"`
Deposited bool `json:"deposited"`
Email string `json:"email"`
FailedTimes int64 `json:"failed_times"`
KycPassed bool `json:"kyc_passed"`
Language string `json:"lang"`
Nonce int64 `json:"nonce"`
OTPEnabled bool `json:"otp_enabled"`
PhoneNumber string `json:"phone_number"`
ProductsEnabled []string `json:"products_enabled"`
Referred bool `json:"referred"`
Reply string `json:"reply"`
SessionID string `json:"session_id"`
Status []string `json:"status"`
Timezone string `json:"timezone"`
Traded bool `json:"traded"`
UnverifiedEmail string `json:"unverified_email"`
Username string `json:"username"`
WithdrawEnabled bool `json:"withdraw_enabled"`
}
// WsNewOrderResponse returns if new_order response failes
type WsNewOrderResponse struct {
Message string `json:"msg"`
Nonce int64 `json:"nonce"`
Reply string `json:"reply"`
Status []string `json:"status"`
}
// WsGetAccountBalanceResponse contains values of each currency
type WsGetAccountBalanceResponse struct {
BCH float64 `json:"BCH,string"`
BTC float64 `json:"BTC,string"`
BTG float64 `json:"BTG,string"`
CAD float64 `json:"CAD,string"`
ETC float64 `json:"ETC,string"`
ETH float64 `json:"ETH,string"`
LCH float64 `json:"LCH,string"`
LTC float64 `json:"LTC,string"`
MYR float64 `json:"MYR,string"`
SGD float64 `json:"SGD,string"`
USD float64 `json:"USD,string"`
USDT float64 `json:"USDT,string"`
XMR float64 `json:"XMR,string"`
ZEC float64 `json:"ZEC,string"`
Nonce int64 `json:"nonce"`
Reply string `json:"reply"`
Status []string `json:"status"`
TransID int64 `json:"trans_id"`
}
type instrumentMap struct {
Instruments map[string]int64
Loaded bool
m sync.Mutex
}
type wsOrderContainer struct {
OrderID int64 `json:"order_id"`
ClientOrderID int64 `json:"client_ord_id"`
InstrumentID int64 `json:"inst_id"`
Nonce int64 `json:"nonce"`
Timestamp int64 `json:"timestamp"`
TransactionID int64 `json:"trans_id"`
OpenQuantity float64 `json:"open_qty,string"`
OrderPrice float64 `json:"order_price,string"`
Quantity float64 `json:"qty,string"`
FillPrice float64 `json:"fill_price,string"`
FillQuantity float64 `json:"fill_qty,string"`
Price float64 `json:"price,string"`
Reply string `json:"reply"`
Side string `json:"side"`
Status []string `json:"status"`
Reasons []string `json:"reasons"`
Order struct {
ClientOrderID int64 `json:"client_ord_id"`
InstrumentID int64 `json:"inst_id"`
OrderID int64 `json:"order_id"`
Timestamp int64 `json:"timestamp"`
Price float64 `json:"price,string"`
Quantity float64 `json:"qty,string"`
OpenQuantity float64 `json:"open_qty,string"`
Side string `json:"side"`
} `json:"order"`
Commission struct {
Amount float64 `json:"amount,string"`
Currency string `json:"currency"`
} `json:"commission"`
}