@@ -76,12 +76,13 @@ public function setAPI($api_key, $api_secret)
76
76
public function getSystemStatus ()
77
77
{
78
78
$ this ->api_url = config ('binance-api.urls.sapi ' );
79
+
79
80
return $ this ->publicRequest ('v1/system/status ' );
80
81
}
81
82
82
83
/**
83
84
* Get Binance Server Time.
84
- *
85
+ *
85
86
* @return mixed
86
87
*/
87
88
public function getTime ()
@@ -91,8 +92,9 @@ public function getTime()
91
92
92
93
/**
93
94
* Get Binance Exchange Info.
94
- *
95
+ *
95
96
* @param string $symbol Exchange Pair Symbol
97
+ *
96
98
* @return mixed
97
99
*/
98
100
public function getExchangeInfo ($ symbol = null )
@@ -106,8 +108,9 @@ public function getExchangeInfo($symbol = null)
106
108
107
109
/**
108
110
* Get Binance Order Book for a given symbol.
109
- *
111
+ *
110
112
* @param string $symbol Exchange Pair Symbol
113
+ *
111
114
* @return mixed
112
115
*/
113
116
public function getOrderBook ($ symbol )
@@ -121,8 +124,9 @@ public function getOrderBook($symbol)
121
124
122
125
/**
123
126
* Get Average Price for a given symbol.
124
- *
127
+ *
125
128
* @param string $symbol Exchange Pair Symbol
129
+ *
126
130
* @return mixed
127
131
*/
128
132
public function getAvgPrice ($ symbol = null )
@@ -136,10 +140,11 @@ public function getAvgPrice($symbol = null)
136
140
137
141
/**
138
142
* Get 24hr Ticker Price Change Statistics.
139
- * If the symbol is not sent, tickers for all symbols will
143
+ * If the symbol is not sent, tickers for all symbols will
140
144
* be returned in an array.
141
- *
145
+ *
142
146
* @param string $symbol Exchange Pair Symbol
147
+ *
143
148
* @return mixed
144
149
*/
145
150
public function getTicker ($ symbol = null )
@@ -180,8 +185,9 @@ public function getAccountInfo()
180
185
181
186
/**
182
187
* Get all current account orders; active, canceled, or filled.
183
- *
188
+ *
184
189
* @param string $symbol Exchange Pair Symbol
190
+ *
185
191
* @return mixed
186
192
*/
187
193
public function getAllOrders ($ symbol = null )
@@ -194,10 +200,11 @@ public function getAllOrders($symbol = null)
194
200
}
195
201
196
202
/**
197
- * Get all current account open orders on a symbol.
203
+ * Get all current account open orders on a symbol.
198
204
* Careful when accessing this with no symbol.
199
- *
205
+ *
200
206
* @param string $symbol Exchange Pair Symbol
207
+ *
201
208
* @return mixed
202
209
*/
203
210
public function getOpenOrders ($ symbol = null )
@@ -210,9 +217,10 @@ public function getOpenOrders($symbol = null)
210
217
}
211
218
212
219
/**
213
- * Get the trade history for a particular symbol.
214
- *
220
+ * Get the trade history for a particular symbol.
221
+ *
215
222
* @param string $symbol Exchange Pair Symbol
223
+ *
216
224
* @return mixed
217
225
*/
218
226
public function getTrades ($ symbol = null )
@@ -226,16 +234,17 @@ public function getTrades($symbol = null)
226
234
227
235
/**
228
236
* Get an order's status.
229
- *
230
- * @param string $symbol Exchange Pair Symbol
237
+ *
238
+ * @param string $symbol Exchange Pair Symbol
231
239
* @param string $orderId Exchange Order Id
240
+ *
232
241
* @return mixed
233
242
*/
234
243
public function getOrderStatus ($ symbol = null , $ orderId = null )
235
244
{
236
245
$ data = [
237
- 'symbol ' => $ symbol ? strtoupper ($ symbol ) : null ,
238
- 'orderId ' => $ orderId
246
+ 'symbol ' => $ symbol ? strtoupper ($ symbol ) : null ,
247
+ 'orderId ' => $ orderId,
239
248
];
240
249
241
250
return $ this ->privateRequest ('v3/order ' , $ data );
@@ -244,36 +253,39 @@ public function getOrderStatus($symbol = null, $orderId = null)
244
253
/**
245
254
* Get information of coins (available for deposit and withdraw) for the user.
246
255
* Uses Sapi Endpoint.
247
- *
256
+ *
248
257
* @return mixed
249
258
*/
250
259
public function getUserCoinsInfo ()
251
260
{
252
261
$ this ->api_url = config ('binance-api.urls.sapi ' );
262
+
253
263
return $ this ->privateRequest ('v1/capital/config/getall ' );
254
264
}
255
265
256
266
/**
257
267
* Get deposit history of the user account.
258
268
* Uses Sapi Endpoint.
259
- *
269
+ *
260
270
* @return mixed
261
271
*/
262
272
public function getDepositHistory ()
263
273
{
264
274
$ this ->api_url = config ('binance-api.urls.sapi ' );
275
+
265
276
return $ this ->privateRequest ('v1/capital/deposit/hisrec ' );
266
277
}
267
278
268
279
/**
269
280
* Get withdraw history of the user account.
270
281
* Uses Sapi Endpoint.
271
- *
282
+ *
272
283
* @return mixed
273
284
*/
274
285
public function getWithdrawHistory ()
275
286
{
276
287
$ this ->api_url = config ('binance-api.urls.sapi ' );
288
+
277
289
return $ this ->privateRequest ('v1/capital/withdraw/history ' );
278
290
}
279
291
@@ -364,7 +376,7 @@ private function sendApiRequest($url, $method)
364
376
'message ' => $ e ->getMessage (),
365
377
];
366
378
}
367
-
379
+
368
380
// If response if Ok. Return collection.
369
381
if ($ response ->ok ()) {
370
382
return $ response ->collect ();
0 commit comments