ccxt 4.4.52__py2.py3-none-any.whl → 4.4.57__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 (223) hide show
  1. ccxt/__init__.py +1 -3
  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 -3
  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 +24 -7
  14. ccxt/async_support/bigone.py +5 -0
  15. ccxt/async_support/binance.py +54 -54
  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 +9 -5
  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 +13 -5
  39. ccxt/async_support/cex.py +2 -0
  40. ccxt/async_support/coinbase.py +20 -13
  41. ccxt/async_support/coinbaseexchange.py +5 -0
  42. ccxt/async_support/coinbaseinternational.py +23 -4
  43. ccxt/async_support/coincatch.py +3 -0
  44. ccxt/async_support/coincheck.py +2 -0
  45. ccxt/async_support/coinex.py +6 -2
  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 +15 -28
  57. ccxt/async_support/digifinex.py +10 -5
  58. ccxt/async_support/ellipx.py +9 -5
  59. ccxt/async_support/exmo.py +7 -4
  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 +9 -4
  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 +7 -5
  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/mercado.py +4 -0
  80. ccxt/async_support/mexc.py +10 -9
  81. ccxt/async_support/ndax.py +6 -1
  82. ccxt/async_support/novadax.py +5 -0
  83. ccxt/async_support/oceanex.py +6 -2
  84. ccxt/async_support/okcoin.py +4 -0
  85. ccxt/async_support/okx.py +17 -5
  86. ccxt/async_support/onetrading.py +4 -0
  87. ccxt/async_support/oxfun.py +3 -0
  88. ccxt/async_support/p2b.py +3 -0
  89. ccxt/async_support/paradex.py +8 -2
  90. ccxt/async_support/phemex.py +10 -4
  91. ccxt/async_support/poloniex.py +6 -3
  92. ccxt/async_support/poloniexfutures.py +5 -1
  93. ccxt/async_support/probit.py +4 -0
  94. ccxt/async_support/timex.py +4 -0
  95. ccxt/async_support/tokocrypto.py +5 -0
  96. ccxt/async_support/tradeogre.py +2 -0
  97. ccxt/async_support/upbit.py +5 -2
  98. ccxt/async_support/vertex.py +6 -2
  99. ccxt/async_support/wavesexchange.py +20 -3
  100. ccxt/async_support/wazirx.py +2 -0
  101. ccxt/async_support/whitebit.py +5 -4
  102. ccxt/async_support/woo.py +15 -5
  103. ccxt/async_support/woofipro.py +23 -9
  104. ccxt/async_support/xt.py +5 -0
  105. ccxt/async_support/yobit.py +5 -2
  106. ccxt/async_support/zaif.py +2 -0
  107. ccxt/async_support/zonda.py +2 -0
  108. ccxt/base/exchange.py +96 -54
  109. ccxt/base/types.py +1 -1
  110. ccxt/bigone.py +5 -0
  111. ccxt/binance.py +54 -54
  112. ccxt/bingx.py +25 -29
  113. ccxt/bit2c.py +3 -0
  114. ccxt/bitbank.py +3 -0
  115. ccxt/bitbns.py +3 -0
  116. ccxt/bitfinex.py +6 -1
  117. ccxt/bitflyer.py +6 -1
  118. ccxt/bitget.py +9 -5
  119. ccxt/bithumb.py +3 -1
  120. ccxt/bitmart.py +22 -12
  121. ccxt/bitmex.py +99 -93
  122. ccxt/bitopro.py +7 -2
  123. ccxt/bitrue.py +4 -0
  124. ccxt/bitso.py +5 -2
  125. ccxt/bitstamp.py +3 -0
  126. ccxt/bitteam.py +5 -0
  127. ccxt/bitvavo.py +4 -0
  128. ccxt/blockchaincom.py +4 -0
  129. ccxt/blofin.py +3 -0
  130. ccxt/btcalpha.py +5 -0
  131. ccxt/btcbox.py +3 -2
  132. ccxt/btcmarkets.py +5 -0
  133. ccxt/btcturk.py +3 -0
  134. ccxt/bybit.py +13 -5
  135. ccxt/cex.py +2 -0
  136. ccxt/coinbase.py +20 -13
  137. ccxt/coinbaseexchange.py +5 -0
  138. ccxt/coinbaseinternational.py +23 -4
  139. ccxt/coincatch.py +3 -0
  140. ccxt/coincheck.py +2 -0
  141. ccxt/coinex.py +6 -2
  142. ccxt/coinlist.py +5 -0
  143. ccxt/coinmate.py +4 -0
  144. ccxt/coinmetro.py +9 -5
  145. ccxt/coinone.py +3 -0
  146. ccxt/coinsph.py +4 -0
  147. ccxt/coinspot.py +1 -0
  148. ccxt/cryptocom.py +5 -0
  149. ccxt/currencycom.py +3 -0
  150. ccxt/defx.py +5 -0
  151. ccxt/delta.py +4 -1
  152. ccxt/deribit.py +15 -28
  153. ccxt/digifinex.py +10 -5
  154. ccxt/ellipx.py +9 -5
  155. ccxt/exmo.py +7 -4
  156. ccxt/gate.py +5 -1
  157. ccxt/gemini.py +3 -0
  158. ccxt/hashkey.py +5 -4
  159. ccxt/hitbtc.py +6 -2
  160. ccxt/hollaex.py +7 -2
  161. ccxt/htx.py +8 -1
  162. ccxt/huobijp.py +5 -0
  163. ccxt/hyperliquid.py +9 -4
  164. ccxt/idex.py +5 -1
  165. ccxt/independentreserve.py +4 -0
  166. ccxt/indodax.py +3 -0
  167. ccxt/kraken.py +7 -5
  168. ccxt/krakenfutures.py +5 -2
  169. ccxt/kucoin.py +13 -6
  170. ccxt/kucoinfutures.py +5 -1
  171. ccxt/kuna.py +3 -0
  172. ccxt/latoken.py +4 -0
  173. ccxt/lbank.py +6 -1
  174. ccxt/luno.py +6 -1
  175. ccxt/mercado.py +4 -0
  176. ccxt/mexc.py +10 -9
  177. ccxt/ndax.py +6 -1
  178. ccxt/novadax.py +5 -0
  179. ccxt/oceanex.py +6 -2
  180. ccxt/okcoin.py +4 -0
  181. ccxt/okx.py +17 -5
  182. ccxt/onetrading.py +4 -0
  183. ccxt/oxfun.py +3 -0
  184. ccxt/p2b.py +3 -0
  185. ccxt/paradex.py +8 -2
  186. ccxt/phemex.py +10 -4
  187. ccxt/poloniex.py +6 -3
  188. ccxt/poloniexfutures.py +5 -1
  189. ccxt/pro/__init__.py +1 -1
  190. ccxt/pro/binance.py +2 -2
  191. ccxt/pro/bitcoincom.py +1 -4
  192. ccxt/pro/bitget.py +3 -3
  193. ccxt/pro/bitopro.py +1 -1
  194. ccxt/pro/bybit.py +7 -2
  195. ccxt/pro/cex.py +1 -1
  196. ccxt/pro/coincatch.py +3 -3
  197. ccxt/pro/mexc.py +3 -3
  198. ccxt/pro/okx.py +1 -1
  199. ccxt/probit.py +4 -0
  200. ccxt/test/tests_async.py +57 -30
  201. ccxt/test/tests_sync.py +57 -30
  202. ccxt/timex.py +4 -0
  203. ccxt/tokocrypto.py +5 -0
  204. ccxt/tradeogre.py +2 -0
  205. ccxt/upbit.py +5 -2
  206. ccxt/vertex.py +6 -2
  207. ccxt/wavesexchange.py +20 -3
  208. ccxt/wazirx.py +2 -0
  209. ccxt/whitebit.py +5 -4
  210. ccxt/woo.py +15 -5
  211. ccxt/woofipro.py +23 -9
  212. ccxt/xt.py +5 -0
  213. ccxt/yobit.py +5 -2
  214. ccxt/zaif.py +2 -0
  215. ccxt/zonda.py +2 -0
  216. {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/METADATA +225 -143
  217. {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/RECORD +220 -223
  218. ccxt/abstract/lykke.py +0 -29
  219. ccxt/async_support/lykke.py +0 -1370
  220. ccxt/lykke.py +0 -1370
  221. {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/LICENSE.txt +0 -0
  222. {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/WHEEL +0 -0
  223. {ccxt-4.4.52.dist-info → ccxt-4.4.57.dist-info}/top_level.txt +0 -0
ccxt/coincatch.py CHANGED
@@ -464,11 +464,13 @@ class coincatch(Exchange, ImplicitAPI):
464
464
  'limit': 500,
465
465
  'daysBack': 100000, # todo implement
466
466
  'untilDays': 100000, # todo implement
467
+ 'symbolRequired': True,
467
468
  },
468
469
  'fetchOrder': {
469
470
  'marginMode': False,
470
471
  'trigger': False,
471
472
  'trailing': False,
473
+ 'symbolRequired': False,
472
474
  },
473
475
  'fetchOpenOrders': {
474
476
  'marginMode': False,
@@ -476,6 +478,7 @@ class coincatch(Exchange, ImplicitAPI):
476
478
  'trigger': True,
477
479
  'trailing': False,
478
480
  'marketType': True,
481
+ 'symbolRequired': False,
479
482
  },
480
483
  'fetchOrders': None,
481
484
  'fetchClosedOrders': None, # todo implement
ccxt/coincheck.py CHANGED
@@ -187,6 +187,7 @@ class coincheck(Exchange, ImplicitAPI):
187
187
  'limit': None,
188
188
  'daysBack': None,
189
189
  'untilDays': None,
190
+ 'symbolRequired': True,
190
191
  },
191
192
  'fetchOrder': None,
192
193
  'fetchOpenOrders': {
@@ -194,6 +195,7 @@ class coincheck(Exchange, ImplicitAPI):
194
195
  'limit': None,
195
196
  'trigger': False,
196
197
  'trailing': False,
198
+ 'symbolRequired': False,
197
199
  },
198
200
  'fetchOrders': None,
199
201
  'fetchClosedOrders': None,
ccxt/coinex.py CHANGED
@@ -546,17 +546,20 @@ class coinex(Exchange, ImplicitAPI):
546
546
  'limit': 1000,
547
547
  'daysBack': None,
548
548
  'untilDays': 100000,
549
+ 'symbolRequired': True,
549
550
  },
550
551
  'fetchOrder': {
551
552
  'marginMode': False,
552
553
  'trigger': False,
553
554
  'trailing': False,
555
+ 'symbolRequired': True,
554
556
  },
555
557
  'fetchOpenOrders': {
556
558
  'marginMode': True,
557
559
  'limit': 1000,
558
560
  'trigger': True,
559
561
  'trailing': False,
562
+ 'symbolRequired': False,
560
563
  },
561
564
  'fetchOrders': None,
562
565
  'fetchClosedOrders': {
@@ -567,6 +570,7 @@ class coinex(Exchange, ImplicitAPI):
567
570
  'untilDays': None,
568
571
  'trigger': True,
569
572
  'trailing': False,
573
+ 'symbolRequired': False,
570
574
  },
571
575
  'fetchOHLCV': {
572
576
  'limit': 1000,
@@ -813,7 +817,7 @@ class coinex(Exchange, ImplicitAPI):
813
817
  swapMarkets = promises[1]
814
818
  return self.array_concat(spotMarkets, swapMarkets)
815
819
 
816
- def fetch_spot_markets(self, params):
820
+ def fetch_spot_markets(self, params) -> List[Market]:
817
821
  response = self.v2PublicGetSpotMarket(params)
818
822
  #
819
823
  # {
@@ -4611,7 +4615,7 @@ class coinex(Exchange, ImplicitAPI):
4611
4615
  request: dict = {
4612
4616
  'ccy': currency['id'],
4613
4617
  'to_address': address, # must be authorized, inter-user transfer by a registered mobile phone number or an email address is supported
4614
- 'amount': self.number_to_string(amount), # the actual amount without fees, https://www.coinex.com/fees
4618
+ 'amount': self.currency_to_precision(code, amount), # the actual amount without fees, https://www.coinex.com/fees
4615
4619
  }
4616
4620
  if tag is not None:
4617
4621
  request['memo'] = tag
ccxt/coinlist.py CHANGED
@@ -255,17 +255,20 @@ class coinlist(Exchange, ImplicitAPI):
255
255
  'limit': 500,
256
256
  'daysBack': 100000,
257
257
  'untilDays': 100000,
258
+ 'symbolRequired': False,
258
259
  },
259
260
  'fetchOrder': {
260
261
  'marginMode': False,
261
262
  'trigger': False,
262
263
  'trailing': False,
264
+ 'symbolRequired': False,
263
265
  },
264
266
  'fetchOpenOrders': {
265
267
  'marginMode': False,
266
268
  'limit': 500,
267
269
  'trigger': False,
268
270
  'trailing': False,
271
+ 'symbolRequired': False,
269
272
  },
270
273
  'fetchOrders': {
271
274
  'marginMode': False,
@@ -274,6 +277,7 @@ class coinlist(Exchange, ImplicitAPI):
274
277
  'untilDays': 100000,
275
278
  'trigger': False,
276
279
  'trailing': False,
280
+ 'symbolRequired': False,
277
281
  },
278
282
  'fetchClosedOrders': {
279
283
  'marginMode': False,
@@ -283,6 +287,7 @@ class coinlist(Exchange, ImplicitAPI):
283
287
  'untilDays': 100000,
284
288
  'trigger': False,
285
289
  'trailing': False,
290
+ 'symbolRequired': False,
286
291
  },
287
292
  'fetchOHLCV': {
288
293
  'limit': 300,
ccxt/coinmate.py CHANGED
@@ -248,17 +248,20 @@ class coinmate(Exchange, ImplicitAPI):
248
248
  'limit': 1000,
249
249
  'daysBack': 100000,
250
250
  'untilDays': 100000, # todo implement
251
+ 'symbolRequired': False,
251
252
  },
252
253
  'fetchOrder': {
253
254
  'marginMode': False,
254
255
  'trigger': False,
255
256
  'trailing': False,
257
+ 'symbolRequired': False,
256
258
  },
257
259
  'fetchOpenOrders': {
258
260
  'marginMode': False,
259
261
  'limit': None,
260
262
  'trigger': False,
261
263
  'trailing': False,
264
+ 'symbolRequired': True,
262
265
  },
263
266
  'fetchOrders': {
264
267
  'marginMode': False,
@@ -267,6 +270,7 @@ class coinmate(Exchange, ImplicitAPI):
267
270
  'untilDays': None,
268
271
  'trigger': False,
269
272
  'trailing': False,
273
+ 'symbolRequired': True,
270
274
  },
271
275
  'fetchClosedOrders': None,
272
276
  'fetchOHLCV': None,
ccxt/coinmetro.py CHANGED
@@ -255,17 +255,20 @@ class coinmetro(Exchange, ImplicitAPI):
255
255
  'limit': None,
256
256
  'daysBack': 100000,
257
257
  'untilDays': None,
258
+ 'symbolRequired': False,
258
259
  },
