ccxt 4.4.72__py2.py3-none-any.whl → 4.4.74__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 (68) hide show
  1. ccxt/__init__.py +1 -7
  2. ccxt/abstract/bitmart.py +2 -0
  3. ccxt/ace.py +39 -1
  4. ccxt/alpaca.py +49 -0
  5. ccxt/ascendex.py +7 -1
  6. ccxt/async_support/__init__.py +1 -7
  7. ccxt/async_support/ace.py +39 -1
  8. ccxt/async_support/alpaca.py +49 -0
  9. ccxt/async_support/ascendex.py +7 -1
  10. ccxt/async_support/base/exchange.py +1 -1
  11. ccxt/async_support/bequant.py +1 -0
  12. ccxt/async_support/binance.py +18 -14
  13. ccxt/async_support/binanceusdm.py +1 -1
  14. ccxt/async_support/bit2c.py +37 -0
  15. ccxt/async_support/bitbank.py +32 -0
  16. ccxt/async_support/bitbns.py +1 -1
  17. ccxt/async_support/bitflyer.py +1 -0
  18. ccxt/async_support/bitget.py +6 -5
  19. ccxt/async_support/bithumb.py +34 -0
  20. ccxt/async_support/bitmart.py +70 -6
  21. ccxt/async_support/bitrue.py +1 -1
  22. ccxt/async_support/blofin.py +1 -1
  23. ccxt/async_support/bybit.py +42 -26
  24. ccxt/async_support/coinlist.py +81 -11
  25. ccxt/async_support/defx.py +1 -1
  26. ccxt/async_support/deribit.py +19 -0
  27. ccxt/async_support/derive.py +2 -0
  28. ccxt/async_support/gate.py +11 -7
  29. ccxt/async_support/hitbtc.py +7 -1
  30. ccxt/async_support/okx.py +4 -0
  31. ccxt/base/errors.py +0 -6
  32. ccxt/base/exchange.py +26 -14
  33. ccxt/bequant.py +1 -0
  34. ccxt/binance.py +18 -14
  35. ccxt/binanceusdm.py +1 -1
  36. ccxt/bit2c.py +37 -0
  37. ccxt/bitbank.py +32 -0
  38. ccxt/bitbns.py +1 -1
  39. ccxt/bitflyer.py +1 -0
  40. ccxt/bitget.py +6 -5
  41. ccxt/bithumb.py +34 -0
  42. ccxt/bitmart.py +70 -6
  43. ccxt/bitrue.py +1 -1
  44. ccxt/blofin.py +1 -1
  45. ccxt/bybit.py +42 -26
  46. ccxt/coinlist.py +81 -11
  47. ccxt/defx.py +1 -1
  48. ccxt/deribit.py +19 -0
  49. ccxt/derive.py +2 -0
  50. ccxt/gate.py +11 -7
  51. ccxt/hitbtc.py +7 -1
  52. ccxt/okx.py +4 -0
  53. ccxt/pro/__init__.py +1 -7
  54. ccxt/pro/ascendex.py +1 -1
  55. ccxt/pro/bingx.py +9 -1
  56. ccxt/pro/bitget.py +9 -1
  57. ccxt/pro/bitmart.py +9 -1
  58. ccxt/pro/bitopro.py +5 -4
  59. ccxt/test/tests_async.py +6 -3
  60. ccxt/test/tests_sync.py +6 -3
  61. {ccxt-4.4.72.dist-info → ccxt-4.4.74.dist-info}/METADATA +5 -5
  62. {ccxt-4.4.72.dist-info → ccxt-4.4.74.dist-info}/RECORD +65 -68
  63. ccxt/abstract/bitcoincom.py +0 -115
  64. ccxt/abstract/bitfinex1.py +0 -69
  65. ccxt/abstract/bitpanda.py +0 -23
  66. {ccxt-4.4.72.dist-info → ccxt-4.4.74.dist-info}/LICENSE.txt +0 -0
  67. {ccxt-4.4.72.dist-info → ccxt-4.4.74.dist-info}/WHEEL +0 -0
  68. {ccxt-4.4.72.dist-info → ccxt-4.4.74.dist-info}/top_level.txt +0 -0
