ccxt 4.4.97__py2.py3-none-any.whl → 4.4.99__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 (77) hide show
  1. ccxt/__init__.py +4 -1
  2. ccxt/abstract/bitget.py +6 -0
  3. ccxt/abstract/hibachi.py +26 -0
  4. ccxt/async_support/__init__.py +4 -1
  5. ccxt/async_support/base/exchange.py +1 -1
  6. ccxt/async_support/binance.py +7 -6
  7. ccxt/async_support/bitget.py +2032 -559
  8. ccxt/async_support/bybit.py +5 -1
  9. ccxt/async_support/coinex.py +64 -3
  10. ccxt/async_support/coinmetro.py +2 -3
  11. ccxt/async_support/cryptocom.py +2 -1
  12. ccxt/async_support/gate.py +1 -2
  13. ccxt/async_support/hibachi.py +2080 -0
  14. ccxt/async_support/ndax.py +8 -0
  15. ccxt/async_support/novadax.py +34 -0
  16. ccxt/async_support/okx.py +2 -0
  17. ccxt/base/decimal_to_precision.py +7 -9
  18. ccxt/base/errors.py +6 -6
  19. ccxt/base/exchange.py +1 -1
  20. ccxt/binance.py +7 -6
  21. ccxt/bitget.py +2032 -559
  22. ccxt/bybit.py +5 -1
  23. ccxt/coinex.py +64 -3
  24. ccxt/coinmetro.py +2 -3
  25. ccxt/cryptocom.py +2 -1
  26. ccxt/gate.py +1 -2
  27. ccxt/hibachi.py +2079 -0
  28. ccxt/ndax.py +8 -0
  29. ccxt/novadax.py +34 -0
  30. ccxt/okx.py +2 -0
  31. ccxt/pro/__init__.py +2 -1
  32. ccxt/pro/alpaca.py +2 -2
  33. ccxt/pro/apex.py +2 -2
  34. ccxt/pro/ascendex.py +2 -2
  35. ccxt/pro/binance.py +2 -4
  36. ccxt/pro/bitget.py +3 -3
  37. ccxt/pro/bithumb.py +2 -2
  38. ccxt/pro/bitmart.py +2 -2
  39. ccxt/pro/bitmex.py +3 -3
  40. ccxt/pro/bitstamp.py +3 -3
  41. ccxt/pro/bittrade.py +2 -2
  42. ccxt/pro/bitvavo.py +4 -2
  43. ccxt/pro/bybit.py +4 -4
  44. ccxt/pro/cex.py +3 -2
  45. ccxt/pro/coinbaseexchange.py +4 -4
  46. ccxt/pro/coinbaseinternational.py +2 -2
  47. ccxt/pro/coincatch.py +1 -1
  48. ccxt/pro/coinone.py +2 -2
  49. ccxt/pro/cryptocom.py +2 -2
  50. ccxt/pro/derive.py +2 -2
  51. ccxt/pro/gate.py +3 -3
  52. ccxt/pro/hollaex.py +2 -2
  53. ccxt/pro/htx.py +3 -3
  54. ccxt/pro/hyperliquid.py +2 -2
  55. ccxt/pro/kraken.py +2 -2
  56. ccxt/pro/krakenfutures.py +4 -3
  57. ccxt/pro/kucoin.py +3 -2
  58. ccxt/pro/kucoinfutures.py +3 -2
  59. ccxt/pro/modetrade.py +2 -2
  60. ccxt/pro/okcoin.py +2 -2
  61. ccxt/pro/okx.py +5 -5
  62. ccxt/pro/onetrading.py +2 -2
  63. ccxt/pro/p2b.py +2 -2
  64. ccxt/pro/paradex.py +2 -2
  65. ccxt/pro/poloniex.py +2 -2
  66. ccxt/pro/probit.py +2 -2
  67. ccxt/pro/vertex.py +2 -2
  68. ccxt/pro/whitebit.py +2 -2
  69. ccxt/pro/woo.py +2 -2
  70. ccxt/pro/woofipro.py +2 -2
  71. ccxt/test/tests_async.py +1 -1
  72. ccxt/test/tests_sync.py +1 -1
  73. {ccxt-4.4.97.dist-info → ccxt-4.4.99.dist-info}/METADATA +7 -6
  74. {ccxt-4.4.97.dist-info → ccxt-4.4.99.dist-info}/RECORD +77 -74
  75. {ccxt-4.4.97.dist-info → ccxt-4.4.99.dist-info}/LICENSE.txt +0 -0
  76. {ccxt-4.4.97.dist-info → ccxt-4.4.99.dist-info}/WHEEL +0 -0
  77. {ccxt-4.4.97.dist-info → ccxt-4.4.99.dist-info}/top_level.txt +0 -0