259
260
  'fetchOrder': {
260
261
  'marginMode': False,
261
262
  'trigger': False,
262
263
  'trailing': False,
264
+ 'symbolRequired': False,
263
265
  },
264
266
  'fetchOpenOrders': {
265
267
  'marginMode': False,
266
268
  'limit': None,
267
269
  'trigger': False,
268
270
  'trailing': False,
271
+ 'symbolRequired': False,
269
272
  },
270
273
  'fetchOrders': {
271
274
  'marginMode': False,
@@ -274,6 +277,7 @@ class coinmetro(Exchange, ImplicitAPI):
274
277
  'untilDays': None,
275
278
  'trigger': False,
276
279
  'trailing': False,
280
+ 'symbolRequired': False,
277
281
  },
278
282
  'fetchClosedOrders': None,
279
283
  'fetchOHLCV': {
@@ -1261,24 +1265,24 @@ class coinmetro(Exchange, ImplicitAPI):
1261
1265
  request: dict = {
1262
1266
  }
1263
1267
  request['orderType'] = type
1264
- precisedAmount = None
1268
+ formattedAmount = None
1265
1269
  if amount is not None:
1266
- precisedAmount = self.amount_to_precision(symbol, amount)
1270
+ formattedAmount = self.amount_to_precision(symbol, amount)
1267
1271
  cost = self.safe_value(params, 'cost')
1268
1272
  params = self.omit(params, 'cost')
1269
1273
  if type == 'limit':
1270
1274
  if (price is None) and (cost is None):
1271
1275
  raise ArgumentsRequired(self.id + ' createOrder() requires a price or params.cost argument for a ' + type + ' order')
1272
1276
  elif (price is not None) and (amount is not None):
1273
- costString = Precise.string_mul(self.number_to_string(price), self.number_to_string(precisedAmount))
1277
+ costString = Precise.string_mul(self.number_to_string(price), self.number_to_string(formattedAmount))
1274
1278
  cost = self.parse_to_numeric(costString)
1275
1279
  precisedCost = None
1276
1280
  if cost is not None:
1277
1281
  precisedCost = self.cost_to_precision(symbol, cost)
1278
1282
  if side == 'sell':
1279
- request = self.handle_create_order_side(market['baseId'], market['quoteId'], precisedAmount, precisedCost, request)
1283
+ request = self.handle_create_order_side(market['baseId'], market['quoteId'], formattedAmount, precisedCost, request)
1280
1284
  elif side == 'buy':
1281
- request = self.handle_create_order_side(market['quoteId'], market['baseId'], precisedCost, precisedAmount, request)
1285
+ request = self.handle_create_order_side(market['quoteId'], market['baseId'], precisedCost, formattedAmount, request)
1282
1286
  timeInForce = self.safe_value(params, 'timeInForce')
1283
1287
  if timeInForce is not None:
1284
1288
  params = self.omit(params, 'timeInForce')
ccxt/coinone.py CHANGED
@@ -228,17 +228,20 @@ class coinone(Exchange, ImplicitAPI):
228
228
  'limit': 100, # todo implement
229
229
  'daysBack': 100000, # todo implement
230
230
  'untilDays': 100000, # todo implement
231
+ 'symbolRequired': True,
231
232
  },
