ccxt 4.2.47__py2.py3-none-any.whl → 4.2.49__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/bitstamp.py +8 -0
  3. ccxt/abstract/indodax.py +9 -8
  4. ccxt/async_support/__init__.py +1 -1
  5. ccxt/async_support/base/exchange.py +1 -1
  6. ccxt/async_support/binance.py +9 -4
  7. ccxt/async_support/bitmart.py +24 -2
  8. ccxt/async_support/bitstamp.py +8 -0
  9. ccxt/async_support/btcalpha.py +4 -0
  10. ccxt/async_support/btcmarkets.py +4 -0
  11. ccxt/async_support/btcturk.py +4 -0
  12. ccxt/async_support/bybit.py +132 -6
  13. ccxt/async_support/idex.py +48 -1
  14. ccxt/async_support/independentreserve.py +47 -1
  15. ccxt/async_support/indodax.py +115 -19
  16. ccxt/async_support/latoken.py +16 -0
  17. ccxt/async_support/luno.py +18 -0
  18. ccxt/async_support/lykke.py +19 -0
  19. ccxt/async_support/ndax.py +18 -0
  20. ccxt/async_support/okx.py +32 -5
  21. ccxt/async_support/upbit.py +92 -17
  22. ccxt/base/exchange.py +2 -2
  23. ccxt/binance.py +9 -4
  24. ccxt/bitmart.py +24 -2
  25. ccxt/bitstamp.py +8 -0
  26. ccxt/btcalpha.py +4 -0
  27. ccxt/btcmarkets.py +4 -0
  28. ccxt/btcturk.py +4 -0
  29. ccxt/bybit.py +132 -6
  30. ccxt/idex.py +48 -1
  31. ccxt/independentreserve.py +47 -1
  32. ccxt/indodax.py +115 -19
  33. ccxt/latoken.py +16 -0
  34. ccxt/luno.py +18 -0
  35. ccxt/lykke.py +19 -0
  36. ccxt/ndax.py +18 -0
  37. ccxt/okx.py +32 -5
  38. ccxt/pro/__init__.py +1 -1
  39. ccxt/pro/ascendex.py +19 -7
  40. ccxt/pro/bitget.py +24 -7
  41. ccxt/pro/bitstamp.py +1 -1
  42. ccxt/pro/hitbtc.py +6 -11
  43. ccxt/pro/mexc.py +2 -1
  44. ccxt/test/test_async.py +10 -10
  45. ccxt/test/test_sync.py +10 -10
  46. ccxt/upbit.py +92 -17
  47. {ccxt-4.2.47.dist-info → ccxt-4.2.49.dist-info}/METADATA +4 -4
  48. {ccxt-4.2.47.dist-info → ccxt-4.2.49.dist-info}/RECORD +50 -50
  49. {ccxt-4.2.47.dist-info → ccxt-4.2.49.dist-info}/WHEEL +0 -0
  50. {ccxt-4.2.47.dist-info → ccxt-4.2.49.dist-info}/top_level.txt +0 -0
@@ -244,6 +244,7 @@ class latoken(Exchange, ImplicitAPI):
244
244
  async def fetch_time(self, params={}):
245
245
  """
246
246
  fetches the current integer timestamp in milliseconds from the exchange server
247
+ :see: https://api.latoken.com/doc/v2/#tag/Time/operation/currentTime
247
248
  :param dict [params]: extra parameters specific to the exchange API endpoint
248
249
  :returns int: the current integer timestamp in milliseconds from the exchange server
249
250
  """
@@ -258,6 +259,7 @@ class latoken(Exchange, ImplicitAPI):
258
259
  async def fetch_markets(self, params={}):
259
260
  """
260
261
  retrieves data on all markets for latoken
262
+ :see: https://api.latoken.com/doc/v2/#tag/Pair/operation/getActivePairs
261
263
  :param dict [params]: extra parameters specific to the exchange API endpoint
262
264
  :returns dict[]: an array of objects representing market data
263
265
  """
@@ -483,6 +485,7 @@ class latoken(Exchange, ImplicitAPI):
483
485
  async def fetch_balance(self, params={}) -> Balances:
484
486
  """
485
487
  query for balance and get the amount of funds available for trading or funds locked in orders
488
+ :see: https://api.latoken.com/doc/v2/#tag/Account/operation/getBalancesByUser
486
489
  :param dict [params]: extra parameters specific to the exchange API endpoint
487
490
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
488
491
  """
@@ -543,6 +546,7 @@ class latoken(Exchange, ImplicitAPI):
543
546
  async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
