ccxt 4.4.39__py2.py3-none-any.whl → 4.4.41__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 (137) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/bitmart.py +2 -0
  3. ccxt/abstract/okx.py +5 -0
  4. ccxt/ascendex.py +9 -9
  5. ccxt/async_support/__init__.py +1 -1
  6. ccxt/async_support/ascendex.py +9 -9
  7. ccxt/async_support/base/exchange.py +10 -3
  8. ccxt/async_support/base/ws/aiohttp_client.py +2 -2
  9. ccxt/async_support/binance.py +37 -41
  10. ccxt/async_support/bingx.py +4 -3
  11. ccxt/async_support/bit2c.py +0 -1
  12. ccxt/async_support/bitbank.py +0 -1
  13. ccxt/async_support/bitbns.py +0 -1
  14. ccxt/async_support/bitfinex.py +16 -17
  15. ccxt/async_support/bitfinex1.py +0 -1
  16. ccxt/async_support/bitflyer.py +0 -1
  17. ccxt/async_support/bitget.py +2 -2
  18. ccxt/async_support/bithumb.py +0 -1
  19. ccxt/async_support/bitmart.py +246 -6
  20. ccxt/async_support/bitmex.py +5 -6
  21. ccxt/async_support/bitopro.py +4 -5
  22. ccxt/async_support/bitrue.py +5 -7
  23. ccxt/async_support/bitso.py +1 -2
  24. ccxt/async_support/bitstamp.py +1 -2
  25. ccxt/async_support/bitteam.py +1 -3
  26. ccxt/async_support/bitvavo.py +2 -4
  27. ccxt/async_support/blockchaincom.py +5 -5
  28. ccxt/async_support/blofin.py +10 -10
  29. ccxt/async_support/btcalpha.py +0 -1
  30. ccxt/async_support/btcbox.py +0 -1
  31. ccxt/async_support/btcmarkets.py +1 -3
  32. ccxt/async_support/bybit.py +10 -11
  33. ccxt/async_support/cex.py +1 -1
  34. ccxt/async_support/coinbase.py +77 -1
  35. ccxt/async_support/coinbaseexchange.py +1 -1
  36. ccxt/async_support/coinbaseinternational.py +62 -0
  37. ccxt/async_support/coincatch.py +1 -1
  38. ccxt/async_support/coinex.py +9 -9
  39. ccxt/async_support/coinlist.py +1 -1
  40. ccxt/async_support/coinmetro.py +1 -1
  41. ccxt/async_support/cryptocom.py +91 -2
  42. ccxt/async_support/currencycom.py +1 -1
  43. ccxt/async_support/defx.py +1 -2
  44. ccxt/async_support/delta.py +1 -1
  45. ccxt/async_support/digifinex.py +1 -1
  46. ccxt/async_support/exmo.py +62 -6
  47. ccxt/async_support/gate.py +2 -2
  48. ccxt/async_support/hashkey.py +3 -5
  49. ccxt/async_support/htx.py +2 -2
  50. ccxt/async_support/hyperliquid.py +61 -2
  51. ccxt/async_support/kraken.py +124 -26
  52. ccxt/async_support/kucoin.py +29 -25
  53. ccxt/async_support/luno.py +1 -1
  54. ccxt/async_support/mexc.py +137 -1
  55. ccxt/async_support/ndax.py +1 -1
  56. ccxt/async_support/okcoin.py +18 -18
  57. ccxt/async_support/okx.py +27 -22
  58. ccxt/async_support/phemex.py +12 -8
  59. ccxt/async_support/poloniex.py +1 -1
  60. ccxt/async_support/poloniexfutures.py +6 -6
  61. ccxt/async_support/vertex.py +11 -11
  62. ccxt/async_support/woo.py +33 -33
  63. ccxt/async_support/woofipro.py +24 -24
  64. ccxt/async_support/xt.py +29 -27
  65. ccxt/async_support/zonda.py +1 -1
  66. ccxt/base/exchange.py +31 -19
  67. ccxt/base/types.py +10 -0
  68. ccxt/binance.py +37 -41
  69. ccxt/bingx.py +4 -3
  70. ccxt/bit2c.py +0 -1
  71. ccxt/bitbank.py +0 -1
  72. ccxt/bitbns.py +0 -1
  73. ccxt/bitfinex.py +16 -17
  74. ccxt/bitfinex1.py +0 -1
  75. ccxt/bitflyer.py +0 -1
  76. ccxt/bitget.py +2 -2
  77. ccxt/bithumb.py +0 -1
  78. ccxt/bitmart.py +246 -6
  79. ccxt/bitmex.py +5 -6
  80. ccxt/bitopro.py +4 -5
  81. ccxt/bitrue.py +5 -7
  82. ccxt/bitso.py +1 -2
  83. ccxt/bitstamp.py +1 -2
  84. ccxt/bitteam.py +1 -3
  85. ccxt/bitvavo.py +2 -4
  86. ccxt/blockchaincom.py +5 -5
  87. ccxt/blofin.py +10 -10
  88. ccxt/btcalpha.py +0 -1
  89. ccxt/btcbox.py +0 -1
  90. ccxt/btcmarkets.py +1 -3
  91. ccxt/bybit.py +10 -11
  92. ccxt/cex.py +1 -1
  93. ccxt/coinbase.py +77 -1
  94. ccxt/coinbaseexchange.py +1 -1
  95. ccxt/coinbaseinternational.py +62 -0
  96. ccxt/coincatch.py +1 -1
  97. ccxt/coinex.py +9 -9
  98. ccxt/coinlist.py +1 -1
  99. ccxt/coinmetro.py +1 -1
  100. ccxt/cryptocom.py +91 -2
  101. ccxt/currencycom.py +1 -1
  102. ccxt/defx.py +1 -2
  103. ccxt/delta.py +1 -1
  104. ccxt/digifinex.py +1 -1
  105. ccxt/exmo.py +62 -6
  106. ccxt/gate.py +2 -2
  107. ccxt/hashkey.py +3 -5
  108. ccxt/htx.py +2 -2
  109. ccxt/hyperliquid.py +61 -2
  110. ccxt/kraken.py +124 -26
  111. ccxt/kucoin.py +29 -25
  112. ccxt/luno.py +1 -1
  113. ccxt/mexc.py +137 -1
  114. ccxt/ndax.py +1 -1
  115. ccxt/okcoin.py +18 -18
  116. ccxt/okx.py +27 -22
  117. ccxt/phemex.py +12 -8
  118. ccxt/poloniex.py +1 -1
  119. ccxt/poloniexfutures.py +6 -6
  120. ccxt/pro/__init__.py +1 -1
  121. ccxt/pro/bitget.py +1 -1
  122. ccxt/pro/bybit.py +12 -1
  123. ccxt/pro/coinex.py +2 -2
  124. ccxt/pro/gate.py +6 -6
  125. ccxt/pro/kucoin.py +3 -3
  126. ccxt/pro/okx.py +11 -11
  127. ccxt/pro/upbit.py +2 -2
  128. ccxt/vertex.py +11 -11
  129. ccxt/woo.py +33 -33
  130. ccxt/woofipro.py +24 -24
  131. ccxt/xt.py +29 -27
  132. ccxt/zonda.py +1 -1
  133. {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/METADATA +4 -4
  134. {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/RECORD +137 -137
  135. {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/LICENSE.txt +0 -0
  136. {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/WHEEL +0 -0
  137. {ccxt-4.4.39.dist-info → ccxt-4.4.41.dist-info}/top_level.txt +0 -0
@@ -1563,16 +1563,16 @@ class okcoin(Exchange, ImplicitAPI):
1563
1563
  :param str id: order id
1564
1564
  :param str symbol: unified symbol of the market the order was made in
1565
1565
  :param dict [params]: extra parameters specific to the exchange API endpoint
1566
- :param bool [params.stop]: True if cancel trigger or conditional orders
1566
+ :param bool [params.trigger]: True if cancel trigger or conditional orders
1567
1567
  :param bool [params.advanced]: True if canceling advanced orders only
1568
1568
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1569
1569
  """
1570
1570
  if symbol is None:
1571
1571
  raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
1572
1572
  await self.load_markets()
1573
- stop = self.safe_value_2(params, 'stop', 'trigger')
1573
+ trigger = self.safe_value_2(params, 'stop', 'trigger')
1574
1574
  advanced = self.safe_value(params, 'advanced')
1575
- if stop or advanced:
1575
+ if trigger or advanced:
1576
1576
  orderInner = await self.cancel_orders([id], symbol, params)
1577
1577
  return self.safe_value(orderInner, 0)
1578
1578
  market = self.market(symbol)
@@ -1620,7 +1620,7 @@ class okcoin(Exchange, ImplicitAPI):
1620
1620
  if symbol is None:
1621
1621
  raise ArgumentsRequired(self.id + ' cancelOrders() requires a symbol argument')
1622
1622
  await self.load_markets()
1623
- stop = self.safe_value_2(params, 'stop', 'trigger')
1623
+ trigger = self.safe_value_2(params, 'stop', 'trigger')
1624
1624
  advanced = self.safe_value(params, 'advanced')
1625
1625
  params = self.omit(params, ['stop', 'trigger', 'advanced'])
1626
1626
  market = self.market(symbol)
@@ -1636,7 +1636,7 @@ class okcoin(Exchange, ImplicitAPI):
1636
1636
  'instId': market['id'],
1637
1637
  })
1638
1638
  for i in range(0, len(ids)):
1639
- if stop or advanced:
1639
+ if trigger or advanced:
1640
1640
  request.append({
1641
1641
  'algoId': ids[i],
1642
1642
  'instId': market['id'],
@@ -1653,7 +1653,7 @@ class okcoin(Exchange, ImplicitAPI):
1653
1653
  'clOrdId': clientOrderIds[i],
1654
1654
  })
1655
1655
  response = None
1656
- if stop:
1656
+ if trigger:
1657
1657
  response = await self.privatePostTradeCancelAlgos(request)
1658
1658
  elif advanced:
1659
1659
  response = await self.privatePostTradeCancelAdvanceAlgos(request)
@@ -1901,8 +1901,8 @@ class okcoin(Exchange, ImplicitAPI):
1901
1901
  # 'ordId': id,
1902
1902
  }
1903
1903
  clientOrderId = self.safe_string_2(params, 'clOrdId', 'clientOrderId')
1904
- stop = self.safe_value_2(params, 'stop', 'trigger')
1905
- if stop:
1904
+ trigger = self.safe_value_2(params, 'stop', 'trigger')
1905
+ if trigger:
1906
1906
  if clientOrderId is not None:
1907
1907
  request['algoClOrdId'] = clientOrderId
1908
1908
  else:
@@ -1914,7 +1914,7 @@ class okcoin(Exchange, ImplicitAPI):
1914
1914
  request['ordId'] = id
1915
1915
  query = self.omit(params, ['clientOrderId', 'stop', 'trigger'])
1916
1916
  response = None
1917
- if stop:
1917
+ if trigger:
1918
1918
  response = await self.privateGetTradeOrderAlgo(self.extend(request, query))
1919
1919
  else:
1920
1920
  response = await self.privateGetTradeOrder(self.extend(request, query))
@@ -1933,7 +1933,7 @@ class okcoin(Exchange, ImplicitAPI):
1933
1933
  :param int [since]: the earliest time in ms to fetch open orders for
1934
1934
  :param int [limit]: the maximum number of open orders structures to retrieve
1935
1935
  :param dict [params]: extra parameters specific to the exchange API endpoint
1936
- :param bool [params.stop]: True if fetching trigger or conditional orders
1936
+ :param bool [params.trigger]: True if fetching trigger or conditional orders
1937
1937
  :param str [params.ordType]: "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
1938
1938
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1939
1939
  """
@@ -1953,12 +1953,12 @@ class okcoin(Exchange, ImplicitAPI):
1953
1953
  if limit is not None:
1954
1954
  request['limit'] = limit # default 100, max 100
1955
1955
  ordType = self.safe_string(params, 'ordType')
1956
- stop = self.safe_value(params, 'stop') or (self.safe_string(params, 'ordType') is not None)
1957
- if stop and (ordType is None):
1956
+ trigger = self.safe_value(params, 'stop') or (self.safe_string(params, 'ordType') is not None)
1957
+ if trigger and (ordType is None):
1958
1958
  request['ordType'] = 'trigger' # default to trigger
1959
1959
  params = self.omit(params, ['stop'])
1960
1960
  response = None
1961
- if stop:
1961
+ if trigger:
1962
1962
  response = await self.privateGetTradeOrdersAlgoPending(self.extend(request, params))
1963
1963
  else:
1964
1964
  response = await self.privateGetTradeOrdersPending(self.extend(request, params))
@@ -1977,7 +1977,7 @@ class okcoin(Exchange, ImplicitAPI):
1977
1977
  :param int [since]: the earliest time in ms to fetch orders for
1978
1978
  :param int [limit]: the maximum number of order structures to retrieve
1979
1979
  :param dict [params]: extra parameters specific to the exchange API endpoint
1980
- :param bool [params.stop]: True if fetching trigger or conditional orders
1980
+ :param bool [params.trigger]: True if fetching trigger or conditional orders
1981
1981
  :param str [params.ordType]: "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
1982
1982
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1983
1983
  """
@@ -1990,12 +1990,12 @@ class okcoin(Exchange, ImplicitAPI):
1990
1990
  market = self.market(symbol)
1991
1991
  request['instId'] = market['id']
1992
1992
  ordType = self.safe_string(params, 'ordType')
1993
- stop = self.safe_value(params, 'stop') or (self.safe_string(params, 'ordType') is not None)
1994
- if stop and (ordType is None):
1993
+ trigger = self.safe_value(params, 'stop') or (self.safe_string(params, 'ordType') is not None)
1994
+ if trigger and (ordType is None):
1995
1995
  request['ordType'] = 'trigger' # default to trigger
1996
1996
  params = self.omit(params, ['stop'])
1997
1997
  response = None
1998
- if stop:
1998
+ if trigger:
1999
1999
  response = await self.privateGetTradeOrdersAlgoHistory(self.extend(request, params))
2000
2000
  else:
2001
2001
  method = None
@@ -2726,7 +2726,7 @@ class okcoin(Exchange, ImplicitAPI):
2726
2726
  :param int [since]: timestamp in ms of the earliest ledger entry, default is None
2727
2727
  :param int [limit]: max number of ledger entries to return, default is None
2728
2728
  :param dict [params]: extra parameters specific to the exchange API endpoint
2729
- :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
2729
+ :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
2730
2730
  """
2731
2731
  await self.load_markets()
2732
2732
  method = None
ccxt/async_support/okx.py CHANGED
@@ -286,6 +286,7 @@ class okx(Exchange, ImplicitAPI):
286
286
  'tradingBot/public/rsi-back-testing': 1,
287
287
  'asset/exchange-list': 5 / 3,
288
288
  'finance/staking-defi/eth/apy-history': 5 / 3,
289
+ 'finance/staking-defi/sol/apy-history': 5 / 3,
289
290
  'finance/savings/lending-rate-summary': 5 / 3,
290
291
  'finance/savings/lending-rate-history': 5 / 3,
291
292
  'finance/fixed-loan/lending-offers': 10 / 3,
@@ -424,6 +425,8 @@ class okx(Exchange, ImplicitAPI):
424
425
  'finance/staking-defi/eth/balance': 5 / 3,
425
426
  'finance/staking-defi/eth/purchase-redeem-history': 5 / 3,
426
427
  'finance/staking-defi/eth/product-info': 3,
428
+ 'finance/staking-defi/sol/balance': 5 / 3,
429
+ 'finance/staking-defi/sol/purchase-redeem-history': 5 / 3,
427
430
  # copytrading
428
431
  'copytrading/current-subpositions': 1,
429
432
  'copytrading/subpositions-history': 1,
@@ -558,6 +561,8 @@ class okx(Exchange, ImplicitAPI):
558
561
  # eth staking
559
562
  'finance/staking-defi/eth/purchase': 5,
560
563
  'finance/staking-defi/eth/redeem': 5,
564
+ 'finance/staking-defi/sol/purchase': 5,
565
+ 'finance/staking-defi/sol/redeem': 5,
561
566
  # copytrading
562
567
  'copytrading/algo-order': 1,
563
568
  'copytrading/close-subposition': 1,
@@ -3255,9 +3260,9 @@ class okx(Exchange, ImplicitAPI):
3255
3260
  """
3256
3261
  if symbol is None:
3257
3262
  raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
3258
- stop = self.safe_value_2(params, 'stop', 'trigger')
3263
+ trigger = self.safe_value_2(params, 'stop', 'trigger')
3259
3264
  trailing = self.safe_bool(params, 'trailing', False)
3260
- if stop or trailing:
3265
+ if trigger or trailing:
3261
3266
  orderInner = await self.cancel_orders([id], symbol, params)
3262
3267
  return self.safe_value(orderInner, 0)
3263
3268
  await self.load_markets()
@@ -3315,9 +3320,9 @@ class okx(Exchange, ImplicitAPI):
3315
3320
  method = self.safe_string(params, 'method', defaultMethod)
3316
3321
  clientOrderIds = self.parse_ids(self.safe_value_2(params, 'clOrdId', 'clientOrderId'))
3317
3322
  algoIds = self.parse_ids(self.safe_value(params, 'algoId'))
3318
- stop = self.safe_value_2(params, 'stop', 'trigger')
3323
+ trigger = self.safe_value_2(params, 'stop', 'trigger')
3319
3324
  trailing = self.safe_bool(params, 'trailing', False)
3320
- if stop or trailing:
3325
+ if trigger or trailing:
3321
3326
  method = 'privatePostTradeCancelAlgos'
3322
3327
  if clientOrderIds is None:
3323
3328
  ids = self.parse_ids(ids)
@@ -3328,7 +3333,7 @@ class okx(Exchange, ImplicitAPI):
3328
3333
  'instId': market['id'],
3329
3334
  })
3330
3335
  for i in range(0, len(ids)):
3331
- if trailing or stop:
3336
+ if trailing or trigger:
3332
3337
  request.append({
3333
3338
  'algoId': ids[i],
3334
3339
  'instId': market['id'],
@@ -3399,9 +3404,9 @@ class okx(Exchange, ImplicitAPI):
3399
3404
  options = self.safe_dict(self.options, 'cancelOrders', {})
3400
3405
  defaultMethod = self.safe_string(options, 'method', 'privatePostTradeCancelBatchOrders')
3401
3406
  method = self.safe_string(params, 'method', defaultMethod)
3402
- stop = self.safe_bool_2(params, 'stop', 'trigger')
3407
+ trigger = self.safe_bool_2(params, 'stop', 'trigger')
3403
3408
  trailing = self.safe_bool(params, 'trailing', False)
3404
- isStopOrTrailing = stop or trailing
3409
+ isStopOrTrailing = trigger or trailing
3405
3410
  if isStopOrTrailing:
3406
3411
  method = 'privatePostTradeCancelAlgos'
3407
3412
  for i in range(0, len(orders)):
@@ -3724,8 +3729,8 @@ class okx(Exchange, ImplicitAPI):
3724
3729
  options = self.safe_value(self.options, 'fetchOrder', {})
3725
3730
  defaultMethod = self.safe_string(options, 'method', 'privateGetTradeOrder')
3726
3731
  method = self.safe_string(params, 'method', defaultMethod)
3727
- stop = self.safe_value_2(params, 'stop', 'trigger')
3728
- if stop:
3732
+ trigger = self.safe_value_2(params, 'stop', 'trigger')
3733
+ if trigger:
3729
3734
  method = 'privateGetTradeOrderAlgo'
3730
3735
  if clientOrderId is not None:
3731
3736
  request['algoClOrdId'] = clientOrderId
@@ -3853,7 +3858,7 @@ class okx(Exchange, ImplicitAPI):
3853
3858
  :param int [since]: the earliest time in ms to fetch open orders for
3854
3859
  :param int [limit]: the maximum number of open orders structures to retrieve
3855
3860
  :param dict [params]: extra parameters specific to the exchange API endpoint
3856
- :param bool [params.stop]: True if fetching trigger or conditional orders
3861
+ :param bool [params.trigger]: True if fetching trigger or conditional orders
3857
3862
  :param str [params.ordType]: "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
3858
3863
  :param str [params.algoId]: Algo ID "'433845797218942976'"
3859
3864
  :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
@@ -3886,13 +3891,13 @@ class okx(Exchange, ImplicitAPI):
3886
3891
  defaultMethod = self.safe_string(options, 'method', 'privateGetTradeOrdersPending')
3887
3892
  method = self.safe_string(params, 'method', defaultMethod)
3888
3893
  ordType = self.safe_string(params, 'ordType')
3889
- stop = self.safe_value_2(params, 'stop', 'trigger')
3894
+ trigger = self.safe_value_2(params, 'stop', 'trigger')
3890
3895
  trailing = self.safe_bool(params, 'trailing', False)
3891
- if trailing or stop or (ordType in algoOrderTypes):
3896
+ if trailing or trigger or (ordType in algoOrderTypes):
3892
3897
  method = 'privateGetTradeOrdersAlgoPending'
3893
3898
  if trailing:
3894
3899
  request['ordType'] = 'move_order_stop'
3895
- elif stop and (ordType is None):
3900
+ elif trigger and (ordType is None):
3896
3901
  request['ordType'] = 'trigger'
3897
3902
  query = self.omit(params, ['method', 'stop', 'trigger', 'trailing'])
3898
3903
  response = None
@@ -4009,7 +4014,7 @@ class okx(Exchange, ImplicitAPI):
4009
4014
  :param int [since]: timestamp in ms of the earliest order, default is None
4010
4015
  :param int [limit]: max number of orders to return, default is None
4011
4016
  :param dict [params]: extra parameters specific to the exchange API endpoint
4012
- :param bool [params.stop]: True if fetching trigger or conditional orders
4017
+ :param bool [params.trigger]: True if fetching trigger or conditional orders
4013
4018
  :param str [params.ordType]: "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
4014
4019
  :param str [params.algoId]: Algo ID "'433845797218942976'"
4015
4020
  :param int [params.until]: timestamp in ms to fetch orders for
@@ -4044,18 +4049,18 @@ class okx(Exchange, ImplicitAPI):
4044
4049
  defaultMethod = self.safe_string(options, 'method', 'privateGetTradeOrdersHistory')
4045
4050
  method = self.safe_string(params, 'method', defaultMethod)
4046
4051
  ordType = self.safe_string(params, 'ordType')
4047
- stop = self.safe_value_2(params, 'stop', 'trigger')
4052
+ trigger = self.safe_value_2(params, 'stop', 'trigger')
4048
4053
  trailing = self.safe_bool(params, 'trailing', False)
4049
4054
  if trailing:
4050
4055
  method = 'privateGetTradeOrdersAlgoHistory'
4051
4056
  request['ordType'] = 'move_order_stop'
4052
- elif stop or (ordType in algoOrderTypes):
4057
+ elif trigger or (ordType in algoOrderTypes):
4053
4058
  method = 'privateGetTradeOrdersAlgoHistory'
4054
4059
  algoId = self.safe_string(params, 'algoId')
4055
4060
  if algoId is not None:
4056
4061
  request['algoId'] = algoId
4057
4062
  params = self.omit(params, 'algoId')
4058
- if stop:
4063
+ if trigger:
4059
4064
  if ordType is None:
4060
4065
  raise ArgumentsRequired(self.id + ' fetchCanceledOrders() requires an "ordType" string parameter, "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"')
4061
4066
  else:
@@ -4225,14 +4230,14 @@ class okx(Exchange, ImplicitAPI):
4225
4230
  defaultMethod = self.safe_string(options, 'method', 'privateGetTradeOrdersHistory')
4226
4231
  method = self.safe_string(params, 'method', defaultMethod)
4227
4232
  ordType = self.safe_string(params, 'ordType')
4228
- stop = self.safe_bool_2(params, 'stop', 'trigger')
4233
+ trigger = self.safe_bool_2(params, 'stop', 'trigger')
4229
4234
  trailing = self.safe_bool(params, 'trailing', False)
4230
- if trailing or stop or (ordType in algoOrderTypes):
4235
+ if trailing or trigger or (ordType in algoOrderTypes):
4231
4236
  method = 'privateGetTradeOrdersAlgoHistory'
4232
4237
  request['state'] = 'effective'
4233
4238
  if trailing:
4234
4239
  request['ordType'] = 'move_order_stop'
4235
- elif stop:
4240
+ elif trigger:
4236
4241
  if ordType is None:
4237
4242
  request['ordType'] = 'trigger'
4238
4243
  else:
@@ -4454,7 +4459,7 @@ class okx(Exchange, ImplicitAPI):
4454
4459
  :param str [params.marginMode]: 'cross' or 'isolated'
4455
4460
  :param int [params.until]: the latest time in ms to fetch entries for
4456
4461
  :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
4457
- :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
4462
+ :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
4458
4463
  """
4459
4464
  await self.load_markets()
4460
4465
  paginate = False
@@ -7034,7 +7039,7 @@ class okx(Exchange, ImplicitAPI):
7034
7039
  # }
7035
7040
  #
7036
7041
  data = self.safe_list(response, 'data', [])
7037
- return self.parse_open_interests(data, None, since, limit)
7042
+ return self.parse_open_interests_history(data, None, since, limit)
7038
7043
 
7039
7044
  def parse_open_interest(self, interest, market: Market = None):
7040
7045
  #
@@ -2804,15 +2804,15 @@ class phemex(Exchange, ImplicitAPI):
2804
2804
  raise ArgumentsRequired(self.id + ' cancelAllOrders() requires a symbol argument')
2805
2805
  await self.load_markets()
2806
2806
  market = self.market(symbol)
2807
- stop = self.safe_value_2(params, 'stop', 'trigger', False)
2808
- params = self.omit(params, 'stop', 'trigger')
2807
+ trigger = self.safe_value_2(params, 'stop', 'trigger', False)
2808
+ params = self.omit(params, ['stop', 'trigger'])
2809
2809
  request: dict = {
2810
2810
  'symbol': market['id'],
2811
2811
  # 'untriggerred': False, # False to cancel non-conditional orders, True to cancel conditional orders
2812
2812
  # 'text': 'up to 40 characters max',
2813
2813
  }
2814
- if stop:
2815
- request['untriggerred'] = stop
2814
+ if trigger:
2815
+ request['untriggerred'] = trigger
2816
2816
  response = None
2817
2817
  if market['settle'] == 'USDT':
2818
2818
  response = await self.privateDeleteGOrdersAll(self.extend(request, params))
@@ -3894,19 +3894,23 @@ class phemex(Exchange, ImplicitAPI):
3894
3894
  marketId = self.safe_string(contract, 'symbol')
3895
3895
  symbol = self.safe_symbol(marketId, market)
3896
3896
  timestamp = self.safe_integer_product(contract, 'timestamp', 0.000001)
3897
+ markEp = self.from_ep(self.safe_string(contract, 'markEp'), market)
3898
+ indexEp = self.from_ep(self.safe_string(contract, 'indexEp'), market)
3899
+ fundingRateEr = self.from_er(self.safe_string(contract, 'fundingRateEr'), market)
3900
+ nextFundingRateEr = self.from_er(self.safe_string(contract, 'predFundingRateEr'), market)
3897
3901
  return {
3898
3902
  'info': contract,
3899
3903
  'symbol': symbol,
3900
- 'markPrice': self.from_ep(self.safe_string_2(contract, 'markEp', 'markPriceRp'), market),
3901
- 'indexPrice': self.from_ep(self.safe_string_2(contract, 'indexEp', 'indexPriceRp'), market),
3904
+ 'markPrice': self.safe_number(contract, 'markPriceRp', markEp),
3905
+ 'indexPrice': self.safe_number(contract, 'indexPriceRp', indexEp),
3902
3906
  'interestRate': None,
3903
3907
  'estimatedSettlePrice': None,
3904
3908
  'timestamp': timestamp,
3905
3909
  'datetime': self.iso8601(timestamp),
3906
- 'fundingRate': self.from_er(self.safe_string(contract, 'fundingRateEr'), market),
3910
+ 'fundingRate': self.safe_number(contract, 'fundingRateRr', fundingRateEr),
3907
3911
  'fundingTimestamp': None,
3908
3912
  'fundingDatetime': None,
3909
- 'nextFundingRate': self.from_er(self.safe_string_2(contract, 'predFundingRateEr', 'predFundingRateRr'), market),
3913
+ 'nextFundingRate': self.safe_number(contract, 'predFundingRateRr', nextFundingRateEr),
3910
3914
  'nextFundingTimestamp': None,
3911
3915
  'nextFundingDatetime': None,
3912
3916
  'previousFundingRate': None,
@@ -1201,7 +1201,7 @@ class poloniex(Exchange, ImplicitAPI):
1201
1201
  :param int [since]: the earliest time in ms to fetch open orders for
1202
1202
  :param int [limit]: the maximum number of open orders structures to retrieve
1203
1203
  :param dict [params]: extra parameters specific to the exchange API endpoint
1204
- :param boolean [params.stop]: set True to fetch trigger orders instead of regular orders
1204
+ :param boolean [params.trigger]: set True to fetch trigger orders instead of regular orders
1205
1205
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1206
1206
  """
1207
1207
  await self.load_markets()
@@ -1180,17 +1180,17 @@ class poloniexfutures(Exchange, ImplicitAPI):
1180
1180
  cancel all open orders
1181
1181
  :param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
1182
1182
  :param dict [params]: extra parameters specific to the exchange API endpoint
1183
- :param dict [params.stop]: When True, all the trigger orders will be cancelled
1183
+ :param dict [params.trigger]: When True, all the trigger orders will be cancelled
1184
1184
  :returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1185
1185
  """
1186
1186
  await self.load_markets()
1187
1187
  request: dict = {}
1188
1188
  if symbol is not None:
1189
1189
  request['symbol'] = self.market_id(symbol)
1190
- stop = self.safe_value_2(params, 'stop', 'trigger')
1190
+ trigger = self.safe_value_2(params, 'stop', 'trigger')
1191
1191
  params = self.omit(params, ['stop', 'trigger'])
1192
1192
  response = None
1193
- if stop:
1193
+ if trigger:
1194
1194
  response = await self.privateDeleteStopOrders(self.extend(request, params))
1195
1195
  else:
1196
1196
  response = await self.privateDeleteOrders(self.extend(request, params))
@@ -1254,13 +1254,13 @@ class poloniexfutures(Exchange, ImplicitAPI):
1254
1254
  :returns: An `array of order structures <https://docs.ccxt.com/#/?id=order-structure>`
1255
1255
  """
1256
1256
  await self.load_markets()
1257
- stop = self.safe_value_2(params, 'stop', 'trigger')
1257
+ trigger = self.safe_value_2(params, 'stop', 'trigger')
1258
1258
  until = self.safe_integer(params, 'until')
1259
1259
  params = self.omit(params, ['trigger', 'stop', 'until'])
1260
1260
  if status == 'closed':
1261
1261
  status = 'done'
1262
1262
  request: dict = {}
1263
- if not stop:
1263
+ if not trigger:
1264
1264
  request['status'] = 'active' if (status == 'open') else 'done'
1265
1265
  elif status != 'open':
1266
1266
  raise BadRequest(self.id + ' fetchOrdersByStatus() can only fetch untriggered stop orders')
@@ -1273,7 +1273,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
1273
1273
  if until is not None:
1274
1274
  request['endAt'] = until
1275
1275
  response = None
1276
- if stop:
1276
+ if trigger:
1277
1277
  response = await self.privateGetStopOrders(self.extend(request, params))
1278
1278
  else:
1279
1279
  response = await self.privateGetOrders(self.extend(request, params))
@@ -1964,7 +1964,7 @@ class vertex(Exchange, ImplicitAPI):
1964
1964
  :param int [since]: the earliest time in ms to fetch open orders for
1965
1965
  :param int [limit]: the maximum number of open orders structures to retrieve
1966
1966
  :param dict [params]: extra parameters specific to the exchange API endpoint
1967
- :param boolean [params.stop]: whether the order is a stop/algo order
1967
+ :param boolean [params.trigger]: whether the order is a trigger/algo order
1968
1968
  :param str [params.user]: user address, will default to self.walletAddress if not provided
1969
1969
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
1970
1970
  """
@@ -1974,13 +1974,13 @@ class vertex(Exchange, ImplicitAPI):
1974
1974
  userAddress, params = self.handle_public_address('fetchOpenOrders', params)
1975
1975
  request = {}
1976
1976
  market: Market = None
1977
- stop = self.safe_bool_2(params, 'stop', 'trigger')
1977
+ trigger = self.safe_bool_2(params, 'stop', 'trigger')
1978
1978
  params = self.omit(params, ['stop', 'trigger'])
1979
1979
  if symbol is not None:
1980
1980
  market = self.market(symbol)
1981
1981
  request['product_id'] = self.parse_to_numeric(market['id'])
1982
1982
  response = None
1983
- if stop:
1983
+ if trigger:
1984
1984
  contracts = await self.query_contracts()
1985
1985
  chainId = self.safe_string(contracts, 'chain_id')
1986
1986
  verifyingContractAddress = self.safe_string(contracts, 'endpoint_addr')
@@ -2076,14 +2076,14 @@ class vertex(Exchange, ImplicitAPI):
2076
2076
  :param int [since]: the earliest time in ms to fetch open orders for
2077
2077
  :param int [limit]: the maximum number of open orders structures to retrieve
2078
2078
  :param dict [params]: extra parameters specific to the exchange API endpoint
2079
- :param boolean [params.stop]: whether the order is a stop/algo order
2079
+ :param boolean [params.trigger]: whether the order is a trigger/algo order
2080
2080
  :param str [params.user]: user address, will default to self.walletAddress if not provided
2081
2081
  :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
2082
2082
  """
2083
2083
  self.check_required_credentials()
2084
- stop = self.safe_bool_2(params, 'stop', 'trigger')
2084
+ trigger = self.safe_bool_2(params, 'stop', 'trigger')
2085
2085
  params = self.omit(params, ['stop', 'trigger'])
2086
- if not stop:
2086
+ if not trigger:
2087
2087
  raise NotSupported(self.id + ' fetchOrders only support trigger orders')
2088
2088
  userAddress = None
2089
2089
  userAddress, params = self.handle_public_address('fetchOrders', params)
@@ -2158,7 +2158,7 @@ class vertex(Exchange, ImplicitAPI):
2158
2158
  cancel all open orders in a market
2159
2159
  :param str symbol: unified market symbol
2160
2160
  :param dict [params]: extra parameters specific to the exchange API endpoint
2161
- :param boolean [params.stop]: whether the order is a stop/algo order
2161
+ :param boolean [params.trigger]: whether the order is a trigger/algo order
2162
2162
  :returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
2163
2163
  """
2164
2164
  self.check_required_credentials()
@@ -2189,10 +2189,10 @@ class vertex(Exchange, ImplicitAPI):
2189
2189
  'signature': self.build_cancel_all_orders_sig(cancels, chainId, verifyingContractAddress),
2190
2190
  },
2191
2191
  }
2192
- stop = self.safe_bool_2(params, 'stop', 'trigger')
2192
+ trigger = self.safe_bool_2(params, 'stop', 'trigger')
2193
2193
  params = self.omit(params, ['stop', 'trigger'])
2194
2194
  response = None
2195
- if stop:
2195
+ if trigger:
2196
2196
  response = await self.v1TriggerPostExecute(self.extend(request, params))
2197
2197
  #
2198
2198
  # {
@@ -2286,10 +2286,10 @@ class vertex(Exchange, ImplicitAPI):
2286
2286
  'signature': self.build_cancel_orders_sig(cancels, chainId, verifyingContractAddress),
2287
2287
  },
2288
2288
  }
2289
- stop = self.safe_bool_2(params, 'stop', 'trigger')
2289
+ trigger = self.safe_bool_2(params, 'stop', 'trigger')
2290
2290
  params = self.omit(params, ['stop', 'trigger'])
2291
2291
  response = None
2292
- if stop:
2292
+ if trigger:
2293
2293
  response = await self.v1TriggerPostExecute(self.extend(request, params))
2294
2294
  #
2295
2295
  # {