ccxt 4.2.83__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/abstract/bybit.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 +39 -28
- 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 +34 -87
- ccxt/async_support/coincheck.py +4 -4
- ccxt/async_support/coinex.py +12 -13
- 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 +12 -34
- 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 +14 -2
- 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 +39 -28
- 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 +34 -87
- ccxt/coincheck.py +4 -4
- ccxt/coinex.py +12 -13
- 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 +12 -34
- 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 +14 -2
- 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/test/base/test_market.py +3 -0
- 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.83.dist-info → ccxt-4.2.85.dist-info}/METADATA +4 -4
- {ccxt-4.2.83.dist-info → ccxt-4.2.85.dist-info}/RECORD +152 -152
- {ccxt-4.2.83.dist-info → ccxt-4.2.85.dist-info}/WHEEL +0 -0
- {ccxt-4.2.83.dist-info → ccxt-4.2.85.dist-info}/top_level.txt +0 -0
ccxt/async_support/tokocrypto.py
CHANGED
@@ -1203,7 +1203,7 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1203
1203
|
}
|
1204
1204
|
response = await self.binanceGetTicker24hr(self.extend(request, params))
|
1205
1205
|
if isinstance(response, list):
|
1206
|
-
firstTicker = self.
|
1206
|
+
firstTicker = self.safe_dict(response, 0, {})
|
1207
1207
|
return self.parse_ticker(firstTicker, market)
|
1208
1208
|
return self.parse_ticker(response, market)
|
1209
1209
|
|
@@ -1311,7 +1311,7 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1311
1311
|
# [1591478640000,"0.02500800","0.02501100","0.02500300","0.02500800","154.14200000",1591478699999,"3.85405839",97,"5.32300000","0.13312641","0"],
|
1312
1312
|
# ]
|
1313
1313
|
#
|
1314
|
-
data = self.
|
1314
|
+
data = self.safe_list(response, 'data', response)
|
1315
1315
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
1316
1316
|
|
1317
1317
|
async def fetch_balance(self, params={}) -> Balances:
|
@@ -1712,7 +1712,7 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1712
1712
|
# "timestamp": 1662710994975
|
1713
1713
|
# }
|
1714
1714
|
#
|
1715
|
-
rawOrder = self.
|
1715
|
+
rawOrder = self.safe_dict(response, 'data', {})
|
1716
1716
|
return self.parse_order(rawOrder, market)
|
1717
1717
|
|
1718
1718
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
@@ -1759,7 +1759,7 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1759
1759
|
#
|
1760
1760
|
data = self.safe_value(response, 'data', {})
|
1761
1761
|
list = self.safe_value(data, 'list', [])
|
1762
|
-
rawOrder = self.
|
1762
|
+
rawOrder = self.safe_dict(list, 0, {})
|
1763
1763
|
return self.parse_order(rawOrder)
|
1764
1764
|
|
1765
1765
|
async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -1825,7 +1825,7 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1825
1825
|
# }
|
1826
1826
|
#
|
1827
1827
|
data = self.safe_value(response, 'data', {})
|
1828
|
-
orders = self.
|
1828
|
+
orders = self.safe_list(data, 'list', [])
|
1829
1829
|
return self.parse_orders(orders, market, since, limit)
|
1830
1830
|
|
1831
1831
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -1894,7 +1894,7 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1894
1894
|
# "timestamp": 1662710683634
|
1895
1895
|
# }
|
1896
1896
|
#
|
1897
|
-
rawOrder = self.
|
1897
|
+
rawOrder = self.safe_dict(response, 'data', {})
|
1898
1898
|
return self.parse_order(rawOrder)
|
1899
1899
|
|
1900
1900
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -1949,7 +1949,7 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
1949
1949
|
# }
|
1950
1950
|
#
|
1951
1951
|
data = self.safe_value(response, 'data', {})
|
1952
|
-
trades = self.
|
1952
|
+
trades = self.safe_list(data, 'list', [])
|
1953
1953
|
return self.parse_trades(trades, market, since, limit)
|
1954
1954
|
|
1955
1955
|
async def fetch_deposit_address(self, code: str, params={}):
|
@@ -2056,7 +2056,7 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
2056
2056
|
# }
|
2057
2057
|
#
|
2058
2058
|
data = self.safe_value(response, 'data', {})
|
2059
|
-
deposits = self.
|
2059
|
+
deposits = self.safe_list(data, 'list', [])
|
2060
2060
|
return self.parse_transactions(deposits, currency, since, limit)
|
2061
2061
|
|
2062
2062
|
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -2108,7 +2108,7 @@ class tokocrypto(Exchange, ImplicitAPI):
|
|
2108
2108
|
# }
|
2109
2109
|
#
|
2110
2110
|
data = self.safe_value(response, 'data', {})
|
2111
|
-
withdrawals = self.
|
2111
|
+
withdrawals = self.safe_list(data, 'list', [])
|
2112
2112
|
return self.parse_transactions(withdrawals, currency, since, limit)
|
2113
2113
|
|
2114
2114
|
def parse_transaction_status_by_type(self, status, type=None):
|
@@ -861,7 +861,7 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
861
861
|
#
|
862
862
|
data = self.safe_value(response, 'data', [])
|
863
863
|
ticker = self.safe_value(data, 0, {})
|
864
|
-
dataTicker = self.
|
864
|
+
dataTicker = self.safe_dict(ticker, 'data', {})
|
865
865
|
return self.parse_ticker(dataTicker, market)
|
866
866
|
|
867
867
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
@@ -1386,11 +1386,11 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
1386
1386
|
#
|
1387
1387
|
if isMarketOrder:
|
1388
1388
|
response = await self.matcherPostMatcherOrderbookMarket(body)
|
1389
|
-
value = self.
|
1389
|
+
value = self.safe_dict(response, 'message')
|
1390
1390
|
return self.parse_order(value, market)
|
1391
1391
|
else:
|
1392
1392
|
response = await self.matcherPostMatcherOrderbook(body)
|
1393
|
-
value = self.
|
1393
|
+
value = self.safe_dict(response, 'message')
|
1394
1394
|
return self.parse_order(value, market)
|
1395
1395
|
|
1396
1396
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
ccxt/async_support/whitebit.py
CHANGED
@@ -728,7 +728,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
728
728
|
# },
|
729
729
|
# }
|
730
730
|
#
|
731
|
-
ticker = self.
|
731
|
+
ticker = self.safe_dict(response, 'result', {})
|
732
732
|
return self.parse_ticker(ticker, market)
|
733
733
|
|
734
734
|
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
@@ -1069,7 +1069,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1069
1069
|
# ]
|
1070
1070
|
# }
|
1071
1071
|
#
|
1072
|
-
result = self.
|
1072
|
+
result = self.safe_list(response, 'result', [])
|
1073
1073
|
return self.parse_ohlcvs(result, market, timeframe, since, limit)
|
1074
1074
|
|
1075
1075
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -1523,7 +1523,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1523
1523
|
# "limit": 100
|
1524
1524
|
# }
|
1525
1525
|
#
|
1526
|
-
data = self.
|
1526
|
+
data = self.safe_list(response, 'records', [])
|
1527
1527
|
return self.parse_trades(data, market)
|
1528
1528
|
|
1529
1529
|
async def fetch_deposit_address(self, code: str, params={}):
|
@@ -1842,7 +1842,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1842
1842
|
# }
|
1843
1843
|
#
|
1844
1844
|
records = self.safe_value(response, 'records', [])
|
1845
|
-
first = self.
|
1845
|
+
first = self.safe_dict(records, 0, {})
|
1846
1846
|
return self.parse_transaction(first, currency)
|
1847
1847
|
|
1848
1848
|
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -1905,7 +1905,7 @@ class whitebit(Exchange, ImplicitAPI):
|
|
1905
1905
|
# "total": 300 # total number of transactions, use self for calculating ‘limit’ and ‘offset'
|
1906
1906
|
# }
|
1907
1907
|
#
|
1908
|
-
records = self.
|
1908
|
+
records = self.safe_list(response, 'records', [])
|
1909
1909
|
return self.parse_transactions(records, currency, since, limit)
|
1910
1910
|
|
1911
1911
|
async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
ccxt/async_support/woo.py
CHANGED
@@ -1258,7 +1258,7 @@ class woo(Exchange, ImplicitAPI):
|
|
1258
1258
|
# ]
|
1259
1259
|
# }
|
1260
1260
|
#
|
1261
|
-
orders = self.
|
1261
|
+
orders = self.safe_dict(response, 'data', response)
|
1262
1262
|
return self.parse_order(orders, market)
|
1263
1263
|
|
1264
1264
|
async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
ccxt/async_support/zaif.py
CHANGED
@@ -600,7 +600,7 @@ class zaif(Exchange, ImplicitAPI):
|
|
600
600
|
# }
|
601
601
|
# }
|
602
602
|
#
|
603
|
-
returnData = self.
|
603
|
+
returnData = self.safe_dict(result, 'return')
|
604
604
|
return self.parse_transaction(returnData, currency)
|
605
605
|
|
606
606
|
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
ccxt/async_support/zonda.py
CHANGED
@@ -421,7 +421,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
421
421
|
await self.load_markets()
|
422
422
|
request = {}
|
423
423
|
response = await self.v1_01PrivateGetTradingOffer(self.extend(request, params))
|
424
|
-
items = self.
|
424
|
+
items = self.safe_list(response, 'items', [])
|
425
425
|
return self.parse_orders(items, None, since, limit, {'status': 'open'})
|
426
426
|
|
427
427
|
def parse_order(self, order, market: Market = None) -> Order:
|
@@ -788,7 +788,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
788
788
|
#
|
789
789
|
else:
|
790
790
|
raise BadRequest(self.id + ' fetchTickers params["method"] must be "v1_01PublicGetTradingTicker" or "v1_01PublicGetTradingStats"')
|
791
|
-
items = self.
|
791
|
+
items = self.safe_dict(response, 'items')
|
792
792
|
return self.parse_tickers(items, symbols)
|
793
793
|
|
794
794
|
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -1200,7 +1200,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1200
1200
|
# ]
|
1201
1201
|
# }
|
1202
1202
|
#
|
1203
|
-
items = self.
|
1203
|
+
items = self.safe_list(response, 'items', [])
|
1204
1204
|
return self.parse_ohlcvs(items, market, timeframe, since, limit)
|
1205
1205
|
|
1206
1206
|
def parse_trade(self, trade, market: Market = None) -> Trade:
|
@@ -1298,7 +1298,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1298
1298
|
if limit is not None:
|
1299
1299
|
request['limit'] = limit # default - 10, max - 300
|
1300
1300
|
response = await self.v1_01PublicGetTradingTransactionsSymbol(self.extend(request, params))
|
1301
|
-
items = self.
|
1301
|
+
items = self.safe_list(response, 'items')
|
1302
1302
|
return self.parse_trades(items, market, since, limit)
|
1303
1303
|
|
1304
1304
|
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
@@ -1509,7 +1509,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1509
1509
|
# }
|
1510
1510
|
#
|
1511
1511
|
data = self.safe_value(response, 'data')
|
1512
|
-
first = self.
|
1512
|
+
first = self.safe_dict(data, 0)
|
1513
1513
|
return self.parse_deposit_address(first, currency)
|
1514
1514
|
|
1515
1515
|
async def fetch_deposit_addresses(self, codes: List[str] = None, params={}):
|
@@ -1535,7 +1535,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1535
1535
|
# ]
|
1536
1536
|
# }
|
1537
1537
|
#
|
1538
|
-
data = self.
|
1538
|
+
data = self.safe_list(response, 'data')
|
1539
1539
|
return self.parse_deposit_addresses(data, codes)
|
1540
1540
|
|
1541
1541
|
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
@@ -1684,7 +1684,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1684
1684
|
# }
|
1685
1685
|
# }
|
1686
1686
|
#
|
1687
|
-
data = self.
|
1687
|
+
data = self.safe_dict(response, 'data')
|
1688
1688
|
return self.parse_transaction(data, currency)
|
1689
1689
|
|
1690
1690
|
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.2.
|
7
|
+
__version__ = '4.2.85'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -321,8 +321,6 @@ class Exchange(object):
|
|
321
321
|
'fetchDepositAddresses': None,
|
322
322
|
'fetchDepositAddressesByNetwork': None,
|
323
323
|
'fetchDeposits': None,
|
324
|
-
'fetchFundingFee': None,
|
325
|
-
'fetchFundingFees': None,
|
326
324
|
'fetchFundingHistory': None,
|
327
325
|
'fetchFundingRate': None,
|
328
326
|
'fetchFundingRateHistory': None,
|
@@ -1497,13 +1495,6 @@ class Exchange(object):
|
|
1497
1495
|
markets = self.fetch_markets(params)
|
1498
1496
|
return self.set_markets(markets, currencies)
|
1499
1497
|
|
1500
|
-
def load_fees(self, reload=False):
|
1501
|
-
if not reload:
|
1502
|
-
if self.loaded_fees != Exchange.loaded_fees:
|
1503
|
-
return self.loaded_fees
|
1504
|
-
self.loaded_fees = self.deep_extend(self.loaded_fees, self.fetch_fees())
|
1505
|
-
return self.loaded_fees
|
1506
|
-
|
1507
1498
|
def fetch_markets(self, params={}):
|
1508
1499
|
# markets are returned as a list
|
1509
1500
|
# currencies are returned as a dict
|
@@ -3834,18 +3825,6 @@ class Exchange(object):
|
|
3834
3825
|
def fetch_status(self, params={}):
|
3835
3826
|
raise NotSupported(self.id + ' fetchStatus() is not supported yet')
|
3836
3827
|
|
3837
|
-
def fetch_funding_fee(self, code: str, params={}):
|
3838
|
-
warnOnFetchFundingFee = self.safe_bool(self.options, 'warnOnFetchFundingFee', True)
|
3839
|
-
if warnOnFetchFundingFee:
|
3840
|
-
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')
|
3841
|
-
return self.fetch_transaction_fee(code, params)
|
3842
|
-
|
3843
|
-
def fetch_funding_fees(self, codes: List[str] = None, params={}):
|
3844
|
-
warnOnFetchFundingFees = self.safe_bool(self.options, 'warnOnFetchFundingFees', True)
|
3845
|
-
if warnOnFetchFundingFees:
|
3846
|
-
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')
|
3847
|
-
return self.fetch_transaction_fees(codes, params)
|
3848
|
-
|
3849
3828
|
def fetch_transaction_fee(self, code: str, params={}):
|
3850
3829
|
if not self.has['fetchTransactionFees']:
|
3851
3830
|
raise NotSupported(self.id + ' fetchTransactionFee() is not supported yet')
|
@@ -4031,7 +4010,7 @@ class Exchange(object):
|
|
4031
4010
|
def fetch_order_books(self, symbols: List[str] = None, limit: Int = None, params={}):
|
4032
4011
|
raise NotSupported(self.id + ' fetchOrderBooks() is not supported yet')
|
4033
4012
|
|
4034
|
-
def watch_bids_asks(self, symbols:
|
4013
|
+
def watch_bids_asks(self, symbols: Strings = None, params={}):
|
4035
4014
|
raise NotSupported(self.id + ' watchBidsAsks() is not supported yet')
|
4036
4015
|
|
4037
4016
|
def watch_tickers(self, symbols: List[str] = None, params={}):
|
@@ -5378,3 +5357,67 @@ class Exchange(object):
|
|
5378
5357
|
|
5379
5358
|
def parse_leverage(self, leverage, market: Market = None):
|
5380
5359
|
raise NotSupported(self.id + ' parseLeverage() is not supported yet')
|
5360
|
+
|
5361
|
+
def convert_expire_date(self, date: str):
|
5362
|
+
# parse YYMMDD to datetime string
|
5363
|
+
year = date[0:2]
|
5364
|
+
month = date[2:4]
|
5365
|
+
day = date[4:6]
|
5366
|
+
reconstructedDate = '20' + year + '-' + month + '-' + day + 'T00:00:00Z'
|
5367
|
+
return reconstructedDate
|
5368
|
+
|
5369
|
+
def convert_expire_date_to_market_id_date(self, date: str):
|
5370
|
+
# parse 240119 to 19JAN24
|
5371
|
+
year = date[0:2]
|
5372
|
+
monthRaw = date[2:4]
|
5373
|
+
month = None
|
5374
|
+
day = date[4:6]
|
5375
|
+
if monthRaw == '01':
|
5376
|
+
month = 'JAN'
|
5377
|
+
elif monthRaw == '02':
|
5378
|
+
month = 'FEB'
|
5379
|
+
elif monthRaw == '03':
|
5380
|
+
month = 'MAR'
|
5381
|
+
elif monthRaw == '04':
|
5382
|
+
month = 'APR'
|
5383
|
+
elif monthRaw == '05':
|
5384
|
+
month = 'MAY'
|
5385
|
+
elif monthRaw == '06':
|
5386
|
+
month = 'JUN'
|
5387
|
+
elif monthRaw == '07':
|
5388
|
+
month = 'JUL'
|
5389
|
+
elif monthRaw == '08':
|
5390
|
+
month = 'AUG'
|
5391
|
+
elif monthRaw == '09':
|
5392
|
+
month = 'SEP'
|
5393
|
+
elif monthRaw == '10':
|
5394
|
+
month = 'OCT'
|
5395
|
+
elif monthRaw == '11':
|
5396
|
+
month = 'NOV'
|
5397
|
+
elif monthRaw == '12':
|
5398
|
+
month = 'DEC'
|
5399
|
+
reconstructedDate = day + month + year
|
5400
|
+
return reconstructedDate
|
5401
|
+
|
5402
|
+
def convert_market_id_expire_date(self, date: str):
|
5403
|
+
# parse 19JAN24 to 240119
|
5404
|
+
monthMappping = {
|
5405
|
+
'JAN': '01',
|
5406
|
+
'FEB': '02',
|
5407
|
+
'MAR': '03',
|
5408
|
+
'APR': '04',
|
5409
|
+
'MAY': '05',
|
5410
|
+
'JUN': '06',
|
5411
|
+
'JUL': '07',
|
5412
|
+
'AUG': '08',
|
5413
|
+
'SEP': '09',
|
5414
|
+
'OCT': '10',
|
5415
|
+
'NOV': '11',
|
5416
|
+
'DEC': '12',
|
5417
|
+
}
|
5418
|
+
year = date[0:2]
|
5419
|
+
monthName = date[2:5]
|
5420
|
+
month = self.safe_string(monthMappping, monthName)
|
5421
|
+
day = date[5:7]
|
5422
|
+
reconstructedDate = day + month + year
|
5423
|
+
return reconstructedDate
|
ccxt/bigone.py
CHANGED
@@ -810,7 +810,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
810
810
|
# }
|
811
811
|
# }
|
812
812
|
#
|
813
|
-
ticker = self.
|
813
|
+
ticker = self.safe_dict(response, 'data', {})
|
814
814
|
return self.parse_ticker(ticker, market)
|
815
815
|
else:
|
816
816
|
tickers = self.fetch_tickers([symbol], params)
|
@@ -983,7 +983,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
983
983
|
# }
|
984
984
|
# }
|
985
985
|
#
|
986
|
-
orderbook = self.
|
986
|
+
orderbook = self.safe_dict(response, 'data', {})
|
987
987
|
return self.parse_order_book(orderbook, market['symbol'], None, 'bids', 'asks', 'price', 'quantity')
|
988
988
|
|
989
989
|
def parse_contract_bids_asks(self, bidsAsks):
|
@@ -1171,7 +1171,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1171
1171
|
# ]
|
1172
1172
|
# }
|
1173
1173
|
#
|
1174
|
-
trades = self.
|
1174
|
+
trades = self.safe_list(response, 'data', [])
|
1175
1175
|
return self.parse_trades(trades, market, since, limit)
|
1176
1176
|
|
1177
1177
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -1245,7 +1245,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1245
1245
|
# ]
|
1246
1246
|
# }
|
1247
1247
|
#
|
1248
|
-
data = self.
|
1248
|
+
data = self.safe_list(response, 'data', [])
|
1249
1249
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
1250
1250
|
|
1251
1251
|
def parse_balance(self, response) -> Balances:
|
@@ -1483,7 +1483,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1483
1483
|
# "updated_at":"2019-01-29T06:05:56Z"
|
1484
1484
|
# }
|
1485
1485
|
#
|
1486
|
-
order = self.
|
1486
|
+
order = self.safe_dict(response, 'data')
|
1487
1487
|
return self.parse_order(order, market)
|
1488
1488
|
|
1489
1489
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
@@ -1510,7 +1510,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1510
1510
|
# "created_at":"2019-01-29T06:05:56Z",
|
1511
1511
|
# "updated_at":"2019-01-29T06:05:56Z"
|
1512
1512
|
# }
|
1513
|
-
order = self.
|
1513
|
+
order = self.safe_dict(response, 'data')
|
1514
1514
|
return self.parse_order(order)
|
1515
1515
|
|
1516
1516
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
@@ -1552,7 +1552,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1552
1552
|
self.load_markets()
|
1553
1553
|
request = {'id': id}
|
1554
1554
|
response = self.privateGetOrdersId(self.extend(request, params))
|
1555
|
-
order = self.
|
1555
|
+
order = self.safe_dict(response, 'data', {})
|
1556
1556
|
return self.parse_order(order)
|
1557
1557
|
|
1558
1558
|
def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -1599,7 +1599,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1599
1599
|
# "page_token":"dxzef",
|
1600
1600
|
# }
|
1601
1601
|
#
|
1602
|
-
orders = self.
|
1602
|
+
orders = self.safe_list(response, 'data', [])
|
1603
1603
|
return self.parse_orders(orders, market, since, limit)
|
1604
1604
|
|
1605
1605
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -1657,7 +1657,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1657
1657
|
# "page_token":"dxfv"
|
1658
1658
|
# }
|
1659
1659
|
#
|
1660
|
-
trades = self.
|
1660
|
+
trades = self.safe_list(response, 'data', [])
|
1661
1661
|
return self.parse_trades(trades, market, since, limit)
|
1662
1662
|
|
1663
1663
|
def parse_order_status(self, status):
|
@@ -1923,7 +1923,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1923
1923
|
# ]
|
1924
1924
|
# }
|
1925
1925
|
#
|
1926
|
-
deposits = self.
|
1926
|
+
deposits = self.safe_list(response, 'data', [])
|
1927
1927
|
return self.parse_transactions(deposits, currency, since, limit)
|
1928
1928
|
|
1929
1929
|
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -1971,7 +1971,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
1971
1971
|
# "page_token":"dxvf"
|
1972
1972
|
# }
|
1973
1973
|
#
|
1974
|
-
withdrawals = self.
|
1974
|
+
withdrawals = self.safe_list(response, 'data', [])
|
1975
1975
|
return self.parse_transactions(withdrawals, currency, since, limit)
|
1976
1976
|
|
1977
1977
|
def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
@@ -2091,7 +2091,7 @@ class bigone(Exchange, ImplicitAPI):
|
|
2091
2091
|
# }
|
2092
2092
|
# }
|
2093
2093
|
#
|
2094
|
-
data = self.
|
2094
|
+
data = self.safe_dict(response, 'data', {})
|
2095
2095
|
return self.parse_transaction(data, currency)
|
2096
2096
|
|
2097
2097
|
def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
|
ccxt/binance.py
CHANGED
@@ -2440,14 +2440,6 @@ class binance(Exchange, ImplicitAPI):
|
|
2440
2440
|
super(binance, self).set_sandbox_mode(enable)
|
2441
2441
|
self.options['sandboxMode'] = enable
|
2442
2442
|
|
2443
|
-
def convert_expire_date(self, date):
|
2444
|
-
# parse YYMMDD to timestamp
|
2445
|
-
year = date[0:2]
|
2446
|
-
month = date[2:4]
|
2447
|
-
day = date[4:6]
|
2448
|
-
reconstructedDate = '20' + year + '-' + month + '-' + day + 'T00:00:00Z'
|
2449
|
-
return reconstructedDate
|
2450
|
-
|
2451
2443
|
def create_expired_option_market(self, symbol: str):
|
2452
2444
|
# support expired option contracts
|
2453
2445
|
settle = 'USDT'
|
@@ -3859,26 +3851,24 @@ class binance(Exchange, ImplicitAPI):
|
|
3859
3851
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
3860
3852
|
"""
|
3861
3853
|
self.load_markets()
|
3862
|
-
symbols = self.market_symbols(symbols)
|
3863
|
-
market =
|
3864
|
-
if symbols is not None:
|
3865
|
-
first = self.safe_string(symbols, 0)
|
3866
|
-
market = self.market(first)
|
3854
|
+
symbols = self.market_symbols(symbols, None, True, True, True)
|
3855
|
+
market = self.get_market_from_symbols(symbols)
|
3867
3856
|
type = None
|
3857
|
+
type, params = self.handle_market_type_and_params('fetchBidsAsks', market, params)
|
3868
3858
|
subType = None
|
3869
3859
|
subType, params = self.handle_sub_type_and_params('fetchBidsAsks', market, params)
|
3870
|
-
type, params = self.handle_market_type_and_params('fetchBidsAsks', market, params)
|
3871
3860
|
response = None
|
3872
3861
|
if self.is_linear(type, subType):
|
3873
3862
|
response = self.fapiPublicGetTickerBookTicker(params)
|
3874
3863
|
elif self.is_inverse(type, subType):
|
3875
3864
|
response = self.dapiPublicGetTickerBookTicker(params)
|
3876
|
-
|
3865
|
+
elif type == 'spot':
|
3877
3866
|
request = {}
|
3878
3867
|
if symbols is not None:
|
3879
|
-
|
3880
|
-
request['symbols'] = self.json(marketIds)
|
3868
|
+
request['symbols'] = self.json(self.market_ids(symbols))
|
3881
3869
|
response = self.publicGetTickerBookTicker(self.extend(request, params))
|
3870
|
+
else:
|
3871
|
+
raise NotSupported(self.id + ' fetchBidsAsks() does not support ' + type + ' markets yet')
|
3882
3872
|
return self.parse_tickers(response, symbols)
|
3883
3873
|
|
3884
3874
|
def fetch_last_prices(self, symbols: Strings = None, params={}):
|
@@ -3893,12 +3883,12 @@ class binance(Exchange, ImplicitAPI):
|
|
3893
3883
|
:returns dict: a dictionary of lastprices structures
|
3894
3884
|
"""
|
3895
3885
|
self.load_markets()
|
3896
|
-
symbols = self.market_symbols(symbols)
|
3886
|
+
symbols = self.market_symbols(symbols, None, True, True, True)
|
3897
3887
|
market = self.get_market_from_symbols(symbols)
|
3898
3888
|
type = None
|
3889
|
+
type, params = self.handle_market_type_and_params('fetchLastPrices', market, params)
|
3899
3890
|
subType = None
|
3900
3891
|
subType, params = self.handle_sub_type_and_params('fetchLastPrices', market, params)
|
3901
|
-
type, params = self.handle_market_type_and_params('fetchLastPrices', market, params)
|
3902
3892
|
response = None
|
3903
3893
|
if self.is_linear(type, subType):
|
3904
3894
|
response = self.fapiPublicV2GetTickerPrice(params)
|
@@ -3993,28 +3983,26 @@ class binance(Exchange, ImplicitAPI):
|
|
3993
3983
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
3994
3984
|
"""
|
3995
3985
|
self.load_markets()
|
3996
|
-
type = None
|
3997
|
-
market = None
|
3998
3986
|
symbols = self.market_symbols(symbols, None, True, True, True)
|
3999
|
-
|
4000
|
-
|
4001
|
-
market = self.market(first)
|
3987
|
+
market = self.get_market_from_symbols(symbols)
|
3988
|
+
type = None
|
4002
3989
|
type, params = self.handle_market_type_and_params('fetchTickers', market, params)
|
4003
3990
|
subType = None
|
4004
3991
|
subType, params = self.handle_sub_type_and_params('fetchTickers', market, params)
|
4005
3992
|
response = None
|
4006
|
-
if type
|
4007
|
-
response = self.eapiPublicGetTicker(params)
|
4008
|
-
elif self.is_linear(type, subType):
|
3993
|
+
if self.is_linear(type, subType):
|
4009
3994
|
response = self.fapiPublicGetTicker24hr(params)
|
4010
3995
|
elif self.is_inverse(type, subType):
|
4011
3996
|
response = self.dapiPublicGetTicker24hr(params)
|
4012
|
-
|
3997
|
+
elif type == 'spot':
|
4013
3998
|
request = {}
|
4014
3999
|
if symbols is not None:
|
4015
|
-
|
4016
|
-
request['symbols'] = self.json(marketIds)
|
4000
|
+
request['symbols'] = self.json(self.market_ids(symbols))
|
4017
4001
|
response = self.publicGetTicker24hr(self.extend(request, params))
|
4002
|
+
elif type == 'option':
|
4003
|
+
response = self.eapiPublicGetTicker(params)
|
4004
|
+
else:
|
4005
|
+
raise NotSupported(self.id + ' fetchTickers() does not support ' + type + ' markets yet')
|
4018
4006
|
return self.parse_tickers(response, symbols)
|
4019
4007
|
|
4020
4008
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -4635,7 +4623,7 @@ class binance(Exchange, ImplicitAPI):
|
|
4635
4623
|
# }
|
4636
4624
|
# }
|
4637
4625
|
#
|
4638
|
-
data = self.
|
4626
|
+
data = self.safe_dict(response, 'newOrderResponse')
|
4639
4627
|
return self.parse_order(data, market)
|
4640
4628
|
|
4641
4629
|
def edit_spot_order_request(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
@@ -11400,7 +11388,7 @@ class binance(Exchange, ImplicitAPI):
|
|
11400
11388
|
#
|
11401
11389
|
else:
|
11402
11390
|
raise BadRequest(self.id + ' fetchMarginModes() supports linear and inverse subTypes only')
|
11403
|
-
assets = self.
|
11391
|
+
assets = self.safe_list(response, 'positions', [])
|
11404
11392
|
return self.parse_margin_modes(assets, symbols, 'symbol', 'swap')
|
11405
11393
|
|
11406
11394
|
def parse_margin_mode(self, marginMode, market=None) -> MarginMode:
|
ccxt/bingx.py
CHANGED
@@ -1333,9 +1333,12 @@ class bingx(Exchange, ImplicitAPI):
|
|
1333
1333
|
response = self.spotV1PublicGetTicker24hr(self.extend(request, params))
|
1334
1334
|
else:
|
1335
1335
|
response = self.swapV2PublicGetQuoteTicker(self.extend(request, params))
|
1336
|
-
data = self.
|
1337
|
-
|
1338
|
-
|
1336
|
+
data = self.safe_list(response, 'data')
|
1337
|
+
if data is not None:
|
1338
|
+
first = self.safe_dict(data, 0, {})
|
1339
|
+
return self.parse_ticker(first, market)
|
1340
|
+
dataDict = self.safe_dict(response, 'data', {})
|
1341
|
+
return self.parse_ticker(dataDict, market)
|
1339
1342
|
|
1340
1343
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
1341
1344
|
"""
|
@@ -1359,7 +1362,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1359
1362
|
response = self.spotV1PublicGetTicker24hr(params)
|
1360
1363
|
else:
|
1361
1364
|
response = self.swapV2PublicGetQuoteTicker(params)
|
1362
|
-
tickers = self.
|
1365
|
+
tickers = self.safe_list(response, 'data')
|
1363
1366
|
return self.parse_tickers(tickers, symbols)
|
1364
1367
|
|
1365
1368
|
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
@@ -1938,7 +1941,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
1938
1941
|
response = self.fix_stringified_json_members(response)
|
1939
1942
|
response = self.parse_json(response)
|
1940
1943
|
data = self.safe_value(response, 'data', {})
|
1941
|
-
order = self.
|
1944
|
+
order = self.safe_dict(data, 'order', data)
|
1942
1945
|
return self.parse_order(order, market)
|
1943
1946
|
|
1944
1947
|
def create_orders(self, orders: List[OrderRequest], params={}):
|
@@ -2407,7 +2410,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
2407
2410
|
# }
|
2408
2411
|
#
|
2409
2412
|
data = self.safe_value(response, 'data')
|
2410
|
-
first = self.
|
2413
|
+
first = self.safe_dict(data, 'order', data)
|
2411
2414
|
return self.parse_order(first, market)
|
2412
2415
|
|
2413
2416
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
@@ -2632,7 +2635,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
2632
2635
|
# }
|
2633
2636
|
#
|
2634
2637
|
data = self.safe_value(response, 'data')
|
2635
|
-
first = self.
|
2638
|
+
first = self.safe_dict(data, 'order', data)
|
2636
2639
|
return self.parse_order(first, market)
|
2637
2640
|
|
2638
2641
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -2804,7 +2807,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
2804
2807
|
# }
|
2805
2808
|
#
|
2806
2809
|
data = self.safe_value(response, 'data', [])
|
2807
|
-
orders = self.
|
2810
|
+
orders = self.safe_list(data, 'orders', [])
|
2808
2811
|
return self.parse_orders(orders, market, since, limit)
|
2809
2812
|
|
2810
2813
|
def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
@@ -3492,7 +3495,7 @@ class bingx(Exchange, ImplicitAPI):
|
|
3492
3495
|
"""
|
3493
3496
|
self.load_markets()
|
3494
3497
|
response = self.walletsV1PrivateGetCapitalConfigGetall(params)
|
3495
|
-
coins = self.
|
3498
|
+
coins = self.safe_list(response, 'data')
|
3496
3499
|
return self.parse_deposit_withdraw_fees(coins, codes, 'coin')
|
3497
3500
|
|
3498
3501
|
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
ccxt/bit2c.py
CHANGED
@@ -470,7 +470,7 @@ class bit2c(Exchange, ImplicitAPI):
|
|
470
470
|
response = 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
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|