ccxt 4.2.84__py2.py3-none-any.whl → 4.2.86__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.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +1 -1
- ccxt/abstract/coinex.py +232 -123
- 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 +45 -28
- ccxt/async_support/bit2c.py +1 -1
- ccxt/async_support/bitbank.py +27 -29
- 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 +404 -262
- 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 +12 -12
- 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 +15 -14
- 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 +45 -28
- ccxt/bit2c.py +1 -1
- ccxt/bitbank.py +27 -29
- 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 +404 -262
- 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 +12 -12
- 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 +15 -14
- 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/bitget.py +1 -0
- 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.86.dist-info}/METADATA +6 -6
- {ccxt-4.2.84.dist-info → ccxt-4.2.86.dist-info}/RECORD +152 -152
- {ccxt-4.2.84.dist-info → ccxt-4.2.86.dist-info}/WHEEL +0 -0
- {ccxt-4.2.84.dist-info → ccxt-4.2.86.dist-info}/top_level.txt +0 -0
ccxt/async_support/coinlist.py
CHANGED
@@ -708,7 +708,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
708
708
|
# ]
|
709
709
|
# }
|
710
710
|
#
|
711
|
-
candles = self.
|
711
|
+
candles = self.safe_list(response, 'candles', [])
|
712
712
|
return self.parse_ohlcvs(candles, market, timeframe, since, limit)
|
713
713
|
|
714
714
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -781,7 +781,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
781
781
|
# ]
|
782
782
|
# }
|
783
783
|
#
|
784
|
-
auctions = self.
|
784
|
+
auctions = self.safe_list(response, 'auctions', [])
|
785
785
|
return self.parse_trades(auctions, market, since, limit)
|
786
786
|
|
787
787
|
def parse_trade(self, trade, market: Market = None) -> Trade:
|
@@ -1163,7 +1163,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1163
1163
|
# ]
|
1164
1164
|
# }
|
1165
1165
|
#
|
1166
|
-
fills = self.
|
1166
|
+
fills = self.safe_list(response, 'fills', [])
|
1167
1167
|
return self.parse_trades(fills, market, since, limit)
|
1168
1168
|
|
1169
1169
|
async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
@@ -1240,7 +1240,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1240
1240
|
# ]
|
1241
1241
|
# }
|
1242
1242
|
#
|
1243
|
-
orders = self.
|
1243
|
+
orders = self.safe_list(response, 'orders', [])
|
1244
1244
|
return self.parse_orders(orders, market, since, limit)
|
1245
1245
|
|
1246
1246
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
@@ -1458,7 +1458,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1458
1458
|
# "timestamp": "2023-10-26T11:30:55.376Z"
|
1459
1459
|
# }
|
1460
1460
|
#
|
1461
|
-
order = self.
|
1461
|
+
order = self.safe_dict(response, 'order', {})
|
1462
1462
|
return self.parse_order(order, market)
|
1463
1463
|
|
1464
1464
|
async def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
@@ -1729,7 +1729,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1729
1729
|
# ]
|
1730
1730
|
# }
|
1731
1731
|
#
|
1732
|
-
transfers = self.
|
1732
|
+
transfers = self.safe_list(response, 'transfers', [])
|
1733
1733
|
return self.parse_transfers(transfers, currency, since, limit)
|
1734
1734
|
|
1735
1735
|
def parse_transfer(self, transfer, currency: Currency = None):
|
@@ -1889,7 +1889,7 @@ class coinlist(Exchange, ImplicitAPI):
|
|
1889
1889
|
# "transfer_id": "d4a2d8dd-7def-4545-a062-761683b9aa05"
|
1890
1890
|
# }
|
1891
1891
|
#
|
1892
|
-
data = self.
|
1892
|
+
data = self.safe_dict(response, 'data', {})
|
1893
1893
|
return self.parse_transaction(data, currency)
|
1894
1894
|
|
1895
1895
|
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
ccxt/async_support/coinmate.py
CHANGED
@@ -395,7 +395,7 @@ class coinmate(Exchange, ImplicitAPI):
|
|
395
395
|
# }
|
396
396
|
# }
|
397
397
|
#
|
398
|
-
data = self.
|
398
|
+
data = self.safe_dict(response, 'data')
|
399
399
|
return self.parse_ticker(data, market)
|
400
400
|
|
401
401
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
@@ -660,7 +660,7 @@ class coinmate(Exchange, ImplicitAPI):
|
|
660
660
|
if since is not None:
|
661
661
|
request['timestampFrom'] = since
|
662
662
|
response = await self.privatePostTradeHistory(self.extend(request, params))
|
663
|
-
data = self.
|
663
|
+
data = self.safe_list(response, 'data', [])
|
664
664
|
return self.parse_trades(data, None, since, limit)
|
665
665
|
|
666
666
|
def parse_trade(self, trade, market: Market = None) -> Trade:
|
@@ -758,7 +758,7 @@ class coinmate(Exchange, ImplicitAPI):
|
|
758
758
|
# ]
|
759
759
|
# }
|
760
760
|
#
|
761
|
-
data = self.
|
761
|
+
data = self.safe_list(response, 'data', [])
|
762
762
|
return self.parse_trades(data, market, since, limit)
|
763
763
|
|
764
764
|
async def fetch_trading_fee(self, symbol: str, params={}):
|
@@ -985,7 +985,7 @@ class coinmate(Exchange, ImplicitAPI):
|
|
985
985
|
if symbol:
|
986
986
|
market = self.market(symbol)
|
987
987
|
response = await self.privatePostOrderById(self.extend(request, params))
|
988
|
-
data = self.
|
988
|
+
data = self.safe_dict(response, 'data')
|
989
989
|
return self.parse_order(data, market)
|
990
990
|
|
991
991
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
ccxt/async_support/coinmetro.py
CHANGED
@@ -532,7 +532,7 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
532
532
|
# ]
|
533
533
|
# }
|
534
534
|
#
|
535
|
-
candleHistory = self.
|
535
|
+
candleHistory = self.safe_list(response, 'candleHistory', [])
|
536
536
|
return self.parse_ohlcvs(candleHistory, market, timeframe, since, limit)
|
537
537
|
|
538
538
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -594,7 +594,7 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
594
594
|
# ]
|
595
595
|
# }
|
596
596
|
#
|
597
|
-
tickHistory = self.
|
597
|
+
tickHistory = self.safe_list(response, 'tickHistory', [])
|
598
598
|
return self.parse_trades(tickHistory, market, since, limit)
|
599
599
|
|
600
600
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -851,7 +851,7 @@ class coinmetro(Exchange, ImplicitAPI):
|
|
851
851
|
"""
|
852
852
|
await self.load_markets()
|
853
853
|
response = await self.publicGetExchangePrices(params)
|
854
|
-
latestPrices = self.
|
854
|
+
latestPrices = self.safe_list(response, 'latestPrices', [])
|
855
855
|
return self.parse_tickers(latestPrices, symbols)
|
856
856
|
|
857
857
|
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
ccxt/async_support/coinone.py
CHANGED
@@ -503,7 +503,7 @@ class coinone(Exchange, ImplicitAPI):
|
|
503
503
|
# ]
|
504
504
|
# }
|
505
505
|
#
|
506
|
-
data = self.
|
506
|
+
data = self.safe_list(response, 'tickers', [])
|
507
507
|
return self.parse_tickers(data, symbols)
|
508
508
|
|
509
509
|
async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
@@ -555,7 +555,7 @@ class coinone(Exchange, ImplicitAPI):
|
|
555
555
|
# }
|
556
556
|
#
|
557
557
|
data = self.safe_value(response, 'tickers', [])
|
558
|
-
ticker = self.
|
558
|
+
ticker = self.safe_dict(data, 0, {})
|
559
559
|
return self.parse_ticker(ticker, market)
|
560
560
|
|
561
561
|
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
@@ -714,7 +714,7 @@ class coinone(Exchange, ImplicitAPI):
|
|
714
714
|
# ]
|
715
715
|
# }
|
716
716
|
#
|
717
|
-
data = self.
|
717
|
+
data = self.safe_list(response, 'transactions', [])
|
718
718
|
return self.parse_trades(data, market, since, limit)
|
719
719
|
|
720
720
|
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
@@ -942,7 +942,7 @@ class coinone(Exchange, ImplicitAPI):
|
|
942
942
|
# ]
|
943
943
|
# }
|
944
944
|
#
|
945
|
-
limitOrders = self.
|
945
|
+
limitOrders = self.safe_list(response, 'limitOrders', [])
|
946
946
|
return self.parse_orders(limitOrders, market, since, limit)
|
947
947
|
|
948
948
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -982,7 +982,7 @@ class coinone(Exchange, ImplicitAPI):
|
|
982
982
|
# ]
|
983
983
|
# }
|
984
984
|
#
|
985
|
-
completeOrders = self.
|
985
|
+
completeOrders = self.safe_list(response, 'completeOrders', [])
|
986
986
|
return self.parse_trades(completeOrders, market, since, limit)
|
987
987
|
|
988
988
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
ccxt/async_support/coinspot.py
CHANGED
@@ -274,7 +274,7 @@ class coinspot(Exchange, ImplicitAPI):
|
|
274
274
|
# }
|
275
275
|
# }
|
276
276
|
#
|
277
|
-
ticker = self.
|
277
|
+
ticker = self.safe_dict(prices, id)
|
278
278
|
return self.parse_ticker(ticker, market)
|
279
279
|
|
280
280
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
@@ -340,7 +340,7 @@ class coinspot(Exchange, ImplicitAPI):
|
|
340
340
|
# ],
|
341
341
|
# }
|
342
342
|
#
|
343
|
-
trades = self.
|
343
|
+
trades = self.safe_list(response, 'orders', [])
|
344
344
|
return self.parse_trades(trades, market, since, limit)
|
345
345
|
|
346
346
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
ccxt/async_support/cryptocom.py
CHANGED
@@ -625,7 +625,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
625
625
|
# }
|
626
626
|
#
|
627
627
|
result = self.safe_value(response, 'result', {})
|
628
|
-
data = self.
|
628
|
+
data = self.safe_list(result, 'data', [])
|
629
629
|
return self.parse_tickers(data, symbols)
|
630
630
|
|
631
631
|
async def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
@@ -712,7 +712,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
712
712
|
# }
|
713
713
|
#
|
714
714
|
data = self.safe_value(response, 'result', {})
|
715
|
-
orders = self.
|
715
|
+
orders = self.safe_list(data, 'data', [])
|
716
716
|
return self.parse_orders(orders, market, since, limit)
|
717
717
|
|
718
718
|
async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
@@ -766,7 +766,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
766
766
|
# }
|
767
767
|
#
|
768
768
|
result = self.safe_value(response, 'result', {})
|
769
|
-
trades = self.
|
769
|
+
trades = self.safe_list(result, 'data', [])
|
770
770
|
return self.parse_trades(trades, market, since, limit)
|
771
771
|
|
772
772
|
async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
@@ -823,7 +823,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
823
823
|
# }
|
824
824
|
#
|
825
825
|
result = self.safe_value(response, 'result', {})
|
826
|
-
data = self.
|
826
|
+
data = self.safe_list(result, 'data', [])
|
827
827
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
828
828
|
|
829
829
|
async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
@@ -985,7 +985,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
985
985
|
# }
|
986
986
|
# }
|
987
987
|
#
|
988
|
-
order = self.
|
988
|
+
order = self.safe_dict(response, 'result', {})
|
989
989
|
return self.parse_order(order, market)
|
990
990
|
|
991
991
|
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
@@ -1102,7 +1102,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1102
1102
|
# }
|
1103
1103
|
# }
|
1104
1104
|
#
|
1105
|
-
result = self.
|
1105
|
+
result = self.safe_dict(response, 'result', {})
|
1106
1106
|
return self.parse_order(result, market)
|
1107
1107
|
|
1108
1108
|
async def create_orders(self, orders: List[OrderRequest], params={}):
|
@@ -1320,7 +1320,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1320
1320
|
# }
|
1321
1321
|
# }
|
1322
1322
|
#
|
1323
|
-
result = self.
|
1323
|
+
result = self.safe_dict(response, 'result', {})
|
1324
1324
|
return self.parse_order(result, market)
|
1325
1325
|
|
1326
1326
|
async def cancel_orders(self, ids, symbol: Str = None, params={}):
|
@@ -1349,7 +1349,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1349
1349
|
'order_list': orderRequests,
|
1350
1350
|
}
|
1351
1351
|
response = await self.v1PrivatePostPrivateCancelOrderList(self.extend(request, params))
|
1352
|
-
result = self.
|
1352
|
+
result = self.safe_list(response, 'result', [])
|
1353
1353
|
return self.parse_orders(result, market, None, None, params)
|
1354
1354
|
|
1355
1355
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -1407,7 +1407,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1407
1407
|
# }
|
1408
1408
|
#
|
1409
1409
|
data = self.safe_value(response, 'result', {})
|
1410
|
-
orders = self.
|
1410
|
+
orders = self.safe_list(data, 'data', [])
|
1411
1411
|
return self.parse_orders(orders, market, since, limit)
|
1412
1412
|
|
1413
1413
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -1471,7 +1471,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1471
1471
|
# }
|
1472
1472
|
#
|
1473
1473
|
result = self.safe_value(response, 'result', {})
|
1474
|
-
trades = self.
|
1474
|
+
trades = self.safe_list(result, 'data', [])
|
1475
1475
|
return self.parse_trades(trades, market, since, limit)
|
1476
1476
|
|
1477
1477
|
def parse_address(self, addressString):
|
@@ -1529,7 +1529,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1529
1529
|
# }
|
1530
1530
|
# }
|
1531
1531
|
#
|
1532
|
-
result = self.
|
1532
|
+
result = self.safe_dict(response, 'result')
|
1533
1533
|
return self.parse_transaction(result, currency)
|
1534
1534
|
|
1535
1535
|
async def fetch_deposit_addresses_by_network(self, code: str, params={}):
|
@@ -1667,7 +1667,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1667
1667
|
# }
|
1668
1668
|
#
|
1669
1669
|
data = self.safe_value(response, 'result', {})
|
1670
|
-
depositList = self.
|
1670
|
+
depositList = self.safe_list(data, 'deposit_list', [])
|
1671
1671
|
return self.parse_transactions(depositList, currency, since, limit)
|
1672
1672
|
|
1673
1673
|
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -1722,7 +1722,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
1722
1722
|
# }
|
1723
1723
|
#
|
1724
1724
|
data = self.safe_value(response, 'result', {})
|
1725
|
-
withdrawalList = self.
|
1725
|
+
withdrawalList = self.safe_list(data, 'withdrawal_list', [])
|
1726
1726
|
return self.parse_transactions(withdrawalList, currency, since, limit)
|
1727
1727
|
|
1728
1728
|
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
@@ -2160,7 +2160,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
2160
2160
|
await self.load_markets()
|
2161
2161
|
response = await self.v1PrivatePostPrivateGetCurrencyNetworks(params)
|
2162
2162
|
data = self.safe_value(response, 'result')
|
2163
|
-
currencyMap = self.
|
2163
|
+
currencyMap = self.safe_list(data, 'currency_map')
|
2164
2164
|
return self.parse_deposit_withdraw_fees(currencyMap, codes, 'full_name')
|
2165
2165
|
|
2166
2166
|
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -2563,8 +2563,8 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
2563
2563
|
# }
|
2564
2564
|
# }
|
2565
2565
|
#
|
2566
|
-
result = self.
|
2567
|
-
data = self.
|
2566
|
+
result = self.safe_dict(response, 'result', {})
|
2567
|
+
data = self.safe_list(result, 'data', [])
|
2568
2568
|
return self.parse_position(data[0], market)
|
2569
2569
|
|
2570
2570
|
async def fetch_positions(self, symbols: Strings = None, params={}):
|
@@ -2737,7 +2737,7 @@ class cryptocom(Exchange, ImplicitAPI):
|
|
2737
2737
|
# }
|
2738
2738
|
# }
|
2739
2739
|
#
|
2740
|
-
result = self.
|
2740
|
+
result = self.safe_dict(response, 'result')
|
2741
2741
|
return self.parse_order(result, market)
|
2742
2742
|
|
2743
2743
|
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
@@ -1847,7 +1847,7 @@ class currencycom(Exchange, ImplicitAPI):
|
|
1847
1847
|
# ]
|
1848
1848
|
# }
|
1849
1849
|
#
|
1850
|
-
data = self.
|
1850
|
+
data = self.safe_list(response, 'positions', [])
|
1851
1851
|
return self.parse_positions(data, symbols)
|
1852
1852
|
|
1853
1853
|
def parse_position(self, position, market: Market = None):
|
ccxt/async_support/delta.py
CHANGED
@@ -254,14 +254,6 @@ class delta(Exchange, ImplicitAPI):
|
|
254
254
|
},
|
255
255
|
})
|
256
256
|
|
257
|
-
def convert_expire_date(self, date):
|
258
|
-
# parse YYMMDD to timestamp
|
259
|
-
year = date[0:2]
|
260
|
-
month = date[2:4]
|
261
|
-
day = date[4:6]
|
262
|
-
reconstructedDate = '20' + year + '-' + month + '-' + day + 'T00:00:00Z'
|
263
|
-
return reconstructedDate
|
264
|
-
|
265
257
|
def create_expired_option_market(self, symbol: str):
|
266
258
|
# support expired option contracts
|
267
259
|
quote = 'USDT'
|
ccxt/async_support/deribit.py
CHANGED
@@ -417,70 +417,6 @@ class deribit(Exchange, ImplicitAPI):
|
|
417
417
|
},
|
418
418
|
})
|
419
419
|
|
420
|
-
def convert_expire_date(self, date):
|
421
|
-
# parse YYMMDD to timestamp
|
422
|
-
year = date[0:2]
|
423
|
-
month = date[2:4]
|
424
|
-
day = date[4:6]
|
425
|
-
reconstructedDate = '20' + year + '-' + month + '-' + day + 'T00:00:00Z'
|
426
|
-
return reconstructedDate
|
427
|
-
|
428
|
-
def convert_market_id_expire_date(self, date):
|
429
|
-
# parse 19JAN24 to 240119
|
430
|
-
monthMappping = {
|
431
|
-
'JAN': '01',
|
432
|
-
'FEB': '02',
|
433
|
-
'MAR': '03',
|
434
|
-
'APR': '04',
|
435
|
-
'MAY': '05',
|
436
|
-
'JUN': '06',
|
437
|
-
'JUL': '07',
|
438
|
-
'AUG': '08',
|
439
|
-
'SEP': '09',
|
440
|
-
'OCT': '10',
|
441
|
-
'NOV': '11',
|
442
|
-
'DEC': '12',
|
443
|
-
}
|
444
|
-
year = date[0:2]
|
445
|
-
monthName = date[2:5]
|
446
|
-
month = self.safe_string(monthMappping, monthName)
|
447
|
-
day = date[5:7]
|
448
|
-
reconstructedDate = day + month + year
|
449
|
-
return reconstructedDate
|
450
|
-
|
451
|
-
def convert_expire_date_to_market_id_date(self, date):
|
452
|
-
# parse 240119 to 19JAN24
|
453
|
-
year = date[0:2]
|
454
|
-
monthRaw = date[2:4]
|
455
|
-
month = None
|
456
|
-
day = date[4:6]
|
457
|
-
if monthRaw == '01':
|
458
|
-
month = 'JAN'
|
459
|
-
elif monthRaw == '02':
|
460
|
-
month = 'FEB'
|
461
|
-
elif monthRaw == '03':
|
462
|
-
month = 'MAR'
|
463
|
-
elif monthRaw == '04':
|
464
|
-
month = 'APR'
|
465
|
-
elif monthRaw == '05':
|
466
|
-
month = 'MAY'
|
467
|
-
elif monthRaw == '06':
|
468
|
-
month = 'JUN'
|
469
|
-
elif monthRaw == '07':
|
470
|
-
month = 'JUL'
|
471
|
-
elif monthRaw == '08':
|
472
|
-
month = 'AUG'
|
473
|
-
elif monthRaw == '09':
|
474
|
-
month = 'SEP'
|
475
|
-
elif monthRaw == '10':
|
476
|
-
month = 'OCT'
|
477
|
-
elif monthRaw == '11':
|
478
|
-
month = 'NOV'
|
479
|
-
elif monthRaw == '12':
|
480
|
-
month = 'DEC'
|
481
|
-
reconstructedDate = day + month + year
|
482
|
-
return reconstructedDate
|
483
|
-
|
484
420
|
def create_expired_option_market(self, symbol: str):
|
485
421
|
# support expired option contracts
|
486
422
|
quote = 'USD'
|
@@ -1231,7 +1167,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1231
1167
|
# "testnet": False
|
1232
1168
|
# }
|
1233
1169
|
#
|
1234
|
-
result = self.
|
1170
|
+
result = self.safe_dict(response, 'result')
|
1235
1171
|
return self.parse_ticker(result, market)
|
1236
1172
|
|
1237
1173
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
@@ -1496,7 +1432,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1496
1432
|
# }
|
1497
1433
|
#
|
1498
1434
|
result = self.safe_value(response, 'result', {})
|
1499
|
-
trades = self.
|
1435
|
+
trades = self.safe_list(result, 'trades', [])
|
1500
1436
|
return self.parse_trades(trades, market, since, limit)
|
1501
1437
|
|
1502
1438
|
async def fetch_trading_fees(self, params={}):
|
@@ -1836,7 +1772,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
1836
1772
|
# }
|
1837
1773
|
# }
|
1838
1774
|
#
|
1839
|
-
result = self.
|
1775
|
+
result = self.safe_dict(response, 'result')
|
1840
1776
|
return self.parse_order(result, market)
|
1841
1777
|
|
1842
1778
|
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
@@ -2050,7 +1986,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2050
1986
|
'order_id': id,
|
2051
1987
|
}
|
2052
1988
|
response = await self.privateGetCancel(self.extend(request, params))
|
2053
|
-
result = self.
|
1989
|
+
result = self.safe_dict(response, 'result', {})
|
2054
1990
|
return self.parse_order(result)
|
2055
1991
|
|
2056
1992
|
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
@@ -2097,7 +2033,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2097
2033
|
market = self.market(symbol)
|
2098
2034
|
request['instrument_name'] = market['id']
|
2099
2035
|
response = await self.privateGetGetOpenOrdersByInstrument(self.extend(request, params))
|
2100
|
-
result = self.
|
2036
|
+
result = self.safe_list(response, 'result', [])
|
2101
2037
|
return self.parse_orders(result, market, since, limit)
|
2102
2038
|
|
2103
2039
|
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -2124,7 +2060,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2124
2060
|
market = self.market(symbol)
|
2125
2061
|
request['instrument_name'] = market['id']
|
2126
2062
|
response = await self.privateGetGetOrderHistoryByInstrument(self.extend(request, params))
|
2127
|
-
result = self.
|
2063
|
+
result = self.safe_list(response, 'result', [])
|
2128
2064
|
return self.parse_orders(result, market, since, limit)
|
2129
2065
|
|
2130
2066
|
async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -2176,7 +2112,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2176
2112
|
# }
|
2177
2113
|
# }
|
2178
2114
|
#
|
2179
|
-
result = self.
|
2115
|
+
result = self.safe_list(response, 'result', [])
|
2180
2116
|
return self.parse_trades(result, None, since, limit)
|
2181
2117
|
|
2182
2118
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -2251,7 +2187,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2251
2187
|
# }
|
2252
2188
|
#
|
2253
2189
|
result = self.safe_value(response, 'result', {})
|
2254
|
-
trades = self.
|
2190
|
+
trades = self.safe_list(result, 'trades', [])
|
2255
2191
|
return self.parse_trades(trades, market, since, limit)
|
2256
2192
|
|
2257
2193
|
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -2295,7 +2231,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2295
2231
|
# }
|
2296
2232
|
#
|
2297
2233
|
result = self.safe_value(response, 'result', {})
|
2298
|
-
data = self.
|
2234
|
+
data = self.safe_list(result, 'data', [])
|
2299
2235
|
return self.parse_transactions(data, currency, since, limit, params)
|
2300
2236
|
|
2301
2237
|
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -2343,7 +2279,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2343
2279
|
# }
|
2344
2280
|
#
|
2345
2281
|
result = self.safe_value(response, 'result', {})
|
2346
|
-
data = self.
|
2282
|
+
data = self.safe_list(result, 'data', [])
|
2347
2283
|
return self.parse_transactions(data, currency, since, limit, params)
|
2348
2284
|
|
2349
2285
|
def parse_transaction_status(self, status):
|
@@ -2527,7 +2463,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2527
2463
|
# }
|
2528
2464
|
# }
|
2529
2465
|
#
|
2530
|
-
result = self.
|
2466
|
+
result = self.safe_dict(response, 'result')
|
2531
2467
|
return self.parse_position(result)
|
2532
2468
|
|
2533
2469
|
async def fetch_positions(self, symbols: Strings = None, params={}):
|
@@ -2592,7 +2528,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2592
2528
|
# ]
|
2593
2529
|
# }
|
2594
2530
|
#
|
2595
|
-
result = self.
|
2531
|
+
result = self.safe_list(response, 'result')
|
2596
2532
|
return self.parse_positions(result, symbols)
|
2597
2533
|
|
2598
2534
|
async def fetch_volatility_history(self, code: str, params={}):
|
@@ -2707,7 +2643,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2707
2643
|
# }
|
2708
2644
|
#
|
2709
2645
|
result = self.safe_value(response, 'result', {})
|
2710
|
-
transfers = self.
|
2646
|
+
transfers = self.safe_list(result, 'data', [])
|
2711
2647
|
return self.parse_transfers(transfers, currency, since, limit, params)
|
2712
2648
|
|
2713
2649
|
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
@@ -2756,7 +2692,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2756
2692
|
# }
|
2757
2693
|
# }
|
2758
2694
|
#
|
2759
|
-
result = self.
|
2695
|
+
result = self.safe_dict(response, 'result', {})
|
2760
2696
|
return self.parse_transfer(result, currency)
|
2761
2697
|
|
2762
2698
|
def parse_transfer(self, transfer, currency: Currency = None):
|
@@ -2884,7 +2820,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
2884
2820
|
# "testnet": True
|
2885
2821
|
# }
|
2886
2822
|
#
|
2887
|
-
data = self.
|
2823
|
+
data = self.safe_list(response, 'result', [])
|
2888
2824
|
return self.parse_deposit_withdraw_fees(data, codes, 'currency')
|
2889
2825
|
|
2890
2826
|
async def fetch_funding_rate(self, symbol: str, params={}):
|
@@ -3129,7 +3065,7 @@ class deribit(Exchange, ImplicitAPI):
|
|
3129
3065
|
# }
|
3130
3066
|
#
|
3131
3067
|
result = self.safe_value(response, 'result', {})
|
3132
|
-
settlements = self.
|
3068
|
+
settlements = self.safe_list(result, 'settlements', [])
|
3133
3069
|
return self.parse_liquidations(settlements, market, since, limit)
|
3134
3070
|
|
3135
3071
|
def parse_liquidation(self, liquidation, market: Market = None):
|
ccxt/async_support/digifinex.py
CHANGED
@@ -1397,7 +1397,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
1397
1397
|
# ]
|
1398
1398
|
# }
|
1399
1399
|
#
|
1400
|
-
data = self.
|
1400
|
+
data = self.safe_list(response, 'data', [])
|
1401
1401
|
return self.parse_trades(data, market, since, limit)
|
1402
1402
|
|
1403
1403
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -2080,7 +2080,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2080
2080
|
# ]
|
2081
2081
|
# }
|
2082
2082
|
#
|
2083
|
-
data = self.
|
2083
|
+
data = self.safe_list(response, 'data', [])
|
2084
2084
|
return self.parse_orders(data, market, since, limit)
|
2085
2085
|
|
2086
2086
|
async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -2175,7 +2175,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2175
2175
|
# ]
|
2176
2176
|
# }
|
2177
2177
|
#
|
2178
|
-
data = self.
|
2178
|
+
data = self.safe_list(response, 'data', [])
|
2179
2179
|
return self.parse_orders(data, market, since, limit)
|
2180
2180
|
|
2181
2181
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
@@ -2354,7 +2354,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2354
2354
|
# }
|
2355
2355
|
#
|
2356
2356
|
responseRequest = 'data' if (marketType == 'swap') else 'list'
|
2357
|
-
data = self.
|
2357
|
+
data = self.safe_list(response, responseRequest, [])
|
2358
2358
|
return self.parse_trades(data, market, since, limit)
|
2359
2359
|
|
2360
2360
|
def parse_ledger_entry_type(self, type):
|
@@ -2581,7 +2581,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2581
2581
|
# ]
|
2582
2582
|
# }
|
2583
2583
|
#
|
2584
|
-
data = self.
|
2584
|
+
data = self.safe_list(response, 'data', [])
|
2585
2585
|
return self.parse_transactions(data, currency, since, limit, {'type': type})
|
2586
2586
|
|
2587
2587
|
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -3473,7 +3473,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3473
3473
|
# ]
|
3474
3474
|
# }
|
3475
3475
|
#
|
3476
|
-
transfers = self.
|
3476
|
+
transfers = self.safe_list(response, 'data', [])
|
3477
3477
|
return self.parse_transfers(transfers, currency, since, limit)
|
3478
3478
|
|
3479
3479
|
async def fetch_leverage_tiers(self, symbols: Strings = None, params={}):
|
@@ -3709,7 +3709,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3709
3709
|
# "code": 200,
|
3710
3710
|
# }
|
3711
3711
|
#
|
3712
|
-
data = self.
|
3712
|
+
data = self.safe_list(response, 'data')
|
3713
3713
|
return self.parse_deposit_withdraw_fees(data, codes)
|
3714
3714
|
|
3715
3715
|
def parse_deposit_withdraw_fees(self, response, codes=None, currencyIdKey=None):
|
@@ -3891,7 +3891,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3891
3891
|
# ]
|
3892
3892
|
# }
|
3893
3893
|
#
|
3894
|
-
data = self.
|
3894
|
+
data = self.safe_list(response, 'data', [])
|
3895
3895
|
return self.parse_incomes(data, market, since, limit)
|
3896
3896
|
|
3897
3897
|
def parse_income(self, income, market: Market = None):
|