ccxt 4.4.45__py2.py3-none-any.whl → 4.4.46__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 CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.4.45'
25
+ __version__ = '4.4.46'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
ccxt/ascendex.py CHANGED
@@ -1092,6 +1092,7 @@ class ascendex(Exchange, ImplicitAPI):
1092
1092
  :param int [since]: timestamp in ms of the earliest candle to fetch
1093
1093
  :param int [limit]: the maximum amount of candles to fetch
1094
1094
  :param dict [params]: extra parameters specific to the exchange API endpoint
1095
+ :param int [params.until]: timestamp in ms of the latest candle to fetch
1095
1096
  :returns int[][]: A list of candles ordered, open, high, low, close, volume
1096
1097
  """
1097
1098
  self.load_markets()
@@ -1105,15 +1106,28 @@ class ascendex(Exchange, ImplicitAPI):
1105
1106
  duration = self.parse_timeframe(timeframe)
1106
1107
  options = self.safe_dict(self.options, 'fetchOHLCV', {})
1107
1108
  defaultLimit = self.safe_integer(options, 'limit', 500)
1109
+ until = self.safe_integer(params, 'until')
1108
1110
  if since is not None:
1109
1111
  request['from'] = since
1110
1112
  if limit is None:
1111
1113
  limit = defaultLimit
1112
1114
  else:
1113
1115
  limit = min(limit, defaultLimit)
1114
- request['to'] = self.sum(since, limit * duration * 1000, 1)
1116
+ toWithLimit = self.sum(since, limit * duration * 1000, 1)
1117
+ if until is not None:
1118
+ request['to'] = min(toWithLimit, until + 1)
1119
+ else:
1120
+ request['to'] = toWithLimit
1121
+ elif until is not None:
1122
+ request['to'] = until + 1
1123
+ if limit is None:
1124
+ limit = defaultLimit
1125
+ else:
1126
+ limit = min(limit, defaultLimit)
1127
+ request['from'] = until - (limit * duration * 1000)
1115
1128
  elif limit is not None:
1116
1129
  request['n'] = limit # max 500
1130
+ params = self.omit(params, 'until')
1117
1131
  response = self.v1PublicGetBarhist(self.extend(request, params))
1118
1132
  #
1119
1133
  # {
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.45'
7
+ __version__ = '4.4.46'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -1093,6 +1093,7 @@ class ascendex(Exchange, ImplicitAPI):
1093
1093
  :param int [since]: timestamp in ms of the earliest candle to fetch
1094
1094
  :param int [limit]: the maximum amount of candles to fetch
1095
1095
  :param dict [params]: extra parameters specific to the exchange API endpoint
1096
+ :param int [params.until]: timestamp in ms of the latest candle to fetch
1096
1097
  :returns int[][]: A list of candles ordered, open, high, low, close, volume
1097
1098
  """
1098
1099
  await self.load_markets()
@@ -1106,15 +1107,28 @@ class ascendex(Exchange, ImplicitAPI):
1106
1107
  duration = self.parse_timeframe(timeframe)
1107
1108
  options = self.safe_dict(self.options, 'fetchOHLCV', {})
1108
1109
  defaultLimit = self.safe_integer(options, 'limit', 500)
1110
+ until = self.safe_integer(params, 'until')
1109
1111
  if since is not None:
1110
1112
  request['from'] = since
1111
1113
  if limit is None:
1112
1114
  limit = defaultLimit
1113
1115
  else:
1114
1116
  limit = min(limit, defaultLimit)
1115
- request['to'] = self.sum(since, limit * duration * 1000, 1)
1117
+ toWithLimit = self.sum(since, limit * duration * 1000, 1)
1118
+ if until is not None:
1119
+ request['to'] = min(toWithLimit, until + 1)
1120
+ else:
1121
+ request['to'] = toWithLimit
1122
+ elif until is not None:
1123
+ request['to'] = until + 1
1124
+ if limit is None:
1125
+ limit = defaultLimit
1126
+ else:
1127
+ limit = min(limit, defaultLimit)
1128
+ request['from'] = until - (limit * duration * 1000)
1116
1129
  elif limit is not None:
1117
1130
  request['n'] = limit # max 500
1131
+ params = self.omit(params, 'until')
1118
1132
  response = await self.v1PublicGetBarhist(self.extend(request, params))
1119
1133
  #
