ccxt 4.1.54__py2.py3-none-any.whl → 4.1.56__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.

Potentially problematic release.


This version of ccxt might be problematic. Click here for more details.

Files changed (251) hide show
  1. ccxt/__init__.py +2 -2
  2. ccxt/abstract/binance.py +1 -0
  3. ccxt/abstract/binancecoinm.py +1 -0
  4. ccxt/abstract/binanceus.py +1 -0
  5. ccxt/abstract/binanceusdm.py +1 -0
  6. ccxt/abstract/bitbank.py +1 -0
  7. ccxt/abstract/coinbase.py +2 -0
  8. ccxt/abstract/htx.py +3 -0
  9. ccxt/abstract/huobi.py +3 -0
  10. ccxt/abstract/huobipro.py +3 -0
  11. ccxt/abstract/okex.py +3 -1
  12. ccxt/abstract/okex5.py +3 -1
  13. ccxt/abstract/okx.py +3 -1
  14. ccxt/ace.py +23 -23
  15. ccxt/alpaca.py +8 -8
  16. ccxt/ascendex.py +26 -26
  17. ccxt/async_support/__init__.py +2 -2
  18. ccxt/async_support/ace.py +23 -23
  19. ccxt/async_support/alpaca.py +8 -8
  20. ccxt/async_support/ascendex.py +26 -26
  21. ccxt/async_support/base/exchange.py +4 -2216
  22. ccxt/async_support/bigone.py +21 -24
  23. ccxt/async_support/binance.py +61 -54
  24. ccxt/async_support/bingx.py +28 -28
  25. ccxt/async_support/bit2c.py +9 -9
  26. ccxt/async_support/bitbank.py +11 -10
  27. ccxt/async_support/bitbns.py +11 -11
  28. ccxt/async_support/bitfinex.py +15 -15
  29. ccxt/async_support/bitfinex2.py +22 -22
  30. ccxt/async_support/bitflyer.py +13 -13
  31. ccxt/async_support/bitforex.py +10 -10
  32. ccxt/async_support/bitget.py +44 -44
  33. ccxt/async_support/bithumb.py +9 -9
  34. ccxt/async_support/bitmart.py +85 -104
  35. ccxt/async_support/bitmex.py +27 -27
  36. ccxt/async_support/bitopro.py +18 -18
  37. ccxt/async_support/bitpanda.py +18 -18
  38. ccxt/async_support/bitrue.py +14 -14
  39. ccxt/async_support/bitso.py +17 -17
  40. ccxt/async_support/bitstamp.py +17 -17
  41. ccxt/async_support/bittrex.py +22 -24
  42. ccxt/async_support/bitvavo.py +15 -15
  43. ccxt/async_support/bl3p.py +4 -4
  44. ccxt/async_support/blockchaincom.py +17 -17
  45. ccxt/async_support/btcalpha.py +14 -14
  46. ccxt/async_support/btcbox.py +9 -9
  47. ccxt/async_support/btcmarkets.py +17 -17
  48. ccxt/async_support/btcturk.py +9 -9
  49. ccxt/async_support/bybit.py +46 -46
  50. ccxt/async_support/cex.py +10 -10
  51. ccxt/async_support/coinbase.py +69 -25
  52. ccxt/async_support/coinbasepro.py +19 -19
  53. ccxt/async_support/coincheck.py +10 -10
  54. ccxt/async_support/coinex.py +57 -66
  55. ccxt/async_support/coinlist.py +22 -22
  56. ccxt/async_support/coinmate.py +10 -10
  57. ccxt/async_support/coinone.py +10 -10
  58. ccxt/async_support/coinsph.py +17 -17
  59. ccxt/async_support/coinspot.py +5 -5
  60. ccxt/async_support/cryptocom.py +27 -27
  61. ccxt/async_support/currencycom.py +18 -18
  62. ccxt/async_support/delta.py +21 -21
  63. ccxt/async_support/deribit.py +24 -24
  64. ccxt/async_support/digifinex.py +35 -35
  65. ccxt/async_support/exmo.py +19 -19
  66. ccxt/async_support/gate.py +38 -38
  67. ccxt/async_support/gemini.py +11 -11
  68. ccxt/async_support/hitbtc.py +27 -27
  69. ccxt/async_support/hollaex.py +19 -19
  70. ccxt/async_support/htx.py +47 -44
  71. ccxt/async_support/huobijp.py +22 -22
  72. ccxt/async_support/idex.py +20 -20
  73. ccxt/async_support/independentreserve.py +9 -9
  74. ccxt/async_support/indodax.py +10 -10
  75. ccxt/async_support/kraken.py +25 -25
  76. ccxt/async_support/krakenfutures.py +17 -17
  77. ccxt/async_support/kucoin.py +27 -27
  78. ccxt/async_support/kucoinfutures.py +20 -20
  79. ccxt/async_support/kuna.py +19 -19
  80. ccxt/async_support/latoken.py +14 -14
  81. ccxt/async_support/lbank.py +18 -18
  82. ccxt/async_support/luno.py +14 -14
  83. ccxt/async_support/lykke.py +12 -12
  84. ccxt/async_support/mercado.py +11 -11
  85. ccxt/async_support/mexc.py +36 -36
  86. ccxt/async_support/ndax.py +18 -18
  87. ccxt/async_support/novadax.py +17 -17
  88. ccxt/async_support/oceanex.py +12 -12
  89. ccxt/async_support/okcoin.py +19 -19
  90. ccxt/async_support/okx.py +48 -45
  91. ccxt/async_support/p2b.py +6 -6
  92. ccxt/async_support/paymium.py +6 -6
  93. ccxt/async_support/phemex.py +57 -57
  94. ccxt/async_support/poloniex.py +31 -30
  95. ccxt/async_support/poloniexfutures.py +16 -16
  96. ccxt/async_support/probit.py +22 -22
  97. ccxt/async_support/tidex.py +15 -15
  98. ccxt/async_support/timex.py +20 -20
  99. ccxt/async_support/tokocrypto.py +16 -16
  100. ccxt/async_support/upbit.py +15 -15
  101. ccxt/async_support/wavesexchange.py +12 -12
  102. ccxt/async_support/wazirx.py +13 -13
  103. ccxt/async_support/whitebit.py +26 -26
  104. ccxt/async_support/woo.py +47 -47
  105. ccxt/async_support/yobit.py +8 -8
  106. ccxt/async_support/zaif.py +10 -10
  107. ccxt/async_support/zonda.py +16 -16
  108. ccxt/base/errors.py +17 -16
  109. ccxt/base/exchange.py +57 -97
  110. ccxt/base/types.py +138 -139
  111. ccxt/bigone.py +21 -24
  112. ccxt/binance.py +61 -54
  113. ccxt/bingx.py +28 -28
  114. ccxt/bit2c.py +9 -9
  115. ccxt/bitbank.py +11 -10
  116. ccxt/bitbns.py +11 -11
  117. ccxt/bitfinex.py +15 -15
  118. ccxt/bitfinex2.py +22 -22
  119. ccxt/bitflyer.py +13 -13
  120. ccxt/bitforex.py +10 -10
  121. ccxt/bitget.py +44 -44
  122. ccxt/bithumb.py +9 -9
  123. ccxt/bitmart.py +85 -104
  124. ccxt/bitmex.py +27 -27
  125. ccxt/bitopro.py +18 -18
  126. ccxt/bitpanda.py +18 -18
  127. ccxt/bitrue.py +14 -14
  128. ccxt/bitso.py +17 -17
  129. ccxt/bitstamp.py +17 -17
  130. ccxt/bittrex.py +22 -24
  131. ccxt/bitvavo.py +15 -15
  132. ccxt/bl3p.py +4 -4
  133. ccxt/blockchaincom.py +17 -17
  134. ccxt/btcalpha.py +14 -14
  135. ccxt/btcbox.py +9 -9
  136. ccxt/btcmarkets.py +17 -17
  137. ccxt/btcturk.py +9 -9
  138. ccxt/bybit.py +46 -46
  139. ccxt/cex.py +10 -10
  140. ccxt/coinbase.py +69 -25
  141. ccxt/coinbasepro.py +19 -19
  142. ccxt/coincheck.py +10 -10
  143. ccxt/coinex.py +57 -66
  144. ccxt/coinlist.py +22 -22
  145. ccxt/coinmate.py +10 -10
  146. ccxt/coinone.py +10 -10
  147. ccxt/coinsph.py +17 -17
  148. ccxt/coinspot.py +5 -5
  149. ccxt/cryptocom.py +27 -27
  150. ccxt/currencycom.py +18 -18
  151. ccxt/delta.py +21 -21
  152. ccxt/deribit.py +24 -24
  153. ccxt/digifinex.py +35 -35
  154. ccxt/exmo.py +19 -19
  155. ccxt/gate.py +38 -38
  156. ccxt/gemini.py +11 -11
  157. ccxt/hitbtc.py +27 -27
  158. ccxt/hollaex.py +19 -19
  159. ccxt/htx.py +47 -44
  160. ccxt/huobijp.py +22 -22
  161. ccxt/idex.py +20 -20
  162. ccxt/independentreserve.py +9 -9
  163. ccxt/indodax.py +10 -10
  164. ccxt/kraken.py +25 -25
  165. ccxt/krakenfutures.py +17 -17
  166. ccxt/kucoin.py +27 -27
  167. ccxt/kucoinfutures.py +20 -20
  168. ccxt/kuna.py +19 -19
  169. ccxt/latoken.py +14 -14
  170. ccxt/lbank.py +18 -18
  171. ccxt/luno.py +14 -14
  172. ccxt/lykke.py +12 -12
  173. ccxt/mercado.py +11 -11
  174. ccxt/mexc.py +36 -36
  175. ccxt/ndax.py +18 -18
  176. ccxt/novadax.py +17 -17
  177. ccxt/oceanex.py +12 -12
  178. ccxt/okcoin.py +19 -19
  179. ccxt/okx.py +48 -45
  180. ccxt/p2b.py +6 -6
  181. ccxt/paymium.py +6 -6
  182. ccxt/phemex.py +57 -57
  183. ccxt/poloniex.py +31 -30
  184. ccxt/poloniexfutures.py +16 -16
  185. ccxt/pro/__init__.py +1 -1
  186. ccxt/pro/alpaca.py +3 -3
  187. ccxt/pro/ascendex.py +2 -2
  188. ccxt/pro/binance.py +9 -9
  189. ccxt/pro/bingx.py +3 -3
  190. ccxt/pro/bitfinex.py +3 -3
  191. ccxt/pro/bitfinex2.py +3 -3
  192. ccxt/pro/bitget.py +3 -3
  193. ccxt/pro/bitmart.py +2 -2
  194. ccxt/pro/bitmex.py +3 -3
  195. ccxt/pro/bitpanda.py +3 -3
  196. ccxt/pro/bitrue.py +2 -2
  197. ccxt/pro/bitstamp.py +2 -2
  198. ccxt/pro/bittrex.py +3 -3
  199. ccxt/pro/bitvavo.py +3 -3
  200. ccxt/pro/blockchaincom.py +2 -2
  201. ccxt/pro/bybit.py +4 -4
  202. ccxt/pro/cex.py +3 -3
  203. ccxt/pro/coinbasepro.py +3 -3
  204. ccxt/pro/coinex.py +2 -2
  205. ccxt/pro/cryptocom.py +5 -5
  206. ccxt/pro/deribit.py +3 -3
  207. ccxt/pro/exmo.py +2 -2
  208. ccxt/pro/gate.py +3 -3
  209. ccxt/pro/gemini.py +2 -2
  210. ccxt/pro/hitbtc.py +4 -4
  211. ccxt/pro/hollaex.py +3 -3
  212. ccxt/pro/htx.py +3 -3
  213. ccxt/pro/idex.py +3 -3
  214. ccxt/pro/kraken.py +7 -7
  215. ccxt/pro/krakenfutures.py +4 -4
  216. ccxt/pro/kucoin.py +3 -3
  217. ccxt/pro/kucoinfutures.py +3 -3
  218. ccxt/pro/mexc.py +3 -3
  219. ccxt/pro/okcoin.py +2 -2
  220. ccxt/pro/okx.py +6 -6
  221. ccxt/pro/phemex.py +3 -3
  222. ccxt/pro/poloniex.py +3 -3
  223. ccxt/pro/poloniexfutures.py +3 -3
  224. ccxt/pro/probit.py +3 -3
  225. ccxt/pro/wazirx.py +3 -3
  226. ccxt/pro/whitebit.py +3 -3
  227. ccxt/pro/woo.py +2 -2
  228. ccxt/probit.py +22 -22
  229. ccxt/test/base/test_shared_methods.py +3 -3
  230. ccxt/test/test_async.py +543 -535
  231. ccxt/test/test_sync.py +542 -534
  232. ccxt/tidex.py +15 -15
  233. ccxt/timex.py +20 -20
  234. ccxt/tokocrypto.py +16 -16
  235. ccxt/upbit.py +15 -15
  236. ccxt/wavesexchange.py +12 -12
  237. ccxt/wazirx.py +13 -13
  238. ccxt/whitebit.py +26 -26
  239. ccxt/woo.py +47 -47
  240. ccxt/yobit.py +8 -8
  241. ccxt/zaif.py +10 -10
  242. ccxt/zonda.py +16 -16
  243. {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/METADATA +10 -8
  244. ccxt-4.1.56.dist-info/RECORD +449 -0
  245. ccxt/async_support/bitstamp1.py +0 -402
  246. ccxt/async_support/lbank2.py +0 -2620
  247. ccxt/bitstamp1.py +0 -402
  248. ccxt/lbank2.py +0 -2619
  249. ccxt-4.1.54.dist-info/RECORD +0 -453
  250. {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/WHEEL +0 -0
  251. {ccxt-4.1.54.dist-info → ccxt-4.1.56.dist-info}/top_level.txt +0 -0
ccxt/okx.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.okx import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Greeks, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, String, Strings, Ticker, Tickers, Trade, Transaction
9
+ from ccxt.base.types import Balances, Currency, Greeks, Int, Market, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import PermissionDenied
@@ -203,6 +203,7 @@ class okx(Exchange, ImplicitAPI):
203
203
  'market/open-oracle': 50,
204
204
  'market/exchange-rate': 20,
205
205
  'market/index-components': 1,
206
+ 'public/economic-calendar': 50,
206
207
  'market/block-tickers': 1,
207
208
  'market/block-ticker': 1,
208
209
  'public/block-trades': 1,
@@ -334,7 +335,6 @@ class okx(Exchange, ImplicitAPI):
334
335
  'asset/subaccount/bills': 5 / 3,
335
336
  'asset/subaccount/managed-subaccount-bills': 5 / 3,
336
337
  'users/entrust-subaccount-list': 10,
337
- 'users/partner/if-rebate': 1,
338
338
  'account/subaccount/interest-limits': 4,
339
339
  # grid trading
340
340
  'tradingBot/grid/orders-algo-pending': 1,
@@ -381,6 +381,9 @@ class okx(Exchange, ImplicitAPI):
381
381
  'finance/sfp/dcd/orders': 2,
382
382
  'broker/fd/rebate-per-orders': 300,
383
383
  'broker/fd/if-rebate': 5,
384
+ # affiliate
385
+ 'affiliate/invitee/detail': 1,
386
+ 'users/partner/if-rebate': 1,
384
387
  },
385
388
  'post': {
386
389
  # rfq
@@ -1672,7 +1675,7 @@ class okx(Exchange, ImplicitAPI):
1672
1675
  timestamp = self.safe_integer(first, 'ts')
1673
1676
  return self.parse_order_book(first, symbol, timestamp)
1674
1677
 
1675
- def parse_ticker(self, ticker, market=None) -> Ticker:
1678
+ def parse_ticker(self, ticker, market: Market = None) -> Ticker:
1676
1679
  #
1677
1680
  # {
1678
1681
  # "instType": "SPOT",
@@ -1830,7 +1833,7 @@ class okx(Exchange, ImplicitAPI):
1830
1833
  type, query = self.handle_market_type_and_params('fetchTickers', market, params)
1831
1834
  return self.fetch_tickers_by_type(type, symbols, query)
1832
1835
 
1833
- def parse_trade(self, trade, market=None) -> Trade:
1836
+ def parse_trade(self, trade, market: Market = None) -> Trade:
1834
1837
  #
1835
1838
  # public fetchTrades
1836
1839
  #
@@ -1990,7 +1993,7 @@ class okx(Exchange, ImplicitAPI):
1990
1993
  data = self.safe_value(response, 'data', [])
1991
1994
  return self.parse_trades(data, market, since, limit)
1992
1995
 
1993
- def parse_ohlcv(self, ohlcv, market=None) -> list:
1996
+ def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
1994
1997
  #
1995
1998
  # [
1996
1999
  # "1678928760000", # timestamp
@@ -2108,7 +2111,7 @@ class okx(Exchange, ImplicitAPI):
2108
2111
  data = self.safe_value(response, 'data', [])
2109
2112
  return self.parse_ohlcvs(data, market, timeframe, since, limit)
2110
2113
 
2111
- def fetch_funding_rate_history(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
2114
+ def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
2112
2115
  """
2113
2116
  fetches historical funding rate prices
2114
2117
  :see: https://www.okx.com/docs-v5/en/#public-data-rest-api-get-funding-rate-history
@@ -2217,7 +2220,7 @@ class okx(Exchange, ImplicitAPI):
2217
2220
  result[code] = account
2218
2221
  return self.safe_balance(result)
2219
2222
 
2220
- def parse_trading_fee(self, fee, market=None):
2223
+ def parse_trading_fee(self, fee, market: Market = None):
2221
2224
  # https://www.okx.com/docs-v5/en/#rest-api-account-get-fee-rates
2222
2225
  #
2223
2226
  # {
@@ -2517,7 +2520,7 @@ class okx(Exchange, ImplicitAPI):
2517
2520
  request['ordType'] = 'ioc'
2518
2521
  elif fok:
2519
2522
  request['ordType'] = 'fok'
2520
- elif stopLossDefined or takeProfitDefined:
2523
+ if stopLossDefined or takeProfitDefined:
2521
2524
  if stopLossDefined:
2522
2525
  stopLossTriggerPrice = self.safe_value_n(stopLoss, ['triggerPrice', 'stopPrice', 'slTriggerPx'])
2523
2526
  if stopLossTriggerPrice is None:
@@ -2805,7 +2808,7 @@ class okx(Exchange, ImplicitAPI):
2805
2808
  order['side'] = side
2806
2809
  return order
2807
2810
 
2808
- def cancel_order(self, id: str, symbol: String = None, params={}):
2811
+ def cancel_order(self, id: str, symbol: Str = None, params={}):
2809
2812
  """
2810
2813
  cancels an open order
2811
2814
  :see: https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-cancel-order
@@ -2849,7 +2852,7 @@ class okx(Exchange, ImplicitAPI):
2849
2852
  else:
2850
2853
  return ids
2851
2854
 
2852
- def cancel_orders(self, ids, symbol: String = None, params={}):
2855
+ def cancel_orders(self, ids, symbol: Str = None, params={}):
2853
2856
  """
2854
2857
  cancel multiple orders
2855
2858
  :see: https://www.okx.com/docs-v5/en/#order-book-trading-trade-post-cancel-multiple-orders
@@ -2941,7 +2944,7 @@ class okx(Exchange, ImplicitAPI):
2941
2944
  }
2942
2945
  return self.safe_string(statuses, status, status)
2943
2946
 
2944
- def parse_order(self, order, market=None) -> Order:
2947
+ def parse_order(self, order, market: Market = None) -> Order:
2945
2948
  #
2946
2949
  # createOrder
2947
2950
  #
@@ -3141,7 +3144,7 @@ class okx(Exchange, ImplicitAPI):
3141
3144
  'reduceOnly': reduceOnly,
3142
3145
  }, market)
3143
3146
 
3144
- def fetch_order(self, id: str, symbol: String = None, params={}):
3147
+ def fetch_order(self, id: str, symbol: Str = None, params={}):
3145
3148
  """
3146
3149
  fetch an order by the id
3147
3150
  :see: https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-details
@@ -3278,7 +3281,7 @@ class okx(Exchange, ImplicitAPI):
3278
3281
  order = self.safe_value(data, 0)
3279
3282
  return self.parse_order(order, market)
3280
3283
 
3281
- def fetch_open_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
3284
+ def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
3282
3285
  """
3283
3286
  Fetch orders that are still open
3284
3287
  fetch all unfilled currently open orders
@@ -3427,7 +3430,7 @@ class okx(Exchange, ImplicitAPI):
3427
3430
  data = self.safe_value(response, 'data', [])
3428
3431
  return self.parse_orders(data, market, since, limit)
3429
3432
 
3430
- def fetch_canceled_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
3433
+ def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3431
3434
  """
3432
3435
  fetches information on multiple canceled orders made by the user
3433
3436
  :see: https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-history-last-7-days
@@ -3592,7 +3595,7 @@ class okx(Exchange, ImplicitAPI):
3592
3595
  data = self.safe_value(response, 'data', [])
3593
3596
  return self.parse_orders(data, market, since, limit)
3594
3597
 
3595
- def fetch_closed_orders(self, symbol: String = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
3598
+ def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
3596
3599
  """
3597
3600
  fetches information on multiple closed orders made by the user
3598
3601
  :see: https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-order-history-last-7-days
@@ -3754,7 +3757,7 @@ class okx(Exchange, ImplicitAPI):
3754
3757
  data = self.safe_value(response, 'data', [])
3755
3758
  return self.parse_orders(data, market, since, limit)
3756
3759
 
3757
- def fetch_my_trades(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
3760
+ def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3758
3761
  """
3759
3762
  fetch all trades made by the user
3760
3763
  :see: https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-transaction-details-last-3-months
@@ -3818,7 +3821,7 @@ class okx(Exchange, ImplicitAPI):
3818
3821
  data = self.safe_value(response, 'data', [])
3819
3822
  return self.parse_trades(data, market, since, limit, query)
3820
3823
 
3821
- def fetch_order_trades(self, id: str, symbol: String = None, since: Int = None, limit: Int = None, params={}):
3824
+ def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
3822
3825
  """
3823
3826
  fetch all the trades made from a single order
3824
3827
  :see: https://www.okx.com/docs-v5/en/#order-book-trading-trade-get-transaction-details-last-3-months
@@ -3838,7 +3841,7 @@ class okx(Exchange, ImplicitAPI):
3838
3841
  }
3839
3842
  return self.fetch_my_trades(symbol, since, limit, self.extend(request, params))
3840
3843
 
3841
- def fetch_ledger(self, code: String = None, since: Int = None, limit: Int = None, params={}):
3844
+ def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
3842
3845
  """
3843
3846
  fetch the history of changes, actions done by the user or operations that altered balance of the user
3844
3847
  :see: https://www.okx.com/docs-v5/en/#rest-api-account-get-bills-details-last-7-days
@@ -3960,7 +3963,7 @@ class okx(Exchange, ImplicitAPI):
3960
3963
  }
3961
3964
  return self.safe_string(types, type, type)
3962
3965
 
3963
- def parse_ledger_entry(self, item, currency=None):
3966
+ def parse_ledger_entry(self, item, currency: Currency = None):
3964
3967
  #
3965
3968
  # privateGetAccountBills, privateGetAccountBillsArchive
3966
3969
  #
@@ -4037,7 +4040,7 @@ class okx(Exchange, ImplicitAPI):
4037
4040
  'fee': fee,
4038
4041
  }
4039
4042
 
4040
- def parse_deposit_address(self, depositAddress, currency=None):
4043
+ def parse_deposit_address(self, depositAddress, currency: Currency = None):
4041
4044
  #
4042
4045
  # {
4043
4046
  # "addr": "okbtothemoon",
@@ -4272,7 +4275,7 @@ class okx(Exchange, ImplicitAPI):
4272
4275
  transaction = self.safe_value(data, 0)
4273
4276
  return self.parse_transaction(transaction, currency)
4274
4277
 
4275
- def fetch_deposits(self, code: String = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
4278
+ def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
4276
4279
  """
4277
4280
  fetch all deposits made to an account
4278
4281
  :see: https://www.okx.com/docs-v5/en/#rest-api-funding-get-deposit-history
@@ -4347,7 +4350,7 @@ class okx(Exchange, ImplicitAPI):
4347
4350
  data = self.safe_value(response, 'data', [])
4348
4351
  return self.parse_transactions(data, currency, since, limit, params)
4349
4352
 
4350
- def fetch_deposit(self, id: str, code: String = None, params={}):
4353
+ def fetch_deposit(self, id: str, code: Str = None, params={}):
4351
4354
  """
4352
4355
  fetch data on a currency deposit via the deposit id
4353
4356
  :see: https://www.okx.com/docs-v5/en/#rest-api-funding-get-deposit-history
@@ -4369,7 +4372,7 @@ class okx(Exchange, ImplicitAPI):
4369
4372
  deposit = self.safe_value(data, 0, {})
4370
4373
  return self.parse_transaction(deposit, currency)
4371
4374
 
4372
- def fetch_withdrawals(self, code: String = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
4375
+ def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
4373
4376
  """
4374
4377
  fetch all withdrawals made from an account
4375
4378
  :see: https://www.okx.com/docs-v5/en/#rest-api-funding-get-withdrawal-history
@@ -4436,7 +4439,7 @@ class okx(Exchange, ImplicitAPI):
4436
4439
  data = self.safe_value(response, 'data', [])
4437
4440
  return self.parse_transactions(data, currency, since, limit, params)
4438
4441
 
4439
- def fetch_withdrawal(self, id: str, code: String = None, params={}):
4442
+ def fetch_withdrawal(self, id: str, code: Str = None, params={}):
4440
4443
  """
4441
4444
  fetch data on a currency withdrawal via the withdrawal id
4442
4445
  :see: https://www.okx.com/docs-v5/en/#rest-api-funding-get-withdrawal-history
@@ -4516,7 +4519,7 @@ class okx(Exchange, ImplicitAPI):
4516
4519
  }
4517
4520
  return self.safe_string(statuses, status, status)
4518
4521
 
4519
- def parse_transaction(self, transaction, currency=None) -> Transaction:
4522
+ def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
4520
4523
  #
4521
4524
  # withdraw
4522
4525
  #
@@ -4798,7 +4801,7 @@ class okx(Exchange, ImplicitAPI):
4798
4801
  result.append(self.parse_position(positions[i]))
4799
4802
  return self.filter_by_array_positions(result, 'symbol', symbols, False)
4800
4803
 
4801
- def parse_position(self, position, market=None):
4804
+ def parse_position(self, position, market: Market = None):
4802
4805
  #
4803
4806
  # {
4804
4807
  # "adl": "3",
@@ -4987,7 +4990,7 @@ class okx(Exchange, ImplicitAPI):
4987
4990
  rawTransfer = self.safe_value(data, 0, {})
4988
4991
  return self.parse_transfer(rawTransfer, currency)
4989
4992
 
4990
- def parse_transfer(self, transfer, currency=None):
4993
+ def parse_transfer(self, transfer, currency: Currency = None):
4991
4994
  #
4992
4995
  # transfer
4993
4996
  #
@@ -5069,7 +5072,7 @@ class okx(Exchange, ImplicitAPI):
5069
5072
  }
5070
5073
  return self.safe_string(statuses, status, status)
5071
5074
 
5072
- def fetch_transfer(self, id: str, code: String = None, params={}):
5075
+ def fetch_transfer(self, id: str, code: Str = None, params={}):
5073
5076
  self.load_markets()
5074
5077
  request = {
5075
5078
  'transId': id,
@@ -5100,7 +5103,7 @@ class okx(Exchange, ImplicitAPI):
5100
5103
  transfer = self.safe_value(data, 0)
5101
5104
  return self.parse_transfer(transfer)
5102
5105
 
5103
- def fetch_transfers(self, code: String = None, since: Int = None, limit: Int = None, params={}):
5106
+ def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
5104
5107
  """
5105
5108
  fetch a history of internal transfers made on an account
5106
5109
  :see: https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-bills-details-last-3-months
@@ -5209,7 +5212,7 @@ class okx(Exchange, ImplicitAPI):
5209
5212
  headers['OK-ACCESS-SIGN'] = signature
5210
5213
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
5211
5214
 
5212
- def parse_funding_rate(self, contract, market=None):
5215
+ def parse_funding_rate(self, contract, market: Market = None):
5213
5216
  #
5214
5217
  # {
5215
5218
  # "fundingRate": "0.00027815",
@@ -5285,7 +5288,7 @@ class okx(Exchange, ImplicitAPI):
5285
5288
  entry = self.safe_value(data, 0, {})
5286
5289
  return self.parse_funding_rate(entry, market)
5287
5290
 
5288
- def fetch_funding_history(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
5291
+ def fetch_funding_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
5289
5292
  """
5290
5293
  fetch the history of funding payments paid and received on self account
5291
5294
  :see: https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-bills-details-last-3-months
@@ -5435,7 +5438,7 @@ class okx(Exchange, ImplicitAPI):
5435
5438
  sorted = self.sort_by(result, 'timestamp')
5436
5439
  return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
5437
5440
 
5438
- def set_leverage(self, leverage, symbol: String = None, params={}):
5441
+ def set_leverage(self, leverage, symbol: Str = None, params={}):
5439
5442
  """
5440
5443
  set the level of leverage for a market
5441
5444
  :see: https://www.okx.com/docs-v5/en/#rest-api-account-set-leverage
@@ -5487,7 +5490,7 @@ class okx(Exchange, ImplicitAPI):
5487
5490
  #
5488
5491
  return response
5489
5492
 
5490
- def set_position_mode(self, hedged, symbol: String = None, params={}):
5493
+ def set_position_mode(self, hedged, symbol: Str = None, params={}):
5491
5494
  """
5492
5495
  set hedged to True or False for a market
5493
5496
  :see: https://www.okx.com/docs-v5/en/#trading-account-rest-api-set-position-mode
@@ -5518,7 +5521,7 @@ class okx(Exchange, ImplicitAPI):
5518
5521
  #
5519
5522
  return response
5520
5523
 
5521
- def set_margin_mode(self, marginMode, symbol: String = None, params={}):
5524
+ def set_margin_mode(self, marginMode, symbol: Str = None, params={}):
5522
5525
  """
5523
5526
  set margin mode to 'cross' or 'isolated'
5524
5527
  :see: https://www.okx.com/docs-v5/en/#trading-account-rest-api-set-leverage
@@ -5630,7 +5633,7 @@ class okx(Exchange, ImplicitAPI):
5630
5633
  rate = self.safe_value(data, 0)
5631
5634
  return self.parse_borrow_rate(rate)
5632
5635
 
5633
- def parse_borrow_rate(self, info, currency=None):
5636
+ def parse_borrow_rate(self, info, currency: Currency = None):
5634
5637
  #
5635
5638
  # {
5636
5639
  # "amt": "992.10341195",
@@ -5793,7 +5796,7 @@ class okx(Exchange, ImplicitAPI):
5793
5796
  #
5794
5797
  return self.parse_margin_modification(response, market)
5795
5798
 
5796
- def parse_margin_modification(self, data, market=None):
5799
+ def parse_margin_modification(self, data, market: Market = None):
5797
5800
  innerData = self.safe_value(data, 'data', [])
5798
5801
  entry = self.safe_value(innerData, 0, {})
5799
5802
  errorCode = self.safe_string(data, 'code')
@@ -5887,7 +5890,7 @@ class okx(Exchange, ImplicitAPI):
5887
5890
  data = self.safe_value(response, 'data')
5888
5891
  return self.parse_market_leverage_tiers(data, market)
5889
5892
 
5890
- def parse_market_leverage_tiers(self, info, market=None):
5893
+ def parse_market_leverage_tiers(self, info, market: Market = None):
5891
5894
  """
5892
5895
  * @ignore
5893
5896
  :param dict info: Exchange response for 1 market
@@ -5925,7 +5928,7 @@ class okx(Exchange, ImplicitAPI):
5925
5928
  })
5926
5929
  return tiers
5927
5930
 
5928
- def fetch_borrow_interest(self, code: String = None, symbol: String = None, since: Int = None, limit: Int = None, params={}):
5931
+ def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
5929
5932
  """
5930
5933
  fetch the interest owed by the user for borrowing currency for margin trading
5931
5934
  :see: https://www.okx.com/docs-v5/en/#rest-api-account-get-interest-accrued-data
@@ -5981,7 +5984,7 @@ class okx(Exchange, ImplicitAPI):
5981
5984
  interest = self.parse_borrow_interests(data)
5982
5985
  return self.filter_by_currency_since_limit(interest, code, since, limit)
5983
5986
 
5984
- def parse_borrow_interest(self, info, market=None):
5987
+ def parse_borrow_interest(self, info, market: Market = None):
5985
5988
  instId = self.safe_string(info, 'instId')
5986
5989
  if instId is not None:
5987
5990
  market = self.safe_market(instId, market)
@@ -5998,7 +6001,7 @@ class okx(Exchange, ImplicitAPI):
5998
6001
  'info': info,
5999
6002
  }
6000
6003
 
6001
- def borrow_margin(self, code: str, amount, symbol: String = None, params={}):
6004
+ def borrow_margin(self, code: str, amount, symbol: Str = None, params={}):
6002
6005
  """
6003
6006
  create a loan to borrow margin
6004
6007
  :see: https://www.okx.com/docs-v5/en/#rest-api-account-vip-loans-borrow-and-repay
@@ -6040,7 +6043,7 @@ class okx(Exchange, ImplicitAPI):
6040
6043
  'symbol': symbol,
6041
6044
  })
