ccxt 4.4.52__py2.py3-none-any.whl → 4.4.53__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 (224) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/binance.py +0 -1
  3. ccxt/abstract/binancecoinm.py +0 -1
  4. ccxt/abstract/binanceus.py +0 -1
  5. ccxt/abstract/binanceusdm.py +0 -1
  6. ccxt/ace.py +3 -0
  7. ccxt/alpaca.py +5 -0
  8. ccxt/ascendex.py +2 -1
  9. ccxt/async_support/__init__.py +1 -1
  10. ccxt/async_support/ace.py +3 -0
  11. ccxt/async_support/alpaca.py +5 -0
  12. ccxt/async_support/ascendex.py +2 -1
  13. ccxt/async_support/base/exchange.py +20 -3
  14. ccxt/async_support/bigone.py +5 -0
  15. ccxt/async_support/binance.py +55 -69
  16. ccxt/async_support/bingx.py +25 -29
  17. ccxt/async_support/bit2c.py +3 -0
  18. ccxt/async_support/bitbank.py +3 -0
  19. ccxt/async_support/bitbns.py +3 -0
  20. ccxt/async_support/bitfinex.py +6 -1
  21. ccxt/async_support/bitflyer.py +6 -1
  22. ccxt/async_support/bitget.py +8 -4
  23. ccxt/async_support/bithumb.py +3 -1
  24. ccxt/async_support/bitmart.py +22 -12
  25. ccxt/async_support/bitmex.py +99 -93
  26. ccxt/async_support/bitopro.py +7 -2
  27. ccxt/async_support/bitrue.py +4 -0
  28. ccxt/async_support/bitso.py +5 -2
  29. ccxt/async_support/bitstamp.py +3 -0
  30. ccxt/async_support/bitteam.py +5 -0
  31. ccxt/async_support/bitvavo.py +4 -0
  32. ccxt/async_support/blockchaincom.py +4 -0
  33. ccxt/async_support/blofin.py +3 -0
  34. ccxt/async_support/btcalpha.py +5 -0
  35. ccxt/async_support/btcbox.py +3 -2
  36. ccxt/async_support/btcmarkets.py +5 -0
  37. ccxt/async_support/btcturk.py +3 -0
  38. ccxt/async_support/bybit.py +10 -4
  39. ccxt/async_support/cex.py +2 -0
  40. ccxt/async_support/coinbase.py +19 -12
  41. ccxt/async_support/coinbaseexchange.py +5 -0
  42. ccxt/async_support/coinbaseinternational.py +21 -2
  43. ccxt/async_support/coincatch.py +3 -0
  44. ccxt/async_support/coincheck.py +2 -0
  45. ccxt/async_support/coinex.py +5 -1
  46. ccxt/async_support/coinlist.py +5 -0
  47. ccxt/async_support/coinmate.py +4 -0
  48. ccxt/async_support/coinmetro.py +9 -5
  49. ccxt/async_support/coinone.py +3 -0
  50. ccxt/async_support/coinsph.py +4 -0
  51. ccxt/async_support/coinspot.py +1 -0
  52. ccxt/async_support/cryptocom.py +5 -0
  53. ccxt/async_support/currencycom.py +3 -0
  54. ccxt/async_support/defx.py +5 -0
  55. ccxt/async_support/delta.py +4 -1
  56. ccxt/async_support/deribit.py +7 -3
  57. ccxt/async_support/digifinex.py +10 -5
  58. ccxt/async_support/ellipx.py +9 -5
  59. ccxt/async_support/exmo.py +6 -3
  60. ccxt/async_support/gate.py +5 -1
  61. ccxt/async_support/gemini.py +3 -0
  62. ccxt/async_support/hashkey.py +5 -4
  63. ccxt/async_support/hitbtc.py +6 -2
  64. ccxt/async_support/hollaex.py +7 -2
  65. ccxt/async_support/htx.py +8 -1
  66. ccxt/async_support/huobijp.py +5 -0
  67. ccxt/async_support/hyperliquid.py +6 -1
  68. ccxt/async_support/idex.py +5 -1
  69. ccxt/async_support/independentreserve.py +4 -0
  70. ccxt/async_support/indodax.py +3 -0
  71. ccxt/async_support/kraken.py +6 -4
  72. ccxt/async_support/krakenfutures.py +5 -2
  73. ccxt/async_support/kucoin.py +13 -6
  74. ccxt/async_support/kucoinfutures.py +5 -1
  75. ccxt/async_support/kuna.py +3 -0
  76. ccxt/async_support/latoken.py +4 -0
  77. ccxt/async_support/lbank.py +6 -1
  78. ccxt/async_support/luno.py +6 -1
  79. ccxt/async_support/lykke.py +4 -0
  80. ccxt/async_support/mercado.py +4 -0
  81. ccxt/async_support/mexc.py +10 -9
  82. ccxt/async_support/ndax.py +6 -1
  83. ccxt/async_support/novadax.py +5 -0
  84. ccxt/async_support/oceanex.py +6 -2
  85. ccxt/async_support/okcoin.py +4 -0
  86. ccxt/async_support/okx.py +17 -5
  87. ccxt/async_support/onetrading.py +4 -0
  88. ccxt/async_support/oxfun.py +3 -0
  89. ccxt/async_support/p2b.py +3 -0
  90. ccxt/async_support/paradex.py +8 -2
  91. ccxt/async_support/phemex.py +10 -4
  92. ccxt/async_support/poloniex.py +6 -3
  93. ccxt/async_support/poloniexfutures.py +5 -1
  94. ccxt/async_support/probit.py +4 -0
  95. ccxt/async_support/timex.py +4 -0
  96. ccxt/async_support/tokocrypto.py +5 -0
  97. ccxt/async_support/tradeogre.py +2 -0
  98. ccxt/async_support/upbit.py +5 -2
  99. ccxt/async_support/vertex.py +6 -2
  100. ccxt/async_support/wavesexchange.py +20 -3
  101. ccxt/async_support/wazirx.py +2 -0
  102. ccxt/async_support/whitebit.py +5 -4
  103. ccxt/async_support/woo.py +15 -5
  104. ccxt/async_support/woofipro.py +21 -7
  105. ccxt/async_support/xt.py +5 -0
  106. ccxt/async_support/yobit.py +5 -2
  107. ccxt/async_support/zaif.py +2 -0
  108. ccxt/async_support/zonda.py +2 -0
  109. ccxt/base/exchange.py +92 -50
  110. ccxt/base/types.py +1 -1
  111. ccxt/bigone.py +5 -0
  112. ccxt/binance.py +55 -69
  113. ccxt/bingx.py +25 -29
  114. ccxt/bit2c.py +3 -0
  115. ccxt/bitbank.py +3 -0
  116. ccxt/bitbns.py +3 -0
  117. ccxt/bitfinex.py +6 -1
  118. ccxt/bitflyer.py +6 -1
  119. ccxt/bitget.py +8 -4
  120. ccxt/bithumb.py +3 -1
  121. ccxt/bitmart.py +22 -12
  122. ccxt/bitmex.py +99 -93
  123. ccxt/bitopro.py +7 -2
  124. ccxt/bitrue.py +4 -0
  125. ccxt/bitso.py +5 -2
  126. ccxt/bitstamp.py +3 -0
  127. ccxt/bitteam.py +5 -0
  128. ccxt/bitvavo.py +4 -0
  129. ccxt/blockchaincom.py +4 -0
  130. ccxt/blofin.py +3 -0
  131. ccxt/btcalpha.py +5 -0
  132. ccxt/btcbox.py +3 -2
  133. ccxt/btcmarkets.py +5 -0
  134. ccxt/btcturk.py +3 -0
  135. ccxt/bybit.py +10 -4
  136. ccxt/cex.py +2 -0
  137. ccxt/coinbase.py +19 -12
  138. ccxt/coinbaseexchange.py +5 -0
  139. ccxt/coinbaseinternational.py +21 -2
  140. ccxt/coincatch.py +3 -0
  141. ccxt/coincheck.py +2 -0
  142. ccxt/coinex.py +5 -1
  143. ccxt/coinlist.py +5 -0
  144. ccxt/coinmate.py +4 -0
  145. ccxt/coinmetro.py +9 -5
  146. ccxt/coinone.py +3 -0
  147. ccxt/coinsph.py +4 -0
  148. ccxt/coinspot.py +1 -0
  149. ccxt/cryptocom.py +5 -0
  150. ccxt/currencycom.py +3 -0
  151. ccxt/defx.py +5 -0
  152. ccxt/delta.py +4 -1
  153. ccxt/deribit.py +7 -3
  154. ccxt/digifinex.py +10 -5
  155. ccxt/ellipx.py +9 -5
  156. ccxt/exmo.py +6 -3
  157. ccxt/gate.py +5 -1
  158. ccxt/gemini.py +3 -0
  159. ccxt/hashkey.py +5 -4
  160. ccxt/hitbtc.py +6 -2
  161. ccxt/hollaex.py +7 -2
  162. ccxt/htx.py +8 -1
  163. ccxt/huobijp.py +5 -0
  164. ccxt/hyperliquid.py +6 -1
  165. ccxt/idex.py +5 -1
  166. ccxt/independentreserve.py +4 -0
  167. ccxt/indodax.py +3 -0
  168. ccxt/kraken.py +6 -4
  169. ccxt/krakenfutures.py +5 -2
  170. ccxt/kucoin.py +13 -6
  171. ccxt/kucoinfutures.py +5 -1
  172. ccxt/kuna.py +3 -0
  173. ccxt/latoken.py +4 -0
  174. ccxt/lbank.py +6 -1
  175. ccxt/luno.py +6 -1
  176. ccxt/lykke.py +4 -0
  177. ccxt/mercado.py +4 -0
  178. ccxt/mexc.py +10 -9
  179. ccxt/ndax.py +6 -1
  180. ccxt/novadax.py +5 -0
  181. ccxt/oceanex.py +6 -2
  182. ccxt/okcoin.py +4 -0
  183. ccxt/okx.py +17 -5
  184. ccxt/onetrading.py +4 -0
  185. ccxt/oxfun.py +3 -0
  186. ccxt/p2b.py +3 -0
  187. ccxt/paradex.py +8 -2
  188. ccxt/phemex.py +10 -4
  189. ccxt/poloniex.py +6 -3
  190. ccxt/poloniexfutures.py +5 -1
  191. ccxt/pro/__init__.py +1 -1
  192. ccxt/pro/bitcoincom.py +1 -4
  193. ccxt/pro/bitopro.py +1 -1
  194. ccxt/probit.py +4 -0
  195. ccxt/test/tests_async.py +57 -30
  196. ccxt/test/tests_sync.py +57 -30
  197. ccxt/timex.py +4 -0
  198. ccxt/tokocrypto.py +5 -0
  199. ccxt/tradeogre.py +2 -0
  200. ccxt/upbit.py +5 -2
  201. ccxt/vertex.py +6 -2
  202. ccxt/wavesexchange.py +20 -3
  203. ccxt/wazirx.py +2 -0
  204. ccxt/whitebit.py +5 -4
  205. ccxt/woo.py +15 -5
  206. ccxt/woofipro.py +21 -7
  207. ccxt/xt.py +5 -0
  208. ccxt/yobit.py +5 -2
  209. ccxt/zaif.py +2 -0
  210. ccxt/zonda.py +2 -0
  211. {ccxt-4.4.52.dist-info → ccxt-4.4.53.dist-info}/METADATA +225 -140
  212. {ccxt-4.4.52.dist-info → ccxt-4.4.53.dist-info}/RECORD +215 -224
  213. ccxt/static_dependencies/ethereum/abi/py.typed +0 -0
  214. ccxt/static_dependencies/ethereum/account/py.typed +0 -0
  215. ccxt/static_dependencies/ethereum/hexbytes/py.typed +0 -0
  216. ccxt/static_dependencies/ethereum/typing/py.typed +0 -0
  217. ccxt/static_dependencies/ethereum/utils/py.typed +0 -0
  218. ccxt/static_dependencies/lark/py.typed +0 -0
  219. ccxt/static_dependencies/marshmallow/py.typed +0 -0
  220. ccxt/static_dependencies/marshmallow_dataclass/py.typed +0 -0
  221. ccxt/static_dependencies/marshmallow_oneofschema/py.typed +0 -0
  222. {ccxt-4.4.52.dist-info → ccxt-4.4.53.dist-info}/LICENSE.txt +0 -0
  223. {ccxt-4.4.52.dist-info → ccxt-4.4.53.dist-info}/WHEEL +0 -0
  224. {ccxt-4.4.52.dist-info → ccxt-4.4.53.dist-info}/top_level.txt +0 -0