232
233
  'fetchOrder': {
233
234
  'marginMode': False,
234
235
  'trigger': False,
235
236
  'trailing': False,
237
+ 'symbolRequired': True,
236
238
  },
237
239
  'fetchOpenOrders': {
238
240
  'marginMode': False,
239
241
  'limit': None,
240
242
  'trigger': False,
241
243
  'trailing': False,
244
+ 'symbolRequired': True,
242
245
  },
243
246
  'fetchOrders': None,
244
247
  'fetchClosedOrders': None, # todo implement
ccxt/coinsph.py CHANGED
@@ -344,17 +344,20 @@ class coinsph(Exchange, ImplicitAPI):
344
344
  'limit': 1000,
345
345
  'daysBack': 100000,
346
346
  'untilDays': 100000, # todo implement
347
+ 'symbolRequired': True,
347
348
  },
348
349
  'fetchOrder': {
349
350
  'marginMode': False,
350
351
  'trigger': False,
351
352
  'trailing': False,
353
+ 'symbolRequired': False,
352
354
  },
353
355
  'fetchOpenOrders': {
354
356
  'marginMode': False,
355
357
  'limit': None,
356
358
  'trigger': False,
357
359
  'trailing': False,
360
+ 'symbolRequired': False,
358
361
  },
359
362
  'fetchOrders': None,
