Skip to content

Commit ea662a2

Browse files
committed
fix rename method
1 parent ba50fbd commit ea662a2

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,9 @@ go(function () {
340340
| KuCoin\SDK\PrivateApi\Order::getHfFills() | YES | https://docs.kucoin.com/spot-hf/#hf-transaction-records |
341341
| KuCoin\SDK\PrivateApi\Order::hfCancelAll() | YES | https://www.kucoin.com/docs/rest/spot-trading/spot-hf-trade-pro-account/cancel-all-hf-orders |
342342
| KuCoin\SDK\PrivateApi\Order::createHfMarginOrder() | YES | https://www.kucoin.com/docs/rest/margin-trading/margin-hf-trade/place-hf-order |
343-
| KuCoin\SDK\PrivateApi\Order::marginHfCancel() | YES | https://www.kucoin.com/docs/rest/margin-trading/margin-hf-trade/cancel-hf-order-by-orderid |
344-
| KuCoin\SDK\PrivateApi\Order::marginHfCancelByClientOid() | YES | https://www.kucoin.com/docs/rest/margin-trading/margin-hf-trade/cancel-hf-order-by-clientoid |
345-
| KuCoin\SDK\PrivateApi\Order::marginHfCancelAll() | YES | https://www.kucoin.com/docs/rest/margin-trading/margin-hf-trade/cancel-all-hf-orders-by-symbol |
343+
| KuCoin\SDK\PrivateApi\Order::cancelMarginHfOrder() | YES | https://www.kucoin.com/docs/rest/margin-trading/margin-hf-trade/cancel-hf-order-by-orderid |
344+
| KuCoin\SDK\PrivateApi\Order::cancelMarginHfOrderByClientOid() | YES | https://www.kucoin.com/docs/rest/margin-trading/margin-hf-trade/cancel-hf-order-by-clientoid |
345+
| KuCoin\SDK\PrivateApi\Order::cancelAllMarginHfOrder() | YES | https://www.kucoin.com/docs/rest/margin-trading/margin-hf-trade/cancel-all-hf-orders-by-symbol |
346346
| KuCoin\SDK\PrivateApi\Order::getMarginHfActiveOrders() | YES | https://www.kucoin.com/docs/rest/margin-trading/margin-hf-trade/get-active-hf-orders-list |
347347
| KuCoin\SDK\PrivateApi\Order::getMarginHfFilledOrders() | YES | https://www.kucoin.com/docs/rest/margin-trading/margin-hf-trade/get-hf-filled-list |
348348
| KuCoin\SDK\PrivateApi\Order::getMarginHfDetail() | YES | https://www.kucoin.com/docs/rest/margin-trading/margin-hf-trade/get-hf-order-details-by-orderid |

src/PrivateApi/Order.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ public function createHfMarginOrder(array $order)
488488
* @throws \KuCoin\SDK\Exceptions\HttpException
489489
* @throws \KuCoin\SDK\Exceptions\InvalidApiUriException
490490
*/
491-
public function marginHfCancel($orderId, $symbol)
491+
public function cancelMarginHfOrder($orderId, $symbol)
492492
{
493493
$response = $this->call(Request::METHOD_DELETE, '/api/v3/hf/margin/orders/' . $orderId, ['symbol' => $symbol]);
494494
return $response->getApiData();
@@ -504,7 +504,7 @@ public function marginHfCancel($orderId, $symbol)
504504
* @throws \KuCoin\SDK\Exceptions\HttpException
505505
* @throws \KuCoin\SDK\Exceptions\InvalidApiUriException
506506
*/
507-
public function marginHfCancelByClientOid($clientOid, $symbol)
507+
public function cancelMarginHfOrderByClientOid($clientOid, $symbol)
508508
{
509509
$response = $this->call(Request::METHOD_DELETE, '/api/v3/hf/margin/orders/client-order/' . $clientOid, ['symbol' => $symbol]);
510510
return $response->getApiData();
@@ -520,7 +520,7 @@ public function marginHfCancelByClientOid($clientOid, $symbol)
520520
* @throws \KuCoin\SDK\Exceptions\HttpException
521521
* @throws \KuCoin\SDK\Exceptions\InvalidApiUriException
522522
*/
523-
public function marginHfCancelAll($symbol, $tradeType)
523+
public function cancelAllMarginHfOrder($symbol, $tradeType)
524524
{
525525
$response = $this->call(Request::METHOD_DELETE, '/api/v3/hf/margin/orders', ['symbol' => $symbol, 'tradeType' => $tradeType]);
526526
return $response->getApiData();
@@ -613,7 +613,7 @@ public function getMarginHfFills(array $params)
613613
* @throws \KuCoin\SDK\Exceptions\HttpException
614614
* @throws \KuCoin\SDK\Exceptions\InvalidApiUriException
615615
*/
616-
public function hfCreateTest(array $order)
616+
public function createHfTestOrder(array $order)
617617
{
618618
$response = $this->call(Request::METHOD_POST, '/api/v1/hf/orders/test', $order);
619619
return $response->getApiData();
@@ -628,7 +628,7 @@ public function hfCreateTest(array $order)
628628
* @throws \KuCoin\SDK\Exceptions\HttpException
629629
* @throws \KuCoin\SDK\Exceptions\InvalidApiUriException
630630
*/
631-
public function createTest(array $order)
631+
public function createTestOrder(array $order)
632632
{
633633
$response = $this->call(Request::METHOD_POST, '/api/v1/orders/test', $order);
634634
return $response->getApiData();

tests/PrivateApi/OrderTest.php

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,6 @@ public function testCreateHfMarginOrder(Order $api)
991991
$this->assertArrayHasKey('orderId', $order);
992992
}
993993

994-
995994
/**
996995
* @dataProvider apiProvider
997996
* @param Order $api
@@ -1000,10 +999,10 @@ public function testCreateHfMarginOrder(Order $api)
1000999
* @throws \KuCoin\SDK\Exceptions\HttpException
10011000
* @throws \KuCoin\SDK\Exceptions\InvalidApiUriException
10021001
*/
1003-
public function testMarginHfCancel(Order $api)
1002+
public function testCancelMarginHfOrder(Order $api)
10041003
{
10051004
$order = $this->createMarginHf($api);
1006-
$result = $api->marginHfCancel($order['orderId'], $order['symbol']);
1005+
$result = $api->cancelMarginHfOrder($order['orderId'], $order['symbol']);
10071006
$this->assertInternalType('array', $result);
10081007
$this->assertArrayHasKey('orderId', $result);
10091008
}
@@ -1016,10 +1015,10 @@ public function testMarginHfCancel(Order $api)
10161015
* @throws \KuCoin\SDK\Exceptions\HttpException
10171016
* @throws \KuCoin\SDK\Exceptions\InvalidApiUriException
10181017
*/
1019-
public function testMarginHfCancelByClientOid(Order $api)
1018+
public function testCancelMarginHfOrderByClientOid(Order $api)
10201019
{
10211020
$order = $this->createMarginHf($api);
1022-
$result = $api->marginHfCancelByClientOid($order['clientOid'], $order['symbol']);
1021+
$result = $api->cancelMarginHfOrderByClientOid($order['clientOid'], $order['symbol']);
10231022
$this->assertInternalType('array', $result);
10241023
$this->assertArrayHasKey('clientOid', $result);
10251024
}
@@ -1158,7 +1157,7 @@ public function testGetMarginHfDetail(Order $api)
11581157
$this->assertArrayHasKey('createdAt', $detail);
11591158
$this->assertArrayHasKey('lastUpdatedAt', $detail);
11601159
$this->assertArrayHasKey('tradeType', $detail);
1161-
$api->marginHfCancel($order['orderId'], $order['symbol']);
1160+
$api->cancelMarginHfOrder($order['orderId'], $order['symbol']);
11621161
}
11631162

11641163
/**
@@ -1201,7 +1200,7 @@ public function testGetMarginHfDetailByClientOid(Order $api)
12011200
$this->assertArrayHasKey('createdAt', $detail);
12021201
$this->assertArrayHasKey('lastUpdatedAt', $detail);
12031202
$this->assertArrayHasKey('tradeType', $detail);
1204-
$api->marginHfCancel($order['orderId'], $order['symbol']);
1203+
$api->cancelMarginHfOrder($order['orderId'], $order['symbol']);
12051204
}
12061205

12071206
/**
@@ -1212,11 +1211,11 @@ public function testGetMarginHfDetailByClientOid(Order $api)
12121211
* @throws \KuCoin\SDK\Exceptions\HttpException
12131212
* @throws \KuCoin\SDK\Exceptions\InvalidApiUriException
12141213
*/
1215-
public function testMarginHfCancelAll(Order $api)
1214+
public function testCancelAllMarginHfOrder(Order $api)
12161215
{
12171216
$symbol = 'DOT-USDT';
12181217
$tradeType = 'MARGIN_TRADE';
1219-
$result = $api->marginHfCancelAll($symbol, $tradeType);
1218+
$result = $api->cancelAllMarginHfOrder($symbol, $tradeType);
12201219
$this->assertEquals('success', $result);
12211220
}
12221221

@@ -1276,7 +1275,7 @@ protected function createMarginHf(Order $api)
12761275
* @throws \KuCoin\SDK\Exceptions\HttpException
12771276
* @throws \KuCoin\SDK\Exceptions\InvalidApiUriException
12781277
*/
1279-
public function testCreateTest(Order $api)
1278+
public function testCreateTestOrder(Order $api)
12801279
{
12811280
$clientOid = uniqid();
12821281
$order = [
@@ -1289,7 +1288,7 @@ public function testCreateTest(Order $api)
12891288
'size' => 0.001,
12901289
];
12911290

1292-
$data = $api->createTest($order);
1291+
$data = $api->createTestOrder($order);
12931292
$this->assertInternalType('array', $data);
12941293
$this->assertArrayHasKey('orderId', $data);
12951294
}
@@ -1302,7 +1301,7 @@ public function testCreateTest(Order $api)
13021301
* @throws \KuCoin\SDK\Exceptions\HttpException
13031302
* @throws \KuCoin\SDK\Exceptions\InvalidApiUriException
13041303
*/
1305-
public function testHfCreateTest(Order $api)
1304+
public function testCreateHfTestOrder(Order $api)
13061305
{
13071306
$order = [
13081307
'clientOid' => uniqid(),
@@ -1313,7 +1312,7 @@ public function testHfCreateTest(Order $api)
13131312
'price' => 100,
13141313
'size' => 1,
13151314
];
1316-
$data = $api->hfCreateTest($order);
1315+
$data = $api->createHfTestOrder($order);
13171316
$this->assertInternalType('array', $data);
13181317
$this->assertArrayHasKey('orderId', $data);
13191318
}

0 commit comments

Comments
 (0)