Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Kraken Websockets API v2; add kraken.spot.KrakenSpotWebsocketClientV2; internals #131

Merged
merged 36 commits into from
Jul 31, 2023

Conversation

btschwertfeger
Copy link
Owner

@btschwertfeger btschwertfeger commented Jul 19, 2023

Summary

This PR provides a new client that can be used to connect to the Kraken Websocket API V2 (kraken.spot.KrakenSpotWSClientV2).

To do so, new base classes were used to support both API v1 and v2.

Breaking

  • Some internals have changed. This only affects users that used non-public functions or classes that were not documented so far.
  • The parameter msg of kraken.spot.KrakenSpotWSClient.on_message was renamed to message.
  • The parameter msg of kraken.spot.KrakenSpotWSClient.send_message was renamed to message.

Todo's / Changes

  • add kraken.spot.KrakenSpotWSClientV2 and create a base class to support API v1 and v2
  • adjust the examples (/examples/*.py and README.md)
  • adjust the documentation and add new / remove old stuff
  • write new tests for Websocket API V2
  • use __all__ in python modules
  • do we still need to ping? - Yes - the Kraken Docs are recommending it.

@btschwertfeger btschwertfeger added enhancement New feature or request Must This is a must Spot Topic related to Spot trading Breaking Breaking changes labels Jul 19, 2023
@btschwertfeger btschwertfeger self-assigned this Jul 19, 2023
@btschwertfeger btschwertfeger linked an issue Jul 19, 2023 that may be closed by this pull request
3 tasks
@btschwertfeger btschwertfeger added this to the Next Release milestone Jul 19, 2023
@btschwertfeger btschwertfeger changed the title Integrate Kraken Websockets API v2 Integrate Kraken Websockets API v2; add kraken.spot.KrakenSpotWebsocketClientV2 Jul 19, 2023
@codecov
Copy link

codecov bot commented Jul 19, 2023

Codecov Report

Merging #131 (17a6e2a) into master (9f30c1b) will increase coverage by 2.42%.
The diff coverage is 91.37%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #131      +/-   ##
==========================================
+ Coverage   87.57%   90.00%   +2.42%     
==========================================
  Files          18       20       +2     
  Lines        1569     1720     +151     
==========================================
+ Hits         1374     1548     +174     
+ Misses        195      172      -23     
Flag Coverage Δ
unittests 90.00% <91.37%> (+2.42%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
kraken/spot/websocket/connectors.py 79.34% <79.34%> (ø)
kraken/spot/orderbook.py 90.10% <95.45%> (+0.22%) ⬆️
kraken/spot/websocket_v2.py 96.77% <96.77%> (ø)
kraken/spot/websocket/__init__.py 96.96% <96.82%> (+21.81%) ⬆️
kraken/spot/websocket_v1.py 97.16% <98.38%> (ø)
kraken/base_api/__init__.py 90.05% <100.00%> (-0.43%) ⬇️
kraken/exceptions/__init__.py 99.20% <100.00%> (+0.01%) ⬆️
kraken/futures/__init__.py 100.00% <100.00%> (ø)
kraken/futures/funding.py 64.00% <100.00%> (+3.13%) ⬆️
kraken/futures/market.py 91.39% <100.00%> (+0.18%) ⬆️
... and 10 more

@btschwertfeger btschwertfeger changed the title Integrate Kraken Websockets API v2; add kraken.spot.KrakenSpotWebsocketClientV2 Integrate Kraken Websockets API v2; add kraken.spot.KrakenSpotWebsocketClientV2; internals Jul 23, 2023
@btschwertfeger btschwertfeger removed the Must This is a must label Jul 25, 2023
@btschwertfeger btschwertfeger marked this pull request as ready for review July 31, 2023 15:51
@btschwertfeger btschwertfeger merged commit 16627d8 into master Jul 31, 2023
60 checks passed
@btschwertfeger btschwertfeger deleted the 130-integrate-websockets-api-v2 branch July 31, 2023 15:59
btschwertfeger added a commit that referenced this pull request Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Breaking changes enhancement New feature or request Spot Topic related to Spot trading
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate Websockets API v2
1 participant