@@ -35,6 +35,9 @@ class ndax(Exchange, ImplicitAPI):
35
35
  'future': False,
36
36
  'option': False,
37
37
  'addMargin': False,
38
+ 'borrowCrossMargin': False,
39
+ 'borrowIsolatedMargin': False,
40
+ 'borrowMargin': False,
38
41
  'cancelAllOrders': True,
39
42
  'cancelOrder': True,
40
43
  'closeAllPositions': False,
@@ -47,6 +50,7 @@ class ndax(Exchange, ImplicitAPI):
47
50
  'createStopOrder': True,
48
51
  'editOrder': True,
49
52
  'fetchAccounts': True,
53
+ 'fetchAllGreeks': False,
50
54
  'fetchBalance': True,
51
55
  'fetchBorrowInterest': False,
52
56
  'fetchBorrowRate': False,
@@ -77,12 +81,15 @@ class ndax(Exchange, ImplicitAPI):
77
81
  'fetchLeverages': False,
78
82
  'fetchLeverageTiers': False,
79
83
  'fetchLiquidations': False,
84
+ 'fetchLongShortRatio': False,
85
+ 'fetchLongShortRatioHistory': False,
80
86
  'fetchMarginAdjustmentHistory': False,
81
87
  'fetchMarginMode': False,
82
88
  'fetchMarginModes': False,
83
89
  'fetchMarketLeverageTiers': False,
84
90
  'fetchMarkets': True,
85
91
  'fetchMarkOHLCV': False,
92
+ 'fetchMarkPrice': False,
86
93
  'fetchMarkPrices': False,
87
94
  'fetchMyLiquidations': False,
88
95
  'fetchMySettlementHistory': False,
@@ -90,6 +97,7 @@ class ndax(Exchange, ImplicitAPI):
90
97
  'fetchOHLCV': True,
91
98
  'fetchOpenInterest': False,
92
99
  'fetchOpenInterestHistory': False,
100
+ 'fetchOpenInterests': False,
93
101
  'fetchOpenOrders': True,
94
102
  'fetchOption': False,
95
103
  'fetchOptionChain': False,
@@ -46,6 +46,9 @@ class novadax(Exchange, ImplicitAPI):
46
46
  'future': False,
47
47
  'option': False,
48
48
  'addMargin': False,
49
+ 'borrowCrossMargin': False,
50
+ 'borrowIsolatedMargin': False,
51
+ 'borrowMargin': False,
49
52
  'cancelOrder': True,
50
53
  'closeAllPositions': False,
51
54
  'closePosition': False,
@@ -58,9 +61,14 @@ class novadax(Exchange, ImplicitAPI):
58
61
  'createStopMarketOrder': True,
59
62
  'createStopOrder': True,
60
63
  'fetchAccounts': True,
64
+ 'fetchAllGreeks': False,
61
65
  'fetchBalance': True,
66
+ 'fetchBorrowInterest': False,
67
+ 'fetchBorrowRate': False,
62
68
  'fetchBorrowRateHistories': False,
63
69
  'fetchBorrowRateHistory': False,
70
+ 'fetchBorrowRates': False,
71
+ 'fetchBorrowRatesPerSymbol': False,
64
72
  'fetchClosedOrders': True,
65
73
  'fetchCrossBorrowRate': False,
66
74
  'fetchCrossBorrowRates': False,
@@ -70,20 +78,40 @@ class novadax(Exchange, ImplicitAPI):
70
78
  'fetchDeposits': True,
71
79
  'fetchDepositsWithdrawals': True,
72
80
  'fetchFundingHistory': False,
81
+ 'fetchFundingInterval': False,
82
+ 'fetchFundingIntervals': False,
73
83
  'fetchFundingRate': False,
74
84
  'fetchFundingRateHistory': False,
75
85
  'fetchFundingRates': False,
86
+ 'fetchGreeks': False,
76
87
  'fetchIndexOHLCV': False,
77
88
  'fetchIsolatedBorrowRate': False,
78
89
  'fetchIsolatedBorrowRates': False,
90
+ 'fetchIsolatedPositions': False,
79
91
  'fetchLeverage': False,
92
+ 'fetchLeverages': False,
80
93
  'fetchLeverageTiers': False,