544
547
  """
545
548
  fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
549
+ :see: https://api.latoken.com/doc/v2/#tag/Order-Book/operation/getOrderBook
546
550
  :param str symbol: unified symbol of the market to fetch the order book for
547
551
  :param int [limit]: the maximum amount of order book entries to return
548
552
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -625,6 +629,7 @@ class latoken(Exchange, ImplicitAPI):
625
629
  async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
626
630
  """
627
631
  fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
632
+ :see: https://api.latoken.com/doc/v2/#tag/Ticker/operation/getTicker
628
633
  :param str symbol: unified symbol of the market to fetch the ticker for
629
634
  :param dict [params]: extra parameters specific to the exchange API endpoint
630
635
  :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -661,6 +666,7 @@ class latoken(Exchange, ImplicitAPI):
661
666
  async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
662
667
  """
663
668
  fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
669
+ :see: https://api.latoken.com/doc/v2/#tag/Ticker/operation/getAllTickers
664
670
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
665
671
  :param dict [params]: extra parameters specific to the exchange API endpoint
666
672
  :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -775,6 +781,7 @@ class latoken(Exchange, ImplicitAPI):
775
781
  async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
776
782
  """
777
783
  get the list of most recent trades for a particular symbol
784
+ :see: https://api.latoken.com/doc/v2/#tag/Trade/operation/getTradesByPair
778
785
  :param str symbol: unified symbol of the market to fetch trades for
779
786
  :param int [since]: timestamp in ms of the earliest trade to fetch
780
787
  :param int [limit]: the maximum amount of trades to fetch
@@ -804,6 +811,8 @@ class latoken(Exchange, ImplicitAPI):
804
811
  async def fetch_trading_fee(self, symbol: str, params={}):
805
812
  """
806
813
  fetch the trading fees for a market
814
+ :see: https://api.latoken.com/doc/v2/#tag/Trade/operation/getFeeByPair
815
+ :see: https://api.latoken.com/doc/v2/#tag/Trade/operation/getAuthFeeByPair
807
816
  :param str symbol: unified market symbol
808
817
  :param dict [params]: extra parameters specific to the exchange API endpoint
809
818
  :returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
@@ -868,6 +877,8 @@ class latoken(Exchange, ImplicitAPI):
868
877
  async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
869
878
  """
870
879
  fetch all trades made by the user
880
+ :see: https://api.latoken.com/doc/v2/#tag/Trade/operation/getTradesByTrader
881
+ :see: https://api.latoken.com/doc/v2/#tag/Trade/operation/getTradesByAssetAndTrader
871
882
  :param str symbol: unified market symbol
872
883
  :param int [since]: the earliest time in ms to fetch trades for
873
884
  :param int [limit]: the maximum number of trades structures to retrieve
@@ -1329,6 +1340,7 @@ class latoken(Exchange, ImplicitAPI):
1329
1340
  """
1330
1341
  * @deprecated
1331
1342
  use fetchDepositsWithdrawals instead
1343
+ :see: https://api.latoken.com/doc/v2/#tag/Transaction/operation/getUserTransactions
1332
1344
  :param str code: unified currency code for the currency of the transactions, default is None
1333
1345
  :param int [since]: timestamp in ms of the earliest transaction, default is None
1334
1346
  :param int [limit]: max number of transactions to return, default is None
@@ -1453,6 +1465,7 @@ class latoken(Exchange, ImplicitAPI):
1453
1465
  async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
1454
1466
  """
1455
1467
  fetch a history of internal transfers made on an account
1468
+ :see: https://api.latoken.com/doc/v2/#tag/Transfer/operation/getUsersTransfers
1456
1469
  :param str code: unified currency code of the currency transferred
1457
1470
  :param int [since]: the earliest time in ms to fetch transfers for
1458
1471
  :param int [limit]: the maximum number of transfers structures to retrieve
@@ -1499,6 +1512,9 @@ class latoken(Exchange, ImplicitAPI):
1499
1512
  async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
1500
1513
  """
1501
1514
  transfer currency internally between wallets on the same account
1515
+ :see: https://api.latoken.com/doc/v2/#tag/Transfer/operation/transferByEmail
1516
+ :see: https://api.latoken.com/doc/v2/#tag/Transfer/operation/transferById
1517
+ :see: https://api.latoken.com/doc/v2/#tag/Transfer/operation/transferByPhone
1502
1518
  :param str code: unified currency code
1503
1519
  :param float amount: amount to transfer
1504
1520
  :param str fromAccount: account to transfer from
@@ -183,6 +183,7 @@ class luno(Exchange, ImplicitAPI):
183
183
  async def fetch_markets(self, params={}):
184
184
  """
185
185
  retrieves data on all markets for luno
186
+ :see: https://www.luno.com/en/developers/api#tag/Market/operation/Markets
186
187
  :param dict [params]: extra parameters specific to the exchange API endpoint