6042
6045
 
6043
- def repay_margin(self, code: str, amount, symbol: String = None, params={}):
6046
+ def repay_margin(self, code: str, amount, symbol: Str = None, params={}):
6044
6047
  """
6045
6048
  repay borrowed margin and interest
6046
6049
  :see: https://www.okx.com/docs-v5/en/#rest-api-account-vip-loans-borrow-and-repay
@@ -6082,7 +6085,7 @@ class okx(Exchange, ImplicitAPI):
6082
6085
  'symbol': symbol,
6083
6086
  })
6084
6087
 
6085
- def parse_margin_loan(self, info, currency=None):
6088
+ def parse_margin_loan(self, info, currency: Currency = None):
6086
6089
  #
6087
6090
  # {
6088
6091
  # "amt": "102",
@@ -6205,7 +6208,7 @@ class okx(Exchange, ImplicitAPI):
6205
6208
  data = self.safe_value(response, 'data', [])
6206
6209
  return self.parse_open_interests(data, None, since, limit)
6207
6210
 
6208
- def parse_open_interest(self, interest, market=None):
6211
+ def parse_open_interest(self, interest, market: Market = None):
6209
6212
  #
6210
6213
  # fetchOpenInterestHistory
6211
6214
  #
@@ -6377,7 +6380,7 @@ class okx(Exchange, ImplicitAPI):
6377
6380
  depositWithdrawFees[code] = self.assign_default_deposit_withdraw_fees(depositWithdrawFees[code], currency)
6378
6381
  return depositWithdrawFees
6379
6382
 
6380
- def fetch_settlement_history(self, symbol: String = None, since: Int = None, limit: Int = None, params={}):
6383
+ def fetch_settlement_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
6381
6384
  """