94
+ 'fetchLiquidations': False,
95
+ 'fetchLongShortRatio': False,
96
+ 'fetchLongShortRatioHistory': False,
97
+ 'fetchMarginAdjustmentHistory': False,
98
+ 'fetchMarginMode': False,
99
+ 'fetchMarginModes': False,
100
+ 'fetchMarketLeverageTiers': False,
81
101
  'fetchMarkets': True,
82
102
  'fetchMarkOHLCV': False,
103
+ 'fetchMarkPrice': False,
104
+ 'fetchMarkPrices': False,
105
+ 'fetchMyLiquidations': False,
106
+ 'fetchMySettlementHistory': False,
83
107
  'fetchMyTrades': True,
84
108
  'fetchOHLCV': True,
109
+ 'fetchOpenInterest': False,
85
110
  'fetchOpenInterestHistory': False,
111
+ 'fetchOpenInterests': False,
86
112
  'fetchOpenOrders': True,
113
+ 'fetchOption': False,
114
+ 'fetchOptionChain': False,
87
115
  'fetchOrder': True,
88
116
  'fetchOrderBook': True,
89
117
  'fetchOrders': True,
@@ -96,6 +124,7 @@ class novadax(Exchange, ImplicitAPI):
96
124
  'fetchPositionsHistory': False,
97
125
  'fetchPositionsRisk': False,
98
126
  'fetchPremiumIndexOHLCV': False,
127
+ 'fetchSettlementHistory': False,
99
128
  'fetchTicker': True,
100
129
  'fetchTickers': True,
101
130
  'fetchTime': True,
@@ -103,9 +132,14 @@ class novadax(Exchange, ImplicitAPI):
103
132
  'fetchTradingFee': False,
104
133
  'fetchTradingFees': False,
105
134
  'fetchTransactions': 'emulated',
135
+ 'fetchUnderlyingAssets': False,
136
+ 'fetchVolatilityHistory': False,
106
137
  'fetchWithdrawals': True,
107
138
  'reduceMargin': False,
139
+ 'repayCrossMargin': False,
140
+ 'repayIsolatedMargin': False,
108
141
  'setLeverage': False,
142
+ 'setMargin': False,
109
143
  'setMarginMode': False,
110
144
  'setPositionMode': False,
111
145
  'transfer': True,
ccxt/async_support/okx.py CHANGED
@@ -19,6 +19,7 @@ from ccxt.base.errors import BadRequest
19
19
  from ccxt.base.errors import BadSymbol
20
20
  from ccxt.base.errors import OperationRejected
21
21
  from ccxt.base.errors import ManualInteractionNeeded
22
+ from ccxt.base.errors import RestrictedLocation
22
23
  from ccxt.base.errors import InsufficientFunds
23
24
  from ccxt.base.errors import InvalidAddress
24
25
  from ccxt.base.errors import InvalidOrder
@@ -762,6 +763,7 @@ class okx(Exchange, ImplicitAPI):
762
763
  '51137': InvalidOrder, # Your opening price has triggered the limit price, and the max buy price is {0}
763
764
  '51138': InvalidOrder, # Your opening price has triggered the limit price, and the min sell price is {0}
764
765
  '51139': InvalidOrder, # Reduce-only feature is unavailable for the spot transactions by simple account
766
+ '51155': RestrictedLocation, # {"code":"1","data":[{"clOrdId":"e847xxx","ordId":"","sCode":"51155","sMsg":"You can't trade self pair or borrow self crypto due to local compliance restrictions. ","tag":"e847xxx","ts":"1753979177157"}],"inTime":"1753979177157408","msg":"All operations failed","outTime":"1753979177157874"}
765
767
  '51156': BadRequest, # You're leading trades in long/short mode and can't use self API endpoint to close positions
766
768
  '51159': BadRequest, # You're leading trades in buy/sell mode. If you want to place orders using self API endpoint, the orders must be in the same direction existing positions and open orders.
767
769
  '51162': InvalidOrder, # You have {instrument} open orders. Cancel these orders and try again
@@ -33,25 +33,23 @@ NO_PADDING = 5
33
33
  PAD_WITH_ZERO = 6
34
34
 
35
35
 
36
- def decimal_to_precision(n, rounding_mode=ROUND, numPrecisionDigits=None, counting_mode=DECIMAL_PLACES, padding_mode=NO_PADDING):
37
- assert numPrecisionDigits is not None, 'numPrecisionDigits should not be None'
36
+ def decimal_to_precision(n, rounding_mode=ROUND, precision=None, counting_mode=DECIMAL_PLACES, padding_mode=NO_PADDING):
37
+ assert precision is not None, 'precision should not be None'
38
38
 
