ccxt 4.4.45 → 4.4.46
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.
- package/README.md +3 -3
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ascendex.js +20 -1
- package/dist/cjs/src/binance.js +1 -1
- package/dist/cjs/src/bitget.js +102 -39
- package/dist/cjs/src/bybit.js +81 -37
- package/dist/cjs/src/delta.js +10 -4
- package/dist/cjs/src/gate.js +0 -1
- package/dist/cjs/src/hyperliquid.js +2 -3
- package/dist/cjs/src/mexc.js +1 -0
- package/dist/cjs/src/onetrading.js +22 -4
- package/dist/cjs/src/pro/coinex.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/ascendex.d.ts +1 -0
- package/js/src/ascendex.js +20 -1
- package/js/src/binance.js +1 -1
- package/js/src/bitget.js +102 -39
- package/js/src/bybit.js +81 -37
- package/js/src/delta.d.ts +2 -1
- package/js/src/delta.js +10 -4
- package/js/src/gate.js +0 -1
- package/js/src/hyperliquid.js +2 -3
- package/js/src/mexc.js +1 -0
- package/js/src/onetrading.d.ts +2 -1
- package/js/src/onetrading.js +22 -4
- package/js/src/pro/coinex.js +1 -1
- package/package.json +1 -1
package/js/src/ascendex.js
CHANGED
|
@@ -1117,6 +1117,7 @@ export default class ascendex extends Exchange {
|
|
|
1117
1117
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
1118
1118
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
1119
1119
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1120
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
1120
1121
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
1121
1122
|
*/
|
|
1122
1123
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
@@ -1131,6 +1132,7 @@ export default class ascendex extends Exchange {
|
|
|
1131
1132
|
const duration = this.parseTimeframe(timeframe);
|
|
1132
1133
|
const options = this.safeDict(this.options, 'fetchOHLCV', {});
|
|
1133
1134
|
const defaultLimit = this.safeInteger(options, 'limit', 500);
|
|
1135
|
+
const until = this.safeInteger(params, 'until');
|
|
1134
1136
|
if (since !== undefined) {
|
|
1135
1137
|
request['from'] = since;
|
|
1136
1138
|
if (limit === undefined) {
|
|
@@ -1139,11 +1141,28 @@ export default class ascendex extends Exchange {
|
|
|
1139
1141
|
else {
|
|
1140
1142
|
limit = Math.min(limit, defaultLimit);
|
|
1141
1143
|
}
|
|
1142
|
-
|
|
1144
|
+
const toWithLimit = this.sum(since, limit * duration * 1000, 1);
|
|
1145
|
+
if (until !== undefined) {
|
|
1146
|
+
request['to'] = Math.min(toWithLimit, until + 1);
|
|
1147
|
+
}
|
|
1148
|
+
else {
|
|
1149
|
+
request['to'] = toWithLimit;
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
else if (until !== undefined) {
|
|
1153
|
+
request['to'] = until + 1;
|
|
1154
|
+
if (limit === undefined) {
|
|
1155
|
+
limit = defaultLimit;
|
|
1156
|
+
}
|
|
1157
|
+
else {
|
|
1158
|
+
limit = Math.min(limit, defaultLimit);
|
|
1159
|
+
}
|
|
1160
|
+
request['from'] = until - (limit * duration * 1000);
|
|
1143
1161
|
}
|
|
1144
1162
|
else if (limit !== undefined) {
|
|
1145
1163
|
request['n'] = limit; // max 500
|
|
1146
1164
|
}
|
|
1165
|
+
params = this.omit(params, 'until');
|
|
1147
1166
|
const response = await this.v1PublicGetBarhist(this.extend(request, params));
|
|
1148
1167
|
//
|
|
1149
1168
|
// {
|
package/js/src/binance.js
CHANGED
|
@@ -2475,7 +2475,7 @@ export default class binance extends Exchange {
|
|
|
2475
2475
|
//
|
|
2476
2476
|
'-2010': InvalidOrder,
|
|
2477
2477
|
'-2011': OperationRejected,
|
|
2478
|
-
'-2013':
|
|
2478
|
+
'-2013': OrderNotFound,
|
|
2479
2479
|
'-2014': OperationRejected,
|
|
2480
2480
|
'-2015': OperationRejected,
|
|
2481
2481
|
'-2016': OperationFailed,
|
package/js/src/bitget.js
CHANGED
|
@@ -1426,16 +1426,102 @@ export default class bitget extends Exchange {
|
|
|
1426
1426
|
},
|
|
1427
1427
|
'sandboxMode': false,
|
|
1428
1428
|
'networks': {
|
|
1429
|
+
// 'TRX': 'TRX', // different code for mainnet
|
|
1429
1430
|
'TRC20': 'TRC20',
|
|
1431
|
+
// 'ETH': 'ETH', // different code for mainnet
|
|
1430
1432
|
'ERC20': 'ERC20',
|
|
1431
1433
|
'BEP20': 'BSC',
|
|
1432
|
-
'
|
|
1433
|
-
'
|
|
1434
|
-
'
|
|
1434
|
+
// 'BEP20': 'BEP20', // different for BEP20
|
|
1435
|
+
'BSC': 'BEP20',
|
|
1436
|
+
'ATOM': 'ATOM',
|
|
1437
|
+
'ACA': 'AcalaToken',
|
|
1435
1438
|
'APT': 'Aptos',
|
|
1439
|
+
'ARBONE': 'ArbitrumOne',
|
|
1440
|
+
'ARBNOVA': 'ArbitrumNova',
|
|
1441
|
+
'AVAXC': 'C-Chain',
|
|
1442
|
+
'AVAXX': 'X-Chain',
|
|
1443
|
+
'AR': 'Arweave',
|
|
1444
|
+
'BCH': 'BCH',
|
|
1445
|
+
'BCHA': 'BCHA',
|
|
1446
|
+
'BITCI': 'BITCI',
|
|
1447
|
+
'BTC': 'BTC',
|
|
1448
|
+
'CELO': 'CELO',
|
|
1449
|
+
'CSPR': 'CSPR',
|
|
1450
|
+
'ADA': 'Cardano',
|
|
1451
|
+
'CHZ': 'ChilizChain',
|
|
1452
|
+
'CRC20': 'CronosChain',
|
|
1453
|
+
'DOGE': 'DOGE',
|
|
1454
|
+
'DOT': 'DOT',
|
|
1455
|
+
'EOS': 'EOS',
|
|
1456
|
+
'ETHF': 'ETHFAIR',
|
|
1457
|
+
'ETHW': 'ETHW',
|
|
1458
|
+
'ETC': 'ETC',
|
|
1459
|
+
'EGLD': 'Elrond',
|
|
1460
|
+
'FIL': 'FIL',
|
|
1461
|
+
'FIO': 'FIO',
|
|
1462
|
+
'FTM': 'Fantom',
|
|
1463
|
+
'HRC20': 'HECO',
|
|
1464
|
+
'ONE': 'Harmony',
|
|
1465
|
+
'HNT': 'Helium',
|
|
1466
|
+
'ICP': 'ICP',
|
|
1467
|
+
'IOTX': 'IoTeX',
|
|
1468
|
+
'KARDIA': 'KAI',
|
|
1469
|
+
'KAVA': 'KAVA',
|
|
1470
|
+
'KDA': 'KDA',
|
|
1471
|
+
'KLAY': 'Klaytn',
|
|
1472
|
+
'KSM': 'Kusama',
|
|
1473
|
+
'LAT': 'LAT',
|
|
1474
|
+
'LTC': 'LTC',
|
|
1475
|
+
'MINA': 'MINA',
|
|
1476
|
+
'MOVR': 'MOVR',
|
|
1477
|
+
'METIS': 'MetisToken',
|
|
1478
|
+
'GLMR': 'Moonbeam',
|
|
1479
|
+
'NEAR': 'NEARProtocol',
|
|
1480
|
+
'NULS': 'NULS',
|
|
1481
|
+
'OASYS': 'OASYS',
|
|
1482
|
+
'OASIS': 'ROSE',
|
|
1483
|
+
'OMNI': 'OMNI',
|
|
1484
|
+
'ONT': 'Ontology',
|
|
1485
|
+
'OPTIMISM': 'Optimism',
|
|
1486
|
+
'OSMO': 'Osmosis',
|
|
1487
|
+
'POKT': 'PocketNetwork',
|
|
1436
1488
|
'MATIC': 'Polygon',
|
|
1489
|
+
'QTUM': 'QTUM',
|
|
1490
|
+
'REEF': 'REEF',
|
|
1491
|
+
'SOL': 'SOL',
|
|
1492
|
+
'SYS': 'SYS',
|
|
1493
|
+
'SXP': 'Solar',
|
|
1494
|
+
'XYM': 'Symbol',
|
|
1495
|
+
'TON': 'TON',
|
|
1496
|
+
'TT': 'TT',
|
|
1497
|
+
'TLOS': 'Telos',
|
|
1498
|
+
'THETA': 'ThetaToken',
|
|
1499
|
+
'VITE': 'VITE',
|
|
1500
|
+
'WAVES': 'WAVES',
|
|
1501
|
+
'WAX': 'WAXP',
|
|
1502
|
+
'WEMIX': 'WEMIXMainnet',
|
|
1503
|
+
'XDC': 'XDCNetworkXDC',
|
|
1504
|
+
'XRP': 'XRP',
|
|
1505
|
+
'FET': 'FETCH',
|
|
1506
|
+
'NEM': 'NEM',
|
|
1507
|
+
'REI': 'REINetwork',
|
|
1508
|
+
'ZIL': 'ZIL',
|
|
1509
|
+
'ABBC': 'ABBCCoin',
|
|
1510
|
+
'RSK': 'RSK',
|
|
1511
|
+
'AZERO': 'AZERO',
|
|
1512
|
+
'TRC10': 'TRC10',
|
|
1513
|
+
'JUNO': 'JUNO',
|
|
1514
|
+
// undetected: USDSP, more info at https://www.bitget.com/v1/spot/public/coinChainList
|
|
1515
|
+
// todo: uncomment below after unification
|
|
1516
|
+
// 'TERRACLASSIC': 'Terra', // tbd, that network id is also assigned to TERRANEW network
|
|
1517
|
+
// 'CUBENETWORK': 'CUBE',
|
|
1518
|
+
// 'CADUCEUS': 'CMP',
|
|
1519
|
+
// 'CONFLUX': 'CFX', // CFXeSpace is different
|
|
1520
|
+
// 'CERE': 'CERE',
|
|
1521
|
+
// 'CANTO': 'CANTO',
|
|
1522
|
+
'ZKSYNC': 'zkSyncEra',
|
|
1523
|
+
'STARKNET': 'Starknet',
|
|
1437
1524
|
'VIC': 'VICTION',
|
|
1438
|
-
'AVAXC': 'C-Chain',
|
|
1439
1525
|
},
|
|
1440
1526
|
'networksById': {},
|
|
1441
1527
|
'fetchPositions': {
|
|
@@ -2341,14 +2427,14 @@ export default class bitget extends Exchange {
|
|
|
2341
2427
|
*/
|
|
2342
2428
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
2343
2429
|
this.checkAddress(address);
|
|
2344
|
-
|
|
2345
|
-
params = this.
|
|
2346
|
-
if (
|
|
2347
|
-
throw new ArgumentsRequired(this.id + ' withdraw() requires a
|
|
2430
|
+
let networkCode = undefined;
|
|
2431
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2432
|
+
if (networkCode === undefined) {
|
|
2433
|
+
throw new ArgumentsRequired(this.id + ' withdraw() requires a "network" parameter');
|
|
2348
2434
|
}
|
|
2349
2435
|
await this.loadMarkets();
|
|
2350
2436
|
const currency = this.currency(code);
|
|
2351
|
-
const networkId = this.networkCodeToId(
|
|
2437
|
+
const networkId = this.networkCodeToId(networkCode);
|
|
2352
2438
|
const request = {
|
|
2353
2439
|
'coin': currency['id'],
|
|
2354
2440
|
'address': address,
|
|
@@ -2372,27 +2458,8 @@ export default class bitget extends Exchange {
|
|
|
2372
2458
|
// }
|
|
2373
2459
|
//
|
|
2374
2460
|
const data = this.safeValue(response, 'data', {});
|
|
2375
|
-
const result =
|
|
2376
|
-
|
|
2377
|
-
'info': response,
|
|
2378
|
-
'txid': undefined,
|
|
2379
|
-
'timestamp': undefined,
|
|
2380
|
-
'datetime': undefined,
|
|
2381
|
-
'network': undefined,
|
|
2382
|
-
'addressFrom': undefined,
|
|
2383
|
-
'address': undefined,
|
|
2384
|
-
'addressTo': undefined,
|
|
2385
|
-
'amount': undefined,
|
|
2386
|
-
'type': 'withdrawal',
|
|
2387
|
-
'currency': undefined,
|
|
2388
|
-
'status': undefined,
|
|
2389
|
-
'updated': undefined,
|
|
2390
|
-
'tagFrom': undefined,
|
|
2391
|
-
'tag': undefined,
|
|
2392
|
-
'tagTo': undefined,
|
|
2393
|
-
'comment': undefined,
|
|
2394
|
-
'fee': undefined,
|
|
2395
|
-
};
|
|
2461
|
+
const result = this.parseTransaction(data, currency);
|
|
2462
|
+
result['type'] = 'withdrawal';
|
|
2396
2463
|
const withdrawOptions = this.safeValue(this.options, 'withdraw', {});
|
|
2397
2464
|
const fillResponseFromRequest = this.safeBool(withdrawOptions, 'fillResponseFromRequest', true);
|
|
2398
2465
|
if (fillResponseFromRequest) {
|
|
@@ -2403,7 +2470,7 @@ export default class bitget extends Exchange {
|
|
|
2403
2470
|
result['tag'] = tag;
|
|
2404
2471
|
result['address'] = address;
|
|
2405
2472
|
result['addressTo'] = address;
|
|
2406
|
-
result['network'] =
|
|
2473
|
+
result['network'] = networkCode;
|
|
2407
2474
|
}
|
|
2408
2475
|
return result;
|
|
2409
2476
|
}
|
|
@@ -2571,18 +2638,14 @@ export default class bitget extends Exchange {
|
|
|
2571
2638
|
*/
|
|
2572
2639
|
async fetchDepositAddress(code, params = {}) {
|
|
2573
2640
|
await this.loadMarkets();
|
|
2574
|
-
|
|
2575
|
-
params = this.
|
|
2576
|
-
let networkId = undefined;
|
|
2577
|
-
if (networkCode !== undefined) {
|
|
2578
|
-
networkId = this.networkCodeToId(networkCode, code);
|
|
2579
|
-
}
|
|
2641
|
+
let networkCode = undefined;
|
|
2642
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2580
2643
|
const currency = this.currency(code);
|
|
2581
2644
|
const request = {
|
|
2582
2645
|
'coin': currency['id'],
|
|
2583
2646
|
};
|
|
2584
|
-
if (
|
|
2585
|
-
request['chain'] =
|
|
2647
|
+
if (networkCode !== undefined) {
|
|
2648
|
+
request['chain'] = this.networkCodeToId(networkCode, code);
|
|
2586
2649
|
}
|
|
2587
2650
|
const response = await this.privateSpotGetV2SpotWalletDepositAddress(this.extend(request, params));
|
|
2588
2651
|
//
|
package/js/src/bybit.js
CHANGED
|
@@ -1058,8 +1058,78 @@ export default class bybit extends Exchange {
|
|
|
1058
1058
|
'ERC20': 'ETH',
|
|
1059
1059
|
'TRC20': 'TRX',
|
|
1060
1060
|
'BEP20': 'BSC',
|
|
1061
|
+
'SOL': 'SOL',
|
|
1062
|
+
'ACA': 'ACA',
|
|
1063
|
+
'ADA': 'ADA',
|
|
1064
|
+
'ALGO': 'ALGO',
|
|
1065
|
+
'APT': 'APTOS',
|
|
1066
|
+
'AR': 'AR',
|
|
1067
|
+
'ARBONE': 'ARBI',
|
|
1068
|
+
'AVAXC': 'CAVAX',
|
|
1069
|
+
'AVAXX': 'XAVAX',
|
|
1070
|
+
'ATOM': 'ATOM',
|
|
1071
|
+
'BCH': 'BCH',
|
|
1072
|
+
'BEP2': 'BNB',
|
|
1073
|
+
'CHZ': 'CHZ',
|
|
1074
|
+
'DCR': 'DCR',
|
|
1075
|
+
'DGB': 'DGB',
|
|
1076
|
+
'DOGE': 'DOGE',
|
|
1077
|
+
'DOT': 'DOT',
|
|
1078
|
+
'EGLD': 'EGLD',
|
|
1079
|
+
'EOS': 'EOS',
|
|
1080
|
+
'ETC': 'ETC',
|
|
1081
|
+
'ETHF': 'ETHF',
|
|
1082
|
+
'ETHW': 'ETHW',
|
|
1083
|
+
'FIL': 'FIL',
|
|
1084
|
+
'STEP': 'FITFI',
|
|
1085
|
+
'FLOW': 'FLOW',
|
|
1086
|
+
'FTM': 'FTM',
|
|
1087
|
+
'GLMR': 'GLMR',
|
|
1088
|
+
'HBAR': 'HBAR',
|
|
1089
|
+
'HNT': 'HNT',
|
|
1090
|
+
'ICP': 'ICP',
|
|
1091
|
+
'ICX': 'ICX',
|
|
1092
|
+
'KDA': 'KDA',
|
|
1093
|
+
'KLAY': 'KLAY',
|
|
1094
|
+
'KMA': 'KMA',
|
|
1095
|
+
'KSM': 'KSM',
|
|
1096
|
+
'LTC': 'LTC',
|
|
1097
|
+
// 'TERRA': 'LUNANEW',
|
|
1098
|
+
// 'TERRACLASSIC': 'LUNA',
|
|
1099
|
+
'MATIC': 'MATIC',
|
|
1100
|
+
'MINA': 'MINA',
|
|
1101
|
+
'MOVR': 'MOVR',
|
|
1102
|
+
'NEAR': 'NEAR',
|
|
1103
|
+
'NEM': 'NEM',
|
|
1104
|
+
'OASYS': 'OAS',
|
|
1105
|
+
'OASIS': 'ROSE',
|
|
1061
1106
|
'OMNI': 'OMNI',
|
|
1062
|
-
'
|
|
1107
|
+
'ONE': 'ONE',
|
|
1108
|
+
'OPTIMISM': 'OP',
|
|
1109
|
+
'POKT': 'POKT',
|
|
1110
|
+
'QTUM': 'QTUM',
|
|
1111
|
+
'RVN': 'RVN',
|
|
1112
|
+
'SC': 'SC',
|
|
1113
|
+
'SCRT': 'SCRT',
|
|
1114
|
+
'STX': 'STX',
|
|
1115
|
+
'THETA': 'THETA',
|
|
1116
|
+
'TON': 'TON',
|
|
1117
|
+
'WAVES': 'WAVES',
|
|
1118
|
+
'WAX': 'WAXP',
|
|
1119
|
+
'XDC': 'XDC',
|
|
1120
|
+
'XEC': 'XEC',
|
|
1121
|
+
'XLM': 'XLM',
|
|
1122
|
+
'XRP': 'XRP',
|
|
1123
|
+
'XTZ': 'XTZ',
|
|
1124
|
+
'XYM': 'XYM',
|
|
1125
|
+
'ZEN': 'ZEN',
|
|
1126
|
+
'ZIL': 'ZIL',
|
|
1127
|
+
'ZKSYNC': 'ZKSYNC',
|
|
1128
|
+
// todo: uncomment after consensus
|
|
1129
|
+
// 'CADUCEUS': 'CMP',
|
|
1130
|
+
// 'KON': 'KON', // konpay, "konchain"
|
|
1131
|
+
// 'AURORA': 'AURORA',
|
|
1132
|
+
// 'BITCOINGOLD': 'BTG',
|
|
1063
1133
|
},
|
|
1064
1134
|
'networksById': {
|
|
1065
1135
|
'ETH': 'ERC20',
|
|
@@ -5359,12 +5429,11 @@ export default class bybit extends Exchange {
|
|
|
5359
5429
|
const address = this.safeString(depositAddress, 'addressDeposit');
|
|
5360
5430
|
const tag = this.safeString(depositAddress, 'tagDeposit');
|
|
5361
5431
|
const code = this.safeString(currency, 'code');
|
|
5362
|
-
const chain = this.safeString(depositAddress, 'chain');
|
|
5363
5432
|
this.checkAddress(address);
|
|
5364
5433
|
return {
|
|
5365
5434
|
'info': depositAddress,
|
|
5366
5435
|
'currency': code,
|
|
5367
|
-
'network': chain,
|
|
5436
|
+
'network': this.networkIdToCode(this.safeString(depositAddress, 'chain'), code),
|
|
5368
5437
|
'address': address,
|
|
5369
5438
|
'tag': tag,
|
|
5370
5439
|
};
|
|
@@ -5384,6 +5453,11 @@ export default class bybit extends Exchange {
|
|
|
5384
5453
|
const request = {
|
|
5385
5454
|
'coin': currency['id'],
|
|
5386
5455
|
};
|
|
5456
|
+
let networkCode = undefined;
|
|
5457
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
5458
|
+
if (networkCode !== undefined) {
|
|
5459
|
+
request['chainType'] = this.networkCodeToId(networkCode, code);
|
|
5460
|
+
}
|
|
5387
5461
|
const response = await this.privateGetV5AssetDepositQueryAddress(this.extend(request, params));
|
|
5388
5462
|
//
|
|
5389
5463
|
// {
|
|
@@ -5424,41 +5498,11 @@ export default class bybit extends Exchange {
|
|
|
5424
5498
|
*/
|
|
5425
5499
|
async fetchDepositAddress(code, params = {}) {
|
|
5426
5500
|
await this.loadMarkets();
|
|
5427
|
-
const [networkCode, query] = this.handleNetworkCodeAndParams(params);
|
|
5428
|
-
const networkId = this.networkCodeToId(networkCode);
|
|
5429
5501
|
const currency = this.currency(code);
|
|
5430
|
-
const
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5434
|
-
request['chainType'] = networkId;
|
|
5435
|
-
}
|
|
5436
|
-
const response = await this.privateGetV5AssetDepositQueryAddress(this.extend(request, query));
|
|
5437
|
-
//
|
|
5438
|
-
// {
|
|
5439
|
-
// "retCode": 0,
|
|
5440
|
-
// "retMsg": "success",
|
|
5441
|
-
// "result": {
|
|
5442
|
-
// "coin": "USDT",
|
|
5443
|
-
// "chains": [
|
|
5444
|
-
// {
|
|
5445
|
-
// "chainType": "ERC20",
|
|
5446
|
-
// "addressDeposit": "0xd9e1cd77afa0e50b452a62fbb68a3340602286c3",
|
|
5447
|
-
// "tagDeposit": "",
|
|
5448
|
-
// "chain": "ETH"
|
|
5449
|
-
// }
|
|
5450
|
-
// ]
|
|
5451
|
-
// },
|
|
5452
|
-
// "retExtInfo": {},
|
|
5453
|
-
// "time": 1672192792860
|
|
5454
|
-
// }
|
|
5455
|
-
//
|
|
5456
|
-
const result = this.safeDict(response, 'result', {});
|
|
5457
|
-
const chains = this.safeList(result, 'chains', []);
|
|
5458
|
-
const chainsIndexedById = this.indexBy(chains, 'chain');
|
|
5459
|
-
const selectedNetworkId = this.selectNetworkIdFromRawNetworks(code, networkCode, chainsIndexedById);
|
|
5460
|
-
const addressObject = this.safeDict(chainsIndexedById, selectedNetworkId, {});
|
|
5461
|
-
return this.parseDepositAddress(addressObject, currency);
|
|
5502
|
+
const [networkCode, paramsOmited] = this.handleNetworkCodeAndParams(params);
|
|
5503
|
+
const indexedAddresses = await this.fetchDepositAddressesByNetwork(code, paramsOmited);
|
|
5504
|
+
const selectedNetworkCode = this.selectNetworkCodeFromUnifiedNetworks(currency['code'], networkCode, indexedAddresses);
|
|
5505
|
+
return indexedAddresses[selectedNetworkCode];
|
|
5462
5506
|
}
|
|
5463
5507
|
/**
|
|
5464
5508
|
* @method
|
package/js/src/delta.d.ts
CHANGED
|
@@ -100,12 +100,13 @@ export default class delta extends Exchange {
|
|
|
100
100
|
* @method
|
|
101
101
|
* @name delta#fetchOHLCV
|
|
102
102
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
103
|
-
* @see https://docs.delta.exchange/#
|
|
103
|
+
* @see https://docs.delta.exchange/#delta-exchange-api-v2-historical-ohlc-candles-sparklines
|
|
104
104
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
105
105
|
* @param {string} timeframe the length of time each candle represents
|
|
106
106
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
107
107
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
108
108
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
109
|
+
* @param {string} [params.until] timestamp in ms of the latest candle to fetch
|
|
109
110
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
110
111
|
*/
|
|
111
112
|
fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
package/js/src/delta.js
CHANGED
|
@@ -1469,12 +1469,13 @@ export default class delta extends Exchange {
|
|
|
1469
1469
|
* @method
|
|
1470
1470
|
* @name delta#fetchOHLCV
|
|
1471
1471
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1472
|
-
* @see https://docs.delta.exchange/#
|
|
1472
|
+
* @see https://docs.delta.exchange/#delta-exchange-api-v2-historical-ohlc-candles-sparklines
|
|
1473
1473
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1474
1474
|
* @param {string} timeframe the length of time each candle represents
|
|
1475
1475
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
1476
1476
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
1477
1477
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1478
|
+
* @param {string} [params.until] timestamp in ms of the latest candle to fetch
|
|
1478
1479
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
1479
1480
|
*/
|
|
1480
1481
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
@@ -1485,15 +1486,20 @@ export default class delta extends Exchange {
|
|
|
1485
1486
|
};
|
|
1486
1487
|
const duration = this.parseTimeframe(timeframe);
|
|
1487
1488
|
limit = limit ? limit : 2000; // max 2000
|
|
1489
|
+
let until = this.safeIntegerProduct(params, 'until', 0.001);
|
|
1490
|
+
const untilIsDefined = (until !== undefined);
|
|
1491
|
+
if (untilIsDefined) {
|
|
1492
|
+
until = this.parseToInt(until);
|
|
1493
|
+
}
|
|
1488
1494
|
if (since === undefined) {
|
|
1489
|
-
const end = this.seconds();
|
|
1495
|
+
const end = untilIsDefined ? until : this.seconds();
|
|
1490
1496
|
request['end'] = end;
|
|
1491
1497
|
request['start'] = end - limit * duration;
|
|
1492
1498
|
}
|
|
1493
1499
|
else {
|
|
1494
1500
|
const start = this.parseToInt(since / 1000);
|
|
1495
1501
|
request['start'] = start;
|
|
1496
|
-
request['end'] = this.sum(start, limit * duration);
|
|
1502
|
+
request['end'] = untilIsDefined ? until : this.sum(start, limit * duration);
|
|
1497
1503
|
}
|
|
1498
1504
|
const price = this.safeString(params, 'price');
|
|
1499
1505
|
if (price === 'mark') {
|
|
@@ -1505,7 +1511,7 @@ export default class delta extends Exchange {
|
|
|
1505
1511
|
else {
|
|
1506
1512
|
request['symbol'] = market['id'];
|
|
1507
1513
|
}
|
|
1508
|
-
params = this.omit(params, 'price');
|
|
1514
|
+
params = this.omit(params, ['price', 'until']);
|
|
1509
1515
|
const response = await this.publicGetHistoryCandles(this.extend(request, params));
|
|
1510
1516
|
//
|
|
1511
1517
|
// {
|
package/js/src/gate.js
CHANGED
package/js/src/hyperliquid.js
CHANGED
|
@@ -230,7 +230,6 @@ export default class hyperliquid extends Exchange {
|
|
|
230
230
|
'takeProfitPrice': false,
|
|
231
231
|
'attachedStopLossTakeProfit': undefined,
|
|
232
232
|
'timeInForce': {
|
|
233
|
-
'GTC': true,
|
|
234
233
|
'IOC': true,
|
|
235
234
|
'FOK': false,
|
|
236
235
|
'PO': true,
|
|
@@ -2258,7 +2257,7 @@ export default class hyperliquid extends Exchange {
|
|
|
2258
2257
|
market = this.safeMarket(marketId, market);
|
|
2259
2258
|
}
|
|
2260
2259
|
const symbol = market['symbol'];
|
|
2261
|
-
const timestamp = this.
|
|
2260
|
+
const timestamp = this.safeInteger(entry, 'timestamp');
|
|
2262
2261
|
const status = this.safeString2(order, 'status', 'ccxtStatus');
|
|
2263
2262
|
order = this.omit(order, ['ccxtStatus']);
|
|
2264
2263
|
let side = this.safeString(entry, 'side');
|
|
@@ -2274,7 +2273,7 @@ export default class hyperliquid extends Exchange {
|
|
|
2274
2273
|
'timestamp': timestamp,
|
|
2275
2274
|
'datetime': this.iso8601(timestamp),
|
|
2276
2275
|
'lastTradeTimestamp': undefined,
|
|
2277
|
-
'lastUpdateTimestamp':
|
|
2276
|
+
'lastUpdateTimestamp': this.safeInteger(order, 'statusTimestamp'),
|
|
2278
2277
|
'symbol': symbol,
|
|
2279
2278
|
'type': this.parseOrderType(this.safeStringLower(entry, 'orderType')),
|
|
2280
2279
|
'timeInForce': this.safeStringUpper(entry, 'tif'),
|
package/js/src/mexc.js
CHANGED
package/js/src/onetrading.d.ts
CHANGED
|
@@ -109,6 +109,7 @@ export default class onetrading extends Exchange {
|
|
|
109
109
|
fetchBalance(params?: {}): Promise<Balances>;
|
|
110
110
|
parseOrderStatus(status: Str): string;
|
|
111
111
|
parseOrder(order: Dict, market?: Market): Order;
|
|
112
|
+
parseOrderType(type: Str): string;
|
|
112
113
|
parseTimeInForce(timeInForce: Str): string;
|
|
113
114
|
/**
|
|
114
115
|
* @method
|
|
@@ -135,7 +136,7 @@ export default class onetrading extends Exchange {
|
|
|
135
136
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
136
137
|
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
137
138
|
*/
|
|
138
|
-
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<
|
|
139
|
+
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
139
140
|
/**
|
|
140
141
|
* @method
|
|
141
142
|
* @name onetrading#cancelAllOrders
|
package/js/src/onetrading.js
CHANGED
|
@@ -278,7 +278,9 @@ export default class onetrading extends Exchange {
|
|
|
278
278
|
'CF_RATELIMIT': DDoSProtection,
|
|
279
279
|
'INTERNAL_SERVER_ERROR': ExchangeError,
|
|
280
280
|
},
|
|
281
|
-
'broad': {
|
|
281
|
+
'broad': {
|
|
282
|
+
'Order not found.': OrderNotFound,
|
|
283
|
+
},
|
|
282
284
|
},
|
|
283
285
|
'commonCurrencies': {
|
|
284
286
|
'MIOTA': 'IOTA', // https://github.com/ccxt/ccxt/issues/7487
|
|
@@ -1005,6 +1007,7 @@ export default class onetrading extends Exchange {
|
|
|
1005
1007
|
'CLOSED': 'canceled',
|
|
1006
1008
|
'FAILED': 'failed',
|
|
1007
1009
|
'STOP_TRIGGERED': 'triggered',
|
|
1010
|
+
'DONE': 'closed',
|
|
1008
1011
|
};
|
|
1009
1012
|
return this.safeString(statuses, status, status);
|
|
1010
1013
|
}
|
|
@@ -1099,7 +1102,7 @@ export default class onetrading extends Exchange {
|
|
|
1099
1102
|
'datetime': this.iso8601(timestamp),
|
|
1100
1103
|
'lastTradeTimestamp': undefined,
|
|
1101
1104
|
'symbol': symbol,
|
|
1102
|
-
'type': type,
|
|
1105
|
+
'type': this.parseOrderType(type),
|
|
1103
1106
|
'timeInForce': timeInForce,
|
|
1104
1107
|
'postOnly': postOnly,
|
|
1105
1108
|
'side': side,
|
|
@@ -1115,6 +1118,12 @@ export default class onetrading extends Exchange {
|
|
|
1115
1118
|
'trades': rawTrades,
|
|
1116
1119
|
}, market);
|
|
1117
1120
|
}
|
|
1121
|
+
parseOrderType(type) {
|
|
1122
|
+
const types = {
|
|
1123
|
+
'booked': 'limit',
|
|
1124
|
+
};
|
|
1125
|
+
return this.safeString(types, type, type);
|
|
1126
|
+
}
|
|
1118
1127
|
parseTimeInForce(timeInForce) {
|
|
1119
1128
|
const timeInForces = {
|
|
1120
1129
|
'GOOD_TILL_CANCELLED': 'GTC',
|
|
@@ -1178,6 +1187,9 @@ export default class onetrading extends Exchange {
|
|
|
1178
1187
|
request['client_id'] = clientOrderId;
|
|
1179
1188
|
params = this.omit(params, ['clientOrderId', 'client_id']);
|
|
1180
1189
|
}
|
|
1190
|
+
const timeInForce = this.safeString2(params, 'timeInForce', 'time_in_force', 'GOOD_TILL_CANCELLED');
|
|
1191
|
+
params = this.omit(params, 'timeInForce');
|
|
1192
|
+
request['time_in_force'] = timeInForce;
|
|
1181
1193
|
const response = await this.privatePostAccountOrders(this.extend(request, params));
|
|
1182
1194
|
//
|
|
1183
1195
|
// {
|
|
@@ -1219,11 +1231,17 @@ export default class onetrading extends Exchange {
|
|
|
1219
1231
|
else {
|
|
1220
1232
|
request['order_id'] = id;
|
|
1221
1233
|
}
|
|
1222
|
-
|
|
1234
|
+
let response = undefined;
|
|
1235
|
+
if (method === 'privateDeleteAccountOrdersOrderId') {
|
|
1236
|
+
response = await this.privateDeleteAccountOrdersOrderId(this.extend(request, params));
|
|
1237
|
+
}
|
|
1238
|
+
else {
|
|
1239
|
+
response = await this.privateDeleteAccountOrdersClientClientId(this.extend(request, params));
|
|
1240
|
+
}
|
|
1223
1241
|
//
|
|
1224
1242
|
// responds with an empty body
|
|
1225
1243
|
//
|
|
1226
|
-
return response;
|
|
1244
|
+
return this.parseOrder(response);
|
|
1227
1245
|
}
|
|
1228
1246
|
/**
|
|
1229
1247
|
* @method
|
package/js/src/pro/coinex.js
CHANGED
|
@@ -1289,7 +1289,7 @@ export default class coinex extends coinexRest {
|
|
|
1289
1289
|
const defaultType = this.safeString(this.options, 'defaultType');
|
|
1290
1290
|
const marketId = this.safeString(ticker, 'market');
|
|
1291
1291
|
market = this.safeMarket(marketId, market, undefined, defaultType);
|
|
1292
|
-
const timestamp = this.
|
|
1292
|
+
const timestamp = this.safeInteger(ticker, 'updated_at');
|
|
1293
1293
|
return this.safeTicker({
|
|
1294
1294
|
'symbol': this.safeSymbol(marketId, market, undefined, defaultType),
|
|
1295
1295
|
'timestamp': timestamp,
|
package/package.json
CHANGED