360
363
  'fetchClosedOrders': {
@@ -365,6 +368,7 @@ class coinsph(Exchange, ImplicitAPI):
365
368
  'untilDays': 100000,
366
369
  'trigger': False,
367
370
  'trailing': False,
371
+ 'symbolRequired': True,
368
372
  },
369
373
  'fetchOHLCV': {
370
374
  'limit': 1000,
ccxt/coinspot.py CHANGED
@@ -175,6 +175,7 @@ class coinspot(Exchange, ImplicitAPI):
175
175
  'limit': None,
176
176
  'daysBack': 100000,
177
177
  'untilDays': 100000, # todo implement
178
+ 'symbolRequired': False,
178
179
  },
179
180
  'fetchOrder': None,
180
181
  'fetchOpenOrders': None, # todo implement
ccxt/cryptocom.py CHANGED
@@ -404,17 +404,20 @@ class cryptocom(Exchange, ImplicitAPI):
404
404
  'limit': 100,
405
405
  'daysBack': None,
406
406
  'untilDays': 1,
407
+ 'symbolRequired': False,
407
408
  },
408
409
  'fetchOrder': {
409
410
  'marginMode': False,
410
411
  'trigger': False,
411
412
  'trailing': False,
413
+ 'symbolRequired': False,
412
414
  },