ccxt/bit2c.py CHANGED
@@ -209,17 +209,20 @@ class bit2c(Exchange, ImplicitAPI):
209
209
  'limit': 100,
210
210
  'daysBack': 30,
211
211
  'untilDays': 30,
212
+ 'symbolRequired': False,
212
213
  },
213
214
  'fetchOrder': {
214
215
  'marginMode': False,
215
216
  'trigger': False,
216
217
  'trailing': False,
218
+ 'symbolRequired': False,
217
219
  },
218
220
  'fetchOpenOrders': {
219
221
  'marginMode': False,
220
222
  'limit': None,
221
223
  'trigger': False,
222
224
  'trailing': False,
225
+ 'symbolRequired': True,
223
226
  },
224
227
  'fetchOrders': None,
225
228
  'fetchClosedOrders': None, # todo implement
ccxt/bitbank.py CHANGED
@@ -185,17 +185,20 @@ class bitbank(Exchange, ImplicitAPI):
185
185
  'limit': 1000,
186
186
  'daysBack': None,
187
187
  'untilDays': None,
188
+ 'symbolRequired': False,
188
189
  },
189
190
  'fetchOrder': {
190
191
  'marginMode': False,
191
192
  'trigger': False,
192
193
  'trailing': False,
194
+ 'symbolRequired': False,
193
195
  },