187
188
  :returns dict[]: an array of objects representing market data
188
189
  """
@@ -270,6 +271,7 @@ class luno(Exchange, ImplicitAPI):
270
271
  async def fetch_accounts(self, params={}):
271
272
  """
272
273
  fetch all the accounts associated with a profile
274
+ :see: https://www.luno.com/en/developers/api#tag/Accounts/operation/getBalances
273
275
  :param dict [params]: extra parameters specific to the exchange API endpoint
274
276
  :returns dict: a dictionary of `account structures <https://docs.ccxt.com/#/?id=account-structure>` indexed by the account type
275
277
  """
@@ -318,6 +320,7 @@ class luno(Exchange, ImplicitAPI):
318
320
  async def fetch_balance(self, params={}) -> Balances:
319
321
  """
320
322
  query for balance and get the amount of funds available for trading or funds locked in orders
323
+ :see: https://www.luno.com/en/developers/api#tag/Accounts/operation/getBalances
321
324
  :param dict [params]: extra parameters specific to the exchange API endpoint
322
325
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
323
326
  """
@@ -338,6 +341,8 @@ class luno(Exchange, ImplicitAPI):
338
341
  async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
339
342
  """
340
343
  fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
344
+ :see: https://www.luno.com/en/developers/api#tag/Market/operation/GetOrderBookFull
345
+ :see: https://www.luno.com/en/developers/api#tag/Market/operation/GetOrderBook
341
346
  :param str symbol: unified symbol of the market to fetch the order book for
342
347
  :param int [limit]: the maximum amount of order book entries to return
343
348
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -438,6 +443,7 @@ class luno(Exchange, ImplicitAPI):
438
443
  async def fetch_order(self, id: str, symbol: Str = None, params={}):
439
444
  """
440
445
  fetches information on an order made by the user
446
+ :see: https://www.luno.com/en/developers/api#tag/Orders/operation/GetOrder
441
447
  :param str symbol: not used by luno fetchOrder
442
448
  :param dict [params]: extra parameters specific to the exchange API endpoint
443
449
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
@@ -465,6 +471,7 @@ class luno(Exchange, ImplicitAPI):
465
471
  async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
466
472
  """
467
473
  fetches information on multiple orders made by the user
474
+ :see: https://www.luno.com/en/developers/api#tag/Orders/operation/ListOrders
468
475
  :param str symbol: unified market symbol of the market orders were made in
469
476
  :param int [since]: the earliest time in ms to fetch orders for
470
477
  :param int [limit]: the maximum number of order structures to retrieve
@@ -476,6 +483,7 @@ class luno(Exchange, ImplicitAPI):
476
483
  async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
477
484
  """
478
485
  fetch all unfilled currently open orders
486
+ :see: https://www.luno.com/en/developers/api#tag/Orders/operation/ListOrders
479
487
  :param str symbol: unified market symbol
480
488
  :param int [since]: the earliest time in ms to fetch open orders for
481
489
  :param int [limit]: the maximum number of open orders structures to retrieve
@@ -487,6 +495,7 @@ class luno(Exchange, ImplicitAPI):
487
495
  async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
488
496
  """
489
497
  fetches information on multiple closed orders made by the user
498
+ :see: https://www.luno.com/en/developers/api#tag/Orders/operation/ListOrders
490
499
  :param str symbol: unified market symbol of the market orders were made in
491
500
  :param int [since]: the earliest time in ms to fetch orders for
492
501
  :param int [limit]: the maximum number of order structures to retrieve
@@ -535,6 +544,7 @@ class luno(Exchange, ImplicitAPI):
535
544
  async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
536
545
  """
537
546
  fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
547
+ :see: https://www.luno.com/en/developers/api#tag/Market/operation/GetTickers
538
548
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
539
549
  :param dict [params]: extra parameters specific to the exchange API endpoint
540
550
  :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -556,6 +566,7 @@ class luno(Exchange, ImplicitAPI):
556
566
  async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
557
567
  """
558
568
  fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
569
+ :see: https://www.luno.com/en/developers/api#tag/Market/operation/GetTicker
559
570
  :param str symbol: unified symbol of the market to fetch the ticker for
560
571
  :param dict [params]: extra parameters specific to the exchange API endpoint
561
572
  :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -664,6 +675,7 @@ class luno(Exchange, ImplicitAPI):
664
675
  async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
665
676
  """
666
677
  get the list of most recent trades for a particular symbol
678
+ :see: https://www.luno.com/en/developers/api#tag/Market/operation/ListTrades
667
679
  :param str symbol: unified symbol of the market to fetch trades for
668
680
  :param int [since]: timestamp in ms of the earliest trade to fetch
669
681
  :param int [limit]: the maximum amount of trades to fetch
@@ -757,6 +769,7 @@ class luno(Exchange, ImplicitAPI):
757
769
  async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
758
770
  """