413
415
  'fetchOpenOrders': {
414
416
  'marginMode': True,
415
417
  'limit': 100,
416
418
  'trigger': False,
417
419
  'trailing': False,
420
+ 'symbolRequired': False,
418
421
  },
419
422
  'fetchOrders': {
420
423
  'marginMode': False,
@@ -423,6 +426,7 @@ class cryptocom(Exchange, ImplicitAPI):
423
426
  'untilDays': 1,
424
427
  'trigger': False,
425
428
  'trailing': False,
429
+ 'symbolRequired': False,
426
430
  },
427
431
  'fetchClosedOrders': {
428
432
  'marginMode': False,
@@ -432,6 +436,7 @@ class cryptocom(Exchange, ImplicitAPI):
432
436
  'untilDays': 1,
433
437
  'trigger': False,
434
438
  'trailing': False,
439
+ 'symbolRequired': False,
435
440
  },
436
441
  'fetchOHLCV': {
437
442
  'limit': 300,
ccxt/currencycom.py CHANGED
@@ -295,17 +295,20 @@ class currencycom(Exchange, ImplicitAPI):
295
295
  'limit': 500,
296
296
  'daysBack': 100000,
297
297
  'untilDays': 100000, # todo implementation
298
+ 'symbolRequired': False,
298
299
  },
