Skip to content

Commit

Permalink
Resolve "The "level3" channel is missing in `kraken.spot.ws_client.Sp…
Browse files Browse the repository at this point in the history
…otWSClient.private_channel_names`" (#270)
  • Loading branch information
btschwertfeger authored Sep 13, 2024
1 parent 09e6d83 commit 0f596d3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 9 additions & 6 deletions kraken/spot/ws_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 <https://docs.kraken.com/websockets-v2/#executions>`_
- `executions
<https://docs.kraken.com/api/docs/websocket-v2/executions>`_
- `balances <https://docs.kraken.com/api/docs/websocket-v2/balances>`_
- `level3 <https://docs.kraken.com/api/docs/websocket-v2/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]:
Expand Down
1 change: 0 additions & 1 deletion tests/nft/test_nft_trade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
12 changes: 2 additions & 10 deletions tests/spot/test_spot_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 0f596d3

Please sign in to comment.