759
771
  fetch all trades made by the user
772
+ :see: https://www.luno.com/en/developers/api#tag/Orders/operation/ListUserTrades
760
773
  :param str symbol: unified market symbol
761
774
  :param int [since]: the earliest time in ms to fetch trades for
762
775
  :param int [limit]: the maximum number of trades structures to retrieve
@@ -802,6 +815,7 @@ class luno(Exchange, ImplicitAPI):
802
815
  async def fetch_trading_fee(self, symbol: str, params={}):
803
816
  """
804
817
  fetch the trading fees for a market
818
+ :see: https://www.luno.com/en/developers/api#tag/Orders/operation/getFeeInfo
805
819
  :param str symbol: unified market symbol
806
820
  :param dict [params]: extra parameters specific to the exchange API endpoint
807
821
  :returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
@@ -829,6 +843,8 @@ class luno(Exchange, ImplicitAPI):
829
843
  async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
830
844
  """
831
845
  create a trade order
846
+ :see: https://www.luno.com/en/developers/api#tag/Orders/operation/PostMarketOrder
847
+ :see: https://www.luno.com/en/developers/api#tag/Orders/operation/PostLimitOrder
832
848
  :param str symbol: unified symbol of the market to create an order in
833
849
  :param str type: 'market' or 'limit'
834
850
  :param str side: 'buy' or 'sell'
@@ -864,6 +880,7 @@ class luno(Exchange, ImplicitAPI):
864
880
  async def cancel_order(self, id: str, symbol: Str = None, params={}):
865
881
  """
866
882
  cancels an open order
883
+ :see: https://www.luno.com/en/developers/api#tag/Orders/operation/StopOrder
867
884
  :param str id: order id
868
885
  :param str symbol: unified symbol of the market the order was made in
869
886
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -891,6 +908,7 @@ class luno(Exchange, ImplicitAPI):
891
908
  async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
892
909
  """
893
910
  fetch the history of changes, actions done by the user or operations that altered balance of the user
911
+ :see: https://www.luno.com/en/developers/api#tag/Accounts/operation/ListTransactions
894
912
  :param str code: unified currency code, default is None
895
913
  :param int [since]: timestamp in ms of the earliest ledger entry, default is None
896
914
  :param int [limit]: max number of ledger entrys to return, default is None
@@ -190,6 +190,7 @@ class lykke(Exchange, ImplicitAPI):
190
190
  async def fetch_currencies(self, params={}):
191
191
  """
192
192
  fetches all available currencies on an exchange
193
+ :see: https://lykkecity.github.io/Trading-API/#get-all-assets
193
194
  :param dict [params]: extra parameters specific to the exchange API endpoint
194
195
  :returns dict: an associative dictionary of currencies
195
196
  """
@@ -265,6 +266,7 @@ class lykke(Exchange, ImplicitAPI):
265
266
  async def fetch_markets(self, params={}):
266
267
  """
267
268
  retrieves data on all markets for lykke
269
+ :see: https://lykkecity.github.io/Trading-API/#get-asset-by-id
268
270
  :param dict [params]: extra parameters specific to the exchange API endpoint
269
271
  :returns dict[]: an array of objects representing market data
270
272
  """
@@ -421,6 +423,8 @@ class lykke(Exchange, ImplicitAPI):
421
423
  async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
422
424
  """
423
425
  fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
426
+ :see: https://lykkecity.github.io/Trading-API/#get-current-prices
427
+ :see: https://lykkecity.github.io/Trading-API/#24hr-ticker-price-change-statistics
424
428
  :param str symbol: unified symbol of the market to fetch the ticker for
425
429
  :param dict [params]: extra parameters specific to the exchange API endpoint
426
430
  :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -476,6 +480,7 @@ class lykke(Exchange, ImplicitAPI):
476
480
  async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
477
481
  """
478
482
  fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
483
+ :see: https://lykkecity.github.io/Trading-API/#24hr-ticker-price-change-statistics
479
484
  :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
480
485
  :param dict [params]: extra parameters specific to the exchange API endpoint
481
486
  :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -505,6 +510,7 @@ class lykke(Exchange, ImplicitAPI):
505
510
  async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
506
511
  """
507
512
  fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
513
+ :see: https://lykkecity.github.io/Trading-API/#asset-pair-order-book-ticker
508
514
  :param str symbol: unified symbol of the market to fetch the order book for
509
515
  :param int [limit]: the maximum amount of order book entries to return
510
516
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -605,6 +611,7 @@ class lykke(Exchange, ImplicitAPI):
605
611
  async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
606
612
  """