299
300
  'fetchOrder': {
300
301
  'marginMode': False,
301
302
  'trigger': False,
302
303
  'trailing': False,
304
+ 'symbolRequired': False,
303
305
  },
304
306
  'fetchOpenOrders': {
305
307
  'marginMode': True,
306
308
  'limit': 100,
307
309
  'trigger': False,
308
310
  'trailing': False,
311
+ 'symbolRequired': False,
309
312
  },
310
313
  'fetchOrders': None,
311
314
  'fetchClosedOrders': None,
ccxt/defx.py CHANGED
@@ -294,17 +294,20 @@ class defx(Exchange, ImplicitAPI):
294
294
  'limit': 1000,
295
295
  'daysBack': None,
296
296
  'untilDays': None,
297
+ 'symbolRequired': False,
297
298
  },
298
299
  'fetchOrder': {
299
300
  'marginMode': False,
300
301
  'trigger': False,
301
302
  'trailing': False,
303
+ 'symbolRequired': False,
302
304
  },
303
305
  'fetchOpenOrders': {
304
306
  'marginMode': True,
305
307
  'limit': 100,
306
308
  'trigger': False,
307
309
  'trailing': False,
310
+ 'symbolRequired': False,
308
311
  },
309
312
  'fetchOrders': {
310
313
  'marginMode': False,
@@ -313,6 +316,7 @@ class defx(Exchange, ImplicitAPI):
313
316
  'untilDays': 100000,
314
317
  'trigger': False,
315
318
  'trailing': False,
319
+ 'symbolRequired': False,
316
320
  },
317
321
  'fetchClosedOrders': {
318
322
  'marginMode': False,
@@ -322,6 +326,7 @@ class defx(Exchange, ImplicitAPI):
322
326
  'untilDays': 100000,
323
327
  'trigger': False,
324
328
  'trailing': False,
329
+ 'symbolRequired': False,
325
330
  },
326
331
  'fetchOHLCV': {
327
332
  'limit': 1000,
ccxt/delta.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.delta import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Greeks, Int, LedgerEntry, Leverage, MarginMode, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade
9
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Greeks, Int, LedgerEntry, Leverage, MarginMode, MarginModification, Market, Num, Option, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, MarketInterface
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -269,6 +269,7 @@ class delta(Exchange, ImplicitAPI):
269
269
  'limit': 100, # todo: revise
270
270
  'daysBack': 100000,
271
271
  'untilDays': 100000,
272
+ 'symbolRequired': False,
272
273
  },
273
274
  'fetchOrder': None,
274
275
  'fetchOpenOrders': {
@@ -276,6 +277,7 @@ class delta(Exchange, ImplicitAPI):
276
277
  'limit': 100, # todo: revise
277
278
  'trigger': False,
278
279
  'trailing': False,
280
+ 'symbolRequired': False,
279
281
  },
280
282
  'fetchOrders': None,
281
283
  'fetchClosedOrders': {
@@ -286,6 +288,7 @@ class delta(Exchange, ImplicitAPI):
286
288
  'untilDays': 100000,
287
289
  'trigger': False,
288
290
  'trailing': False,
291
+ 'symbolRequired': False,
289
292
  },
290
293
  'fetchOHLCV': {
291
294
  'limit': 2000, # todo: recheck
ccxt/deribit.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.deribit import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Account, Balances, Currencies, Currency, DepositAddress, Greeks, Int, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFees, Transaction, TransferEntry
9
+ from ccxt.base.types import Account, Balances, Currencies, Currency, DepositAddress, Greeks, Int, Market, Num, Option, OptionChain, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFees, 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
@@ -327,17 +327,20 @@ class deribit(Exchange, ImplicitAPI):
327
327
  'limit': 100, # todo: revise
328
328
  'daysBack': 100000,
329
329
  'untilDays': 100000,
330
+ 'symbolRequired': True, # todo
330
331
  },
331
332
  'fetchOrder': {
332
333
  'marginMode': False,
333
334
  'trigger': False,
334
335
  'trailing': False,
336
+ 'symbolRequired': True, # todo
335
337
  },