ccxt/binance.py CHANGED
@@ -1317,12 +1317,13 @@ class binance(Exchange, ImplicitAPI):
1317
1317
  },
1318
1318
  'quoteOrderQty': True, # whether market orders support amounts in quote currency
1319
1319
  'broker': {
1320
- 'spot': 'x-R4BD3S82',
1321
- 'margin': 'x-R4BD3S82',
1322
- 'future': 'x-xcKtGhcu',
1320
+ 'spot': 'x-TKT5PX2F',
1321
+ 'margin': 'x-TKT5PX2F',
1322
+ 'future': 'x-cvBPrNm9',
1323
1323
  'delivery': 'x-xcKtGhcu',
1324
- 'swap': 'x-xcKtGhcu',
1324
+ 'swap': 'x-cvBPrNm9',
1325
1325
  'option': 'x-xcKtGhcu',
1326
+ 'inverse': 'x-xcKtGhcu',
1326
1327
  },
1327
1328
  'accountsByType': {
1328
1329
  'main': 'MAIN',
@@ -5161,7 +5162,7 @@ class binance(Exchange, ImplicitAPI):
5161
5162
  # "symbol": "BTCUSDT",
5162
5163
  # "orderId": 16383176297,
5163
5164
  # "orderListId": -1,
5164
- # "clientOrderId": "x-R4BD3S8222ecb58eb9074fb1be018c",
5165
+ # "clientOrderId": "x-TKT5PX2F22ecb58eb9074fb1be018c",
5165
5166
  # "transactTime": 1670891847932,
5166
5167
  # "price": "13500.00000000",
5167
5168
  # "origQty": "0.00085000",
@@ -5517,7 +5518,7 @@ class binance(Exchange, ImplicitAPI):
5517
5518
  # "symbol": "BTCUSDT",
5518
5519
  # "orderId": 16383176297,
5519
5520
  # "orderListId": -1,
5520
- # "clientOrderId": "x-R4BD3S8222ecb58eb9074fb1be018c",
5521
+ # "clientOrderId": "x-TKT5PX2F22ecb58eb9074fb1be018c",
5521
5522
  # "transactTime": 1670891847932,
5522
5523
  # "price": "13500.00000000",
5523
5524
  # "origQty": "0.00085000",
@@ -5580,7 +5581,7 @@ class binance(Exchange, ImplicitAPI):
5580
5581
  # "symbol": "BTCUSDT",
5581
5582
  # "orderId": 5403233939,
5582
5583
  # "orderListId": -1,
5583
- # "clientOrderId": "x-R4BD3S825e669e75b6c14f69a2c43e",
5584
+ # "clientOrderId": "x-TKT5PX2F5e669e75b6c14f69a2c43e",
5584
5585
  # "transactTime": 1617151923742,
5585
5586
  # "price": "0.00000000",
5586
5587
  # "origQty": "0.00050000",
@@ -5755,7 +5756,7 @@ class binance(Exchange, ImplicitAPI):
5755
5756
  # createOrder, cancelAllOrders, cancelOrder: portfolio margin spot margin
5756
5757
  #
5757
5758
  # {
5758
- # "clientOrderId": "x-R4BD3S82e9ef29d8346440f0b28b86",
5759
+ # "clientOrderId": "x-TKT5PX2Fe9ef29d8346440f0b28b86",
5759
5760
  # "cummulativeQuoteQty": "0.00000000",
5760
5761
  # "executedQty": "0.00000000",
5761
5762
  # "fills": [],
@@ -5776,7 +5777,7 @@ class binance(Exchange, ImplicitAPI):
5776
5777
  # {
5777
5778
  # "symbol": "BTCUSDT",
5778
5779
  # "orderId": 24700763749,
5779
- # "clientOrderId": "x-R4BD3S826f724c2a4af6425f98c7b6",
5780
+ # "clientOrderId": "x-TKT5PX2F6f724c2a4af6425f98c7b6",
5780
5781
  # "price": "35000.00000000",
5781
5782
  # "origQty": "0.00100000",
5782
5783
  # "executedQty": "0.00000000",
@@ -6315,8 +6316,11 @@ class binance(Exchange, ImplicitAPI):
6315
6316
  clientOrderIdRequest = 'newClientStrategyId' if isPortfolioMarginConditional else 'newClientOrderId'
6316
6317
  if clientOrderId is None:
6317
6318
  broker = self.safe_dict(self.options, 'broker', {})
6318
- defaultId = 'x-xcKtGhcu' if (market['contract']) else 'x-R4BD3S82'
6319
- brokerId = self.safe_string(broker, marketType, defaultId)
6319
+ defaultId = 'x-xcKtGhcu' if (market['contract']) else 'x-TKT5PX2F'
6320
+ idMarketType = 'spot'
6321
+ if market['contract']:
6322
+ idMarketType = 'swap' if (market['swap'] and market['linear']) else 'inverse'
6323
+ brokerId = self.safe_string(broker, idMarketType, defaultId)
6320
6324
  request[clientOrderIdRequest] = brokerId + self.uuid22()
6321
6325
  else:
6322
6326
  request[clientOrderIdRequest] = clientOrderId
@@ -6835,7 +6839,7 @@ class binance(Exchange, ImplicitAPI):
6835
6839
  # {
6836
6840
  # "symbol": "BTCUSDT",
6837
6841
  # "orderId": 24684460474,
6838
- # "clientOrderId": "x-R4BD3S82e9ef29d8346440f0b28b86",
6842
+ # "clientOrderId": "x-TKT5PX2Fe9ef29d8346440f0b28b86",
6839
6843
  # "price": "35000.00000000",
6840
6844
  # "origQty": "0.00100000",
6841
6845
  # "executedQty": "0.00000000",
@@ -7448,7 +7452,7 @@ class binance(Exchange, ImplicitAPI):
7448
7452
  # [
7449
7453
  # {
7450
7454
  # "symbol": "ADAUSDT",
7451
- # "origClientOrderId": "x-R4BD3S82662cde7a90114475b86e21",
7455
+ # "origClientOrderId": "x-TKT5PX2F662cde7a90114475b86e21",
7452
7456
  # "orderId": 3935107,
7453
7457
  # "orderListId": -1,
7454
7458
  # "clientOrderId": "bqM2w1oTlugfRAjnTIFBE8",
@@ -11323,7 +11327,7 @@ class binance(Exchange, ImplicitAPI):
11323
11327
  if newClientOrderId is None:
11324
11328
  isSpotOrMargin = (api.find('sapi') > -1 or api == 'private')
11325
11329
  marketType = 'spot' if isSpotOrMargin else 'future'
11326
- defaultId = 'x-xcKtGhcu' if (not isSpotOrMargin) else 'x-R4BD3S82'
11330
+ defaultId = 'x-xcKtGhcu' if (not isSpotOrMargin) else 'x-TKT5PX2F'
11327
11331
  broker = self.safe_dict(self.options, 'broker', {})
11328
11332
  brokerId = self.safe_string(broker, marketType, defaultId)
11329
11333
  params['newClientOrderId'] = brokerId + self.uuid22()
ccxt/binanceusdm.py CHANGED
@@ -36,7 +36,7 @@ class binanceusdm(binance, ImplicitAPI):
36
36
  'fetchMarkets': ['linear'],
37
37
  'defaultSubType': 'linear',
38
38
  # https://www.binance.com/en/support/faq/360033162192
39
- # tier amount, maintenance margin, initial margin
39
+ # tier amount, maintenance margin, initial margin,
40
40
  'leverageBrackets': None,
41
41
  'marginTypes': {},
42
42
  'marginModes': {},
ccxt/bit2c.py CHANGED
@@ -36,49 +36,86 @@ class bit2c(Exchange, ImplicitAPI):
36
36
  'future': False,
37
37
  'option': False,
38
38
  'addMargin': False,
39
+ 'borrowCrossMargin': False,
40
+ 'borrowIsolatedMargin': False,
41
+ 'borrowMargin': False,
39
42
  'cancelAllOrders': False,
40
43
  'cancelOrder': True,
41
44
  'closeAllPositions': False,
42
45
  'closePosition': False,
43
46
  'createOrder': True,
47
+ 'createOrderWithTakeProfitAndStopLoss': False,
48
+ 'createOrderWithTakeProfitAndStopLossWs': False,
44
49
  'createReduceOnlyOrder': False,
45
50
  'fetchBalance': True,
51
+ 'fetchBorrowInterest': False,
52
+ 'fetchBorrowRate': False,
46
53
  'fetchBorrowRateHistories': False,
47
54
  'fetchBorrowRateHistory': False,
55
+ 'fetchBorrowRates': False,
56
+ 'fetchBorrowRatesPerSymbol': False,
48
57
  'fetchCrossBorrowRate': False,
49
58
  'fetchCrossBorrowRates': False,
50
59
  'fetchDepositAddress': True,
51
60
  'fetchDepositAddresses': False,
52
61
  'fetchDepositAddressesByNetwork': False,
53
62
  'fetchFundingHistory': False,
63
+ 'fetchFundingInterval': False,
64
+ 'fetchFundingIntervals': False,
54
65
  'fetchFundingRate': False,
55
66
  'fetchFundingRateHistory': False,
56
67
  'fetchFundingRates': False,
68
+ 'fetchGreeks': False,
57
69
  'fetchIndexOHLCV': False,
58
70
  'fetchIsolatedBorrowRate': False,
59
71
  'fetchIsolatedBorrowRates': False,
72
+ 'fetchIsolatedPositions': False,
60
73
  'fetchLeverage': False,
74
+ 'fetchLeverages': False,
61
75
  'fetchLeverageTiers': False,
76
+ 'fetchLiquidations': False,
77
+ 'fetchLongShortRatio': False,
78
+ 'fetchLongShortRatioHistory': False,
79
+ 'fetchMarginAdjustmentHistory': False,
62
80
  'fetchMarginMode': False,
81
+ 'fetchMarginModes': False,
82
+ 'fetchMarketLeverageTiers': False,
63
83
  'fetchMarkOHLCV': False,
84
+ 'fetchMarkPrices': False,
85
+ 'fetchMyLiquidations': False,
86
+ 'fetchMySettlementHistory': False,
64
87
  'fetchMyTrades': True,
88
+ 'fetchOpenInterest': False,
65
89
  'fetchOpenInterestHistory': False,
90
+ 'fetchOpenInterests': False,
66
91
  'fetchOpenOrders': True,
92
+ 'fetchOption': False,
93
+ 'fetchOptionChain': False,
67
94
  'fetchOrder': True,
68
95
  'fetchOrderBook': True,
69
96
  'fetchPosition': False,
97
+ 'fetchPositionHistory': False,
70
98
  'fetchPositionMode': False,
71
99
  'fetchPositions': False,
100
+ 'fetchPositionsForSymbol': False,
101
+ 'fetchPositionsHistory': False,
72
102
  'fetchPositionsRisk': False,
73
103
  'fetchPremiumIndexOHLCV': False,
104
+ 'fetchSettlementHistory': False,
74
105
  'fetchTicker': True,
75
106
  'fetchTrades': True,
76
107
  'fetchTradingFee': False,
77
108
  'fetchTradingFees': True,
78
109
  'fetchTransfer': False,
79
110
  'fetchTransfers': False,
111
+ 'fetchUnderlyingAssets': False,
112
+ 'fetchVolatilityHistory': False,
80
113
  'reduceMargin': False,
114
+ 'repayCrossMargin': False,
115
+ 'repayIsolatedMargin': False,
116
+ 'repayMargin': False,
81
117
  'setLeverage': False,
118
+ 'setMargin': False,
82
119
  'setMarginMode': False,
83
120
  'setPositionMode': False,
84
121
  'transfer': False,
ccxt/bitbank.py CHANGED
@@ -34,35 +34,62 @@ class bitbank(Exchange, ImplicitAPI):
34
34
  'future': False,
35
35
  'option': False,
36
36
  'addMargin': False,
37
+ 'borrowCrossMargin': False,
38
+ 'borrowIsolatedMargin': False,
39
+ 'borrowMargin': False,
37
40
  'cancelAllOrders': False,
38
41
  'cancelOrder': True,
39
42
  'closeAllPositions': False,
40
43
  'closePosition': False,
41
44
  'createOrder': True,
45
+ 'createOrderWithTakeProfitAndStopLoss': False,
46
+ 'createOrderWithTakeProfitAndStopLossWs': False,
42
47
  'createReduceOnlyOrder': False,
43
48
  'fetchBalance': True,
49
+ 'fetchBorrowInterest': False,
50
+ 'fetchBorrowRate': False,
44
51
  'fetchBorrowRateHistories': False,
45
52
  'fetchBorrowRateHistory': False,
53
+ 'fetchBorrowRates': False,
54
+ 'fetchBorrowRatesPerSymbol': False,
46
55
  'fetchCrossBorrowRate': False,
47
56
  'fetchCrossBorrowRates': False,
48
57
  'fetchDepositAddress': True,
49
58
  'fetchDepositAddresses': False,
50
59
  'fetchDepositAddressesByNetwork': False,
51
60
  'fetchFundingHistory': False,
61
+ 'fetchFundingInterval': False,
62
+ 'fetchFundingIntervals': False,
52
63
  'fetchFundingRate': False,
53
64
  'fetchFundingRateHistory': False,
54
65
  'fetchFundingRates': False,
66
+ 'fetchGreeks': False,
55
67
  'fetchIndexOHLCV': False,
56
68
  'fetchIsolatedBorrowRate': False,
57
69
  'fetchIsolatedBorrowRates': False,
70
+ 'fetchIsolatedPositions': False,
58
71
  'fetchLeverage': False,
72
+ 'fetchLeverages': False,
59
73
  'fetchLeverageTiers': False,
74
+ 'fetchLiquidations': False,
75
+ 'fetchLongShortRatio': False,
76
+ 'fetchLongShortRatioHistory': False,
77
+ 'fetchMarginAdjustmentHistory': False,
60
78
  'fetchMarginMode': False,
79
+ 'fetchMarginModes': False,
80
+ 'fetchMarketLeverageTiers': False,
61
81
  'fetchMarkOHLCV': False,
82
+ 'fetchMarkPrices': False,
83
+ 'fetchMyLiquidations': False,
84
+ 'fetchMySettlementHistory': False,
62
85
  'fetchMyTrades': True,
63
86
  'fetchOHLCV': True,
87
+ 'fetchOpenInterest': False,
64
88
  'fetchOpenInterestHistory': False,
89
+ 'fetchOpenInterests': False,
65
90
  'fetchOpenOrders': True,
91
+ 'fetchOption': False,
92
+ 'fetchOptionChain': False,
66
93
  'fetchOrder': True,
67
94
  'fetchOrderBook': True,
68
95
  'fetchPosition': False,
@@ -73,14 +100,19 @@ class bitbank(Exchange, ImplicitAPI):
73
100
  'fetchPositionsHistory': False,
74
101
  'fetchPositionsRisk': False,
75
102
  'fetchPremiumIndexOHLCV': False,
103
+ 'fetchSettlementHistory': False,
76
104
  'fetchTicker': True,
77
105
  'fetchTrades': True,
78
106
  'fetchTradingFee': False,
79
107
  'fetchTradingFees': True,
80
108
  'fetchTransfer': False,
81
109
  'fetchTransfers': False,
110
+ 'fetchVolatilityHistory': False,
82
111
  'reduceMargin': False,
112
+ 'repayCrossMargin': False,
113
+ 'repayIsolatedMargin': False,
83
114
  'setLeverage': False,
115
+ 'setMargin': False,
84
116
  'setMarginMode': False,
85
117
  'setPositionMode': False,
86
118
  'transfer': False,
ccxt/bitbns.py CHANGED
@@ -315,7 +315,7 @@ class bitbns(Exchange, ImplicitAPI):
315
315
  'swap': False,
316
316
  'future': False,
317
317
  'option': False,
318
- 'active': None,
318
+ 'active': self.safe_bool(market, 'active'),
319
319
  'contract': False,
320
320
  'linear': None,
321
321
  'inverse': None,
ccxt/bitflyer.py CHANGED
@@ -250,6 +250,7 @@ class bitflyer(Exchange, ImplicitAPI):
250
250
  # {"product_code": "BCH_BTC", "market_type": "Spot"},
251
251
  # # forex swap
252
252
  # {"product_code": "FX_BTC_JPY", "market_type": "FX"},
253
+ #
253
254
  # # future
254
255
  # {
255
256
  # "product_code": "BTCJPY11FEB2022",
ccxt/bitget.py CHANGED
@@ -1917,7 +1917,7 @@ class bitget(Exchange, ImplicitAPI):
1917
1917
  priceDecimals = self.safe_integer(market, 'pricePlace')
1918
1918
  amountDecimals = self.safe_integer(market, 'volumePlace')
1919
1919
  priceStep = self.safe_string(market, 'priceEndStep')
1920
- amountStep = self.safe_string(market, 'minTradeNum')
1920
+ amountStep = self.safe_string(market, 'sizeMultiplier')
1921
1921
  precise = Precise(priceStep)
1922
1922
  precise.decimals = max(precise.decimals, priceDecimals)
1923
1923
  precise.reduce()
@@ -2416,16 +2416,17 @@ class bitget(Exchange, ImplicitAPI):
2416
2416
  paginate, params = self.handle_option_and_params(params, 'fetchWithdrawals', 'paginate')
2417
2417
  if paginate:
2418
2418
  return self.fetch_paginated_call_cursor('fetchWithdrawals', None, since, limit, params, 'idLessThan', 'idLessThan', None, 100)
2419
- if code is None:
2420
- raise ArgumentsRequired(self.id + ' fetchWithdrawals() requires a `code` argument')
2421
- currency = self.currency(code)
2419
+ currency = None
2420
+ if code is not None:
2421
+ currency = self.currency(code)
2422
2422
  if since is None:
2423
2423
  since = self.milliseconds() - 7776000000 # 90 days
2424
2424
  request: dict = {
2425
- 'coin': currency['id'],
2426
2425
  'startTime': since,
2427
2426
  'endTime': self.milliseconds(),
2428
2427
  }
2428
+ if currency is not None:
2429
+ request['coin'] = currency['id']
2429
2430
  request, params = self.handle_until_option('endTime', request, params)
2430
2431
  if limit is not None:
2431
2432
  request['limit'] = limit
ccxt/bithumb.py CHANGED
@@ -39,30 +39,59 @@ class bithumb(Exchange, ImplicitAPI):
39
39
  'future': False,
40
40
  'option': False,
41
41
  'addMargin': False,
42
+ 'borrowCrossMargin': False,
43
+ 'borrowIsolatedMargin': False,
44
+ 'borrowMargin': False,
42
45
  'cancelOrder': True,
43
46
  'closeAllPositions': False,
44
47
  'closePosition': False,
45
48
  'createMarketOrder': True,
46
49
  'createOrder': True,
50
+ 'createOrderWithTakeProfitAndStopLoss': False,
51
+ 'createOrderWithTakeProfitAndStopLossWs': False,
47
52
  'createReduceOnlyOrder': False,
48
53
  'fetchBalance': True,
54
+ 'fetchBorrowInterest': False,
55
+ 'fetchBorrowRate': False,
49
56
  'fetchBorrowRateHistories': False,
50
57
  'fetchBorrowRateHistory': False,
58
+ 'fetchBorrowRates': False,
59
+ 'fetchBorrowRatesPerSymbol': False,
51
60
  'fetchCrossBorrowRate': False,
52
61
  'fetchCrossBorrowRates': False,
53
62
  'fetchFundingHistory': False,
63
+ 'fetchFundingInterval': False,
64
+ 'fetchFundingIntervals': False,
54
65
  'fetchFundingRate': False,
55
66
  'fetchFundingRateHistory': False,
56
67
  'fetchFundingRates': False,
68
+ 'fetchGreeks': False,
57
69
  'fetchIndexOHLCV': False,
58
70
  'fetchIsolatedBorrowRate': False,
59
71
  'fetchIsolatedBorrowRates': False,
72
+ 'fetchIsolatedPositions': False,
60
73
  'fetchLeverage': False,
74
+ 'fetchLeverages': False,
75
+ 'fetchLeverageTiers': False,
76
+ 'fetchLiquidations': False,
77
+ 'fetchLongShortRatio': False,
78
+ 'fetchLongShortRatioHistory': False,
79
+ 'fetchMarginAdjustmentHistory': False,
80
+ 'fetchMarginMode': False,
81
+ 'fetchMarginModes': False,
82
+ 'fetchMarketLeverageTiers': False,
61
83
  'fetchMarkets': True,
62
84
  'fetchMarkOHLCV': False,
85
+ 'fetchMarkPrices': False,
86
+ 'fetchMyLiquidations': False,
87
+ 'fetchMySettlementHistory': False,
63
88
  'fetchOHLCV': True,
89
+ 'fetchOpenInterest': False,
64
90
  'fetchOpenInterestHistory': False,
91
+ 'fetchOpenInterests': False,
65
92
  'fetchOpenOrders': True,
93
+ 'fetchOption': False,
94
+ 'fetchOptionChain': False,
66
95
  'fetchOrder': True,
67
96
  'fetchOrderBook': True,
68
97
  'fetchPosition': False,
@@ -73,13 +102,18 @@ class bithumb(Exchange, ImplicitAPI):
73
102
  'fetchPositionsHistory': False,
74
103
  'fetchPositionsRisk': False,
75
104
  'fetchPremiumIndexOHLCV': False,
105
+ 'fetchSettlementHistory': False,
76
106
  'fetchTicker': True,
77
107
  'fetchTickers': True,
78
108
  'fetchTrades': True,
79
109
  'fetchTransfer': False,
80
110
  'fetchTransfers': False,
111
+ 'fetchVolatilityHistory': False,
81
112
  'reduceMargin': False,
113
+ 'repayCrossMargin': False,
114
+ 'repayIsolatedMargin': False,
82
115
  'setLeverage': False,
116
+ 'setMargin': False,
83
117
  'setMarginMode': False,
84
118
  'setPositionMode': False,
85
119
  'transfer': False,
ccxt/bitmart.py CHANGED
@@ -104,7 +104,7 @@ class bitmart(Exchange, ImplicitAPI):
104
104
  'fetchOrders': False,
105
105
  'fetchOrderTrades': True,
106
106
  'fetchPosition': True,
107
- 'fetchPositionMode': False,
107
+ 'fetchPositionMode': True,
108
108
  'fetchPositions': True,
109
109
  'fetchStatus': True,
110
110
  'fetchTicker': True,
@@ -126,6 +126,7 @@ class bitmart(Exchange, ImplicitAPI):
126
126
  'repayIsolatedMargin': True,
127
127
  'setLeverage': True,
128
128
  'setMarginMode': False,
129
+ 'setPositionMode': True,
129
130
  'transfer': True,
130
131
  'withdraw': True,
131
132
  },