607
613
  get the list of most recent trades for a particular symbol
614
+ :see: https://lykkecity.github.io/Trading-API/#get-public-trades
608
615
  :param str symbol: unified symbol of the market to fetch trades for
609
616
  :param int [since]: timestamp in ms of the earliest trade to fetch
610
617
  :param int [limit]: the maximum amount of trades to fetch
@@ -665,6 +672,7 @@ class lykke(Exchange, ImplicitAPI):
665
672
  async def fetch_balance(self, params={}) -> Balances:
666
673
  """
667
674
  query for balance and get the amount of funds available for trading or funds locked in orders
675
+ :see: https://lykkecity.github.io/Trading-API/#get-the-current-balance
668
676
  :param dict [params]: extra parameters specific to the exchange API endpoint
669
677
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
670
678
  """
@@ -758,6 +766,8 @@ class lykke(Exchange, ImplicitAPI):
758
766
  async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
759
767
  """
760
768
  create a trade order
769
+ :see: https://lykkecity.github.io/Trading-API/#place-a-limit-order
770
+ :see: https://lykkecity.github.io/Trading-API/#place-a-market-order
761
771
  :param str symbol: unified symbol of the market to create an order in
762
772
  :param str type: 'market' or 'limit'
763
773
  :param str side: 'buy' or 'sell'
@@ -828,6 +838,7 @@ class lykke(Exchange, ImplicitAPI):
828
838
  async def cancel_order(self, id: str, symbol: Str = None, params={}):
829
839
  """
830
840
  cancels an open order
841
+ :see: https://lykkecity.github.io/Trading-API/#cancel-orders-by-id
831
842
  :param str id: order id
832
843
  :param str symbol: unified symbol of the market the order was made in
833
844
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -847,6 +858,7 @@ class lykke(Exchange, ImplicitAPI):
847
858
  async def cancel_all_orders(self, symbol: Str = None, params={}):
848
859
  """
849
860
  cancel all open orders
861
+ :see: https://lykkecity.github.io/Trading-API/#mass-cancel-orders
850
862
  :param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
851
863
  :param dict [params]: extra parameters specific to the exchange API endpoint
852
864
  :returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
@@ -870,6 +882,7 @@ class lykke(Exchange, ImplicitAPI):
870
882
  async def fetch_order(self, id: str, symbol: Str = None, params={}):
871
883
  """
872
884
  fetches information on an order made by the user
885
+ :see: https://lykkecity.github.io/Trading-API/#get-order-by-id
873
886
  :param str symbol: not used by lykke fetchOrder
874
887
  :param dict [params]: extra parameters specific to the exchange API endpoint
875
888
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
@@ -904,6 +917,7 @@ class lykke(Exchange, ImplicitAPI):
904
917
  async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
905
918
  """
906
919
  fetch all unfilled currently open orders
920
+ :see: https://lykkecity.github.io/Trading-API/#get-active-or-closed-orders
907
921
  :param str symbol: unified market symbol
908
922
  :param int [since]: the earliest time in ms to fetch open orders for
909
923
  :param int [limit]: the maximum number of open orders structures to retrieve
@@ -948,6 +962,7 @@ class lykke(Exchange, ImplicitAPI):
948
962
  async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
949
963
  """
950
964
  fetches information on multiple closed orders made by the user
965
+ :see: https://lykkecity.github.io/Trading-API/#get-active-or-closed-orders
951
966
  :param str symbol: unified market symbol of the market orders were made in
952
967
  :param int [since]: the earliest time in ms to fetch orders for
953
968
  :param int [limit]: the maximum number of order structures to retrieve
@@ -992,6 +1007,7 @@ class lykke(Exchange, ImplicitAPI):
992
1007
  async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
993
1008
  """
994
1009
  fetch all trades made by the user
1010
+ :see: https://lykkecity.github.io/Trading-API/#get-trade-history
995
1011
  :param str symbol: unified market symbol
996
1012
  :param int [since]: the earliest time in ms to fetch trades for
997
1013
  :param int [limit]: the maximum number of trades structures to retrieve
@@ -1046,6 +1062,7 @@ class lykke(Exchange, ImplicitAPI):
1046
1062
  async def fetch_deposit_address(self, code: str, params={}):
1047
1063
  """
1048
1064
  fetch the deposit address for a currency associated with self account
1065
+ :see: https://lykkecity.github.io/Trading-API/#get-deposit-address-for-a-given-asset
1049
1066
  :param str code: unified currency code
1050
1067
  :param dict [params]: extra parameters specific to the exchange API endpoint
1051
1068
  :returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
