ccxt 4.3.30__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/bigone.py +32 -32
- ccxt/async_support/binance.py +105 -96
- ccxt/async_support/bingx.py +21 -21
- 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 +168 -139
- 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 +37 -37
- 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 +35 -35
- ccxt/base/types.py +13 -0
- ccxt/bigone.py +32 -32
- ccxt/binance.py +105 -96
- ccxt/bingx.py +21 -21
- 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 +168 -139
- 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 +37 -37
- 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.30.dist-info → ccxt-4.3.31.dist-info}/METADATA +4 -4
- {ccxt-4.3.30.dist-info → ccxt-4.3.31.dist-info}/RECORD +258 -258
- {ccxt-4.3.30.dist-info → ccxt-4.3.31.dist-info}/WHEEL +0 -0
- {ccxt-4.3.30.dist-info → ccxt-4.3.31.dist-info}/top_level.txt +0 -0
ccxt/bingx.py
CHANGED
@@ -528,25 +528,25 @@ class bingx(Exchange, ImplicitAPI):
|
|
528
528
|
# }
|
529
529
|
#
|
530
530
|
data = self.safe_list(response, 'data', [])
|
531
|
-
result = {}
|
531
|
+
result: dict = {}
|
532
532
|
for i in range(0, len(data)):
|
533
533
|
entry = data[i]
|
534
534
|
currencyId = self.safe_string(entry, 'coin')
|
535
535
|
code = self.safe_currency_code(currencyId)
|
536
536
|
name = self.safe_string(entry, 'name')
|
537
537
|
networkList = self.safe_list(entry, 'networkList')
|
538
|
-
networks = {}
|
538
|
+
networks: dict = {}
|
539
539
|
fee = None
|
540
540
|
active = None
|
541
541
|
withdrawEnabled = None
|
542
|
-
defaultLimits = {}
|
542
|
+
defaultLimits: dict = {}
|
543
543
|
for j in range(0, len(networkList)):
|
544
544
|
rawNetwork = networkList[j]
|
545
545
|
network = self.safe_string(rawNetwork, 'network')
|
546
546
|
networkCode = self.network_id_to_code(network)
|
547
547
|
isDefault = self.safe_bool(rawNetwork, 'isDefault')
|
548
548
|
withdrawEnabled = self.safe_bool(rawNetwork, 'withdrawEnable')
|
549
|
-
limits = {
|
549
|
+
limits: dict = {
|
550
550
|
'amounts': {'min': self.safe_number(rawNetwork, 'withdrawMin'), 'max': self.safe_number(rawNetwork, 'withdrawMax')},
|
551
551
|
}
|
552
552
|
if isDefault:
|
@@ -928,7 +928,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
928
928
|
trades = self.safe_list(response, 'data', [])
|
929
929
|
return self.parse_trades(trades, market, since, limit)
|
930
930
|
|
931
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
931
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
932
932
|
#
|
933
933
|
# spot
|
934
934
|
# fetchTrades
|
@@ -1575,7 +1575,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1575
1575
|
def parse_balance(self, response) -> Balances:
|
1576
1576
|
data = self.safe_value(response, 'data')
|
1577
1577
|
balances = self.safe_value_2(data, 'balance', 'balances', data)
|
1578
|
-
result = {'info': response}
|
1578
|
+
result: dict = {'info': response}
|
1579
1579
|
if isinstance(balances, list):
|
1580
1580
|
for i in range(0, len(balances)):
|
1581
1581
|
balance = balances[i]
|
@@ -1638,7 +1638,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1638
1638
|
positions = self.safe_list(response, 'data', [])
|
1639
1639
|
return self.parse_positions(positions, symbols)
|
1640
1640
|
|
1641
|
-
def parse_position(self, position, market: Market = None):
|
1641
|
+
def parse_position(self, position: dict, market: Market = None):
|
1642
1642
|
#
|
1643
1643
|
# {
|
1644
1644
|
# "positionId":"1773122376147623936",
|
@@ -2078,7 +2078,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
2078
2078
|
return self.parse_orders(result, market)
|
2079
2079
|
|
2080
2080
|
def parse_order_side(self, side):
|
2081
|
-
sides = {
|
2081
|
+
sides: dict = {
|
2082
2082
|
'BUY': 'buy',
|
2083
2083
|
'SELL': 'sell',
|
2084
2084
|
'SHORT': 'sell',
|
@@ -2088,8 +2088,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
2088
2088
|
}
|
2089
2089
|
return self.safe_string(sides, side, side)
|
2090
2090
|
|
2091
|
-
def parse_order_type(self, type):
|
2092
|
-
types = {
|
2091
|
+
def parse_order_type(self, type: Str):
|
2092
|
+
types: dict = {
|
2093
2093
|
'trigger_market': 'market',
|
2094
2094
|
'trigger_limit': 'limit',
|
2095
2095
|
'stop_limit': 'limit',
|
@@ -2099,7 +2099,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
2099
2099
|
}
|
2100
2100
|
return self.safe_string(types, type, type)
|
2101
2101
|
|
2102
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
2102
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
2103
2103
|
#
|
2104
2104
|
# spot
|
2105
2105
|
# createOrder, createOrders, cancelOrder
|
@@ -2402,8 +2402,8 @@ class bingx(Exchange, ImplicitAPI):
|
|
2402
2402
|
'reduceOnly': self.safe_bool(order, 'reduceOnly'),
|
2403
2403
|
}, market)
|
2404
2404
|
|
2405
|
-
def parse_order_status(self, status):
|
2406
|
-
statuses = {
|
2405
|
+
def parse_order_status(self, status: Str):
|
2406
|
+
statuses: dict = {
|
2407
2407
|
'NEW': 'open',
|
2408
2408
|
'PENDING': 'open',
|
2409
2409
|
'PARTIALLY_FILLED': 'open',
|
@@ -2770,7 +2770,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
2770
2770
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
2771
2771
|
"""
|
2772
2772
|
self.load_markets()
|
2773
|
-
request = {}
|
2773
|
+
request: dict = {}
|
2774
2774
|
market = None
|
2775
2775
|
if symbol is not None:
|
2776
2776
|
market = self.market(symbol)
|
@@ -3301,7 +3301,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
3301
3301
|
#
|
3302
3302
|
return self.parse_transactions(response, currency, since, limit)
|
3303
3303
|
|
3304
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
3304
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
3305
3305
|
#
|
3306
3306
|
# fetchDeposits
|
3307
3307
|
#
|
@@ -3395,7 +3395,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
3395
3395
|
}
|
3396
3396
|
|
3397
3397
|
def parse_transaction_status(self, status: str):
|
3398
|
-
statuses = {
|
3398
|
+
statuses: dict = {
|
3399
3399
|
'0': 'pending',
|
3400
3400
|
'1': 'ok',
|
3401
3401
|
'10': 'pending',
|
@@ -3440,13 +3440,13 @@ class bingx(Exchange, ImplicitAPI):
|
|
3440
3440
|
return self.swapV2PrivatePostTradeMarginType(self.extend(request, params))
|
3441
3441
|
|
3442
3442
|
def add_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
3443
|
-
request = {
|
3443
|
+
request: dict = {
|
3444
3444
|
'type': 1,
|
3445
3445
|
}
|
3446
3446
|
return self.set_margin(symbol, amount, self.extend(request, params))
|
3447
3447
|
|
3448
3448
|
def reduce_margin(self, symbol: str, amount: float, params={}) -> MarginModification:
|
3449
|
-
request = {
|
3449
|
+
request: dict = {
|
3450
3450
|
'type': 2,
|
3451
3451
|
}
|
3452
3452
|
return self.set_margin(symbol, amount, self.extend(request, params))
|
@@ -3699,7 +3699,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
3699
3699
|
#
|
3700
3700
|
networkList = self.safe_list(fee, 'networkList', [])
|
3701
3701
|
networkListLength = len(networkList)
|
3702
|
-
result = {
|
3702
|
+
result: dict = {
|
3703
3703
|
'info': fee,
|
3704
3704
|
'withdraw': {
|
3705
3705
|
'fee': None,
|
@@ -3809,7 +3809,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
3809
3809
|
:returns dict: an array of `liquidation structures <https://docs.ccxt.com/#/?id=liquidation-structure>`
|
3810
3810
|
"""
|
3811
3811
|
self.load_markets()
|
3812
|
-
request = {
|
3812
|
+
request: dict = {
|
3813
3813
|
'autoCloseType': 'LIQUIDATION',
|
3814
3814
|
}
|
3815
3815
|
request, params = self.handle_until_option('endTime', request, params)
|
@@ -4208,7 +4208,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
4208
4208
|
data = self.safe_dict(response, 'data', {})
|
4209
4209
|
return self.parse_margin_mode(data, market)
|
4210
4210
|
|
4211
|
-
def parse_margin_mode(self, marginMode, market=None) -> MarginMode:
|
4211
|
+
def parse_margin_mode(self, marginMode: dict, market=None) -> MarginMode:
|
4212
4212
|
marginType = self.safe_string_lower(marginMode, 'marginType')
|
4213
4213
|
marginType = 'cross' if (marginType == 'crossed') else marginType
|
4214
4214
|
return {
|
ccxt/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
|
self.load_markets()
|
275
275
|
market = self.market(symbol)
|
276
|
-
request = {
|
276
|
+
request: dict = {
|
277
277
|
'pair': market['id'],
|
278
278
|
}
|
279
279
|
orderbook = self.publicGetExchangesPairOrderbook(self.extend(request, params))
|
@@ -317,7 +317,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
317
317
|
"""
|
318
318
|
self.load_markets()
|
319
319
|
market = self.market(symbol)
|
320
|
-
request = {
|
320
|
+
request: dict = {
|
321
321
|
'pair': market['id'],
|
322
322
|
}
|
323
323
|
response = self.publicGetExchangesPairTicker(self.extend(request, params))
|
@@ -337,7 +337,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
337
337
|
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
|
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 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
|
self.load_markets()
|
466
466
|
market = self.market(symbol)
|
467
|
-
request = {
|
467
|
+
request: dict = {
|
468
468
|
'pair': market['id'],
|
469
469
|
}
|
470
470
|
response = self.privateGetOrderMyOrders(self.extend(request, params))
|
@@ -483,7 +483,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
483
483
|
"""
|
484
484
|
self.load_markets()
|
485
485
|
market = self.market(symbol)
|
486
|
-
request = {
|
486
|
+
request: dict = {
|
487
487
|
'id': id,
|
488
488
|
}
|
489
489
|
response = 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
|
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 = self.privatePostFundsAddCoinFundsRequest(self.extend(request, params))
|
ccxt/bitbank.py
CHANGED
@@ -303,7 +303,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
303
303
|
"""
|
304
304
|
self.load_markets()
|
305
305
|
market = self.market(symbol)
|
306
|
-
request = {
|
306
|
+
request: dict = {
|
307
307
|
'pair': market['id'],
|
308
308
|
}
|
309
309
|
response = self.publicGetPairTicker(self.extend(request, params))
|
@@ -321,7 +321,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
321
321
|
"""
|
322
322
|
self.load_markets()
|
323
323
|
market = self.market(symbol)
|
324
|
-
request = {
|
324
|
+
request: dict = {
|
325
325
|
'pair': market['id'],
|
326
326
|
}
|
327
327
|
response = 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
|
self.load_markets()
|
387
387
|
market = self.market(symbol)
|
388
|
-
request = {
|
388
|
+
request: dict = {
|
389
389
|
'pair': market['id'],
|
390
390
|
}
|
391
391
|
response = 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
|
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
|
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
|
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
|
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
|
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
|
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
|
self.load_markets()
|
751
751
|
currency = self.currency(code)
|
752
|
-
request = {
|
752
|
+
request: dict = {
|
753
753
|
'asset': currency['id'],
|
754
754
|
}
|
755
755
|
response = 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
|
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/bitbns.py
CHANGED
@@ -294,7 +294,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
294
294
|
"""
|
295
295
|
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
|
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
|
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
|
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
|
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
|
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
|
self.load_markets()
|
1076
1076
|
currency = self.currency(code)
|
1077
|
-
request = {
|
1077
|
+
request: dict = {
|
1078
1078
|
'symbol': currency['id'],
|
1079
1079
|
}
|
1080
1080
|
response = 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
|
}
|