@@ -231,6 +232,7 @@ class bitmart(Exchange, ImplicitAPI):
231
232
  'contract/private/affilate/rebate-list': 10,
232
233
  'contract/private/affilate/trade-list': 10,
233
234
  'contract/private/transaction-history': 10,
235
+ 'contract/private/get-position-mode': 1,
234
236
  },
235
237
  'post': {
236
238
  # sub-account endpoints
@@ -283,6 +285,7 @@ class bitmart(Exchange, ImplicitAPI):
283
285
  'contract/private/modify-tp-sl-order': 2.5,
284
286
  'contract/private/submit-trail-order': 2.5, # weight is not provided by the exchange, is set order
285
287
  'contract/private/cancel-trail-order': 1.5, # weight is not provided by the exchange, is set order
288
+ 'contract/private/set-position-mode': 1,
286
289
  },
287
290
  },
288
291
  },
@@ -1205,7 +1208,7 @@ class bitmart(Exchange, ImplicitAPI):
1205
1208
  # {
1206
1209
  # "message": "OK",
1207
1210
  # "code": 1000,
1208
- # "trace": "619294ecef584282b26a3be322b1e01f.66.17403093228242228",
1211
+ # "trace": "619294ecef584282b26a3be322b1e01f.66.17403093228242229",
1209
1212
  # "data": {