39
- if isinstance(numPrecisionDigits, str):
40
- numPrecisionDigits = float(numPrecisionDigits)
41
- assert isinstance(numPrecisionDigits, float) or isinstance(numPrecisionDigits, decimal.Decimal) or isinstance(numPrecisionDigits, numbers.Integral), 'numPrecisionDigits has an invalid number'
39
+ if isinstance(precision, str):
40
+ precision = float(precision)
41
+ assert isinstance(precision, float) or isinstance(precision, decimal.Decimal) or isinstance(precision, numbers.Integral), 'precision has an invalid number'
42
42
 
43
43
  if counting_mode == TICK_SIZE:
44
- assert numPrecisionDigits > 0, 'negative or zero numPrecisionDigits can not be used with TICK_SIZE precisionMode'
44
+ assert precision > 0, 'negative or zero precision can not be used with TICK_SIZE precisionMode'
45
45
  else:
46
- assert isinstance(numPrecisionDigits, numbers.Integral)
46
+ assert isinstance(precision, numbers.Integral)
47
47
 
48
48
  assert rounding_mode in [TRUNCATE, ROUND]
49
49
  assert counting_mode in [DECIMAL_PLACES, SIGNIFICANT_DIGITS, TICK_SIZE]
50
50
  assert padding_mode in [NO_PADDING, PAD_WITH_ZERO]
51
51
  # end of checks
52
52
 
53
- precision = numPrecisionDigits # "precision" variable name was in signature, but to make function signature similar to php/js, I had to change the argument name to "numPrecisionDigits". however, the below codes use "precision" variable name, so we have to assign that name here (you can change the usage of 'precision' variable name below everywhere, but i've refrained to do that to avoid many changes)
54
-
55
53
  context = decimal.getcontext()
56
54
 
57
55
  if counting_mode != TICK_SIZE:
ccxt/base/errors.py CHANGED
@@ -1,9 +1,3 @@
1
- # ----------------------------------------------------------------------------
2
-
3
- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
4
- # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
- # EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
-
7
1
  error_hierarchy = {
8
2
  'BaseError': {
9
3
  'ExchangeError': {
@@ -23,6 +17,7 @@ error_hierarchy = {
23
17
  },
24
18
  'MarketClosed': {},
25
19
  'ManualInteractionNeeded': {},
20
+ 'RestrictedLocation': {},
26
21
  },
27
22
  'InsufficientFunds': {},
28
23
  'InvalidAddress': {
@@ -118,6 +113,10 @@ class ManualInteractionNeeded(OperationRejected):
118
113
  pass
119
114
 
120
115
 
116
+ class RestrictedLocation(OperationRejected):
117
+ pass
118
+
119
+
121
120
  class InsufficientFunds(ExchangeError):
122
121
  pass
123
122
 
@@ -238,6 +237,7 @@ __all__ = [
238
237
  'MarginModeAlreadySet',
239
238
  'MarketClosed',
240
239
  'ManualInteractionNeeded',
240
+ 'RestrictedLocation',
241
241
  'InsufficientFunds',
242
242
  'InvalidAddress',
243
243
  'AddressPending',
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.97'
7
+ __version__ = '4.4.99'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
ccxt/binance.py CHANGED
@@ -2731,12 +2731,13 @@ class binance(Exchange, ImplicitAPI):
2731
2731
  return market
2732
2732
  return markets[0]
2733
2733
  elif (symbol.find('/') > -1) and (symbol.find(':') < 0):
2734
- # support legacy symbols
2735
- base, quote = symbol.split('/')
2736
- settle = base if (quote == 'USD') else quote
2737
- futuresSymbol = symbol + ':' + settle
2738
- if futuresSymbol in self.markets:
2739
- return self.markets[futuresSymbol]
2734
+ if (defaultType is not None) and (defaultType != 'spot'):
2735
+ # support legacy symbols
2736
+ base, quote = symbol.split('/')
2737
+ settle = base if (quote == 'USD') else quote
2738
+ futuresSymbol = symbol + ':' + settle
2739
+ if futuresSymbol in self.markets:
2740
+ return self.markets[futuresSymbol]
2740
2741
  elif (symbol.find('-C') > -1) or (symbol.find('-P') > -1): # both exchange-id and unified symbols are supported self way regardless of the defaultType
2741
2742
  return self.create_expired_option_market(symbol)
2742
2743
  raise BadSymbol(self.id + ' does not have market symbol ' + symbol)