ccxt 4.3.54__py2.py3-none-any.whl → 4.3.56__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.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +1 -1
- ccxt/abstract/bingx.py +16 -0
- ccxt/abstract/kucoin.py +3 -0
- ccxt/abstract/kucoinfutures.py +3 -0
- ccxt/ace.py +1 -1
- ccxt/alpaca.py +1 -1
- ccxt/ascendex.py +6 -4
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +1 -1
- ccxt/async_support/alpaca.py +1 -1
- ccxt/async_support/ascendex.py +6 -4
- ccxt/async_support/base/exchange.py +19 -3
- ccxt/async_support/bigone.py +1 -1
- ccxt/async_support/binance.py +13 -13
- ccxt/async_support/bingx.py +36 -3
- ccxt/async_support/bit2c.py +1 -1
- ccxt/async_support/bitbank.py +1 -1
- ccxt/async_support/bitbns.py +1 -1
- ccxt/async_support/bitfinex.py +1 -1
- ccxt/async_support/bitfinex2.py +1 -1
- ccxt/async_support/bitflyer.py +8 -2
- ccxt/async_support/bitget.py +2 -2
- ccxt/async_support/bithumb.py +1 -1
- ccxt/async_support/bitmart.py +3 -3
- ccxt/async_support/bitmex.py +1 -1
- ccxt/async_support/bitopro.py +19 -4
- ccxt/async_support/bitrue.py +1 -1
- ccxt/async_support/bitso.py +1 -1
- ccxt/async_support/bitstamp.py +1 -1
- ccxt/async_support/bitteam.py +1 -1
- ccxt/async_support/bitvavo.py +2 -2
- ccxt/async_support/bl3p.py +1 -1
- ccxt/async_support/blockchaincom.py +28 -28
- ccxt/async_support/blofin.py +1 -1
- ccxt/async_support/btcalpha.py +4 -11
- ccxt/async_support/btcbox.py +1 -1
- ccxt/async_support/btcmarkets.py +28 -27
- ccxt/async_support/btcturk.py +1 -1
- ccxt/async_support/bybit.py +10 -7
- ccxt/async_support/cex.py +2 -2
- ccxt/async_support/coinbase.py +33 -33
- ccxt/async_support/coinbaseexchange.py +1 -1
- ccxt/async_support/coinbaseinternational.py +1 -1
- ccxt/async_support/coincheck.py +1 -1
- ccxt/async_support/coinex.py +2 -2
- ccxt/async_support/coinlist.py +2 -2
- ccxt/async_support/coinmate.py +1 -1
- ccxt/async_support/coinmetro.py +1 -1
- ccxt/async_support/coinone.py +1 -1
- ccxt/async_support/coinsph.py +1 -1
- ccxt/async_support/coinspot.py +1 -1
- ccxt/async_support/cryptocom.py +1 -1
- ccxt/async_support/currencycom.py +1 -1
- ccxt/async_support/delta.py +7 -3
- ccxt/async_support/deribit.py +4 -4
- ccxt/async_support/digifinex.py +2 -2
- ccxt/async_support/exmo.py +2 -2
- ccxt/async_support/gate.py +3 -2
- ccxt/async_support/gemini.py +1 -1
- ccxt/async_support/hitbtc.py +1 -1
- ccxt/async_support/hollaex.py +1 -1
- ccxt/async_support/htx.py +3 -3
- ccxt/async_support/huobijp.py +1 -1
- ccxt/async_support/hyperliquid.py +3 -3
- ccxt/async_support/idex.py +1 -1
- ccxt/async_support/independentreserve.py +1 -1
- ccxt/async_support/indodax.py +1 -1
- ccxt/async_support/kraken.py +2 -2
- ccxt/async_support/kucoin.py +127 -46
- ccxt/async_support/kucoinfutures.py +1 -1
- ccxt/async_support/kuna.py +1 -1
- ccxt/async_support/latoken.py +1 -1
- ccxt/async_support/lbank.py +28 -7
- ccxt/async_support/luno.py +1 -1
- ccxt/async_support/lykke.py +1 -1
- ccxt/async_support/mercado.py +1 -1
- ccxt/async_support/mexc.py +1 -1
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/novadax.py +1 -1
- ccxt/async_support/oceanex.py +1 -1
- ccxt/async_support/okcoin.py +1 -1
- ccxt/async_support/okx.py +3 -3
- ccxt/async_support/onetrading.py +1 -1
- ccxt/async_support/oxfun.py +2 -2
- ccxt/async_support/p2b.py +1 -1
- ccxt/async_support/paymium.py +1 -1
- ccxt/async_support/phemex.py +2 -2
- ccxt/async_support/poloniex.py +4 -3
- ccxt/async_support/poloniexfutures.py +1 -1
- ccxt/async_support/probit.py +1 -1
- ccxt/async_support/timex.py +1 -1
- ccxt/async_support/tokocrypto.py +1 -1
- ccxt/async_support/tradeogre.py +1 -1
- ccxt/async_support/upbit.py +1 -1
- ccxt/async_support/vertex.py +2 -2
- ccxt/async_support/wavesexchange.py +1 -1
- ccxt/async_support/wazirx.py +1 -1
- ccxt/async_support/whitebit.py +2 -2
- ccxt/async_support/woo.py +5 -5
- ccxt/async_support/woofipro.py +3 -3
- ccxt/async_support/yobit.py +1 -1
- ccxt/async_support/zaif.py +1 -1
- ccxt/async_support/zonda.py +1 -1
- ccxt/base/exchange.py +19 -3
- ccxt/base/types.py +4 -1
- ccxt/bigone.py +1 -1
- ccxt/binance.py +13 -13
- ccxt/bingx.py +36 -3
- ccxt/bit2c.py +1 -1
- ccxt/bitbank.py +1 -1
- ccxt/bitbns.py +1 -1
- ccxt/bitfinex.py +1 -1
- ccxt/bitfinex2.py +1 -1
- ccxt/bitflyer.py +8 -2
- ccxt/bitget.py +2 -2
- ccxt/bithumb.py +1 -1
- ccxt/bitmart.py +3 -3
- ccxt/bitmex.py +1 -1
- ccxt/bitopro.py +19 -4
- ccxt/bitrue.py +1 -1
- ccxt/bitso.py +1 -1
- ccxt/bitstamp.py +1 -1
- ccxt/bitteam.py +1 -1
- ccxt/bitvavo.py +2 -2
- ccxt/bl3p.py +1 -1
- ccxt/blockchaincom.py +28 -28
- ccxt/blofin.py +1 -1
- ccxt/btcalpha.py +4 -11
- ccxt/btcbox.py +1 -1
- ccxt/btcmarkets.py +28 -27
- ccxt/btcturk.py +1 -1
- ccxt/bybit.py +10 -7
- ccxt/cex.py +2 -2
- ccxt/coinbase.py +33 -33
- ccxt/coinbaseexchange.py +1 -1
- ccxt/coinbaseinternational.py +1 -1
- ccxt/coincheck.py +1 -1
- ccxt/coinex.py +2 -2
- ccxt/coinlist.py +2 -2
- ccxt/coinmate.py +1 -1
- ccxt/coinmetro.py +1 -1
- ccxt/coinone.py +1 -1
- ccxt/coinsph.py +1 -1
- ccxt/coinspot.py +1 -1
- ccxt/cryptocom.py +1 -1
- ccxt/currencycom.py +1 -1
- ccxt/delta.py +7 -3
- ccxt/deribit.py +4 -4
- ccxt/digifinex.py +2 -2
- ccxt/exmo.py +2 -2
- ccxt/gate.py +3 -2
- ccxt/gemini.py +1 -1
- ccxt/hitbtc.py +1 -1
- ccxt/hollaex.py +1 -1
- ccxt/htx.py +3 -3
- ccxt/huobijp.py +1 -1
- ccxt/hyperliquid.py +3 -3
- ccxt/idex.py +1 -1
- ccxt/independentreserve.py +1 -1
- ccxt/indodax.py +1 -1
- ccxt/kraken.py +2 -2
- ccxt/kucoin.py +127 -46
- ccxt/kucoinfutures.py +1 -1
- ccxt/kuna.py +1 -1
- ccxt/latoken.py +1 -1
- ccxt/lbank.py +28 -7
- ccxt/luno.py +1 -1
- ccxt/lykke.py +1 -1
- ccxt/mercado.py +1 -1
- ccxt/mexc.py +1 -1
- ccxt/ndax.py +1 -1
- ccxt/novadax.py +1 -1
- ccxt/oceanex.py +1 -1
- ccxt/okcoin.py +1 -1
- ccxt/okx.py +3 -3
- ccxt/onetrading.py +1 -1
- ccxt/oxfun.py +2 -2
- ccxt/p2b.py +1 -1
- ccxt/paymium.py +1 -1
- ccxt/phemex.py +2 -2
- ccxt/poloniex.py +4 -3
- ccxt/poloniexfutures.py +1 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binance.py +2 -2
- ccxt/pro/bitvavo.py +2 -2
- ccxt/pro/bybit.py +2 -2
- ccxt/pro/cex.py +3 -3
- ccxt/pro/coinbase.py +22 -1
- ccxt/pro/cryptocom.py +1 -1
- ccxt/pro/gate.py +2 -2
- ccxt/pro/hitbtc.py +1 -1
- ccxt/pro/kraken.py +2 -2
- ccxt/pro/kucoin.py +2 -2
- ccxt/pro/okx.py +2 -2
- ccxt/pro/oxfun.py +2 -2
- ccxt/pro/poloniex.py +1 -1
- ccxt/pro/vertex.py +1 -1
- ccxt/probit.py +1 -1
- ccxt/test/{test_async.py → tests_async.py} +27 -280
- ccxt/test/tests_helpers.py +284 -0
- ccxt/test/tests_init.py +35 -0
- ccxt/test/{test_sync.py → tests_sync.py} +27 -282
- ccxt/timex.py +1 -1
- ccxt/tokocrypto.py +1 -1
- ccxt/tradeogre.py +1 -1
- ccxt/upbit.py +1 -1
- ccxt/vertex.py +2 -2
- ccxt/wavesexchange.py +1 -1
- ccxt/wazirx.py +1 -1
- ccxt/whitebit.py +2 -2
- ccxt/woo.py +5 -5
- ccxt/woofipro.py +3 -3
- ccxt/yobit.py +1 -1
- ccxt/zaif.py +1 -1
- ccxt/zonda.py +1 -1
- {ccxt-4.3.54.dist-info → ccxt-4.3.56.dist-info}/METADATA +5 -7
- {ccxt-4.3.54.dist-info → ccxt-4.3.56.dist-info}/RECORD +220 -253
- ccxt/test/base/__init__.py +0 -29
- ccxt/test/base/test_account.py +0 -26
- ccxt/test/base/test_balance.py +0 -56
- ccxt/test/base/test_borrow_interest.py +0 -35
- ccxt/test/base/test_borrow_rate.py +0 -32
- ccxt/test/base/test_calculate_fee.py +0 -51
- ccxt/test/base/test_crypto.py +0 -127
- ccxt/test/base/test_currency.py +0 -76
- ccxt/test/base/test_datetime.py +0 -109
- ccxt/test/base/test_decimal_to_precision.py +0 -392
- ccxt/test/base/test_deep_extend.py +0 -68
- ccxt/test/base/test_deposit_withdrawal.py +0 -50
- ccxt/test/base/test_exchange_datetime_functions.py +0 -76
- ccxt/test/base/test_funding_rate_history.py +0 -29
- ccxt/test/base/test_last_price.py +0 -31
- ccxt/test/base/test_ledger_entry.py +0 -45
- ccxt/test/base/test_ledger_item.py +0 -48
- ccxt/test/base/test_leverage_tier.py +0 -33
- ccxt/test/base/test_liquidation.py +0 -50
- ccxt/test/base/test_margin_mode.py +0 -24
- ccxt/test/base/test_margin_modification.py +0 -35
- ccxt/test/base/test_market.py +0 -193
- ccxt/test/base/test_number.py +0 -411
- ccxt/test/base/test_ohlcv.py +0 -33
- ccxt/test/base/test_open_interest.py +0 -32
- ccxt/test/base/test_order.py +0 -64
- ccxt/test/base/test_order_book.py +0 -69
- ccxt/test/base/test_position.py +0 -60
- ccxt/test/base/test_shared_methods.py +0 -353
- ccxt/test/base/test_status.py +0 -24
- ccxt/test/base/test_throttle.py +0 -126
- ccxt/test/base/test_ticker.py +0 -92
- ccxt/test/base/test_trade.py +0 -47
- ccxt/test/base/test_trading_fee.py +0 -26
- ccxt/test/base/test_transaction.py +0 -39
- {ccxt-4.3.54.dist-info → ccxt-4.3.56.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.3.54.dist-info → ccxt-4.3.56.dist-info}/WHEEL +0 -0
- {ccxt-4.3.54.dist-info → ccxt-4.3.56.dist-info}/top_level.txt +0 -0
ccxt/async_support/bitmex.py
CHANGED
@@ -1768,7 +1768,7 @@ class bitmex(Exchange, ImplicitAPI):
|
|
1768
1768
|
:param str type: 'market' or 'limit'
|
1769
1769
|
:param str side: 'buy' or 'sell'
|
1770
1770
|
:param float amount: how much of currency you want to trade in units of base currency
|
1771
|
-
:param float [price]: the price at which the order is to be
|
1771
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1772
1772
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1773
1773
|
:param dict [params.triggerPrice]: the price at which a trigger order is triggered at
|
1774
1774
|
:param dict [params.triggerDirection]: the direction whenever the trigger happens with relation to price - 'above' or 'below'
|
ccxt/async_support/bitopro.py
CHANGED
@@ -964,7 +964,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
964
964
|
:param str type: 'market' or 'limit'
|
965
965
|
:param str side: 'buy' or 'sell'
|
966
966
|
:param float amount: how much of currency you want to trade in units of base currency
|
967
|
-
:param float [price]: the price at which the order is to be
|
967
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
968
968
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
969
969
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
970
970
|
"""
|
@@ -1038,6 +1038,20 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1038
1038
|
#
|
1039
1039
|
return self.parse_order(response, market)
|
1040
1040
|
|
1041
|
+
def parse_cancel_orders(self, data):
|
1042
|
+
dataKeys = list(data.keys())
|
1043
|
+
orders = []
|
1044
|
+
for i in range(0, len(dataKeys)):
|
1045
|
+
marketId = dataKeys[i]
|
1046
|
+
orderIds = data[marketId]
|
1047
|
+
for j in range(0, len(orderIds)):
|
1048
|
+
orders.append(self.safe_order({
|
1049
|
+
'info': orderIds[j],
|
1050
|
+
'id': orderIds[j],
|
1051
|
+
'symbol': self.safe_symbol(marketId),
|
1052
|
+
}))
|
1053
|
+
return orders
|
1054
|
+
|
1041
1055
|
async def cancel_orders(self, ids, symbol: Str = None, params={}):
|
1042
1056
|
"""
|
1043
1057
|
cancel multiple orders
|
@@ -1065,7 +1079,8 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1065
1079
|
# }
|
1066
1080
|
# }
|
1067
1081
|
#
|
1068
|
-
|
1082
|
+
data = self.safe_dict(response, 'data')
|
1083
|
+
return self.parse_cancel_orders(data)
|
1069
1084
|
|
1070
1085
|
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
1071
1086
|
"""
|
@@ -1086,7 +1101,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1086
1101
|
response = await self.privateDeleteOrdersPair(self.extend(request, params))
|
1087
1102
|
else:
|
1088
1103
|
response = await self.privateDeleteOrdersAll(self.extend(request, params))
|
1089
|
-
|
1104
|
+
data = self.safe_value(response, 'data', {})
|
1090
1105
|
#
|
1091
1106
|
# {
|
1092
1107
|
# "data":{
|
@@ -1097,7 +1112,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1097
1112
|
# }
|
1098
1113
|
# }
|
1099
1114
|
#
|
1100
|
-
return
|
1115
|
+
return self.parse_cancel_orders(data)
|
1101
1116
|
|
1102
1117
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
1103
1118
|
"""
|
ccxt/async_support/bitrue.py
CHANGED
@@ -1824,7 +1824,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
1824
1824
|
:param str type: 'market' or 'limit'
|
1825
1825
|
:param str side: 'buy' or 'sell'
|
1826
1826
|
:param float amount: how much of currency you want to trade in units of base currency
|
1827
|
-
:param float [price]: the price at which the order is to be
|
1827
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1828
1828
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1829
1829
|
:param float [params.triggerPrice]: *spot only* the price at which a trigger order is triggered at
|
1830
1830
|
:param str [params.clientOrderId]: a unique id for the order, automatically generated if not sent
|
ccxt/async_support/bitso.py
CHANGED
@@ -928,7 +928,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
928
928
|
:param str type: 'market' or 'limit'
|
929
929
|
:param str side: 'buy' or 'sell'
|
930
930
|
:param float amount: how much of currency you want to trade in units of base currency
|
931
|
-
:param float [price]: the price at which the order is to be
|
931
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
932
932
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
933
933
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
934
934
|
"""
|
ccxt/async_support/bitstamp.py
CHANGED
@@ -1343,7 +1343,7 @@ class bitstamp(Exchange, ImplicitAPI):
|
|
1343
1343
|
:param str type: 'market' or 'limit'
|
1344
1344
|
:param str side: 'buy' or 'sell'
|
1345
1345
|
:param float amount: how much of currency you want to trade in units of base currency
|
1346
|
-
:param float [price]: the price at which the order is to be
|
1346
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1347
1347
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1348
1348
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1349
1349
|
"""
|
ccxt/async_support/bitteam.py
CHANGED
@@ -962,7 +962,7 @@ class bitteam(Exchange, ImplicitAPI):
|
|
962
962
|
:param str type: 'market' or 'limit'
|
963
963
|
:param str side: 'buy' or 'sell'
|
964
964
|
:param float amount: how much of currency you want to trade in units of base currency
|
965
|
-
:param float [price]: the price at which the order is to be
|
965
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
966
966
|
:param dict [params]: extra parameters specific to the bitteam api endpoint
|
967
967
|
:returns dict: an `order structure <https://github.com/ccxt/ccxt/wiki/Manual#order-structure>`
|
968
968
|
"""
|
ccxt/async_support/bitvavo.py
CHANGED
@@ -1091,7 +1091,7 @@ class bitvavo(Exchange, ImplicitAPI):
|
|
1091
1091
|
:param str type: 'market' or 'limit'
|
1092
1092
|
:param str side: 'buy' or 'sell'
|
1093
1093
|
:param float amount: how much of currency you want to trade in units of base currency
|
1094
|
-
:param float price: the price at which the order is to be
|
1094
|
+
:param float price: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1095
1095
|
:param dict [params]: extra parameters specific to the bitvavo api endpoint
|
1096
1096
|
:param str [params.timeInForce]: "GTC", "IOC", or "PO"
|
1097
1097
|
:param float [params.stopPrice]: The price at which a trigger order is triggered at
|
@@ -1184,7 +1184,7 @@ class bitvavo(Exchange, ImplicitAPI):
|
|
1184
1184
|
:param str type: 'market' or 'limit'
|
1185
1185
|
:param str side: 'buy' or 'sell'
|
1186
1186
|
:param float [amount]: how much of currency you want to trade in units of base currency
|
1187
|
-
:param float [price]: the price at which the order is to be
|
1187
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1188
1188
|
:param dict [params]: extra parameters specific to the bitvavo api endpoint
|
1189
1189
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1190
1190
|
"""
|
ccxt/async_support/bl3p.py
CHANGED
@@ -375,7 +375,7 @@ class bl3p(Exchange, ImplicitAPI):
|
|
375
375
|
:param str type: 'market' or 'limit'
|
376
376
|
:param str side: 'buy' or 'sell'
|
377
377
|
:param float amount: how much of currency you want to trade in units of base currency
|
378
|
-
:param float [price]: the price at which the order is to be
|
378
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
379
379
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
380
380
|
*
|
381
381
|
* EXCHANGE SPECIFIC PARAMETERS
|
@@ -140,9 +140,9 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
140
140
|
'percentage': True,
|
141
141
|
'tiers': {
|
142
142
|
'taker': [
|
143
|
-
[self.parse_number('0'), self.parse_number('0.
|
144
|
-
[self.parse_number('10000'), self.parse_number('0.
|
145
|
-
[self.parse_number('50000'), self.parse_number('0.
|
143
|
+
[self.parse_number('0'), self.parse_number('0.0045')],
|
144
|
+
[self.parse_number('10000'), self.parse_number('0.0035')],
|
145
|
+
[self.parse_number('50000'), self.parse_number('0.0018')],
|
146
146
|
[self.parse_number('100000'), self.parse_number('0.0018')],
|
147
147
|
[self.parse_number('500000'), self.parse_number('0.0018')],
|
148
148
|
[self.parse_number('1000000'), self.parse_number('0.0018')],
|
@@ -154,11 +154,11 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
154
154
|
[self.parse_number('1000000000'), self.parse_number('0.0006')],
|
155
155
|
],
|
156
156
|
'maker': [
|
157
|
-
[self.parse_number('0'), self.parse_number('0.
|
158
|
-
[self.parse_number('10000'), self.parse_number('0.
|
159
|
-
[self.parse_number('50000'), self.parse_number('0.
|
157
|
+
[self.parse_number('0'), self.parse_number('0.004')],
|
158
|
+
[self.parse_number('10000'), self.parse_number('0.0017')],
|
159
|
+
[self.parse_number('50000'), self.parse_number('0.0015')],
|
160
160
|
[self.parse_number('100000'), self.parse_number('0.0008')],
|
161
|
-
[self.parse_number('500000'), self.parse_number('0.
|
161
|
+
[self.parse_number('500000'), self.parse_number('0.0007')],
|
162
162
|
[self.parse_number('1000000'), self.parse_number('0.0006')],
|
163
163
|
[self.parse_number('2500000'), self.parse_number('0.0005')],
|
164
164
|
[self.parse_number('5000000'), self.parse_number('0.0004')],
|
@@ -230,7 +230,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
230
230
|
async def fetch_markets(self, params={}) -> List[Market]:
|
231
231
|
"""
|
232
232
|
retrieves data on all markets for blockchaincom
|
233
|
-
:see: https://api.blockchain.com/v3
|
233
|
+
:see: https://api.blockchain.com/v3/#getsymbols
|
234
234
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
235
235
|
:returns dict[]: an array of objects representing market data
|
236
236
|
"""
|
@@ -354,7 +354,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
354
354
|
async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
355
355
|
"""
|
356
356
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
357
|
-
:see: https://api.blockchain.com/v3
|
357
|
+
:see: https://api.blockchain.com/v3/#getl3orderbook
|
358
358
|
:param str symbol: unified symbol of the market to fetch the order book for
|
359
359
|
:param int [limit]: the maximum amount of order book entries to return
|
360
360
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -365,7 +365,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
365
365
|
async def fetch_l3_order_book(self, symbol: str, limit: Int = None, params={}):
|
366
366
|
"""
|
367
367
|
fetches level 3 information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
368
|
-
:see: https://api.blockchain.com/v3
|
368
|
+
:see: https://api.blockchain.com/v3/#getl3orderbook
|
369
369
|
:param str symbol: unified market symbol
|
370
370
|
:param int [limit]: max number of orders to return, default is None
|
371
371
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -432,7 +432,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
432
432
|
async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
433
433
|
"""
|
434
434
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
435
|
-
:see: https://api.blockchain.com/v3
|
435
|
+
:see: https://api.blockchain.com/v3/#gettickerbysymbol
|
436
436
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
437
437
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
438
438
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -448,7 +448,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
448
448
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
449
449
|
"""
|
450
450
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
451
|
-
:see: https://api.blockchain.com/v3
|
451
|
+
:see: https://api.blockchain.com/v3/#gettickers
|
452
452
|
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
453
453
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
454
454
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -527,12 +527,12 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
527
527
|
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
528
528
|
"""
|
529
529
|
create a trade order
|
530
|
-
:see: https://api.blockchain.com/v3
|
530
|
+
:see: https://api.blockchain.com/v3/#createorder
|
531
531
|
:param str symbol: unified symbol of the market to create an order in
|
532
532
|
:param str type: 'market' or 'limit'
|
533
533
|
:param str side: 'buy' or 'sell'
|
534
534
|
:param float amount: how much of currency you want to trade in units of base currency
|
535
|
-
:param float [price]: the price at which the order is to be
|
535
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
536
536
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
537
537
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
538
538
|
"""
|
@@ -579,7 +579,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
579
579
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
580
580
|
"""
|
581
581
|
cancels an open order
|
582
|
-
:see: https://api.blockchain.com/v3
|
582
|
+
:see: https://api.blockchain.com/v3/#deleteorder
|
583
583
|
:param str id: order id
|
584
584
|
:param str symbol: unified symbol of the market the order was made in
|
585
585
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -624,7 +624,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
624
624
|
async def fetch_trading_fees(self, params={}) -> TradingFees:
|
625
625
|
"""
|
626
626
|
fetch the trading fees for multiple markets
|
627
|
-
:see: https://api.blockchain.com/v3
|
627
|
+
:see: https://api.blockchain.com/v3/#getfees
|
628
628
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
629
629
|
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
|
630
630
|
"""
|
@@ -653,7 +653,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
653
653
|
async def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
654
654
|
"""
|
655
655
|
fetches information on multiple canceled orders made by the user
|
656
|
-
:see: https://api.blockchain.com/v3
|
656
|
+
:see: https://api.blockchain.com/v3/#getorders
|
657
657
|
:param str symbol: unified market symbol of the market orders were made in
|
658
658
|
:param int [since]: timestamp in ms of the earliest order, default is None
|
659
659
|
:param int [limit]: max number of orders to return, default is None
|
@@ -666,7 +666,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
666
666
|
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
667
667
|
"""
|
668
668
|
fetches information on multiple closed orders made by the user
|
669
|
-
:see: https://api.blockchain.com/v3
|
669
|
+
:see: https://api.blockchain.com/v3/#getorders
|
670
670
|
:param str symbol: unified market symbol of the market orders were made in
|
671
671
|
:param int [since]: the earliest time in ms to fetch orders for
|
672
672
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -679,7 +679,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
679
679
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
680
680
|
"""
|
681
681
|
fetch all unfilled currently open orders
|
682
|
-
:see: https://api.blockchain.com/v3
|
682
|
+
:see: https://api.blockchain.com/v3/#getorders
|
683
683
|
:param str symbol: unified market symbol
|
684
684
|
:param int [since]: the earliest time in ms to fetch open orders for
|
685
685
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
@@ -752,7 +752,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
752
752
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
753
753
|
"""
|
754
754
|
fetch all trades made by the user
|
755
|
-
:see: https://api.blockchain.com/v3
|
755
|
+
:see: https://api.blockchain.com/v3/#getfills
|
756
756
|
:param str symbol: unified market symbol
|
757
757
|
:param int [since]: the earliest time in ms to fetch trades for
|
758
758
|
:param int [limit]: the maximum number of trades structures to retrieve
|
@@ -773,7 +773,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
773
773
|
async def fetch_deposit_address(self, code: str, params={}):
|
774
774
|
"""
|
775
775
|
fetch the deposit address for a currency associated with self account
|
776
|
-
:see: https://api.blockchain.com/v3
|
776
|
+
:see: https://api.blockchain.com/v3/#getdepositaddress
|
777
777
|
:param str code: unified currency code
|
778
778
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
779
779
|
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
@@ -880,7 +880,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
880
880
|
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
|
881
881
|
"""
|
882
882
|
make a withdrawal
|
883
|
-
:see: https://api.blockchain.com/v3
|
883
|
+
:see: https://api.blockchain.com/v3/#createwithdrawal
|
884
884
|
:param str code: unified currency code
|
885
885
|
:param float amount: the amount to withdraw
|
886
886
|
:param str address: the address to withdraw to
|
@@ -913,7 +913,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
913
913
|
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
914
914
|
"""
|
915
915
|
fetch all withdrawals made from an account
|
916
|
-
:see: https://api.blockchain.com/v3
|
916
|
+
:see: https://api.blockchain.com/v3/#getwithdrawals
|
917
917
|
:param str code: unified currency code
|
918
918
|
:param int [since]: the earliest time in ms to fetch withdrawals for
|
919
919
|
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
@@ -936,7 +936,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
936
936
|
async def fetch_withdrawal(self, id: str, code: Str = None, params={}):
|
937
937
|
"""
|
938
938
|
fetch data on a currency withdrawal via the withdrawal id
|
939
|
-
:see: https://api.blockchain.com/v3
|
939
|
+
:see: https://api.blockchain.com/v3/#getwithdrawalbyid
|
940
940
|
:param str id: withdrawal id
|
941
941
|
:param str code: not used by blockchaincom.fetchWithdrawal
|
942
942
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -952,7 +952,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
952
952
|
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
953
953
|
"""
|
954
954
|
fetch all deposits made to an account
|
955
|
-
:see: https://api.blockchain.com/v3
|
955
|
+
:see: https://api.blockchain.com/v3/#getdeposits
|
956
956
|
:param str code: unified currency code
|
957
957
|
:param int [since]: the earliest time in ms to fetch deposits for
|
958
958
|
:param int [limit]: the maximum number of deposits structures to retrieve
|
@@ -975,7 +975,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
975
975
|
async def fetch_deposit(self, id: str, code: Str = None, params={}):
|
976
976
|
"""
|
977
977
|
fetch information on a deposit
|
978
|
-
:see: https://api.blockchain.com/v3
|
978
|
+
:see: https://api.blockchain.com/v3/#getdepositbyid
|
979
979
|
:param str id: deposit id
|
980
980
|
:param str code: not used by blockchaincom fetchDeposit()
|
981
981
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -992,7 +992,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
992
992
|
async def fetch_balance(self, params={}) -> Balances:
|
993
993
|
"""
|
994
994
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
995
|
-
:see: https://api.blockchain.com/v3
|
995
|
+
:see: https://api.blockchain.com/v3/#getaccounts
|
996
996
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
997
997
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
998
998
|
"""
|
@@ -1035,7 +1035,7 @@ class blockchaincom(Exchange, ImplicitAPI):
|
|
1035
1035
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
1036
1036
|
"""
|
1037
1037
|
fetches information on an order made by the user
|
1038
|
-
:see: https://api.blockchain.com/v3
|
1038
|
+
:see: https://api.blockchain.com/v3/#getorderbyid
|
1039
1039
|
:param str symbol: not used by blockchaincom fetchOrder
|
1040
1040
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1041
1041
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
ccxt/async_support/blofin.py
CHANGED
@@ -1118,7 +1118,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1118
1118
|
:param str type: 'market' or 'limit' or 'post_only' or 'ioc' or 'fok'
|
1119
1119
|
:param str side: 'buy' or 'sell'
|
1120
1120
|
:param float amount: how much of currency you want to trade in units of base currency
|
1121
|
-
:param float [price]: the price at which the order is to be
|
1121
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1122
1122
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1123
1123
|
:param bool [params.reduceOnly]: a mark to reduce the position size for margin, swap and future orders
|
1124
1124
|
:param bool [params.postOnly]: True to place a post only order
|
ccxt/async_support/btcalpha.py
CHANGED
@@ -9,10 +9,8 @@ import hashlib
|
|
9
9
|
from ccxt.base.types import Balances, Currency, IndexType, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
|
-
from ccxt.base.errors import AuthenticationError
|
13
12
|
from ccxt.base.errors import InsufficientFunds
|
14
13
|
from ccxt.base.errors import InvalidOrder
|
15
|
-
from ccxt.base.errors import DDoSProtection
|
16
14
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
17
15
|
from ccxt.base.precise import Precise
|
18
16
|
|
@@ -715,7 +713,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
715
713
|
:param str type: 'limit'
|
716
714
|
:param str side: 'buy' or 'sell'
|
717
715
|
:param float amount: how much of currency you want to trade in units of base currency
|
718
|
-
:param float [price]: the price at which the order is to be
|
716
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
719
717
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
720
718
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
721
719
|
"""
|
@@ -878,14 +876,9 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
878
876
|
# {"date":1570599531.4814300537,"error":"Out of balance -9.99243661 BTC"}
|
879
877
|
#
|
880
878
|
error = self.safe_string(response, 'error')
|
881
|
-
feedback = self.id + ' ' + body
|
882
879
|
if error is not None:
|
880
|
+
feedback = self.id + ' ' + body
|
883
881
|
self.throw_exactly_matched_exception(self.exceptions['exact'], error, feedback)
|
884
882
|
self.throw_broadly_matched_exception(self.exceptions['broad'], error, feedback)
|
885
|
-
|
886
|
-
|
887
|
-
elif code == 429:
|
888
|
-
raise DDoSProtection(feedback)
|
889
|
-
if code < 400:
|
890
|
-
return None
|
891
|
-
raise ExchangeError(feedback)
|
883
|
+
raise ExchangeError(feedback) # unknown error
|
884
|
+
return None
|
ccxt/async_support/btcbox.py
CHANGED
@@ -297,7 +297,7 @@ class btcbox(Exchange, ImplicitAPI):
|
|
297
297
|
:param str type: 'market' or 'limit'
|
298
298
|
:param str side: 'buy' or 'sell'
|
299
299
|
:param float amount: how much of currency you want to trade in units of base currency
|
300
|
-
:param float [price]: the price at which the order is to be
|
300
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
301
301
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
302
302
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
303
303
|
"""
|
ccxt/async_support/btcmarkets.py
CHANGED
@@ -14,7 +14,6 @@ from ccxt.base.errors import BadRequest
|
|
14
14
|
from ccxt.base.errors import InsufficientFunds
|
15
15
|
from ccxt.base.errors import InvalidOrder
|
16
16
|
from ccxt.base.errors import OrderNotFound
|
17
|
-
from ccxt.base.errors import DDoSProtection
|
18
17
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
19
18
|
from ccxt.base.precise import Precise
|
20
19
|
|
@@ -161,16 +160,18 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
161
160
|
},
|
162
161
|
'precisionMode': TICK_SIZE,
|
163
162
|
'exceptions': {
|
164
|
-
'
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
163
|
+
'exact': {
|
164
|
+
'InsufficientFund': InsufficientFunds,
|
165
|
+
'InvalidPrice': InvalidOrder,
|
166
|
+
'InvalidAmount': InvalidOrder,
|
167
|
+
'MissingArgument': BadRequest,
|
168
|
+
'OrderAlreadyCancelled': InvalidOrder,
|
169
|
+
'OrderNotFound': OrderNotFound,
|
170
|
+
'OrderStatusIsFinal': InvalidOrder,
|
171
|
+
'InvalidPaginationParameter': BadRequest,
|
172
|
+
},
|
173
|
+
'broad': {
|
174
|
+
},
|
174
175
|
},
|
175
176
|
'fees': {
|
176
177
|
'percentage': True,
|
@@ -370,7 +371,8 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
370
371
|
# "minOrderAmount":"0.00007",
|
371
372
|
# "maxOrderAmount":"1000000",
|
372
373
|
# "amountDecimals":"8",
|
373
|
-
# "priceDecimals":"2"
|
374
|
+
# "priceDecimals":"2",
|
375
|
+
# "status": "Online"
|
374
376
|
# }
|
375
377
|
# ]
|
376
378
|
#
|
@@ -387,6 +389,7 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
387
389
|
pricePrecision = self.parse_number(self.parse_precision(self.safe_string(market, 'priceDecimals')))
|
388
390
|
minAmount = self.safe_number(market, 'minOrderAmount')
|
389
391
|
maxAmount = self.safe_number(market, 'maxOrderAmount')
|
392
|
+
status = self.safe_string(market, 'status')
|
390
393
|
minPrice = None
|
391
394
|
if quote == 'AUD':
|
392
395
|
minPrice = pricePrecision
|
@@ -405,7 +408,7 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
405
408
|
'swap': False,
|
406
409
|
'future': False,
|
407
410
|
'option': False,
|
408
|
-
'active':
|
411
|
+
'active': (status == 'Online'),
|
409
412
|
'contract': False,
|
410
413
|
'linear': None,
|
411
414
|
'inverse': None,
|
@@ -760,7 +763,7 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
760
763
|
:param str type: 'market' or 'limit'
|
761
764
|
:param str side: 'buy' or 'sell'
|
762
765
|
:param float amount: how much of currency you want to trade in units of base currency
|
763
|
-
:param float [price]: the price at which the order is to be
|
766
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
764
767
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
765
768
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
766
769
|
"""
|
@@ -1204,18 +1207,16 @@ class btcmarkets(Exchange, ImplicitAPI):
|
|
1204
1207
|
def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
|
1205
1208
|
if response is None:
|
1206
1209
|
return None # fallback to default error handler
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
if code >= 400:
|
1215
|
-
errorCode = self.safe_string(response, 'code')
|
1216
|
-
message = self.safe_string(response, 'message')
|
1210
|
+
#
|
1211
|
+
# {"code":"UnAuthorized","message":"invalid access token"}
|
1212
|
+
# {"code":"MarketNotFound","message":"invalid marketId"}
|
1213
|
+
#
|
1214
|
+
errorCode = self.safe_string(response, 'code')
|
1215
|
+
message = self.safe_string(response, 'message')
|
1216
|
+
if errorCode is not None:
|
1217
1217
|
feedback = self.id + ' ' + body
|
1218
|
-
self.throw_exactly_matched_exception(self.exceptions,
|
1219
|
-
self.throw_exactly_matched_exception(self.exceptions,
|
1220
|
-
|
1218
|
+
self.throw_exactly_matched_exception(self.exceptions['exact'], message, feedback)
|
1219
|
+
self.throw_exactly_matched_exception(self.exceptions['exact'], errorCode, feedback)
|
1220
|
+
self.throw_broadly_matched_exception(self.exceptions['broad'], message, feedback)
|
1221
|
+
raise ExchangeError(feedback) # unknown message
|
1221
1222
|
return None
|
ccxt/async_support/btcturk.py
CHANGED
@@ -650,7 +650,7 @@ class btcturk(Exchange, ImplicitAPI):
|
|
650
650
|
:param str type: 'market' or 'limit'
|
651
651
|
:param str side: 'buy' or 'sell'
|
652
652
|
:param float amount: how much of currency you want to trade in units of base currency
|
653
|
-
:param float [price]: the price at which the order is to be
|
653
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
654
654
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
655
655
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
656
656
|
"""
|
ccxt/async_support/bybit.py
CHANGED
@@ -2922,14 +2922,17 @@ class bybit(Exchange, ImplicitAPI):
|
|
2922
2922
|
enableUnifiedMargin, enableUnifiedAccount = await self.is_unified_enabled()
|
2923
2923
|
isUnifiedAccount = (enableUnifiedMargin or enableUnifiedAccount)
|
2924
2924
|
type = None
|
2925
|
-
type, params = self.
|
2925
|
+
type, params = self.get_bybit_type('fetchBalance', None, params)
|
2926
2926
|
isSpot = (type == 'spot')
|
2927
|
-
|
2927
|
+
isLinear = (type == 'linear')
|
2928
|
+
isInverse = (type == 'inverse')
|
2928
2929
|
if isUnifiedAccount:
|
2929
|
-
if
|
2930
|
+
if isInverse:
|
2931
|
+
type = 'contract'
|
2932
|
+
else:
|
2930
2933
|
type = 'unified'
|
2931
2934
|
else:
|
2932
|
-
if
|
2935
|
+
if isLinear or isInverse:
|
2933
2936
|
type = 'contract'
|
2934
2937
|
accountTypes = self.safe_dict(self.options, 'accountsByType', {})
|
2935
2938
|
unifiedType = self.safe_string_upper(accountTypes, type, type)
|
@@ -3232,7 +3235,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3232
3235
|
else:
|
3233
3236
|
feeCurrencyCode = market['base'] if market['inverse'] else market['settle']
|
3234
3237
|
fee = {
|
3235
|
-
'cost': feeCostString,
|
3238
|
+
'cost': self.parse_number(feeCostString),
|
3236
3239
|
'currency': feeCurrencyCode,
|
3237
3240
|
}
|
3238
3241
|
clientOrderId = self.safe_string(order, 'orderLinkId')
|
@@ -3336,7 +3339,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3336
3339
|
:param str type: 'market' or 'limit'
|
3337
3340
|
:param str side: 'buy' or 'sell'
|
3338
3341
|
:param float amount: how much of currency you want to trade in units of base currency
|
3339
|
-
:param float [price]: the price at which the order is to be
|
3342
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
3340
3343
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3341
3344
|
:param str [params.timeInForce]: "GTC", "IOC", "FOK"
|
3342
3345
|
:param bool [params.postOnly]: True or False whether the order is post-only
|
@@ -3893,7 +3896,7 @@ class bybit(Exchange, ImplicitAPI):
|
|
3893
3896
|
:param str type: 'market' or 'limit'
|
3894
3897
|
:param str side: 'buy' or 'sell'
|
3895
3898
|
:param float amount: how much of currency you want to trade in units of base currency
|
3896
|
-
:param float price: the price at which the order is to be
|
3899
|
+
:param float price: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
3897
3900
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3898
3901
|
:param float [params.triggerPrice]: The price that a trigger order is triggered at
|
3899
3902
|
:param float [params.stopLossPrice]: The price that a stop loss order is triggered at
|
ccxt/async_support/cex.py
CHANGED
@@ -735,7 +735,7 @@ class cex(Exchange, ImplicitAPI):
|
|
735
735
|
:param str type: 'market' or 'limit'
|
736
736
|
:param str side: 'buy' or 'sell'
|
737
737
|
:param float amount: how much of currency you want to trade in units of base currency
|
738
|
-
:param float [price]: the price at which the order is to be
|
738
|
+
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
739
739
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
740
740
|
:param float [params.cost]: the quote quantity that can be used alternative for the amount for market buy orders
|
741
741
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -1489,7 +1489,7 @@ class cex(Exchange, ImplicitAPI):
|
|
1489
1489
|
:param str type: 'market' or 'limit'
|
1490
1490
|
:param str side: 'buy' or 'sell'
|
1491
1491
|
:param float amount: how much of the currency you want to trade in units of the base currency
|
1492
|
-
:param float|None [price]: the price at which the order is to be
|
1492
|
+
:param float|None [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
1493
1493
|
:param dict [params]: extra parameters specific to the cex api endpoint
|
1494
1494
|
:returns dict: an `order structure <https://docs.ccxt.com/en/latest/manual.html#order-structure>`
|
1495
1495
|
"""
|