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/async_support/bitbank.py
CHANGED
@@ -302,7 +302,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
302
302
|
'pair': market['id'],
|
303
303
|
}
|
304
304
|
response = await self.publicGetPairTicker(self.extend(request, params))
|
305
|
-
data = self.
|
305
|
+
data = self.safe_dict(response, 'data', {})
|
306
306
|
return self.parse_ticker(data, market)
|
307
307
|
|
308
308
|
async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
@@ -385,7 +385,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
385
385
|
}
|
386
386
|
response = await self.publicGetPairTransactions(self.extend(request, params))
|
387
387
|
data = self.safe_value(response, 'data', {})
|
388
|
-
trades = self.
|
388
|
+
trades = self.safe_list(data, 'transactions', [])
|
389
389
|
return self.parse_trades(trades, market, since, limit)
|
390
390
|
|
391
391
|
async def fetch_trading_fees(self, params={}):
|
@@ -508,7 +508,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
508
508
|
data = self.safe_value(response, 'data', {})
|
509
509
|
candlestick = self.safe_value(data, 'candlestick', [])
|
510
510
|
first = self.safe_value(candlestick, 0, {})
|
511
|
-
ohlcv = self.
|
511
|
+
ohlcv = self.safe_list(first, 'ohlcv', [])
|
512
512
|
return self.parse_ohlcvs(ohlcv, market, timeframe, since, limit)
|
513
513
|
|
514
514
|
def parse_balance(self, response) -> Balances:
|
@@ -645,7 +645,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
645
645
|
if type == 'limit':
|
646
646
|
request['price'] = self.price_to_precision(symbol, price)
|
647
647
|
response = await self.privatePostUserSpotOrder(self.extend(request, params))
|
648
|
-
data = self.
|
648
|
+
data = self.safe_dict(response, 'data')
|
649
649
|
return self.parse_order(data, market)
|
650
650
|
|
651
651
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
@@ -682,7 +682,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
682
682
|
'pair': market['id'],
|
683
683
|
}
|
684
684
|
response = await self.privateGetUserSpotOrder(self.extend(request, params))
|
685
|
-
data = self.
|
685
|
+
data = self.safe_dict(response, 'data')
|
686
686
|
return self.parse_order(data, market)
|
687
687
|
|
688
688
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -706,7 +706,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
706
706
|
request['since'] = self.parse_to_int(since / 1000)
|
707
707
|
response = await self.privateGetUserSpotActiveOrders(self.extend(request, params))
|
708
708
|
data = self.safe_value(response, 'data', {})
|
709
|
-
orders = self.
|
709
|
+
orders = self.safe_list(data, 'orders', [])
|
710
710
|
return self.parse_orders(orders, market, since, limit)
|
711
711
|
|
712
712
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -731,7 +731,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
731
731
|
request['since'] = self.parse_to_int(since / 1000)
|
732
732
|
response = await self.privateGetUserSpotTradeHistory(self.extend(request, params))
|
733
733
|
data = self.safe_value(response, 'data', {})
|
734
|
-
trades = self.
|
734
|
+
trades = self.safe_list(data, 'trades', [])
|
735
735
|
return self.parse_trades(trades, market, since, limit)
|
736
736
|
|
737
737
|
async def fetch_deposit_address(self, code: str, params={}):
|
@@ -799,7 +799,7 @@ class bitbank(Exchange, ImplicitAPI):
|
|
799
799
|
# }
|
800
800
|
# }
|
801
801
|
#
|
802
|
-
data = self.
|
802
|
+
data = self.safe_dict(response, 'data', {})
|
803
803
|
return self.parse_transaction(data, currency)
|
804
804
|
|
805
805
|
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
ccxt/async_support/bitbns.py
CHANGED
@@ -696,7 +696,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
696
696
|
# }
|
697
697
|
#
|
698
698
|
data = self.safe_value(response, 'data', [])
|
699
|
-
first = self.
|
699
|
+
first = self.safe_dict(data, 0)
|
700
700
|
return self.parse_order(first, market)
|
701
701
|
|
702
702
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -744,7 +744,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
744
744
|
# "code":200
|
745
745
|
# }
|
746
746
|
#
|
747
|
-
data = self.
|
747
|
+
data = self.safe_list(response, 'data', [])
|
748
748
|
return self.parse_orders(data, market, since, limit)
|
749
749
|
|
750
750
|
def parse_trade(self, trade, market: Market = None) -> Trade:
|
@@ -884,7 +884,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
884
884
|
# "code": 200
|
885
885
|
# }
|
886
886
|
#
|
887
|
-
data = self.
|
887
|
+
data = self.safe_list(response, 'data', [])
|
888
888
|
return self.parse_trades(data, market, since, limit)
|
889
889
|
|
890
890
|
async def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
@@ -955,7 +955,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
955
955
|
# "code":200
|
956
956
|
# }
|
957
957
|
#
|
958
|
-
data = self.
|
958
|
+
data = self.safe_list(response, 'data', [])
|
959
959
|
return self.parse_transactions(data, currency, since, limit)
|
960
960
|
|
961
961
|
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -979,7 +979,7 @@ class bitbns(Exchange, ImplicitAPI):
|
|
979
979
|
#
|
980
980
|
# ...
|
981
981
|
#
|
982
|
-
data = self.
|
982
|
+
data = self.safe_list(response, 'data', [])
|
983
983
|
return self.parse_transactions(data, currency, since, limit)
|
984
984
|
|
985
985
|
def parse_transaction_status_by_type(self, status, type=None):
|
ccxt/async_support/bitfinex.py
CHANGED
@@ -460,7 +460,7 @@ class bitfinex(Exchange, ImplicitAPI):
|
|
460
460
|
# }
|
461
461
|
# }
|
462
462
|
#
|
463
|
-
withdraw = self.
|
463
|
+
withdraw = self.safe_list(response, 'withdraw')
|
464
464
|
return self.parse_deposit_withdraw_fees(withdraw, codes)
|
465
465
|
|
466
466
|
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
ccxt/async_support/bitfinex2.py
CHANGED
@@ -1712,7 +1712,7 @@ class bitfinex2(Exchange, ImplicitAPI):
|
|
1712
1712
|
'all': 1,
|
1713
1713
|
}
|
1714
1714
|
response = await self.privatePostAuthWOrderCancelMulti(self.extend(request, params))
|
1715
|
-
orders = self.
|
1715
|
+
orders = self.safe_list(response, 4, [])
|
1716
1716
|
return self.parse_orders(orders)
|
1717
1717
|
|
1718
1718
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
ccxt/async_support/bitget.py
CHANGED
@@ -2149,7 +2149,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
2149
2149
|
# ]
|
2150
2150
|
# }
|
2151
2151
|
#
|
2152
|
-
rawTransactions = self.
|
2152
|
+
rawTransactions = self.safe_list(response, 'data', [])
|
2153
2153
|
return self.parse_transactions(rawTransactions, currency, since, limit)
|
2154
2154
|
|
2155
2155
|
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
@@ -2286,7 +2286,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
2286
2286
|
# ]
|
2287
2287
|
# }
|
2288
2288
|
#
|
2289
|
-
rawTransactions = self.
|
2289
|
+
rawTransactions = self.safe_list(response, 'data', [])
|
2290
2290
|
return self.parse_transactions(rawTransactions, currency, since, limit)
|
2291
2291
|
|
2292
2292
|
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
@@ -2409,7 +2409,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
2409
2409
|
# }
|
2410
2410
|
# }
|
2411
2411
|
#
|
2412
|
-
data = self.
|
2412
|
+
data = self.safe_dict(response, 'data', {})
|
2413
2413
|
return self.parse_deposit_address(data, currency)
|
2414
2414
|
|
2415
2415
|
def parse_deposit_address(self, depositAddress, currency: Currency = None):
|
@@ -2682,7 +2682,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
2682
2682
|
# ]
|
2683
2683
|
# }
|
2684
2684
|
#
|
2685
|
-
data = self.
|
2685
|
+
data = self.safe_list(response, 'data', [])
|
2686
2686
|
return self.parse_ticker(data[0], market)
|
2687
2687
|
|
2688
2688
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
@@ -2779,7 +2779,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
2779
2779
|
# ]
|
2780
2780
|
# }
|
2781
2781
|
#
|
2782
|
-
data = self.
|
2782
|
+
data = self.safe_list(response, 'data', [])
|
2783
2783
|
return self.parse_tickers(data, symbols)
|
2784
2784
|
|
2785
2785
|
def parse_trade(self, trade, market: Market = None) -> Trade:
|
@@ -3000,7 +3000,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
3000
3000
|
# ]
|
3001
3001
|
# }
|
3002
3002
|
#
|
3003
|
-
data = self.
|
3003
|
+
data = self.safe_list(response, 'data', [])
|
3004
3004
|
return self.parse_trades(data, market, since, limit)
|
3005
3005
|
|
3006
3006
|
async def fetch_trading_fee(self, symbol: str, params={}):
|
@@ -4008,7 +4008,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4008
4008
|
# }
|
4009
4009
|
# }
|
4010
4010
|
#
|
4011
|
-
data = self.
|
4011
|
+
data = self.safe_dict(response, 'data', {})
|
4012
4012
|
return self.parse_order(data, market)
|
4013
4013
|
|
4014
4014
|
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
@@ -4425,7 +4425,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4425
4425
|
# }
|
4426
4426
|
# }
|
4427
4427
|
#
|
4428
|
-
data = self.
|
4428
|
+
data = self.safe_dict(response, 'data', {})
|
4429
4429
|
return self.parse_order(data, market)
|
4430
4430
|
|
4431
4431
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
@@ -4626,7 +4626,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4626
4626
|
# }
|
4627
4627
|
#
|
4628
4628
|
data = self.safe_value(response, 'data', {})
|
4629
|
-
orders = self.
|
4629
|
+
orders = self.safe_list(data, 'successList', [])
|
4630
4630
|
return self.parse_orders(orders, market)
|
4631
4631
|
|
4632
4632
|
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
@@ -4833,9 +4833,14 @@ class bitget(Exchange, ImplicitAPI):
|
|
4833
4833
|
#
|
4834
4834
|
if isinstance(response, str):
|
4835
4835
|
response = json.loads(response)
|
4836
|
-
data = self.
|
4837
|
-
|
4836
|
+
data = self.safe_dict(response, 'data')
|
4837
|
+
if (data is not None) and not isinstance(data, list):
|
4838
|
+
return self.parse_order(data, market)
|
4839
|
+
dataList = self.safe_list(response, 'data', [])
|
4840
|
+
first = self.safe_dict(dataList, 0, {})
|
4838
4841
|
return self.parse_order(first, market)
|
4842
|
+
# first = self.safe_dict(data, 0, data)
|
4843
|
+
# return self.parse_order(first, market)
|
4839
4844
|
|
4840
4845
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
4841
4846
|
"""
|
@@ -5112,10 +5117,10 @@ class bitget(Exchange, ImplicitAPI):
|
|
5112
5117
|
data = self.safe_value(response, 'data')
|
5113
5118
|
if type == 'spot':
|
5114
5119
|
if (marginMode is not None) or stop:
|
5115
|
-
resultList = self.
|
5120
|
+
resultList = self.safe_list(data, 'orderList', [])
|
5116
5121
|
return self.parse_orders(resultList, market, since, limit)
|
5117
5122
|
else:
|
5118
|
-
result = self.
|
5123
|
+
result = self.safe_list(data, 'entrustedList', [])
|
5119
5124
|
return self.parse_orders(result, market, since, limit)
|
5120
5125
|
return self.parse_orders(data, market, since, limit)
|
5121
5126
|
|
@@ -5445,7 +5450,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
5445
5450
|
return self.parse_orders(self.safe_value(data, 'entrustedList', []), market, since, limit)
|
5446
5451
|
if isinstance(response, str):
|
5447
5452
|
response = json.loads(response)
|
5448
|
-
orders = self.
|
5453
|
+
orders = self.safe_list(response, 'data', [])
|
5449
5454
|
return self.parse_orders(orders, market, since, limit)
|
5450
5455
|
|
5451
5456
|
async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -5816,10 +5821,10 @@ class bitget(Exchange, ImplicitAPI):
|
|
5816
5821
|
#
|
5817
5822
|
data = self.safe_value(response, 'data')
|
5818
5823
|
if (market['swap']) or (market['future']):
|
5819
|
-
fillList = self.
|
5824
|
+
fillList = self.safe_list(data, 'fillList', [])
|
5820
5825
|
return self.parse_trades(fillList, market, since, limit)
|
5821
5826
|
elif marginMode is not None:
|
5822
|
-
fills = self.
|
5827
|
+
fills = self.safe_list(data, 'fills', [])
|
5823
5828
|
return self.parse_trades(fills, market, since, limit)
|
5824
5829
|
return self.parse_trades(data, market, since, limit)
|
5825
5830
|
|
@@ -5877,8 +5882,8 @@ class bitget(Exchange, ImplicitAPI):
|
|
5877
5882
|
# ]
|
5878
5883
|
# }
|
5879
5884
|
#
|
5880
|
-
data = self.
|
5881
|
-
first = self.
|
5885
|
+
data = self.safe_list(response, 'data', [])
|
5886
|
+
first = self.safe_dict(data, 0, {})
|
5882
5887
|
return self.parse_position(first, market)
|
5883
5888
|
|
5884
5889
|
async def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
@@ -6739,7 +6744,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
6739
6744
|
# }
|
6740
6745
|
# }
|
6741
6746
|
#
|
6742
|
-
data = self.
|
6747
|
+
data = self.safe_dict(response, 'data', {})
|
6743
6748
|
return self.parse_open_interest(data, market)
|
6744
6749
|
|
6745
6750
|
def parse_open_interest(self, interest, market: Market = None):
|
@@ -6818,7 +6823,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
6818
6823
|
# ]
|
6819
6824
|
# }
|
6820
6825
|
#
|
6821
|
-
data = self.
|
6826
|
+
data = self.safe_list(response, 'data', [])
|
6822
6827
|
return self.parse_transfers(data, currency, since, limit)
|
6823
6828
|
|
6824
6829
|
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
@@ -7008,7 +7013,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
7008
7013
|
# "requestTime": "1700120731773"
|
7009
7014
|
# }
|
7010
7015
|
#
|
7011
|
-
data = self.
|
7016
|
+
data = self.safe_list(response, 'data', [])
|
7012
7017
|
return self.parse_deposit_withdraw_fees(data, codes, 'coin')
|
7013
7018
|
|
7014
7019
|
async def borrow_cross_margin(self, code: str, amount: float, params={}):
|
@@ -7295,7 +7300,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
7295
7300
|
# }
|
7296
7301
|
#
|
7297
7302
|
data = self.safe_value(response, 'data', {})
|
7298
|
-
liquidations = self.
|
7303
|
+
liquidations = self.safe_list(data, 'resultList', [])
|
7299
7304
|
return self.parse_liquidations(liquidations, market, since, limit)
|
7300
7305
|
|
7301
7306
|
def parse_liquidation(self, liquidation, market: Market = None):
|
@@ -7723,7 +7728,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
7723
7728
|
# }
|
7724
7729
|
#
|
7725
7730
|
data = self.safe_value(response, 'data', {})
|
7726
|
-
order = self.
|
7731
|
+
order = self.safe_list(data, 'successList', [])
|
7727
7732
|
return self.parse_order(order[0], market)
|
7728
7733
|
|
7729
7734
|
async def close_all_positions(self, params={}) -> List[Position]:
|
@@ -7759,7 +7764,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
7759
7764
|
# }
|
7760
7765
|
#
|
7761
7766
|
data = self.safe_value(response, 'data', {})
|
7762
|
-
orderInfo = self.
|
7767
|
+
orderInfo = self.safe_list(data, 'successList', [])
|
7763
7768
|
return self.parse_positions(orderInfo, None, params)
|
7764
7769
|
|
7765
7770
|
async def fetch_margin_mode(self, symbol: str, params={}) -> MarginMode:
|
ccxt/async_support/bithumb.py
CHANGED
@@ -487,7 +487,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
487
487
|
# }
|
488
488
|
# }
|
489
489
|
#
|
490
|
-
data = self.
|
490
|
+
data = self.safe_dict(response, 'data', {})
|
491
491
|
return self.parse_ticker(data, market)
|
492
492
|
|
493
493
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -552,7 +552,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
552
552
|
# }
|
553
553
|
# }
|
554
554
|
#
|
555
|
-
data = self.
|
555
|
+
data = self.safe_list(response, 'data', [])
|
556
556
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
557
557
|
|
558
558
|
def parse_trade(self, trade, market: Market = None) -> Trade:
|
@@ -660,7 +660,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
660
660
|
# ]
|
661
661
|
# }
|
662
662
|
#
|
663
|
-
data = self.
|
663
|
+
data = self.safe_list(response, 'data', [])
|
664
664
|
return self.parse_trades(data, market, since, limit)
|
665
665
|
|
666
666
|
async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
@@ -748,7 +748,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
748
748
|
# }
|
749
749
|
# }
|
750
750
|
#
|
751
|
-
data = self.
|
751
|
+
data = self.safe_dict(response, 'data')
|
752
752
|
return self.parse_order(self.extend(data, {'order_id': id}), market)
|
753
753
|
|
754
754
|
def parse_order_status(self, status):
|
@@ -893,7 +893,7 @@ class bithumb(Exchange, ImplicitAPI):
|
|
893
893
|
# ]
|
894
894
|
# }
|
895
895
|
#
|
896
|
-
data = self.
|
896
|
+
data = self.safe_list(response, 'data', [])
|
897
897
|
return self.parse_orders(data, market, since, limit)
|
898
898
|
|
899
899
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
ccxt/async_support/bitmart.py
CHANGED
@@ -1302,7 +1302,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
1302
1302
|
tickersById = self.index_by(tickers, 'symbol')
|
1303
1303
|
elif market['swap']:
|
1304
1304
|
tickersById = self.index_by(tickers, 'contract_symbol')
|
1305
|
-
ticker = self.
|
1305
|
+
ticker = self.safe_dict(tickersById, market['id'])
|
1306
1306
|
return self.parse_ticker(ticker, market)
|
1307
1307
|
|
1308
1308
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
@@ -1549,7 +1549,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
1549
1549
|
# }
|
1550
1550
|
#
|
1551
1551
|
data = self.safe_value(response, 'data', {})
|
1552
|
-
trades = self.
|
1552
|
+
trades = self.safe_list(data, 'trades', [])
|
1553
1553
|
return self.parse_trades(trades, market, since, limit)
|
1554
1554
|
|
1555
1555
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -1703,7 +1703,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
1703
1703
|
# "trace": "96c989db-e0f5-46f5-bba6-60cfcbde699b"
|
1704
1704
|
# }
|
1705
1705
|
#
|
1706
|
-
ohlcv = self.
|
1706
|
+
ohlcv = self.safe_list(response, 'data', [])
|
1707
1707
|
return self.parse_ohlcvs(ohlcv, market, timeframe, since, limit)
|
1708
1708
|
|
1709
1709
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -1806,7 +1806,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
1806
1806
|
# "trace": "4cad855074634097ac6ba5257c47305d.62.16959616054873723"
|
1807
1807
|
# }
|
1808
1808
|
#
|
1809
|
-
data = self.
|
1809
|
+
data = self.safe_list(response, 'data', [])
|
1810
1810
|
return self.parse_trades(data, market, since, limit)
|
1811
1811
|
|
1812
1812
|
async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -1825,7 +1825,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
1825
1825
|
'orderId': id,
|
1826
1826
|
}
|
1827
1827
|
response = await self.privatePostSpotV4QueryOrderTrades(self.extend(request, params))
|
1828
|
-
data = self.
|
1828
|
+
data = self.safe_list(response, 'data', [])
|
1829
1829
|
return self.parse_trades(data, None, since, limit)
|
1830
1830
|
|
1831
1831
|
def custom_parse_balance(self, response, marketType) -> Balances:
|
@@ -2616,7 +2616,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2616
2616
|
# }
|
2617
2617
|
#
|
2618
2618
|
data = self.safe_value(response, 'data', {})
|
2619
|
-
orders = self.
|
2619
|
+
orders = self.safe_list(data, 'orders', [])
|
2620
2620
|
return self.parse_orders(orders, market, since, limit)
|
2621
2621
|
|
2622
2622
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -2731,7 +2731,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2731
2731
|
# "trace": "7f9d94g10f9d4513bc08a7rfc3a5559a.71.16957022303515933"
|
2732
2732
|
# }
|
2733
2733
|
#
|
2734
|
-
data = self.
|
2734
|
+
data = self.safe_list(response, 'data', [])
|
2735
2735
|
return self.parse_orders(data, market, since, limit)
|
2736
2736
|
|
2737
2737
|
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -2775,7 +2775,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2775
2775
|
response = await self.privatePostSpotV4QueryHistoryOrders(self.extend(request, params))
|
2776
2776
|
else:
|
2777
2777
|
response = await self.privateGetContractPrivateOrderHistory(self.extend(request, params))
|
2778
|
-
data = self.
|
2778
|
+
data = self.safe_list(response, 'data', [])
|
2779
2779
|
return self.parse_orders(data, market, since, limit)
|
2780
2780
|
|
2781
2781
|
async def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -2882,7 +2882,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2882
2882
|
# "trace": "4cad855075664097af6ba5257c47605d.63.14957831547451715"
|
2883
2883
|
# }
|
2884
2884
|
#
|
2885
|
-
data = self.
|
2885
|
+
data = self.safe_dict(response, 'data', {})
|
2886
2886
|
return self.parse_order(data, market)
|
2887
2887
|
|
2888
2888
|
async def fetch_deposit_address(self, code: str, params={}):
|
@@ -2921,7 +2921,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
2921
2921
|
# }
|
2922
2922
|
# }
|
2923
2923
|
#
|
2924
|
-
data = self.
|
2924
|
+
data = self.safe_dict(response, 'data', {})
|
2925
2925
|
return self.parse_deposit_address(data, currency)
|
2926
2926
|
|
2927
2927
|
def parse_deposit_address(self, depositAddress, currency=None):
|
@@ -3058,7 +3058,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
3058
3058
|
# }
|
3059
3059
|
#
|
3060
3060
|
data = self.safe_value(response, 'data', {})
|
3061
|
-
records = self.
|
3061
|
+
records = self.safe_list(data, 'records', [])
|
3062
3062
|
return self.parse_transactions(records, currency, since, limit)
|
3063
3063
|
|
3064
3064
|
async def fetch_deposit(self, id: str, code: Str = None, params={}):
|
@@ -3097,7 +3097,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
3097
3097
|
# }
|
3098
3098
|
#
|
3099
3099
|
data = self.safe_value(response, 'data', {})
|
3100
|
-
record = self.
|
3100
|
+
record = self.safe_dict(data, 'record', {})
|
3101
3101
|
return self.parse_transaction(record)
|
3102
3102
|
|
3103
3103
|
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -3147,7 +3147,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
3147
3147
|
# }
|
3148
3148
|
#
|
3149
3149
|
data = self.safe_value(response, 'data', {})
|
3150
|
-
record = self.
|
3150
|
+
record = self.safe_dict(data, 'record', {})
|
3151
3151
|
return self.parse_transaction(record)
|
3152
3152
|
|
3153
3153
|
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -3665,7 +3665,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
3665
3665
|
# }
|
3666
3666
|
#
|
3667
3667
|
data = self.safe_value(response, 'data', {})
|
3668
|
-
records = self.
|
3668
|
+
records = self.safe_list(data, 'records', [])
|
3669
3669
|
return self.parse_transfers(records, currency, since, limit)
|
3670
3670
|
|
3671
3671
|
async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -3774,7 +3774,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
3774
3774
|
# "trace": "7f9c94e10f9d4513bc08a7bfc2a5559a.72.16946575108274991"
|
3775
3775
|
# }
|
3776
3776
|
#
|
3777
|
-
data = self.
|
3777
|
+
data = self.safe_dict(response, 'data', {})
|
3778
3778
|
return self.parse_open_interest(data, market)
|
3779
3779
|
|
3780
3780
|
def parse_open_interest(self, interest, market: Market = None):
|
@@ -3930,7 +3930,7 @@ class bitmart(Exchange, ImplicitAPI):
|
|
3930
3930
|
# }
|
3931
3931
|
#
|
3932
3932
|
data = self.safe_value(response, 'data', [])
|
3933
|
-
first = self.
|
3933
|
+
first = self.safe_dict(data, 0, {})
|
3934
3934
|
return self.parse_position(first, market)
|
3935
3935
|
|
3936
3936
|
async def fetch_positions(self, symbols: Strings = None, params={}):
|
ccxt/async_support/bitopro.py
CHANGED
@@ -1574,7 +1574,7 @@ class bitopro(Exchange, ImplicitAPI):
|
|
1574
1574
|
# ]
|
1575
1575
|
# }
|
1576
1576
|
#
|
1577
|
-
data = self.
|
1577
|
+
data = self.safe_list(response, 'data', [])
|
1578
1578
|
return self.parse_deposit_withdraw_fees(data, codes, 'currency')
|
1579
1579
|
|
1580
1580
|
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
ccxt/async_support/bitrue.py
CHANGED
@@ -2404,7 +2404,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2404
2404
|
# ]
|
2405
2405
|
# }
|
2406
2406
|
#
|
2407
|
-
data = self.
|
2407
|
+
data = self.safe_list(response, 'data', [])
|
2408
2408
|
return self.parse_transactions(data, currency, since, limit)
|
2409
2409
|
|
2410
2410
|
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -2642,7 +2642,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2642
2642
|
# }
|
2643
2643
|
# }
|
2644
2644
|
#
|
2645
|
-
data = self.
|
2645
|
+
data = self.safe_dict(response, 'data', {})
|
2646
2646
|
return self.parse_transaction(data, currency)
|
2647
2647
|
|
2648
2648
|
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
@@ -2693,7 +2693,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2693
2693
|
"""
|
2694
2694
|
await self.load_markets()
|
2695
2695
|
response = await self.spotV1PublicGetExchangeInfo(params)
|
2696
|
-
coins = self.
|
2696
|
+
coins = self.safe_list(response, 'coins')
|
2697
2697
|
return self.parse_deposit_withdraw_fees(coins, codes, 'coin')
|
2698
2698
|
|
2699
2699
|
def parse_transfer(self, transfer, currency=None):
|
@@ -2811,7 +2811,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
2811
2811
|
# 'data': null
|
2812
2812
|
# }
|
2813
2813
|
#
|
2814
|
-
data = self.
|
2814
|
+
data = self.safe_dict(response, 'data', {})
|
2815
2815
|
return self.parse_transfer(data, currency)
|
2816
2816
|
|
2817
2817
|
async def set_leverage(self, leverage: Int, symbol: Str = None, params={}):
|
ccxt/async_support/bitso.py
CHANGED
@@ -670,7 +670,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
670
670
|
# ]
|
671
671
|
# }
|
672
672
|
#
|
673
|
-
payload = self.
|
673
|
+
payload = self.safe_list(response, 'payload', [])
|
674
674
|
return self.parse_ohlcvs(payload, market, timeframe, since, limit)
|
675
675
|
|
676
676
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -1183,7 +1183,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
1183
1183
|
# }
|
1184
1184
|
#
|
1185
1185
|
transactions = self.safe_value(response, 'payload', [])
|
1186
|
-
first = self.
|
1186
|
+
first = self.safe_dict(transactions, 0, {})
|
1187
1187
|
return self.parse_transaction(first)
|
1188
1188
|
|
1189
1189
|
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -1224,7 +1224,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
1224
1224
|
# }]
|
1225
1225
|
# }
|
1226
1226
|
#
|
1227
|
-
transactions = self.
|
1227
|
+
transactions = self.safe_list(response, 'payload', [])
|
1228
1228
|
return self.parse_transactions(transactions, currency, since, limit, params)
|
1229
1229
|
|
1230
1230
|
async def fetch_deposit_address(self, code: str, params={}):
|
@@ -1396,7 +1396,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
1396
1396
|
# }
|
1397
1397
|
# }
|
1398
1398
|
#
|
1399
|
-
payload = self.
|
1399
|
+
payload = self.safe_list(response, 'payload', [])
|
1400
1400
|
return self.parse_deposit_withdraw_fees(payload, codes)
|
1401
1401
|
|
1402
1402
|
def parse_deposit_withdraw_fees(self, response, codes=None, currencyIdKey=None):
|
@@ -1524,7 +1524,7 @@ class bitso(Exchange, ImplicitAPI):
|
|
1524
1524
|
# }
|
1525
1525
|
#
|
1526
1526
|
payload = self.safe_value(response, 'payload', [])
|
1527
|
-
first = self.
|
1527
|
+
first = self.safe_dict(payload, 0)
|
1528
1528
|
return self.parse_transaction(first, currency)
|
1529
1529
|
|
1530
1530
|
def safe_network(self, networkId):
|
ccxt/async_support/bitstamp.py
CHANGED
@@ -1073,7 +1073,7 @@ class bitstamp(Exchange, ImplicitAPI):
|
|
1073
1073
|
# }
|
1074
1074
|
#
|
1075
1075
|
data = self.safe_value(response, 'data', {})
|
1076
|
-
ohlc = self.
|
1076
|
+
ohlc = self.safe_list(data, 'ohlc', [])
|
1077
1077
|
return self.parse_ohlcvs(ohlc, market, timeframe, since, limit)
|
1078
1078
|
|
1079
1079
|
def parse_balance(self, response) -> Balances:
|