1120
1134
  # {
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.45'
5
+ __version__ = '4.4.46'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -2496,7 +2496,7 @@ class binance(Exchange, ImplicitAPI):
2496
2496
  #
2497
2497
  '-2010': InvalidOrder, # NEW_ORDER_REJECTED
2498
2498
  '-2011': OperationRejected, # CANCEL_REJECTED
2499
- '-2013': BadRequest, # Order does not exist.
2499
+ '-2013': OrderNotFound, # Order does not exist.
2500
2500
  '-2014': OperationRejected, # API-key format invalid.
2501
2501
  '-2015': OperationRejected, # Invalid API-key, IP, or permissions for action.
2502
2502
  '-2016': OperationFailed, # No trading window could be found for the symbol. Try ticker/24hrs instead.
@@ -1445,16 +1445,102 @@ class bitget(Exchange, ImplicitAPI):
1445
1445
  },
1446
1446
  'sandboxMode': False,
1447
1447
  'networks': {
1448
+ # 'TRX': 'TRX', # different code for mainnet
1448
1449
  'TRC20': 'TRC20',
1450
+ # 'ETH': 'ETH', # different code for mainnet
1449
1451
  'ERC20': 'ERC20',
1450
1452
  'BEP20': 'BSC',
1451
- 'ARB': 'ArbitrumOne',
1452
- 'ZKSYNC': 'zkSyncEra',
1453
- 'STARKNET': 'Starknet',
1453
+ # 'BEP20': 'BEP20', # different for BEP20
1454
+ 'BSC': 'BEP20',
1455
+ 'ATOM': 'ATOM',
1456
+ 'ACA': 'AcalaToken',
1454
1457
  'APT': 'Aptos',
1458
+ 'ARBONE': 'ArbitrumOne',
1459
+ 'ARBNOVA': 'ArbitrumNova',
1460
+ 'AVAXC': 'C-Chain',
1461
+ 'AVAXX': 'X-Chain',
1462
+ 'AR': 'Arweave',
1463
+ 'BCH': 'BCH',
1464
+ 'BCHA': 'BCHA',
1465
+ 'BITCI': 'BITCI',
1466
+ 'BTC': 'BTC',
1467
+ 'CELO': 'CELO',
1468
+ 'CSPR': 'CSPR',
1469
+ 'ADA': 'Cardano',
1470
+ 'CHZ': 'ChilizChain',
1471
+ 'CRC20': 'CronosChain',
1472
+ 'DOGE': 'DOGE',
1473
+ 'DOT': 'DOT',
1474
+ 'EOS': 'EOS',
1475
+ 'ETHF': 'ETHFAIR',
1476
+ 'ETHW': 'ETHW',
1477
+ 'ETC': 'ETC',
1478
+ 'EGLD': 'Elrond',
1479
+ 'FIL': 'FIL',
1480
+ 'FIO': 'FIO',
1481
+ 'FTM': 'Fantom',
1482
+ 'HRC20': 'HECO',
1483
+ 'ONE': 'Harmony',
1484
+ 'HNT': 'Helium',
1485
+ 'ICP': 'ICP',
1486
+ 'IOTX': 'IoTeX',
1487
+ 'KARDIA': 'KAI',
1488
+ 'KAVA': 'KAVA',
1489
+ 'KDA': 'KDA',
1490
+ 'KLAY': 'Klaytn',
1491
+ 'KSM': 'Kusama',
1492
+ 'LAT': 'LAT',
1493
+ 'LTC': 'LTC',
1494
+ 'MINA': 'MINA',
1495
+ 'MOVR': 'MOVR',
1496
+ 'METIS': 'MetisToken',
1497
+ 'GLMR': 'Moonbeam',
1498
+ 'NEAR': 'NEARProtocol',
1499
+ 'NULS': 'NULS',
1500
+ 'OASYS': 'OASYS',
1501
+ 'OASIS': 'ROSE',
1502
+ 'OMNI': 'OMNI',
1503
+ 'ONT': 'Ontology',
1504
+ 'OPTIMISM': 'Optimism',
1505
+ 'OSMO': 'Osmosis',
1506
+ 'POKT': 'PocketNetwork',
1455
1507
  'MATIC': 'Polygon',
1508
+ 'QTUM': 'QTUM',
1509
+ 'REEF': 'REEF',
1510
+ 'SOL': 'SOL',
1511
+ 'SYS': 'SYS', # SyscoinNEVM is different
1512
+ 'SXP': 'Solar',
1513
+ 'XYM': 'Symbol',
1514
+ 'TON': 'TON',
1515
+ 'TT': 'TT',
1516
+ 'TLOS': 'Telos',
1517
+ 'THETA': 'ThetaToken',
1518
+ 'VITE': 'VITE',
1519
+ 'WAVES': 'WAVES',
1520
+ 'WAX': 'WAXP',
1521
+ 'WEMIX': 'WEMIXMainnet',
1522
+ 'XDC': 'XDCNetworkXDC',
1523
+ 'XRP': 'XRP',
1524
+ 'FET': 'FETCH',
1525
+ 'NEM': 'NEM',
1526
+ 'REI': 'REINetwork',
1527
+ 'ZIL': 'ZIL',
1528
+ 'ABBC': 'ABBCCoin',
1529
+ 'RSK': 'RSK',
1530
+ 'AZERO': 'AZERO',
1531
+ 'TRC10': 'TRC10',
1532
+ 'JUNO': 'JUNO',
1533
+ # undetected: USDSP, more info at https://www.bitget.com/v1/spot/public/coinChainList
1534
+ # todo: uncomment below after unification
1535
+ # 'TERRACLASSIC': 'Terra', # tbd, that network id is also assigned to TERRANEW network
1536
+ # 'CUBENETWORK': 'CUBE',
1537
+ # 'CADUCEUS': 'CMP',
1538
+ # 'CONFLUX': 'CFX', # CFXeSpace is different
1539
+ # 'CERE': 'CERE',
1540
+ # 'CANTO': 'CANTO',
1541
+ 'ZKSYNC': 'zkSyncEra',
1542
+ 'STARKNET': 'Starknet',
1456
1543
  'VIC': 'VICTION',
1457
- 'AVAXC': 'C-Chain',
1458
1544
  },
