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

A the Spot order book client (kraken.spot.OrderbookClient) #106

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
528cb95
added the Spot order book client
btschwertfeger May 22, 2023
8e36e13
work on the spot order book client
btschwertfeger May 23, 2023
1c77027
merged with master
btschwertfeger May 24, 2023
6edb9fb
lost my mind on the websocket error handling
btschwertfeger May 24, 2023
63c7c29
adjust ws test
btschwertfeger May 24, 2023
fd22e3e
extended order book client and added unit tests
btschwertfeger May 25, 2023
7cb7a54
adjust the Spot and Futures websocket unit tests
btschwertfeger May 25, 2023
209cbae
fixed typo
btschwertfeger May 25, 2023
9ac6fff
increase wait time for Futures WS test
btschwertfeger May 25, 2023
2422cb1
restructured the project to simplify the hierarchy
btschwertfeger May 26, 2023
5a1b20d
adjusted the tests
btschwertfeger May 26, 2023
aabce29
adjusted the spot orderbook example
btschwertfeger May 26, 2023
b7e3548
added the spot orderbook client to the documentation
btschwertfeger May 26, 2023
8a1f13c
restructured the doc
btschwertfeger May 26, 2023
fcecf42
the spot orderbook client do not inherit from the ws client anymore
btschwertfeger May 26, 2023
4f926a6
doc strings
btschwertfeger May 29, 2023
9dab0b6
merged with master; added Spot orderbook test
btschwertfeger May 29, 2023
ad8572c
typing; doc string
btschwertfeger May 29, 2023
80bacc8
added key generation hint in readme
btschwertfeger Jun 4, 2023
6537528
adjust the docummentation - add missing functions
btschwertfeger Jun 10, 2023
c435bc4
adjust docstrings
btschwertfeger Jun 10, 2023
60336a9
update channgelog
btschwertfeger Jun 10, 2023
ff43e0a
increse accuracy of nonce for spot and futures
btschwertfeger Jun 10, 2023
0bdd603
adjust the doc portal
btschwertfeger Jun 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ repos:
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: end-of-file-fixer
- id: pretty-format-json
- id: detect-private-key
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
Expand Down
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,25 @@

## [Unreleased](https://github.com/btschwertfeger/python-kraken-sdk/tree/HEAD)

