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.
- ccxt/__init__.py +1 -7
- ccxt/abstract/bitmart.py +2 -0
- ccxt/ace.py +39 -1
- ccxt/alpaca.py +49 -0
- ccxt/ascendex.py +7 -1
- ccxt/async_support/__init__.py +1 -7
- ccxt/async_support/ace.py +39 -1
- ccxt/async_support/alpaca.py +49 -0
- ccxt/async_support/ascendex.py +7 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/bequant.py +1 -0
- ccxt/async_support/binance.py +18 -14
- ccxt/async_support/binanceusdm.py +1 -1
- ccxt/async_support/bit2c.py +37 -0
- ccxt/async_support/bitbank.py +32 -0
- ccxt/async_support/bitbns.py +1 -1
- ccxt/async_support/bitflyer.py +1 -0
- ccxt/async_support/bitget.py +6 -5
- ccxt/async_support/bithumb.py +34 -0
- ccxt/async_support/bitmart.py +70 -6
- ccxt/async_support/bitrue.py +1 -1
- ccxt/async_support/blofin.py +1 -1
- ccxt/async_support/bybit.py +42 -26
- ccxt/async_support/coinlist.py +81 -11
- ccxt/async_support/defx.py +1 -1
- ccxt/async_support/deribit.py +19 -0
- ccxt/async_support/derive.py +2 -0
- ccxt/async_support/gate.py +11 -7
- ccxt/async_support/hitbtc.py +7 -1
- ccxt/async_support/okx.py +4 -0
- ccxt/base/errors.py +0 -6
- ccxt/base/exchange.py +26 -14
- ccxt/bequant.py +1 -0
- ccxt/binance.py +18 -14
- ccxt/binanceusdm.py +1 -1
- ccxt/bit2c.py +37 -0
- ccxt/bitbank.py +32 -0
- ccxt/bitbns.py +1 -1
- ccxt/bitflyer.py +1 -0
- ccxt/bitget.py +6 -5
- ccxt/bithumb.py +34 -0
- ccxt/bitmart.py +70 -6
- ccxt/bitrue.py +1 -1
- ccxt/blofin.py +1 -1
- ccxt/bybit.py +42 -26
- ccxt/coinlist.py +81 -11
- ccxt/defx.py +1 -1
- ccxt/deribit.py +19 -0
- ccxt/derive.py +2 -0
- ccxt/gate.py +11 -7
- ccxt/hitbtc.py +7 -1
- ccxt/okx.py +4 -0
- ccxt/pro/__init__.py +1 -7
- ccxt/pro/ascendex.py +1 -1
- ccxt/pro/bingx.py +9 -1
- ccxt/pro/bitget.py +9 -1
- ccxt/pro/bitmart.py +9 -1
- ccxt/pro/bitopro.py +5 -4
- ccxt/test/tests_async.py +6 -3
- ccxt/test/tests_sync.py +6 -3
- {ccxt-4.4.72.dist-info → ccxt-4.4.74.dist-info}/METADATA +5 -5
- {ccxt-4.4.72.dist-info → ccxt-4.4.74.dist-info}/RECORD +65 -68
- ccxt/abstract/bitcoincom.py +0 -115
- ccxt/abstract/bitfinex1.py +0 -69
- ccxt/abstract/bitpanda.py +0 -23
- {ccxt-4.4.72.dist-info → ccxt-4.4.74.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.72.dist-info → ccxt-4.4.74.dist-info}/WHEEL +0 -0
- {ccxt-4.4.72.dist-info → ccxt-4.4.74.dist-info}/top_level.txt +0 -0
ccxt/async_support/binance.py
CHANGED
@@ -1318,12 +1318,13 @@ class binance(Exchange, ImplicitAPI):
|
|
1318
1318
|
},
|
1319
1319
|
'quoteOrderQty': True, # whether market orders support amounts in quote currency
|
1320
1320
|
'broker': {
|
1321
|
-
'spot': 'x-
|
1322
|
-
'margin': 'x-
|
1323
|
-
'future': 'x-
|
1321
|
+
'spot': 'x-TKT5PX2F',
|
1322
|
+
'margin': 'x-TKT5PX2F',
|
1323
|
+
'future': 'x-cvBPrNm9',
|
1324
1324
|
'delivery': 'x-xcKtGhcu',
|
1325
|
-
'swap': 'x-
|
1325
|
+
'swap': 'x-cvBPrNm9',
|
1326
1326
|
'option': 'x-xcKtGhcu',
|
1327
|
+
'inverse': 'x-xcKtGhcu',
|
1327
1328
|
},
|
1328
1329
|
'accountsByType': {
|
1329
1330
|
'main': 'MAIN',
|
@@ -5162,7 +5163,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5162
5163
|
# "symbol": "BTCUSDT",
|
5163
5164
|
# "orderId": 16383176297,
|
5164
5165
|
# "orderListId": -1,
|
5165
|
-
# "clientOrderId": "x-
|
5166
|
+
# "clientOrderId": "x-TKT5PX2F22ecb58eb9074fb1be018c",
|
5166
5167
|
# "transactTime": 1670891847932,
|
5167
5168
|
# "price": "13500.00000000",
|
5168
5169
|
# "origQty": "0.00085000",
|
@@ -5518,7 +5519,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5518
5519
|
# "symbol": "BTCUSDT",
|
5519
5520
|
# "orderId": 16383176297,
|
5520
5521
|
# "orderListId": -1,
|
5521
|
-
# "clientOrderId": "x-
|
5522
|
+
# "clientOrderId": "x-TKT5PX2F22ecb58eb9074fb1be018c",
|
5522
5523
|
# "transactTime": 1670891847932,
|
5523
5524
|
# "price": "13500.00000000",
|
5524
5525
|
# "origQty": "0.00085000",
|
@@ -5581,7 +5582,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5581
5582
|
# "symbol": "BTCUSDT",
|
5582
5583
|
# "orderId": 5403233939,
|
5583
5584
|
# "orderListId": -1,
|
5584
|
-
# "clientOrderId": "x-
|
5585
|
+
# "clientOrderId": "x-TKT5PX2F5e669e75b6c14f69a2c43e",
|
5585
5586
|
# "transactTime": 1617151923742,
|
5586
5587
|
# "price": "0.00000000",
|
5587
5588
|
# "origQty": "0.00050000",
|
@@ -5756,7 +5757,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5756
5757
|
# createOrder, cancelAllOrders, cancelOrder: portfolio margin spot margin
|
5757
5758
|
#
|
5758
5759
|
# {
|
5759
|
-
# "clientOrderId": "x-
|
5760
|
+
# "clientOrderId": "x-TKT5PX2Fe9ef29d8346440f0b28b86",
|
5760
5761
|
# "cummulativeQuoteQty": "0.00000000",
|
5761
5762
|
# "executedQty": "0.00000000",
|
5762
5763
|
# "fills": [],
|
@@ -5777,7 +5778,7 @@ class binance(Exchange, ImplicitAPI):
|
|
5777
5778
|
# {
|
5778
5779
|
# "symbol": "BTCUSDT",
|
5779
5780
|
# "orderId": 24700763749,
|
5780
|
-
# "clientOrderId": "x-
|
5781
|
+
# "clientOrderId": "x-TKT5PX2F6f724c2a4af6425f98c7b6",
|
5781
5782
|
# "price": "35000.00000000",
|
5782
5783
|
# "origQty": "0.00100000",
|
5783
5784
|
# "executedQty": "0.00000000",
|
@@ -6316,8 +6317,11 @@ class binance(Exchange, ImplicitAPI):
|
|
6316
6317
|
clientOrderIdRequest = 'newClientStrategyId' if isPortfolioMarginConditional else 'newClientOrderId'
|
6317
6318
|
if clientOrderId is None:
|
6318
6319
|
broker = self.safe_dict(self.options, 'broker', {})
|
6319
|
-
defaultId = 'x-xcKtGhcu' if (market['contract']) else 'x-
|
6320
|
-
|
6320
|
+
defaultId = 'x-xcKtGhcu' if (market['contract']) else 'x-TKT5PX2F'
|
6321
|
+
idMarketType = 'spot'
|
6322
|
+
if market['contract']:
|
6323
|
+
idMarketType = 'swap' if (market['swap'] and market['linear']) else 'inverse'
|
6324
|
+
brokerId = self.safe_string(broker, idMarketType, defaultId)
|
6321
6325
|
request[clientOrderIdRequest] = brokerId + self.uuid22()
|
6322
6326
|
else:
|
6323
6327
|
request[clientOrderIdRequest] = clientOrderId
|
@@ -6836,7 +6840,7 @@ class binance(Exchange, ImplicitAPI):
|
|
6836
6840
|
# {
|
6837
6841
|
# "symbol": "BTCUSDT",
|
6838
6842
|
# "orderId": 24684460474,
|
6839
|
-
# "clientOrderId": "x-
|
6843
|
+
# "clientOrderId": "x-TKT5PX2Fe9ef29d8346440f0b28b86",
|
6840
6844
|
# "price": "35000.00000000",
|
6841
6845
|
# "origQty": "0.00100000",
|
6842
6846
|
# "executedQty": "0.00000000",
|
@@ -7449,7 +7453,7 @@ class binance(Exchange, ImplicitAPI):
|
|
7449
7453
|
# [
|
7450
7454
|
# {
|
7451
7455
|
# "symbol": "ADAUSDT",
|
7452
|
-
# "origClientOrderId": "x-
|
7456
|
+
# "origClientOrderId": "x-TKT5PX2F662cde7a90114475b86e21",
|
7453
7457
|
# "orderId": 3935107,
|
7454
7458
|
# "orderListId": -1,
|
7455
7459
|
# "clientOrderId": "bqM2w1oTlugfRAjnTIFBE8",
|
@@ -11324,7 +11328,7 @@ class binance(Exchange, ImplicitAPI):
|
|
11324
11328
|
if newClientOrderId is None:
|
11325
11329
|
isSpotOrMargin = (api.find('sapi') > -1 or api == 'private')
|
11326
11330
|
marketType = 'spot' if isSpotOrMargin else 'future'
|
11327
|
-
defaultId = 'x-xcKtGhcu' if (not isSpotOrMargin) else 'x-
|
11331
|
+
defaultId = 'x-xcKtGhcu' if (not isSpotOrMargin) else 'x-TKT5PX2F'
|
11328
11332
|
broker = self.safe_dict(self.options, 'broker', {})
|
11329
11333
|
brokerId = self.safe_string(broker, marketType, defaultId)
|
11330
11334
|
params['newClientOrderId'] = brokerId + self.uuid22()
|
@@ -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/async_support/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/async_support/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/async_support/bitbns.py
CHANGED
ccxt/async_support/bitflyer.py
CHANGED
ccxt/async_support/bitget.py
CHANGED
@@ -1918,7 +1918,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
1918
1918
|
priceDecimals = self.safe_integer(market, 'pricePlace')
|
1919
1919
|
amountDecimals = self.safe_integer(market, 'volumePlace')
|
1920
1920
|
priceStep = self.safe_string(market, 'priceEndStep')
|
1921
|
-
amountStep = self.safe_string(market, '
|
1921
|
+
amountStep = self.safe_string(market, 'sizeMultiplier')
|
1922
1922
|
precise = Precise(priceStep)
|
1923
1923
|
precise.decimals = max(precise.decimals, priceDecimals)
|
1924
1924
|
precise.reduce()
|
@@ -2417,16 +2417,17 @@ class bitget(Exchange, ImplicitAPI):
|
|
2417
2417
|
paginate, params = self.handle_option_and_params(params, 'fetchWithdrawals', 'paginate')
|
2418
2418
|
if paginate:
|
2419
2419
|
return await self.fetch_paginated_call_cursor('fetchWithdrawals', None, since, limit, params, 'idLessThan', 'idLessThan', None, 100)
|
2420
|
-
|
2421
|
-
|
2422
|
-
|
2420
|
+
currency = None
|
2421
|
+
if code is not None:
|
2422
|
+
currency = self.currency(code)
|
2423
2423
|
if since is None:
|
2424
2424
|
since = self.milliseconds() - 7776000000 # 90 days
|
2425
2425
|
request: dict = {
|
2426
|
-
'coin': currency['id'],
|
2427
2426
|
'startTime': since,
|
2428
2427
|
'endTime': self.milliseconds(),
|
2429
2428
|
}
|
2429
|
+
if currency is not None:
|
2430
|
+
request['coin'] = currency['id']
|
2430
2431
|
request, params = self.handle_until_option('endTime', request, params)
|
2431
2432
|
if limit is not None:
|
2432
2433
|
request['limit'] = limit
|
ccxt/async_support/bithumb.py
CHANGED
@@ -40,30 +40,59 @@ class bithumb(Exchange, ImplicitAPI):
|
|
40
40
|
'future': False,
|
41
41
|
'option': False,
|
42
42
|
'addMargin': False,
|
43
|
+
'borrowCrossMargin': False,
|
44
|
+
'borrowIsolatedMargin': False,
|
45
|
+
'borrowMargin': False,
|
43
46
|
'cancelOrder': True,
|
44
47
|
'closeAllPositions': False,
|
45
48
|
'closePosition': False,
|
46
49
|
'createMarketOrder': True,
|
47
50
|
'createOrder': True,
|
51
|
+
'createOrderWithTakeProfitAndStopLoss': False,
|
52
|
+
'createOrderWithTakeProfitAndStopLossWs': False,
|
48
53
|
'createReduceOnlyOrder': False,
|
49
54
|
'fetchBalance': True,
|
55
|
+
'fetchBorrowInterest': False,
|
56
|
+
'fetchBorrowRate': False,
|
50
57
|
'fetchBorrowRateHistories': False,
|
51
58
|
'fetchBorrowRateHistory': False,
|
59
|
+
'fetchBorrowRates': False,
|
60
|
+
'fetchBorrowRatesPerSymbol': False,
|
52
61
|
'fetchCrossBorrowRate': False,
|
53
62
|
'fetchCrossBorrowRates': False,
|
54
63
|
'fetchFundingHistory': False,
|
64
|
+
'fetchFundingInterval': False,
|
65
|
+
'fetchFundingIntervals': False,
|
55
66
|
'fetchFundingRate': False,
|
56
67
|
'fetchFundingRateHistory': False,
|
57
68
|
'fetchFundingRates': False,
|
69
|
+
'fetchGreeks': False,
|
58
70
|
'fetchIndexOHLCV': False,
|
59
71
|
'fetchIsolatedBorrowRate': False,
|
60
72
|
'fetchIsolatedBorrowRates': False,
|
73
|
+
'fetchIsolatedPositions': False,
|
61
74
|
'fetchLeverage': False,
|
75
|
+
'fetchLeverages': False,
|
76
|
+
'fetchLeverageTiers': False,
|
77
|
+
'fetchLiquidations': False,
|
78
|
+
'fetchLongShortRatio': False,
|
79
|
+
'fetchLongShortRatioHistory': False,
|
80
|
+
'fetchMarginAdjustmentHistory': False,
|
81
|
+
'fetchMarginMode': False,
|
82
|
+
'fetchMarginModes': False,
|
83
|
+
'fetchMarketLeverageTiers': False,
|
62
84
|
'fetchMarkets': True,
|
63
85
|
'fetchMarkOHLCV': False,
|
86
|
+
'fetchMarkPrices': False,
|
87
|
+
'fetchMyLiquidations': False,
|
88
|
+
'fetchMySettlementHistory': False,
|
64
89
|
'fetchOHLCV': True,
|
90
|
+
'fetchOpenInterest': False,
|
65
91
|
'fetchOpenInterestHistory': False,
|
92
|
+
'fetchOpenInterests': False,
|
66
93
|
'fetchOpenOrders': True,
|
94
|
+
'fetchOption': False,
|
95
|
+
'fetchOptionChain': False,
|
67
96
|
'fetchOrder': True,
|
68
97
|
'fetchOrderBook': True,
|
69
98
|
'fetchPosition': False,
|
@@ -74,13 +103,18 @@ class bithumb(Exchange, ImplicitAPI):
|
|
74
103
|
'fetchPositionsHistory': False,
|
75
104
|
'fetchPositionsRisk': False,
|
76
105
|
'fetchPremiumIndexOHLCV': False,
|
106
|
+
'fetchSettlementHistory': False,
|
77
107
|
'fetchTicker': True,
|
78
108
|
'fetchTickers': True,
|
79
109
|
'fetchTrades': True,
|
80
110
|
'fetchTransfer': False,
|
81
111
|
'fetchTransfers': False,
|
112
|
+
'fetchVolatilityHistory': False,
|
82
113
|
'reduceMargin': False,
|
114
|
+
'repayCrossMargin': False,
|
115
|
+
'repayIsolatedMargin': False,
|
83
116
|
'setLeverage': False,
|
117
|
+
'setMargin': False,
|
84
118
|
'setMarginMode': False,
|
85
119
|
'setPositionMode': False,
|
86
120
|
'transfer': False,
|
ccxt/async_support/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':
|
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.
|
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
|
3851
|
-
|
3852
|
-
|
3853
|
-
|
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
|
+
async 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
|
+
await 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 await self.privatePostContractPrivateSetPositionMode(self.extend(request, params))
|
5250
|
+
|
5251
|
+
async 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 = await 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/async_support/bitrue.py
CHANGED
@@ -1230,7 +1230,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1230
1230
|
# "time": 1699338305000
|
1231
1231
|
# }
|
1232
1232
|
#
|
1233
|
-
timestamp = self.
|
1233
|
+
timestamp = self.safe_integer_2(response, 'time', 'lastUpdateId')
|
1234
1234
|
orderbook = self.parse_order_book(response, symbol, timestamp)
|
1235
1235
|
orderbook['nonce'] = self.safe_integer(response, 'lastUpdateId')
|
1236
1236
|
return orderbook
|
ccxt/async_support/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':
|
69
|
+
'fetchClosedOrders': True,
|
70
70
|
'fetchCrossBorrowRate': False,
|
71
71
|
'fetchCrossBorrowRates': False,
|
72
72
|
'fetchCurrencies': False,
|