From 0f596d3ceef3a53e1f7364b89241854e9ffa4905 Mon Sep 17 00:00:00 2001 From: "Benjamin T. Schwertfeger" Date: Fri, 13 Sep 2024 08:27:31 +0200 Subject: [PATCH] Resolve "The "level3" channel is missing in `kraken.spot.ws_client.SpotWSClient.private_channel_names`" (#270) --- .github/workflows/cicd.yaml | 7 ++++--- kraken/spot/ws_client.py | 15 +++++++++------ tests/nft/test_nft_trade.py | 1 - tests/spot/test_spot_websocket.py | 12 ++---------- 4 files changed, 15 insertions(+), 20 deletions(-) diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml index 466c2c3..901361f 100644 --- a/.github/workflows/cicd.yaml +++ b/.github/workflows/cicd.yaml @@ -46,17 +46,18 @@ name: CI/CD on: push: - branches: - - "**" + branches: [master] schedule: - cron: "20 16 */7 * *" release: types: [created] pull_request: types: [opened, synchronize, reopened] + branches: ["**"] +# only run once due to API rate limits concurrency: - group: CICD-${{ github.ref }} + group: CICD cancel-in-progress: true jobs: diff --git a/kraken/spot/ws_client.py b/kraken/spot/ws_client.py index 6b69c7f..c8a5be0 100644 --- a/kraken/spot/ws_client.py +++ b/kraken/spot/ws_client.py @@ -515,7 +515,8 @@ def public_channel_names(self: SpotWSClient) -> list[str]: Returns the list of valid values for ``channel`` when un-/subscribing from/to public feeds without authentication. - See https://docs.kraken.com/websockets-v2/#channels for all channels. + Override this property if the exchange supports additional public + channels. The available public channels are listed below: @@ -536,16 +537,18 @@ def private_channel_names(self: SpotWSClient) -> list[str]: Returns the list of valid values for ``channel`` when un-/subscribing from/to private feeds that need authentication. - See https://docs.kraken.com/websockets-v2/#channels for all channels. - - Currently there is only one private channel (June 2023): + Override this property if the exchange supports additional private + channels. - - `executions `_ + - `executions + `_ + - `balances `_ + - `level3 `_ :return: List of available private channel names :rtype: list[str] """ - return ["executions", "balances"] + return ["executions", "balances", "level3"] @property def private_methods(self: SpotWSClient) -> list[str]: diff --git a/tests/nft/test_nft_trade.py b/tests/nft/test_nft_trade.py index 7435dc3..b188de9 100644 --- a/tests/nft/test_nft_trade.py +++ b/tests/nft/test_nft_trade.py @@ -218,4 +218,3 @@ def test_nft_trade_list_nft_transactions(nft_auth_trade: Trade) -> None: assert len(result["items"]) > 0 assert isinstance(result["items"][0], dict) assert "nft_id" in result["items"][0] - assert result["items"][0]["nft_id"] == "NTRU2ZH-EK7SW-QHJOVI" diff --git a/tests/spot/test_spot_websocket.py b/tests/spot/test_spot_websocket.py index 6efb766..17f3e07 100644 --- a/tests/spot/test_spot_websocket.py +++ b/tests/spot/test_spot_websocket.py @@ -149,16 +149,8 @@ async def check_access() -> None: key=spot_api_key, secret=spot_secret_key, ) as auth_client: - assert auth_client.private_channel_names == ["executions", "balances"] - assert auth_client.private_methods == [ - "add_order", - "batch_add", - "batch_cancel", - "cancel_all", - "cancel_all_orders_after", - "cancel_order", - "edit_order", - ] + assert isinstance(auth_client.private_channel_names, list) + assert isinstance(auth_client.private_methods, list) assert auth_client.active_private_subscriptions == [] await async_sleep(2.5)