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/dist/cjs/ccxt.js
CHANGED
|
@@ -202,7 +202,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
202
202
|
|
|
203
203
|
//-----------------------------------------------------------------------------
|
|
204
204
|
// this is updated by vss.js when building
|
|
205
|
-
const version = '4.4.
|
|
205
|
+
const version = '4.4.46';
|
|
206
206
|
Exchange["default"].ccxtVersion = version;
|
|
207
207
|
const exchanges = {
|
|
208
208
|
'ace': ace,
|
package/dist/cjs/src/ascendex.js
CHANGED
|
@@ -1114,6 +1114,7 @@ class ascendex extends ascendex$1 {
|
|
|
1114
1114
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
1115
1115
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
1116
1116
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1117
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
1117
1118
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
1118
1119
|
*/
|
|
1119
1120
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
@@ -1128,6 +1129,7 @@ class ascendex extends ascendex$1 {
|
|
|
1128
1129
|
const duration = this.parseTimeframe(timeframe);
|
|
1129
1130
|
const options = this.safeDict(this.options, 'fetchOHLCV', {});
|
|
1130
1131
|
const defaultLimit = this.safeInteger(options, 'limit', 500);
|
|
1132
|
+
const until = this.safeInteger(params, 'until');
|
|
1131
1133
|
if (since !== undefined) {
|
|
1132
1134
|
request['from'] = since;
|
|
1133
1135
|
if (limit === undefined) {
|
|
@@ -1136,11 +1138,28 @@ class ascendex extends ascendex$1 {
|
|
|
1136
1138
|
else {
|
|
1137
1139
|
limit = Math.min(limit, defaultLimit);
|
|
1138
1140
|
}
|
|
1139
|
-
|
|
1141
|
+
const toWithLimit = this.sum(since, limit * duration * 1000, 1);
|
|
1142
|
+
if (until !== undefined) {
|
|
1143
|
+
request['to'] = Math.min(toWithLimit, until + 1);
|
|
1144
|
+
}
|
|
1145
|
+
else {
|
|
1146
|
+
request['to'] = toWithLimit;
|
|
1147
|
+
}
|
|
1148
|
+
}
|
|
1149
|
+
else if (until !== undefined) {
|
|
1150
|
+
request['to'] = until + 1;
|
|
1151
|
+
if (limit === undefined) {
|
|
1152
|
+
limit = defaultLimit;
|
|
1153
|
+
}
|
|
1154
|
+
else {
|
|
1155
|
+
limit = Math.min(limit, defaultLimit);
|
|
1156
|
+
}
|
|
1157
|
+
request['from'] = until - (limit * duration * 1000);
|
|
1140
1158
|
}
|
|
1141
1159
|
else if (limit !== undefined) {
|
|
1142
1160
|
request['n'] = limit; // max 500
|
|
1143
1161
|
}
|
|
1162
|
+
params = this.omit(params, 'until');
|
|
1144
1163
|
const response = await this.v1PublicGetBarhist(this.extend(request, params));
|
|
1145
1164
|
//
|
|
1146
1165
|
// {
|
package/dist/cjs/src/binance.js
CHANGED
|
@@ -2472,7 +2472,7 @@ class binance extends binance$1 {
|
|
|
2472
2472
|
//
|
|
2473
2473
|
'-2010': errors.InvalidOrder,
|
|
2474
2474
|
'-2011': errors.OperationRejected,
|
|
2475
|
-
'-2013': errors.
|
|
2475
|
+
'-2013': errors.OrderNotFound,
|
|
2476
2476
|
'-2014': errors.OperationRejected,
|
|
2477
2477
|
'-2015': errors.OperationRejected,
|
|
2478
2478
|
'-2016': errors.OperationFailed,
|
package/dist/cjs/src/bitget.js
CHANGED
|
@@ -1423,16 +1423,102 @@ class bitget extends bitget$1 {
|
|
|
1423
1423
|
},
|
|
1424
1424
|
'sandboxMode': false,
|
|
1425
1425
|
'networks': {
|
|
1426
|
+
// 'TRX': 'TRX', // different code for mainnet
|
|
1426
1427
|
'TRC20': 'TRC20',
|
|
1428
|
+
// 'ETH': 'ETH', // different code for mainnet
|
|
1427
1429
|
'ERC20': 'ERC20',
|
|
1428
1430
|
'BEP20': 'BSC',
|
|
1429
|
-
'
|
|
1430
|
-
'
|
|
1431
|
-
'
|
|
1431
|
+
// 'BEP20': 'BEP20', // different for BEP20
|
|
1432
|
+
'BSC': 'BEP20',
|
|
1433
|
+
'ATOM': 'ATOM',
|
|
1434
|
+
'ACA': 'AcalaToken',
|
|
1432
1435
|
'APT': 'Aptos',
|
|
1436
|
+
'ARBONE': 'ArbitrumOne',
|
|
1437
|
+
'ARBNOVA': 'ArbitrumNova',
|
|
1438
|
+
'AVAXC': 'C-Chain',
|
|
1439
|
+
'AVAXX': 'X-Chain',
|
|
1440
|
+
'AR': 'Arweave',
|
|
1441
|
+
'BCH': 'BCH',
|
|
1442
|
+
'BCHA': 'BCHA',
|
|
1443
|
+
'BITCI': 'BITCI',
|
|
1444
|
+
'BTC': 'BTC',
|
|
1445
|
+
'CELO': 'CELO',
|
|
1446
|
+
'CSPR': 'CSPR',
|
|
1447
|
+
'ADA': 'Cardano',
|
|
1448
|
+
'CHZ': 'ChilizChain',
|
|
1449
|
+
'CRC20': 'CronosChain',
|
|
1450
|
+
'DOGE': 'DOGE',
|
|
1451
|
+
'DOT': 'DOT',
|
|
1452
|
+
'EOS': 'EOS',
|
|
1453
|
+
'ETHF': 'ETHFAIR',
|
|
1454
|
+
'ETHW': 'ETHW',
|
|
1455
|
+
'ETC': 'ETC',
|
|
1456
|
+
'EGLD': 'Elrond',
|
|
1457
|
+
'FIL': 'FIL',
|
|
1458
|
+
'FIO': 'FIO',
|
|
1459
|
+
'FTM': 'Fantom',
|
|
1460
|
+
'HRC20': 'HECO',
|
|
1461
|
+
'ONE': 'Harmony',
|
|
1462
|
+
'HNT': 'Helium',
|
|
1463
|
+
'ICP': 'ICP',
|
|
1464
|
+
'IOTX': 'IoTeX',
|
|
1465
|
+
'KARDIA': 'KAI',
|
|
1466
|
+
'KAVA': 'KAVA',
|
|
1467
|
+
'KDA': 'KDA',
|
|
1468
|
+
'KLAY': 'Klaytn',
|
|
1469
|
+
'KSM': 'Kusama',
|
|
1470
|
+
'LAT': 'LAT',
|
|
1471
|
+
'LTC': 'LTC',
|
|
1472
|
+
'MINA': 'MINA',
|
|
1473
|
+
'MOVR': 'MOVR',
|
|
1474
|
+
'METIS': 'MetisToken',
|
|
1475
|
+
'GLMR': 'Moonbeam',
|
|
1476
|
+
'NEAR': 'NEARProtocol',
|
|
1477
|
+
'NULS': 'NULS',
|
|
1478
|
+
'OASYS': 'OASYS',
|
|
1479
|
+
'OASIS': 'ROSE',
|
|
1480
|
+
'OMNI': 'OMNI',
|
|
1481
|
+
'ONT': 'Ontology',
|
|
1482
|
+
'OPTIMISM': 'Optimism',
|
|
1483
|
+
'OSMO': 'Osmosis',
|
|
1484
|
+
'POKT': 'PocketNetwork',
|
|
1433
1485
|
'MATIC': 'Polygon',
|
|
1486
|
+
'QTUM': 'QTUM',
|
|
1487
|
+
'REEF': 'REEF',
|
|
1488
|
+
'SOL': 'SOL',
|
|
1489
|
+
'SYS': 'SYS',
|
|
1490
|
+
'SXP': 'Solar',
|
|
1491
|
+
'XYM': 'Symbol',
|
|
1492
|
+
'TON': 'TON',
|
|
1493
|
+
'TT': 'TT',
|
|
1494
|
+
'TLOS': 'Telos',
|
|
1495
|
+
'THETA': 'ThetaToken',
|
|
1496
|
+
'VITE': 'VITE',
|
|
1497
|
+
'WAVES': 'WAVES',
|
|
1498
|
+
'WAX': 'WAXP',
|
|
1499
|
+
'WEMIX': 'WEMIXMainnet',
|
|
1500
|
+
'XDC': 'XDCNetworkXDC',
|
|
1501
|
+
'XRP': 'XRP',
|
|
1502
|
+
'FET': 'FETCH',
|
|
1503
|
+
'NEM': 'NEM',
|
|
1504
|
+
'REI': 'REINetwork',
|
|
1505
|
+
'ZIL': 'ZIL',
|
|
1506
|
+
'ABBC': 'ABBCCoin',
|
|
1507
|
+
'RSK': 'RSK',
|
|
1508
|
+
'AZERO': 'AZERO',
|
|
1509
|
+
'TRC10': 'TRC10',
|
|
1510
|
+
'JUNO': 'JUNO',
|
|
1511
|
+
// undetected: USDSP, more info at https://www.bitget.com/v1/spot/public/coinChainList
|
|
1512
|
+
// todo: uncomment below after unification
|
|
1513
|
+
// 'TERRACLASSIC': 'Terra', // tbd, that network id is also assigned to TERRANEW network
|
|
1514
|
+
// 'CUBENETWORK': 'CUBE',
|
|
1515
|
+
// 'CADUCEUS': 'CMP',
|
|
1516
|
+
// 'CONFLUX': 'CFX', // CFXeSpace is different
|
|
1517
|
+
// 'CERE': 'CERE',
|
|
1518
|
+
// 'CANTO': 'CANTO',
|
|
1519
|
+
'ZKSYNC': 'zkSyncEra',
|
|
1520
|
+
'STARKNET': 'Starknet',
|
|
1434
1521
|
'VIC': 'VICTION',
|
|
1435
|
-
'AVAXC': 'C-Chain',
|
|
1436
1522
|
},
|
|
1437
1523
|
'networksById': {},
|
|
1438
1524
|
'fetchPositions': {
|
|
@@ -2338,14 +2424,14 @@ class bitget extends bitget$1 {
|
|
|
2338
2424
|
*/
|
|
2339
2425
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
2340
2426
|
this.checkAddress(address);
|
|
2341
|
-
|
|
2342
|
-
params = this.
|
|
2343
|
-
if (
|
|
2344
|
-
throw new errors.ArgumentsRequired(this.id + ' withdraw() requires a
|
|
2427
|
+
let networkCode = undefined;
|
|
2428
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2429
|
+
if (networkCode === undefined) {
|
|
2430
|
+
throw new errors.ArgumentsRequired(this.id + ' withdraw() requires a "network" parameter');
|
|
2345
2431
|
}
|
|
2346
2432
|
await this.loadMarkets();
|
|
2347
2433
|
const currency = this.currency(code);
|
|
2348
|
-
const networkId = this.networkCodeToId(
|
|
2434
|
+
const networkId = this.networkCodeToId(networkCode);
|
|
2349
2435
|
const request = {
|
|
2350
2436
|
'coin': currency['id'],
|
|
2351
2437
|
'address': address,
|
|
@@ -2369,27 +2455,8 @@ class bitget extends bitget$1 {
|
|
|
2369
2455
|
// }
|
|
2370
2456
|
//
|
|
2371
2457
|
const data = this.safeValue(response, 'data', {});
|
|
2372
|
-
const result =
|
|
2373
|
-
|
|
2374
|
-
'info': response,
|
|
2375
|
-
'txid': undefined,
|
|
2376
|
-
'timestamp': undefined,
|
|
2377
|
-
'datetime': undefined,
|
|
2378
|
-
'network': undefined,
|
|
2379
|
-
'addressFrom': undefined,
|
|
2380
|
-
'address': undefined,
|
|
2381
|
-
'addressTo': undefined,
|
|
2382
|
-
'amount': undefined,
|
|
2383
|
-
'type': 'withdrawal',
|
|
2384
|
-
'currency': undefined,
|
|
2385
|
-
'status': undefined,
|
|
2386
|
-
'updated': undefined,
|
|
2387
|
-
'tagFrom': undefined,
|
|
2388
|
-
'tag': undefined,
|
|
2389
|
-
'tagTo': undefined,
|
|
2390
|
-
'comment': undefined,
|
|
2391
|
-
'fee': undefined,
|
|
2392
|
-
};
|
|
2458
|
+
const result = this.parseTransaction(data, currency);
|
|
2459
|
+
result['type'] = 'withdrawal';
|
|
2393
2460
|
const withdrawOptions = this.safeValue(this.options, 'withdraw', {});
|
|
2394
2461
|
const fillResponseFromRequest = this.safeBool(withdrawOptions, 'fillResponseFromRequest', true);
|
|
2395
2462
|
if (fillResponseFromRequest) {
|
|
@@ -2400,7 +2467,7 @@ class bitget extends bitget$1 {
|
|
|
2400
2467
|
result['tag'] = tag;
|
|
2401
2468
|
result['address'] = address;
|
|
2402
2469
|
result['addressTo'] = address;
|
|
2403
|
-
result['network'] =
|
|
2470
|
+
result['network'] = networkCode;
|
|
2404
2471
|
}
|
|
2405
2472
|
return result;
|
|
2406
2473
|
}
|
|
@@ -2568,18 +2635,14 @@ class bitget extends bitget$1 {
|
|
|
2568
2635
|
*/
|
|
2569
2636
|
async fetchDepositAddress(code, params = {}) {
|
|
2570
2637
|
await this.loadMarkets();
|
|
2571
|
-
|
|
2572
|
-
params = this.
|
|
2573
|
-
let networkId = undefined;
|
|
2574
|
-
if (networkCode !== undefined) {
|
|
2575
|
-
networkId = this.networkCodeToId(networkCode, code);
|
|
2576
|
-
}
|
|
2638
|
+
let networkCode = undefined;
|
|
2639
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2577
2640
|
const currency = this.currency(code);
|
|
2578
2641
|
const request = {
|
|
2579
2642
|
'coin': currency['id'],
|
|
2580
2643
|
};
|
|
2581
|
-
if (
|
|
2582
|
-
request['chain'] =
|
|
2644
|
+
if (networkCode !== undefined) {
|
|
2645
|
+
request['chain'] = this.networkCodeToId(networkCode, code);
|
|
2583
2646
|
}
|
|
2584
2647
|
const response = await this.privateSpotGetV2SpotWalletDepositAddress(this.extend(request, params));
|
|
2585
2648
|
//
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -1055,8 +1055,78 @@ class bybit extends bybit$1 {
|
|
|
1055
1055
|
'ERC20': 'ETH',
|
|
1056
1056
|
'TRC20': 'TRX',
|
|
1057
1057
|
'BEP20': 'BSC',
|
|
1058
|
+
'SOL': 'SOL',
|
|
1059
|
+
'ACA': 'ACA',
|
|
1060
|
+
'ADA': 'ADA',
|
|
1061
|
+
'ALGO': 'ALGO',
|
|
1062
|
+
'APT': 'APTOS',
|
|
1063
|
+
'AR': 'AR',
|
|
1064
|
+
'ARBONE': 'ARBI',
|
|
1065
|
+
'AVAXC': 'CAVAX',
|
|
1066
|
+
'AVAXX': 'XAVAX',
|
|
1067
|
+
'ATOM': 'ATOM',
|
|
1068
|
+
'BCH': 'BCH',
|
|
1069
|
+
'BEP2': 'BNB',
|
|
1070
|
+
'CHZ': 'CHZ',
|
|
1071
|
+
'DCR': 'DCR',
|
|
1072
|
+
'DGB': 'DGB',
|
|
1073
|
+
'DOGE': 'DOGE',
|
|
1074
|
+
'DOT': 'DOT',
|
|
1075
|
+
'EGLD': 'EGLD',
|
|
1076
|
+
'EOS': 'EOS',
|
|
1077
|
+
'ETC': 'ETC',
|
|
1078
|
+
'ETHF': 'ETHF',
|
|
1079
|
+
'ETHW': 'ETHW',
|
|
1080
|
+
'FIL': 'FIL',
|
|
1081
|
+
'STEP': 'FITFI',
|
|
1082
|
+
'FLOW': 'FLOW',
|
|
1083
|
+
'FTM': 'FTM',
|
|
1084
|
+
'GLMR': 'GLMR',
|
|
1085
|
+
'HBAR': 'HBAR',
|
|
1086
|
+
'HNT': 'HNT',
|
|
1087
|
+
'ICP': 'ICP',
|
|
1088
|
+
'ICX': 'ICX',
|
|
1089
|
+
'KDA': 'KDA',
|
|
1090
|
+
'KLAY': 'KLAY',
|
|
1091
|
+
'KMA': 'KMA',
|
|
1092
|
+
'KSM': 'KSM',
|
|
1093
|
+
'LTC': 'LTC',
|
|
1094
|
+
// 'TERRA': 'LUNANEW',
|
|
1095
|
+
// 'TERRACLASSIC': 'LUNA',
|
|
1096
|
+
'MATIC': 'MATIC',
|
|
1097
|
+
'MINA': 'MINA',
|
|
1098
|
+
'MOVR': 'MOVR',
|
|
1099
|
+
'NEAR': 'NEAR',
|
|
1100
|
+
'NEM': 'NEM',
|
|
1101
|
+
'OASYS': 'OAS',
|
|
1102
|
+
'OASIS': 'ROSE',
|
|
1058
1103
|
'OMNI': 'OMNI',
|
|
1059
|
-
'
|
|
1104
|
+
'ONE': 'ONE',
|
|
1105
|
+
'OPTIMISM': 'OP',
|
|
1106
|
+
'POKT': 'POKT',
|
|
1107
|
+
'QTUM': 'QTUM',
|
|
1108
|
+
'RVN': 'RVN',
|
|
1109
|
+
'SC': 'SC',
|
|
1110
|
+
'SCRT': 'SCRT',
|
|
1111
|
+
'STX': 'STX',
|
|
1112
|
+
'THETA': 'THETA',
|
|
1113
|
+
'TON': 'TON',
|
|
1114
|
+
'WAVES': 'WAVES',
|
|
1115
|
+
'WAX': 'WAXP',
|
|
1116
|
+
'XDC': 'XDC',
|
|
1117
|
+
'XEC': 'XEC',
|
|
1118
|
+
'XLM': 'XLM',
|
|
1119
|
+
'XRP': 'XRP',
|
|
1120
|
+
'XTZ': 'XTZ',
|
|
1121
|
+
'XYM': 'XYM',
|
|
1122
|
+
'ZEN': 'ZEN',
|
|
1123
|
+
'ZIL': 'ZIL',
|
|
1124
|
+
'ZKSYNC': 'ZKSYNC',
|
|
1125
|
+
// todo: uncomment after consensus
|
|
1126
|
+
// 'CADUCEUS': 'CMP',
|
|
1127
|
+
// 'KON': 'KON', // konpay, "konchain"
|
|
1128
|
+
// 'AURORA': 'AURORA',
|
|
1129
|
+
// 'BITCOINGOLD': 'BTG',
|
|
1060
1130
|
},
|
|
1061
1131
|
'networksById': {
|
|
1062
1132
|
'ETH': 'ERC20',
|
|
@@ -5356,12 +5426,11 @@ class bybit extends bybit$1 {
|
|
|
5356
5426
|
const address = this.safeString(depositAddress, 'addressDeposit');
|
|
5357
5427
|
const tag = this.safeString(depositAddress, 'tagDeposit');
|
|
5358
5428
|
const code = this.safeString(currency, 'code');
|
|
5359
|
-
const chain = this.safeString(depositAddress, 'chain');
|
|
5360
5429
|
this.checkAddress(address);
|
|
5361
5430
|
return {
|
|
5362
5431
|
'info': depositAddress,
|
|
5363
5432
|
'currency': code,
|
|
5364
|
-
'network': chain,
|
|
5433
|
+
'network': this.networkIdToCode(this.safeString(depositAddress, 'chain'), code),
|
|
5365
5434
|
'address': address,
|
|
5366
5435
|
'tag': tag,
|
|
5367
5436
|
};
|
|
@@ -5381,6 +5450,11 @@ class bybit extends bybit$1 {
|
|
|
5381
5450
|
const request = {
|
|
5382
5451
|
'coin': currency['id'],
|
|
5383
5452
|
};
|
|
5453
|
+
let networkCode = undefined;
|
|
5454
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
5455
|
+
if (networkCode !== undefined) {
|
|
5456
|
+
request['chainType'] = this.networkCodeToId(networkCode, code);
|
|
5457
|
+
}
|
|
5384
5458
|
const response = await this.privateGetV5AssetDepositQueryAddress(this.extend(request, params));
|
|
5385
5459
|
//
|
|
5386
5460
|
// {
|
|
@@ -5421,41 +5495,11 @@ class bybit extends bybit$1 {
|
|
|
5421
5495
|
*/
|
|
5422
5496
|
async fetchDepositAddress(code, params = {}) {
|
|
5423
5497
|
await this.loadMarkets();
|
|
5424
|
-
const [networkCode, query] = this.handleNetworkCodeAndParams(params);
|
|
5425
|
-
const networkId = this.networkCodeToId(networkCode);
|
|
5426
5498
|
const currency = this.currency(code);
|
|
5427
|
-
const
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
request['chainType'] = networkId;
|
|
5432
|
-
}
|
|
5433
|
-
const response = await this.privateGetV5AssetDepositQueryAddress(this.extend(request, query));
|
|
5434
|
-
//
|
|
5435
|
-
// {
|
|
5436
|
-
// "retCode": 0,
|
|
5437
|
-
// "retMsg": "success",
|
|
5438
|
-
// "result": {
|
|
5439
|
-
// "coin": "USDT",
|
|
5440
|
-
// "chains": [
|
|
5441
|
-
// {
|
|
5442
|
-
// "chainType": "ERC20",
|
|
5443
|
-
// "addressDeposit": "0xd9e1cd77afa0e50b452a62fbb68a3340602286c3",
|
|
5444
|
-
// "tagDeposit": "",
|
|
5445
|
-
// "chain": "ETH"
|
|
5446
|
-
// }
|
|
5447
|
-
// ]
|
|
5448
|
-
// },
|
|
5449
|
-
// "retExtInfo": {},
|
|
5450
|
-
// "time": 1672192792860
|
|
5451
|
-
// }
|
|
5452
|
-
//
|
|
5453
|
-
const result = this.safeDict(response, 'result', {});
|
|
5454
|
-
const chains = this.safeList(result, 'chains', []);
|
|
5455
|
-
const chainsIndexedById = this.indexBy(chains, 'chain');
|
|
5456
|
-
const selectedNetworkId = this.selectNetworkIdFromRawNetworks(code, networkCode, chainsIndexedById);
|
|
5457
|
-
const addressObject = this.safeDict(chainsIndexedById, selectedNetworkId, {});
|
|
5458
|
-
return this.parseDepositAddress(addressObject, currency);
|
|
5499
|
+
const [networkCode, paramsOmited] = this.handleNetworkCodeAndParams(params);
|
|
5500
|
+
const indexedAddresses = await this.fetchDepositAddressesByNetwork(code, paramsOmited);
|
|
5501
|
+
const selectedNetworkCode = this.selectNetworkCodeFromUnifiedNetworks(currency['code'], networkCode, indexedAddresses);
|
|
5502
|
+
return indexedAddresses[selectedNetworkCode];
|
|
5459
5503
|
}
|
|
5460
5504
|
/**
|
|
5461
5505
|
* @method
|
package/dist/cjs/src/delta.js
CHANGED
|
@@ -1466,12 +1466,13 @@ class delta extends delta$1 {
|
|
|
1466
1466
|
* @method
|
|
1467
1467
|
* @name delta#fetchOHLCV
|
|
1468
1468
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1469
|
-
* @see https://docs.delta.exchange/#
|
|
1469
|
+
* @see https://docs.delta.exchange/#delta-exchange-api-v2-historical-ohlc-candles-sparklines
|
|
1470
1470
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1471
1471
|
* @param {string} timeframe the length of time each candle represents
|
|
1472
1472
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
1473
1473
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
1474
1474
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1475
|
+
* @param {string} [params.until] timestamp in ms of the latest candle to fetch
|
|
1475
1476
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
1476
1477
|
*/
|
|
1477
1478
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
@@ -1482,15 +1483,20 @@ class delta extends delta$1 {
|
|
|
1482
1483
|
};
|
|
1483
1484
|
const duration = this.parseTimeframe(timeframe);
|
|
1484
1485
|
limit = limit ? limit : 2000; // max 2000
|
|
1486
|
+
let until = this.safeIntegerProduct(params, 'until', 0.001);
|
|
1487
|
+
const untilIsDefined = (until !== undefined);
|
|
1488
|
+
if (untilIsDefined) {
|
|
1489
|
+
until = this.parseToInt(until);
|
|
1490
|
+
}
|
|
1485
1491
|
if (since === undefined) {
|
|
1486
|
-
const end = this.seconds();
|
|
1492
|
+
const end = untilIsDefined ? until : this.seconds();
|
|
1487
1493
|
request['end'] = end;
|
|
1488
1494
|
request['start'] = end - limit * duration;
|
|
1489
1495
|
}
|
|
1490
1496
|
else {
|
|
1491
1497
|
const start = this.parseToInt(since / 1000);
|
|
1492
1498
|
request['start'] = start;
|
|
1493
|
-
request['end'] = this.sum(start, limit * duration);
|
|
1499
|
+
request['end'] = untilIsDefined ? until : this.sum(start, limit * duration);
|
|
1494
1500
|
}
|
|
1495
1501
|
const price = this.safeString(params, 'price');
|
|
1496
1502
|
if (price === 'mark') {
|
|
@@ -1502,7 +1508,7 @@ class delta extends delta$1 {
|
|
|
1502
1508
|
else {
|
|
1503
1509
|
request['symbol'] = market['id'];
|
|
1504
1510
|
}
|
|
1505
|
-
params = this.omit(params, 'price');
|
|
1511
|
+
params = this.omit(params, ['price', 'until']);
|
|
1506
1512
|
const response = await this.publicGetHistoryCandles(this.extend(request, params));
|
|
1507
1513
|
//
|
|
1508
1514
|
// {
|
package/dist/cjs/src/gate.js
CHANGED
|
@@ -227,7 +227,6 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
227
227
|
'takeProfitPrice': false,
|
|
228
228
|
'attachedStopLossTakeProfit': undefined,
|
|
229
229
|
'timeInForce': {
|
|
230
|
-
'GTC': true,
|
|
231
230
|
'IOC': true,
|
|
232
231
|
'FOK': false,
|
|
233
232
|
'PO': true,
|
|
@@ -2255,7 +2254,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
2255
2254
|
market = this.safeMarket(marketId, market);
|
|
2256
2255
|
}
|
|
2257
2256
|
const symbol = market['symbol'];
|
|
2258
|
-
const timestamp = this.
|
|
2257
|
+
const timestamp = this.safeInteger(entry, 'timestamp');
|
|
2259
2258
|
const status = this.safeString2(order, 'status', 'ccxtStatus');
|
|
2260
2259
|
order = this.omit(order, ['ccxtStatus']);
|
|
2261
2260
|
let side = this.safeString(entry, 'side');
|
|
@@ -2271,7 +2270,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
2271
2270
|
'timestamp': timestamp,
|
|
2272
2271
|
'datetime': this.iso8601(timestamp),
|
|
2273
2272
|
'lastTradeTimestamp': undefined,
|
|
2274
|
-
'lastUpdateTimestamp':
|
|
2273
|
+
'lastUpdateTimestamp': this.safeInteger(order, 'statusTimestamp'),
|
|
2275
2274
|
'symbol': symbol,
|
|
2276
2275
|
'type': this.parseOrderType(this.safeStringLower(entry, 'orderType')),
|
|
2277
2276
|
'timeInForce': this.safeStringUpper(entry, 'tif'),
|
package/dist/cjs/src/mexc.js
CHANGED
|
@@ -275,7 +275,9 @@ class onetrading extends onetrading$1 {
|
|
|
275
275
|
'CF_RATELIMIT': errors.DDoSProtection,
|
|
276
276
|
'INTERNAL_SERVER_ERROR': errors.ExchangeError,
|
|
277
277
|
},
|
|
278
|
-
'broad': {
|
|
278
|
+
'broad': {
|
|
279
|
+
'Order not found.': errors.OrderNotFound,
|
|
280
|
+
},
|
|
279
281
|
},
|
|
280
282
|
'commonCurrencies': {
|
|
281
283
|
'MIOTA': 'IOTA', // https://github.com/ccxt/ccxt/issues/7487
|
|
@@ -1002,6 +1004,7 @@ class onetrading extends onetrading$1 {
|
|
|
1002
1004
|
'CLOSED': 'canceled',
|
|
1003
1005
|
'FAILED': 'failed',
|
|
1004
1006
|
'STOP_TRIGGERED': 'triggered',
|
|
1007
|
+
'DONE': 'closed',
|
|
1005
1008
|
};
|
|
1006
1009
|
return this.safeString(statuses, status, status);
|
|
1007
1010
|
}
|
|
@@ -1096,7 +1099,7 @@ class onetrading extends onetrading$1 {
|
|
|
1096
1099
|
'datetime': this.iso8601(timestamp),
|
|
1097
1100
|
'lastTradeTimestamp': undefined,
|
|
1098
1101
|
'symbol': symbol,
|
|
1099
|
-
'type': type,
|
|
1102
|
+
'type': this.parseOrderType(type),
|
|
1100
1103
|
'timeInForce': timeInForce,
|
|
1101
1104
|
'postOnly': postOnly,
|
|
1102
1105
|
'side': side,
|
|
@@ -1112,6 +1115,12 @@ class onetrading extends onetrading$1 {
|
|
|
1112
1115
|
'trades': rawTrades,
|
|
1113
1116
|
}, market);
|
|
1114
1117
|
}
|
|
1118
|
+
parseOrderType(type) {
|
|
1119
|
+
const types = {
|
|
1120
|
+
'booked': 'limit',
|
|
1121
|
+
};
|
|
1122
|
+
return this.safeString(types, type, type);
|
|
1123
|
+
}
|
|
1115
1124
|
parseTimeInForce(timeInForce) {
|
|
1116
1125
|
const timeInForces = {
|
|
1117
1126
|
'GOOD_TILL_CANCELLED': 'GTC',
|
|
@@ -1175,6 +1184,9 @@ class onetrading extends onetrading$1 {
|
|
|
1175
1184
|
request['client_id'] = clientOrderId;
|
|
1176
1185
|
params = this.omit(params, ['clientOrderId', 'client_id']);
|
|
1177
1186
|
}
|
|
1187
|
+
const timeInForce = this.safeString2(params, 'timeInForce', 'time_in_force', 'GOOD_TILL_CANCELLED');
|
|
1188
|
+
params = this.omit(params, 'timeInForce');
|
|
1189
|
+
request['time_in_force'] = timeInForce;
|
|
1178
1190
|
const response = await this.privatePostAccountOrders(this.extend(request, params));
|
|
1179
1191
|
//
|
|
1180
1192
|
// {
|
|
@@ -1216,11 +1228,17 @@ class onetrading extends onetrading$1 {
|
|
|
1216
1228
|
else {
|
|
1217
1229
|
request['order_id'] = id;
|
|
1218
1230
|
}
|
|
1219
|
-
|
|
1231
|
+
let response = undefined;
|
|
1232
|
+
if (method === 'privateDeleteAccountOrdersOrderId') {
|
|
1233
|
+
response = await this.privateDeleteAccountOrdersOrderId(this.extend(request, params));
|
|
1234
|
+
}
|
|
1235
|
+
else {
|
|
1236
|
+
response = await this.privateDeleteAccountOrdersClientClientId(this.extend(request, params));
|
|
1237
|
+
}
|
|
1220
1238
|
//
|
|
1221
1239
|
// responds with an empty body
|
|
1222
1240
|
//
|
|
1223
|
-
return response;
|
|
1241
|
+
return this.parseOrder(response);
|
|
1224
1242
|
}
|
|
1225
1243
|
/**
|
|
1226
1244
|
* @method
|
|
@@ -1286,7 +1286,7 @@ class coinex extends coinex$1 {
|
|
|
1286
1286
|
const defaultType = this.safeString(this.options, 'defaultType');
|
|
1287
1287
|
const marketId = this.safeString(ticker, 'market');
|
|
1288
1288
|
market = this.safeMarket(marketId, market, undefined, defaultType);
|
|
1289
|
-
const timestamp = this.
|
|
1289
|
+
const timestamp = this.safeInteger(ticker, 'updated_at');
|
|
1290
1290
|
return this.safeTicker({
|
|
1291
1291
|
'symbol': this.safeSymbol(marketId, market, undefined, defaultType),
|
|
1292
1292
|
'timestamp': timestamp,
|
package/js/ccxt.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
|
|
|
4
4
|
import * as errors from './src/base/errors.js';
|
|
5
5
|
import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, DepositAddressResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarketMarginModes, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, LongShortRatio, OpenInterests } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.4.
|
|
7
|
+
declare const version = "4.4.45";
|
|
8
8
|
import ace from './src/ace.js';
|
|
9
9
|
import alpaca from './src/alpaca.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
package/js/ccxt.js
CHANGED
|
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
|
|
|
38
38
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.4.
|
|
41
|
+
const version = '4.4.46';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import ace from './src/ace.js';
|
package/js/src/ascendex.d.ts
CHANGED
|
@@ -96,6 +96,7 @@ export default class ascendex extends Exchange {
|
|
|
96
96
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
97
97
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
98
98
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
99
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
99
100
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
100
101
|
*/
|
|
101
102
|
fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|