[Full Changelog](https://github.com/btschwertfeger/python-kraken-sdk/compare/v1.2.0...HEAD)
[Full Changelog](https://github.com/btschwertfeger/python-kraken-sdk/compare/v1.3.0...HEAD)

**Implemented enhancements:**

- Add the `truncate` parameter to `create_order` of the Spot websocket client [\#111](https://github.com/btschwertfeger/python-kraken-sdk/issues/111)
- Add the `truncate` parameter to create_order of the Spot websocket clients' `create_order` and `cancel_order`+ `kraken.spot.Trade.edit_order` [\#113](https://github.com/btschwertfeger/python-kraken-sdk/pull/113) ([btschwertfeger](https://github.com/btschwertfeger))

Uncategorized merged pull requests:

- Update `/examples/spot_orderbook.py` [\#110](https://github.com/btschwertfeger/python-kraken-sdk/pull/110) ([btschwertfeger](https://github.com/btschwertfeger))

## [v1.3.0](https://github.com/btschwertfeger/python-kraken-sdk/tree/v1.3.0) (2023-05-24)

[Full Changelog](https://github.com/btschwertfeger/python-kraken-sdk/compare/v1.2.0...v1.3.0)

**Breaking changes:**

- Rename `kraken.futures.User.get_unwindqueue` to `kraken.futures.User.get_unwind_queue` [\#107](https://github.com/btschwertfeger/python-kraken-sdk/issues/107)
- Prepare release v1.3.0 [\#99](https://github.com/btschwertfeger/python-kraken-sdk/pull/99) ([btschwertfeger](https://github.com/btschwertfeger))
- Change `kraken.spot.User.get_balances` and add `kraken.spot.User.get_balance` [\#98](https://github.com/btschwertfeger/python-kraken-sdk/pull/98) ([btschwertfeger](https://github.com/btschwertfeger))
- Rename `get_tradeable_asset_pair` to `get_asset_pairs` and make the `pair` parameter optional [\#93](https://github.com/btschwertfeger/python-kraken-sdk/pull/93) ([btschwertfeger](https://github.com/btschwertfeger))
- Extend typing + add `KrakenUnknownMethodError` and `KrakenBadRequestError` + Fix \#65 [\#87](https://github.com/btschwertfeger/python-kraken-sdk/pull/87) ([btschwertfeger](https://github.com/btschwertfeger))
Expand All @@ -24,6 +39,7 @@

**Closed issues:**

- Add a realtime Spot order book example [\#103](https://github.com/btschwertfeger/python-kraken-sdk/issues/103)
- `kraken.spot.Trade.create_order`: documentatoin for txid outdated. [\#96](https://github.com/btschwertfeger/python-kraken-sdk/issues/96)
- Create `CONTRIBUTING.md` [\#91](https://github.com/btschwertfeger/python-kraken-sdk/issues/91)
- Extend the typing - using mypy [\#84](https://github.com/btschwertfeger/python-kraken-sdk/issues/84)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ python3 -m pip install python-kraken-sdk
### 2. Register at Kraken and generate API Keys:

- Spot Trading: https://www.kraken.com/u/security/api
- Futures Trading: https://futures.kraken.com/trade/settings/api
- Futures Trading: https://futures.kraken.com/trade/settings/api (see _[help](https://docs.futures.kraken.com/#introduction-generate-api-keys)_)
- Futures Sandbox: https://demo-futures.kraken.com/settings/api

### 3. Start using the provided example scripts
Expand Down Expand Up @@ -177,7 +177,7 @@ import time
import asyncio
from kraken.spot import KrakenSpotWSClient

async def main() -> None:
async def main()

key = "kraken-public-key"
secret = "kraken-secret-key"
Expand Down
10 changes: 5 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ Welcome to Python Kraken SDK's documentation!
|Release date badge| |Release version badge| |DOI badge|

.. toctree::
:maxdepth: 2
:caption: Contents:
:maxdepth: 2

src/introduction.rst
src/getting_started/getting_started.rst
src/examples/trading_bot_templates.rst
src/issues.rst
src/spot/spot_rest.rst
src/spot/spot_websocket.rst
src/futures/futures_rest.rst
src/futures/futures_websocket.rst
src/spot/rest.rst
src/spot/websockets.rst
src/futures/rest.rst
src/futures/websockets.rst
src/base_api/base_api.rst
src/krakenexceptions/krakenexceptions.rst
src/about/license.rst
Expand Down
3 changes: 1 addition & 2 deletions docs/src/about/license.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

.. _section-license:

License
=======
=========

.. include:: ../../../LICENSE
6 changes: 5 additions & 1 deletion docs/src/examples/spot_orderbook.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
.. The spot orderbook

Maintain a valid Spot order book
--------------------------------

The following example demonstrate how to use the python-kraken-sdk to
retrieve a valid realtime order book. Please see the following example
snippet for more information.

--------------------------------
References:
- https://gist.github.com/btschwertfeger/6eea0eeff193f7cd1b262cfce4f0eb51


.. literalinclude:: ../../../examples/spot_orderbook.py
:language: python
:linenos:
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Futures REST Clients
=====================
Futures REST
============

.. autoclass:: kraken.futures.User
:members:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Futures Websocket Client
========================
Futures Websockets
==================

.. autoclass:: kraken.futures.KrakenFuturesWSClient
:members:
Expand Down
2 changes: 2 additions & 0 deletions docs/src/issues.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Known Issues
============

Issues listed here: `python-kraken-sdk/issues`_

Futures Trading
---------------

Expand Down
4 changes: 2 additions & 2 deletions docs/src/spot/spot_rest.rst → docs/src/spot/rest.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Spot REST Clients
==================
Spot REST
=========

.. autoclass:: kraken.spot.User
:members:
Expand Down
7 changes: 0 additions & 7 deletions docs/src/spot/spot_websocket.rst

This file was deleted.

12 changes: 12 additions & 0 deletions docs/src/spot/websockets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Spot Websockets
===============

.. autoclass:: kraken.spot.KrakenSpotWSClient
:members:
:show-inheritance:
:inherited-members:

.. autoclass:: kraken.spot.OrderbookClient
:members:
:show-inheritance:
:inherited-members:
Loading