194
196
  'fetchOpenOrders': {
195
197
  'marginMode': False,
196
198
  'limit': 1000,
197
199
  'trigger': False,
198
200
  'trailing': False,
201
+ 'symbolRequired': False,
199
202
  },
200
203
  'fetchOrders': None,
201
204
  'fetchClosedOrders': None,
ccxt/bitbns.py CHANGED
@@ -182,17 +182,20 @@ class bitbns(Exchange, ImplicitAPI):
182
182
  'limit': None,
183
183
  'daysBack': None,
184
184
  'untilDays': None,
185
+ 'symbolRequired': True,
185
186
  },
186
187
  'fetchOrder': {
187
188
  'marginMode': False,
188
189
  'trigger': False,
189
190
  'trailing': False,
191
+ 'symbolRequired': True,
190
192
  },
191
193
  'fetchOpenOrders': {
192
194
  'marginMode': False,
193
195
  'limit': None,
194
196
  'trigger': True,
195
197
  'trailing': False,
198
+ 'symbolRequired': True,
196
199
  },
197
200
  'fetchOrders': None,
198
201
  'fetchClosedOrders': None,
ccxt/bitfinex.py CHANGED
@@ -453,17 +453,20 @@ class bitfinex(Exchange, ImplicitAPI):
453
453
  'limit': 2500,
