ccxt 4.4.17__py2.py3-none-any.whl → 4.4.19__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 -1
- ccxt/abstract/binance.py +4 -0
- ccxt/abstract/binancecoinm.py +4 -0
- ccxt/abstract/binanceus.py +4 -0
- ccxt/abstract/binanceusdm.py +4 -0
- ccxt/abstract/kucoinfutures.py +1 -0
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +18 -3
- ccxt/async_support/bingx.py +5 -3
- ccxt/async_support/bitget.py +1 -1
- ccxt/async_support/bitmart.py +1 -1
- ccxt/async_support/bitso.py +9 -13
- ccxt/async_support/gate.py +49 -20
- ccxt/async_support/htx.py +26 -0
- ccxt/async_support/hyperliquid.py +4 -0
- ccxt/async_support/kucoin.py +1 -1
- ccxt/async_support/kucoinfutures.py +82 -2
- ccxt/async_support/mexc.py +4 -2
- ccxt/async_support/okx.py +2 -1
- ccxt/base/exchange.py +1 -1
- ccxt/base/types.py +12 -1
- ccxt/binance.py +18 -3
- ccxt/bingx.py +5 -3
- ccxt/bitget.py +1 -1
- ccxt/bitmart.py +1 -1
- ccxt/bitso.py +9 -13
- ccxt/gate.py +49 -20
- ccxt/htx.py +26 -0
- ccxt/hyperliquid.py +4 -0
- ccxt/kucoin.py +1 -1
- ccxt/kucoinfutures.py +82 -2
- ccxt/mexc.py +4 -2
- ccxt/okx.py +2 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitget.py +11 -3
- {ccxt-4.4.17.dist-info → ccxt-4.4.19.dist-info}/METADATA +4 -4
- {ccxt-4.4.17.dist-info → ccxt-4.4.19.dist-info}/RECORD +41 -41
- {ccxt-4.4.17.dist-info → ccxt-4.4.19.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.17.dist-info → ccxt-4.4.19.dist-info}/WHEEL +0 -0
- {ccxt-4.4.17.dist-info → ccxt-4.4.19.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/abstract/binance.py
CHANGED
@@ -482,6 +482,7 @@ class ImplicitAPI:
|
|
482
482
|
fapipublic_get_constituents = fapiPublicGetConstituents = Entry('constituents', 'fapiPublic', 'GET', {'cost': 2})
|
483
483
|
fapipublic_get_apitradingstatus = fapiPublicGetApiTradingStatus = Entry('apiTradingStatus', 'fapiPublic', 'GET', {'cost': 1, 'noSymbol': 10})
|
484
484
|
fapipublic_get_lvtklines = fapiPublicGetLvtKlines = Entry('lvtKlines', 'fapiPublic', 'GET', {'cost': 1})
|
485
|
+
fapipublic_get_convert_exchangeinfo = fapiPublicGetConvertExchangeInfo = Entry('convert/exchangeInfo', 'fapiPublic', 'GET', {'cost': 4})
|
485
486
|
fapidata_get_delivery_price = fapiDataGetDeliveryPrice = Entry('delivery-price', 'fapiData', 'GET', {'cost': 1})
|
486
487
|
fapidata_get_openinteresthist = fapiDataGetOpenInterestHist = Entry('openInterestHist', 'fapiData', 'GET', {'cost': 1})
|
487
488
|
fapidata_get_toplongshortaccountratio = fapiDataGetTopLongShortAccountRatio = Entry('topLongShortAccountRatio', 'fapiData', 'GET', {'cost': 1})
|
@@ -526,6 +527,7 @@ class ImplicitAPI:
|
|
526
527
|
fapiprivate_get_feeburn = fapiPrivateGetFeeBurn = Entry('feeBurn', 'fapiPrivate', 'GET', {'cost': 1})
|
527
528
|
fapiprivate_get_symbolconfig = fapiPrivateGetSymbolConfig = Entry('symbolConfig', 'fapiPrivate', 'GET', {'cost': 5})
|
528
529
|
fapiprivate_get_accountconfig = fapiPrivateGetAccountConfig = Entry('accountConfig', 'fapiPrivate', 'GET', {'cost': 5})
|
530
|
+
fapiprivate_get_convert_orderstatus = fapiPrivateGetConvertOrderStatus = Entry('convert/orderStatus', 'fapiPrivate', 'GET', {'cost': 5})
|
529
531
|
fapiprivate_post_batchorders = fapiPrivatePostBatchOrders = Entry('batchOrders', 'fapiPrivate', 'POST', {'cost': 5})
|
530
532
|
fapiprivate_post_positionside_dual = fapiPrivatePostPositionSideDual = Entry('positionSide/dual', 'fapiPrivate', 'POST', {'cost': 1})
|
531
533
|
fapiprivate_post_positionmargin = fapiPrivatePostPositionMargin = Entry('positionMargin', 'fapiPrivate', 'POST', {'cost': 1})
|
@@ -538,6 +540,8 @@ class ImplicitAPI:
|
|
538
540
|
fapiprivate_post_apireferral_customization = fapiPrivatePostApiReferralCustomization = Entry('apiReferral/customization', 'fapiPrivate', 'POST', {'cost': 1})
|
539
541
|
fapiprivate_post_apireferral_usercustomization = fapiPrivatePostApiReferralUserCustomization = Entry('apiReferral/userCustomization', 'fapiPrivate', 'POST', {'cost': 1})
|
540
542
|
fapiprivate_post_feeburn = fapiPrivatePostFeeBurn = Entry('feeBurn', 'fapiPrivate', 'POST', {'cost': 1})
|
543
|
+
fapiprivate_post_convert_getquote = fapiPrivatePostConvertGetQuote = Entry('convert/getQuote', 'fapiPrivate', 'POST', {'cost': 200})
|
544
|
+
fapiprivate_post_convert_acceptquote = fapiPrivatePostConvertAcceptQuote = Entry('convert/acceptQuote', 'fapiPrivate', 'POST', {'cost': 20})
|
541
545
|
fapiprivate_put_listenkey = fapiPrivatePutListenKey = Entry('listenKey', 'fapiPrivate', 'PUT', {'cost': 1})
|
542
546
|
fapiprivate_put_order = fapiPrivatePutOrder = Entry('order', 'fapiPrivate', 'PUT', {'cost': 1})
|
543
547
|
fapiprivate_put_batchorders = fapiPrivatePutBatchOrders = Entry('batchOrders', 'fapiPrivate', 'PUT', {'cost': 5})
|
ccxt/abstract/binancecoinm.py
CHANGED
@@ -482,6 +482,7 @@ class ImplicitAPI:
|
|
482
482
|
fapipublic_get_constituents = fapiPublicGetConstituents = Entry('constituents', 'fapiPublic', 'GET', {'cost': 2})
|
483
483
|
fapipublic_get_apitradingstatus = fapiPublicGetApiTradingStatus = Entry('apiTradingStatus', 'fapiPublic', 'GET', {'cost': 1, 'noSymbol': 10})
|
484
484
|
fapipublic_get_lvtklines = fapiPublicGetLvtKlines = Entry('lvtKlines', 'fapiPublic', 'GET', {'cost': 1})
|
485
|
+
fapipublic_get_convert_exchangeinfo = fapiPublicGetConvertExchangeInfo = Entry('convert/exchangeInfo', 'fapiPublic', 'GET', {'cost': 4})
|
485
486
|
fapidata_get_delivery_price = fapiDataGetDeliveryPrice = Entry('delivery-price', 'fapiData', 'GET', {'cost': 1})
|
486
487
|
fapidata_get_openinteresthist = fapiDataGetOpenInterestHist = Entry('openInterestHist', 'fapiData', 'GET', {'cost': 1})
|
487
488
|
fapidata_get_toplongshortaccountratio = fapiDataGetTopLongShortAccountRatio = Entry('topLongShortAccountRatio', 'fapiData', 'GET', {'cost': 1})
|
@@ -526,6 +527,7 @@ class ImplicitAPI:
|
|
526
527
|
fapiprivate_get_feeburn = fapiPrivateGetFeeBurn = Entry('feeBurn', 'fapiPrivate', 'GET', {'cost': 1})
|
527
528
|
fapiprivate_get_symbolconfig = fapiPrivateGetSymbolConfig = Entry('symbolConfig', 'fapiPrivate', 'GET', {'cost': 5})
|
528
529
|
fapiprivate_get_accountconfig = fapiPrivateGetAccountConfig = Entry('accountConfig', 'fapiPrivate', 'GET', {'cost': 5})
|
530
|
+
fapiprivate_get_convert_orderstatus = fapiPrivateGetConvertOrderStatus = Entry('convert/orderStatus', 'fapiPrivate', 'GET', {'cost': 5})
|
529
531
|
fapiprivate_post_batchorders = fapiPrivatePostBatchOrders = Entry('batchOrders', 'fapiPrivate', 'POST', {'cost': 5})
|
530
532
|
fapiprivate_post_positionside_dual = fapiPrivatePostPositionSideDual = Entry('positionSide/dual', 'fapiPrivate', 'POST', {'cost': 1})
|
531
533
|
fapiprivate_post_positionmargin = fapiPrivatePostPositionMargin = Entry('positionMargin', 'fapiPrivate', 'POST', {'cost': 1})
|
@@ -538,6 +540,8 @@ class ImplicitAPI:
|
|
538
540
|
fapiprivate_post_apireferral_customization = fapiPrivatePostApiReferralCustomization = Entry('apiReferral/customization', 'fapiPrivate', 'POST', {'cost': 1})
|
539
541
|
fapiprivate_post_apireferral_usercustomization = fapiPrivatePostApiReferralUserCustomization = Entry('apiReferral/userCustomization', 'fapiPrivate', 'POST', {'cost': 1})
|
540
542
|
fapiprivate_post_feeburn = fapiPrivatePostFeeBurn = Entry('feeBurn', 'fapiPrivate', 'POST', {'cost': 1})
|
543
|
+
fapiprivate_post_convert_getquote = fapiPrivatePostConvertGetQuote = Entry('convert/getQuote', 'fapiPrivate', 'POST', {'cost': 200})
|
544
|
+
fapiprivate_post_convert_acceptquote = fapiPrivatePostConvertAcceptQuote = Entry('convert/acceptQuote', 'fapiPrivate', 'POST', {'cost': 20})
|
541
545
|
fapiprivate_put_listenkey = fapiPrivatePutListenKey = Entry('listenKey', 'fapiPrivate', 'PUT', {'cost': 1})
|
542
546
|
fapiprivate_put_order = fapiPrivatePutOrder = Entry('order', 'fapiPrivate', 'PUT', {'cost': 1})
|
543
547
|
fapiprivate_put_batchorders = fapiPrivatePutBatchOrders = Entry('batchOrders', 'fapiPrivate', 'PUT', {'cost': 5})
|
ccxt/abstract/binanceus.py
CHANGED
@@ -534,6 +534,7 @@ class ImplicitAPI:
|
|
534
534
|
fapipublic_get_constituents = fapiPublicGetConstituents = Entry('constituents', 'fapiPublic', 'GET', {'cost': 2})
|
535
535
|
fapipublic_get_apitradingstatus = fapiPublicGetApiTradingStatus = Entry('apiTradingStatus', 'fapiPublic', 'GET', {'cost': 1, 'noSymbol': 10})
|
536
536
|
fapipublic_get_lvtklines = fapiPublicGetLvtKlines = Entry('lvtKlines', 'fapiPublic', 'GET', {'cost': 1})
|
537
|
+
fapipublic_get_convert_exchangeinfo = fapiPublicGetConvertExchangeInfo = Entry('convert/exchangeInfo', 'fapiPublic', 'GET', {'cost': 4})
|
537
538
|
fapidata_get_delivery_price = fapiDataGetDeliveryPrice = Entry('delivery-price', 'fapiData', 'GET', {'cost': 1})
|
538
539
|
fapidata_get_openinteresthist = fapiDataGetOpenInterestHist = Entry('openInterestHist', 'fapiData', 'GET', {'cost': 1})
|
539
540
|
fapidata_get_toplongshortaccountratio = fapiDataGetTopLongShortAccountRatio = Entry('topLongShortAccountRatio', 'fapiData', 'GET', {'cost': 1})
|
@@ -578,6 +579,7 @@ class ImplicitAPI:
|
|
578
579
|
fapiprivate_get_feeburn = fapiPrivateGetFeeBurn = Entry('feeBurn', 'fapiPrivate', 'GET', {'cost': 1})
|
579
580
|
fapiprivate_get_symbolconfig = fapiPrivateGetSymbolConfig = Entry('symbolConfig', 'fapiPrivate', 'GET', {'cost': 5})
|
580
581
|
fapiprivate_get_accountconfig = fapiPrivateGetAccountConfig = Entry('accountConfig', 'fapiPrivate', 'GET', {'cost': 5})
|
582
|
+
fapiprivate_get_convert_orderstatus = fapiPrivateGetConvertOrderStatus = Entry('convert/orderStatus', 'fapiPrivate', 'GET', {'cost': 5})
|
581
583
|
fapiprivate_post_batchorders = fapiPrivatePostBatchOrders = Entry('batchOrders', 'fapiPrivate', 'POST', {'cost': 5})
|
582
584
|
fapiprivate_post_positionside_dual = fapiPrivatePostPositionSideDual = Entry('positionSide/dual', 'fapiPrivate', 'POST', {'cost': 1})
|
583
585
|
fapiprivate_post_positionmargin = fapiPrivatePostPositionMargin = Entry('positionMargin', 'fapiPrivate', 'POST', {'cost': 1})
|
@@ -590,6 +592,8 @@ class ImplicitAPI:
|
|
590
592
|
fapiprivate_post_apireferral_customization = fapiPrivatePostApiReferralCustomization = Entry('apiReferral/customization', 'fapiPrivate', 'POST', {'cost': 1})
|
591
593
|
fapiprivate_post_apireferral_usercustomization = fapiPrivatePostApiReferralUserCustomization = Entry('apiReferral/userCustomization', 'fapiPrivate', 'POST', {'cost': 1})
|
592
594
|
fapiprivate_post_feeburn = fapiPrivatePostFeeBurn = Entry('feeBurn', 'fapiPrivate', 'POST', {'cost': 1})
|
595
|
+
fapiprivate_post_convert_getquote = fapiPrivatePostConvertGetQuote = Entry('convert/getQuote', 'fapiPrivate', 'POST', {'cost': 200})
|
596
|
+
fapiprivate_post_convert_acceptquote = fapiPrivatePostConvertAcceptQuote = Entry('convert/acceptQuote', 'fapiPrivate', 'POST', {'cost': 20})
|
593
597
|
fapiprivate_put_listenkey = fapiPrivatePutListenKey = Entry('listenKey', 'fapiPrivate', 'PUT', {'cost': 1})
|
594
598
|
fapiprivate_put_order = fapiPrivatePutOrder = Entry('order', 'fapiPrivate', 'PUT', {'cost': 1})
|
595
599
|
fapiprivate_put_batchorders = fapiPrivatePutBatchOrders = Entry('batchOrders', 'fapiPrivate', 'PUT', {'cost': 5})
|
ccxt/abstract/binanceusdm.py
CHANGED
@@ -482,6 +482,7 @@ class ImplicitAPI:
|
|
482
482
|
fapipublic_get_constituents = fapiPublicGetConstituents = Entry('constituents', 'fapiPublic', 'GET', {'cost': 2})
|
483
483
|
fapipublic_get_apitradingstatus = fapiPublicGetApiTradingStatus = Entry('apiTradingStatus', 'fapiPublic', 'GET', {'cost': 1, 'noSymbol': 10})
|
484
484
|
fapipublic_get_lvtklines = fapiPublicGetLvtKlines = Entry('lvtKlines', 'fapiPublic', 'GET', {'cost': 1})
|
485
|
+
fapipublic_get_convert_exchangeinfo = fapiPublicGetConvertExchangeInfo = Entry('convert/exchangeInfo', 'fapiPublic', 'GET', {'cost': 4})
|
485
486
|
fapidata_get_delivery_price = fapiDataGetDeliveryPrice = Entry('delivery-price', 'fapiData', 'GET', {'cost': 1})
|
486
487
|
fapidata_get_openinteresthist = fapiDataGetOpenInterestHist = Entry('openInterestHist', 'fapiData', 'GET', {'cost': 1})
|
487
488
|
fapidata_get_toplongshortaccountratio = fapiDataGetTopLongShortAccountRatio = Entry('topLongShortAccountRatio', 'fapiData', 'GET', {'cost': 1})
|
@@ -526,6 +527,7 @@ class ImplicitAPI:
|
|
526
527
|
fapiprivate_get_feeburn = fapiPrivateGetFeeBurn = Entry('feeBurn', 'fapiPrivate', 'GET', {'cost': 1})
|
527
528
|
fapiprivate_get_symbolconfig = fapiPrivateGetSymbolConfig = Entry('symbolConfig', 'fapiPrivate', 'GET', {'cost': 5})
|
528
529
|
fapiprivate_get_accountconfig = fapiPrivateGetAccountConfig = Entry('accountConfig', 'fapiPrivate', 'GET', {'cost': 5})
|
530
|
+
fapiprivate_get_convert_orderstatus = fapiPrivateGetConvertOrderStatus = Entry('convert/orderStatus', 'fapiPrivate', 'GET', {'cost': 5})
|
529
531
|
fapiprivate_post_batchorders = fapiPrivatePostBatchOrders = Entry('batchOrders', 'fapiPrivate', 'POST', {'cost': 5})
|
530
532
|
fapiprivate_post_positionside_dual = fapiPrivatePostPositionSideDual = Entry('positionSide/dual', 'fapiPrivate', 'POST', {'cost': 1})
|
531
533
|
fapiprivate_post_positionmargin = fapiPrivatePostPositionMargin = Entry('positionMargin', 'fapiPrivate', 'POST', {'cost': 1})
|
@@ -538,6 +540,8 @@ class ImplicitAPI:
|
|
538
540
|
fapiprivate_post_apireferral_customization = fapiPrivatePostApiReferralCustomization = Entry('apiReferral/customization', 'fapiPrivate', 'POST', {'cost': 1})
|
539
541
|
fapiprivate_post_apireferral_usercustomization = fapiPrivatePostApiReferralUserCustomization = Entry('apiReferral/userCustomization', 'fapiPrivate', 'POST', {'cost': 1})
|
540
542
|
fapiprivate_post_feeburn = fapiPrivatePostFeeBurn = Entry('feeBurn', 'fapiPrivate', 'POST', {'cost': 1})
|
543
|
+
fapiprivate_post_convert_getquote = fapiPrivatePostConvertGetQuote = Entry('convert/getQuote', 'fapiPrivate', 'POST', {'cost': 200})
|
544
|
+
fapiprivate_post_convert_acceptquote = fapiPrivatePostConvertAcceptQuote = Entry('convert/acceptQuote', 'fapiPrivate', 'POST', {'cost': 20})
|
541
545
|
fapiprivate_put_listenkey = fapiPrivatePutListenKey = Entry('listenKey', 'fapiPrivate', 'PUT', {'cost': 1})
|
542
546
|
fapiprivate_put_order = fapiPrivatePutOrder = Entry('order', 'fapiPrivate', 'PUT', {'cost': 1})
|
543
547
|
fapiprivate_put_batchorders = fapiPrivatePutBatchOrders = Entry('batchOrders', 'fapiPrivate', 'PUT', {'cost': 5})
|
ccxt/abstract/kucoinfutures.py
CHANGED
@@ -219,6 +219,7 @@ class ImplicitAPI:
|
|
219
219
|
futuresprivate_delete_withdrawals_withdrawalid = futuresPrivateDeleteWithdrawalsWithdrawalId = Entry('withdrawals/{withdrawalId}', 'futuresPrivate', 'DELETE', {'cost': 1})
|
220
220
|
futuresprivate_delete_cancel_transfer_out = futuresPrivateDeleteCancelTransferOut = Entry('cancel/transfer-out', 'futuresPrivate', 'DELETE', {'cost': 1})
|
221
221
|
futuresprivate_delete_sub_api_key = futuresPrivateDeleteSubApiKey = Entry('sub/api-key', 'futuresPrivate', 'DELETE', {'cost': 1})
|
222
|
+
futuresprivate_delete_orders_multi_cancel = futuresPrivateDeleteOrdersMultiCancel = Entry('orders/multi-cancel', 'futuresPrivate', 'DELETE', {'cost': 20})
|
222
223
|
webexchange_get_currency_currency_chain_info = webExchangeGetCurrencyCurrencyChainInfo = Entry('currency/currency/chain-info', 'webExchange', 'GET', {'cost': 1})
|
223
224
|
webexchange_get_contract_symbol_funding_rates = webExchangeGetContractSymbolFundingRates = Entry('contract/{symbol}/funding-rates', 'webExchange', 'GET', {'cost': 1})
|
224
225
|
broker_get_broker_nd_info = brokerGetBrokerNdInfo = Entry('broker/nd/info', 'broker', 'GET', {'cost': 2})
|
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/binance.py
CHANGED
@@ -828,6 +828,7 @@ class binance(Exchange, ImplicitAPI):
|
|
828
828
|
'constituents': 2,
|
829
829
|
'apiTradingStatus': {'cost': 1, 'noSymbol': 10},
|
830
830
|
'lvtKlines': 1,
|
831
|
+
'convert/exchangeInfo': 4,
|
831
832
|
},
|
832
833
|
},
|
833
834
|
'fapiData': {
|
@@ -881,6 +882,7 @@ class binance(Exchange, ImplicitAPI):
|
|
881
882
|
'feeBurn': 1,
|
882
883
|
'symbolConfig': 5,
|
883
884
|
'accountConfig': 5,
|
885
|
+
'convert/orderStatus': 5,
|
884
886
|
},
|
885
887
|
'post': {
|
886
888
|
'batchOrders': 5,
|
@@ -896,6 +898,8 @@ class binance(Exchange, ImplicitAPI):
|
|
896
898
|
'apiReferral/customization': 1,
|
897
899
|
'apiReferral/userCustomization': 1,
|
898
900
|
'feeBurn': 1,
|
901
|
+
'convert/getQuote': 200, # 360 requests per hour
|
902
|
+
'convert/acceptQuote': 20,
|
899
903
|
},
|
900
904
|
'put': {
|
901
905
|
'listenKey': 1,
|
@@ -3162,14 +3166,15 @@ class binance(Exchange, ImplicitAPI):
|
|
3162
3166
|
fees = self.fees
|
3163
3167
|
linear = None
|
3164
3168
|
inverse = None
|
3165
|
-
strike = self.safe_string(market, 'strikePrice')
|
3166
3169
|
symbol = base + '/' + quote
|
3170
|
+
strike = None
|
3167
3171
|
if contract:
|
3168
3172
|
if swap:
|
3169
3173
|
symbol = symbol + ':' + settle
|
3170
3174
|
elif future:
|
3171
3175
|
symbol = symbol + ':' + settle + '-' + self.yymmdd(expiry)
|
3172
3176
|
elif option:
|
3177
|
+
strike = self.number_to_string(self.parse_to_numeric(self.safe_string(market, 'strikePrice')))
|
3173
3178
|
symbol = symbol + ':' + settle + '-' + self.yymmdd(expiry) + '-' + strike + '-' + self.safe_string(optionParts, 3)
|
3174
3179
|
contractSize = self.safe_number_2(market, 'contractSize', 'unit', self.parse_number('1'))
|
3175
3180
|
linear = settle == quote
|
@@ -5947,11 +5952,21 @@ class binance(Exchange, ImplicitAPI):
|
|
5947
5952
|
if isPortfolioMargin:
|
5948
5953
|
request['quantity'] = self.parse_to_numeric(amount)
|
5949
5954
|
else:
|
5950
|
-
|
5955
|
+
marketAmountPrecision = self.safe_string(market['precision'], 'amount')
|
5956
|
+
isPrecisionAvailable = (marketAmountPrecision is not None)
|
5957
|
+
if isPrecisionAvailable:
|
5958
|
+
request['quantity'] = self.amount_to_precision(symbol, amount)
|
5959
|
+
else:
|
5960
|
+
request['quantity'] = self.parse_to_numeric(amount) # some options don't have the precision available
|
5951
5961
|
if priceIsRequired and not isPriceMatch:
|
5952
5962
|
if price is None:
|
5953
5963
|
raise InvalidOrder(self.id + ' createOrder() requires a price argument for a ' + type + ' order')
|
5954
|
-
|
5964
|
+
pricePrecision = self.safe_string(market['precision'], 'price')
|
5965
|
+
isPricePrecisionAvailable = (pricePrecision is not None)
|
5966
|
+
if isPricePrecisionAvailable:
|
5967
|
+
request['price'] = self.price_to_precision(symbol, price)
|
5968
|
+
else:
|
5969
|
+
request['price'] = self.parse_to_numeric(price) # some options don't have the precision available
|
5955
5970
|
if stopPriceIsRequired:
|
5956
5971
|
if market['contract']:
|
5957
5972
|
if stopPrice is None:
|
ccxt/async_support/bingx.py
CHANGED
@@ -509,6 +509,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
509
509
|
},
|
510
510
|
'networks': {
|
511
511
|
'ARB': 'ARBITRUM',
|
512
|
+
'MATIC': 'POLYGON',
|
512
513
|
},
|
513
514
|
},
|
514
515
|
})
|
@@ -614,9 +615,10 @@ class bingx(Exchange, ImplicitAPI):
|
|
614
615
|
'max': self.safe_number(rawNetwork, 'withdrawMax'),
|
615
616
|
},
|
616
617
|
}
|
618
|
+
fee = self.safe_number(rawNetwork, 'withdrawFee')
|
617
619
|
if isDefault:
|
618
|
-
fee = self.safe_number(rawNetwork, 'withdrawFee')
|
619
620
|
defaultLimits = limits
|
621
|
+
precision = self.safe_number(rawNetwork, 'withdrawPrecision')
|
620
622
|
networkActive = networkDepositEnabled or networkWithdrawEnabled
|
621
623
|
networks[networkCode] = {
|
622
624
|
'info': rawNetwork,
|
@@ -626,7 +628,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
626
628
|
'active': networkActive,
|
627
629
|
'deposit': networkDepositEnabled,
|
628
630
|
'withdraw': networkWithdrawEnabled,
|
629
|
-
'precision':
|
631
|
+
'precision': precision,
|
630
632
|
'limits': limits,
|
631
633
|
}
|
632
634
|
active = depositEnabled or withdrawEnabled
|
@@ -771,7 +773,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
771
773
|
isActive = False
|
772
774
|
if (self.safe_string(market, 'apiStateOpen') == 'true') and (self.safe_string(market, 'apiStateClose') == 'true'):
|
773
775
|
isActive = True # swap active
|
774
|
-
elif self.safe_bool(market, 'apiStateSell') and self.safe_bool(market, 'apiStateBuy') and (self.
|
776
|
+
elif self.safe_bool(market, 'apiStateSell') and self.safe_bool(market, 'apiStateBuy') and (self.safe_string(market, 'status') == '1'):
|
775
777
|
isActive = True # spot active
|
776
778
|
isInverse = None if (spot) else checkIsInverse
|
777
779
|
isLinear = None if (spot) else checkIsLinear
|
ccxt/async_support/bitget.py
CHANGED
ccxt/async_support/bitmart.py
CHANGED
ccxt/async_support/bitso.py
CHANGED
@@ -124,6 +124,12 @@ class bitso(Exchange, ImplicitAPI):
|
|
124
124
|
'TUSD': 0.01,
|
125
125
|
},
|
126
126
|
'defaultPrecision': 0.00000001,
|
127
|
+
'networks': {
|
128
|
+
'TRC20': 'trx',
|
129
|
+
'ERC20': 'erc20',
|
130
|
+
'BEP20': 'bsc',
|
131
|
+
'BEP2': 'bep2',
|
132
|
+
},
|
127
133
|
},
|
128
134
|
'timeframes': {
|
129
135
|
'1m': '60',
|
@@ -1548,18 +1554,6 @@ class bitso(Exchange, ImplicitAPI):
|
|
1548
1554
|
first = self.safe_dict(payload, 0)
|
1549
1555
|
return self.parse_transaction(first, currency)
|
1550
1556
|
|
1551
|
-
def safe_network(self, networkId):
|
1552
|
-
if networkId is None:
|
1553
|
-
return None
|
1554
|
-
networkId = networkId.upper()
|
1555
|
-
networksById: dict = {
|
1556
|
-
'trx': 'TRC20',
|
1557
|
-
'erc20': 'ERC20',
|
1558
|
-
'bsc': 'BEP20',
|
1559
|
-
'bep2': 'BEP2',
|
1560
|
-
}
|
1561
|
-
return self.safe_string(networksById, networkId, networkId)
|
1562
|
-
|
1563
1557
|
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
1564
1558
|
#
|
1565
1559
|
# deposit
|
@@ -1606,12 +1600,14 @@ class bitso(Exchange, ImplicitAPI):
|
|
1606
1600
|
networkId = self.safe_string_2(transaction, 'network', 'method')
|
1607
1601
|
status = self.safe_string(transaction, 'status')
|
1608
1602
|
withdrawId = self.safe_string(transaction, 'wid')
|
1603
|
+
networkCode = self.network_id_to_code(networkId)
|
1604
|
+
networkCodeUpper = networkCode.upper() if (networkCode is not None) else None
|
1609
1605
|
return {
|
1610
1606
|
'id': self.safe_string_2(transaction, 'wid', 'fid'),
|
1611
1607
|
'txid': self.safe_string(details, 'tx_hash'),
|
1612
1608
|
'timestamp': self.parse8601(datetime),
|
1613
1609
|
'datetime': datetime,
|
1614
|
-
'network':
|
1610
|
+
'network': networkCodeUpper,
|
1615
1611
|
'addressFrom': receivingAddress,
|
1616
1612
|
'address': withdrawalAddress if (withdrawalAddress is not None) else receivingAddress,
|
1617
1613
|
'addressTo': withdrawalAddress,
|
ccxt/async_support/gate.py
CHANGED
@@ -3491,32 +3491,61 @@ class gate(Exchange, ImplicitAPI):
|
|
3491
3491
|
|
3492
3492
|
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
3493
3493
|
#
|
3494
|
-
#
|
3494
|
+
# fetchDeposits
|
3495
3495
|
#
|
3496
|
-
#
|
3497
|
-
#
|
3498
|
-
#
|
3499
|
-
#
|
3500
|
-
#
|
3501
|
-
#
|
3502
|
-
#
|
3503
|
-
#
|
3504
|
-
#
|
3505
|
-
#
|
3496
|
+
# {
|
3497
|
+
# "id": "d33361395",
|
3498
|
+
# "currency": "USDT_TRX",
|
3499
|
+
# "address": "TErdnxenuLtXfnMafLbfappYdHtnXQ5U4z",
|
3500
|
+
# "amount": "100",
|
3501
|
+
# "txid": "ae9374de34e558562fe18cbb1bf9ab4d9eb8aa7669d65541c9fa2a532c1474a0",
|
3502
|
+
# "timestamp": "1626345819",
|
3503
|
+
# "status": "DONE",
|
3504
|
+
# "memo": ""
|
3505
|
+
# }
|
3506
3506
|
#
|
3507
3507
|
# withdraw
|
3508
3508
|
#
|
3509
|
-
#
|
3510
|
-
#
|
3511
|
-
#
|
3512
|
-
#
|
3513
|
-
#
|
3514
|
-
#
|
3515
|
-
#
|
3509
|
+
# {
|
3510
|
+
# "id":"w64413318",
|
3511
|
+
# "currency":"usdt",
|
3512
|
+
# "amount":"10150",
|
3513
|
+
# "address":"0x0ab891497116f7f5532a4c2f4f7b1784488628e1",
|
3514
|
+
# "memo":null,
|
3515
|
+
# "status":"REQUEST",
|
3516
|
+
# "chain":"eth",
|
3517
|
+
# "withdraw_order_id":"",
|
3518
|
+
# "fee_amount":"4.15000000"
|
3519
|
+
# }
|
3520
|
+
#
|
3521
|
+
# fetchWithdrawals
|
3522
|
+
#
|
3523
|
+
# {
|
3524
|
+
# "id": "210496",
|
3525
|
+
# "timestamp": "1542000000",
|
3526
|
+
# "withdraw_order_id": "order_123456",
|
3527
|
+
# "currency": "USDT",
|
3528
|
+
# "address": "1HkxtBAMrA3tP5ENnYY2CZortjZvFDH5Cs",
|
3529
|
+
# "txid": "128988928203223323290",
|
3530
|
+
# "block_number": "41575382",
|
3531
|
+
# "amount": "222.61",
|
3532
|
+
# "fee": "0.01",
|
3533
|
+
# "memo": "",
|
3534
|
+
# "status": "DONE",
|
3535
|
+
# "chain": "TRX"
|
3536
|
+
# }
|
3537
|
+
#
|
3538
|
+
# {
|
3539
|
+
# "id": "w13389675",
|
3540
|
+
# "currency": "USDT",
|
3541
|
+
# "amount": "50",
|
3542
|
+
# "address": "TUu2rLFrmzUodiWfYki7QCNtv1akL682p1",
|
3543
|
+
# "memo": null
|
3544
|
+
# }
|
3516
3545
|
#
|
3517
3546
|
# {
|
3518
3547
|
# "currency":"usdt",
|
3519
|
-
# "address":"
|
3548
|
+
# "address":"0x01c0A9b7b4CdE774AF0f3E47CB4f1c2CCdBa0806",
|
3520
3549
|
# "amount":"1880",
|
3521
3550
|
# "chain":"eth"
|
3522
3551
|
# }
|
@@ -3531,7 +3560,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3531
3560
|
amountString = Precise.string_abs(amountString)
|
3532
3561
|
else:
|
3533
3562
|
type = self.parse_transaction_type(id[0])
|
3534
|
-
feeCostString = self.
|
3563
|
+
feeCostString = self.safe_string_2(transaction, 'fee', 'fee_amount')
|
3535
3564
|
if type == 'withdrawal':
|
3536
3565
|
amountString = Precise.string_sub(amountString, feeCostString)
|
3537
3566
|
networkId = self.safe_string_upper(transaction, 'chain')
|
ccxt/async_support/htx.py
CHANGED
@@ -1254,6 +1254,16 @@ class htx(Exchange, ImplicitAPI):
|
|
1254
1254
|
})
|
1255
1255
|
|
1256
1256
|
async def fetch_status(self, params={}):
|
1257
|
+
"""
|
1258
|
+
the latest known information on the availability of the exchange API
|
1259
|
+
:see: https://huobiapi.github.io/docs/spot/v1/en/#get-system-status
|
1260
|
+
:see: https://huobiapi.github.io/docs/dm/v1/en/#get-system-status
|
1261
|
+
:see: https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-system-status
|
1262
|
+
:see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#get-system-status
|
1263
|
+
:see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#query-whether-the-system-is-available # contractPublicGetHeartbeat
|
1264
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1265
|
+
:returns dict: a `status structure <https://docs.ccxt.com/#/?id=exchange-status-structure>`
|
1266
|
+
"""
|
1257
1267
|
await self.load_markets()
|
1258
1268
|
marketType = None
|
1259
1269
|
marketType, params = self.handle_market_type_and_params('fetchStatus', None, params)
|
@@ -1465,6 +1475,8 @@ class htx(Exchange, ImplicitAPI):
|
|
1465
1475
|
async def fetch_time(self, params={}):
|
1466
1476
|
"""
|
1467
1477
|
fetches the current integer timestamp in milliseconds from the exchange server
|
1478
|
+
:see: https://huobiapi.github.io/docs/spot/v1/en/#get-current-timestamp
|
1479
|
+
:see: https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-current-system-timestamp
|
1468
1480
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1469
1481
|
:returns int: the current integer timestamp in milliseconds from the exchange server
|
1470
1482
|
"""
|
@@ -1511,6 +1523,7 @@ class htx(Exchange, ImplicitAPI):
|
|
1511
1523
|
async def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
1512
1524
|
"""
|
1513
1525
|
fetch the trading fees for a market
|
1526
|
+
:see: https://huobiapi.github.io/docs/spot/v1/en/#get-current-fee-rate-applied-to-the-user
|
1514
1527
|
:param str symbol: unified market symbol
|
1515
1528
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1516
1529
|
:returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -1554,6 +1567,13 @@ class htx(Exchange, ImplicitAPI):
|
|
1554
1567
|
return result
|
1555
1568
|
|
1556
1569
|
async def fetch_trading_limits_by_id(self, id: str, params={}):
|
1570
|
+
"""
|
1571
|
+
* @ignore
|
1572
|
+
:see: https://huobiapi.github.io/docs/spot/v1/en/#get-current-fee-rate-applied-to-the-user
|
1573
|
+
:param str id: market id
|
1574
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1575
|
+
:returns dict: the limits object of a market structure
|
1576
|
+
"""
|
1557
1577
|
request: dict = {
|
1558
1578
|
'symbol': id,
|
1559
1579
|
}
|
@@ -5914,6 +5934,7 @@ class htx(Exchange, ImplicitAPI):
|
|
5914
5934
|
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
5915
5935
|
"""
|
5916
5936
|
fetch all withdrawals made from an account
|
5937
|
+
:see: https://huobiapi.github.io/docs/spot/v1/en/#search-for-existed-withdraws-and-deposits
|
5917
5938
|
:param str code: unified currency code
|
5918
5939
|
:param int [since]: the earliest time in ms to fetch withdrawals for
|
5919
5940
|
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
@@ -6239,6 +6260,7 @@ class htx(Exchange, ImplicitAPI):
|
|
6239
6260
|
async def fetch_isolated_borrow_rates(self, params={}) -> IsolatedBorrowRates:
|
6240
6261
|
"""
|
6241
6262
|
fetch the borrow interest rates of all currencies
|
6263
|
+
:see: https://huobiapi.github.io/docs/spot/v1/en/#get-loan-interest-rate-and-quota-isolated
|
6242
6264
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6243
6265
|
:returns dict: a list of `isolated borrow rate structures <https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure>`
|
6244
6266
|
"""
|
@@ -6449,6 +6471,8 @@ class htx(Exchange, ImplicitAPI):
|
|
6449
6471
|
async def fetch_funding_rate(self, symbol: str, params={}) -> FundingRate:
|
6450
6472
|
"""
|
6451
6473
|
fetch the current funding rate
|
6474
|
+
:see: https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-funding-rate
|
6475
|
+
:see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-funding-rate
|
6452
6476
|
:param str symbol: unified market symbol
|
6453
6477
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6454
6478
|
:returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
|
@@ -6486,6 +6510,8 @@ class htx(Exchange, ImplicitAPI):
|
|
6486
6510
|
async def fetch_funding_rates(self, symbols: Strings = None, params={}) -> FundingRates:
|
6487
6511
|
"""
|
6488
6512
|
fetch the funding rate for multiple markets
|
6513
|
+
:see: https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-a-batch-of-funding-rate
|
6514
|
+
:see: https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-a-batch-of-funding-rate
|
6489
6515
|
:param str[]|None symbols: list of unified market symbols
|
6490
6516
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
6491
6517
|
:returns dict[]: a list of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rates-structure>`, indexed by market symbols
|
@@ -1880,6 +1880,10 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
1880
1880
|
statuses: dict = {
|
1881
1881
|
'triggered': 'open',
|
1882
1882
|
'filled': 'closed',
|
1883
|
+
'open': 'open',
|
1884
|
+
'canceled': 'canceled',
|
1885
|
+
'rejected': 'rejected',
|
1886
|
+
'marginCanceled': 'canceled',
|
1883
1887
|
}
|
1884
1888
|
return self.safe_string(statuses, status, status)
|
1885
1889
|
|
ccxt/async_support/kucoin.py
CHANGED
@@ -4725,7 +4725,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
4725
4725
|
headers = headers if (headers is not None) else {}
|
4726
4726
|
url = self.urls['api'][api]
|
4727
4727
|
if not self.is_empty(query):
|
4728
|
-
if (method == 'GET') or (method == 'DELETE'):
|
4728
|
+
if ((method == 'GET') or (method == 'DELETE')) and (path != 'orders/multi-cancel'):
|
4729
4729
|
endpoint += '?' + self.rawencode(query)
|
4730
4730
|
else:
|
4731
4731
|
body = self.json(query)
|