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/async_support/bingx.py
CHANGED
@@ -529,25 +529,25 @@ class bingx(Exchange, ImplicitAPI):
|
|
529
529
|
# }
|
530
530
|
#
|
531
531
|
data = self.safe_list(response, 'data', [])
|
532
|
-
result = {}
|
532
|
+
result: dict = {}
|
533
533
|
for i in range(0, len(data)):
|
534
534
|
entry = data[i]
|
535
535
|
currencyId = self.safe_string(entry, 'coin')
|
536
536
|
code = self.safe_currency_code(currencyId)
|
537
537
|
name = self.safe_string(entry, 'name')
|
538
538
|
networkList = self.safe_list(entry, 'networkList')
|
539
|
-
networks = {}
|
539
|
+
networks: dict = {}
|
540
540
|
fee = None
|
541
541
|
active = None
|
542
542
|
withdrawEnabled = None
|
543
|
-
defaultLimits = {}
|
543
|
+
defaultLimits: dict = {}
|
544
544
|
for j in range(0, len(networkList)):
|
545
545
|
rawNetwork = networkList[j]
|
546
546
|
network = self.safe_string(rawNetwork, 'network')
|
547
547
|
networkCode = self.network_id_to_code(network)
|
548
548
|
isDefault = self.safe_bool(rawNetwork, 'isDefault')
|
549
549
|
withdrawEnabled = self.safe_bool(rawNetwork, 'withdrawEnable')
|
550
|
-
limits = {
|
550
|
+
limits: dict = {
|
551
551
|
'amounts': {'min': self.safe_number(rawNetwork, 'withdrawMin'), 'max': self.safe_number(rawNetwork, 'withdrawMax')},
|
552
552
|
}
|
553
553
|
if isDefault:
|
@@ -929,7 +929,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
929
929
|
trades = self.safe_list(response, 'data', [])
|
930
930
|
return self.parse_trades(trades, market, since, limit)
|
931
931
|
|
932
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
932
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
933
933
|
#
|
934
934
|
# spot
|
935
935
|
# fetchTrades
|
@@ -1576,7 +1576,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1576
1576
|
def parse_balance(self, response) -> Balances:
|
1577
1577
|
data = self.safe_value(response, 'data')
|
1578
1578
|
balances = self.safe_value_2(data, 'balance', 'balances', data)
|
1579
|
-
result = {'info': response}
|
1579
|
+
result: dict = {'info': response}
|
1580
1580
|
if isinstance(balances, list):
|
1581
1581
|
for i in range(0, len(balances)):
|
1582
1582
|
balance = balances[i]
|
@@ -1639,7 +1639,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1639
1639
|
positions = self.safe_list(response, 'data', [])
|
1640
1640
|
return self.parse_positions(positions, symbols)
|
1641
1641
|
|
1642
|
-
def parse_position(self, position, market: Market = None):
|
1642
|
+
def parse_position(self, position: dict, market: Market = None):
|
1643
1643
|
#
|
1644
1644
|
# {
|
1645
1645
|
# "positionId":"1773122376147623936",
|
@@ -2079,7 +2079,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
2079
2079
|
return self.parse_orders(result, market)
|
2080
2080
|
|
2081
2081
|
def parse_order_side(self, side):
|
2082
|
-
sides = {
|
2082
|
+
sides: dict = {
|
2083
2083
|
'BUY': 'buy',
|
2084
2084
|
'SELL': 'sell',
|
2085
2085
|
'SHORT': 'sell',
|
@@ -2089,8 +2089,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
2089
2089
|
}
|
2090
2090
|
return self.safe_string(sides, side, side)
|
2091
2091
|
|
2092
|
-
def parse_order_type(self, type):
|
2093
|
-
types = {
|
2092
|
+
def parse_order_type(self, type: Str):
|
2093
|
+
types: dict = {
|
2094
2094
|
'trigger_market': 'market',
|
2095
2095
|
'trigger_limit': 'limit',
|
2096
2096
|
'stop_limit': 'limit',
|
@@ -2100,7 +2100,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
2100
2100
|
}
|
2101
2101
|
return self.safe_string(types, type, type)
|
2102
2102
|
|
2103
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
2103
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
2104
2104
|
#
|
2105
2105
|
# spot
|
2106
2106
|
# createOrder, createOrders, cancelOrder
|
@@ -2390,7 +2390,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
2390
2390
|
'stopLossPrice': stopLossPrice,
|
2391
2391
|
'takeProfitPrice': takeProfitPrice,
|
2392
2392
|
'average': self.safe_string_2(order, 'avgPrice', 'ap'),
|
2393
|
-
'cost':
|
2393
|
+
'cost': self.safe_string(order, 'cummulativeQuoteQty'),
|
2394
2394
|
'amount': self.safe_string_n(order, ['origQty', 'q', 'quantity']),
|
2395
2395
|
'filled': self.safe_string_2(order, 'executedQty', 'z'),
|
2396
2396
|
'remaining': None,
|
@@ -2403,8 +2403,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
2403
2403
|
'reduceOnly': self.safe_bool(order, 'reduceOnly'),
|
2404
2404
|
}, market)
|
2405
2405
|
|
2406
|
-
def parse_order_status(self, status):
|
2407
|
-
statuses = {
|
2406
|
+
def parse_order_status(self, status: Str):
|
2407
|
+
statuses: dict = {
|
2408
2408
|
'NEW': 'open',
|
2409
2409
|
'PENDING': 'open',
|
2410
2410
|
'PARTIALLY_FILLED': 'open',
|
@@ -2771,7 +2771,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
2771
2771
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
2772
2772
|
"""
|
2773
2773
|
await self.load_markets()
|
2774
|
-
request = {}
|
2774
|
+
request: dict = {}
|
2775
2775
|
market = None
|
2776
2776
|
if symbol is not None:
|
2777
2777
|
market = self.market(symbol)
|
@@ -3302,7 +3302,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
3302
3302
|
#
|
3303
3303
|
return self.parse_transactions(response, currency, since, limit)
|
3304
3304
|
|
3305
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
3305
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
3306
3306
|
#
|
3307
3307
|
# fetchDeposits
|
3308
3308
|
#
|
@@ -3396,7 +3396,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
3396
3396
|
}
|
3397
3397
|
|
3398
3398
|
def parse_transaction_status(self, status: str):
|
3399
|
-
statuses = {
|
3399
|
+
statuses: dict = {
|
3400
3400
|
'0': 'pending',
|
3401
3401
|
'1': 'ok',
|
3402
3402
|
'10': 'pending',
|
@@ -3441,13 +3441,13 @@ class bingx(Exchange, ImplicitAPI):
|
|
3441
3441
|
return await self.swapV2PrivatePostTradeMarginType(self.extend(request, params))
|
3442
3442
|
|
3443
3443
|
async def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
3444
|
-
request = {
|
3444
|
+
request: dict = {
|
3445
3445
|
'type': 1,
|
3446
3446
|
}
|
3447
3447
|
return await self.set_margin(symbol, amount, self.extend(request, params))
|
3448
3448
|
|
3449
3449
|
async def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
3450
|
-
request = {
|
3450
|
+
request: dict = {
|
3451
3451
|
'type': 2,
|
3452
3452
|
}
|
3453
3453
|
return await self.set_margin(symbol, amount, self.extend(request, params))
|
@@ -3700,7 +3700,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
3700
3700
|
#
|
3701
3701
|
networkList = self.safe_list(fee, 'networkList', [])
|
3702
3702
|
networkListLength = len(networkList)
|
3703
|
-
result = {
|
3703
|
+
result: dict = {
|
3704
3704
|
'info': fee,
|
3705
3705
|
'withdraw': {
|
3706
3706
|
'fee': None,
|
@@ -3810,7 +3810,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
3810
3810
|
:returns dict: an array of `liquidation structures <https://docs.ccxt.com/#/?id=liquidation-structure>`
|
3811
3811
|
"""
|
3812
3812
|
await self.load_markets()
|
3813
|
-
request = {
|
3813
|
+
request: dict = {
|
3814
3814
|
'autoCloseType': 'LIQUIDATION',
|
3815
3815
|
}
|
3816
3816
|
request, params = self.handle_until_option('endTime', request, params)
|
@@ -4209,7 +4209,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
4209
4209
|
data = self.safe_dict(response, 'data', {})
|
4210
4210
|
return self.parse_margin_mode(data, market)
|
4211
4211
|
|
4212
|
-
def parse_margin_mode(self, marginMode, market=None) -> MarginMode:
|
4212
|
+
def parse_margin_mode(self, marginMode: dict, market=None) -> MarginMode:
|
4213
4213
|
marginType = self.safe_string_lower(marginMode, 'marginType')
|
4214
4214
|
marginType = 'cross' if (marginType == 'crossed') else marginType
|
4215
4215
|
return {
|
ccxt/async_support/bit2c.py
CHANGED
@@ -192,7 +192,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
192
192
|
})
|
193
193
|
|
194
194
|
def parse_balance(self, response) -> Balances:
|
195
|
-
result = {
|
195
|
+
result: dict = {
|
196
196
|
'info': response,
|
197
197
|
'timestamp': None,
|
198
198
|
'datetime': None,
|
@@ -273,7 +273,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
273
273
|
"""
|
274
274
|
await self.load_markets()
|
275
275
|
market = self.market(symbol)
|
276
|
-
request = {
|
276
|
+
request: dict = {
|
277
277
|
'pair': market['id'],
|
278
278
|
}
|
279
279
|
orderbook = await self.publicGetExchangesPairOrderbook(self.extend(request, params))
|
@@ -317,7 +317,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
317
317
|
"""
|
318
318
|
await self.load_markets()
|
319
319
|
market = self.market(symbol)
|
320
|
-
request = {
|
320
|
+
request: dict = {
|
321
321
|
'pair': market['id'],
|
322
322
|
}
|
323
323
|
response = await self.publicGetExchangesPairTicker(self.extend(request, params))
|
@@ -337,7 +337,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
337
337
|
await self.load_markets()
|
338
338
|
market = self.market(symbol)
|
339
339
|
method = self.options['fetchTradesMethod'] # public_get_exchanges_pair_trades or public_get_exchanges_pair_lasttrades
|
340
|
-
request = {
|
340
|
+
request: dict = {
|
341
341
|
'pair': market['id'],
|
342
342
|
}
|
343
343
|
if since is not None:
|
@@ -387,7 +387,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
387
387
|
#
|
388
388
|
fees = self.safe_value(response, 'Fees', {})
|
389
389
|
keys = list(fees.keys())
|
390
|
-
result = {}
|
390
|
+
result: dict = {}
|
391
391
|
for i in range(0, len(keys)):
|
392
392
|
marketId = keys[i]
|
393
393
|
symbol = self.safe_symbol(marketId)
|
@@ -421,7 +421,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
421
421
|
await self.load_markets()
|
422
422
|
method = 'privatePostOrderAddOrder'
|
423
423
|
market = self.market(symbol)
|
424
|
-
request = {
|
424
|
+
request: dict = {
|
425
425
|
'Amount': amount,
|
426
426
|
'Pair': market['id'],
|
427
427
|
}
|
@@ -445,7 +445,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
445
445
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
446
446
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
447
447
|
"""
|
448
|
-
request = {
|
448
|
+
request: dict = {
|
449
449
|
'id': id,
|
450
450
|
}
|
451
451
|
return await self.privatePostOrderCancelOrder(self.extend(request, params))
|
@@ -464,7 +464,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
464
464
|
raise ArgumentsRequired(self.id + ' fetchOpenOrders() requires a symbol argument')
|
465
465
|
await self.load_markets()
|
466
466
|
market = self.market(symbol)
|
467
|
-
request = {
|
467
|
+
request: dict = {
|
468
468
|
'pair': market['id'],
|
469
469
|
}
|
470
470
|
response = await self.privateGetOrderMyOrders(self.extend(request, params))
|
@@ -483,7 +483,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
483
483
|
"""
|
484
484
|
await self.load_markets()
|
485
485
|
market = self.market(symbol)
|
486
|
-
request = {
|
486
|
+
request: dict = {
|
487
487
|
'id': id,
|
488
488
|
}
|
489
489
|
response = await self.privateGetOrderGetById(self.extend(request, params))
|
@@ -503,7 +503,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
503
503
|
#
|
504
504
|
return self.parse_order(response, market)
|
505
505
|
|
506
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
506
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
507
507
|
#
|
508
508
|
# createOrder
|
509
509
|
# {
|
@@ -622,7 +622,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
622
622
|
"""
|
623
623
|
await self.load_markets()
|
624
624
|
market = None
|
625
|
-
request = {}
|
625
|
+
request: dict = {}
|
626
626
|
if limit is not None:
|
627
627
|
request['take'] = limit
|
628
628
|
request['take'] = limit
|
@@ -680,7 +680,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
680
680
|
newString += strParts[i]
|
681
681
|
return newString
|
682
682
|
|
683
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
683
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
684
684
|
#
|
685
685
|
# public fetchTrades
|
686
686
|
#
|
@@ -789,7 +789,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
789
789
|
currency = self.currency(code)
|
790
790
|
if self.is_fiat(code):
|
791
791
|
raise NotSupported(self.id + ' fetchDepositAddress() does not support fiat currencies')
|
792
|
-
request = {
|
792
|
+
request: dict = {
|
793
793
|
'Coin': currency['id'],
|
794
794
|
}
|
795
795
|
response = await self.privatePostFundsAddCoinFundsRequest(self.extend(request, params))
|
ccxt/async_support/bitbank.py
CHANGED
@@ -303,7 +303,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
303
303
|
"""
|
304
304
|
await self.load_markets()
|
305
305
|
market = self.market(symbol)
|
306
|
-
request = {
|
306
|
+
request: dict = {
|
307
307
|
'pair': market['id'],
|
308
308
|
}
|
309
309
|
response = await self.publicGetPairTicker(self.extend(request, params))
|
@@ -321,7 +321,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
321
321
|
"""
|
322
322
|
await self.load_markets()
|
323
323
|
market = self.market(symbol)
|
324
|
-
request = {
|
324
|
+
request: dict = {
|
325
325
|
'pair': market['id'],
|
326
326
|
}
|
327
327
|
response = await self.publicGetPairDepth(self.extend(request, params))
|
@@ -329,7 +329,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
329
329
|
timestamp = self.safe_integer(orderbook, 'timestamp')
|
330
330
|
return self.parse_order_book(orderbook, market['symbol'], timestamp)
|
331
331
|
|
332
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
332
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
333
333
|
#
|
334
334
|
# fetchTrades
|
335
335
|
#
|
@@ -385,7 +385,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
385
385
|
"""
|
386
386
|
await self.load_markets()
|
387
387
|
market = self.market(symbol)
|
388
|
-
request = {
|
388
|
+
request: dict = {
|
389
389
|
'pair': market['id'],
|
390
390
|
}
|
391
391
|
response = await self.publicGetPairTransactions(self.extend(request, params))
|
@@ -432,7 +432,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
432
432
|
#
|
433
433
|
data = self.safe_value(response, 'data', {})
|
434
434
|
pairs = self.safe_value(data, 'pairs', [])
|
435
|
-
result = {}
|
435
|
+
result: dict = {}
|
436
436
|
for i in range(0, len(pairs)):
|
437
437
|
pair = pairs[i]
|
438
438
|
marketId = self.safe_string(pair, 'name')
|
@@ -486,7 +486,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
486
486
|
since = self.milliseconds() - duration * 1000 * limit
|
487
487
|
await self.load_markets()
|
488
488
|
market = self.market(symbol)
|
489
|
-
request = {
|
489
|
+
request: dict = {
|
490
490
|
'pair': market['id'],
|
491
491
|
'candletype': self.safe_string(self.timeframes, timeframe, timeframe),
|
492
492
|
'yyyymmdd': self.yyyymmdd(since, ''),
|
@@ -517,7 +517,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
517
517
|
return self.parse_ohlcvs(ohlcv, market, timeframe, since, limit)
|
518
518
|
|
519
519
|
def parse_balance(self, response) -> Balances:
|
520
|
-
result = {
|
520
|
+
result: dict = {
|
521
521
|
'info': response,
|
522
522
|
'timestamp': None,
|
523
523
|
'datetime': None,
|
@@ -579,8 +579,8 @@ class bitbank(Exchange, ImplicitAPI):
|
|
579
579
|
#
|
580
580
|
return self.parse_balance(response)
|
581
581
|
|
582
|
-
def parse_order_status(self, status):
|
583
|
-
statuses = {
|
582
|
+
def parse_order_status(self, status: Str):
|
583
|
+
statuses: dict = {
|
584
584
|
'UNFILLED': 'open',
|
585
585
|
'PARTIALLY_FILLED': 'open',
|
586
586
|
'FULLY_FILLED': 'closed',
|
@@ -589,7 +589,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
589
589
|
}
|
590
590
|
return self.safe_string(statuses, status, status)
|
591
591
|
|
592
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
592
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
593
593
|
id = self.safe_string(order, 'order_id')
|
594
594
|
marketId = self.safe_string(order, 'pair')
|
595
595
|
market = self.safe_market(marketId, market)
|
@@ -641,7 +641,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
641
641
|
"""
|
642
642
|
await self.load_markets()
|
643
643
|
market = self.market(symbol)
|
644
|
-
request = {
|
644
|
+
request: dict = {
|
645
645
|
'pair': market['id'],
|
646
646
|
'amount': self.amount_to_precision(symbol, amount),
|
647
647
|
'side': side,
|
@@ -664,7 +664,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
664
664
|
"""
|
665
665
|
await self.load_markets()
|
666
666
|
market = self.market(symbol)
|
667
|
-
request = {
|
667
|
+
request: dict = {
|
668
668
|
'order_id': id,
|
669
669
|
'pair': market['id'],
|
670
670
|
}
|
@@ -682,7 +682,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
682
682
|
"""
|
683
683
|
await self.load_markets()
|
684
684
|
market = self.market(symbol)
|
685
|
-
request = {
|
685
|
+
request: dict = {
|
686
686
|
'order_id': id,
|
687
687
|
'pair': market['id'],
|
688
688
|
}
|
@@ -702,7 +702,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
702
702
|
"""
|
703
703
|
await self.load_markets()
|
704
704
|
market = self.market(symbol)
|
705
|
-
request = {
|
705
|
+
request: dict = {
|
706
706
|
'pair': market['id'],
|
707
707
|
}
|
708
708
|
if limit is not None:
|
@@ -725,7 +725,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
725
725
|
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
726
726
|
"""
|
727
727
|
await self.load_markets()
|
728
|
-
request = {}
|
728
|
+
request: dict = {}
|
729
729
|
market = None
|
730
730
|
if symbol is not None:
|
731
731
|
market = self.market(symbol)
|
@@ -749,7 +749,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
749
749
|
"""
|
750
750
|
await self.load_markets()
|
751
751
|
currency = self.currency(code)
|
752
|
-
request = {
|
752
|
+
request: dict = {
|
753
753
|
'asset': currency['id'],
|
754
754
|
}
|
755
755
|
response = await self.privateGetUserWithdrawalAccount(self.extend(request, params))
|
@@ -782,7 +782,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
782
782
|
raise ExchangeError(self.id + ' uuid is required for withdrawal')
|
783
783
|
await self.load_markets()
|
784
784
|
currency = self.currency(code)
|
785
|
-
request = {
|
785
|
+
request: dict = {
|
786
786
|
'asset': currency['id'],
|
787
787
|
'amount': amount,
|
788
788
|
}
|
@@ -807,7 +807,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
807
807
|
data = self.safe_dict(response, 'data', {})
|
808
808
|
return self.parse_transaction(data, currency)
|
809
809
|
|
810
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
810
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
811
811
|
#
|
812
812
|
# withdraw
|
813
813
|
#
|
@@ -887,7 +887,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
887
887
|
success = self.safe_integer(response, 'success')
|
888
888
|
data = self.safe_value(response, 'data')
|
889
889
|
if not success or not data:
|
890
|
-
errorMessages = {
|
890
|
+
errorMessages: dict = {
|
891
891
|
'10000': 'URL does not exist',
|
892
892
|
'10001': 'A system error occurred. Please contact support',
|
893
893
|
'10002': 'Invalid JSON format. Please check the contents of transmission',
|
ccxt/async_support/bitbns.py
CHANGED
@@ -294,7 +294,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
294
294
|
"""
|
295
295
|
await self.load_markets()
|
296
296
|
market = self.market(symbol)
|
297
|
-
request = {
|
297
|
+
request: dict = {
|
298
298
|
'symbol': market['id'],
|
299
299
|
}
|
300
300
|
if limit is not None:
|
@@ -423,7 +423,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
423
423
|
|
424
424
|
def parse_balance(self, response) -> Balances:
|
425
425
|
timestamp = None
|
426
|
-
result = {
|
426
|
+
result: dict = {
|
427
427
|
'info': response,
|
428
428
|
'timestamp': timestamp,
|
429
429
|
'datetime': self.iso8601(timestamp),
|
@@ -474,7 +474,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
474
474
|
return self.parse_balance(response)
|
475
475
|
|
476
476
|
def parse_status(self, status):
|
477
|
-
statuses = {
|
477
|
+
statuses: dict = {
|
478
478
|
'-1': 'cancelled',
|
479
479
|
'0': 'open',
|
480
480
|
'1': 'open',
|
@@ -488,7 +488,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
488
488
|
}
|
489
489
|
return self.safe_string(statuses, status, status)
|
490
490
|
|
491
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
491
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
492
492
|
#
|
493
493
|
# createOrder
|
494
494
|
#
|
@@ -588,7 +588,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
588
588
|
targetRate = self.safe_string(params, 'target_rate')
|
589
589
|
trailRate = self.safe_string(params, 'trail_rate')
|
590
590
|
params = self.omit(params, ['triggerPrice', 'stopPrice', 'trail_rate', 'target_rate', 't_rate'])
|
591
|
-
request = {
|
591
|
+
request: dict = {
|
592
592
|
'side': side.upper(),
|
593
593
|
'symbol': market['uppercaseId'],
|
594
594
|
'quantity': self.amount_to_precision(symbol, amount),
|
@@ -637,7 +637,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
637
637
|
market = self.market(symbol)
|
638
638
|
isTrigger = self.safe_value_2(params, 'trigger', 'stop')
|
639
639
|
params = self.omit(params, ['trigger', 'stop'])
|
640
|
-
request = {
|
640
|
+
request: dict = {
|
641
641
|
'entry_id': id,
|
642
642
|
'symbol': market['uppercaseId'],
|
643
643
|
}
|
@@ -662,7 +662,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
662
662
|
raise ArgumentsRequired(self.id + ' fetchOrder() requires a symbol argument')
|
663
663
|
await self.load_markets()
|
664
664
|
market = self.market(symbol)
|
665
|
-
request = {
|
665
|
+
request: dict = {
|
666
666
|
'symbol': market['id'],
|
667
667
|
'entry_id': id,
|
668
668
|
}
|
@@ -718,7 +718,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
718
718
|
isTrigger = self.safe_value_2(params, 'trigger', 'stop')
|
719
719
|
params = self.omit(params, ['trigger', 'stop'])
|
720
720
|
quoteSide = 'usdtListOpen' if (market['quoteId'] == 'USDT') else 'listOpen'
|
721
|
-
request = {
|
721
|
+
request: dict = {
|
722
722
|
'symbol': market['uppercaseId'],
|
723
723
|
'page': 0,
|
724
724
|
'side': (quoteSide + 'StopOrders') if isTrigger else (quoteSide + 'Orders'),
|
@@ -747,7 +747,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
747
747
|
data = self.safe_list(response, 'data', [])
|
748
748
|
return self.parse_orders(data, market, since, limit)
|
749
749
|
|
750
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
750
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
751
751
|
#
|
752
752
|
# fetchMyTrades
|
753
753
|
#
|
@@ -836,7 +836,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
836
836
|
raise ArgumentsRequired(self.id + ' fetchMyTrades() requires a symbol argument')
|
837
837
|
await self.load_markets()
|
838
838
|
market = self.market(symbol)
|
839
|
-
request = {
|
839
|
+
request: dict = {
|
840
840
|
'symbol': market['id'],
|
841
841
|
'page': 0,
|
842
842
|
}
|
@@ -900,7 +900,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
900
900
|
raise ArgumentsRequired(self.id + ' fetchTrades() requires a symbol argument')
|
901
901
|
await self.load_markets()
|
902
902
|
market = self.market(symbol)
|
903
|
-
request = {
|
903
|
+
request: dict = {
|
904
904
|
'coin': market['baseId'],
|
905
905
|
'market': market['quoteId'],
|
906
906
|
}
|
@@ -927,7 +927,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
927
927
|
raise ArgumentsRequired(self.id + ' fetchDeposits() requires a currency code argument')
|
928
928
|
await self.load_markets()
|
929
929
|
currency = self.currency(code)
|
930
|
-
request = {
|
930
|
+
request: dict = {
|
931
931
|
'symbol': currency['id'],
|
932
932
|
'page': 0,
|
933
933
|
}
|
@@ -971,7 +971,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
971
971
|
raise ArgumentsRequired(self.id + ' fetchWithdrawals() requires a currency code argument')
|
972
972
|
await self.load_markets()
|
973
973
|
currency = self.currency(code)
|
974
|
-
request = {
|
974
|
+
request: dict = {
|
975
975
|
'symbol': currency['id'],
|
976
976
|
'page': 0,
|
977
977
|
}
|
@@ -983,7 +983,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
983
983
|
return self.parse_transactions(data, currency, since, limit)
|
984
984
|
|
985
985
|
def parse_transaction_status_by_type(self, status, type=None):
|
986
|
-
statusesByType = {
|
986
|
+
statusesByType: dict = {
|
987
987
|
'deposit': {
|
988
988
|
'0': 'pending',
|
989
989
|
'1': 'ok',
|
@@ -1001,7 +1001,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
1001
1001
|
statuses = self.safe_value(statusesByType, type, {})
|
1002
1002
|
return self.safe_string(statuses, status, status)
|
1003
1003
|
|
1004
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
1004
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
1005
1005
|
#
|
1006
1006
|
# fetchDeposits
|
1007
1007
|
#
|
@@ -1074,7 +1074,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
1074
1074
|
"""
|
1075
1075
|
await self.load_markets()
|
1076
1076
|
currency = self.currency(code)
|
1077
|
-
request = {
|
1077
|
+
request: dict = {
|
1078
1078
|
'symbol': currency['id'],
|
1079
1079
|
}
|
1080
1080
|
response = await self.v1PostGetCoinAddressSymbol(self.extend(request, params))
|
@@ -1124,7 +1124,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
1124
1124
|
body = self.json(query)
|
1125
1125
|
else:
|
1126
1126
|
body = '{}'
|
1127
|
-
auth = {
|
1127
|
+
auth: dict = {
|
1128
1128
|
'timeStamp_nonce': nonce,
|
1129
1129
|
'body': body,
|
1130
1130
|
}
|