Skip to content

Commit 4e08e9e

Browse files
Resolve "The URLs in the documentation linking to the Kraken API documentation are out-dated" (#360)
1 parent 57647c0 commit 4e08e9e

File tree

21 files changed

+128
-174
lines changed

21 files changed

+128
-174
lines changed

.github/codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ coverage:
1919
comment:
2020
layout: "reach, diff, flags, files"
2121
behavior: default
22-
require_changes: false # if false: post the comment even if coverage doesn't change
22+
require_changes: true # if false: post the comment even if coverage doesn't change
2323
require_base: no # [yes :: must have a base report to post]
2424
require_head: yes # [yes :: must have a head report to post]

.github/workflows/_codecov.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
FUTURES_SECRET_KEY: ${{ secrets.FUTURES_SECRET_KEY }}
8080
FUTURES_SANDBOX_KEY: ${{ secrets.FUTURES_SANDBOX_KEY }}
8181
FUTURES_SANDBOX_SECRET: ${{ secrets.FUTURES_SANDBOX_SECRET }}
82-
run: pytest -vv --cov --cov-report=xml:coverage.xml tests
82+
run: pytest -vv --cov=kraken --cov-report=xml:coverage.xml --cov-report=term tests
8383

8484
- name: Export coverage report
8585
uses: actions/upload-artifact@v4

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ UV ?= uv
1010
PYTHON := python
1111
PYTEST := $(UV) run pytest
1212
PYTEST_OPTS := -vv --junit-xml=pytest.xml
13-
PYTEST_COV_OPTS := $(PYTEST_OPTS) --cov --cov-report=xml:coverage.xml --cov-report=term
13+
PYTEST_COV_OPTS := $(PYTEST_OPTS) --cov=kraken --cov-report=xml:coverage.xml --cov-report=term
1414
TEST_DIR := tests
1515

1616
## ======= M A K E F I L E - T A R G E T S =====================================

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,6 @@ longer be extended, but maintained to a certain degree.
514514
- https://python-kraken-sdk.readthedocs.io/en/stable
515515
- https://docs.kraken.com/api/
516516
- https://docs.kraken.com/api/docs/guides/global-intro
517-
- https://docs.kraken.com/rest
518-
- https://docs.kraken.com/websockets-v2
519-
- https://docs.futures.kraken.com
520517
- https://support.kraken.com/hc/en-us/sections/360012894412-Futures-API
521518
522519
---

doc/getting_started/getting_started.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Getting Started
1717
1818
2. Register at Kraken and generate API Keys
1919

20-
- Spot Trading: https://www.kraken.com/u/security/api
20+
- Spot Trading: https://pro.kraken.com/app/settings/api
2121
- Futures Trading: https://futures.kraken.com/trade/settings/api
2222
- Futures Sandbox: https://demo-futures.kraken.com/settings/api
2323

doc/introduction.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,4 @@ References
110110
- https://python-kraken-sdk.readthedocs.io/en/stable
111111
- https://docs.kraken.com/api/
112112
- https://docs.kraken.com/api/docs/guides/global-intro
113-
- https://docs.kraken.com/rest
114-
- https://docs.kraken.com/websockets-v2
115-
- https://docs.futures.kraken.com
116113
- https://support.kraken.com/hc/en-us/sections/360012894412-Futures-API

doc/issues.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Futures Trading
1717
``order_id`` or ``orderId``, ``cliOrdId`` seems to work in all cases.
1818
- Kraken's API doesn't seem to know the ``trailing_stop`` order type and raises
1919
an error if this type is part of an order. This order type is documented here
20-
https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-send-order
20+
https://docs.kraken.com/api/docs/futures-api/trading/send-order
2121

2222
.. code-block:: python
2323
:linenos:

src/kraken/exceptions/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ class MaxReconnectError(Exception):
354354
"""To many reconnect tries."""
355355

356356

357-
# https://docs.kraken.com/rest/#section/General-Usage/Requests-Responses-and-Errors
358357
EXCEPTION_ASSIGNMENT: dict[str, Any] = {
359358
# Spot, Margin, and Futures trading Errors
360359
#

src/kraken/futures/funding.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def get_historical_funding_rates(
7878
Retrieve information about the historical funding rates of a specific
7979
``symbol``
8080
81-
- https://docs.futures.kraken.com/#http-api-trading-v3-api-historical-funding-rates-historicalfundingrates
81+
- https://docs.kraken.com/api/docs/futures-api/trading/historical-funding-rates
8282
8383
:param symbol: The futures symbol to filter for
8484
:type symbol: str
@@ -129,7 +129,7 @@ def initiate_wallet_transfer(
129129
Requires the ``General API - Full Access`` and ``Withdrawal API - Full
130130
access`` permissions in the API key settings.
131131
132-
- https://docs.futures.kraken.com/#http-api-trading-v3-api-transfers-initiate-wallet-transfer
132+
- https://docs.kraken.com/api/docs/futures-api/trading/transfer
133133
134134
:param amount: The volume to transfer
135135
:type amount: str | float
@@ -187,7 +187,7 @@ def initiate_subaccount_transfer(
187187
Requires the ``General API - Full Access`` and ``Withdrawal API - Full
188188
access`` permissions in the API key settings.
189189
190-
- https://docs.futures.kraken.com/#http-api-trading-v3-api-transfers-initiate-sub-account-transfer
190+
- https://docs.kraken.com/api/docs/futures-api/trading/sub-account-transfer
191191
192192
:param amount: The volume to transfer
193193
:type amount: str | float
@@ -215,6 +215,7 @@ def initiate_subaccount_transfer(
215215
... unit='XBT'
216216
... ))
217217
"""
218+
218219
return self.request( # type: ignore[return-value]
219220
method="POST",
220221
uri="/derivatives/api/v3/transfer/subaccount",
@@ -244,7 +245,7 @@ def initiate_withdrawal_to_spot_wallet(
244245
Requires the ``General API - Full Access`` and ``Withdrawal API - Full
245246
access`` permissions in the API key settings.
246247
247-
- https://docs.futures.kraken.com/#http-api-trading-v3-api-transfers-initiate-withdrawal-to-spot-wallet
248+
- https://docs.kraken.com/api/docs/futures-api/trading/withdrawal
248249
249250
:param amount: The volume to transfer
250251
:type amount: str | float

src/kraken/futures/market.py

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ def get_ohlc(
8484
Retrieve the open, high, low, and close data for a specific symbol and
8585
resolution. It is also possible to filter by time.
8686
87-
- https://docs.futures.kraken.com/#http-api-charts-ohlc-get-ohlc
88-
- https://support.kraken.com/hc/en-us/articles/4403284627220-OHLC
87+
- https://docs.kraken.com/api/docs/futures-api/charts/candles
8988
9089
:param tick_type: The kind of data, based on ``mark``, ``spot``, or
9190
``trade``
@@ -154,7 +153,7 @@ def get_tick_types(
154153
Retrieve the available tick types that can be used for example to access
155154
the :func:`kraken.futures.Market.get_ohlc` endpoint.
156155
157-
- https://docs.futures.kraken.com/#http-api-charts-ohlc-get-tick-types
156+
- https://docs.kraken.com/api/docs/futures-api/charts/tick-types
158157
159158
This function uses caching. Run ``get_tick_types.cache_clear()`` to
160159
clear.
@@ -188,7 +187,7 @@ def get_tradeable_products(
188187
"""
189188
Retrieve a list containing the tradeable assets on the futures market.
190189
191-
- https://docs.futures.kraken.com/#http-api-charts-ohlc-get-tradeable-products
190+
- https://docs.kraken.com/api/docs/futures-api/charts/symbols
192191
193192
This function uses caching. Run ``get_tradeable_products.cache_clear()``
194193
to clear.
@@ -226,7 +225,7 @@ def get_resolutions(
226225
"""
227226
Retrieve the list of available resolutions for a specific asset.
228227
229-
- https://docs.futures.kraken.com/#http-api-charts-ohlc-get-resolutions
228+
- https://docs.kraken.com/api/docs/futures-api/charts/resolutions
230229
231230
This function uses caching. Run ``get_resolutions.cache_clear()`` to
232231
clear.
@@ -264,9 +263,9 @@ def get_fee_schedules(
264263
"""
265264
Retrieve information about the current fees
266265
267-
- https://docs.futures.kraken.com/#http-api-trading-v3-api-fee-schedules-get-fee-schedules
266+
- https://docs.kraken.com/api/docs/futures-api/trading/get-fee-schedules-v-3
268267
269-
- https://support.kraken.com/hc/en-us/articles/360049269572-Fee-Schedules
268+
- https://www.kraken.com/features/fee-schedule
270269
271270
This function uses caching. Run ``get_fee_schedules.cache_clear()`` to
272271
clear.
@@ -316,7 +315,7 @@ def get_fee_schedules_vol(
316315
Requires the ``General API - Full Access`` permission in the API key
317316
settings.
318317
319-
- https://docs.futures.kraken.com/#http-api-trading-v3-api-fee-schedules-get-fee-schedule-volumes
318+
- https://docs.kraken.com/api/docs/futures-api/trading/get-user-fee-schedule-volumes-v-3
320319
321320
.. code-block:: python
322321
:linenos:
@@ -354,9 +353,7 @@ def get_orderbook(
354353
recommended to use the ``symbol`` parameter until they don't fix this
355354
issue.
356355
357-
- https://docs.futures.kraken.com/#http-api-trading-v3-api-market-data-get-orderbook
358-
359-
- https://support.kraken.com/hc/en-us/articles/360022839551-Order-Book
356+
- https://docs.kraken.com/api/docs/futures-api/trading/get-orderbook
360357
361358
:param symbol: The asset/symbol to get the orderbook from
362359
:type symbol: str, optional
@@ -408,9 +405,7 @@ def get_tickers(
408405
"""
409406
Retrieve information about the current tickers of all futures contracts.
410407
411-
- https://docs.futures.kraken.com/#http-api-trading-v3-api-market-data-get-tickers
412-
413-
- https://support.kraken.com/hc/en-us/articles/360022839531-Tickers
408+
- https://docs.kraken.com/api/docs/futures-api/trading/get-tickers
414409
415410
:return: The current tickers
416411
:rtype: dict
@@ -462,9 +457,7 @@ def get_instruments(
462457
Retrieve more specific information about the tradeable assets on the
463458
Futures market
464459
465-
- https://docs.futures.kraken.com/#http-api-trading-v3-api-instrument-details-get-instruments
466-
467-
- https://support.kraken.com/hc/en-us/articles/360022635672-Instruments
460+
- https://docs.kraken.com/api/docs/futures-api/trading/get-instruments
468461
469462
:return: Dictionary containing information for all tradeable assets
470463
:rtype: dict
@@ -552,9 +545,7 @@ def get_instruments_status(
552545
"""
553546
Retrieve status information of a specific or all futures contracts.
554547
555-
- https://docs.futures.kraken.com/#http-api-trading-v3-api-instrument-details-get-instrument-status-list
556-
557-
- https://docs.futures.kraken.com/#http-api-trading-v3-api-instrument-details-get-instrument-status
548+
- https://docs.kraken.com/api/docs/futures-api/trading/instrument-status
558549
559550
:param instrument: Filter by asset
560551
:type instrument: str | None, optional
@@ -600,9 +591,7 @@ def get_trade_history(
600591
Retrieve the trade history (max 100 entries), can be filtered using the
601592
parameters.
602593
603-
- https://docs.futures.kraken.com/#http-api-trading-v3-api-market-data-get-trade-history
604-
605-
- https://support.kraken.com/hc/en-us/articles/360022839511-History
594+
- https://docs.kraken.com/api/docs/futures-api/trading/get-history
606595
607596
:param symbol: The asset to filter for
608597
:type symbol: str, optional
@@ -659,7 +648,7 @@ def get_historical_funding_rates(
659648
Retrieve information about the historical funding rates for a specific
660649
asset.
661650
662-
- https://support.kraken.com/hc/en-us/articles/360061979852-Historical-Funding-Rates
651+
- https://docs.kraken.com/api/docs/futures-api/trading/historical-funding-rates
663652
664653
:param symbol: The symbol/asset/futures contract
665654
:type symbol: str
@@ -708,7 +697,7 @@ def get_leverage_preference(
708697
Requires at least the ``General API - Read Only`` permission in the API
709698
key settings.
710699
711-
- https://docs.futures.kraken.com/#http-api-trading-v3-api-multi-collateral-get-the-leverage-setting-for-a-market
700+
- https://docs.kraken.com/api/docs/futures-api/trading/get-leverage-setting
712701
713702
:return: The leverage preferences for all futures contracts
714703
:rtype: dict
@@ -747,7 +736,7 @@ def set_leverage_preference(
747736
Requires the ``General API - Full Access`` permission in the API key
748737
settings.
749738
750-
- https://docs.futures.kraken.com/#http-api-trading-v3-api-multi-collateral-set-the-leverage-setting-for-a-market
739+
- https://docs.kraken.com/api/docs/futures-api/trading/set-leverage-setting
751740
752741
:param symbol: The symbol to set the preference
753742
:type symbol: str, optional
@@ -789,7 +778,7 @@ def get_pnl_preference(
789778
Requires at least the ``General API - Read Only`` permission in the API
790779
key settings.
791780
792-
- https://docs.futures.kraken.com/#http-api-trading-v3-api-multi-collateral-get-pnl-currency-preference-for-a-market
781+
- https://docs.kraken.com/api/docs/futures-api/trading/get-pnl-currency-preference
793782
794783
:return: The current NPL preferences
795784
:rtype: dict
@@ -825,7 +814,7 @@ def set_pnl_preference(
825814
Requires the ``General API - Full Access`` permission in the API key
826815
settings.
827816
828-
- https://docs.futures.kraken.com/#http-api-trading-v3-api-multi-collateral-set-pnl-currency-preference-for-a-market
817+
- https://docs.kraken.com/api/docs/futures-api/trading/set-pnl-currency-preference
829818
830819
:param symbol: The asset pair or futures contract
831820
:type symbol: str
@@ -919,9 +908,7 @@ def get_public_execution_events(
919908
Retrieve information about the public execution events. The returned
920909
``continuation_token`` can be used to request more data.
921910
922-
- https://docs.futures.kraken.com/#http-api-history-market-history-get-public-execution-events
923-
924-
- https://support.kraken.com/hc/en-us/articles/4401755685268-Market-History-Executions
911+
- https://docs.kraken.com/api/docs/futures-api/history/get-public-execution-events
925912
926913
:param tradeable: The contract to filter for
927914
:type tradeable: str
@@ -1014,9 +1001,7 @@ def get_public_order_events(
10141001
opened, etc, for a specific contract.The returned ``continuation_token``
10151002
can be used to request more data.
10161003
1017-
- https://docs.futures.kraken.com/#http-api-history-market-history-get-public-order-events
1018-
1019-
- https://support.kraken.com/hc/en-us/articles/4401755906452-Market-History-Orders
1004+
- https://docs.kraken.com/api/docs/futures-api/history/get-public-order-events
10201005
10211006
:param tradeable: The contract to filter for
10221007
:type tradeable: str
@@ -1089,9 +1074,7 @@ def get_public_mark_price_events(
10891074
Retrieve information about public mark price events. The returned
10901075
``continuation_token`` can be used to request more data.
10911076
1092-
- https://docs.futures.kraken.com/#http-api-history-market-history-get-public-mark-price-events
1093-
1094-
- https://support.kraken.com/hc/en-us/articles/4401748276116-Market-History-Mark-Price
1077+
- https://docs.kraken.com/api/docs/futures-api/history/get-public-price-events
10951078
10961079
:param tradeable: The contract to filter for
10971080
:type tradeable: str

0 commit comments

Comments
 (0)