-------------------------------
For a detailed list of changes, refer to the same-number releases below.
Migration instructions
^^^^^^^^^^^^^^^^^^^^^^
* Everything network-related now handled by ``requests``. See its
`docs`_ if needed. (`11`_)
* ``krakenex.API`` class no longer has a ``conn`` attribute for
connection manipulation. It has been replaced by a ``session``
attribute, which is a ``requests.Session``. For custom networking
setups, directly modify ``session`` attribute of a ``krakenex.API``
object.
* ``krakenex.API`` constructor no longer accepts ``conn`` argument
as a means of re-using an existing ``krakenex.Connection`` object.
Instead, modify ``krakenex.API.session`` if needed, same as above.
* If you were previously calling ``API.query_private()`` or
``API.query_public()`` in a ``try/except`` block, be aware that
these two may now throw a ``requests.exceptions.HTTPError`` instead
of the previous ``http.client.HTTPException``, if the
underlying ``Connection`` returns a non-`20x` status code.
.. _docs: http://docs.python-requests.org/
.. _11: https://github.com/veox/python3-krakenex/issues/11
Known issues
^^^^^^^^^^^^
* The remote servers are unstable under high load, which is most of
the time. No recovery mechanism is provided for failed queries. (`66`_)
Most importantly, queries that may seem to have failed due to a ``502``
HTTP error may in fact reach the trade execution engine, with an
unpredictable delay. See `PSA`_ for an example.
After encountering a ``502``, a subsequent call to
``krakenex.API.query_private()`` will construct a new query, with an
increased ``nonce``. When used with an ``AddOrder`` query, this may
have disastrous effects, placing a duplicate order.
To work around this, instead reuse the ``krakenex.API.response.request``
object, which is a ``requests.PreparedRequest``, saved as part of
``requests``' operation when submitting the first query. This request
can be re-sent using ``krakenex.API.session.send()``.
.. _66: https://github.com/veox/python3-krakenex/issues/66
.. _PSA: https://www.reddit.com/r/krakenex/comments/778uvh/psa_http_error_502_does_not_mean_the_query_wont/