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/luno.py
CHANGED
@@ -465,7 +465,7 @@ class luno(Exchange, ImplicitAPI):
|
|
465
465
|
market = self.market(symbol)
|
466
466
|
request['pair'] = market['id']
|
467
467
|
response = await self.privateGetListorders(self.extend(request, params))
|
468
|
-
orders = self.
|
468
|
+
orders = self.safe_list(response, 'orders', [])
|
469
469
|
return self.parse_orders(orders, market, since, limit)
|
470
470
|
|
471
471
|
async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -703,7 +703,7 @@ class luno(Exchange, ImplicitAPI):
|
|
703
703
|
# ]
|
704
704
|
# }
|
705
705
|
#
|
706
|
-
trades = self.
|
706
|
+
trades = self.safe_list(response, 'trades', [])
|
707
707
|
return self.parse_trades(trades, market, since, limit)
|
708
708
|
|
709
709
|
async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}):
|
@@ -745,7 +745,7 @@ class luno(Exchange, ImplicitAPI):
|
|
745
745
|
# "pair": "XBTEUR"
|
746
746
|
# }
|
747
747
|
#
|
748
|
-
ohlcvs = self.
|
748
|
+
ohlcvs = self.safe_list(response, 'candles', [])
|
749
749
|
return self.parse_ohlcvs(ohlcvs, market, timeframe, since, limit)
|
750
750
|
|
751
751
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -809,7 +809,7 @@ class luno(Exchange, ImplicitAPI):
|
|
809
809
|
# ]
|
810
810
|
# }
|
811
811
|
#
|
812
|
-
trades = self.
|
812
|
+
trades = self.safe_list(response, 'trades', [])
|
813
813
|
return self.parse_trades(trades, market, since, limit)
|
814
814
|
|
815
815
|
async def fetch_trading_fee(self, symbol: str, params={}):
|
ccxt/async_support/mercado.py
CHANGED
@@ -492,7 +492,7 @@ class mercado(Exchange, ImplicitAPI):
|
|
492
492
|
# }
|
493
493
|
#
|
494
494
|
responseData = self.safe_value(response, 'response_data', {})
|
495
|
-
order = self.
|
495
|
+
order = self.safe_dict(responseData, 'order', {})
|
496
496
|
return self.parse_order(order, market)
|
497
497
|
|
498
498
|
def parse_order_status(self, status):
|
@@ -591,7 +591,7 @@ class mercado(Exchange, ImplicitAPI):
|
|
591
591
|
}
|
592
592
|
response = await self.privatePostGetOrder(self.extend(request, params))
|
593
593
|
responseData = self.safe_value(response, 'response_data', {})
|
594
|
-
order = self.
|
594
|
+
order = self.safe_dict(responseData, 'order')
|
595
595
|
return self.parse_order(order, market)
|
596
596
|
|
597
597
|
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
@@ -648,7 +648,7 @@ class mercado(Exchange, ImplicitAPI):
|
|
648
648
|
# }
|
649
649
|
#
|
650
650
|
responseData = self.safe_value(response, 'response_data', {})
|
651
|
-
withdrawal = self.
|
651
|
+
withdrawal = self.safe_dict(responseData, 'withdrawal')
|
652
652
|
return self.parse_transaction(withdrawal, currency)
|
653
653
|
|
654
654
|
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
@@ -745,7 +745,7 @@ class mercado(Exchange, ImplicitAPI):
|
|
745
745
|
}
|
746
746
|
response = await self.privatePostListOrders(self.extend(request, params))
|
747
747
|
responseData = self.safe_value(response, 'response_data', {})
|
748
|
-
orders = self.
|
748
|
+
orders = self.safe_list(responseData, 'orders', [])
|
749
749
|
return self.parse_orders(orders, market, since, limit)
|
750
750
|
|
751
751
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -767,7 +767,7 @@ class mercado(Exchange, ImplicitAPI):
|
|
767
767
|
}
|
768
768
|
response = await self.privatePostListOrders(self.extend(request, params))
|
769
769
|
responseData = self.safe_value(response, 'response_data', {})
|
770
|
-
orders = self.
|
770
|
+
orders = self.safe_list(responseData, 'orders', [])
|
771
771
|
return self.parse_orders(orders, market, since, limit)
|
772
772
|
|
773
773
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
ccxt/async_support/mexc.py
CHANGED
@@ -2680,7 +2680,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
2680
2680
|
# ]
|
2681
2681
|
# }
|
2682
2682
|
#
|
2683
|
-
data = self.
|
2683
|
+
data = self.safe_list(response, 'data')
|
2684
2684
|
return self.parse_orders(data, market)
|
2685
2685
|
|
2686
2686
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -2930,7 +2930,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
2930
2930
|
# ]
|
2931
2931
|
# }
|
2932
2932
|
#
|
2933
|
-
data = self.
|
2933
|
+
data = self.safe_list(response, 'data')
|
2934
2934
|
return self.parse_orders(data, market)
|
2935
2935
|
|
2936
2936
|
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
@@ -3013,7 +3013,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
3013
3013
|
# "code": "0"
|
3014
3014
|
# }
|
3015
3015
|
#
|
3016
|
-
data = self.
|
3016
|
+
data = self.safe_list(response, 'data', [])
|
3017
3017
|
return self.parse_orders(data, market)
|
3018
3018
|
|
3019
3019
|
def parse_order(self, order, market: Market = None) -> Order:
|
@@ -4084,7 +4084,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4084
4084
|
# ]
|
4085
4085
|
# }
|
4086
4086
|
#
|
4087
|
-
data = self.
|
4087
|
+
data = self.safe_list(response, 'data')
|
4088
4088
|
return self.parse_leverage_tiers(data, symbols, 'symbol')
|
4089
4089
|
|
4090
4090
|
def parse_market_leverage_tiers(self, info, market: Market = None):
|
@@ -4505,7 +4505,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4505
4505
|
# ]
|
4506
4506
|
# }
|
4507
4507
|
#
|
4508
|
-
data = self.
|
4508
|
+
data = self.safe_list(response, 'data', [])
|
4509
4509
|
return self.parse_positions(data, symbols)
|
4510
4510
|
|
4511
4511
|
def parse_position(self, position, market: Market = None):
|
@@ -4596,7 +4596,7 @@ class mexc(Exchange, ImplicitAPI):
|
|
4596
4596
|
# }
|
4597
4597
|
# }
|
4598
4598
|
#
|
4599
|
-
data = self.
|
4599
|
+
data = self.safe_dict(response, 'data', {})
|
4600
4600
|
return self.parse_transfer(data)
|
4601
4601
|
elif marketType == 'swap':
|
4602
4602
|
raise BadRequest(self.id + ' fetchTransfer() is not supported for ' + marketType)
|
ccxt/async_support/ndax.py
CHANGED
@@ -1858,7 +1858,7 @@ class ndax(Exchange, ImplicitAPI):
|
|
1858
1858
|
# ]
|
1859
1859
|
#
|
1860
1860
|
grouped = self.group_by(response, 'ChangeReason')
|
1861
|
-
trades = self.
|
1861
|
+
trades = self.safe_list(grouped, 'Trade', [])
|
1862
1862
|
return self.parse_trades(trades, market, since, limit)
|
1863
1863
|
|
1864
1864
|
async def fetch_deposit_address(self, code: str, params={}):
|
ccxt/async_support/novadax.py
CHANGED
@@ -405,7 +405,7 @@ class novadax(Exchange, ImplicitAPI):
|
|
405
405
|
# "message":"Success"
|
406
406
|
# }
|
407
407
|
#
|
408
|
-
data = self.
|
408
|
+
data = self.safe_dict(response, 'data', {})
|
409
409
|
return self.parse_ticker(data, market)
|
410
410
|
|
411
411
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
@@ -593,7 +593,7 @@ class novadax(Exchange, ImplicitAPI):
|
|
593
593
|
# "message":"Success"
|
594
594
|
# }
|
595
595
|
#
|
596
|
-
data = self.
|
596
|
+
data = self.safe_list(response, 'data', [])
|
597
597
|
return self.parse_trades(data, market, since, limit)
|
598
598
|
|
599
599
|
async def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
@@ -644,7 +644,7 @@ class novadax(Exchange, ImplicitAPI):
|
|
644
644
|
# "message": "Success"
|
645
645
|
# }
|
646
646
|
#
|
647
|
-
data = self.
|
647
|
+
data = self.safe_list(response, 'data', [])
|
648
648
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
649
649
|
|
650
650
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -804,7 +804,7 @@ class novadax(Exchange, ImplicitAPI):
|
|
804
804
|
# "message": "Success"
|
805
805
|
# }
|
806
806
|
#
|
807
|
-
data = self.
|
807
|
+
data = self.safe_dict(response, 'data', {})
|
808
808
|
return self.parse_order(data, market)
|
809
809
|
|
810
810
|
async def cancel_order(self, id: str, symbol: Str = None, params={}):
|
@@ -830,7 +830,7 @@ class novadax(Exchange, ImplicitAPI):
|
|
830
830
|
# "message": "Success"
|
831
831
|
# }
|
832
832
|
#
|
833
|
-
data = self.
|
833
|
+
data = self.safe_dict(response, 'data', {})
|
834
834
|
return self.parse_order(data)
|
835
835
|
|
836
836
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
@@ -867,7 +867,7 @@ class novadax(Exchange, ImplicitAPI):
|
|
867
867
|
# "message": "Success"
|
868
868
|
# }
|
869
869
|
#
|
870
|
-
data = self.
|
870
|
+
data = self.safe_dict(response, 'data', {})
|
871
871
|
return self.parse_order(data)
|
872
872
|
|
873
873
|
async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -922,7 +922,7 @@ class novadax(Exchange, ImplicitAPI):
|
|
922
922
|
# "message": "Success"
|
923
923
|
# }
|
924
924
|
#
|
925
|
-
data = self.
|
925
|
+
data = self.safe_list(response, 'data', [])
|
926
926
|
return self.parse_orders(data, market, since, limit)
|
927
927
|
|
928
928
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -1297,7 +1297,7 @@ class novadax(Exchange, ImplicitAPI):
|
|
1297
1297
|
# "message": "Success"
|
1298
1298
|
# }
|
1299
1299
|
#
|
1300
|
-
data = self.
|
1300
|
+
data = self.safe_list(response, 'data', [])
|
1301
1301
|
return self.parse_transactions(data, currency, since, limit)
|
1302
1302
|
|
1303
1303
|
def parse_transaction_status(self, status):
|
@@ -1435,7 +1435,7 @@ class novadax(Exchange, ImplicitAPI):
|
|
1435
1435
|
# "message": "Success"
|
1436
1436
|
# }
|
1437
1437
|
#
|
1438
|
-
data = self.
|
1438
|
+
data = self.safe_list(response, 'data', [])
|
1439
1439
|
return self.parse_trades(data, market, since, limit)
|
1440
1440
|
|
1441
1441
|
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
ccxt/async_support/oceanex.py
CHANGED
@@ -271,7 +271,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
271
271
|
# }
|
272
272
|
# }
|
273
273
|
#
|
274
|
-
data = self.
|
274
|
+
data = self.safe_dict(response, 'data', {})
|
275
275
|
return self.parse_ticker(data, market)
|
276
276
|
|
277
277
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
@@ -484,7 +484,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
484
484
|
# ]
|
485
485
|
# }
|
486
486
|
#
|
487
|
-
data = self.
|
487
|
+
data = self.safe_list(response, 'data')
|
488
488
|
return self.parse_trades(data, market, since, limit)
|
489
489
|
|
490
490
|
def parse_trade(self, trade, market: Market = None) -> Trade:
|
@@ -620,7 +620,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
620
620
|
if type == 'limit':
|
621
621
|
request['price'] = self.price_to_precision(symbol, price)
|
622
622
|
response = await self.privatePostOrders(self.extend(request, params))
|
623
|
-
data = self.
|
623
|
+
data = self.safe_dict(response, 'data')
|
624
624
|
return self.parse_order(data, market)
|
625
625
|
|
626
626
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
@@ -752,7 +752,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
752
752
|
if limit is not None:
|
753
753
|
request['limit'] = limit
|
754
754
|
response = await self.publicPostK(self.extend(request, params))
|
755
|
-
ohlcvs = self.
|
755
|
+
ohlcvs = self.safe_list(response, 'data', [])
|
756
756
|
return self.parse_ohlcvs(ohlcvs, market, timeframe, since, limit)
|
757
757
|
|
758
758
|
def parse_order(self, order, market: Market = None) -> Order:
|
@@ -828,7 +828,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
828
828
|
"""
|
829
829
|
await self.load_markets()
|
830
830
|
response = await self.privatePostOrderDelete(self.extend({'id': id}, params))
|
831
|
-
data = self.
|
831
|
+
data = self.safe_dict(response, 'data')
|
832
832
|
return self.parse_order(data)
|
833
833
|
|
834
834
|
async def cancel_orders(self, ids, symbol: Str = None, params={}):
|
@@ -842,7 +842,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
842
842
|
"""
|
843
843
|
await self.load_markets()
|
844
844
|
response = await self.privatePostOrderDeleteMulti(self.extend({'ids': ids}, params))
|
845
|
-
data = self.
|
845
|
+
data = self.safe_list(response, 'data')
|
846
846
|
return self.parse_orders(data)
|
847
847
|
|
848
848
|
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
@@ -855,7 +855,7 @@ class oceanex(Exchange, ImplicitAPI):
|
|
855
855
|
"""
|
856
856
|
await self.load_markets()
|
857
857
|
response = await self.privatePostOrdersClear(params)
|
858
|
-
data = self.
|
858
|
+
data = self.safe_list(response, 'data')
|
859
859
|
return self.parse_orders(data)
|
860
860
|
|
861
861
|
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
ccxt/async_support/okcoin.py
CHANGED
@@ -971,7 +971,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
971
971
|
'instType': 'SPOT',
|
972
972
|
}
|
973
973
|
response = await self.publicGetMarketTickers(self.extend(request, params))
|
974
|
-
data = self.
|
974
|
+
data = self.safe_list(response, 'data', [])
|
975
975
|
return self.parse_tickers(data, symbols, params)
|
976
976
|
|
977
977
|
def parse_trade(self, trade, market: Market = None) -> Trade:
|
@@ -1072,7 +1072,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1072
1072
|
response = await self.publicGetMarketTrades(self.extend(request, params))
|
1073
1073
|
else:
|
1074
1074
|
response = await self.publicGetMarketHistoryTrades(self.extend(request, params))
|
1075
|
-
data = self.
|
1075
|
+
data = self.safe_list(response, 'data', [])
|
1076
1076
|
return self.parse_trades(data, market, since, limit)
|
1077
1077
|
|
1078
1078
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -1130,7 +1130,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1130
1130
|
response = await self.publicGetMarketCandles(self.extend(request, params))
|
1131
1131
|
else:
|
1132
1132
|
response = await self.publicGetMarketHistoryCandles(self.extend(request, params))
|
1133
|
-
data = self.
|
1133
|
+
data = self.safe_list(response, 'data', [])
|
1134
1134
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
1135
1135
|
|
1136
1136
|
def parse_account_balance(self, response):
|
@@ -1571,7 +1571,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1571
1571
|
response = await self.privatePostTradeCancelOrder(self.extend(request, query))
|
1572
1572
|
# {"code":"0","data":[{"clOrdId":"","ordId":"317251910906576896","sCode":"0","sMsg":""}],"msg":""}
|
1573
1573
|
data = self.safe_value(response, 'data', [])
|
1574
|
-
order = self.
|
1574
|
+
order = self.safe_dict(data, 0)
|
1575
1575
|
return self.parse_order(order, market)
|
1576
1576
|
|
1577
1577
|
def parse_ids(self, ids):
|
@@ -1654,7 +1654,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1654
1654
|
# }
|
1655
1655
|
#
|
1656
1656
|
#
|
1657
|
-
ordersData = self.
|
1657
|
+
ordersData = self.safe_list(response, 'data', [])
|
1658
1658
|
return self.parse_orders(ordersData, market, None, None, params)
|
1659
1659
|
|
1660
1660
|
def parse_order_status(self, status):
|
@@ -1895,7 +1895,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1895
1895
|
else:
|
1896
1896
|
response = await self.privateGetTradeOrder(self.extend(request, query))
|
1897
1897
|
data = self.safe_value(response, 'data', [])
|
1898
|
-
order = self.
|
1898
|
+
order = self.safe_dict(data, 0)
|
1899
1899
|
return self.parse_order(order)
|
1900
1900
|
|
1901
1901
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -1936,7 +1936,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1936
1936
|
response = await self.privateGetTradeOrdersAlgoPending(self.extend(request, params))
|
1937
1937
|
else:
|
1938
1938
|
response = await self.privateGetTradeOrdersPending(self.extend(request, params))
|
1939
|
-
data = self.
|
1939
|
+
data = self.safe_list(response, 'data', [])
|
1940
1940
|
return self.parse_orders(data, market, since, limit)
|
1941
1941
|
|
1942
1942
|
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -2017,7 +2017,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2017
2017
|
# "msg":""
|
2018
2018
|
# }
|
2019
2019
|
#
|
2020
|
-
data = self.
|
2020
|
+
data = self.safe_list(response, 'data', [])
|
2021
2021
|
return self.parse_orders(data, market, since, limit)
|
2022
2022
|
|
2023
2023
|
def parse_deposit_address(self, depositAddress, currency: Currency = None):
|
@@ -2223,7 +2223,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2223
2223
|
# }
|
2224
2224
|
#
|
2225
2225
|
data = self.safe_value(response, 'data', [])
|
2226
|
-
rawTransfer = self.
|
2226
|
+
rawTransfer = self.safe_dict(data, 0, {})
|
2227
2227
|
return self.parse_transfer(rawTransfer, currency)
|
2228
2228
|
|
2229
2229
|
def parse_transfer(self, transfer, currency: Currency = None):
|
@@ -2359,7 +2359,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2359
2359
|
# }
|
2360
2360
|
#
|
2361
2361
|
data = self.safe_value(response, 'data', [])
|
2362
|
-
transaction = self.
|
2362
|
+
transaction = self.safe_dict(data, 0)
|
2363
2363
|
return self.parse_transaction(transaction, currency)
|
2364
2364
|
|
2365
2365
|
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -2428,7 +2428,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2428
2428
|
# ]
|
2429
2429
|
# }
|
2430
2430
|
#
|
2431
|
-
data = self.
|
2431
|
+
data = self.safe_list(response, 'data', [])
|
2432
2432
|
return self.parse_transactions(data, currency, since, limit, params)
|
2433
2433
|
|
2434
2434
|
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -2489,7 +2489,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2489
2489
|
# ]
|
2490
2490
|
# }
|
2491
2491
|
#
|
2492
|
-
data = self.
|
2492
|
+
data = self.safe_list(response, 'data', [])
|
2493
2493
|
return self.parse_transactions(data, currency, since, limit, params)
|
2494
2494
|
|
2495
2495
|
def parse_transaction_status(self, status):
|
@@ -2650,7 +2650,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2650
2650
|
response = await self.privateGetTradeFillsHistory(self.extend(request, params))
|
2651
2651
|
else:
|
2652
2652
|
response = await self.privateGetTradeFills(self.extend(request, params))
|
2653
|
-
data = self.
|
2653
|
+
data = self.safe_list(response, 'data', [])
|
2654
2654
|
return self.parse_trades(data, market, since, limit)
|
2655
2655
|
|
2656
2656
|
async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
ccxt/async_support/okx.py
CHANGED
@@ -1139,14 +1139,6 @@ class okx(Exchange, ImplicitAPI):
|
|
1139
1139
|
exchangeTypes = self.safe_value(self.options, 'exchangeType', {})
|
1140
1140
|
return self.safe_string(exchangeTypes, type, type)
|
1141
1141
|
|
1142
|
-
def convert_expire_date(self, date):
|
1143
|
-
# parse YYMMDD to timestamp
|
1144
|
-
year = date[0:2]
|
1145
|
-
month = date[2:4]
|
1146
|
-
day = date[4:6]
|
1147
|
-
reconstructedDate = '20' + year + '-' + month + '-' + day + 'T00:00:00Z'
|
1148
|
-
return reconstructedDate
|
1149
|
-
|
1150
1142
|
def create_expired_option_market(self, symbol: str):
|
1151
1143
|
# support expired option contracts
|
1152
1144
|
quote = 'USD'
|
@@ -1833,7 +1825,7 @@ class okx(Exchange, ImplicitAPI):
|
|
1833
1825
|
# }
|
1834
1826
|
#
|
1835
1827
|
data = self.safe_value(response, 'data', [])
|
1836
|
-
first = self.
|
1828
|
+
first = self.safe_dict(data, 0, {})
|
1837
1829
|
return self.parse_ticker(first, market)
|
1838
1830
|
|
1839
1831
|
async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
@@ -2046,7 +2038,7 @@ class okx(Exchange, ImplicitAPI):
|
|
2046
2038
|
# "msg": ""
|
2047
2039
|
# }
|
2048
2040
|
#
|
2049
|
-
data = self.
|
2041
|
+
data = self.safe_list(response, 'data', [])
|
2050
2042
|
return self.parse_trades(data, market, since, limit)
|
2051
2043
|
|
2052
2044
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -2162,7 +2154,7 @@ class okx(Exchange, ImplicitAPI):
|
|
2162
2154
|
# ]
|
2163
2155
|
# }
|
2164
2156
|
#
|
2165
|
-
data = self.
|
2157
|
+
data = self.safe_list(response, 'data', [])
|
2166
2158
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
2167
2159
|
|
2168
2160
|
async def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -2803,7 +2795,7 @@ class okx(Exchange, ImplicitAPI):
|
|
2803
2795
|
# "msg": "",
|
2804
2796
|
# "outTime": "1697979038586493"
|
2805
2797
|
# }
|
2806
|
-
data = self.
|
2798
|
+
data = self.safe_list(response, 'data', [])
|
2807
2799
|
return self.parse_orders(data)
|
2808
2800
|
|
2809
2801
|
def edit_order_request(self, id: str, symbol, type, side, amount=None, price=None, params={}):
|
@@ -2980,7 +2972,7 @@ class okx(Exchange, ImplicitAPI):
|
|
2980
2972
|
response = await self.privatePostTradeCancelOrder(self.extend(request, query))
|
2981
2973
|
# {"code":"0","data":[{"clOrdId":"","ordId":"317251910906576896","sCode":"0","sMsg":""}],"msg":""}
|
2982
2974
|
data = self.safe_value(response, 'data', [])
|
2983
|
-
order = self.
|
2975
|
+
order = self.safe_dict(data, 0)
|
2984
2976
|
return self.parse_order(order, market)
|
2985
2977
|
|
2986
2978
|
def parse_ids(self, ids):
|
@@ -3080,7 +3072,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3080
3072
|
# "msg": ""
|
3081
3073
|
# }
|
3082
3074
|
#
|
3083
|
-
ordersData = self.
|
3075
|
+
ordersData = self.safe_list(response, 'data', [])
|
3084
3076
|
return self.parse_orders(ordersData, market, None, None, params)
|
3085
3077
|
|
3086
3078
|
def parse_order_status(self, status):
|
@@ -3434,7 +3426,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3434
3426
|
# }
|
3435
3427
|
#
|
3436
3428
|
data = self.safe_value(response, 'data', [])
|
3437
|
-
order = self.
|
3429
|
+
order = self.safe_dict(data, 0)
|
3438
3430
|
return self.parse_order(order, market)
|
3439
3431
|
|
3440
3432
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -3588,7 +3580,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3588
3580
|
# "msg": ""
|
3589
3581
|
# }
|
3590
3582
|
#
|
3591
|
-
data = self.
|
3583
|
+
data = self.safe_list(response, 'data', [])
|
3592
3584
|
return self.parse_orders(data, market, since, limit)
|
3593
3585
|
|
3594
3586
|
async def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -3761,7 +3753,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3761
3753
|
# "msg": ""
|
3762
3754
|
# }
|
3763
3755
|
#
|
3764
|
-
data = self.
|
3756
|
+
data = self.safe_list(response, 'data', [])
|
3765
3757
|
return self.parse_orders(data, market, since, limit)
|
3766
3758
|
|
3767
3759
|
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -3935,7 +3927,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3935
3927
|
# "msg": ""
|
3936
3928
|
# }
|
3937
3929
|
#
|
3938
|
-
data = self.
|
3930
|
+
data = self.safe_list(response, 'data', [])
|
3939
3931
|
return self.parse_orders(data, market, since, limit)
|
3940
3932
|
|
3941
3933
|
async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -4001,7 +3993,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4001
3993
|
# "msg": ""
|
4002
3994
|
# }
|
4003
3995
|
#
|
4004
|
-
data = self.
|
3996
|
+
data = self.safe_list(response, 'data', [])
|
4005
3997
|
return self.parse_trades(data, market, since, limit, query)
|
4006
3998
|
|
4007
3999
|
async def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -4451,7 +4443,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4451
4443
|
# }
|
4452
4444
|
#
|
4453
4445
|
data = self.safe_value(response, 'data', [])
|
4454
|
-
transaction = self.
|
4446
|
+
transaction = self.safe_dict(data, 0)
|
4455
4447
|
return self.parse_transaction(transaction, currency)
|
4456
4448
|
|
4457
4449
|
async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -4526,7 +4518,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4526
4518
|
# ]
|
4527
4519
|
# }
|
4528
4520
|
#
|
4529
|
-
data = self.
|
4521
|
+
data = self.safe_list(response, 'data', [])
|
4530
4522
|
return self.parse_transactions(data, currency, since, limit, params)
|
4531
4523
|
|
4532
4524
|
async def fetch_deposit(self, id: str, code: Str = None, params={}):
|
@@ -4548,7 +4540,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4548
4540
|
request['ccy'] = currency['id']
|
4549
4541
|
response = await self.privateGetAssetDepositHistory(self.extend(request, params))
|
4550
4542
|
data = self.safe_value(response, 'data')
|
4551
|
-
deposit = self.
|
4543
|
+
deposit = self.safe_dict(data, 0, {})
|
4552
4544
|
return self.parse_transaction(deposit, currency)
|
4553
4545
|
|
4554
4546
|
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -4615,7 +4607,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4615
4607
|
# ]
|
4616
4608
|
# }
|
4617
4609
|
#
|
4618
|
-
data = self.
|
4610
|
+
data = self.safe_list(response, 'data', [])
|
4619
4611
|
return self.parse_transactions(data, currency, since, limit, params)
|
4620
4612
|
|
4621
4613
|
async def fetch_withdrawal(self, id: str, code: Str = None, params={}):
|
@@ -4658,7 +4650,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4658
4650
|
# }
|
4659
4651
|
#
|
4660
4652
|
data = self.safe_value(response, 'data')
|
4661
|
-
withdrawal = self.
|
4653
|
+
withdrawal = self.safe_dict(data, 0, {})
|
4662
4654
|
return self.parse_transaction(withdrawal)
|
4663
4655
|
|
4664
4656
|
def parse_transaction_status(self, status):
|
@@ -5242,7 +5234,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5242
5234
|
# }
|
5243
5235
|
#
|
5244
5236
|
data = self.safe_value(response, 'data', [])
|
5245
|
-
rawTransfer = self.
|
5237
|
+
rawTransfer = self.safe_dict(data, 0, {})
|
5246
5238
|
return self.parse_transfer(rawTransfer, currency)
|
5247
5239
|
|
5248
5240
|
def parse_transfer(self, transfer, currency: Currency = None):
|
@@ -5355,7 +5347,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5355
5347
|
# }
|
5356
5348
|
#
|
5357
5349
|
data = self.safe_value(response, 'data', [])
|
5358
|
-
transfer = self.
|
5350
|
+
transfer = self.safe_dict(data, 0)
|
5359
5351
|
return self.parse_transfer(transfer)
|
5360
5352
|
|
5361
5353
|
async def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -5413,7 +5405,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5413
5405
|
# "msg": ""
|
5414
5406
|
# }
|
5415
5407
|
#
|
5416
|
-
transfers = self.
|
5408
|
+
transfers = self.safe_list(response, 'data', [])
|
5417
5409
|
return self.parse_transfers(transfers, currency, since, limit, params)
|
5418
5410
|
|
5419
5411
|
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
@@ -6384,7 +6376,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6384
6376
|
# "msg": ""
|
6385
6377
|
# }
|
6386
6378
|
#
|
6387
|
-
data = self.
|
6379
|
+
data = self.safe_list(response, 'data', [])
|
6388
6380
|
return self.parse_open_interest(data[0], market)
|
6389
6381
|
|
6390
6382
|
async def fetch_open_interest_history(self, symbol: str, timeframe='1d', since: Int = None, limit: Int = None, params={}):
|
@@ -6446,7 +6438,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6446
6438
|
# "msg": ''
|
6447
6439
|
# }
|
6448
6440
|
#
|
6449
|
-
data = self.
|
6441
|
+
data = self.safe_list(response, 'data', [])
|
6450
6442
|
return self.parse_open_interests(data, None, since, limit)
|
6451
6443
|
|
6452
6444
|
def parse_open_interest(self, interest, market: Market = None):
|
@@ -6561,7 +6553,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6561
6553
|
# "msg": ""
|
6562
6554
|
# }
|
6563
6555
|
#
|
6564
|
-
data = self.
|
6556
|
+
data = self.safe_list(response, 'data')
|
6565
6557
|
return self.parse_deposit_withdraw_fees(data, codes)
|
6566
6558
|
|
6567
6559
|
def parse_deposit_withdraw_fees(self, response, codes=None, currencyIdKey=None):
|
@@ -6909,7 +6901,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6909
6901
|
# }
|
6910
6902
|
#
|
6911
6903
|
data = self.safe_value(response, 'data')
|
6912
|
-
order = self.
|
6904
|
+
order = self.safe_dict(data, 0)
|
6913
6905
|
return self.parse_order(order, market)
|
6914
6906
|
|
6915
6907
|
async def fetch_option(self, symbol: str, params={}) -> Option:
|
ccxt/async_support/onetrading.py
CHANGED
@@ -1117,7 +1117,7 @@ class onetrading(Exchange, ImplicitAPI):
|
|
1117
1117
|
# "cursor": "eyJhY2NvdW50X2lkIjp7InMiOiJlMzY5YWM4MC00NTc3LTExZTktYWUwOC05YmVkYzQ3OTBiODQiLCJzcyI6W10sIm5zIjpbXSwiYnMiOltdLCJtIjp7fSwibCI6W119LCJpdGVtX2tleSI6eyJzIjoiV0lUSERSQVdBTDo6MmFlMjYwY2ItOTk3MC00YmNiLTgxNmEtZGY4MDVmY2VhZTY1Iiwic3MiOltdLCJucyI6W10sImJzIjpbXSwibSI6e30sImwiOltdfSwiZ2xvYmFsX3dpdGhkcmF3YWxfaW5kZXhfaGFzaF9rZXkiOnsicyI6ImUzNjlhYzgwLTQ1NzctMTFlOS1hZTA4LTliZWRjNDc5MGI4NCIsInNzIjpbXSwibnMiOltdLCJicyI6W10sIm0iOnt9LCJsIjpbXX0sInRpbWVzdGFtcCI6eyJuIjoiMTU4ODA1ODc2Nzk0OCIsInNzIjpbXSwibnMiOltdLCJicyI6W10sIm0iOnt9LCJsIjpbXX19"
|
1118
1118
|
# }
|
1119
1119
|
#
|
1120
|
-
depositHistory = self.
|
1120
|
+
depositHistory = self.safe_list(response, 'deposit_history', [])
|
1121
1121
|
return self.parse_transactions(depositHistory, currency, since, limit, {'type': 'deposit'})
|
1122
1122
|
|
1123
1123
|
async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -1176,7 +1176,7 @@ class onetrading(Exchange, ImplicitAPI):
|
|
1176
1176
|
# "max_page_size": 2
|
1177
1177
|
# }
|
1178
1178
|
#
|
1179
|
-
withdrawalHistory = self.
|
1179
|
+
withdrawalHistory = self.safe_list(response, 'withdrawal_history', [])
|
1180
1180
|
return self.parse_transactions(withdrawalHistory, currency, since, limit, {'type': 'withdrawal'})
|
1181
1181
|
|
1182
1182
|
async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
@@ -1737,7 +1737,7 @@ class onetrading(Exchange, ImplicitAPI):
|
|
1737
1737
|
# "max_page_size": 100
|
1738
1738
|
# }
|
1739
1739
|
#
|
1740
|
-
orderHistory = self.
|
1740
|
+
orderHistory = self.safe_list(response, 'order_history', [])
|
1741
1741
|
return self.parse_orders(orderHistory, market, since, limit)
|
1742
1742
|
|
1743
1743
|
async def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -1868,7 +1868,7 @@ class onetrading(Exchange, ImplicitAPI):
|
|
1868
1868
|
# "cursor": "string"
|
1869
1869
|
# }
|
1870
1870
|
#
|
1871
|
-
tradeHistory = self.
|
1871
|
+
tradeHistory = self.safe_list(response, 'trade_history', [])
|
1872
1872
|
return self.parse_trades(tradeHistory, market, since, limit)
|
1873
1873
|
|
1874
1874
|
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|