-
Notifications
You must be signed in to change notification settings - Fork 102
/
Copy pathorder.go
92 lines (84 loc) · 3.2 KB
/
order.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
package bittrex
import (
"time"
"github.com/shopspring/decimal"
)
type Order struct {
Uuid *string
OrderUuid string `json:"OrderUuid"`
Exchange string `json:"Exchange"`
OrderType string `json:"OrderType"`
Limit decimal.Decimal `json:"Limit"`
Quantity decimal.Decimal `json:"Quantity"`
QuantityRemaining decimal.Decimal `json:"QuantityRemaining"`
Price decimal.Decimal `json:"Price"`
PricePerUnit decimal.Decimal `json:"PricePerUnit"`
CommissionPaid decimal.Decimal
Opened jTime
Closed *jTime
CancelInitiated bool
ImmediateOrCancel bool
IsConditional bool
Condition string
ConditionTarget decimal.Decimal
}
// For getorder
type Order2 struct {
AccountId string
OrderUuid string `json:"OrderUuid"`
Exchange string `json:"Exchange"`
Type string
Quantity decimal.Decimal `json:"Quantity"`
QuantityRemaining decimal.Decimal `json:"QuantityRemaining"`
Limit decimal.Decimal `json:"Limit"`
Reserved decimal.Decimal
ReserveRemaining decimal.Decimal
CommissionReserved decimal.Decimal
CommissionReserveRemaining decimal.Decimal
CommissionPaid decimal.Decimal
Price decimal.Decimal `json:"Price"`
PricePerUnit decimal.Decimal `json:"PricePerUnit"`
Opened jTime
Closed *jTime
IsOpen bool
Sentinel string
CancelInitiated bool
ImmediateOrCancel bool
IsConditional bool
Condition string
ConditionTarget decimal.Decimal
}
type CreateOrderParams struct {
MarketSymbol string `json:"marketSymbol"`
Direction OrderDirection `json:"direction"`
Type OrderType `json:"type"`
Quantity decimal.Decimal `json:"quantity"`
TimeInForce TimeInForce `json:"timeInForce"`
Ceiling float64 `json:"ceiling,omitempty"`
Limit float64 `json:"limit,omitempty"`
ClientOrderID string `json:"clientOrderId,omitempty"`
UseAwards string `json:"useAwards,omitempty"`
}
type OrderV3 struct {
ID string `json:"id"`
MarketSymbol string `json:"marketSymbol"`
Direction string `json:"direction"`
Type string `json:"type"`
Quantity decimal.Decimal `json:"quantity"`
Limit decimal.Decimal `json:"limit"`
Ceiling decimal.Decimal `json:"ceiling"`
TimeInForce string `json:"timeInForce"`
ClientOrderID string `json:"clientOrderId"`
FillQuantity decimal.Decimal `json:"fillQuantity"`
Commission decimal.Decimal `json:"commission"`
Proceeds decimal.Decimal `json:"proceeds"`
Status string `json:"status"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
ClosedAt time.Time `json:"closedAt"`
OrderToCancel OrderData `json:"orderToCancel"`
}
type OrderData struct {
Type string `json:"type"`
ID string `json:"id"`
}