336
338
  'fetchOpenOrders': {
337
339
  'marginMode': False,
338
340
  'limit': None,
339
341
  'trigger': False,
340
342
  'trailing': False,
343
+ 'symbolRequired': True, # todo
341
344
  },
342
345
  'fetchOrders': None,
343
346
  'fetchClosedOrders': {
@@ -348,6 +351,7 @@ class deribit(Exchange, ImplicitAPI):
348
351
  'untilDays': 100000,
349
352
  'trigger': False,
350
353
  'trailing': False,
354
+ 'symbolRequired': True, # todo
351
355
  },
352
356
  'fetchOHLCV': {
353
357
  'limit': 1000, # todo: recheck
@@ -494,9 +498,6 @@ class deribit(Exchange, ImplicitAPI):
494
498
  'fetchBalance': {
495
499
  'code': 'BTC',
496
500
  },
497
- 'fetchPositions': {
498
- 'code': 'BTC',
499
- },
500
501
  'transfer': {
501
502
  'method': 'privateGetSubmitTransferToSubaccount', # or 'privateGetSubmitTransferToUser'
502
503
  },
@@ -760,7 +761,7 @@ class deribit(Exchange, ImplicitAPI):
760
761
  result = self.safe_value(response, 'result', [])
761
762
  return self.parse_accounts(result)
762
763
 
763
- def parse_account(self, account, currency: Currency = None):
764
+ def parse_account(self, account):
764
765
  #
765
766
  # {
766
767
  # "username": "someusername_1",
@@ -779,7 +780,7 @@ class deribit(Exchange, ImplicitAPI):
779
780
  'info': account,
780
781
  'id': self.safe_string(account, 'id'),
781
782
  'type': self.safe_string(account, 'type'),
782
- 'code': self.safe_currency_code(None, currency),
783
+ 'code': None,
783
784
  }
784
785
 
785
786
  def fetch_markets(self, params={}) -> List[Market]:
@@ -2659,32 +2660,18 @@ class deribit(Exchange, ImplicitAPI):
2659
2660
 
2660
2661
  :param str[]|None symbols: list of unified market symbols
2661
2662
  :param dict [params]: extra parameters specific to the exchange API endpoint
2663
+ :param str [params.currency]: currency code filter for positions
2662
2664
  :param str [params.kind]: market type filter for positions 'future', 'option', 'spot', 'future_combo' or 'option_combo'
2665
+ :param int [params.subaccount_id]: the user id for the subaccount
2663
2666
  :returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
