ccxt 4.2.84__py2.py3-none-any.whl → 4.2.85__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/ace.py +5 -5
- ccxt/ascendex.py +8 -8
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +5 -5
- ccxt/async_support/ascendex.py +8 -8
- ccxt/async_support/base/exchange.py +3 -27
- ccxt/async_support/bigone.py +12 -12
- ccxt/async_support/binance.py +20 -32
- ccxt/async_support/bingx.py +12 -9
- ccxt/async_support/bit2c.py +1 -1
- ccxt/async_support/bitbank.py +8 -8
- ccxt/async_support/bitbns.py +5 -5
- ccxt/async_support/bitfinex.py +1 -1
- ccxt/async_support/bitfinex2.py +1 -1
- ccxt/async_support/bitget.py +29 -24
- ccxt/async_support/bithumb.py +5 -5
- ccxt/async_support/bitmart.py +16 -16
- ccxt/async_support/bitopro.py +1 -1
- ccxt/async_support/bitrue.py +4 -4
- ccxt/async_support/bitso.py +5 -5
- ccxt/async_support/bitstamp.py +1 -1
- ccxt/async_support/bitteam.py +8 -8
- ccxt/async_support/bl3p.py +1 -1
- ccxt/async_support/btcturk.py +6 -6
- ccxt/async_support/bybit.py +30 -83
- ccxt/async_support/coincheck.py +4 -4
- ccxt/async_support/coinex.py +11 -11
- ccxt/async_support/coinlist.py +7 -7
- ccxt/async_support/coinmate.py +4 -4
- ccxt/async_support/coinmetro.py +3 -3
- ccxt/async_support/coinone.py +5 -5
- ccxt/async_support/coinspot.py +2 -2
- ccxt/async_support/cryptocom.py +17 -17
- ccxt/async_support/currencycom.py +1 -1
- ccxt/async_support/delta.py +0 -8
- ccxt/async_support/deribit.py +16 -80
- ccxt/async_support/digifinex.py +8 -8
- ccxt/async_support/exmo.py +8 -8
- ccxt/async_support/gate.py +0 -8
- ccxt/async_support/hitbtc.py +5 -4
- ccxt/async_support/hollaex.py +7 -7
- ccxt/async_support/htx.py +7 -7
- ccxt/async_support/huobijp.py +3 -3
- ccxt/async_support/idex.py +2 -2
- ccxt/async_support/independentreserve.py +2 -2
- ccxt/async_support/indodax.py +2 -2
- ccxt/async_support/kraken.py +8 -8
- ccxt/async_support/krakenfutures.py +6 -6
- ccxt/async_support/kucoin.py +4 -1
- ccxt/async_support/kucoinfutures.py +8 -8
- ccxt/async_support/kuna.py +16 -16
- ccxt/async_support/latoken.py +2 -2
- ccxt/async_support/lbank.py +10 -10
- ccxt/async_support/luno.py +4 -4
- ccxt/async_support/mercado.py +5 -5
- ccxt/async_support/mexc.py +6 -6
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/novadax.py +9 -9
- ccxt/async_support/oceanex.py +7 -7
- ccxt/async_support/okcoin.py +13 -13
- ccxt/async_support/okx.py +23 -31
- ccxt/async_support/onetrading.py +4 -4
- ccxt/async_support/p2b.py +7 -7
- ccxt/async_support/phemex.py +12 -12
- ccxt/async_support/poloniexfutures.py +5 -5
- ccxt/async_support/probit.py +11 -11
- ccxt/async_support/timex.py +7 -7
- ccxt/async_support/tokocrypto.py +9 -9
- ccxt/async_support/wavesexchange.py +3 -3
- ccxt/async_support/whitebit.py +5 -5
- ccxt/async_support/woo.py +1 -1
- ccxt/async_support/zaif.py +1 -1
- ccxt/async_support/zonda.py +7 -7
- ccxt/base/exchange.py +66 -23
- ccxt/bigone.py +12 -12
- ccxt/binance.py +20 -32
- ccxt/bingx.py +12 -9
- ccxt/bit2c.py +1 -1
- ccxt/bitbank.py +8 -8
- ccxt/bitbns.py +5 -5
- ccxt/bitfinex.py +1 -1
- ccxt/bitfinex2.py +1 -1
- ccxt/bitget.py +29 -24
- ccxt/bithumb.py +5 -5
- ccxt/bitmart.py +16 -16
- ccxt/bitopro.py +1 -1
- ccxt/bitrue.py +4 -4
- ccxt/bitso.py +5 -5
- ccxt/bitstamp.py +1 -1
- ccxt/bitteam.py +8 -8
- ccxt/bl3p.py +1 -1
- ccxt/btcturk.py +6 -6
- ccxt/bybit.py +30 -83
- ccxt/coincheck.py +4 -4
- ccxt/coinex.py +11 -11
- ccxt/coinlist.py +7 -7
- ccxt/coinmate.py +4 -4
- ccxt/coinmetro.py +3 -3
- ccxt/coinone.py +5 -5
- ccxt/coinspot.py +2 -2
- ccxt/cryptocom.py +17 -17
- ccxt/currencycom.py +1 -1
- ccxt/delta.py +0 -8
- ccxt/deribit.py +16 -80
- ccxt/digifinex.py +8 -8
- ccxt/exmo.py +8 -8
- ccxt/gate.py +0 -8
- ccxt/hitbtc.py +5 -4
- ccxt/hollaex.py +7 -7
- ccxt/htx.py +7 -7
- ccxt/huobijp.py +3 -3
- ccxt/idex.py +2 -2
- ccxt/independentreserve.py +2 -2
- ccxt/indodax.py +2 -2
- ccxt/kraken.py +8 -8
- ccxt/krakenfutures.py +6 -6
- ccxt/kucoin.py +4 -1
- ccxt/kucoinfutures.py +8 -8
- ccxt/kuna.py +16 -16
- ccxt/latoken.py +2 -2
- ccxt/lbank.py +10 -10
- ccxt/luno.py +4 -4
- ccxt/mercado.py +5 -5
- ccxt/mexc.py +6 -6
- ccxt/ndax.py +1 -1
- ccxt/novadax.py +9 -9
- ccxt/oceanex.py +7 -7
- ccxt/okcoin.py +13 -13
- ccxt/okx.py +23 -31
- ccxt/onetrading.py +4 -4
- ccxt/p2b.py +7 -7
- ccxt/phemex.py +12 -12
- ccxt/poloniexfutures.py +5 -5
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binance.py +150 -112
- ccxt/pro/kucoin.py +6 -7
- ccxt/pro/okx.py +12 -1
- ccxt/probit.py +11 -11
- ccxt/timex.py +7 -7
- ccxt/tokocrypto.py +9 -9
- ccxt/wavesexchange.py +3 -3
- ccxt/whitebit.py +5 -5
- ccxt/woo.py +1 -1
- ccxt/zaif.py +1 -1
- ccxt/zonda.py +7 -7
- {ccxt-4.2.84.dist-info → ccxt-4.2.85.dist-info}/METADATA +4 -4
- {ccxt-4.2.84.dist-info → ccxt-4.2.85.dist-info}/RECORD +150 -150
- {ccxt-4.2.84.dist-info → ccxt-4.2.85.dist-info}/WHEEL +0 -0
- {ccxt-4.2.84.dist-info → ccxt-4.2.85.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/ace.py
CHANGED
@@ -395,7 +395,7 @@ class ace(Exchange, ImplicitAPI):
|
|
395
395
|
# "status": 200
|
396
396
|
# }
|
397
397
|
#
|
398
|
-
orderBook = self.
|
398
|
+
orderBook = self.safe_dict(response, 'attachment')
|
399
399
|
return self.parse_order_book(orderBook, market['symbol'], None, 'bids', 'asks')
|
400
400
|
|
401
401
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -602,7 +602,7 @@ class ace(Exchange, ImplicitAPI):
|
|
602
602
|
# "status": 200
|
603
603
|
# }
|
604
604
|
#
|
605
|
-
data = self.
|
605
|
+
data = self.safe_dict(response, 'attachment')
|
606
606
|
return self.parse_order(data, market)
|
607
607
|
|
608
608
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
@@ -664,7 +664,7 @@ class ace(Exchange, ImplicitAPI):
|
|
664
664
|
# "status": 200
|
665
665
|
# }
|
666
666
|
#
|
667
|
-
data = self.
|
667
|
+
data = self.safe_dict(response, 'attachment')
|
668
668
|
return self.parse_order(data, None)
|
669
669
|
|
670
670
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -847,7 +847,7 @@ class ace(Exchange, ImplicitAPI):
|
|
847
847
|
# }
|
848
848
|
#
|
849
849
|
data = self.safe_value(response, 'attachment')
|
850
|
-
trades = self.
|
850
|
+
trades = self.safe_list(data, 'trades', [])
|
851
851
|
return self.parse_trades(trades, market, since, limit)
|
852
852
|
|
853
853
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -902,7 +902,7 @@ class ace(Exchange, ImplicitAPI):
|
|
902
902
|
# "status": 200
|
903
903
|
# }
|
904
904
|
#
|
905
|
-
trades = self.
|
905
|
+
trades = self.safe_list(response, 'attachment', [])
|
906
906
|
return self.parse_trades(trades, market, since, limit)
|
907
907
|
|
908
908
|
def parse_balance(self, response) -> Balances:
|
ccxt/ascendex.py
CHANGED
@@ -1011,7 +1011,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1011
1011
|
# }
|
1012
1012
|
# }
|
1013
1013
|
#
|
1014
|
-
data = self.
|
1014
|
+
data = self.safe_dict(response, 'data', {})
|
1015
1015
|
return self.parse_ticker(data, market)
|
1016
1016
|
|
1017
1017
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
@@ -1138,7 +1138,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1138
1138
|
# ]
|
1139
1139
|
# }
|
1140
1140
|
#
|
1141
|
-
data = self.
|
1141
|
+
data = self.safe_list(response, 'data', [])
|
1142
1142
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
1143
1143
|
|
1144
1144
|
def parse_trade(self, trade, market: Market = None) -> Trade:
|
@@ -1208,7 +1208,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1208
1208
|
# }
|
1209
1209
|
#
|
1210
1210
|
records = self.safe_value(response, 'data', [])
|
1211
|
-
trades = self.
|
1211
|
+
trades = self.safe_list(records, 'data', [])
|
1212
1212
|
return self.parse_trades(trades, market, since, limit)
|
1213
1213
|
|
1214
1214
|
def parse_order_status(self, status):
|
@@ -1691,7 +1691,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1691
1691
|
# }
|
1692
1692
|
#
|
1693
1693
|
data = self.safe_value(response, 'data', {})
|
1694
|
-
info = self.
|
1694
|
+
info = self.safe_list(data, 'info', [])
|
1695
1695
|
return self.parse_orders(info, market)
|
1696
1696
|
|
1697
1697
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
@@ -1793,7 +1793,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1793
1793
|
# }
|
1794
1794
|
# }
|
1795
1795
|
#
|
1796
|
-
data = self.
|
1796
|
+
data = self.safe_dict(response, 'data', {})
|
1797
1797
|
return self.parse_order(data, market)
|
1798
1798
|
|
1799
1799
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -2433,7 +2433,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
2433
2433
|
# }
|
2434
2434
|
#
|
2435
2435
|
data = self.safe_value(response, 'data', {})
|
2436
|
-
transactions = self.
|
2436
|
+
transactions = self.safe_list(data, 'data', [])
|
2437
2437
|
return self.parse_transactions(transactions, currency, since, limit)
|
2438
2438
|
|
2439
2439
|
def parse_transaction_status(self, status):
|
@@ -2962,7 +2962,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
2962
2962
|
"""
|
2963
2963
|
self.load_markets()
|
2964
2964
|
response = self.v2PublicGetAssets(params)
|
2965
|
-
data = self.
|
2965
|
+
data = self.safe_list(response, 'data')
|
2966
2966
|
return self.parse_deposit_withdraw_fees(data, codes, 'assetCode')
|
2967
2967
|
|
2968
2968
|
def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
@@ -3078,7 +3078,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
3078
3078
|
# }
|
3079
3079
|
#
|
3080
3080
|
data = self.safe_value(response, 'data', {})
|
3081
|
-
rows = self.
|
3081
|
+
rows = self.safe_list(data, 'data', [])
|
3082
3082
|
return self.parse_incomes(rows, market, since, limit)
|
3083
3083
|
|
3084
3084
|
def parse_income(self, income, market: Market = None):
|
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/ace.py
CHANGED
@@ -395,7 +395,7 @@ class ace(Exchange, ImplicitAPI):
|
|
395
395
|
# "status": 200
|
396
396
|
# }
|
397
397
|
#
|
398
|
-
orderBook = self.
|
398
|
+
orderBook = self.safe_dict(response, 'attachment')
|
399
399
|
return self.parse_order_book(orderBook, market['symbol'], None, 'bids', 'asks')
|
400
400
|
|
401
401
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -602,7 +602,7 @@ class ace(Exchange, ImplicitAPI):
|
|
602
602
|
# "status": 200
|
603
603
|
# }
|
604
604
|
#
|
605
|
-
data = self.
|
605
|
+
data = self.safe_dict(response, 'attachment')
|
606
606
|
return self.parse_order(data, market)
|
607
607
|
|
608
608
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
@@ -664,7 +664,7 @@ class ace(Exchange, ImplicitAPI):
|
|
664
664
|
# "status": 200
|
665
665
|
# }
|
666
666
|
#
|
667
|
-
data = self.
|
667
|
+
data = self.safe_dict(response, 'attachment')
|
668
668
|
return self.parse_order(data, None)
|
669
669
|
|
670
670
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -847,7 +847,7 @@ class ace(Exchange, ImplicitAPI):
|
|
847
847
|
# }
|
848
848
|
#
|
849
849
|
data = self.safe_value(response, 'attachment')
|
850
|
-
trades = self.
|
850
|
+
trades = self.safe_list(data, 'trades', [])
|
851
851
|
return self.parse_trades(trades, market, since, limit)
|
852
852
|
|
853
853
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -902,7 +902,7 @@ class ace(Exchange, ImplicitAPI):
|
|
902
902
|
# "status": 200
|
903
903
|
# }
|
904
904
|
#
|
905
|
-
trades = self.
|
905
|
+
trades = self.safe_list(response, 'attachment', [])
|
906
906
|
return self.parse_trades(trades, market, since, limit)
|
907
907
|
|
908
908
|
def parse_balance(self, response) -> Balances:
|
ccxt/async_support/ascendex.py
CHANGED
@@ -1011,7 +1011,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1011
1011
|
# }
|
1012
1012
|
# }
|
1013
1013
|
#
|
1014
|
-
data = self.
|
1014
|
+
data = self.safe_dict(response, 'data', {})
|
1015
1015
|
return self.parse_ticker(data, market)
|
1016
1016
|
|
1017
1017
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
@@ -1138,7 +1138,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1138
1138
|
# ]
|
1139
1139
|
# }
|
1140
1140
|
#
|
1141
|
-
data = self.
|
1141
|
+
data = self.safe_list(response, 'data', [])
|
1142
1142
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
1143
1143
|
|
1144
1144
|
def parse_trade(self, trade, market: Market = None) -> Trade:
|
@@ -1208,7 +1208,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1208
1208
|
# }
|
1209
1209
|
#
|
1210
1210
|
records = self.safe_value(response, 'data', [])
|
1211
|
-
trades = self.
|
1211
|
+
trades = self.safe_list(records, 'data', [])
|
1212
1212
|
return self.parse_trades(trades, market, since, limit)
|
1213
1213
|
|
1214
1214
|
def parse_order_status(self, status):
|
@@ -1691,7 +1691,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1691
1691
|
# }
|
1692
1692
|
#
|
1693
1693
|
data = self.safe_value(response, 'data', {})
|
1694
|
-
info = self.
|
1694
|
+
info = self.safe_list(data, 'info', [])
|
1695
1695
|
return self.parse_orders(info, market)
|
1696
1696
|
|
1697
1697
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
@@ -1793,7 +1793,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
1793
1793
|
# }
|
1794
1794
|
# }
|
1795
1795
|
#
|
1796
|
-
data = self.
|
1796
|
+
data = self.safe_dict(response, 'data', {})
|
1797
1797
|
return self.parse_order(data, market)
|
1798
1798
|
|
1799
1799
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -2433,7 +2433,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
2433
2433
|
# }
|
2434
2434
|
#
|
2435
2435
|
data = self.safe_value(response, 'data', {})
|
2436
|
-
transactions = self.
|
2436
|
+
transactions = self.safe_list(data, 'data', [])
|
2437
2437
|
return self.parse_transactions(transactions, currency, since, limit)
|
2438
2438
|
|
2439
2439
|
def parse_transaction_status(self, status):
|
@@ -2962,7 +2962,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
2962
2962
|
"""
|
2963
2963
|
await self.load_markets()
|
2964
2964
|
response = await self.v2PublicGetAssets(params)
|
2965
|
-
data = self.
|
2965
|
+
data = self.safe_list(response, 'data')
|
2966
2966
|
return self.parse_deposit_withdraw_fees(data, codes, 'assetCode')
|
2967
2967
|
|
2968
2968
|
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
@@ -3078,7 +3078,7 @@ class ascendex(Exchange, ImplicitAPI):
|
|
3078
3078
|
# }
|
3079
3079
|
#
|
3080
3080
|
data = self.safe_value(response, 'data', {})
|
3081
|
-
rows = self.
|
3081
|
+
rows = self.safe_list(data, 'data', [])
|
3082
3082
|
return self.parse_incomes(rows, market, since, limit)
|
3083
3083
|
|
3084
3084
|
def parse_income(self, income, market: Market = None):
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# -----------------------------------------------------------------------------
|
4
4
|
|
5
|
-
__version__ = '4.2.
|
5
|
+
__version__ = '4.2.85'
|
6
6
|
|
7
7
|
# -----------------------------------------------------------------------------
|
8
8
|
|
@@ -16,7 +16,7 @@ import sys
|
|
16
16
|
import yarl
|
17
17
|
import math
|
18
18
|
from typing import Any, List
|
19
|
-
from ccxt.base.types import Int, Str, Num
|
19
|
+
from ccxt.base.types import Int, Str, Num, Strings
|
20
20
|
|
21
21
|
# -----------------------------------------------------------------------------
|
22
22
|
|
@@ -277,18 +277,6 @@ class Exchange(BaseExchange):
|
|
277
277
|
self.reloading_markets = False
|
278
278
|
return result
|
279
279
|
|
280
|
-
async def fetch_fees(self):
|
281
|
-
trading = {}
|
282
|
-
funding = {}
|
283
|
-
if self.has['fetchTradingFees']:
|
284
|
-
trading = await self.fetch_trading_fees()
|
285
|
-
if self.has['fetchFundingFees']:
|
286
|
-
funding = await self.fetch_funding_fees()
|
287
|
-
return {
|
288
|
-
'trading': trading,
|
289
|
-
'funding': funding,
|
290
|
-
}
|
291
|
-
|
292
280
|
async def load_fees(self, reload=False):
|
293
281
|
if not reload:
|
294
282
|
if self.loaded_fees != Exchange.loaded_fees:
|
@@ -910,18 +898,6 @@ class Exchange(BaseExchange):
|
|
910
898
|
async def fetch_status(self, params={}):
|
911
899
|
raise NotSupported(self.id + ' fetchStatus() is not supported yet')
|
912
900
|
|
913
|
-
async def fetch_funding_fee(self, code: str, params={}):
|
914
|
-
warnOnFetchFundingFee = self.safe_bool(self.options, 'warnOnFetchFundingFee', True)
|
915
|
-
if warnOnFetchFundingFee:
|
916
|
-
raise NotSupported(self.id + ' fetchFundingFee() method is deprecated, it will be removed in July 2022, please, use fetchTransactionFee() or set exchange.options["warnOnFetchFundingFee"] = False to suppress self warning')
|
917
|
-
return await self.fetch_transaction_fee(code, params)
|
918
|
-
|
919
|
-
async def fetch_funding_fees(self, codes: List[str] = None, params={}):
|
920
|
-
warnOnFetchFundingFees = self.safe_bool(self.options, 'warnOnFetchFundingFees', True)
|
921
|
-
if warnOnFetchFundingFees:
|
922
|
-
raise NotSupported(self.id + ' fetchFundingFees() method is deprecated, it will be removed in July 2022. Please, use fetchTransactionFees() or set exchange.options["warnOnFetchFundingFees"] = False to suppress self warning')
|
923
|
-
return await self.fetch_transaction_fees(codes, params)
|
924
|
-
|
925
901
|
async def fetch_transaction_fee(self, code: str, params={}):
|
926
902
|
if not self.has['fetchTransactionFees']:
|
927
903
|
raise NotSupported(self.id + ' fetchTransactionFee() is not supported yet')
|
@@ -982,7 +958,7 @@ class Exchange(BaseExchange):
|
|
982
958
|
async def fetch_order_books(self, symbols: List[str] = None, limit: Int = None, params={}):
|
983
959
|
raise NotSupported(self.id + ' fetchOrderBooks() is not supported yet')
|
984
960
|
|
985
|
-
async def watch_bids_asks(self, symbols:
|
961
|
+
async def watch_bids_asks(self, symbols: Strings = None, params={}):
|
986
962
|
raise NotSupported(self.id + ' watchBidsAsks() is not supported yet')
|
987
963
|
|
988
964
|
async def watch_tickers(self, symbols: List[str] = None, params={}):
|
ccxt/async_support/bigone.py
CHANGED
@@ -811,7 +811,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
811
811
|
# }
|
812
812
|
# }
|
813
813
|
#
|
814
|
-
ticker = self.
|
814
|
+
ticker = self.safe_dict(response, 'data', {})
|
815
815
|
return self.parse_ticker(ticker, market)
|
816
816
|
else:
|
817
817
|
tickers = await self.fetch_tickers([symbol], params)
|
@@ -984,7 +984,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
984
984
|
# }
|
985
985
|
# }
|
986
986
|
#
|
987
|
-
orderbook = self.
|
987
|
+
orderbook = self.safe_dict(response, 'data', {})
|
988
988
|
return self.parse_order_book(orderbook, market['symbol'], None, 'bids', 'asks', 'price', 'quantity')
|
989
989
|
|
990
990
|
def parse_contract_bids_asks(self, bidsAsks):
|
@@ -1172,7 +1172,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1172
1172
|
# ]
|
1173
1173
|
# }
|
1174
1174
|
#
|
1175
|
-
trades = self.
|
1175
|
+
trades = self.safe_list(response, 'data', [])
|
1176
1176
|
return self.parse_trades(trades, market, since, limit)
|
1177
1177
|
|
1178
1178
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -1246,7 +1246,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1246
1246
|
# ]
|
1247
1247
|
# }
|
1248
1248
|
#
|
1249
|
-
data = self.
|
1249
|
+
data = self.safe_list(response, 'data', [])
|
1250
1250
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
1251
1251
|
|
1252
1252
|
def parse_balance(self, response) -> Balances:
|
@@ -1484,7 +1484,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1484
1484
|
# "updated_at":"2019-01-29T06:05:56Z"
|
1485
1485
|
# }
|
1486
1486
|
#
|
1487
|
-
order = self.
|
1487
|
+
order = self.safe_dict(response, 'data')
|
1488
1488
|
return self.parse_order(order, market)
|
1489
1489
|
|
1490
1490
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
@@ -1511,7 +1511,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1511
1511
|
# "created_at":"2019-01-29T06:05:56Z",
|
1512
1512
|
# "updated_at":"2019-01-29T06:05:56Z"
|
1513
1513
|
# }
|
1514
|
-
order = self.
|
1514
|
+
order = self.safe_dict(response, 'data')
|
1515
1515
|
return self.parse_order(order)
|
1516
1516
|
|
1517
1517
|
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
@@ -1553,7 +1553,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1553
1553
|
await self.load_markets()
|
1554
1554
|
request = {'id': id}
|
1555
1555
|
response = await self.privateGetOrdersId(self.extend(request, params))
|
1556
|
-
order = self.
|
1556
|
+
order = self.safe_dict(response, 'data', {})
|
1557
1557
|
return self.parse_order(order)
|
1558
1558
|
|
1559
1559
|
async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -1600,7 +1600,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1600
1600
|
# "page_token":"dxzef",
|
1601
1601
|
# }
|
1602
1602
|
#
|
1603
|
-
orders = self.
|
1603
|
+
orders = self.safe_list(response, 'data', [])
|
1604
1604
|
return self.parse_orders(orders, market, since, limit)
|
1605
1605
|
|
1606
1606
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -1658,7 +1658,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1658
1658
|
# "page_token":"dxfv"
|
1659
1659
|
# }
|
1660
1660
|
#
|
1661
|
-
trades = self.
|
1661
|
+
trades = self.safe_list(response, 'data', [])
|
1662
1662
|
return self.parse_trades(trades, market, since, limit)
|
1663
1663
|
|
1664
1664
|
def parse_order_status(self, status):
|
@@ -1924,7 +1924,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1924
1924
|
# ]
|
1925
1925
|
# }
|
1926
1926
|
#
|
1927
|
-
deposits = self.
|
1927
|
+
deposits = self.safe_list(response, 'data', [])
|
1928
1928
|
return self.parse_transactions(deposits, currency, since, limit)
|
1929
1929
|
|
1930
1930
|
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -1972,7 +1972,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1972
1972
|
# "page_token":"dxvf"
|
1973
1973
|
# }
|
1974
1974
|
#
|
1975
|
-
withdrawals = self.
|
1975
|
+
withdrawals = self.safe_list(response, 'data', [])
|
1976
1976
|
return self.parse_transactions(withdrawals, currency, since, limit)
|
1977
1977
|
|
1978
1978
|
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
@@ -2092,7 +2092,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
2092
2092
|
# }
|
2093
2093
|
# }
|
2094
2094
|
#
|
2095
|
-
data = self.
|
2095
|
+
data = self.safe_dict(response, 'data', {})
|
2096
2096
|
return self.parse_transaction(data, currency)
|
2097
2097
|
|
2098
2098
|
def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
|
ccxt/async_support/binance.py
CHANGED
@@ -2441,14 +2441,6 @@ class binance(Exchange, ImplicitAPI):
|
|
2441
2441
|
super(binance, self).set_sandbox_mode(enable)
|
2442
2442
|
self.options['sandboxMode'] = enable
|
2443
2443
|
|
2444
|
-
def convert_expire_date(self, date):
|
2445
|
-
# parse YYMMDD to timestamp
|
2446
|
-
year = date[0:2]
|
2447
|
-
month = date[2:4]
|
2448
|
-
day = date[4:6]
|
2449
|
-
reconstructedDate = '20' + year + '-' + month + '-' + day + 'T00:00:00Z'
|
2450
|
-
return reconstructedDate
|
2451
|
-
|
2452
2444
|
def create_expired_option_market(self, symbol: str):
|
2453
2445
|
# support expired option contracts
|
2454
2446
|
settle = 'USDT'
|
@@ -3860,26 +3852,24 @@ class binance(Exchange, ImplicitAPI):
|
|
3860
3852
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
3861
3853
|
"""
|
3862
3854
|
await self.load_markets()
|
3863
|
-
symbols = self.market_symbols(symbols)
|
3864
|
-
market =
|
3865
|
-
if symbols is not None:
|
3866
|
-
first = self.safe_string(symbols, 0)
|
3867
|
-
market = self.market(first)
|
3855
|
+
symbols = self.market_symbols(symbols, None, True, True, True)
|
3856
|
+
market = self.get_market_from_symbols(symbols)
|
3868
3857
|
type = None
|
3858
|
+
type, params = self.handle_market_type_and_params('fetchBidsAsks', market, params)
|
3869
3859
|
subType = None
|
3870
3860
|
subType, params = self.handle_sub_type_and_params('fetchBidsAsks', market, params)
|
3871
|
-
type, params = self.handle_market_type_and_params('fetchBidsAsks', market, params)
|
3872
3861
|
response = None
|
3873
3862
|
if self.is_linear(type, subType):
|
3874
3863
|
response = await self.fapiPublicGetTickerBookTicker(params)
|
3875
3864
|
elif self.is_inverse(type, subType):
|
3876
3865
|
response = await self.dapiPublicGetTickerBookTicker(params)
|
3877
|
-
|
3866
|
+
elif type == 'spot':
|
3878
3867
|
request = {}
|
3879
3868
|
if symbols is not None:
|
3880
|
-
|
3881
|
-
request['symbols'] = self.json(marketIds)
|
3869
|
+
request['symbols'] = self.json(self.market_ids(symbols))
|
3882
3870
|
response = await self.publicGetTickerBookTicker(self.extend(request, params))
|
3871
|
+
else:
|
3872
|
+
raise NotSupported(self.id + ' fetchBidsAsks() does not support ' + type + ' markets yet')
|
3883
3873
|
return self.parse_tickers(response, symbols)
|
3884
3874
|
|
3885
3875
|
async def fetch_last_prices(self, symbols: Strings = None, params={}):
|
@@ -3894,12 +3884,12 @@ class binance(Exchange, ImplicitAPI):
|
|
3894
3884
|
:returns dict: a dictionary of lastprices structures
|
3895
3885
|
"""
|
3896
3886
|
await self.load_markets()
|
3897
|
-
symbols = self.market_symbols(symbols)
|
3887
|
+
symbols = self.market_symbols(symbols, None, True, True, True)
|
3898
3888
|
market = self.get_market_from_symbols(symbols)
|
3899
3889
|
type = None
|
3890
|
+
type, params = self.handle_market_type_and_params('fetchLastPrices', market, params)
|
3900
3891
|
subType = None
|
3901
3892
|
subType, params = self.handle_sub_type_and_params('fetchLastPrices', market, params)
|
3902
|
-
type, params = self.handle_market_type_and_params('fetchLastPrices', market, params)
|
3903
3893
|
response = None
|
3904
3894
|
if self.is_linear(type, subType):
|
3905
3895
|
response = await self.fapiPublicV2GetTickerPrice(params)
|
@@ -3994,28 +3984,26 @@ class binance(Exchange, ImplicitAPI):
|
|
3994
3984
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
3995
3985
|
"""
|
3996
3986
|
await self.load_markets()
|
3997
|
-
type = None
|
3998
|
-
market = None
|
3999
3987
|
symbols = self.market_symbols(symbols, None, True, True, True)
|
4000
|
-
|
4001
|
-
|
4002
|
-
market = self.market(first)
|
3988
|
+
market = self.get_market_from_symbols(symbols)
|
3989
|
+
type = None
|
4003
3990
|
type, params = self.handle_market_type_and_params('fetchTickers', market, params)
|
4004
3991
|
subType = None
|
4005
3992
|
subType, params = self.handle_sub_type_and_params('fetchTickers', market, params)
|
4006
3993
|
response = None
|
4007
|
-
if type
|
4008
|
-
response = await self.eapiPublicGetTicker(params)
|
4009
|
-
elif self.is_linear(type, subType):
|
3994
|
+
if self.is_linear(type, subType):
|
4010
3995
|
response = await self.fapiPublicGetTicker24hr(params)
|
4011
3996
|
elif self.is_inverse(type, subType):
|
4012
3997
|
response = await self.dapiPublicGetTicker24hr(params)
|
4013
|
-
|
3998
|
+
elif type == 'spot':
|
4014
3999
|
request = {}
|
4015
4000
|
if symbols is not None:
|
4016
|
-
|
4017
|
-
request['symbols'] = self.json(marketIds)
|
4001
|
+
request['symbols'] = self.json(self.market_ids(symbols))
|
4018
4002
|
response = await self.publicGetTicker24hr(self.extend(request, params))
|
4003
|
+
elif type == 'option':
|
4004
|
+
response = await self.eapiPublicGetTicker(params)
|
4005
|
+
else:
|
4006
|
+
raise NotSupported(self.id + ' fetchTickers() does not support ' + type + ' markets yet')
|
4019
4007
|
return self.parse_tickers(response, symbols)
|
4020
4008
|
|
4021
4009
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -4636,7 +4624,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4636
4624
|
# }
|
4637
4625
|
# }
|
4638
4626
|
#
|
4639
|
-
data = self.
|
4627
|
+
data = self.safe_dict(response, 'newOrderResponse')
|
4640
4628
|
return self.parse_order(data, market)
|
4641
4629
|
|
4642
4630
|
def edit_spot_order_request(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
@@ -11401,7 +11389,7 @@ class binance(Exchange, ImplicitAPI):
|
|
11401
11389
|
#
|
11402
11390
|
else:
|
11403
11391
|
raise BadRequest(self.id + ' fetchMarginModes() supports linear and inverse subTypes only')
|
11404
|
-
assets = self.
|
11392
|
+
assets = self.safe_list(response, 'positions', [])
|
11405
11393
|
return self.parse_margin_modes(assets, symbols, 'symbol', 'swap')
|
11406
11394
|
|
11407
11395
|
def parse_margin_mode(self, marginMode, market=None) -> MarginMode:
|
ccxt/async_support/bingx.py
CHANGED
@@ -1334,9 +1334,12 @@ class bingx(Exchange, ImplicitAPI):
|
|
1334
1334
|
response = await self.spotV1PublicGetTicker24hr(self.extend(request, params))
|
1335
1335
|
else:
|
1336
1336
|
response = await self.swapV2PublicGetQuoteTicker(self.extend(request, params))
|
1337
|
-
data = self.
|
1338
|
-
|
1339
|
-
|
1337
|
+
data = self.safe_list(response, 'data')
|
1338
|
+
if data is not None:
|
1339
|
+
first = self.safe_dict(data, 0, {})
|
1340
|
+
return self.parse_ticker(first, market)
|
1341
|
+
dataDict = self.safe_dict(response, 'data', {})
|
1342
|
+
return self.parse_ticker(dataDict, market)
|
1340
1343
|
|
1341
1344
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
1342
1345
|
"""
|
@@ -1360,7 +1363,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1360
1363
|
response = await self.spotV1PublicGetTicker24hr(params)
|
1361
1364
|
else:
|
1362
1365
|
response = await self.swapV2PublicGetQuoteTicker(params)
|
1363
|
-
tickers = self.
|
1366
|
+
tickers = self.safe_list(response, 'data')
|
1364
1367
|
return self.parse_tickers(tickers, symbols)
|
1365
1368
|
|
1366
1369
|
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
@@ -1939,7 +1942,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1939
1942
|
response = self.fix_stringified_json_members(response)
|
1940
1943
|
response = self.parse_json(response)
|
1941
1944
|
data = self.safe_value(response, 'data', {})
|
1942
|
-
order = self.
|
1945
|
+
order = self.safe_dict(data, 'order', data)
|
1943
1946
|
return self.parse_order(order, market)
|
1944
1947
|
|
1945
1948
|
async def create_orders(self, orders: List[OrderRequest], params={}):
|
@@ -2408,7 +2411,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
2408
2411
|
# }
|
2409
2412
|
#
|
2410
2413
|
data = self.safe_value(response, 'data')
|
2411
|
-
first = self.
|
2414
|
+
first = self.safe_dict(data, 'order', data)
|
2412
2415
|
return self.parse_order(first, market)
|
2413
2416
|
|
2414
2417
|
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
@@ -2633,7 +2636,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
2633
2636
|
# }
|
2634
2637
|
#
|
2635
2638
|
data = self.safe_value(response, 'data')
|
2636
|
-
first = self.
|
2639
|
+
first = self.safe_dict(data, 'order', data)
|
2637
2640
|
return self.parse_order(first, market)
|
2638
2641
|
|
2639
2642
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -2805,7 +2808,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
2805
2808
|
# }
|
2806
2809
|
#
|
2807
2810
|
data = self.safe_value(response, 'data', [])
|
2808
|
-
orders = self.
|
2811
|
+
orders = self.safe_list(data, 'orders', [])
|
2809
2812
|
return self.parse_orders(orders, market, since, limit)
|
2810
2813
|
|
2811
2814
|
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
@@ -3493,7 +3496,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
3493
3496
|
"""
|
3494
3497
|
await self.load_markets()
|
3495
3498
|
response = await self.walletsV1PrivateGetCapitalConfigGetall(params)
|
3496
|
-
coins = self.
|
3499
|
+
coins = self.safe_list(response, 'data')
|
3497
3500
|
return self.parse_deposit_withdraw_fees(coins, codes, 'coin')
|
3498
3501
|
|
3499
3502
|
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
ccxt/async_support/bit2c.py
CHANGED
@@ -470,7 +470,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
470
470
|
response = await self.privateGetOrderMyOrders(self.extend(request, params))
|
471
471
|
orders = self.safe_value(response, market['id'], {})
|
472
472
|
asks = self.safe_value(orders, 'ask', [])
|
473
|
-
bids = self.
|
473
|
+
bids = self.safe_list(orders, 'bid', [])
|
474
474
|
return self.parse_orders(self.array_concat(asks, bids), market, since, limit)
|
475
475
|
|
476
476
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|