-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfailfast.go
151 lines (137 loc) · 4.22 KB
/
failfast.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
package btce
// Ticker is a single-return, panicking-on-error wrapper for GetTicker
func (c *Client) Ticker(pairs []string) map[string]TickerInfo {
result, err := c.GetTicker(pairs)
if err != nil {
panic(err)
}
return result
}
// Depth is a single-return, panicking-on-error wrapper for GetDepth
func (c *Client) Depth(pairs []string, limit uint) map[string]DepthInfo {
result, err := c.GetDepth(pairs, limit)
if err != nil {
panic(err)
}
return result
}
// PublicInfo is a single-return, panicking-on-error wrapper for
// GetPublicInfo (calling GetInfo method of public V3 API, caching
// result)
func (c *Client) PublicInfo() *PublicInfo {
result, err := c.GetPublicInfo()
if err != nil {
panic(err)
}
return result
}
// PrivateInfo is a single-return, panicking-on-error wrapper for
// getInfo - see https://wex.nz/tapi/docs#getInfo
func (c *Client) PrivateInfo() GetInfoResult {
result := GetInfoResult{}
err := c.Call(GetInfoParameters{}, &result)
if err != nil {
panic(err)
}
return result
}
// ActiveOrders is a single-return, panicking-on-error wrapper for private
// API method ActiveOrders - see https://wex.nz/tapi/docs#ActiveOrders
func (c *Client) ActiveOrders(p ActiveOrdersParameters) ActiveOrdersResult {
result := ActiveOrdersResult{}
err := c.Call(p, &result)
if err != nil {
panic(err)
}
return result
}
// Trade is a single-return, panicking-on-error wrapper for private
// API method Trade - see https://wex.nz/tapi/docs#Trade
func (c *Client) Trade(p TradeParameters) TradeResult {
result := TradeResult{}
err := c.Call(p, &result)
if err != nil {
panic(err)
}
return result
}
// OrderInfo is a single-return, panicking-on-error wrapper for private
// API method OrderInfo - see https://wex.nz/tapi/docs#OrderInfo
func (c *Client) OrderInfo(p OrderInfoParameters) OrderInfoResult {
result := OrderInfoResult{}
err := c.Call(p, &result)
if err != nil {
panic(err)
}
return result
}
// CancelOrder is a single-return, panicking-on-error wrapper for private
// API method CancelOrder - see https://wex.nz/tapi/docs#CancelOrder
func (c *Client) CancelOrder(p CancelOrderParameters) CancelOrderResult {
result := CancelOrderResult{}
err := c.Call(p, &result)
if err != nil {
panic(err)
}
return result
}
// TradeHistory is a single-return, panicking-on-error wrapper for private
// API method TradeHistory - see https://wex.nz/tapi/docs#TradeHistory
func (c *Client) TradeHistory(p TradeHistoryParameters) TradeHistoryResult {
result := TradeHistoryResult{}
err := c.Call(p, &result)
if err != nil {
panic(err)
}
return result
}
// TransHistory is a single-return, panicking-on-error wrapper for private
// API method TransHistory - see https://wex.nz/tapi/docs#TransHistory
func (c *Client) TransHistory(p TransHistoryParameters) TransHistoryResult {
result := TransHistoryResult{}
err := c.Call(p, &result)
if err != nil {
panic(err)
}
return result
}
// CoinDepositAddress is a single-return, panicking-on-error wrapper for private
// API method CoinDepositAddress - see https://wex.nz/tapi/docs#CoinDepositAddress
func (c *Client) CoinDepositAddress(p CoinDepositAddressParameters) CoinDepositAddressResult {
result := CoinDepositAddressResult{}
err := c.Call(p, &result)
if err != nil {
panic(err)
}
return result
}
// WithdrawCoin is a single-return, panicking-on-error wrapper for private
// API method WithdrawCoin - see https://wex.nz/tapi/docs#WithdrawCoin
func (c *Client) WithdrawCoin(p WithdrawCoinParameters) WithdrawCoinResult {
result := WithdrawCoinResult{}
err := c.Call(p, &result)
if err != nil {
panic(err)
}
return result
}
// CreateCoupon is a single-return, panicking-on-error wrapper for private
// API method CreateCoupon - see https://wex.nz/tapi/docs#CreateCoupon
func (c *Client) CreateCoupon(p CreateCouponParameters) CreateCouponResult {
result := CreateCouponResult{}
err := c.Call(p, &result)
if err != nil {
panic(err)
}
return result
}
// RedeemCoupon is a single-return, panicking-on-error wrapper for private
// API method RedeemCoupon - see https://wex.nz/tapi/docs#RedeemCoupon
func (c *Client) RedeemCoupon(p RedeemCouponParameters) RedeemCouponResult {
result := RedeemCouponResult{}
err := c.Call(p, &result)
if err != nil {
panic(err)
}
return result
}