454
454
  'daysBack': None,
455
455
  'untilDays': 100000, # todo: implement
456
+ 'symbolRequired': False,
456
457
  },
457
458
  'fetchOrder': {
458
459
  'marginMode': False,
459
460
  'trigger': False,
460
461
  'trailing': False,
462
+ 'symbolRequired': False,
461
463
  },
462
464
  'fetchOpenOrders': {
463
465
  'marginMode': False,
464
466
  'limit': None,
465
467
  'trigger': False,
466
468
  'trailing': False,
469
+ 'symbolRequired': False,
467
470
  },
468
471
  'fetchOrders': None,
469
472
  'fetchClosedOrders': {
@@ -474,6 +477,7 @@ class bitfinex(Exchange, ImplicitAPI):
474
477
  'untilDays': 100000,
475
478
  'trigger': False,
476
479
  'trailing': False,
480
+ 'symbolRequired': False,
477
481
  },
478
482
  'fetchOHLCV': {
479
483
  'limit': 10000,
@@ -1136,7 +1140,8 @@ class bitfinex(Exchange, ImplicitAPI):
1136
1140
  signedAmount = self.safe_string(order, 2)
1137
1141
  amount = Precise.string_abs(signedAmount)
1138
1142
  side = 'bids' if Precise.string_gt(signedAmount, '0') else 'asks'
1139
- result[side].append([price, self.parse_number(amount)])
1143
+ resultSide = result[side]
1144
+ resultSide.append([price, self.parse_number(amount)])
1140
1145
  result['bids'] = self.sort_by(result['bids'], 0, True)
1141
1146
  result['asks'] = self.sort_by(result['asks'], 0)
1142
1147
  return result
ccxt/bitflyer.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.bitflyer import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currency, Int, Market, MarketInterface, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, FundingRate, Trade, TradingFeeInterface, Transaction
9
+ from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, FundingRate, Trade, TradingFeeInterface, Transaction, MarketInterface
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import ArgumentsRequired
@@ -154,17 +154,20 @@ class bitflyer(Exchange, ImplicitAPI):
154
154
  'limit': 100,
155
155
  'daysBack': None,
156
156
  'untilDays': None,
157
+ 'symbolRequired': True,
157
158
  },
158
159
  'fetchOrder': {
159
160
  'marginMode': False,
160
161
  'trigger': False,
161
162
  'trailing': False,
163
+ 'symbolRequired': True,
162
164
  },
163
165
  'fetchOpenOrders': {
164
166
  'marginMode': False,
165
167
  'limit': 100,
166
168
  'trigger': False,
167
169
  'trailing': False,
170
+ 'symbolRequired': True,
168
171
  },
169
172
  'fetchOrders': {
170
173
  'marginMode': False,
@@ -173,6 +176,7 @@ class bitflyer(Exchange, ImplicitAPI):
173
176
  'untilDays': None,
174
177
  'trigger': False,
175
178
  'trailing': False,
179
+ 'symbolRequired': True,
176
180
  },
177
181
  'fetchClosedOrders': {
178
182
  'marginMode': False,
@@ -182,6 +186,7 @@ class bitflyer(Exchange, ImplicitAPI):
182
186
  'untilDays': None,
183
187
  'trigger': False,
184
188
  'trailing': False,
189
+ 'symbolRequired': True,
185
190
  },
186
191
  'fetchOHLCV': None,
187
192
  },
ccxt/bitget.py CHANGED
@@ -1594,17 +1594,20 @@ class bitget(Exchange, ImplicitAPI):
1594
1594
  'limit': 100,
1595
1595
  'daysBack': None,
1596
1596
  'untilDays': 90,
1597
+ 'symbolRequired': True,
1597
1598
  },
1598
1599
  'fetchOrder': {
1599
1600
  'marginMode': False,
1600
1601
  'trigger': False,
1601
1602
  'trailing': False,
1603
+ 'symbolRequired': True,
1602
1604
  },
1603
1605
  'fetchOpenOrders': {
1604
1606
  'marginMode': True,
1605
1607
  'limit': 100,
1606
1608
  'trigger': True,
1607
1609
  'trailing': False,
1610
+ 'symbolRequired': False,
1608
1611
  },
1609
1612
  'fetchOrders': None,
1610
1613
  'fetchClosedOrders': {
@@ -1615,6 +1618,7 @@ class bitget(Exchange, ImplicitAPI):
1615
1618
  'untilDays': 90,
1616
1619
  'trigger': True,
1617
1620
  'trailing': False,
1621
+ 'symbolRequired': False,
1618
1622
  },
