Skip to content
This repository was archived by the owner on Dec 1, 2025. It is now read-only.

Commit 60faa74

Browse files
committed
Update API methods
1 parent 275e1fd commit 60faa74

File tree

1 file changed

+36
-19
lines changed

1 file changed

+36
-19
lines changed

src/Clients/BittrexClient.php

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public function buyLimit(string $market, float $quantity, float $rate)
162162
$parameters['quantity'] = (string)$quantity;
163163
$parameters['rate'] = (string)$rate;
164164

165-
$request = $this->privateRequestManager->createGetRequest('/market/buylimit');
165+
$request = $this->privateRequestManager->createGetRequest('/market/buylimit', $parameters);
166166

167167
return $this->get($request);
168168
}
@@ -181,7 +181,7 @@ public function sellLimit(string $market, float $quantity, float $rate)
181181
$parameters['quantity'] = (string)$quantity;
182182
$parameters['rate'] = (string)$rate;
183183

184-
$request = $this->privateRequestManager->createGetRequest('/market/selllimit');
184+
$request = $this->privateRequestManager->createGetRequest('/market/selllimit', $parameters);
185185

186186
return $this->get($request);
187187
}
@@ -197,7 +197,7 @@ public function cancel(string $uuid)
197197
{
198198
$parameters['uuid'] = $uuid;
199199

200-
$request = $this->privateRequestManager->createGetRequest('/market/cancel');
200+
$request = $this->privateRequestManager->createGetRequest('/market/cancel', $parameters);
201201

202202
return $this->get($request);
203203
}
@@ -209,11 +209,15 @@ public function cancel(string $uuid)
209209
* @param string $market string literal for the market (e.g.: BTC-LTC)
210210
* @return mixed
211211
*/
212-
public function getOpenOrders(string $market)
212+
public function getOpenOrders(string $market = null)
213213
{
214-
$parameters['market'] = $market;
214+
$parameters = [];
215+
216+
if (!is_null($market)) {
217+
$parameters['market'] = $market;
218+
}
215219

216-
$request = $this->privateRequestManager->createGetRequest('/market/getopenorders');
220+
$request = $this->privateRequestManager->createGetRequest('/market/getopenorders', $parameters);
217221

218222
return $this->get($request);
219223
}
@@ -244,7 +248,7 @@ public function getBalance(string $currency)
244248
{
245249
$parameters['currency'] = $currency;
246250

247-
$request = $this->privateRequestManager->createGetRequest('/account/getbalance');
251+
$request = $this->privateRequestManager->createGetRequest('/account/getbalance', $parameters);
248252

249253
return $this->get($request);
250254
}
@@ -259,7 +263,7 @@ public function getDepositAddress(string $currency)
259263
{
260264
$parameters['currency'] = $currency;
261265

262-
$request = $this->privateRequestManager->createGetRequest('/account/getdepositaddress');
266+
$request = $this->privateRequestManager->createGetRequest('/account/getdepositaddress', $parameters);
263267

264268
return $this->get($request);
265269
}
@@ -279,11 +283,12 @@ public function withdraw(string $currency, float $quantity, string $address, str
279283
$parameters['currency'] = $currency;
280284
$parameters['quantity'] = (string)$quantity;
281285
$parameters['address'] = $address;
286+
282287
if (!is_null($paymentid)) {
283288
$parameters['paymentid'] = $paymentid;
284289
}
285290

286-
$request = $this->privateRequestManager->createGetRequest('/account/withdraw');
291+
$request = $this->privateRequestManager->createGetRequest('/account/withdraw', $parameters);
287292

288293
return $this->get($request);
289294
}
@@ -298,7 +303,7 @@ public function getOrder(string $uuid)
298303
{
299304
$parameters['uuid'] = $uuid;
300305

301-
$request = $this->privateRequestManager->createGetRequest('/account/getorder');
306+
$request = $this->privateRequestManager->createGetRequest('/account/getorder', $parameters);
302307

303308
return $this->get($request);
304309
}
@@ -309,11 +314,15 @@ public function getOrder(string $uuid)
309314
* @param string $market string literal for the market (e.g.: BTC-LTC)
310315
* @return mixed
311316
*/
312-
public function getOrderHistory(string $market)
317+
public function getOrderHistory(string $market = null)
313318
{
314-
$parameters['market'] = $market;
319+
$parameters = [];
320+
321+
if (!is_null($market)) {
322+
$parameters['market'] = $market;
323+
}
315324

316-
$request = $this->privateRequestManager->createGetRequest('/account/getorderhistory');
325+
$request = $this->privateRequestManager->createGetRequest('/account/getorderhistory', $parameters);
317326

318327
return $this->get($request);
319328
}
@@ -324,11 +333,15 @@ public function getOrderHistory(string $market)
324333
* @param string $currency string literal for the currency (e.g.: BTC)
325334
* @return mixed
326335
*/
327-
public function getWithdrawalHistory(string $currency)
336+
public function getWithdrawalHistory(string $currency = null)
328337
{
329-
$parameters['currency'] = $currency;
338+
$parameters = [];
339+
340+
if (!is_null($currency)) {
341+
$parameters['currency'] = $currency;
342+
}
330343

331-
$request = $this->privateRequestManager->createGetRequest('/account/getwithdrawalhistory');
344+
$request = $this->privateRequestManager->createGetRequest('/account/getwithdrawalhistory', $parameters);
332345

333346
return $this->get($request);
334347
}
@@ -339,11 +352,15 @@ public function getWithdrawalHistory(string $currency)
339352
* @param string $currency string literal for the currency (e.g.: BTC)
340353
* @return mixed
341354
*/
342-
public function getDepositHistory(string $currency)
355+
public function getDepositHistory(string $currency = null)
343356
{
344-
$parameters['currency'] = $currency;
357+
$parameters = [];
358+
359+
if (!is_null($currency)) {
360+
$parameters['currency'] = $currency;
361+
}
345362

346-
$request = $this->privateRequestManager->createGetRequest('/account/getdeposithistory');
363+
$request = $this->privateRequestManager->createGetRequest('/account/getdeposithistory', $parameters);
347364

348365
return $this->get($request);
349366
}

0 commit comments

Comments
 (0)