1210
1213
  # "currencies": [
1211
1214
  # {
@@ -3847,10 +3850,11 @@ class bitmart(Exchange, ImplicitAPI):
3847
3850
  timestamp = self.safe_integer(transaction, 'apply_time')
3848
3851
  currencyId = self.safe_string(transaction, 'currency')
3849
3852
  networkId: Str = None
3850
- if currencyId.find('NFT') < 0:
3851
- parts = currencyId.split('-')
3852
- currencyId = self.safe_string(parts, 0)
3853
- networkId = self.safe_string(parts, 1)
3853
+ if currencyId is not None:
3854
+ if currencyId.find('NFT') < 0:
3855
+ parts = currencyId.split('-')
3856
+ currencyId = self.safe_string(parts, 0)
3857
+ networkId = self.safe_string(parts, 1)
3854
3858
  code = self.safe_currency_code(currencyId, currency)
3855
3859
  status = self.parse_transaction_status(self.safe_string(transaction, 'status'))
3856
3860
  feeCost = self.safe_number(transaction, 'fee')
@@ -5212,6 +5216,66 @@ class bitmart(Exchange, ImplicitAPI):
5212
5216
  addresses.append(address)
5213
5217
  return addresses
5214
5218
 
5219
+ def set_position_mode(self, hedged: bool, symbol: Str = None, params={}):
5220
+ """
5221
+ set hedged to True or False for a market
5222
+
5223
+ https://developer-pro.bitmart.com/en/futuresv2/#submit-leverage-signed
5224
+
5225
+ :param bool hedged: set to True to use dualSidePosition
5226
+ :param str symbol: not used by bingx setPositionMode()
5227
+ :param dict [params]: extra parameters specific to the exchange API endpoint
5228
+ :returns dict: response from the exchange
5229
+ """
5230
+ self.load_markets()
5231
+ positionMode = None
5232
+ if hedged:
5233
+ positionMode = 'hedge_mode'
5234
+ else:
5235
+ positionMode = 'one_way_mode'
5236
+ request: dict = {
5237
+ 'position_mode': positionMode,
5238
+ }
5239
+ #
5240
+ # {
5241
+ # "code": 1000,
5242
+ # "trace": "0cc6f4c4-8b8c-4253-8e90-8d3195aa109c",
5243
+ # "message": "Ok",
5244
+ # "data": {
5245
+ # "position_mode":"one_way_mode"
5246
+ # }
5247
+ # }
5248
+ #
5249
+ return self.privatePostContractPrivateSetPositionMode(self.extend(request, params))
5250
+
5251
+ def fetch_position_mode(self, symbol: Str = None, params={}):
5252
+ """
5253
+ fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
5254
+
5255
+ https://developer-pro.bitmart.com/en/futuresv2/#get-position-mode-keyed
5256
+
5257
+ :param str symbol: not used
5258
+ :param dict [params]: extra parameters specific to the exchange API endpoint
5259
+ :returns dict: an object detailing whether the market is in hedged or one-way mode
5260
+ """
5261
+ response = self.privateGetContractPrivateGetPositionMode(params)
5262
+ #
5263
+ # {
5264
+ # "code": 1000,
5265
+ # "trace": "0cc6f4c4-8b8c-4253-8e90-8d3195aa109c",
5266
+ # "message": "Ok",
5267
+ # "data": {
5268
+ # "position_mode":"one_way_mode"
5269
+ # }
5270
+ # }
5271
+ #
5272
+ data = self.safe_dict(response, 'data')
5273
+ positionMode = self.safe_string(data, 'position_mode')
5274
+ return {
5275
+ 'info': response,
5276
+ 'hedged': (positionMode == 'hedge_mode'),
5277
+ }
5278
+
5215
5279
  def nonce(self):
5216
5280
  return self.milliseconds() - self.options['timeDifference']
5217
5281
 
ccxt/bitrue.py CHANGED
@@ -1229,7 +1229,7 @@ class bitrue(Exchange, ImplicitAPI):
1229
1229
  # "time": 1699338305000
1230
1230
  # }
1231
1231
  #
1232
- timestamp = self.safe_integer(response, 'time')
1232
+ timestamp = self.safe_integer_2(response, 'time', 'lastUpdateId')
1233
1233
  orderbook = self.parse_order_book(response, symbol, timestamp)
1234
1234
  orderbook['nonce'] = self.safe_integer(response, 'lastUpdateId')
1235
1235
  return orderbook
ccxt/blofin.py CHANGED
@@ -66,7 +66,7 @@ class blofin(Exchange, ImplicitAPI):
66
66
  'fetchBorrowRateHistory': False,
67
67
  'fetchCanceledOrders': False,
68
68
  'fetchClosedOrder': False,
69
- 'fetchClosedOrders': False,
69
+ 'fetchClosedOrders': True,
70
70
  'fetchCrossBorrowRate': False,
71
71
  'fetchCrossBorrowRates': False,
72
72
  'fetchCurrencies': False,