ccxt 4.2.83__py2.py3-none-any.whl → 4.2.85__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ccxt/__init__.py +1 -1
- ccxt/abstract/bybit.py +1 -1
- ccxt/ace.py +5 -5
- ccxt/ascendex.py +8 -8
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +5 -5
- ccxt/async_support/ascendex.py +8 -8
- ccxt/async_support/base/exchange.py +3 -27
- ccxt/async_support/bigone.py +12 -12
- ccxt/async_support/binance.py +20 -32
- ccxt/async_support/bingx.py +12 -9
- ccxt/async_support/bit2c.py +1 -1
- ccxt/async_support/bitbank.py +8 -8
- ccxt/async_support/bitbns.py +5 -5
- ccxt/async_support/bitfinex.py +1 -1
- ccxt/async_support/bitfinex2.py +1 -1
- ccxt/async_support/bitget.py +39 -28
- ccxt/async_support/bithumb.py +5 -5
- ccxt/async_support/bitmart.py +16 -16
- ccxt/async_support/bitopro.py +1 -1
- ccxt/async_support/bitrue.py +4 -4
- ccxt/async_support/bitso.py +5 -5
- ccxt/async_support/bitstamp.py +1 -1
- ccxt/async_support/bitteam.py +8 -8
- ccxt/async_support/bl3p.py +1 -1
- ccxt/async_support/btcturk.py +6 -6
- ccxt/async_support/bybit.py +34 -87
- ccxt/async_support/coincheck.py +4 -4
- ccxt/async_support/coinex.py +12 -13
- ccxt/async_support/coinlist.py +7 -7
- ccxt/async_support/coinmate.py +4 -4
- ccxt/async_support/coinmetro.py +3 -3
- ccxt/async_support/coinone.py +5 -5
- ccxt/async_support/coinspot.py +2 -2
- ccxt/async_support/cryptocom.py +17 -17
- ccxt/async_support/currencycom.py +1 -1
- ccxt/async_support/delta.py +0 -8
- ccxt/async_support/deribit.py +16 -80
- ccxt/async_support/digifinex.py +8 -8
- ccxt/async_support/exmo.py +8 -8
- ccxt/async_support/gate.py +0 -8
- ccxt/async_support/hitbtc.py +5 -4
- ccxt/async_support/hollaex.py +7 -7
- ccxt/async_support/htx.py +12 -34
- ccxt/async_support/huobijp.py +3 -3
- ccxt/async_support/idex.py +2 -2
- ccxt/async_support/independentreserve.py +2 -2
- ccxt/async_support/indodax.py +2 -2
- ccxt/async_support/kraken.py +8 -8
- ccxt/async_support/krakenfutures.py +6 -6
- ccxt/async_support/kucoin.py +14 -2
- ccxt/async_support/kucoinfutures.py +8 -8
- ccxt/async_support/kuna.py +16 -16
- ccxt/async_support/latoken.py +2 -2
- ccxt/async_support/lbank.py +10 -10
- ccxt/async_support/luno.py +4 -4
- ccxt/async_support/mercado.py +5 -5
- ccxt/async_support/mexc.py +6 -6
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/novadax.py +9 -9
- ccxt/async_support/oceanex.py +7 -7
- ccxt/async_support/okcoin.py +13 -13
- ccxt/async_support/okx.py +23 -31
- ccxt/async_support/onetrading.py +4 -4
- ccxt/async_support/p2b.py +7 -7
- ccxt/async_support/phemex.py +12 -12
- ccxt/async_support/poloniexfutures.py +5 -5
- ccxt/async_support/probit.py +11 -11
- ccxt/async_support/timex.py +7 -7
- ccxt/async_support/tokocrypto.py +9 -9
- ccxt/async_support/wavesexchange.py +3 -3
- ccxt/async_support/whitebit.py +5 -5
- ccxt/async_support/woo.py +1 -1
- ccxt/async_support/zaif.py +1 -1
- ccxt/async_support/zonda.py +7 -7
- ccxt/base/exchange.py +66 -23
- ccxt/bigone.py +12 -12
- ccxt/binance.py +20 -32
- ccxt/bingx.py +12 -9
- ccxt/bit2c.py +1 -1
- ccxt/bitbank.py +8 -8
- ccxt/bitbns.py +5 -5
- ccxt/bitfinex.py +1 -1
- ccxt/bitfinex2.py +1 -1
- ccxt/bitget.py +39 -28
- ccxt/bithumb.py +5 -5
- ccxt/bitmart.py +16 -16
- ccxt/bitopro.py +1 -1
- ccxt/bitrue.py +4 -4
- ccxt/bitso.py +5 -5
- ccxt/bitstamp.py +1 -1
- ccxt/bitteam.py +8 -8
- ccxt/bl3p.py +1 -1
- ccxt/btcturk.py +6 -6
- ccxt/bybit.py +34 -87
- ccxt/coincheck.py +4 -4
- ccxt/coinex.py +12 -13
- ccxt/coinlist.py +7 -7
- ccxt/coinmate.py +4 -4
- ccxt/coinmetro.py +3 -3
- ccxt/coinone.py +5 -5
- ccxt/coinspot.py +2 -2
- ccxt/cryptocom.py +17 -17
- ccxt/currencycom.py +1 -1
- ccxt/delta.py +0 -8
- ccxt/deribit.py +16 -80
- ccxt/digifinex.py +8 -8
- ccxt/exmo.py +8 -8
- ccxt/gate.py +0 -8
- ccxt/hitbtc.py +5 -4
- ccxt/hollaex.py +7 -7
- ccxt/htx.py +12 -34
- ccxt/huobijp.py +3 -3
- ccxt/idex.py +2 -2
- ccxt/independentreserve.py +2 -2
- ccxt/indodax.py +2 -2
- ccxt/kraken.py +8 -8
- ccxt/krakenfutures.py +6 -6
- ccxt/kucoin.py +14 -2
- ccxt/kucoinfutures.py +8 -8
- ccxt/kuna.py +16 -16
- ccxt/latoken.py +2 -2
- ccxt/lbank.py +10 -10
- ccxt/luno.py +4 -4
- ccxt/mercado.py +5 -5
- ccxt/mexc.py +6 -6
- ccxt/ndax.py +1 -1
- ccxt/novadax.py +9 -9
- ccxt/oceanex.py +7 -7
- ccxt/okcoin.py +13 -13
- ccxt/okx.py +23 -31
- ccxt/onetrading.py +4 -4
- ccxt/p2b.py +7 -7
- ccxt/phemex.py +12 -12
- ccxt/poloniexfutures.py +5 -5
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/binance.py +150 -112
- ccxt/pro/kucoin.py +6 -7
- ccxt/pro/okx.py +12 -1
- ccxt/probit.py +11 -11
- ccxt/test/base/test_market.py +3 -0
- ccxt/timex.py +7 -7
- ccxt/tokocrypto.py +9 -9
- ccxt/wavesexchange.py +3 -3
- ccxt/whitebit.py +5 -5
- ccxt/woo.py +1 -1
- ccxt/zaif.py +1 -1
- ccxt/zonda.py +7 -7
- {ccxt-4.2.83.dist-info → ccxt-4.2.85.dist-info}/METADATA +4 -4
- {ccxt-4.2.83.dist-info → ccxt-4.2.85.dist-info}/RECORD +152 -152
- {ccxt-4.2.83.dist-info → ccxt-4.2.85.dist-info}/WHEEL +0 -0
- {ccxt-4.2.83.dist-info → ccxt-4.2.85.dist-info}/top_level.txt +0 -0
ccxt/okx.py
CHANGED
@@ -1138,14 +1138,6 @@ class okx(Exchange, ImplicitAPI):
|
|
1138
1138
|
exchangeTypes = self.safe_value(self.options, 'exchangeType', {})
|
1139
1139
|
return self.safe_string(exchangeTypes, type, type)
|
1140
1140
|
|
1141
|
-
def convert_expire_date(self, date):
|
1142
|
-
# parse YYMMDD to timestamp
|
1143
|
-
year = date[0:2]
|
1144
|
-
month = date[2:4]
|
1145
|
-
day = date[4:6]
|
1146
|
-
reconstructedDate = '20' + year + '-' + month + '-' + day + 'T00:00:00Z'
|
1147
|
-
return reconstructedDate
|
1148
|
-
|
1149
1141
|
def create_expired_option_market(self, symbol: str):
|
1150
1142
|
# support expired option contracts
|
1151
1143
|
quote = 'USD'
|
@@ -1832,7 +1824,7 @@ class okx(Exchange, ImplicitAPI):
|
|
1832
1824
|
# }
|
1833
1825
|
#
|
1834
1826
|
data = self.safe_value(response, 'data', [])
|
1835
|
-
first = self.
|
1827
|
+
first = self.safe_dict(data, 0, {})
|
1836
1828
|
return self.parse_ticker(first, market)
|
1837
1829
|
|
1838
1830
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
@@ -2045,7 +2037,7 @@ class okx(Exchange, ImplicitAPI):
|
|
2045
2037
|
# "msg": ""
|
2046
2038
|
# }
|
2047
2039
|
#
|
2048
|
-
data = self.
|
2040
|
+
data = self.safe_list(response, 'data', [])
|
2049
2041
|
return self.parse_trades(data, market, since, limit)
|
2050
2042
|
|
2051
2043
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -2161,7 +2153,7 @@ class okx(Exchange, ImplicitAPI):
|
|
2161
2153
|
# ]
|
2162
2154
|
# }
|
2163
2155
|
#
|
2164
|
-
data = self.
|
2156
|
+
data = self.safe_list(response, 'data', [])
|
2165
2157
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
2166
2158
|
|
2167
2159
|
def fetch_funding_rate_history(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -2802,7 +2794,7 @@ class okx(Exchange, ImplicitAPI):
|
|
2802
2794
|
# "msg": "",
|
2803
2795
|
# "outTime": "1697979038586493"
|
2804
2796
|
# }
|
2805
|
-
data = self.
|
2797
|
+
data = self.safe_list(response, 'data', [])
|
2806
2798
|
return self.parse_orders(data)
|
2807
2799
|
|
2808
2800
|
def edit_order_request(self, id: str, symbol, type, side, amount=None, price=None, params={}):
|
@@ -2979,7 +2971,7 @@ class okx(Exchange, ImplicitAPI):
|
|
2979
2971
|
response = self.privatePostTradeCancelOrder(self.extend(request, query))
|
2980
2972
|
# {"code":"0","data":[{"clOrdId":"","ordId":"317251910906576896","sCode":"0","sMsg":""}],"msg":""}
|
2981
2973
|
data = self.safe_value(response, 'data', [])
|
2982
|
-
order = self.
|
2974
|
+
order = self.safe_dict(data, 0)
|
2983
2975
|
return self.parse_order(order, market)
|
2984
2976
|
|
2985
2977
|
def parse_ids(self, ids):
|
@@ -3079,7 +3071,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3079
3071
|
# "msg": ""
|
3080
3072
|
# }
|
3081
3073
|
#
|
3082
|
-
ordersData = self.
|
3074
|
+
ordersData = self.safe_list(response, 'data', [])
|
3083
3075
|
return self.parse_orders(ordersData, market, None, None, params)
|
3084
3076
|
|
3085
3077
|
def parse_order_status(self, status):
|
@@ -3433,7 +3425,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3433
3425
|
# }
|
3434
3426
|
#
|
3435
3427
|
data = self.safe_value(response, 'data', [])
|
3436
|
-
order = self.
|
3428
|
+
order = self.safe_dict(data, 0)
|
3437
3429
|
return self.parse_order(order, market)
|
3438
3430
|
|
3439
3431
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -3587,7 +3579,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3587
3579
|
# "msg": ""
|
3588
3580
|
# }
|
3589
3581
|
#
|
3590
|
-
data = self.
|
3582
|
+
data = self.safe_list(response, 'data', [])
|
3591
3583
|
return self.parse_orders(data, market, since, limit)
|
3592
3584
|
|
3593
3585
|
def fetch_canceled_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -3760,7 +3752,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3760
3752
|
# "msg": ""
|
3761
3753
|
# }
|
3762
3754
|
#
|
3763
|
-
data = self.
|
3755
|
+
data = self.safe_list(response, 'data', [])
|
3764
3756
|
return self.parse_orders(data, market, since, limit)
|
3765
3757
|
|
3766
3758
|
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -3934,7 +3926,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3934
3926
|
# "msg": ""
|
3935
3927
|
# }
|
3936
3928
|
#
|
3937
|
-
data = self.
|
3929
|
+
data = self.safe_list(response, 'data', [])
|
3938
3930
|
return self.parse_orders(data, market, since, limit)
|
3939
3931
|
|
3940
3932
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -4000,7 +3992,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4000
3992
|
# "msg": ""
|
4001
3993
|
# }
|
4002
3994
|
#
|
4003
|
-
data = self.
|
3995
|
+
data = self.safe_list(response, 'data', [])
|
4004
3996
|
return self.parse_trades(data, market, since, limit, query)
|
4005
3997
|
|
4006
3998
|
def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -4450,7 +4442,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4450
4442
|
# }
|
4451
4443
|
#
|
4452
4444
|
data = self.safe_value(response, 'data', [])
|
4453
|
-
transaction = self.
|
4445
|
+
transaction = self.safe_dict(data, 0)
|
4454
4446
|
return self.parse_transaction(transaction, currency)
|
4455
4447
|
|
4456
4448
|
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -4525,7 +4517,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4525
4517
|
# ]
|
4526
4518
|
# }
|
4527
4519
|
#
|
4528
|
-
data = self.
|
4520
|
+
data = self.safe_list(response, 'data', [])
|
4529
4521
|
return self.parse_transactions(data, currency, since, limit, params)
|
4530
4522
|
|
4531
4523
|
def fetch_deposit(self, id: str, code: Str = None, params={}):
|
@@ -4547,7 +4539,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4547
4539
|
request['ccy'] = currency['id']
|
4548
4540
|
response = self.privateGetAssetDepositHistory(self.extend(request, params))
|
4549
4541
|
data = self.safe_value(response, 'data')
|
4550
|
-
deposit = self.
|
4542
|
+
deposit = self.safe_dict(data, 0, {})
|
4551
4543
|
return self.parse_transaction(deposit, currency)
|
4552
4544
|
|
4553
4545
|
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
@@ -4614,7 +4606,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4614
4606
|
# ]
|
4615
4607
|
# }
|
4616
4608
|
#
|
4617
|
-
data = self.
|
4609
|
+
data = self.safe_list(response, 'data', [])
|
4618
4610
|
return self.parse_transactions(data, currency, since, limit, params)
|
4619
4611
|
|
4620
4612
|
def fetch_withdrawal(self, id: str, code: Str = None, params={}):
|
@@ -4657,7 +4649,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4657
4649
|
# }
|
4658
4650
|
#
|
4659
4651
|
data = self.safe_value(response, 'data')
|
4660
|
-
withdrawal = self.
|
4652
|
+
withdrawal = self.safe_dict(data, 0, {})
|
4661
4653
|
return self.parse_transaction(withdrawal)
|
4662
4654
|
|
4663
4655
|
def parse_transaction_status(self, status):
|
@@ -5241,7 +5233,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5241
5233
|
# }
|
5242
5234
|
#
|
5243
5235
|
data = self.safe_value(response, 'data', [])
|
5244
|
-
rawTransfer = self.
|
5236
|
+
rawTransfer = self.safe_dict(data, 0, {})
|
5245
5237
|
return self.parse_transfer(rawTransfer, currency)
|
5246
5238
|
|
5247
5239
|
def parse_transfer(self, transfer, currency: Currency = None):
|
@@ -5354,7 +5346,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5354
5346
|
# }
|
5355
5347
|
#
|
5356
5348
|
data = self.safe_value(response, 'data', [])
|
5357
|
-
transfer = self.
|
5349
|
+
transfer = self.safe_dict(data, 0)
|
5358
5350
|
return self.parse_transfer(transfer)
|
5359
5351
|
|
5360
5352
|
def fetch_transfers(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -5412,7 +5404,7 @@ class okx(Exchange, ImplicitAPI):
|
|
5412
5404
|
# "msg": ""
|
5413
5405
|
# }
|
5414
5406
|
#
|
5415
|
-
transfers = self.
|
5407
|
+
transfers = self.safe_list(response, 'data', [])
|
5416
5408
|
return self.parse_transfers(transfers, currency, since, limit, params)
|
5417
5409
|
|
5418
5410
|
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
@@ -6383,7 +6375,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6383
6375
|
# "msg": ""
|
6384
6376
|
# }
|
6385
6377
|
#
|
6386
|
-
data = self.
|
6378
|
+
data = self.safe_list(response, 'data', [])
|
6387
6379
|
return self.parse_open_interest(data[0], market)
|
6388
6380
|
|
6389
6381
|
def fetch_open_interest_history(self, symbol: str, timeframe='1d', since: Int = None, limit: Int = None, params={}):
|
@@ -6445,7 +6437,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6445
6437
|
# "msg": ''
|
6446
6438
|
# }
|
6447
6439
|
#
|
6448
|
-
data = self.
|
6440
|
+
data = self.safe_list(response, 'data', [])
|
6449
6441
|
return self.parse_open_interests(data, None, since, limit)
|
6450
6442
|
|
6451
6443
|
def parse_open_interest(self, interest, market: Market = None):
|
@@ -6560,7 +6552,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6560
6552
|
# "msg": ""
|
6561
6553
|
# }
|
6562
6554
|
#
|
6563
|
-
data = self.
|
6555
|
+
data = self.safe_list(response, 'data')
|
6564
6556
|
return self.parse_deposit_withdraw_fees(data, codes)
|
6565
6557
|
|
6566
6558
|
def parse_deposit_withdraw_fees(self, response, codes=None, currencyIdKey=None):
|
@@ -6908,7 +6900,7 @@ class okx(Exchange, ImplicitAPI):
|
|
6908
6900
|
# }
|
6909
6901
|
#
|
6910
6902
|
data = self.safe_value(response, 'data')
|
6911
|
-
order = self.
|
6903
|
+
order = self.safe_dict(data, 0)
|
6912
6904
|
return self.parse_order(order, market)
|
6913
6905
|
|
6914
6906
|
def fetch_option(self, symbol: str, params={}) -> Option:
|
ccxt/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
|
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
|
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
|
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):
|
ccxt/p2b.py
CHANGED
@@ -564,7 +564,7 @@ class p2b(Exchange, ImplicitAPI):
|
|
564
564
|
# current_time: '1699255571.413828'
|
565
565
|
# }
|
566
566
|
#
|
567
|
-
result = self.
|
567
|
+
result = self.safe_list(response, 'result', [])
|
568
568
|
return self.parse_trades(result, market, since, limit)
|
569
569
|
|
570
570
|
def parse_trade(self, trade, market: Market = None):
|
@@ -676,7 +676,7 @@ class p2b(Exchange, ImplicitAPI):
|
|
676
676
|
# current_time: '1699256375.030494'
|
677
677
|
# }
|
678
678
|
#
|
679
|
-
result = self.
|
679
|
+
result = self.safe_list(response, 'result', [])
|
680
680
|
return self.parse_ohlcvs(result, market, timeframe, since, limit)
|
681
681
|
|
682
682
|
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
@@ -805,7 +805,7 @@ class p2b(Exchange, ImplicitAPI):
|
|
805
805
|
# }
|
806
806
|
# }
|
807
807
|
#
|
808
|
-
result = self.
|
808
|
+
result = self.safe_dict(response, 'result')
|
809
809
|
return self.parse_order(result, market)
|
810
810
|
|
811
811
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
@@ -848,7 +848,7 @@ class p2b(Exchange, ImplicitAPI):
|
|
848
848
|
# }
|
849
849
|
# }
|
850
850
|
#
|
851
|
-
result = self.
|
851
|
+
result = self.safe_dict(response, 'result')
|
852
852
|
return self.parse_order(result)
|
853
853
|
|
854
854
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -899,7 +899,7 @@ class p2b(Exchange, ImplicitAPI):
|
|
899
899
|
# ]
|
900
900
|
# }
|
901
901
|
#
|
902
|
-
result = self.
|
902
|
+
result = self.safe_list(response, 'result', [])
|
903
903
|
return self.parse_orders(result, market, since, limit)
|
904
904
|
|
905
905
|
def fetch_order_trades(self, id: str, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -948,7 +948,7 @@ class p2b(Exchange, ImplicitAPI):
|
|
948
948
|
# }
|
949
949
|
#
|
950
950
|
result = self.safe_value(response, 'result', {})
|
951
|
-
records = self.
|
951
|
+
records = self.safe_list(result, 'records', [])
|
952
952
|
return self.parse_trades(records, market, since, limit)
|
953
953
|
|
954
954
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -1015,7 +1015,7 @@ class p2b(Exchange, ImplicitAPI):
|
|
1015
1015
|
# }
|
1016
1016
|
#
|
1017
1017
|
result = self.safe_value(response, 'result', {})
|
1018
|
-
deals = self.
|
1018
|
+
deals = self.safe_list(result, 'deals', [])
|
1019
1019
|
return self.parse_trades(deals, market, since, limit)
|
1020
1020
|
|
1021
1021
|
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
ccxt/phemex.py
CHANGED
@@ -1266,7 +1266,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1266
1266
|
# }
|
1267
1267
|
#
|
1268
1268
|
data = self.safe_value(response, 'data', {})
|
1269
|
-
rows = self.
|
1269
|
+
rows = self.safe_list(data, 'rows', [])
|
1270
1270
|
return self.parse_ohlcvs(rows, market, timeframe, since, userLimit)
|
1271
1271
|
|
1272
1272
|
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
@@ -1422,7 +1422,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1422
1422
|
# }
|
1423
1423
|
# }
|
1424
1424
|
#
|
1425
|
-
result = self.
|
1425
|
+
result = self.safe_dict(response, 'result', {})
|
1426
1426
|
return self.parse_ticker(result, market)
|
1427
1427
|
|
1428
1428
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
@@ -1452,7 +1452,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
1452
1452
|
response = self.v1GetMdTicker24hrAll(query)
|
1453
1453
|
else:
|
1454
1454
|
response = self.v2GetMdV2Ticker24hrAll(query)
|
1455
|
-
result = self.
|
1455
|
+
result = self.safe_list(response, 'result', [])
|
1456
1456
|
return self.parse_tickers(result, symbols)
|
1457
1457
|
|
1458
1458
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
@@ -2587,7 +2587,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2587
2587
|
# }
|
2588
2588
|
# }
|
2589
2589
|
#
|
2590
|
-
data = self.
|
2590
|
+
data = self.safe_dict(response, 'data', {})
|
2591
2591
|
return self.parse_order(data, market)
|
2592
2592
|
|
2593
2593
|
def edit_order(self, id: str, symbol: str, type: OrderType = None, side: OrderSide = None, amount: Num = None, price: Num = None, params={}):
|
@@ -2648,7 +2648,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2648
2648
|
response = self.privatePutOrdersReplace(self.extend(request, params))
|
2649
2649
|
else:
|
2650
2650
|
response = self.privatePutSpotOrders(self.extend(request, params))
|
2651
|
-
data = self.
|
2651
|
+
data = self.safe_dict(response, 'data', {})
|
2652
2652
|
return self.parse_order(data, market)
|
2653
2653
|
|
2654
2654
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
@@ -2684,7 +2684,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2684
2684
|
response = self.privateDeleteOrdersCancel(self.extend(request, params))
|
2685
2685
|
else:
|
2686
2686
|
response = self.privateDeleteSpotOrders(self.extend(request, params))
|
2687
|
-
data = self.
|
2687
|
+
data = self.safe_dict(response, 'data', {})
|
2688
2688
|
return self.parse_order(data, market)
|
2689
2689
|
|
2690
2690
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
@@ -2782,7 +2782,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2782
2782
|
else:
|
2783
2783
|
response = self.privateGetSpotOrders(self.extend(request, params))
|
2784
2784
|
data = self.safe_value(response, 'data', {})
|
2785
|
-
rows = self.
|
2785
|
+
rows = self.safe_list(data, 'rows', data)
|
2786
2786
|
return self.parse_orders(rows, market, since, limit)
|
2787
2787
|
|
2788
2788
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -2821,7 +2821,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2821
2821
|
if isinstance(data, list):
|
2822
2822
|
return self.parse_orders(data, market, since, limit)
|
2823
2823
|
else:
|
2824
|
-
rows = self.
|
2824
|
+
rows = self.safe_list(data, 'rows', [])
|
2825
2825
|
return self.parse_orders(rows, market, since, limit)
|
2826
2826
|
|
2827
2827
|
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
@@ -2898,7 +2898,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2898
2898
|
if isinstance(data, list):
|
2899
2899
|
return self.parse_orders(data, market, since, limit)
|
2900
2900
|
else:
|
2901
|
-
rows = self.
|
2901
|
+
rows = self.safe_list(data, 'rows', [])
|
2902
2902
|
return self.parse_orders(rows, market, since, limit)
|
2903
2903
|
|
2904
2904
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
@@ -3942,7 +3942,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
3942
3942
|
#
|
3943
3943
|
#
|
3944
3944
|
data = self.safe_value(response, 'data', {})
|
3945
|
-
riskLimits = self.
|
3945
|
+
riskLimits = self.safe_list(data, 'riskLimits')
|
3946
3946
|
return self.parse_leverage_tiers(riskLimits, symbols, 'symbol')
|
3947
3947
|
|
3948
3948
|
def parse_market_leverage_tiers(self, info, market: Market = None):
|
@@ -4173,7 +4173,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4173
4173
|
# }
|
4174
4174
|
#
|
4175
4175
|
data = self.safe_value(response, 'data', {})
|
4176
|
-
transfers = self.
|
4176
|
+
transfers = self.safe_list(data, 'rows', [])
|
4177
4177
|
return self.parse_transfers(transfers, currency, since, limit)
|
4178
4178
|
|
4179
4179
|
def parse_transfer(self, transfer, currency: Currency = None):
|
@@ -4375,7 +4375,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
4375
4375
|
# }
|
4376
4376
|
# }
|
4377
4377
|
#
|
4378
|
-
data = self.
|
4378
|
+
data = self.safe_dict(response, 'data', {})
|
4379
4379
|
return self.parse_transaction(data, currency)
|
4380
4380
|
|
4381
4381
|
def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
|
ccxt/poloniexfutures.py
CHANGED
@@ -665,7 +665,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
665
665
|
# },
|
666
666
|
# }
|
667
667
|
#
|
668
|
-
trades = self.
|
668
|
+
trades = self.safe_list(response, 'data', [])
|
669
669
|
return self.parse_trades(trades, market, since, limit)
|
670
670
|
|
671
671
|
def fetch_time(self, params={}):
|
@@ -729,7 +729,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
729
729
|
# ]
|
730
730
|
# }
|
731
731
|
#
|
732
|
-
data = self.
|
732
|
+
data = self.safe_list(response, 'data', [])
|
733
733
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
734
734
|
|
735
735
|
def parse_balance(self, response) -> Balances:
|
@@ -970,7 +970,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
970
970
|
# ]
|
971
971
|
# }
|
972
972
|
#
|
973
|
-
data = self.
|
973
|
+
data = self.safe_list(response, 'data')
|
974
974
|
return self.parse_positions(data, symbols)
|
975
975
|
|
976
976
|
def parse_position(self, position, market: Market = None):
|
@@ -1389,7 +1389,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1389
1389
|
# }
|
1390
1390
|
#
|
1391
1391
|
market = self.market(symbol) if (symbol is not None) else None
|
1392
|
-
responseData = self.
|
1392
|
+
responseData = self.safe_dict(response, 'data')
|
1393
1393
|
return self.parse_order(responseData, market)
|
1394
1394
|
|
1395
1395
|
def parse_order(self, order, market: Market = None) -> Order:
|
@@ -1616,7 +1616,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1616
1616
|
# }
|
1617
1617
|
#
|
1618
1618
|
data = self.safe_value(response, 'data', {})
|
1619
|
-
trades = self.
|
1619
|
+
trades = self.safe_list(data, 'items', [])
|
1620
1620
|
return self.parse_trades(trades, market, since, limit)
|
1621
1621
|
|
1622
1622
|
def set_margin_mode(self, marginMode: str, symbol: Str = None, params={}):
|