@@ -1139,6 +1156,7 @@ class lykke(Exchange, ImplicitAPI):
1139
1156
  async def fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
1140
1157
  """
1141
1158
  fetch history of deposits and withdrawals
1159
+ :see: https://lykkecity.github.io/Trading-API/#get-the-history-of-withdrawals-and-deposits
1142
1160
  :param str [code]: unified currency code for the currency of the deposit/withdrawals, default is None
1143
1161
  :param int [since]: timestamp in ms of the earliest deposit/withdrawal, default is None
1144
1162
  :param int [limit]: max number of deposit/withdrawals to return, default is None
@@ -1177,6 +1195,7 @@ class lykke(Exchange, ImplicitAPI):
1177
1195
  async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
1178
1196
  """
1179
1197
  make a withdrawal
1198
+ :see: https://lykkecity.github.io/Trading-API/#withdrawal
1180
1199
  :param str code: unified currency code
1181
1200
  :param float amount: the amount to withdraw
1182
1201
  :param str address: the address to withdraw to
@@ -284,6 +284,7 @@ class ndax(Exchange, ImplicitAPI):
284
284
  async def sign_in(self, params={}):
285
285
  """
286
286
  sign in, must be called prior to using other authenticated methods
287
+ :see: https://apidoc.ndax.io/#authenticate2fa
287
288
  :param dict [params]: extra parameters specific to the exchange API endpoint
288
289
  :returns: response from exchange
289
290
  """
@@ -331,6 +332,7 @@ class ndax(Exchange, ImplicitAPI):
331
332
  async def fetch_currencies(self, params={}):
332
333
  """
333
334
  fetches all available currencies on an exchange
335
+ :see: https://apidoc.ndax.io/#getproduct
334
336
  :param dict [params]: extra parameters specific to the exchange API endpoint
335
337
  :returns dict: an associative dictionary of currencies
336
338
  """
@@ -396,6 +398,7 @@ class ndax(Exchange, ImplicitAPI):
396
398
  async def fetch_markets(self, params={}):
397
399
  """
398
400
  retrieves data on all markets for ndax
401
+ :see: https://apidoc.ndax.io/#getinstruments
399
402
  :param dict [params]: extra parameters specific to the exchange API endpoint
400
403
  :returns dict[]: an array of objects representing market data
401
404
  """
@@ -548,6 +551,7 @@ class ndax(Exchange, ImplicitAPI):
548
551
  async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
549
552
  """
550
553
  fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
554
+ :see: https://apidoc.ndax.io/#getl2snapshot
551
555
  :param str symbol: unified symbol of the market to fetch the order book for
552
556
  :param int [limit]: the maximum amount of order book entries to return
553
557
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -656,6 +660,7 @@ class ndax(Exchange, ImplicitAPI):
656
660
  async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
657
661
  """
658
662
  fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
663
+ :see: https://apidoc.ndax.io/#getlevel1
659
664
  :param str symbol: unified symbol of the market to fetch the ticker for
660
665
  :param dict [params]: extra parameters specific to the exchange API endpoint
661
666
  :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
@@ -726,6 +731,7 @@ class ndax(Exchange, ImplicitAPI):
726
731
  async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
727
732
  """
728
733
  fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
734
+ :see: https://apidoc.ndax.io/#gettickerhistory
729
735
  :param str symbol: unified symbol of the market to fetch OHLCV data for
730
736
  :param str timeframe: the length of time each candle represents
731
737
  :param int [since]: timestamp in ms of the earliest candle to fetch
@@ -959,6 +965,7 @@ class ndax(Exchange, ImplicitAPI):
959
965
  async def fetch_accounts(self, params={}):
960
966
  """
961
967
  fetch all the accounts associated with a profile
968
+ :see: https://apidoc.ndax.io/#getuseraccounts
962
969
  :param dict [params]: extra parameters specific to the exchange API endpoint
963
970
  :returns dict: a dictionary of `account structures <https://docs.ccxt.com/#/?id=account-structure>` indexed by the account type
964
971
  """
@@ -1006,6 +1013,7 @@ class ndax(Exchange, ImplicitAPI):
1006
1013
  async def fetch_balance(self, params={}) -> Balances:
1007
1014
  """
1008
1015
  query for balance and get the amount of funds available for trading or funds locked in orders
1016
+ :see: https://apidoc.ndax.io/#getaccountpositions
1009
1017
  :param dict [params]: extra parameters specific to the exchange API endpoint
1010
1018
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
1011
1019
  """
@@ -1127,6 +1135,7 @@ class ndax(Exchange, ImplicitAPI):
1127
1135
  async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
1128
1136
  """
1129
1137
  fetch the history of changes, actions done by the user or operations that altered balance of the user