1459
1545
  'networksById': {
1460
1546
  },
@@ -2304,13 +2390,13 @@ class bitget(Exchange, ImplicitAPI):
2304
2390
  :returns dict: a `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
2305
2391
  """
2306
2392
  self.check_address(address)
2307
- chain = self.safe_string_2(params, 'chain', 'network')
2308
- params = self.omit(params, 'network')
2309
- if chain is None:
2310
- raise ArgumentsRequired(self.id + ' withdraw() requires a chain parameter or a network parameter')
2393
+ networkCode = None
2394
+ networkCode, params = self.handle_network_code_and_params(params)
2395
+ if networkCode is None:
2396
+ raise ArgumentsRequired(self.id + ' withdraw() requires a "network" parameter')
2311
2397
  await self.load_markets()
2312
2398
  currency = self.currency(code)
2313
- networkId = self.network_code_to_id(chain)
2399
+ networkId = self.network_code_to_id(networkCode)
2314
2400
  request: dict = {
2315
2401
  'coin': currency['id'],
2316
2402
  'address': address,
@@ -2333,27 +2419,8 @@ class bitget(Exchange, ImplicitAPI):
2333
2419
  # }
2334
2420
  #
2335
2421
  data = self.safe_value(response, 'data', {})
2336
- result: dict = {
2337
- 'id': self.safe_string(data, 'orderId'),
2338
- 'info': response,
2339
- 'txid': None,
2340
- 'timestamp': None,
2341
- 'datetime': None,
2342
- 'network': None,
2343
- 'addressFrom': None,
2344
- 'address': None,
2345
- 'addressTo': None,
2346
- 'amount': None,
2347
- 'type': 'withdrawal',
2348
- 'currency': None,
2349
- 'status': None,
2350
- 'updated': None,
2351
- 'tagFrom': None,
2352
- 'tag': None,
2353
- 'tagTo': None,
2354
- 'comment': None,
2355
- 'fee': None,
2356
- }
2422
+ result = self.parse_transaction(data, currency)
2423
+ result['type'] = 'withdrawal'
2357
2424
  withdrawOptions = self.safe_value(self.options, 'withdraw', {})
2358
2425
  fillResponseFromRequest = self.safe_bool(withdrawOptions, 'fillResponseFromRequest', True)
2359
2426
  if fillResponseFromRequest:
@@ -2364,7 +2431,7 @@ class bitget(Exchange, ImplicitAPI):
2364
2431
  result['tag'] = tag
2365
2432
  result['address'] = address
2366
2433
  result['addressTo'] = address
2367
- result['network'] = chain
2434
+ result['network'] = networkCode
2368
2435
  return result
2369
2436
 
2370
2437
  async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -2526,17 +2593,14 @@ class bitget(Exchange, ImplicitAPI):
2526
2593
  :returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
2527
2594
  """
2528
2595
  await self.load_markets()
2529
- networkCode = self.safe_string_2(params, 'chain', 'network')
2530
- params = self.omit(params, 'network')
2531
- networkId = None
2532
- if networkCode is not None:
2533
- networkId = self.network_code_to_id(networkCode, code)
2596
+ networkCode = None
2597
+ networkCode, params = self.handle_network_code_and_params(params)
2534
2598
  currency = self.currency(code)
2535
2599
  request: dict = {
2536
2600
  'coin': currency['id'],
2537
2601
  }
2538
- if networkId is not None:
2539
- request['chain'] = networkId
2602
+ if networkCode is not None:
2603
+ request['chain'] = self.network_code_to_id(networkCode, code)
2540
2604
  response = await self.privateSpotGetV2SpotWalletDepositAddress(self.extend(request, params))
2541
2605
  #
2542
2606
  # {
@@ -1073,8 +1073,78 @@ class bybit(Exchange, ImplicitAPI):
1073
1073
  'ERC20': 'ETH',
1074
1074
  'TRC20': 'TRX',
1075
1075
  'BEP20': 'BSC',
1076
+ 'SOL': 'SOL',
1077
+ 'ACA': 'ACA',
1078
+ 'ADA': 'ADA',
1079
+ 'ALGO': 'ALGO',
1080
+ 'APT': 'APTOS',
1081
+ 'AR': 'AR',
1082
+ 'ARBONE': 'ARBI',
1083
+ 'AVAXC': 'CAVAX',
1084
+ 'AVAXX': 'XAVAX',
1085
+ 'ATOM': 'ATOM',
1086
+ 'BCH': 'BCH',
1087
+ 'BEP2': 'BNB',
1088
+ 'CHZ': 'CHZ',
1089
+ 'DCR': 'DCR',
1090
+ 'DGB': 'DGB',
1091
+ 'DOGE': 'DOGE',
1092
+ 'DOT': 'DOT',
1093
+ 'EGLD': 'EGLD',
1094
+ 'EOS': 'EOS',
1095
+ 'ETC': 'ETC',
1096
+ 'ETHF': 'ETHF',
1097
+ 'ETHW': 'ETHW',
1098
+ 'FIL': 'FIL',
1099
+ 'STEP': 'FITFI',
1100
+ 'FLOW': 'FLOW',
1101
+ 'FTM': 'FTM',
1102
+ 'GLMR': 'GLMR',
1103
+ 'HBAR': 'HBAR',
1104
+ 'HNT': 'HNT',
1105
+ 'ICP': 'ICP',
1106
+ 'ICX': 'ICX',
1107
+ 'KDA': 'KDA',
1108
+ 'KLAY': 'KLAY',
1109
+ 'KMA': 'KMA',
1110
+ 'KSM': 'KSM',
1111
+ 'LTC': 'LTC',
1112
+ # 'TERRA': 'LUNANEW',
1113
+ # 'TERRACLASSIC': 'LUNA',
1114
+ 'MATIC': 'MATIC',
1115
+ 'MINA': 'MINA',
1116
+ 'MOVR': 'MOVR',
1117
+ 'NEAR': 'NEAR',
1118
+ 'NEM': 'NEM',
1119
+ 'OASYS': 'OAS',
1120
+ 'OASIS': 'ROSE',
1076
1121
  'OMNI': 'OMNI',
1077
- 'SPL': 'SOL',
1122
+ 'ONE': 'ONE',
1123
+ 'OPTIMISM': 'OP',
1124
+ 'POKT': 'POKT',
1125
+ 'QTUM': 'QTUM',
1126
+ 'RVN': 'RVN',
1127
+ 'SC': 'SC',
1128
+ 'SCRT': 'SCRT',
1129
+ 'STX': 'STX',
1130
+ 'THETA': 'THETA',
1131
+ 'TON': 'TON',
1132
+ 'WAVES': 'WAVES',
1133
+ 'WAX': 'WAXP',
1134
+ 'XDC': 'XDC',
1135
+ 'XEC': 'XEC',
1136
+ 'XLM': 'XLM',
1137
+ 'XRP': 'XRP',
1138
+ 'XTZ': 'XTZ',
1139
+ 'XYM': 'XYM',
1140
+ 'ZEN': 'ZEN',
1141
+ 'ZIL': 'ZIL',
1142
+ 'ZKSYNC': 'ZKSYNC',
1143
+ # todo: uncomment after consensus
1144
+ # 'CADUCEUS': 'CMP',
1145
+ # 'KON': 'KON', # konpay, "konchain"
1146
+ # 'AURORA': 'AURORA',
1147
+ # 'BITCOINGOLD': 'BTG',
1078
1148
  },
1079
1149
  'networksById': {
1080
1150
  'ETH': 'ERC20',
@@ -5059,12 +5129,11 @@ classic accounts only/ spot not supported* fetches information on an order made
5059
5129
  address = self.safe_string(depositAddress, 'addressDeposit')
5060
5130
  tag = self.safe_string(depositAddress, 'tagDeposit')
5061
5131
  code = self.safe_string(currency, 'code')
5062
- chain = self.safe_string(depositAddress, 'chain')
5063
5132
  self.check_address(address)
5064
5133
  return {
5065
5134
  'info': depositAddress,
5066
5135
  'currency': code,
5067
- 'network': chain,
5136
+ 'network': self.network_id_to_code(self.safe_string(depositAddress, 'chain'), code),
5068
5137
  'address': address,
5069
5138
  'tag': tag,
5070
5139
  }
@@ -5084,6 +5153,10 @@ classic accounts only/ spot not supported* fetches information on an order made
5084
5153
  request: dict = {
5085
5154
  'coin': currency['id'],
5086
5155
  }
5156
+ networkCode = None
5157
+ networkCode, params = self.handle_network_code_and_params(params)
5158
+ if networkCode is not None:
5159
+ request['chainType'] = self.network_code_to_id(networkCode, code)
5087
5160
  response = await self.privateGetV5AssetDepositQueryAddress(self.extend(request, params))
5088
5161
  #
5089
5162
  # {
@@ -5124,40 +5197,11 @@ classic accounts only/ spot not supported* fetches information on an order made
5124
5197
  :returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
5125
5198
  """
5126
5199
  await self.load_markets()
5127
- networkCode, query = self.handle_network_code_and_params(params)
5128
- networkId = self.network_code_to_id(networkCode)
5129
5200
  currency = self.currency(code)
5130
- request: dict = {
5131
- 'coin': currency['id'],
5132
- }
5133
- if networkId is not None:
5134
- request['chainType'] = networkId
5135
- response = await self.privateGetV5AssetDepositQueryAddress(self.extend(request, query))
5136
- #
5137
- # {
5138
- # "retCode": 0,
5139
- # "retMsg": "success",
5140
- # "result": {
5141
- # "coin": "USDT",
5142
- # "chains": [
5143
- # {
5144
- # "chainType": "ERC20",
5145
- # "addressDeposit": "0xd9e1cd77afa0e50b452a62fbb68a3340602286c3",
5146
- # "tagDeposit": "",
5147
- # "chain": "ETH"
5148
- # }
5149
- # ]
5150
- # },
5151
- # "retExtInfo": {},
5152
- # "time": 1672192792860
5153
- # }
5154
- #
5155
- result = self.safe_dict(response, 'result', {})
5156
- chains = self.safe_list(result, 'chains', [])
5157
- chainsIndexedById = self.index_by(chains, 'chain')
5158
- selectedNetworkId = self.select_network_id_from_raw_networks(code, networkCode, chainsIndexedById)
5159
- addressObject = self.safe_dict(chainsIndexedById, selectedNetworkId, {})
5160
- return self.parse_deposit_address(addressObject, currency)
5201
+ networkCode, paramsOmited = self.handle_network_code_and_params(params)
5202
+ indexedAddresses = await self.fetch_deposit_addresses_by_network(code, paramsOmited)
5203
+ selectedNetworkCode = self.select_network_code_from_unified_networks(currency['code'], networkCode, indexedAddresses)
5204
+ return indexedAddresses[selectedNetworkCode]
5161
5205
 
5162
5206
  async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
5163
5207
  """
@@ -1446,13 +1446,14 @@ class delta(Exchange, ImplicitAPI):
1446
1446
  """
1447
1447
  fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1448
1448
 
1449
- https://docs.delta.exchange/#get-ohlc-candles
1449
+ https://docs.delta.exchange/#delta-exchange-api-v2-historical-ohlc-candles-sparklines
1450
1450
 
1451
1451
  :param str symbol: unified symbol of the market to fetch OHLCV data for
1452
1452
  :param str timeframe: the length of time each candle represents
1453
1453
  :param int [since]: timestamp in ms of the earliest candle to fetch
1454
1454
  :param int [limit]: the maximum amount of candles to fetch
1455
1455
  :param dict [params]: extra parameters specific to the exchange API endpoint
1456
+ :param str [params.until]: timestamp in ms of the latest candle to fetch
1456
1457
  :returns int[][]: A list of candles ordered, open, high, low, close, volume
1457
1458
  """
1458
1459
  await self.load_markets()
@@ -1462,14 +1463,18 @@ class delta(Exchange, ImplicitAPI):
1462
1463
  }
1463
1464
  duration = self.parse_timeframe(timeframe)
1464
1465
  limit = limit if limit else 2000 # max 2000
1466
+ until = self.safe_integer_product(params, 'until', 0.001)
1467
+ untilIsDefined = (until is not None)
1468
+ if untilIsDefined:
1469
+ until = self.parse_to_int(until)
1465
1470
  if since is None:
1466
- end = self.seconds()
1471
+ end = until if untilIsDefined else self.seconds()
1467
1472
  request['end'] = end
1468
1473
  request['start'] = end - limit * duration
1469
1474
  else:
1470
1475
  start = self.parse_to_int(since / 1000)
1471
1476
  request['start'] = start
1472
- request['end'] = self.sum(start, limit * duration)
1477
+ request['end'] = until if untilIsDefined else self.sum(start, limit * duration)
1473
1478
  price = self.safe_string(params, 'price')
1474
1479
  if price == 'mark':
1475
1480
  request['symbol'] = 'MARK:' + market['id']
@@ -1477,7 +1482,7 @@ class delta(Exchange, ImplicitAPI):
1477
1482
  request['symbol'] = market['info']['spot_index']['symbol']
1478
1483
  else:
1479
1484
  request['symbol'] = market['id']
1480
- params = self.omit(params, 'price')
1485
+ params = self.omit(params, ['price', 'until'])
1481
1486
  response = await self.publicGetHistoryCandles(self.extend(request, params))
1482
1487
  #
1483
1488
  # {
@@ -735,7 +735,6 @@ class gate(Exchange, ImplicitAPI):
735
735
  'takeProfitPrice': True,
736
736
  'attachedStopLossTakeProfit': None,
737
737
  'timeInForce': {
738
- 'GTC': True,
739
738
  'IOC': True,
740
739
  'FOK': True,
741
740
  'PO': True,
@@ -239,7 +239,6 @@ class hyperliquid(Exchange, ImplicitAPI):
239
239
  'takeProfitPrice': False,
240
240
  'attachedStopLossTakeProfit': None,
241
241
  'timeInForce': {
242
- 'GTC': True,
243
242
  'IOC': True,
244
243
  'FOK': False,
245
244
  'PO': True,
@@ -2182,7 +2181,7 @@ class hyperliquid(Exchange, ImplicitAPI):
2182
2181
  else:
2183
2182
  market = self.safe_market(marketId, market)
2184
2183
  symbol = market['symbol']
2185
- timestamp = self.safe_integer_2(order, 'timestamp', 'statusTimestamp')
2184
+ timestamp = self.safe_integer(entry, 'timestamp')
2186
2185
  status = self.safe_string_2(order, 'status', 'ccxtStatus')
2187
2186
  order = self.omit(order, ['ccxtStatus'])
2188
2187
  side = self.safe_string(entry, 'side')
@@ -2197,7 +2196,7 @@ class hyperliquid(Exchange, ImplicitAPI):
2197
2196
  'timestamp': timestamp,
2198
2197
  'datetime': self.iso8601(timestamp),
2199
2198
  'lastTradeTimestamp': None,
2200
- 'lastUpdateTimestamp': None,
2199
+ 'lastUpdateTimestamp': self.safe_integer(order, 'statusTimestamp'),
2201
2200
  'symbol': symbol,
2202
2201
  'type': self.parse_order_type(self.safe_string_lower(entry, 'orderType')),
2203
2202
  'timeInForce': self.safe_string_upper(entry, 'tif'),
@@ -458,6 +458,7 @@ class mexc(Exchange, ImplicitAPI):
458
458
  '1h': '60m',
459
459
  '4h': '4h',
460
460
  '1d': '1d',
461
+ '1w': '1W',
461
462
  '1M': '1M',
462
463
  },
463
464
  'swap': {
@@ -289,6 +289,7 @@ class onetrading(Exchange, ImplicitAPI):
289
289
  'INTERNAL_SERVER_ERROR': ExchangeError,
290
290
  },
291
291
  'broad': {
292
+ 'Order not found.': OrderNotFound,
292
293
  },
293
294
  },
294
295
  'commonCurrencies': {
@@ -1000,6 +1001,7 @@ class onetrading(Exchange, ImplicitAPI):
1000
1001
  'CLOSED': 'canceled',
1001
1002
  'FAILED': 'failed',
1002
1003
  'STOP_TRIGGERED': 'triggered',
1004
+ 'DONE': 'closed',
1003
1005
  }
1004
1006
  return self.safe_string(statuses, status, status)
1005
1007
 
@@ -1094,7 +1096,7 @@ class onetrading(Exchange, ImplicitAPI):
1094
1096
  'datetime': self.iso8601(timestamp),
1095
1097
  'lastTradeTimestamp': None,
1096
1098
  'symbol': symbol,
1097
- 'type': type,
1099
+ 'type': self.parse_order_type(type),
1098
1100
  'timeInForce': timeInForce,
1099
1101
  'postOnly': postOnly,
1100
1102
  'side': side,
@@ -1110,6 +1112,12 @@ class onetrading(Exchange, ImplicitAPI):
1110
1112
  'trades': rawTrades,
1111
1113
  }, market)
1112
1114
 
1115
+ def parse_order_type(self, type: Str):
1116
+ types: dict = {
1117
+ 'booked': 'limit',
1118
+ }
1119
+ return self.safe_string(types, type, type)
1120
+
1113
1121
  def parse_time_in_force(self, timeInForce: Str):
1114
1122
  timeInForces: dict = {
1115
1123
  'GOOD_TILL_CANCELLED': 'GTC',
@@ -1167,6 +1175,9 @@ class onetrading(Exchange, ImplicitAPI):
1167
1175
  if clientOrderId is not None:
1168
1176
  request['client_id'] = clientOrderId
1169
1177
  params = self.omit(params, ['clientOrderId', 'client_id'])
1178
+ timeInForce = self.safe_string_2(params, 'timeInForce', 'time_in_force', 'GOOD_TILL_CANCELLED')
1179
+ params = self.omit(params, 'timeInForce')
1180
+ request['time_in_force'] = timeInForce
1170
1181
  response = await self.privatePostAccountOrders(self.extend(request, params))
1171
1182
  #
1172
1183
  # {
@@ -1206,11 +1217,15 @@ class onetrading(Exchange, ImplicitAPI):
1206
1217
  request['client_id'] = clientOrderId
1207
1218
  else:
1208
1219
  request['order_id'] = id
1209
- response = await getattr(self, method)(self.extend(request, params))
1220
+ response = None
1221
+ if method == 'privateDeleteAccountOrdersOrderId':
1222
+ response = await self.privateDeleteAccountOrdersOrderId(self.extend(request, params))
1223
+ else:
1224
+ response = await self.privateDeleteAccountOrdersClientClientId(self.extend(request, params))
1210
1225
  #
1211
1226
  # responds with an empty body
1212
1227
  #
1213
- return response
1228
+ return self.parse_order(response)
1214
1229
 
1215
1230
  async def cancel_all_orders(self, symbol: Str = None, params={}):
1216
1231
  """
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.45'
7
+ __version__ = '4.4.46'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
ccxt/binance.py CHANGED
@@ -2495,7 +2495,7 @@ class binance(Exchange, ImplicitAPI):
2495
2495
  #
2496
2496
  '-2010': InvalidOrder, # NEW_ORDER_REJECTED
2497
2497
  '-2011': OperationRejected, # CANCEL_REJECTED
2498
- '-2013': BadRequest, # Order does not exist.
2498
+ '-2013': OrderNotFound, # Order does not exist.
2499
2499
  '-2014': OperationRejected, # API-key format invalid.
2500
2500
  '-2015': OperationRejected, # Invalid API-key, IP, or permissions for action.
2501
2501
  '-2016': OperationFailed, # No trading window could be found for the symbol. Try ticker/24hrs instead.