1619
1623
  'fetchOHLCV': {
1620
1624
  'limit': 1000, # variable timespans for recent endpoint, 200 for historical
@@ -1949,10 +1953,10 @@ class bitget(Exchange, ImplicitAPI):
1949
1953
  amountDecimals = self.safe_integer(market, 'volumePlace')
1950
1954
  priceStep = self.safe_string(market, 'priceEndStep')
1951
1955
  amountStep = self.safe_string(market, 'minTradeNum')
1952
- precisePrice = Precise(priceStep)
1953
- precisePrice.decimals = max(precisePrice.decimals, priceDecimals)
1954
- precisePrice.reduce()
1955
- priceString = str(precisePrice)
1956
+ precise = Precise(priceStep)
1957
+ precise.decimals = max(precise.decimals, priceDecimals)
1958
+ precise.reduce()
1959
+ priceString = str(precise)
1956
1960
  pricePrecision = self.parse_number(priceString)
1957
1961
  preciseAmount = Precise(amountStep)
1958
1962
  preciseAmount.decimals = max(preciseAmount.decimals, amountDecimals)
ccxt/bithumb.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.bithumb import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currency, Int, Market, MarketInterface, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
9
+ from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, MarketInterface
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -173,12 +173,14 @@ class bithumb(Exchange, ImplicitAPI):
173
173
  'marginMode': False,
174
174
  'trigger': False,
175
175
  'trailing': False,
176
+ 'symbolRequired': True,
176
177
  },
177
178
  'fetchOpenOrders': {
178
179
  'marginMode': False,
179
180
  'limit': 1000,
180
181
  'trigger': False,
181
182
  'trailing': False,
183
+ 'symbolRequired': True,
182
184
  },
183
185
  'fetchOrders': None,
184
186
  'fetchClosedOrders': None,
ccxt/bitmart.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.bitmart import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, BorrowInterest, Currencies, Currency, DepositAddress, FundingHistory, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, Transaction, TransferEntry
9
+ from ccxt.base.types import Balances, BorrowInterest, Currencies, Currency, DepositAddress, FundingHistory, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, Transaction, MarketInterface, TransferEntry
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -742,17 +742,20 @@ class bitmart(Exchange, ImplicitAPI):
742
742
  'limit': 200,
743
743
  'daysBack': None,
744
744
  'untilDays': 99999,
745
+ 'symbolRequired': False,
745
746
  },
746
747
  'fetchOrder': {
747
748
  'marginMode': False,
748
749
  'trigger': False,
749
750
  'trailing': False,
751
+ 'symbolRequired': False,
750
752
  },
751
753
  'fetchOpenOrders': {
752
754
  'marginMode': True,
753
755
  'limit': 200,
754
756
  'trigger': False,
755
757
  'trailing': False,
758
+ 'symbolRequired': False,
756
759
  },
757
760
  'fetchOrders': None,
758
761
  'fetchClosedOrders': {
@@ -763,6 +766,7 @@ class bitmart(Exchange, ImplicitAPI):
763
766
  'untilDays': None,
764
767
  'trigger': False,
765
768
  'trailing': False,
769
+ 'symbolRequired': False,
766
770
  },
767
771
  'fetchOHLCV': {
768
772
  'limit': 1000, # variable timespans for recent endpoint, 200 for historical
@@ -933,7 +937,7 @@ class bitmart(Exchange, ImplicitAPI):
933
937
  'info': response,
934
938
  }
935
939
 
936
- def fetch_spot_markets(self, params={}):
940
+ def fetch_spot_markets(self, params={}) -> List[MarketInterface]:
937
941
  response = self.publicGetSpotV1SymbolsDetails(params)
938
942
  #
939
943
  # {
@@ -977,7 +981,7 @@ class bitmart(Exchange, ImplicitAPI):
977
981
  minSellCost = self.safe_string(market, 'min_sell_amount')
978
982
  minCost = Precise.string_max(minBuyCost, minSellCost)
979
983
  baseMinSize = self.safe_number(market, 'base_min_size')
980
- result.append({
984
+ result.append(self.safe_market_structure({
981
985
  'id': id,
982
986
  'numericId': numericId,
983
987
  'symbol': symbol,
@@ -1026,10 +1030,10 @@ class bitmart(Exchange, ImplicitAPI):
1026
1030
  },
1027
1031
  'created': None,
1028
1032
  'info': market,
1029
- })
1033
+ }))
1030
1034
  return result
1031
1035
 
1032
- def fetch_contract_markets(self, params={}):
1036
+ def fetch_contract_markets(self, params={}) -> List[MarketInterface]:
1033
1037
  response = self.publicGetContractPublicDetails(params)
1034
1038
  #
1035
1039
  # {
@@ -1089,7 +1093,7 @@ class bitmart(Exchange, ImplicitAPI):
1089
1093
  expiry = self.safe_integer(market, 'expire_timestamp')
1090
1094
  if not isFutures and (expiry == 0):
1091
1095
  expiry = None
