diff --git a/src/Api.php b/src/Api.php index 6cb1b21..8e573b5 100644 --- a/src/Api.php +++ b/src/Api.php @@ -16,12 +16,12 @@ abstract class Api /** * @var string SDK Version */ - const VERSION = '1.1.24'; + const VERSION = '1.1.25'; /** * @var string SDK update date */ - const UPDATE_DATE = '2021.12.02'; + const UPDATE_DATE = '2022.02.21'; /** * @var string diff --git a/src/PrivateApi/Margin.php b/src/PrivateApi/Margin.php index 821edb4..bb4a896 100644 --- a/src/PrivateApi/Margin.php +++ b/src/PrivateApi/Margin.php @@ -301,4 +301,19 @@ public function getTradeLast($currency) $response = $this->call(Request::METHOD_GET, '/api/v1/margin/trade/last', compact('currency')); return $response->getApiData(); } + + /** + * This endpoint can query the cross/isolated margin risk limit. + * This endpoint requires the "General" permission + * @param string $marginModel corss(corss margin), isolated (isolated margin) + * @return mixed + * @throws \KuCoin\SDK\Exceptions\BusinessException + * @throws \KuCoin\SDK\Exceptions\HttpException + * @throws \KuCoin\SDK\Exceptions\InvalidApiUriException + */ + public function getStrategyRiskLimit(string $marginModel) + { + $response = $this->call(Request::METHOD_GET, '/api/v1/risk/limit/strategy', ['marginModel' => $marginModel]); + return $response->getApiData(); + } } \ No newline at end of file diff --git a/src/PrivateApi/Order.php b/src/PrivateApi/Order.php index c7954a6..00e0c4c 100644 --- a/src/PrivateApi/Order.php +++ b/src/PrivateApi/Order.php @@ -87,6 +87,7 @@ public function getList(array $params = [], array $pagination = []) /** * Get v1 historical orders list + * @deprecated * @param array $params * @param array $pagination * @return array diff --git a/tests/PrivateApi/MarginTest.php b/tests/PrivateApi/MarginTest.php index b7930bb..fdae168 100644 --- a/tests/PrivateApi/MarginTest.php +++ b/tests/PrivateApi/MarginTest.php @@ -371,4 +371,22 @@ public function testGetTradeLast(Margin $api) $this->assertArrayHasKey('dailyIntRate', $data[0]); } } + + /** + * @dataProvider apiProvider + * @param Margin $api + * @throws \KuCoin\SDK\Exceptions\BusinessException + * @throws \KuCoin\SDK\Exceptions\HttpException + * @throws \KuCoin\SDK\Exceptions\InvalidApiUriException + */ + public function testGetStrategyRiskLimit(Margin $api) + { + $data = $api->getStrategyRiskLimit('cross'); + if (!empty($data)) { + $this->assertArrayHasKey('currency', $data[0]); + $this->assertArrayHasKey('borrowMaxAmount', $data[0]); + $this->assertArrayHasKey('buyMaxAmount', $data[0]); + $this->assertArrayHasKey('precision', $data[0]); + } + } }