1138
+ :see: https://apidoc.ndax.io/#getaccounttransactions
1130
1139
  :param str code: unified currency code, default is None
1131
1140
  :param int [since]: timestamp in ms of the earliest ledger entry, default is None
1132
1141
  :param int [limit]: max number of ledger entrys to return, default is None
@@ -1277,6 +1286,7 @@ class ndax(Exchange, ImplicitAPI):
1277
1286
  async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
1278
1287
  """
1279
1288
  create a trade order
1289
+ :see: https://apidoc.ndax.io/#sendorder
1280
1290
  :param str symbol: unified symbol of the market to create an order in
1281
1291
  :param str type: 'market' or 'limit'
1282
1292
  :param str side: 'buy' or 'sell'
@@ -1385,6 +1395,7 @@ class ndax(Exchange, ImplicitAPI):
1385
1395
  async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
1386
1396
  """
1387
1397
  fetch all trades made by the user
1398
+ :see: https://apidoc.ndax.io/#gettradeshistory
1388
1399
  :param str symbol: unified market symbol
1389
1400
  :param int [since]: the earliest time in ms to fetch trades for
1390
1401
  :param int [limit]: the maximum number of trades structures to retrieve
@@ -1467,6 +1478,7 @@ class ndax(Exchange, ImplicitAPI):
1467
1478
  async def cancel_all_orders(self, symbol: Str = None, params={}):
1468
1479
  """
1469
1480
  cancel all open orders
1481
+ :see: https://apidoc.ndax.io/#cancelallorders
1470
1482
  :param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
1471
1483
  :param dict [params]: extra parameters specific to the exchange API endpoint
1472
1484
  :returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
@@ -1498,6 +1510,7 @@ class ndax(Exchange, ImplicitAPI):
1498
1510
  async def cancel_order(self, id: str, symbol: Str = None, params={}):
1499
1511
  """
1500
1512
  cancels an open order
1513
+ :see: https://apidoc.ndax.io/#cancelorder
1501
1514
  :param str id: order id
1502
1515
  :param str symbol: unified symbol of the market the order was made in
1503
1516
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -1532,6 +1545,7 @@ class ndax(Exchange, ImplicitAPI):
1532
1545
  async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1533
1546
  """
1534
1547
  fetch all unfilled currently open orders
1548
+ :see: https://apidoc.ndax.io/#getopenorders
1535
1549
  :param str symbol: unified market symbol
1536
1550
  :param int [since]: the earliest time in ms to fetch open orders for
1537
1551
  :param int [limit]: the maximum number of open orders structures to retrieve
@@ -1607,6 +1621,7 @@ class ndax(Exchange, ImplicitAPI):
1607
1621
  async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1608
1622
  """
1609
1623
  fetches information on multiple orders made by the user
1624
+ :see: https://apidoc.ndax.io/#getorderhistory
1610
1625
  :param str symbol: unified market symbol of the market orders were made in
1611
1626
  :param int [since]: the earliest time in ms to fetch orders for
1612
1627
  :param int [limit]: the maximum number of order structures to retrieve
@@ -1696,6 +1711,7 @@ class ndax(Exchange, ImplicitAPI):
1696
1711
  async def fetch_order(self, id: str, symbol: Str = None, params={}):
1697
1712
  """
1698
1713
  fetches information on an order made by the user
1714
+ :see: https://apidoc.ndax.io/#getorderstatus
1699
1715
  :param str symbol: unified symbol of the market the order was made in
1700
1716
  :param dict [params]: extra parameters specific to the exchange API endpoint
1701
1717
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
@@ -1768,6 +1784,7 @@ class ndax(Exchange, ImplicitAPI):
1768
1784
  async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
1769
1785
  """
1770
1786
  fetch all the trades made from a single order
1787
+ :see: https://apidoc.ndax.io/#getorderhistorybyorderid
1771
1788
  :param str id: order id
1772
1789
  :param str symbol: unified market symbol
1773
1790
  :param int [since]: the earliest time in ms to fetch trades for
@@ -1984,6 +2001,7 @@ class ndax(Exchange, ImplicitAPI):
1984
2001
  async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
1985
2002
  """
1986
2003
  fetch all withdrawals made from an account
2004
+ :see: https://apidoc.ndax.io/#getwithdraws
1987
2005
  :param str code: unified currency code
1988
2006
  :param int [since]: the earliest time in ms to fetch withdrawals for
1989
2007
  :param int [limit]: the maximum number of withdrawals structures to retrieve
ccxt/async_support/okx.py CHANGED
@@ -4893,6 +4893,7 @@ class okx(Exchange, ImplicitAPI):
4893
4893
  async def fetch_positions(self, symbols: Strings = None, params={}):
4894
4894
  """
