Skip to content

Commit

Permalink
Merge pull request #14 from hhxsv5/master
Browse files Browse the repository at this point in the history
Fix parameter of order list
  • Loading branch information
hhxsv5 authored Feb 18, 2019
2 parents 522f162 + 4d3455a commit 2ba2753
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/PrivateApi/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,16 @@ public function cancelAll($symbol = null)

/**
* List orders
* @param string|null $status
* @param string|null $symbol
* @param array $params
* @param array $pagination
* @return array
* @throws \KuCoin\SDK\Exceptions\BusinessException
* @throws \KuCoin\SDK\Exceptions\HttpException
* @throws \KuCoin\SDK\Exceptions\InvalidApiUriException
*/
public function getList($status = null, $symbol = null, array $pagination = [])
public function getList(array $params = [], array $pagination = [])
{
$response = $this->call(Request::METHOD_GET, '/api/v1/orders', compact('status', 'symbol') + $pagination);
$response = $this->call(Request::METHOD_GET, '/api/v1/orders', $params + $pagination);
return $response->getApiData();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/OrderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function testCreateMarket(Order $api)
*/
public function testGetList(Order $api)
{
$data = $api->getList(null, 'BTC-USDT', ['currentPage' => 1, 'pageSize' => 10]);
$data = $api->getList(['symbol' => 'BTC-USDT'], ['currentPage' => 1, 'pageSize' => 10]);
$this->assertPagination($data);
foreach ($data['items'] as $item) {
$this->assertArrayHasKey('symbol', $item);
Expand Down

0 comments on commit 2ba2753

Please sign in to comment.