ccxt 4.3.29__py2.py3-none-any.whl → 4.3.31__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 +2 -0
- ccxt/abstract/binancecoinm.py +2 -0
- ccxt/abstract/binanceus.py +2 -0
- ccxt/abstract/binanceusdm.py +2 -0
- ccxt/ace.py +14 -14
- ccxt/alpaca.py +16 -16
- ccxt/ascendex.py +46 -46
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +14 -14
- ccxt/async_support/alpaca.py +16 -16
- ccxt/async_support/ascendex.py +46 -46
- ccxt/async_support/base/exchange.py +23 -23
- ccxt/async_support/base/ws/aiohttp_client.py +1 -0
- ccxt/async_support/base/ws/future.py +27 -29
- ccxt/async_support/bigone.py +32 -32
- ccxt/async_support/binance.py +105 -96
- ccxt/async_support/bingx.py +22 -22
- ccxt/async_support/bit2c.py +13 -13
- ccxt/async_support/bitbank.py +19 -19
- ccxt/async_support/bitbns.py +17 -17
- ccxt/async_support/bitfinex.py +24 -24
- ccxt/async_support/bitfinex2.py +142 -109
- ccxt/async_support/bitflyer.py +23 -23
- ccxt/async_support/bitget.py +76 -76
- ccxt/async_support/bithumb.py +20 -20
- ccxt/async_support/bitmart.py +55 -55
- ccxt/async_support/bitmex.py +41 -41
- ccxt/async_support/bitopro.py +30 -30
- ccxt/async_support/bitrue.py +37 -37
- ccxt/async_support/bitso.py +30 -30
- ccxt/async_support/bitstamp.py +31 -31
- ccxt/async_support/bitteam.py +26 -26
- ccxt/async_support/bitvavo.py +27 -27
- ccxt/async_support/bl3p.py +8 -8
- ccxt/async_support/blockchaincom.py +24 -24
- ccxt/async_support/blofin.py +37 -37
- ccxt/async_support/btcalpha.py +19 -19
- ccxt/async_support/btcbox.py +11 -11
- ccxt/async_support/btcmarkets.py +22 -22
- ccxt/async_support/btcturk.py +13 -13
- ccxt/async_support/bybit.py +96 -96
- ccxt/async_support/cex.py +21 -21
- ccxt/async_support/coinbase.py +53 -53
- ccxt/async_support/coinbaseexchange.py +29 -29
- ccxt/async_support/coinbaseinternational.py +32 -32
- ccxt/async_support/coincheck.py +14 -14
- ccxt/async_support/coinex.py +424 -448
- ccxt/async_support/coinlist.py +35 -35
- ccxt/async_support/coinmate.py +22 -22
- ccxt/async_support/coinmetro.py +22 -22
- ccxt/async_support/coinone.py +18 -18
- ccxt/async_support/coinsph.py +32 -32
- ccxt/async_support/coinspot.py +8 -8
- ccxt/async_support/cryptocom.py +43 -43
- ccxt/async_support/currencycom.py +33 -33
- ccxt/async_support/delta.py +35 -35
- ccxt/async_support/deribit.py +54 -54
- ccxt/async_support/digifinex.py +56 -56
- ccxt/async_support/exmo.py +34 -34
- ccxt/async_support/gate.py +60 -60
- ccxt/async_support/gemini.py +24 -24
- ccxt/async_support/hitbtc.py +51 -51
- ccxt/async_support/hollaex.py +29 -29
- ccxt/async_support/htx.py +73 -73
- ccxt/async_support/huobijp.py +30 -30
- ccxt/async_support/hyperliquid.py +58 -58
- ccxt/async_support/idex.py +33 -33
- ccxt/async_support/independentreserve.py +12 -12
- ccxt/async_support/indodax.py +21 -21
- ccxt/async_support/kraken.py +46 -51
- ccxt/async_support/krakenfutures.py +29 -29
- ccxt/async_support/kucoin.py +51 -51
- ccxt/async_support/kucoinfutures.py +33 -33
- ccxt/async_support/kuna.py +27 -27
- ccxt/async_support/latoken.py +27 -27
- ccxt/async_support/lbank.py +35 -35
- ccxt/async_support/luno.py +19 -19
- ccxt/async_support/lykke.py +20 -20
- ccxt/async_support/mercado.py +17 -17
- ccxt/async_support/mexc.py +64 -64
- ccxt/async_support/ndax.py +38 -38
- ccxt/async_support/novadax.py +26 -26
- ccxt/async_support/oceanex.py +21 -21
- ccxt/async_support/okcoin.py +35 -35
- ccxt/async_support/okx.py +85 -85
- ccxt/async_support/onetrading.py +32 -32
- ccxt/async_support/p2b.py +14 -14
- ccxt/async_support/paymium.py +12 -12
- ccxt/async_support/phemex.py +50 -50
- ccxt/async_support/poloniex.py +35 -35
- ccxt/async_support/poloniexfutures.py +25 -21
- ccxt/async_support/probit.py +30 -30
- ccxt/async_support/timex.py +22 -22
- ccxt/async_support/tokocrypto.py +26 -26
- ccxt/async_support/tradeogre.py +12 -12
- ccxt/async_support/upbit.py +28 -28
- ccxt/async_support/wavesexchange.py +33 -33
- ccxt/async_support/wazirx.py +21 -21
- ccxt/async_support/whitebit.py +80 -40
- ccxt/async_support/woo.py +51 -51
- ccxt/async_support/woofipro.py +46 -46
- ccxt/async_support/yobit.py +20 -20
- ccxt/async_support/zaif.py +12 -12
- ccxt/async_support/zonda.py +22 -22
- ccxt/base/exchange.py +39 -35
- ccxt/base/types.py +13 -0
- ccxt/bigone.py +32 -32
- ccxt/binance.py +105 -96
- ccxt/bingx.py +22 -22
- ccxt/bit2c.py +13 -13
- ccxt/bitbank.py +19 -19
- ccxt/bitbns.py +17 -17
- ccxt/bitfinex.py +24 -24
- ccxt/bitfinex2.py +142 -109
- ccxt/bitflyer.py +23 -23
- ccxt/bitget.py +76 -76
- ccxt/bithumb.py +20 -20
- ccxt/bitmart.py +55 -55
- ccxt/bitmex.py +41 -41
- ccxt/bitopro.py +30 -30
- ccxt/bitrue.py +37 -37
- ccxt/bitso.py +30 -30
- ccxt/bitstamp.py +31 -31
- ccxt/bitteam.py +26 -26
- ccxt/bitvavo.py +27 -27
- ccxt/bl3p.py +8 -8
- ccxt/blockchaincom.py +24 -24
- ccxt/blofin.py +37 -37
- ccxt/btcalpha.py +19 -19
- ccxt/btcbox.py +11 -11
- ccxt/btcmarkets.py +22 -22
- ccxt/btcturk.py +13 -13
- ccxt/bybit.py +96 -96
- ccxt/cex.py +21 -21
- ccxt/coinbase.py +53 -53
- ccxt/coinbaseexchange.py +29 -29
- ccxt/coinbaseinternational.py +32 -32
- ccxt/coincheck.py +14 -14
- ccxt/coinex.py +424 -448
- ccxt/coinlist.py +35 -35
- ccxt/coinmate.py +22 -22
- ccxt/coinmetro.py +22 -22
- ccxt/coinone.py +18 -18
- ccxt/coinsph.py +32 -32
- ccxt/coinspot.py +8 -8
- ccxt/cryptocom.py +43 -43
- ccxt/currencycom.py +33 -33
- ccxt/delta.py +35 -35
- ccxt/deribit.py +54 -54
- ccxt/digifinex.py +56 -56
- ccxt/exmo.py +34 -34
- ccxt/gate.py +60 -60
- ccxt/gemini.py +24 -24
- ccxt/hitbtc.py +51 -51
- ccxt/hollaex.py +29 -29
- ccxt/htx.py +73 -73
- ccxt/huobijp.py +30 -30
- ccxt/hyperliquid.py +58 -58
- ccxt/idex.py +33 -33
- ccxt/independentreserve.py +12 -12
- ccxt/indodax.py +21 -21
- ccxt/kraken.py +46 -51
- ccxt/krakenfutures.py +29 -29
- ccxt/kucoin.py +51 -51
- ccxt/kucoinfutures.py +33 -33
- ccxt/kuna.py +27 -27
- ccxt/latoken.py +27 -27
- ccxt/lbank.py +35 -35
- ccxt/luno.py +19 -19
- ccxt/lykke.py +20 -20
- ccxt/mercado.py +17 -17
- ccxt/mexc.py +64 -64
- ccxt/ndax.py +38 -38
- ccxt/novadax.py +26 -26
- ccxt/oceanex.py +21 -21
- ccxt/okcoin.py +35 -35
- ccxt/okx.py +85 -85
- ccxt/onetrading.py +32 -32
- ccxt/p2b.py +14 -14
- ccxt/paymium.py +12 -12
- ccxt/phemex.py +50 -50
- ccxt/poloniex.py +35 -35
- ccxt/poloniexfutures.py +25 -21
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +8 -8
- ccxt/pro/ascendex.py +4 -4
- ccxt/pro/binance.py +56 -56
- ccxt/pro/bingx.py +5 -5
- ccxt/pro/bitfinex.py +6 -6
- ccxt/pro/bitfinex2.py +10 -10
- ccxt/pro/bitget.py +17 -17
- ccxt/pro/bithumb.py +6 -6
- ccxt/pro/bitmart.py +8 -8
- ccxt/pro/bitmex.py +16 -16
- ccxt/pro/bitopro.py +4 -4
- ccxt/pro/bitrue.py +8 -8
- ccxt/pro/bitstamp.py +5 -5
- ccxt/pro/bitvavo.py +14 -14
- ccxt/pro/blockchaincom.py +7 -7
- ccxt/pro/bybit.py +12 -12
- ccxt/pro/cex.py +19 -19
- ccxt/pro/coinbase.py +2 -2
- ccxt/pro/coinbaseexchange.py +10 -10
- ccxt/pro/coinbaseinternational.py +4 -4
- ccxt/pro/coincheck.py +2 -2
- ccxt/pro/coinex.py +15 -15
- ccxt/pro/coinone.py +4 -4
- ccxt/pro/cryptocom.py +11 -11
- ccxt/pro/currencycom.py +4 -4
- ccxt/pro/deribit.py +9 -9
- ccxt/pro/exmo.py +9 -9
- ccxt/pro/gate.py +12 -12
- ccxt/pro/gemini.py +11 -11
- ccxt/pro/hitbtc.py +13 -13
- ccxt/pro/hollaex.py +6 -6
- ccxt/pro/htx.py +15 -15
- ccxt/pro/huobijp.py +16 -16
- ccxt/pro/hyperliquid.py +9 -9
- ccxt/pro/idex.py +12 -12
- ccxt/pro/independentreserve.py +2 -2
- ccxt/pro/kraken.py +14 -14
- ccxt/pro/krakenfutures.py +12 -12
- ccxt/pro/kucoin.py +12 -12
- ccxt/pro/kucoinfutures.py +16 -16
- ccxt/pro/lbank.py +12 -12
- ccxt/pro/luno.py +4 -4
- ccxt/pro/mexc.py +14 -14
- ccxt/pro/ndax.py +12 -12
- ccxt/pro/okcoin.py +6 -6
- ccxt/pro/okx.py +30 -30
- ccxt/pro/onetrading.py +13 -13
- ccxt/pro/p2b.py +2 -2
- ccxt/pro/phemex.py +9 -9
- ccxt/pro/poloniex.py +9 -9
- ccxt/pro/poloniexfutures.py +10 -10
- ccxt/pro/probit.py +8 -8
- ccxt/pro/upbit.py +1 -1
- ccxt/pro/wazirx.py +10 -10
- ccxt/pro/whitebit.py +8 -8
- ccxt/pro/woo.py +14 -14
- ccxt/pro/woofipro.py +14 -14
- ccxt/probit.py +30 -30
- ccxt/test/base/test_shared_methods.py +1 -0
- ccxt/timex.py +22 -22
- ccxt/tokocrypto.py +26 -26
- ccxt/tradeogre.py +12 -12
- ccxt/upbit.py +28 -28
- ccxt/wavesexchange.py +33 -33
- ccxt/wazirx.py +21 -21
- ccxt/whitebit.py +80 -40
- ccxt/woo.py +51 -51
- ccxt/woofipro.py +46 -46
- ccxt/yobit.py +20 -20
- ccxt/zaif.py +12 -12
- ccxt/zonda.py +22 -22
- {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/METADATA +4 -4
- {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/RECORD +260 -260
- {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/WHEEL +0 -0
- {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/top_level.txt +0 -0
ccxt/whitebit.py
CHANGED
@@ -45,6 +45,9 @@ class whitebit(Exchange, ImplicitAPI):
|
|
45
45
|
'cancelAllOrdersAfter': True,
|
46
46
|
'cancelOrder': True,
|
47
47
|
'cancelOrders': False,
|
48
|
+
'createMarketBuyOrderWithCost': True,
|
49
|
+
'createMarketOrderWithCost': False,
|
50
|
+
'createMarketSellOrderWithCost': False,
|
48
51
|
'createOrder': True,
|
49
52
|
'createStopLimitOrder': True,
|
50
53
|
'createStopMarketOrder': True,
|
@@ -456,7 +459,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
456
459
|
# },
|
457
460
|
#
|
458
461
|
ids = list(response.keys())
|
459
|
-
result = {}
|
462
|
+
result: dict = {}
|
460
463
|
for i in range(0, len(ids)):
|
461
464
|
id = ids[i]
|
462
465
|
currency = response[id]
|
@@ -489,7 +492,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
489
492
|
}
|
490
493
|
return result
|
491
494
|
|
492
|
-
def fetch_transaction_fees(self, codes:
|
495
|
+
def fetch_transaction_fees(self, codes: Strings = None, params={}):
|
493
496
|
"""
|
494
497
|
* @deprecated
|
495
498
|
please use fetchDepositWithdrawFees instead
|
@@ -526,8 +529,8 @@ class whitebit(Exchange, ImplicitAPI):
|
|
526
529
|
# }
|
527
530
|
#
|
528
531
|
currenciesIds = list(response.keys())
|
529
|
-
withdrawFees = {}
|
530
|
-
depositFees = {}
|
532
|
+
withdrawFees: dict = {}
|
533
|
+
depositFees: dict = {}
|
531
534
|
for i in range(0, len(currenciesIds)):
|
532
535
|
currency = currenciesIds[i]
|
533
536
|
data = response[currency]
|
@@ -639,7 +642,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
639
642
|
# ...
|
640
643
|
# }
|
641
644
|
#
|
642
|
-
depositWithdrawFees = {}
|
645
|
+
depositWithdrawFees: dict = {}
|
643
646
|
codes = self.market_codes(codes)
|
644
647
|
currencyIds = list(response.keys())
|
645
648
|
for i in range(0, len(currencyIds)):
|
@@ -658,11 +661,11 @@ class whitebit(Exchange, ImplicitAPI):
|
|
658
661
|
deposit = self.safe_value(feeInfo, 'deposit')
|
659
662
|
withdrawFee = self.safe_number(withdraw, 'fixed')
|
660
663
|
depositFee = self.safe_number(deposit, 'fixed')
|
661
|
-
withdrawResult = {
|
664
|
+
withdrawResult: dict = {
|
662
665
|
'fee': withdrawFee,
|
663
666
|
'percentage': False if (withdrawFee is not None) else None,
|
664
667
|
}
|
665
|
-
depositResult = {
|
668
|
+
depositResult: dict = {
|
666
669
|
'fee': depositFee,
|
667
670
|
'percentage': False if (depositFee is not None) else None,
|
668
671
|
}
|
@@ -710,7 +713,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
710
713
|
# ...
|
711
714
|
# }
|
712
715
|
#
|
713
|
-
result = {}
|
716
|
+
result: dict = {}
|
714
717
|
for i in range(0, len(self.symbols)):
|
715
718
|
symbol = self.symbols[i]
|
716
719
|
market = self.market(symbol)
|
@@ -739,7 +742,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
739
742
|
"""
|
740
743
|
self.load_markets()
|
741
744
|
market = self.market(symbol)
|
742
|
-
request = {
|
745
|
+
request: dict = {
|
743
746
|
'market': market['id'],
|
744
747
|
}
|
745
748
|
response = self.v1PublicGetTicker(self.extend(request, params))
|
@@ -839,7 +842,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
839
842
|
# },
|
840
843
|
#
|
841
844
|
marketIds = list(response.keys())
|
842
|
-
result = {}
|
845
|
+
result: dict = {}
|
843
846
|
for i in range(0, len(marketIds)):
|
844
847
|
marketId = marketIds[i]
|
845
848
|
market = self.safe_market(marketId)
|
@@ -859,7 +862,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
859
862
|
"""
|
860
863
|
self.load_markets()
|
861
864
|
market = self.market(symbol)
|
862
|
-
request = {
|
865
|
+
request: dict = {
|
863
866
|
'market': market['id'],
|
864
867
|
}
|
865
868
|
if limit is not None:
|
@@ -899,7 +902,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
899
902
|
"""
|
900
903
|
self.load_markets()
|
901
904
|
market = self.market(symbol)
|
902
|
-
request = {
|
905
|
+
request: dict = {
|
903
906
|
'market': market['id'],
|
904
907
|
}
|
905
908
|
response = self.v4PublicGetTradesMarket(self.extend(request, params))
|
@@ -929,7 +932,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
929
932
|
"""
|
930
933
|
self.load_markets()
|
931
934
|
market: Market = None
|
932
|
-
request = {}
|
935
|
+
request: dict = {}
|
933
936
|
if symbol is not None:
|
934
937
|
market = self.market(symbol)
|
935
938
|
request['market'] = market['id']
|
@@ -985,7 +988,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
985
988
|
results = self.sort_by_2(results, 'timestamp', 'id')
|
986
989
|
return self.filter_by_since_limit(results, since, limit, 'timestamp')
|
987
990
|
|
988
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
991
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
989
992
|
#
|
990
993
|
# fetchTradesV4
|
991
994
|
#
|
@@ -1076,7 +1079,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1076
1079
|
"""
|
1077
1080
|
self.load_markets()
|
1078
1081
|
market = self.market(symbol)
|
1079
|
-
request = {
|
1082
|
+
request: dict = {
|
1080
1083
|
'market': market['id'],
|
1081
1084
|
'interval': self.safe_string(self.timeframes, timeframe, timeframe),
|
1082
1085
|
}
|
@@ -1162,6 +1165,29 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1162
1165
|
#
|
1163
1166
|
return self.safe_integer(response, 'time')
|
1164
1167
|
|
1168
|
+
def create_market_order_with_cost(self, symbol: str, side: OrderSide, cost: float, params={}):
|
1169
|
+
"""
|
1170
|
+
create a market order by providing the symbol, side and cost
|
1171
|
+
:param str symbol: unified symbol of the market to create an order in
|
1172
|
+
:param str side: 'buy' or 'sell'
|
1173
|
+
:param float cost: how much you want to trade in units of the quote currency
|
1174
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1175
|
+
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1176
|
+
"""
|
1177
|
+
params['cost'] = cost
|
1178
|
+
# only buy side is supported
|
1179
|
+
return self.create_order(symbol, 'market', side, 0, None, params)
|
1180
|
+
|
1181
|
+
def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}) -> Order:
|
1182
|
+
"""
|
1183
|
+
create a market buy order by providing the symbol and cost
|
1184
|
+
:param str symbol: unified symbol of the market to create an order in
|
1185
|
+
:param float cost: how much you want to trade in units of the quote currency
|
1186
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1187
|
+
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1188
|
+
"""
|
1189
|
+
return self.create_market_order_with_cost(symbol, 'buy', cost, params)
|
1190
|
+
|
1165
1191
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
1166
1192
|
"""
|
1167
1193
|
create a trade order
|
@@ -1176,15 +1202,23 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1176
1202
|
:param float amount: how much of currency you want to trade in units of base currency
|
1177
1203
|
:param float [price]: the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
1178
1204
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1205
|
+
:param float [params.cost]: *market orders only* the cost of the order in units of the base currency
|
1179
1206
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1180
1207
|
"""
|
1181
1208
|
self.load_markets()
|
1182
1209
|
market = self.market(symbol)
|
1183
|
-
request = {
|
1210
|
+
request: dict = {
|
1184
1211
|
'market': market['id'],
|
1185
1212
|
'side': side,
|
1186
|
-
'amount': self.amount_to_precision(symbol, amount),
|
1187
1213
|
}
|
1214
|
+
cost = None
|
1215
|
+
cost, params = self.handle_param_string(params, 'cost')
|
1216
|
+
if cost is not None:
|
1217
|
+
if (side != 'buy') or (type != 'market'):
|
1218
|
+
raise InvalidOrder(self.id + ' createOrder() cost is only supported for market buy orders')
|
1219
|
+
request['amount'] = self.cost_to_precision(symbol, cost)
|
1220
|
+
else:
|
1221
|
+
request['amount'] = self.amount_to_precision(symbol, amount)
|
1188
1222
|
clientOrderId = self.safe_string_2(params, 'clOrdId', 'clientOrderId')
|
1189
1223
|
if clientOrderId is None:
|
1190
1224
|
brokerId = self.safe_string(self.options, 'brokerId')
|
@@ -1232,7 +1266,10 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1232
1266
|
if useCollateralEndpoint:
|
1233
1267
|
response = self.v4PrivatePostOrderCollateralMarket(self.extend(request, params))
|
1234
1268
|
else:
|
1235
|
-
|
1269
|
+
if cost is not None:
|
1270
|
+
response = self.v4PrivatePostOrderMarket(self.extend(request, params))
|
1271
|
+
else:
|
1272
|
+
response = self.v4PrivatePostOrderStockMarket(self.extend(request, params))
|
1236
1273
|
return self.parse_order(response)
|
1237
1274
|
|
1238
1275
|
def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
@@ -1254,7 +1291,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1254
1291
|
raise ArgumentsRequired(self.id + ' editOrder() requires a symbol argument')
|
1255
1292
|
self.load_markets()
|
1256
1293
|
market = self.market(symbol)
|
1257
|
-
request = {
|
1294
|
+
request: dict = {
|
1258
1295
|
'orderId': id,
|
1259
1296
|
'market': market['id'],
|
1260
1297
|
}
|
@@ -1300,7 +1337,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1300
1337
|
raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
|
1301
1338
|
self.load_markets()
|
1302
1339
|
market = self.market(symbol)
|
1303
|
-
request = {
|
1340
|
+
request: dict = {
|
1304
1341
|
'market': market['id'],
|
1305
1342
|
'orderId': int(id),
|
1306
1343
|
}
|
@@ -1318,7 +1355,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1318
1355
|
"""
|
1319
1356
|
self.load_markets()
|
1320
1357
|
market = None
|
1321
|
-
request = {}
|
1358
|
+
request: dict = {}
|
1322
1359
|
if symbol is not None:
|
1323
1360
|
market = self.market(symbol)
|
1324
1361
|
request['market'] = market['id']
|
@@ -1381,7 +1418,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1381
1418
|
|
1382
1419
|
def parse_balance(self, response) -> Balances:
|
1383
1420
|
balanceKeys = list(response.keys())
|
1384
|
-
result = {}
|
1421
|
+
result: dict = {}
|
1385
1422
|
for i in range(0, len(balanceKeys)):
|
1386
1423
|
id = balanceKeys[i]
|
1387
1424
|
code = self.safe_currency_code(id)
|
@@ -1459,7 +1496,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1459
1496
|
raise ArgumentsRequired(self.id + ' fetchOpenOrders() requires a symbol argument')
|
1460
1497
|
self.load_markets()
|
1461
1498
|
market = self.market(symbol)
|
1462
|
-
request = {
|
1499
|
+
request: dict = {
|
1463
1500
|
'market': market['id'],
|
1464
1501
|
}
|
1465
1502
|
if limit is not None:
|
@@ -1498,7 +1535,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1498
1535
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1499
1536
|
"""
|
1500
1537
|
self.load_markets()
|
1501
|
-
request = {}
|
1538
|
+
request: dict = {}
|
1502
1539
|
market = None
|
1503
1540
|
if symbol is not None:
|
1504
1541
|
market = self.market(symbol)
|
@@ -1537,8 +1574,8 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1537
1574
|
results = self.filter_by_symbol_since_limit(results, symbol, since, limit)
|
1538
1575
|
return results
|
1539
1576
|
|
1540
|
-
def parse_order_type(self, type):
|
1541
|
-
types = {
|
1577
|
+
def parse_order_type(self, type: Str):
|
1578
|
+
types: dict = {
|
1542
1579
|
'limit': 'limit',
|
1543
1580
|
'market': 'market',
|
1544
1581
|
'stop market': 'market',
|
@@ -1549,7 +1586,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1549
1586
|
}
|
1550
1587
|
return self.safe_string(types, type, type)
|
1551
1588
|
|
1552
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
1589
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
1553
1590
|
#
|
1554
1591
|
# createOrder, fetchOpenOrders
|
1555
1592
|
#
|
@@ -1601,6 +1638,9 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1601
1638
|
stopPrice = self.safe_number(order, 'activation_price')
|
1602
1639
|
orderId = self.safe_string_2(order, 'orderId', 'id')
|
1603
1640
|
type = self.safe_string(order, 'type')
|
1641
|
+
orderType = self.parse_order_type(type)
|
1642
|
+
if orderType == 'market':
|
1643
|
+
remaining = None
|
1604
1644
|
amount = self.safe_string(order, 'amount')
|
1605
1645
|
cost = self.safe_string(order, 'dealMoney')
|
1606
1646
|
if (side == 'buy') and ((type == 'market') or (type == 'stop market')):
|
@@ -1627,7 +1667,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1627
1667
|
'status': None,
|
1628
1668
|
'side': side,
|
1629
1669
|
'price': price,
|
1630
|
-
'type':
|
1670
|
+
'type': orderType,
|
1631
1671
|
'stopPrice': stopPrice,
|
1632
1672
|
'triggerPrice': stopPrice,
|
1633
1673
|
'amount': amount,
|
@@ -1651,7 +1691,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1651
1691
|
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
1652
1692
|
"""
|
1653
1693
|
self.load_markets()
|
1654
|
-
request = {
|
1694
|
+
request: dict = {
|
1655
1695
|
'orderId': int(id),
|
1656
1696
|
}
|
1657
1697
|
market = None
|
@@ -1694,7 +1734,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1694
1734
|
"""
|
1695
1735
|
self.load_markets()
|
1696
1736
|
currency = self.currency(code)
|
1697
|
-
request = {
|
1737
|
+
request: dict = {
|
1698
1738
|
'ticker': currency['id'],
|
1699
1739
|
}
|
1700
1740
|
response = None
|
@@ -1766,7 +1806,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1766
1806
|
raise NotSupported(self.id + ' setLeverage() does not allow to set per symbol')
|
1767
1807
|
if (leverage < 1) or (leverage > 20):
|
1768
1808
|
raise BadRequest(self.id + ' setLeverage() leverage should be between 1 and 20')
|
1769
|
-
request = {
|
1809
|
+
request: dict = {
|
1770
1810
|
'leverage': leverage,
|
1771
1811
|
}
|
1772
1812
|
return self.v4PrivatePostCollateralAccountLeverage(self.extend(request, params))
|
@@ -1791,7 +1831,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1791
1831
|
fromAccountId = self.safe_string(accountsByType, fromAccount, fromAccount)
|
1792
1832
|
toAccountId = self.safe_string(accountsByType, toAccount, toAccount)
|
1793
1833
|
amountString = self.currency_to_precision(code, amount)
|
1794
|
-
request = {
|
1834
|
+
request: dict = {
|
1795
1835
|
'ticker': currency['id'],
|
1796
1836
|
'amount': amountString,
|
1797
1837
|
'from': fromAccountId,
|
@@ -1832,7 +1872,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1832
1872
|
"""
|
1833
1873
|
self.load_markets()
|
1834
1874
|
currency = self.currency(code) # check if it has canDeposit
|
1835
|
-
request = {
|
1875
|
+
request: dict = {
|
1836
1876
|
'ticker': currency['id'],
|
1837
1877
|
'amount': self.currency_to_precision(code, amount),
|
1838
1878
|
'address': address,
|
@@ -1857,7 +1897,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1857
1897
|
#
|
1858
1898
|
return self.extend({'id': uniqueId}, self.parse_transaction(response, currency))
|
1859
1899
|
|
1860
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
1900
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
1861
1901
|
#
|
1862
1902
|
# {
|
1863
1903
|
# "address": "3ApEASLcrQtZpg1TsssFgYF5V5YQJAKvuE", # deposit address
|
@@ -1922,7 +1962,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1922
1962
|
}
|
1923
1963
|
|
1924
1964
|
def parse_transaction_status(self, status):
|
1925
|
-
statuses = {
|
1965
|
+
statuses: dict = {
|
1926
1966
|
'1': 'pending',
|
1927
1967
|
'2': 'pending',
|
1928
1968
|
'3': 'ok',
|
@@ -1953,7 +1993,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1953
1993
|
"""
|
1954
1994
|
self.load_markets()
|
1955
1995
|
currency = None
|
1956
|
-
request = {
|
1996
|
+
request: dict = {
|
1957
1997
|
'transactionMethod': 1,
|
1958
1998
|
'uniqueId': id,
|
1959
1999
|
'limit': 1,
|
@@ -2016,7 +2056,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
2016
2056
|
"""
|
2017
2057
|
self.load_markets()
|
2018
2058
|
currency = None
|
2019
|
-
request = {
|
2059
|
+
request: dict = {
|
2020
2060
|
'transactionMethod': 1,
|
2021
2061
|
'limit': 100,
|
2022
2062
|
'offset': 0,
|
@@ -2079,7 +2119,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
2079
2119
|
:returns dict[]: a list of `borrow interest structures <https://docs.ccxt.com/#/?id=borrow-interest-structure>`
|
2080
2120
|
"""
|
2081
2121
|
self.load_markets()
|
2082
|
-
request = {}
|
2122
|
+
request: dict = {}
|
2083
2123
|
market = None
|
2084
2124
|
if symbol is not None:
|
2085
2125
|
market = self.market(symbol)
|
@@ -2109,7 +2149,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
2109
2149
|
interest = self.parse_borrow_interests(response, market)
|
2110
2150
|
return self.filter_by_currency_since_limit(interest, code, since, limit)
|
2111
2151
|
|
2112
|
-
def parse_borrow_interest(self, info, market: Market = None):
|
2152
|
+
def parse_borrow_interest(self, info: dict, market: Market = None):
|
2113
2153
|
#
|
2114
2154
|
# {
|
2115
2155
|
# "positionId": 191823,
|
@@ -2294,7 +2334,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
2294
2334
|
:returns dict: a list of `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
|
2295
2335
|
"""
|
2296
2336
|
self.load_markets()
|
2297
|
-
request = {}
|
2337
|
+
request: dict = {}
|
2298
2338
|
currency = None
|
2299
2339
|
if code is not None:
|
2300
2340
|
currency = self.currency(code)
|