1092
- result.append({
1096
+ result.append(self.safe_market_structure({
1093
1097
  'id': id,
1094
1098
  'numericId': None,
1095
1099
  'symbol': symbol,
@@ -1138,7 +1142,7 @@ class bitmart(Exchange, ImplicitAPI):
1138
1142
  },
1139
1143
  'created': self.safe_integer(market, 'open_timestamp'),
1140
1144
  'info': market,
1141
- })
1145
+ }))
1142
1146
  return result
1143
1147
 
1144
1148
  def fetch_markets(self, params={}) -> List[Market]:
@@ -2959,7 +2963,7 @@ class bitmart(Exchange, ImplicitAPI):
2959
2963
  order = self.safe_order({'id': id, 'symbol': market['symbol'], 'info': {}}, market)
2960
2964
  return order
2961
2965
 
2962
- def cancel_orders(self, ids: List[str], symbol: Str = None, params={}):
2966
+ def cancel_orders(self, ids: List[str], symbol: Str = None, params={}) -> List[Order]:
2963
2967
  """
2964
2968
  cancel multiple orders
2965
2969
 
@@ -3405,8 +3409,9 @@ class bitmart(Exchange, ImplicitAPI):
3405
3409
  """
3406
3410
  self.load_markets()
3407
3411
  currency = self.currency(code)
3412
+ currencyId = currency['id']
3408
3413
  request: dict = {
3409
- 'currency': currency['id'],
3414
+ 'currency': currencyId,
3410
3415
  }
3411
3416
  if code == 'USDT':
3412
3417
  defaultNetworks = self.safe_value(self.options, 'defaultNetworks')
@@ -3415,8 +3420,13 @@ class bitmart(Exchange, ImplicitAPI):
3415
3420
  networkInner = self.safe_string_upper(params, 'network', defaultNetwork) # self line allows the user to specify either ERC20 or ETH
3416
3421
  networkInner = self.safe_string(networks, networkInner, networkInner) # handle ERC20>ETH alias
3417
3422
  if networkInner is not None:
3418
- request['currency'] = request['currency'] + '-' + networkInner # when network the currency need to be changed to currency + '-' + network https://developer-pro.bitmart.com/en/account/withdraw_apply.html on the end of page
3423
+ request['currency'] = currencyId + '-' + networkInner # when network the currency need to be changed to currency + '-' + network https://developer-pro.bitmart.com/en/account/withdraw_apply.html on the end of page
3419
3424
  params = self.omit(params, 'network')
3425
+ else:
3426
+ networkCode = None
3427
+ networkCode, params = self.handle_network_code_and_params(params)
3428
+ if networkCode is not None:
3429
+ request['currency'] = currencyId + '-' + self.network_code_to_id(networkCode)
3420
3430
  response = self.privateGetAccountV1DepositAddress(self.extend(request, params))
3421
3431
  #
3422
3432
  # {
@@ -3535,7 +3545,7 @@ class bitmart(Exchange, ImplicitAPI):
3535
3545
  network = self.safe_string_upper(params, 'network', defaultNetwork) # self line allows the user to specify either ERC20 or ETH
3536
3546
  network = self.safe_string(networks, network, network) # handle ERC20>ETH alias
3537
3547
  if network is not None:
3538
- request['currency'] += '-' + network # when network the currency need to be changed to currency + '-' + network https://developer-pro.bitmart.com/en/account/withdraw_apply.html on the end of page
3548
+ request['currency'] = request['currency'] + '-' + network # when network the currency need to be changed to currency + '-' + network https://developer-pro.bitmart.com/en/account/withdraw_apply.html on the end of page
3539
3549
  currency['code'] = request['currency'] # update currency code to filter
3540
3550
  params = self.omit(params, 'network')
3541
3551
  response = self.privateGetAccountV2DepositWithdrawHistory(self.extend(request, params))
@@ -4386,7 +4396,7 @@ class bitmart(Exchange, ImplicitAPI):
4386
4396
  https://developer-pro.bitmart.com/en/futuresv2/#get-funding-rate-history
4387
4397
 
4388
4398
  :param str symbol: unified symbol of the market to fetch the funding rate history for
4389
- :param int [since]: timestamp in ms of the earliest funding rate to fetch
4399
+ :param int [since]: not sent to exchange api, exchange api always returns the most recent data, only used to filter exchange response
4390
4400
  :param int [limit]: the maximum amount of funding rate structures to fetch
4391
4401
  :param dict [params]: extra parameters specific to the exchange API endpoint
