ccxt 4.3.41__py2.py3-none-any.whl → 4.3.43__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +1 -1
- ccxt/abstract/coinex.py +2 -1
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +163 -42
- ccxt/async_support/bitmart.py +191 -100
- ccxt/async_support/blockchaincom.py +11 -7
- ccxt/async_support/btcmarkets.py +31 -2
- ccxt/async_support/coinex.py +104 -104
- ccxt/async_support/kraken.py +30 -3
- ccxt/async_support/krakenfutures.py +55 -1
- ccxt/async_support/kucoin.py +59 -2
- ccxt/async_support/phemex.py +4 -4
- ccxt/async_support/tradeogre.py +10 -4
- ccxt/async_support/wavesexchange.py +2 -2
- ccxt/async_support/wazirx.py +38 -15
- ccxt/async_support/zonda.py +9 -1
- ccxt/base/exchange.py +1 -1
- ccxt/binance.py +163 -42
- ccxt/bitmart.py +191 -100
- ccxt/blockchaincom.py +11 -7
- ccxt/btcmarkets.py +31 -2
- ccxt/coinex.py +104 -104
- ccxt/kraken.py +30 -3
- ccxt/krakenfutures.py +55 -1
- ccxt/kucoin.py +59 -2
- ccxt/phemex.py +4 -4
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitget.py +32 -20
- ccxt/pro/bybit.py +1 -1
- ccxt/pro/mexc.py +2 -2
- ccxt/pro/upbit.py +8 -4
- ccxt/pro/woo.py +1 -1
- ccxt/tradeogre.py +10 -4
- ccxt/wavesexchange.py +2 -2
- ccxt/wazirx.py +38 -15
- ccxt/zonda.py +9 -1
- {ccxt-4.3.41.dist-info → ccxt-4.3.43.dist-info}/METADATA +6 -6
- {ccxt-4.3.41.dist-info → ccxt-4.3.43.dist-info}/RECORD +41 -41
- {ccxt-4.3.41.dist-info → ccxt-4.3.43.dist-info}/WHEEL +0 -0
- {ccxt-4.3.41.dist-info → ccxt-4.3.43.dist-info}/top_level.txt +0 -0
ccxt/async_support/coinex.py
CHANGED
@@ -32,7 +32,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
32
32
|
return self.deep_extend(super(coinex, self).describe(), {
|
33
33
|
'id': 'coinex',
|
34
34
|
'name': 'CoinEx',
|
35
|
-
'version': '
|
35
|
+
'version': 'v2',
|
36
36
|
'countries': ['CN'],
|
37
37
|
# IP ratelimit is 400 requests per second
|
38
38
|
# rateLimit = 1000ms / 400 = 2.5
|
@@ -329,6 +329,8 @@ class coinex(Exchange, ImplicitAPI):
|
|
329
329
|
'futures/position-level': 1,
|
330
330
|
'futures/liquidation-history': 1,
|
331
331
|
'futures/basis-history': 1,
|
332
|
+
'assets/deposit-withdraw-config': 1,
|
333
|
+
'assets/all-deposit-withdraw-config': 1,
|
332
334
|
},
|
333
335
|
},
|
334
336
|
'private': {
|
@@ -351,7 +353,6 @@ class coinex(Exchange, ImplicitAPI):
|
|
351
353
|
'assets/deposit-address': 40,
|
352
354
|
'assets/deposit-history': 40,
|
353
355
|
'assets/withdraw': 40,
|
354
|
-
'assets/deposit-withdraw-config': 1,
|
355
356
|
'assets/transfer-history': 40,
|
356
357
|
'spot/order-status': 8,
|
357
358
|
'spot/batch-order-status': 8,
|
@@ -545,126 +546,125 @@ class coinex(Exchange, ImplicitAPI):
|
|
545
546
|
})
|
546
547
|
|
547
548
|
async def fetch_currencies(self, params={}) -> Currencies:
|
548
|
-
|
549
|
+
"""
|
550
|
+
fetches all available currencies on an exchange
|
551
|
+
:see: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-all-deposit-withdrawal-config
|
552
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
553
|
+
:returns dict: an associative dictionary of currencies
|
554
|
+
"""
|
555
|
+
response = await self.v2PublicGetAssetsAllDepositWithdrawConfig(params)
|
556
|
+
#
|
549
557
|
# {
|
550
558
|
# "code": 0,
|
551
|
-
# "data":
|
552
|
-
#
|
553
|
-
#
|
554
|
-
#
|
555
|
-
#
|
556
|
-
#
|
557
|
-
#
|
558
|
-
#
|
559
|
-
#
|
560
|
-
#
|
561
|
-
#
|
562
|
-
#
|
563
|
-
#
|
564
|
-
#
|
565
|
-
#
|
559
|
+
# "data": [
|
560
|
+
# {
|
561
|
+
# "asset": {
|
562
|
+
# "ccy": "CET",
|
563
|
+
# "deposit_enabled": True,
|
564
|
+
# "withdraw_enabled": True,
|
565
|
+
# "inter_transfer_enabled": True,
|
566
|
+
# "is_st": False
|
567
|
+
# },
|
568
|
+
# "chains": [
|
569
|
+
# {
|
570
|
+
# "chain": "CSC",
|
571
|
+
# "min_deposit_amount": "0.8",
|
572
|
+
# "min_withdraw_amount": "8",
|
573
|
+
# "deposit_enabled": True,
|
574
|
+
# "withdraw_enabled": True,
|
575
|
+
# "deposit_delay_minutes": 0,
|
576
|
+
# "safe_confirmations": 10,
|
577
|
+
# "irreversible_confirmations": 20,
|
578
|
+
# "deflation_rate": "0",
|
579
|
+
# "withdrawal_fee": "0.026",
|
580
|
+
# "withdrawal_precision": 8,
|
581
|
+
# "memo": "",
|
582
|
+
# "is_memo_required_for_deposit": False,
|
583
|
+
# "explorer_asset_url": ""
|
584
|
+
# },
|
585
|
+
# ]
|
586
|
+
# }
|
587
|
+
# ],
|
588
|
+
# "message": "OK"
|
566
589
|
# }
|
567
590
|
#
|
568
|
-
data = self.
|
569
|
-
coins = list(data.keys())
|
591
|
+
data = self.safe_list(response, 'data', [])
|
570
592
|
result: dict = {}
|
571
|
-
for i in range(0, len(
|
572
|
-
coin =
|
573
|
-
|
574
|
-
|
575
|
-
|
593
|
+
for i in range(0, len(data)):
|
594
|
+
coin = data[i]
|
595
|
+
asset = self.safe_dict(coin, 'asset', {})
|
596
|
+
chains = self.safe_list(coin, 'chains', [])
|
597
|
+
currencyId = self.safe_string(asset, 'ccy')
|
598
|
+
if currencyId is None:
|
599
|
+
continue # coinex returns empty structures for some reason
|
576
600
|
code = self.safe_currency_code(currencyId)
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
minNetworkDeposit = self.parse_number(minNetworkDepositString)
|
585
|
-
minNetworkWithdrawString = self.safe_string(currency, 'withdraw_least_amount')
|
586
|
-
minNetworkWithdraw = self.parse_number(minNetworkWithdrawString)
|
587
|
-
if self.safe_value(result, code) is None:
|
588
|
-
result[code] = {
|
589
|
-
'id': currencyId,
|
590
|
-
'numericId': None,
|
591
|
-
'code': code,
|
592
|
-
'info': None,
|
593
|
-
'name': None,
|
594
|
-
'active': canDeposit and canWithdraw,
|
595
|
-
'deposit': canDeposit,
|
596
|
-
'withdraw': canWithdraw,
|
597
|
-
'fee': fee,
|
598
|
-
'precision': precision,
|
599
|
-
'limits': {
|
600
|
-
'amount': {
|
601
|
-
'min': None,
|
602
|
-
'max': None,
|
603
|
-
},
|
604
|
-
'deposit': {
|
605
|
-
'min': minNetworkDeposit,
|
606
|
-
'max': None,
|
607
|
-
},
|
608
|
-
'withdraw': {
|
609
|
-
'min': minNetworkWithdraw,
|
610
|
-
'max': None,
|
611
|
-
},
|
612
|
-
},
|
613
|
-
}
|
614
|
-
minFeeString = self.safe_string(result[code], 'fee')
|
615
|
-
if feeString is not None:
|
616
|
-
minFeeString = feeString if (minFeeString is None) else Precise.string_min(feeString, minFeeString)
|
617
|
-
depositAvailable = self.safe_value(result[code], 'deposit')
|
618
|
-
depositAvailable = canDeposit if (canDeposit) else depositAvailable
|
619
|
-
withdrawAvailable = self.safe_value(result[code], 'withdraw')
|
620
|
-
withdrawAvailable = canWithdraw if (canWithdraw) else withdrawAvailable
|
621
|
-
minDepositString = self.safe_string(result[code]['limits']['deposit'], 'min')
|
622
|
-
if minNetworkDepositString is not None:
|
623
|
-
minDepositString = minNetworkDepositString if (minDepositString is None) else Precise.string_min(minNetworkDepositString, minDepositString)
|
624
|
-
minWithdrawString = self.safe_string(result[code]['limits']['withdraw'], 'min')
|
625
|
-
if minNetworkWithdrawString is not None:
|
626
|
-
minWithdrawString = minNetworkWithdrawString if (minWithdrawString is None) else Precise.string_min(minNetworkWithdrawString, minWithdrawString)
|
627
|
-
minPrecisionString = self.safe_string(result[code], 'precision')
|
628
|
-
if precisionString is not None:
|
629
|
-
minPrecisionString = precisionString if (minPrecisionString is None) else Precise.string_min(precisionString, minPrecisionString)
|
630
|
-
networks = self.safe_value(result[code], 'networks', {})
|
631
|
-
network: dict = {
|
632
|
-
'info': currency,
|
633
|
-
'id': networkId,
|
634
|
-
'network': networkId,
|
601
|
+
canDeposit = self.safe_bool(asset, 'deposit_enabled')
|
602
|
+
canWithdraw = self.safe_bool(asset, 'withdraw_enabled')
|
603
|
+
firstChain = self.safe_dict(chains, 0, {})
|
604
|
+
firstPrecisionString = self.parse_precision(self.safe_string(firstChain, 'withdrawal_precision'))
|
605
|
+
result[code] = {
|
606
|
+
'id': currencyId,
|
607
|
+
'code': code,
|
635
608
|
'name': None,
|
609
|
+
'active': canDeposit and canWithdraw,
|
610
|
+
'deposit': canDeposit,
|
611
|
+
'withdraw': canWithdraw,
|
612
|
+
'fee': None,
|
613
|
+
'precision': self.parse_number(firstPrecisionString),
|
636
614
|
'limits': {
|
637
615
|
'amount': {
|
638
616
|
'min': None,
|
639
617
|
'max': None,
|
640
618
|
},
|
641
619
|
'deposit': {
|
642
|
-
'min':
|
620
|
+
'min': None,
|
643
621
|
'max': None,
|
644
622
|
},
|
645
623
|
'withdraw': {
|
646
|
-
'min':
|
624
|
+
'min': None,
|
647
625
|
'max': None,
|
648
626
|
},
|
649
627
|
},
|
650
|
-
'
|
651
|
-
'
|
652
|
-
'withdraw': canWithdraw,
|
653
|
-
'fee': fee,
|
654
|
-
'precision': precision,
|
628
|
+
'networks': {},
|
629
|
+
'info': coin,
|
655
630
|
}
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
631
|
+
for j in range(0, len(chains)):
|
632
|
+
chain = chains[j]
|
633
|
+
networkId = self.safe_string(chain, 'chain')
|
634
|
+
precisionString = self.parse_precision(self.safe_string(chain, 'withdrawal_precision'))
|
635
|
+
feeString = self.safe_string(chain, 'withdrawal_fee')
|
636
|
+
minNetworkDepositString = self.safe_string(chain, 'min_deposit_amount')
|
637
|
+
minNetworkWithdrawString = self.safe_string(chain, 'min_withdraw_amount')
|
638
|
+
canDepositChain = self.safe_bool(chain, 'deposit_enabled')
|
639
|
+
canWithdrawChain = self.safe_bool(chain, 'withdraw_enabled')
|
640
|
+
network: dict = {
|
641
|
+
'id': networkId,
|
642
|
+
'network': networkId,
|
643
|
+
'name': None,
|
644
|
+
'active': canDepositChain and canWithdrawChain,
|
645
|
+
'deposit': canDepositChain,
|
646
|
+
'withdraw': canWithdrawChain,
|
647
|
+
'fee': self.parse_number(feeString),
|
648
|
+
'precision': self.parse_number(precisionString),
|
649
|
+
'limits': {
|
650
|
+
'amount': {
|
651
|
+
'min': None,
|
652
|
+
'max': None,
|
653
|
+
},
|
654
|
+
'deposit': {
|
655
|
+
'min': self.parse_number(minNetworkDepositString),
|
656
|
+
'max': None,
|
657
|
+
},
|
658
|
+
'withdraw': {
|
659
|
+
'min': self.parse_number(minNetworkWithdrawString),
|
660
|
+
'max': None,
|
661
|
+
},
|
662
|
+
},
|
663
|
+
'info': chain,
|
664
|
+
}
|
665
|
+
networks = self.safe_dict(result[code], 'networks', {})
|
666
|
+
networks[networkId] = network
|
667
|
+
result[code]['networks'] = networks
|
668
668
|
return result
|
669
669
|
|
670
670
|
async def fetch_markets(self, params={}) -> List[Market]:
|
@@ -5108,7 +5108,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
5108
5108
|
request: dict = {
|
5109
5109
|
'ccy': currency['id'],
|
5110
5110
|
}
|
5111
|
-
response = await self.
|
5111
|
+
response = await self.v2PublicGetAssetsDepositWithdrawConfig(self.extend(request, params))
|
5112
5112
|
#
|
5113
5113
|
# {
|
5114
5114
|
# "code": 0,
|
@@ -5440,7 +5440,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
5440
5440
|
preparedString += nonce + self.secret
|
5441
5441
|
signature = self.hash(self.encode(preparedString), 'sha256')
|
5442
5442
|
headers = {
|
5443
|
-
'Content-Type': 'application/json
|
5443
|
+
'Content-Type': 'application/json',
|
5444
5444
|
'Accept': 'application/json',
|
5445
5445
|
'X-COINEX-KEY': self.apiKey,
|
5446
5446
|
'X-COINEX-SIGN': signature,
|
ccxt/async_support/kraken.py
CHANGED
@@ -2008,12 +2008,22 @@ class kraken(Exchange, ImplicitAPI):
|
|
2008
2008
|
params = self.omit(params, ['userref', 'clientOrderId'])
|
2009
2009
|
try:
|
2010
2010
|
response = await self.privatePostCancelOrder(self.extend(request, params))
|
2011
|
+
#
|
2012
|
+
# {
|
2013
|
+
# error: [],
|
2014
|
+
# result: {
|
2015
|
+
# count: '1'
|
2016
|
+
# }
|
2017
|
+
# }
|
2018
|
+
#
|
2011
2019
|
except Exception as e:
|
2012
2020
|
if self.last_http_response:
|
2013
2021
|
if self.last_http_response.find('EOrder:Unknown order') >= 0:
|
2014
2022
|
raise OrderNotFound(self.id + ' cancelOrder() error ' + self.last_http_response)
|
2015
2023
|
raise e
|
2016
|
-
return
|
2024
|
+
return self.safe_order({
|
2025
|
+
'info': response,
|
2026
|
+
})
|
2017
2027
|
|
2018
2028
|
async def cancel_orders(self, ids, symbol: Str = None, params={}):
|
2019
2029
|
"""
|
@@ -2036,7 +2046,11 @@ class kraken(Exchange, ImplicitAPI):
|
|
2036
2046
|
# }
|
2037
2047
|
# }
|
2038
2048
|
#
|
2039
|
-
return
|
2049
|
+
return [
|
2050
|
+
self.safe_order({
|
2051
|
+
'info': response,
|
2052
|
+
}),
|
2053
|
+
]
|
2040
2054
|
|
2041
2055
|
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
2042
2056
|
"""
|
@@ -2047,7 +2061,20 @@ class kraken(Exchange, ImplicitAPI):
|
|
2047
2061
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
2048
2062
|
"""
|
2049
2063
|
await self.load_markets()
|
2050
|
-
|
2064
|
+
response = await self.privatePostCancelAll(params)
|
2065
|
+
#
|
2066
|
+
# {
|
2067
|
+
# error: [],
|
2068
|
+
# result: {
|
2069
|
+
# count: '1'
|
2070
|
+
# }
|
2071
|
+
# }
|
2072
|
+
#
|
2073
|
+
return [
|
2074
|
+
self.safe_order({
|
2075
|
+
'info': response,
|
2076
|
+
}),
|
2077
|
+
]
|
2051
2078
|
|
2052
2079
|
async def cancel_all_orders_after(self, timeout: Int, params={}):
|
2053
2080
|
"""
|
@@ -1207,7 +1207,45 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1207
1207
|
if symbol is not None:
|
1208
1208
|
request['symbol'] = self.market_id(symbol)
|
1209
1209
|
response = await self.privatePostCancelallorders(self.extend(request, params))
|
1210
|
-
|
1210
|
+
#
|
1211
|
+
# {
|
1212
|
+
# result: 'success',
|
1213
|
+
# cancelStatus: {
|
1214
|
+
# receivedTime: '2024-06-06T01:12:44.814Z',
|
1215
|
+
# cancelOnly: 'PF_XRPUSD',
|
1216
|
+
# status: 'cancelled',
|
1217
|
+
# cancelledOrders: [{order_id: '272fd0ac-45c0-4003-b84d-d39b9e86bd36'}],
|
1218
|
+
# orderEvents: [
|
1219
|
+
# {
|
1220
|
+
# uid: '272fd0ac-45c0-4003-b84d-d39b9e86bd36',
|
1221
|
+
# order: {
|
1222
|
+
# orderId: '272fd0ac-45c0-4003-b84d-d39b9e86bd36',
|
1223
|
+
# cliOrdId: null,
|
1224
|
+
# type: 'lmt',
|
1225
|
+
# symbol: 'PF_XRPUSD',
|
1226
|
+
# side: 'buy',
|
1227
|
+
# quantity: '10',
|
1228
|
+
# filled: '0',
|
1229
|
+
# limitPrice: '0.4',
|
1230
|
+
# reduceOnly: False,
|
1231
|
+
# timestamp: '2024-06-06T01:11:16.045Z',
|
1232
|
+
# lastUpdateTimestamp: '2024-06-06T01:11:16.045Z'
|
1233
|
+
# },
|
1234
|
+
# type: 'CANCEL'
|
1235
|
+
# }
|
1236
|
+
# ]
|
1237
|
+
# },
|
1238
|
+
# serverTime: '2024-06-06T01:12:44.814Z'
|
1239
|
+
# }
|
1240
|
+
#
|
1241
|
+
cancelStatus = self.safe_dict(response, 'cancelStatus')
|
1242
|
+
orderEvents = self.safe_list(cancelStatus, 'orderEvents', [])
|
1243
|
+
orders = []
|
1244
|
+
for i in range(0, len(orderEvents)):
|
1245
|
+
orderEvent = self.safe_dict(orderEvents, 0)
|
1246
|
+
order = self.safe_dict(orderEvent, 'order', {})
|
1247
|
+
orders.append(order)
|
1248
|
+
return self.parse_orders(orders)
|
1211
1249
|
|
1212
1250
|
async def cancel_all_orders_after(self, timeout: Int, params={}):
|
1213
1251
|
"""
|
@@ -1551,6 +1589,22 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
1551
1589
|
# ]
|
1552
1590
|
# }
|
1553
1591
|
#
|
1592
|
+
# cancelAllOrders
|
1593
|
+
#
|
1594
|
+
# {
|
1595
|
+
# "orderId": "85c40002-3f20-4e87-9302-262626c3531b",
|
1596
|
+
# "cliOrdId": null,
|
1597
|
+
# "type": "lmt",
|
1598
|
+
# "symbol": "pi_xbtusd",
|
1599
|
+
# "side": "buy",
|
1600
|
+
# "quantity": 1000,
|
1601
|
+
# "filled": 0,
|
1602
|
+
# "limitPrice": 10144,
|
1603
|
+
# "stopPrice": null,
|
1604
|
+
# "reduceOnly": False,
|
1605
|
+
# "timestamp": "2019-08-01T15:26:27.790Z"
|
1606
|
+
# }
|
1607
|
+
#
|
1554
1608
|
# FETCH OPEN ORDERS
|
1555
1609
|
#
|
1556
1610
|
# {
|
ccxt/async_support/kucoin.py
CHANGED
@@ -2238,19 +2238,76 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2238
2238
|
request['clientOid'] = clientOrderId
|
2239
2239
|
if stop:
|
2240
2240
|
response = await self.privateDeleteStopOrderCancelOrderByClientOid(self.extend(request, params))
|
2241
|
+
#
|
2242
|
+
# {
|
2243
|
+
# code: '200000',
|
2244
|
+
# data: {
|
2245
|
+
# cancelledOrderId: 'vs8lgpiuao41iaft003khbbk',
|
2246
|
+
# clientOid: '123456'
|
2247
|
+
# }
|
2248
|
+
# }
|
2249
|
+
#
|
2241
2250
|
elif hf:
|
2242
2251
|
response = await self.privateDeleteHfOrdersClientOrderClientOid(self.extend(request, params))
|
2252
|
+
#
|
2253
|
+
# {
|
2254
|
+
# "code": "200000",
|
2255
|
+
# "data": {
|
2256
|
+
# "clientOid": "6d539dc614db3"
|
2257
|
+
# }
|
2258
|
+
# }
|
2259
|
+
#
|
2243
2260
|
else:
|
2244
2261
|
response = await self.privateDeleteOrderClientOrderClientOid(self.extend(request, params))
|
2262
|
+
#
|
2263
|
+
# {
|
2264
|
+
# code: '200000',
|
2265
|
+
# data: {
|
2266
|
+
# cancelledOrderId: '665e580f6660500007aba341',
|
2267
|
+
# clientOid: '1234567',
|
2268
|
+
# cancelledOcoOrderIds: null
|
2269
|
+
# }
|
2270
|
+
# }
|
2271
|
+
#
|
2272
|
+
response = self.safe_dict(response, 'data')
|
2273
|
+
return self.parse_order(response)
|
2245
2274
|
else:
|
2246
2275
|
request['orderId'] = id
|
2247
2276
|
if stop:
|
2248
2277
|
response = await self.privateDeleteStopOrderOrderId(self.extend(request, params))
|
2278
|
+
#
|
2279
|
+
# {
|
2280
|
+
# code: '200000',
|
2281
|
+
# data: {cancelledOrderIds: ['vs8lgpiuaco91qk8003vebu9']}
|
2282
|
+
# }
|
2283
|
+
#
|
2249
2284
|
elif hf:
|
2250
2285
|
response = await self.privateDeleteHfOrdersOrderId(self.extend(request, params))
|
2286
|
+
#
|
2287
|
+
# {
|
2288
|
+
# "code": "200000",
|
2289
|
+
# "data": {
|
2290
|
+
# "orderId": "630625dbd9180300014c8d52"
|
2291
|
+
# }
|
2292
|
+
# }
|
2293
|
+
#
|
2294
|
+
response = self.safe_dict(response, 'data')
|
2295
|
+
return self.parse_order(response)
|
2251
2296
|
else:
|
2252
2297
|
response = await self.privateDeleteOrdersOrderId(self.extend(request, params))
|
2253
|
-
|
2298
|
+
#
|
2299
|
+
# {
|
2300
|
+
# code: '200000',
|
2301
|
+
# data: {cancelledOrderIds: ['665e4fbe28051a0007245c41']}
|
2302
|
+
# }
|
2303
|
+
#
|
2304
|
+
data = self.safe_dict(response, 'data')
|
2305
|
+
orderIds = self.safe_list(data, 'cancelledOrderIds', [])
|
2306
|
+
orderId = self.safe_string(orderIds, 0)
|
2307
|
+
return self.safe_order({
|
2308
|
+
'info': data,
|
2309
|
+
'id': orderId,
|
2310
|
+
})
|
2254
2311
|
|
2255
2312
|
async def cancel_all_orders(self, symbol: Str = None, params={}):
|
2256
2313
|
"""
|
@@ -2664,7 +2721,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2664
2721
|
stopPrice = self.safe_number(order, 'stopPrice')
|
2665
2722
|
return self.safe_order({
|
2666
2723
|
'info': order,
|
2667
|
-
'id': self.safe_string_n(order, ['id', 'orderId', 'newOrderId']),
|
2724
|
+
'id': self.safe_string_n(order, ['id', 'orderId', 'newOrderId', 'cancelledOrderId']),
|
2668
2725
|
'clientOrderId': self.safe_string(order, 'clientOid'),
|
2669
2726
|
'symbol': self.safe_symbol(marketId, market, '-'),
|
2670
2727
|
'type': self.safe_string(order, 'type'),
|
ccxt/async_support/phemex.py
CHANGED
@@ -21,7 +21,6 @@ from ccxt.base.errors import InvalidOrder
|
|
21
21
|
from ccxt.base.errors import OrderNotFound
|
22
22
|
from ccxt.base.errors import CancelPending
|
23
23
|
from ccxt.base.errors import DuplicateOrderId
|
24
|
-
from ccxt.base.errors import NotSupported
|
25
24
|
from ccxt.base.errors import DDoSProtection
|
26
25
|
from ccxt.base.errors import RateLimitExceeded
|
27
26
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
@@ -2772,6 +2771,7 @@ class phemex(Exchange, ImplicitAPI):
|
|
2772
2771
|
|
2773
2772
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
2774
2773
|
"""
|
2774
|
+
:see: https://phemex-docs.github.io/#query-orders-by-ids
|
2775
2775
|
fetches information on an order made by the user
|
2776
2776
|
:param str symbol: unified symbol of the market the order was made in
|
2777
2777
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -2781,8 +2781,6 @@ class phemex(Exchange, ImplicitAPI):
|
|
2781
2781
|
raise ArgumentsRequired(self.id + ' fetchOrder() requires a symbol argument')
|
2782
2782
|
await self.load_markets()
|
2783
2783
|
market = self.market(symbol)
|
2784
|
-
if market['settle'] == 'USDT':
|
2785
|
-
raise NotSupported(self.id + 'fetchOrder() is not supported yet for USDT settled swap markets') # https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#query-user-order-by-orderid-or-query-user-order-by-client-order-id
|
2786
2784
|
request: dict = {
|
2787
2785
|
'symbol': market['id'],
|
2788
2786
|
}
|
@@ -2793,7 +2791,9 @@ class phemex(Exchange, ImplicitAPI):
|
|
2793
2791
|
else:
|
2794
2792
|
request['orderID'] = id
|
2795
2793
|
response = None
|
2796
|
-
if market['
|
2794
|
+
if market['settle'] == 'USDT':
|
2795
|
+
response = await self.privateGetApiDataGFuturesOrdersByOrderId(self.extend(request, params))
|
2796
|
+
elif market['spot']:
|
2797
2797
|
response = await self.privateGetSpotOrdersActive(self.extend(request, params))
|
2798
2798
|
else:
|
2799
2799
|
response = await self.privateGetExchangeOrder(self.extend(request, params))
|
ccxt/async_support/tradeogre.py
CHANGED
@@ -9,6 +9,7 @@ from ccxt.base.types import IndexType, Int, Market, Num, Order, OrderSide, Order
|
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import AuthenticationError
|
12
|
+
from ccxt.base.errors import ArgumentsRequired
|
12
13
|
from ccxt.base.errors import BadRequest
|
13
14
|
from ccxt.base.errors import InsufficientFunds
|
14
15
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
@@ -441,7 +442,7 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
441
442
|
"""
|
442
443
|
create a trade order
|
443
444
|
:param str symbol: unified symbol of the market to create an order in
|
444
|
-
:param str type:
|
445
|
+
:param str type: must be 'limit'
|
445
446
|
:param str side: 'buy' or 'sell'
|
446
447
|
:param float amount: how much of currency you want to trade in units of base currency
|
447
448
|
:param float price: the price at which the order is to be fullfilled, in units of the quote currency
|
@@ -450,13 +451,15 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
450
451
|
"""
|
451
452
|
await self.load_markets()
|
452
453
|
market = self.market(symbol)
|
454
|
+
if type == 'market':
|
455
|
+
raise BadRequest(self.id + ' createOrder does not support market orders')
|
456
|
+
if price is None:
|
457
|
+
raise ArgumentsRequired(self.id + ' createOrder requires a limit parameter')
|
453
458
|
request: dict = {
|
454
459
|
'market': market['id'],
|
455
460
|
'quantity': self.parse_to_numeric(self.amount_to_precision(symbol, amount)),
|
456
461
|
'price': self.parse_to_numeric(self.price_to_precision(symbol, price)),
|
457
462
|
}
|
458
|
-
if type == 'market':
|
459
|
-
raise BadRequest(self.id + ' createOrder does not support market orders')
|
460
463
|
response = None
|
461
464
|
if side == 'buy':
|
462
465
|
response = await self.privatePostOrderBuy(self.extend(request, params))
|
@@ -487,7 +490,10 @@ class tradeogre(Exchange, ImplicitAPI):
|
|
487
490
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
488
491
|
"""
|
489
492
|
await self.load_markets()
|
490
|
-
|
493
|
+
response = await self.cancel_order('all', symbol, params)
|
494
|
+
return [
|
495
|
+
response,
|
496
|
+
]
|
491
497
|
|
492
498
|
async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
493
499
|
"""
|
@@ -1422,7 +1422,7 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
1422
1422
|
firstMessage = self.safe_value(message, 0)
|
1423
1423
|
firstOrder = self.safe_value(firstMessage, 0)
|
1424
1424
|
returnedId = self.safe_string(firstOrder, 'orderId')
|
1425
|
-
return {
|
1425
|
+
return self.safe_order({
|
1426
1426
|
'info': response,
|
1427
1427
|
'id': returnedId,
|
1428
1428
|
'clientOrderId': None,
|
@@ -1441,7 +1441,7 @@ class wavesexchange(Exchange, ImplicitAPI):
|
|
1441
1441
|
'status': None,
|
1442
1442
|
'fee': None,
|
1443
1443
|
'trades': None,
|
1444
|
-
}
|
1444
|
+
})
|
1445
1445
|
|
1446
1446
|
async def fetch_order(self, id: str, symbol: Str = None, params={}):
|
1447
1447
|
"""
|