2664
2667
  """
2665
2668
  self.load_markets()
2666
- kind = self.safe_string(params, 'kind')
2667
- code = None
2668
- if symbols is None:
2669
- code = self.code_from_options('fetchPositions', params)
2670
- elif isinstance(symbols, str):
2671
- code = symbols
2672
- symbols = None # fix https://github.com/ccxt/ccxt/issues/13961
2673
- else:
2674
- if isinstance(symbols, list):
2675
- length = len(symbols)
2676
- if length != 1:
2677
- raise BadRequest(self.id + ' fetchPositions() symbols argument cannot contain more than 1 symbol')
2678
- market = self.market(symbols[0])
2679
- settle = market['settle']
2680
- code = settle if (settle is not None) else market['base']
2681
- kind = market['info']['kind']
2682
- currency = self.currency(code)
2683
- request: dict = {
2684
- 'currency': currency['id'],
2685
- }
2686
- if kind is not None:
2687
- request['kind'] = kind
2669
+ code = self.safe_string(params, 'currency')
2670
+ request: dict = {}
2671
+ if code is not None:
2672
+ params = self.omit(params, 'currency')
2673
+ currency = self.currency(code)
2674
+ request['currency'] = currency['id']
2688
2675
  response = self.privateGetGetPositions(self.extend(request, params))
2689
2676
  #
2690
2677
  # {
ccxt/digifinex.py CHANGED
@@ -280,25 +280,27 @@ class digifinex(Exchange, ImplicitAPI):
280
280
  },
281
281
  'createOrders': {
282
282
  'max': 10,
283
- 'marginMode': True,
284
283
  },
285
284
  'fetchMyTrades': {
286
285
  'marginMode': True,
287
286
  'limit': 500,
288
287
  'daysBack': 100000, # todo
289
288
  'untilDays': 30,
289
+ 'symbolRequired': False,
290
290
  },
291
291
  'fetchOrder': {
292
292
  'marginMode': True,
293
293
  'trigger': False,
294
294
  'trailing': False,
295
295
  'marketType': True,
296
+ 'symbolRequired': True,
296
297
  },
297
298
  'fetchOpenOrders': {
298
299
  'marginMode': True,
299
300
  'limit': None,
300
301
  'trigger': False,
301
302
  'trailing': False,
303
+ 'symbolRequired': False,
302
304
  },
303
305
  'fetchOrders': {
304
306
  'marginMode': True,
@@ -307,6 +309,7 @@ class digifinex(Exchange, ImplicitAPI):
307
309
  'untilDays': 30,
308
310
  'trigger': False,
309
311
  'trailing': False,
312
+ 'symbolRequired': False,
310
313
  },
311
314
  'fetchClosedOrders': None,
312
315
  'fetchOHLCV': {
@@ -566,10 +569,11 @@ class digifinex(Exchange, ImplicitAPI):
566
569
  },
567
570
  }
568
571
  if code in result:
569
- if isinstance(result[code]['info'], list):
570
- result[code]['info'].append(currency)
572
+ resultCodeInfo = result[code]['info']
573
+ if isinstance(resultCodeInfo, list):
574
+ resultCodeInfo.append(currency)
571
575
  else:
572
- result[code]['info'] = [result[code]['info'], currency]
576
+ resultCodeInfo = [resultCodeInfo, currency]
573
577
  if withdraw:
574
578
  result[code]['withdraw'] = True
575
579
  result[code]['limits']['withdraw']['min'] = min(result[code]['limits']['withdraw']['min'], minWithdraw)
@@ -3970,7 +3974,8 @@ class digifinex(Exchange, ImplicitAPI):
3970
3974
  if depositWithdrawFee is None:
3971
3975
  depositWithdrawFees[code] = self.deposit_withdraw_fee({})
3972
3976
  depositWithdrawFees[code]['info'] = []
3973
- depositWithdrawFees[code]['info'].append(entry)
3977
+ depositWithdrawInfo = depositWithdrawFees[code]['info']
3978
+ depositWithdrawInfo.append(entry)
3974
3979
  networkId = self.safe_string(entry, 'chain')
3975
3980
  withdrawFee = self.safe_value(entry, 'min_withdraw_fee')
3976
3981
  withdrawResult: dict = {
ccxt/ellipx.py CHANGED
@@ -266,12 +266,14 @@ class ellipx(Exchange, ImplicitAPI):
266
266
  'marginMode': False,
267
267
  'trigger': False,
268
268
  'trailing': False,
269
+ 'symbolRequired': False,
269
270
  },
270
271
  'fetchOpenOrders': {
271
272
  'marginMode': False,
272
273
  'limit': None,
273
274
  'trigger': False,
274
275
  'trailing': False,
276
+ 'symbolRequired': True,
275
277
  },
276
278
  'fetchOrders': {
277
279
  'marginMode': False,
@@ -280,6 +282,7 @@ class ellipx(Exchange, ImplicitAPI):
280
282
  'untilDays': None, # todo
281
283
  'trigger': False,
282
284
  'trailing': False,
285
+ 'symbolRequired': True,
283
286
  },
284
287
  'fetchClosedOrders': None,
285
288
  'fetchOHLCV': {
@@ -1621,7 +1624,7 @@ class ellipx(Exchange, ImplicitAPI):
1621
1624
  'info': response,
1622
1625
  }
1623
1626
 
1624
- def fetch_trading_fee(self, symbol: str = None, params={}) -> TradingFeeInterface:
1627
+ def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
1625
1628
  """
1626
1629
  Fetches the current trading fees(maker and taker) applicable to the user.
1627
1630
 
@@ -1855,10 +1858,11 @@ class ellipx(Exchange, ImplicitAPI):
1855
1858
  e = self.safe_integer(amount, 'e', None)
1856
1859
  if v is None or e is None:
1857
1860
  return None
1858
- preciseAmount = Precise(v)
1859
- preciseAmount.decimals = e
1860
- preciseAmount.reduce()
1861
- return str(preciseAmount)
1861
+ precise = Precise(v)
1862
+ precise.decimals = e
1863
+ precise.reduce()
1864
+ amountString = str(precise)
1865
+ return amountString
1862
1866
 
1863
1867
  def to_amount(self, amount: float, precision: float) -> dict:
1864
1868
  v = str(amount)