4895
4895
  :see: https://www.okx.com/docs-v5/en/#rest-api-account-get-positions
4896
+ :see: https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-positions-history history
4896
4897
  fetch all open positions
4897
4898
  :param str[]|None symbols: list of unified market symbols
4898
4899
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -5025,13 +5026,38 @@ class okx(Exchange, ImplicitAPI):
5025
5026
  # "vegaBS": "",
5026
5027
  # "vegaPA": ""
5027
5028
  # }
5029
+ # history
5030
+ # {
5031
+ # "cTime":"1708351230102",
5032
+ # "ccy":"USDT",
5033
+ # "closeAvgPx":"1.2567",
5034
+ # "closeTotalPos":"40",
5035
+ # "direction":"short",
5036
+ # "fee":"-0.0351036",
5037
+ # "fundingFee":"0",
5038
+ # "instId":"SUSHI-USDT-SWAP",
5039
+ # "instType":"SWAP",
5040
+ # "lever":"10.0",
5041
+ # "liqPenalty":"0",
5042
+ # "mgnMode":"isolated",
5043
+ # "openAvgPx":"1.2462",
5044
+ # "openMaxPos":"40",
5045
+ # "pnl":"-0.42",
5046
+ # "pnlRatio":"-0.0912982667308618",
5047
+ # "posId":"666159086676836352",
5048
+ # "realizedPnl":"-0.4551036",
5049
+ # "triggerPx":"",
5050
+ # "type":"2",
5051
+ # "uTime":"1708354805699",
5052
+ # "uly":"SUSHI-USDT"
5053
+ # }
5028
5054
  #
5029
5055
  marketId = self.safe_string(position, 'instId')
5030
5056
  market = self.safe_market(marketId, market)
5031
5057
  symbol = market['symbol']
5032
5058
  pos = self.safe_string(position, 'pos') # 'pos' field: One way mode: 0 if position is not open, 1 if open | Two way(hedge) mode: -1 if short, 1 if long, 0 if position is not open
5033
5059
  contractsAbs = Precise.string_abs(pos)
5034
- side = self.safe_string(position, 'posSide')
5060
+ side = self.safe_string_2(position, 'posSide', 'direction')
5035
5061
  hedged = side != 'net'
5036
5062
  contracts = self.parse_number(contractsAbs)
5037
5063
  if market['margin']:
@@ -5061,7 +5087,7 @@ class okx(Exchange, ImplicitAPI):
5061
5087
  notional = self.parse_number(notionalString)
5062
5088
  marginMode = self.safe_string(position, 'mgnMode')
5063
5089
  initialMarginString = None
5064
- entryPriceString = self.safe_string(position, 'avgPx')
5090
+ entryPriceString = self.safe_string_2(position, 'avgPx', 'openAvgPx')
5065
5091
  unrealizedPnlString = self.safe_string(position, 'upl')
5066
5092
  leverageString = self.safe_string(position, 'lever')
5067
5093
  initialMarginPercentage = None
@@ -5088,23 +5114,24 @@ class okx(Exchange, ImplicitAPI):
5088
5114
  marginRatio = self.parse_number(Precise.string_div(maintenanceMarginString, collateralString, 4))
5089
5115
  return self.safe_position({
5090
5116
  'info': position,
5091
- 'id': None,
5117
+ 'id': self.safe_string(position, 'posId'),
5092
5118
  'symbol': symbol,
5093
5119
  'notional': notional,
5094
5120
  'marginMode': marginMode,
5095
5121
  'liquidationPrice': liquidationPrice,
5096
5122
  'entryPrice': self.parse_number(entryPriceString),
5097
5123
  'unrealizedPnl': self.parse_number(unrealizedPnlString),
5124
+ 'realizedPnl': self.safe_number(position, 'realizedPnl'),
5098
5125
  'percentage': percentage,
5099
5126
  'contracts': contracts,
5100
5127
  'contractSize': contractSize,
5101
5128
  'markPrice': self.parse_number(markPriceString),
5102
- 'lastPrice': None,
5129
+ 'lastPrice': self.safe_number(position, 'closeAvgPx'),
5103
5130
  'side': side,
5104
5131
  'hedged': hedged,
5105
5132
  'timestamp': timestamp,
5106
5133
  'datetime': self.iso8601(timestamp),
5107
- 'lastUpdateTimestamp': None,
5134
+ 'lastUpdateTimestamp': self.safe_integer(position, 'uTime'),
5108
5135
  'maintenanceMargin': maintenanceMargin,
5109
5136
  'maintenanceMarginPercentage': maintenanceMarginPercentage,
5110
5137
  'collateral': self.parse_number(collateralString),