6382
6385
  fetches historical settlement records
6383
6386
  :see: https://www.okx.com/docs-v5/en/#rest-api-public-data-get-delivery-exercise-history
@@ -6557,7 +6560,7 @@ class okx(Exchange, ImplicitAPI):
6557
6560
  if entryMarketId == marketId:
6558
6561
  return self.parse_greeks(entry, market)
6559
6562
 
6560
- def parse_greeks(self, greeks, market=None):
6563
+ def parse_greeks(self, greeks, market: Market = None):
6561
6564
  #
6562
6565
  # {
6563
6566
  # "askVol": "0",
ccxt/p2b.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.p2b import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Int, Order, OrderSide, OrderType, Strings, Ticker, Tickers
9
+ from ccxt.base.types import Int, Market, Order, OrderSide, OrderType, Strings, Ticker, Tickers
10
10
  from typing import List
11
11
  from ccxt.base.errors import ArgumentsRequired
12
12
  from ccxt.base.errors import BadRequest
@@ -114,7 +114,7 @@ class p2b(Exchange, ImplicitAPI):
114
114
  'urls': {
115
115
  'extension': '.json',
116
116
  'referral': 'https://p2pb2b.com?referral=ee784c53',
117
- 'logo': 'https://cdn.worldvectorlogo.com/logos/p2b-1.svg',
117
+ 'logo': 'https://github.com/ccxt/ccxt/assets/43336371/8da13a80-1f0a-49be-bb90-ff8b25164755',
118
118
  'api': {
119
119
  'public': 'https://api.p2pb2b.com/api/v2/public',
120
120
  'private': 'https://api.p2pb2b.com/api/v2',
@@ -416,7 +416,7 @@ class p2b(Exchange, ImplicitAPI):
416
416
  self.parse_ticker(result, market)
417
417
  )
418
418
 
419
- def parse_ticker(self, ticker, market=None):
419
+ def parse_ticker(self, ticker, market: Market = None):
420
420
  #
421
421
  # parseTickers
422
422
  #
@@ -570,7 +570,7 @@ class p2b(Exchange, ImplicitAPI):
570
570
  result = self.safe_value(response, 'result', [])
571
571
  return self.parse_trades(result, market, since, limit)
572
572
 
573
- def parse_trade(self, trade, market=None):
573
+ def parse_trade(self, trade, market: Market = None):
574
574
  #
575
575
  # fetchTrades
576
576
  #
@@ -683,7 +683,7 @@ class p2b(Exchange, ImplicitAPI):
683
683
  result = self.safe_value(response, 'result', [])
684
684
  return self.parse_ohlcvs(result, market, timeframe, since, limit)
685
685
 
686
- def parse_ohlcv(self, ohlcv, market=None) -> list:
686
+ def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
687
687
  #
688
688
  # [
689
689
  # 1699253400, # Kline open time
@@ -1094,7 +1094,7 @@ class p2b(Exchange, ImplicitAPI):
1094
1094
  orders = self.array_concat(orders, parsedOrders)
1095
1095
  return orders
1096
1096
 
1097
- def parse_order(self, order, market=None) -> Order:
1097
+ def parse_order(self, order, market: Market = None) -> Order:
1098
1098
  #
1099
1099
  # cancelOrder, fetchOpenOrders, createOrder
1100
1100
  #
ccxt/paymium.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.paymium import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Int, OrderBook, OrderSide, OrderType, String, Ticker, Trade
9
+ from ccxt.base.types import Balances, Currency, Int, Market, OrderBook, OrderSide, OrderType, Str, Ticker, Trade
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.decimal_to_precision import TICK_SIZE
@@ -158,7 +158,7 @@ class paymium(Exchange, ImplicitAPI):
158
158
  response = self.publicGetDataCurrencyDepth(self.extend(request, params))
159
159
  return self.parse_order_book(response, market['symbol'], None, 'bids', 'asks', 'price', 'amount')
160
160
 
161
- def parse_ticker(self, ticker, market=None) -> Ticker:
161
+ def parse_ticker(self, ticker, market: Market = None) -> Ticker:
162
162
  #
163
163
  # {
164
164
  # "high":"33740.82",
@@ -240,7 +240,7 @@ class paymium(Exchange, ImplicitAPI):
240
240
  #
241
241
  return self.parse_ticker(ticker, market)
242
242
 
243
- def parse_trade(self, trade, market=None) -> Trade:
243
+ def parse_trade(self, trade, market: Market = None) -> Trade:
244
244
  timestamp = self.safe_timestamp(trade, 'created_at_int')
245
245
  id = self.safe_string(trade, 'uuid')
246
246
  market = self.safe_market(None, market)
@@ -347,7 +347,7 @@ class paymium(Exchange, ImplicitAPI):
347
347
  #
348
348
  return self.parse_deposit_addresses(response, codes)
349
349
 
350
- def parse_deposit_address(self, depositAddress, currency=None):
350
+ def parse_deposit_address(self, depositAddress, currency: Currency = None):
351
351
  #
352
352
  # {
353
353
  # "address": "1HdjGr6WCTcnmW1tNNsHX7fh4Jr5C2PeKe",
@@ -394,7 +394,7 @@ class paymium(Exchange, ImplicitAPI):
394
394
  'id': response['uuid'],
395
395
  }, market)
396
396
 
397
- def cancel_order(self, id: str, symbol: String = None, params={}):
397
+ def cancel_order(self, id: str, symbol: Str = None, params={}):
398
398
  """
399
399
  cancels an open order
400
400
  :see: https://paymium.github.io/api-documentation/#tag/Order/paths/~1user~1orders~1%7Buuid%7D/delete
@@ -467,7 +467,7 @@ class paymium(Exchange, ImplicitAPI):
467
467
  #
468
468
  return self.parse_transfer(response, currency)
469
469
 
470
- def parse_transfer(self, transfer, currency=None):
470
+ def parse_transfer(self, transfer, currency: Currency = None):
471
471
  #
472
472
  # {
473
473
  # "uuid": "968f4580-e26c-4ad8-8bcd-874d23d55296",