Skip to content

Commit

Permalink
add ocoOrder.
Browse files Browse the repository at this point in the history
  • Loading branch information
fieyum committed Jan 15, 2024
1 parent 0bd2308 commit 3a199e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/PrivateApi/OcoOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,10 @@ public function cancelByClientOid($clientOid)
*/
public function cancelMulti($symbol = '', array $orderIds = [])
{
$query = http_build_query(array_filter([
return $this->call(Request::METHOD_DELETE, '/api/v3/oco/orders', [
'symbol' => $symbol,
'orderIds' => implode(',', $orderIds),
]));

$path = '/api/v3/oco/orders';
return $this->call(Request::METHOD_DELETE, $query ? "$path?$query" : $path)->getApiData();
])->getApiData();
}

/**
Expand Down
5 changes: 4 additions & 1 deletion tests/PrivateApi/OcoOrderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ public static function tearDownAfterClass()
* @var $api OcoOrder
*/
$api = current($item);
$api->cancelMulti();
try {
$api->cancelMulti();
} catch (\Exception $e) {
}
}
}

Expand Down

0 comments on commit 3a199e0

Please sign in to comment.