Skip to content

Commit ab929ec

Browse files
author
Moinuddin S. Khaja
authored
Merge pull request #1 from TechTailor/analysis-m4xMKa
Apply fixes from StyleCI
2 parents 317b5c3 + 26cb1bf commit ab929ec

File tree

2 files changed

+33
-21
lines changed

2 files changed

+33
-21
lines changed

config/binance-api.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727

2828
'urls' => [
29-
'api' => 'https://api.binance.com/api/',
29+
'api' => 'https://api.binance.com/api/',
3030
'sapi' => 'https://api.binance.com/sapi/',
3131
],
3232

@@ -43,4 +43,4 @@
4343
'timing' => env('BINANCE_TIMING', 5000),
4444
],
4545

46-
];
46+
];

src/BinanceAPI.php

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,13 @@ public function setAPI($api_key, $api_secret)
7676
public function getSystemStatus()
7777
{
7878
$this->api_url = config('binance-api.urls.sapi');
79+
7980
return $this->publicRequest('v1/system/status');
8081
}
8182

8283
/**
8384
* Get Binance Server Time.
84-
*
85+
*
8586
* @return mixed
8687
*/
8788
public function getTime()
@@ -91,8 +92,9 @@ public function getTime()
9192

9293
/**
9394
* Get Binance Exchange Info.
94-
*
95+
*
9596
* @param string $symbol Exchange Pair Symbol
97+
*
9698
* @return mixed
9799
*/
98100
public function getExchangeInfo($symbol = null)
@@ -106,8 +108,9 @@ public function getExchangeInfo($symbol = null)
106108

107109
/**
108110
* Get Binance Order Book for a given symbol.
109-
*
111+
*
110112
* @param string $symbol Exchange Pair Symbol
113+
*
111114
* @return mixed
112115
*/
113116
public function getOrderBook($symbol)
@@ -121,8 +124,9 @@ public function getOrderBook($symbol)
121124

122125
/**
123126
* Get Average Price for a given symbol.
124-
*
127+
*
125128
* @param string $symbol Exchange Pair Symbol
129+
*
126130
* @return mixed
127131
*/
128132
public function getAvgPrice($symbol = null)
@@ -136,10 +140,11 @@ public function getAvgPrice($symbol = null)
136140

137141
/**
138142
* 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
140144
* be returned in an array.
141-
*
145+
*
142146
* @param string $symbol Exchange Pair Symbol
147+
*
143148
* @return mixed
144149
*/
145150
public function getTicker($symbol = null)
@@ -180,8 +185,9 @@ public function getAccountInfo()
180185

181186
/**
182187
* Get all current account orders; active, canceled, or filled.
183-
*
188+
*
184189
* @param string $symbol Exchange Pair Symbol
190+
*
185191
* @return mixed
186192
*/
187193
public function getAllOrders($symbol = null)
@@ -194,10 +200,11 @@ public function getAllOrders($symbol = null)
194200
}
195201

196202
/**
197-
* Get all current account open orders on a symbol.
203+
* Get all current account open orders on a symbol.
198204
* Careful when accessing this with no symbol.
199-
*
205+
*
200206
* @param string $symbol Exchange Pair Symbol
207+
*
201208
* @return mixed
202209
*/
203210
public function getOpenOrders($symbol = null)
@@ -210,9 +217,10 @@ public function getOpenOrders($symbol = null)
210217
}
211218

212219
/**
213-
* Get the trade history for a particular symbol.
214-
*
220+
* Get the trade history for a particular symbol.
221+
*
215222
* @param string $symbol Exchange Pair Symbol
223+
*
216224
* @return mixed
217225
*/
218226
public function getTrades($symbol = null)
@@ -226,16 +234,17 @@ public function getTrades($symbol = null)
226234

227235
/**
228236
* Get an order's status.
229-
*
230-
* @param string $symbol Exchange Pair Symbol
237+
*
238+
* @param string $symbol Exchange Pair Symbol
231239
* @param string $orderId Exchange Order Id
240+
*
232241
* @return mixed
233242
*/
234243
public function getOrderStatus($symbol = null, $orderId = null)
235244
{
236245
$data = [
237-
'symbol' => $symbol ? strtoupper($symbol) : null,
238-
'orderId' => $orderId
246+
'symbol' => $symbol ? strtoupper($symbol) : null,
247+
'orderId' => $orderId,
239248
];
240249

241250
return $this->privateRequest('v3/order', $data);
@@ -244,36 +253,39 @@ public function getOrderStatus($symbol = null, $orderId = null)
244253
/**
245254
* Get information of coins (available for deposit and withdraw) for the user.
246255
* Uses Sapi Endpoint.
247-
*
256+
*
248257
* @return mixed
249258
*/
250259
public function getUserCoinsInfo()
251260
{
252261
$this->api_url = config('binance-api.urls.sapi');
262+
253263
return $this->privateRequest('v1/capital/config/getall');
254264
}
255265

256266
/**
257267
* Get deposit history of the user account.
258268
* Uses Sapi Endpoint.
259-
*
269+
*
260270
* @return mixed
261271
*/
262272
public function getDepositHistory()
263273
{
264274
$this->api_url = config('binance-api.urls.sapi');
275+
265276
return $this->privateRequest('v1/capital/deposit/hisrec');
266277
}
267278

268279
/**
269280
* Get withdraw history of the user account.
270281
* Uses Sapi Endpoint.
271-
*
282+
*
272283
* @return mixed
273284
*/
274285
public function getWithdrawHistory()
275286
{
276287
$this->api_url = config('binance-api.urls.sapi');
288+
277289
return $this->privateRequest('v1/capital/withdraw/history');
278290
}
279291

@@ -364,7 +376,7 @@ private function sendApiRequest($url, $method)
364376
'message' => $e->getMessage(),
365377
];
366378
}
367-
379+
368380
// If response if Ok. Return collection.
369381
if ($response->ok()) {
370382
return $response->collect();

0 commit comments

Comments
 (0)