4392
4402
  :returns dict[]: a list of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>`
ccxt/bitmex.py CHANGED
@@ -286,108 +286,113 @@ class bitmex(Exchange, ImplicitAPI):
286
286
  'SOL': 'sol',
287
287
  'ADA': 'ada',
288
288
  },
289
- 'features': {
290
- 'default': {
291
- 'sandbox': True,
292
- 'createOrder': {
293
- 'marginMode': True,
294
- 'triggerPrice': True,
295
- 'triggerPriceType': {
296
- 'last': True,
297
- 'mark': True,
298
- },
299
- 'triggerDirection': True,
300
- 'stopLossPrice': False,
301
- 'takeProfitPrice': False,
302
- 'attachedStopLossTakeProfit': None,
303
- 'timeInForce': {
304
- 'IOC': True,
305
- 'FOK': True,
306
- 'PO': True,
307
- 'GTD': False,
308
- },
309
- 'hedged': False,
310
- 'trailing': True,
311
- 'marketBuyRequiresPrice': False,
312
- 'marketBuyByCost': False,
313
- # exchange-supported features
314
- # 'selfTradePrevention': True,
315
- # 'twap': False,
316
- # 'iceberg': False,
317
- # 'oco': False,
318
- },
319
- 'createOrders': None,
320
- 'fetchMyTrades': {
321
- 'marginMode': False,
322
- 'limit': 500,
323
- 'daysBack': None,
324
- 'untilDays': 1000000,
325
- },
326
- 'fetchOrder': {
327
- 'marginMode': False,
328
- 'trigger': False,
329
- 'trailing': False,
330
- },
331
- 'fetchOpenOrders': {
332
- 'marginMode': False,
333
- 'limit': 500,
334
- 'trigger': False,
335
- 'trailing': False,
336
- },
337
- 'fetchOrders': {
338
- 'marginMode': False,
339
- 'limit': 500,
340
- 'daysBack': None,
341
- 'untilDays': 1000000,
342
- 'trigger': False,
343
- 'trailing': False,
344
- },
345
- 'fetchClosedOrders': {
346
- 'marginMode': False,
347
- 'limit': 500,
348
- 'daysBackClosed': None,
349
- 'daysBackCanceled': None,
350
- 'untilDays': 1000000,
351
- 'trigger': False,
352
- 'trailing': False,
289
+ },
290
+ 'features': {
291
+ 'default': {
292
+ 'sandbox': True,
293
+ 'createOrder': {
294
+ 'marginMode': True,
295
+ 'triggerPrice': True,
296
+ 'triggerPriceType': {
297
+ 'last': True,
298
+ 'mark': True,
353
299
  },
354
- 'fetchOHLCV': {
355
- 'limit': 10000,
300
+ 'triggerDirection': True,
301
+ 'stopLossPrice': False,
302
+ 'takeProfitPrice': False,
303
+ 'attachedStopLossTakeProfit': None,
304
+ 'timeInForce': {
305
+ 'IOC': True,
306
+ 'FOK': True,
307
+ 'PO': True,
308
+ 'GTD': False,
356
309
  },
310
+ 'hedged': False,
311
+ 'trailing': True,
312
+ 'marketBuyRequiresPrice': False,
313
+ 'marketBuyByCost': False,
314
+ # exchange-supported features
315
+ # 'selfTradePrevention': True,
316
+ # 'twap': False,
317
+ # 'iceberg': False,
318
+ # 'oco': False,
357
319
  },
358
- 'spot': {
359
- 'extends': 'default',
360
- 'createOrder': {
361
- 'triggerPriceType': {
362
- 'index': False,
363
- },
364
- },
320
+ 'createOrders': None,
321
+ 'fetchMyTrades': {
322
+ 'marginMode': False,
323
+ 'limit': 500,
324
+ 'daysBack': None,
325
+ 'untilDays': 1000000,
326
+ 'symbolRequired': False,
365
327
  },
366
- 'forDeriv': {
367
- 'extends': 'default',
368
- 'createOrder': {
369
- 'triggerPriceType': {
370
- 'index': True,
371
- },
372
- },
328
+ 'fetchOrder': {
329
+ 'marginMode': False,
330
+ 'trigger': False,
331
+ 'trailing': False,
332
+ 'symbolRequired': False,
373
333
  },
374
- 'swap': {
375
- 'linear': {
376
- 'extends': 'forDeriv',
377
- },
378
- 'inverse': {
379
- 'extends': 'forDeriv',
380
- },
334
+ 'fetchOpenOrders': {
335
+ 'marginMode': False,
336
+ 'limit': 500,
337
+ 'trigger': False,
338
+ 'trailing': False,
339
+ 'symbolRequired': False,
340
+ },
341
+ 'fetchOrders': {
342
+ 'marginMode': False,
343
+ 'limit': 500,
344
+ 'daysBack': None,
345
+ 'untilDays': 1000000,
346
+ 'trigger': False,
347
+ 'trailing': False,
348
+ 'symbolRequired': False,
381
349
  },
382
- 'future': {
383
- 'linear': {
384
- 'extends': 'forDeriv',
350
+ 'fetchClosedOrders': {
351
+ 'marginMode': False,
352
+ 'limit': 500,
353
+ 'daysBack': None,
354
+ 'daysBackCanceled': None,
355
+ 'untilDays': 1000000,
356
+ 'trigger': False,
357
+ 'trailing': False,
358
+ 'symbolRequired': False,
359
+ },
360
+ 'fetchOHLCV': {
361
+ 'limit': 10000,
362
+ },
363
+ },
364
+ 'spot': {
365
+ 'extends': 'default',
366
+ 'createOrder': {
367
+ 'triggerPriceType': {
368
+ 'index': False,
385
369
  },
386
- 'inverse': {
387
- 'extends': 'forDeriv',
370
+ },
371
+ },
372
+ 'derivatives': {
373
+ 'extends': 'default',
374
+ 'createOrder': {
375
+ 'triggerPriceType': {
376
+ 'index': True,
388
377
  },
389
378
  },
390
379
  },
380
+ 'swap': {
381
+ 'linear': {
382
+ 'extends': 'derivatives',
383
+ },
384
+ 'inverse': {
385
+ 'extends': 'derivatives',
386
+ },
387
+ },
388
+ 'future': {
389
+ 'linear': {
390
+ 'extends': 'derivatives',
391
+ },
392
+ 'inverse': {
393
+ 'extends': 'derivatives',
394
+ },
395
+ },
391
396
  },
392
397
  'commonCurrencies': {
393
398
  'USDt': 'USDT',
@@ -964,7 +969,8 @@ class bitmex(Exchange, ImplicitAPI):
964
969
  # https://github.com/ccxt/ccxt/issues/4927
965
970
  # the exchange sometimes returns null price in the orderbook
966
971
  if price is not None:
967
- result[side].append([price, amount])
972
+ resultSide = result[side]
973
+ resultSide.append([price, amount])
968
974
  result['bids'] = self.sort_by(result['bids'], 0, True)
969
975
  result['asks'] = self.sort_by(result['asks'], 0)
970
976
  return result
ccxt/bitopro.py CHANGED
@@ -239,11 +239,13 @@ class bitopro(Exchange, ImplicitAPI):
239
239
  'limit': 1000,
240
240
  'daysBack': 100000,
241
241
  'untilDays': 100000,
242
+ 'symbolRequired': True,
242
243
  },
243
244
  'fetchOrder': {
244
245
  'marginMode': False,
245
246
  'trigger': False,
246
247
  'trailing': False,
248
+ 'symbolRequired': True,
247
249
  },
248
250
  # todo: implement through fetchOrders
249
251
  'fetchOpenOrders': {
@@ -251,6 +253,7 @@ class bitopro(Exchange, ImplicitAPI):
251
253
  'limit': None,
252
254
  'trigger': False,
253
255
  'trailing': False,
256
+ 'symbolRequired': False,
254
257
  },
255
258
  'fetchOrders': {
256
259
  'marginMode': False,
@@ -259,6 +262,7 @@ class bitopro(Exchange, ImplicitAPI):
259
262
  'untilDays': 100000,
260
263
  'trigger': False,
261
264
  'trailing': False,
265
+ 'symbolRequired': True,
262
266
  },
263
267
  'fetchClosedOrders': {
264
268
  'marginMode': False,
@@ -268,6 +272,7 @@ class bitopro(Exchange, ImplicitAPI):
268
272
  'untilDays': 10000,
269
273
  'trigger': False,
270
274
  'trailing': False,
275
+ 'symbolRequired': True,
271
276
  },
272
277
  'fetchOHLCV': {
273
278
  'limit': 1000,
@@ -1151,7 +1156,7 @@ class bitopro(Exchange, ImplicitAPI):
1151
1156
  }))
1152
1157
  return orders
1153
1158
 
1154
- def cancel_orders(self, ids, symbol: Str = None, params={}):
1159
+ def cancel_orders(self, ids, symbol: Str = None, params={}) -> List[Order]:
1155
1160
  """
1156
1161
  cancel multiple orders
1157
1162
 
@@ -1183,7 +1188,7 @@ class bitopro(Exchange, ImplicitAPI):
1183
1188
  data = self.safe_dict(response, 'data')
1184
1189
  return self.parse_cancel_orders(data)
1185
1190
 
1186
- def cancel_all_orders(self, symbol: Str = None, params={}):
1191
+ def cancel_all_orders(self, symbol: Str = None, params={}) -> List[Order]:
1187
1192
  """
1188
1193
  cancel all open orders
1189
1194
 
ccxt/bitrue.py CHANGED
@@ -490,17 +490,20 @@ class bitrue(Exchange, ImplicitAPI):
490
490
  'limit': 1000,
491
491
  'daysBack': 100000,
492
492
  'untilDays': 100000,
493
+ 'symbolRequired': True,
493
494
  },
494
495
  'fetchOrder': {
495
496
  'marginMode': False,
496
497
  'trigger': False,
497
498
  'trailing': False,
499
+ 'symbolRequired': True,
498
500
  },
499
501
  'fetchOpenOrders': {
500
502
  'marginMode': False,
501
503
  'limit': None,
502
504
  'trigger': False,
503
505
  'trailing': False,
506
+ 'symbolRequired': True,
504
507
  },
505
508
  'fetchOrders': None,
506
509
  'fetchClosedOrders': {
@@ -511,6 +514,7 @@ class bitrue(Exchange, ImplicitAPI):
511
514
  'untilDays': 90,
512
515
  'trigger': False,
513
516
  'trailing': False,
517
+ 'symbolRequired': True,
514
518
  },
515
519
  'fetchOHLCV': {
516
520
  'limit': 1440,