ccxt 4.4.44 → 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 +15 -15
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ascendex.js +20 -1
- package/dist/cjs/src/binance.js +161 -39
- package/dist/cjs/src/bingx.js +15 -9
- package/dist/cjs/src/bitfinex.js +1 -1
- package/dist/cjs/src/bitget.js +105 -42
- package/dist/cjs/src/bitmart.js +3 -3
- package/dist/cjs/src/bitmex.js +1 -1
- package/dist/cjs/src/blofin.js +22 -0
- package/dist/cjs/src/bybit.js +85 -41
- package/dist/cjs/src/coinbase.js +1 -1
- package/dist/cjs/src/coinex.js +1 -1
- package/dist/cjs/src/cryptocom.js +1 -1
- package/dist/cjs/src/delta.js +10 -4
- package/dist/cjs/src/exmo.js +18 -8
- package/dist/cjs/src/gate.js +1 -2
- package/dist/cjs/src/hashkey.js +7 -1
- package/dist/cjs/src/htx.js +2 -2
- package/dist/cjs/src/hyperliquid.js +3 -4
- package/dist/cjs/src/kraken.js +1 -1
- package/dist/cjs/src/krakenfutures.js +1 -1
- package/dist/cjs/src/kucoin.js +1 -1
- package/dist/cjs/src/kucoinfutures.js +2 -3
- package/dist/cjs/src/lykke.js +1 -1
- package/dist/cjs/src/mexc.js +3 -2
- package/dist/cjs/src/myokx.js +8 -0
- package/dist/cjs/src/okx.js +4 -4
- package/dist/cjs/src/onetrading.js +24 -5
- package/dist/cjs/src/pro/binance.js +2 -1
- package/dist/cjs/src/pro/coinex.js +1 -1
- package/dist/cjs/src/pro/myokx.js +5 -0
- package/dist/cjs/src/whitebit.js +34 -8
- package/dist/cjs/src/woo.js +1 -1
- package/dist/cjs/src/woofipro.js +2 -2
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/blofin.d.ts +22 -0
- package/js/src/ascendex.d.ts +1 -0
- package/js/src/ascendex.js +20 -1
- package/js/src/binance.d.ts +4 -0
- package/js/src/binance.js +161 -39
- package/js/src/bingx.js +15 -9
- package/js/src/bitfinex.js +1 -1
- package/js/src/bitget.js +105 -42
- package/js/src/bitmart.js +3 -3
- package/js/src/bitmex.js +1 -1
- package/js/src/blofin.js +22 -0
- package/js/src/bybit.js +85 -41
- package/js/src/coinbase.js +1 -1
- package/js/src/coinex.js +1 -1
- package/js/src/cryptocom.js +1 -1
- package/js/src/delta.d.ts +2 -1
- package/js/src/delta.js +10 -4
- package/js/src/exmo.d.ts +1 -0
- package/js/src/exmo.js +18 -8
- package/js/src/gate.js +1 -2
- package/js/src/hashkey.js +7 -1
- package/js/src/htx.js +2 -2
- package/js/src/hyperliquid.js +3 -4
- package/js/src/kraken.js +1 -1
- package/js/src/krakenfutures.js +1 -1
- package/js/src/kucoin.js +1 -1
- package/js/src/kucoinfutures.js +2 -3
- package/js/src/lykke.js +1 -1
- package/js/src/mexc.js +3 -2
- package/js/src/myokx.js +8 -0
- package/js/src/okx.js +4 -4
- package/js/src/onetrading.d.ts +2 -1
- package/js/src/onetrading.js +24 -5
- package/js/src/pro/binance.js +2 -1
- package/js/src/pro/coinex.js +1 -1
- package/js/src/pro/myokx.js +5 -0
- package/js/src/whitebit.d.ts +2 -1
- package/js/src/whitebit.js +34 -8
- package/js/src/woo.js +1 -1
- package/js/src/woofipro.js +2 -2
- package/package.json +1 -1
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': {
|
|
@@ -1460,7 +1546,7 @@ class bitget extends bitget$1 {
|
|
|
1460
1546
|
'mark': false,
|
|
1461
1547
|
'index': false,
|
|
1462
1548
|
},
|
|
1463
|
-
'
|
|
1549
|
+
'price': true,
|
|
1464
1550
|
},
|
|
1465
1551
|
'timeInForce': {
|
|
1466
1552
|
'IOC': true,
|
|
@@ -1502,7 +1588,7 @@ class bitget extends bitget$1 {
|
|
|
1502
1588
|
'fetchClosedOrders': {
|
|
1503
1589
|
'marginMode': true,
|
|
1504
1590
|
'limit': 100,
|
|
1505
|
-
'
|
|
1591
|
+
'daysBack': undefined,
|
|
1506
1592
|
'daysBackCanceled': undefined,
|
|
1507
1593
|
'untilDays': 90,
|
|
1508
1594
|
'trigger': true,
|
|
@@ -1530,7 +1616,7 @@ class bitget extends bitget$1 {
|
|
|
1530
1616
|
'mark': true,
|
|
1531
1617
|
'index': true,
|
|
1532
1618
|
},
|
|
1533
|
-
'
|
|
1619
|
+
'price': false,
|
|
1534
1620
|
},
|
|
1535
1621
|
'timeInForce': {
|
|
1536
1622
|
'IOC': true,
|
|
@@ -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/bitmart.js
CHANGED
|
@@ -737,7 +737,7 @@ class bitmart extends bitmart$1 {
|
|
|
737
737
|
'fetchClosedOrders': {
|
|
738
738
|
'marginMode': true,
|
|
739
739
|
'limit': 200,
|
|
740
|
-
'
|
|
740
|
+
'daysBack': undefined,
|
|
741
741
|
'daysBackCanceled': undefined,
|
|
742
742
|
'untilDays': undefined,
|
|
743
743
|
'trigger': false,
|
|
@@ -766,7 +766,7 @@ class bitmart extends bitmart$1 {
|
|
|
766
766
|
'mark': true,
|
|
767
767
|
'index': false,
|
|
768
768
|
},
|
|
769
|
-
'
|
|
769
|
+
'price': false,
|
|
770
770
|
},
|
|
771
771
|
'timeInForce': {
|
|
772
772
|
'IOC': true,
|
|
@@ -804,7 +804,7 @@ class bitmart extends bitmart$1 {
|
|
|
804
804
|
'fetchClosedOrders': {
|
|
805
805
|
'marginMode': true,
|
|
806
806
|
'limit': 200,
|
|
807
|
-
'
|
|
807
|
+
'daysBack': undefined,
|
|
808
808
|
'daysBackCanceled': undefined,
|
|
809
809
|
'untilDays': undefined,
|
|
810
810
|
'trigger': false,
|
package/dist/cjs/src/bitmex.js
CHANGED
package/dist/cjs/src/blofin.js
CHANGED
|
@@ -195,6 +195,18 @@ class blofin extends blofin$1 {
|
|
|
195
195
|
'trade/orders-tpsl-history': 1,
|
|
196
196
|
'user/query-apikey': 1,
|
|
197
197
|
'affiliate/basic': 1,
|
|
198
|
+
'copytrading/instruments': 1,
|
|
199
|
+
'copytrading/account/balance': 1,
|
|
200
|
+
'copytrading/account/positions-by-order': 1,
|
|
201
|
+
'copytrading/account/positions-details-by-order': 1,
|
|
202
|
+
'copytrading/account/positions-by-contract': 1,
|
|
203
|
+
'copytrading/account/position-mode': 1,
|
|
204
|
+
'copytrading/account/leverage-info': 1,
|
|
205
|
+
'copytrading/trade/orders-pending': 1,
|
|
206
|
+
'copytrading/trade/pending-tpsl-by-contract': 1,
|
|
207
|
+
'copytrading/trade/position-history-by-order': 1,
|
|
208
|
+
'copytrading/trade/orders-history': 1,
|
|
209
|
+
'copytrading/trade/pending-tpsl-by-order': 1,
|
|
198
210
|
},
|
|
199
211
|
'post': {
|
|
200
212
|
'trade/order': 1,
|
|
@@ -206,6 +218,16 @@ class blofin extends blofin$1 {
|
|
|
206
218
|
'trade/cancel-tpsl': 1,
|
|
207
219
|
'trade/close-position': 1,
|
|
208
220
|
'asset/transfer': 1,
|
|
221
|
+
'copytrading/account/set-position-mode': 1,
|
|
222
|
+
'copytrading/account/set-leverage': 1,
|
|
223
|
+
'copytrading/trade/place-order': 1,
|
|
224
|
+
'copytrading/trade/cancel-order': 1,
|
|
225
|
+
'copytrading/trade/place-tpsl-by-contract': 1,
|
|
226
|
+
'copytrading/trade/cancel-tpsl-by-contract': 1,
|
|
227
|
+
'copytrading/trade/place-tpsl-by-order': 1,
|
|
228
|
+
'copytrading/trade/cancel-tpsl-by-order': 1,
|
|
229
|
+
'copytrading/trade/close-position-by-order': 1,
|
|
230
|
+
'copytrading/trade/close-position-by-contract': 1,
|
|
209
231
|
},
|
|
210
232
|
},
|
|
211
233
|
},
|
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',
|
|
@@ -1098,7 +1168,7 @@ class bybit extends bybit$1 {
|
|
|
1098
1168
|
'mark': true,
|
|
1099
1169
|
'index': true,
|
|
1100
1170
|
},
|
|
1101
|
-
'
|
|
1171
|
+
'price': true,
|
|
1102
1172
|
},
|
|
1103
1173
|
'timeInForce': {
|
|
1104
1174
|
'IOC': true,
|
|
@@ -1138,7 +1208,7 @@ class bybit extends bybit$1 {
|
|
|
1138
1208
|
'fetchClosedOrders': {
|
|
1139
1209
|
'marginMode': false,
|
|
1140
1210
|
'limit': 50,
|
|
1141
|
-
'
|
|
1211
|
+
'daysBack': 365 * 2,
|
|
1142
1212
|
'daysBackCanceled': 1,
|
|
1143
1213
|
'untilDays': 7,
|
|
1144
1214
|
'trigger': true,
|
|
@@ -1155,7 +1225,7 @@ class bybit extends bybit$1 {
|
|
|
1155
1225
|
'triggerDirection': false,
|
|
1156
1226
|
'attachedStopLossTakeProfit': {
|
|
1157
1227
|
'triggerPriceType': undefined,
|
|
1158
|
-
'
|
|
1228
|
+
'price': true,
|
|
1159
1229
|
},
|
|
1160
1230
|
'marketBuyRequiresPrice': true,
|
|
1161
1231
|
},
|
|
@@ -1242,7 +1312,7 @@ class bybit extends bybit$1 {
|
|
|
1242
1312
|
* @returns {any} [enableUnifiedMargin, enableUnifiedAccount]
|
|
1243
1313
|
*/
|
|
1244
1314
|
async isUnifiedEnabled(params = {}) {
|
|
1245
|
-
// The API key of user id must own one of permissions will be allowed to call following API endpoints
|
|
1315
|
+
// The API key of user id must own one of permissions will be allowed to call following API endpoints:
|
|
1246
1316
|
// SUB UID: "Account Transfer"
|
|
1247
1317
|
// MASTER UID: "Account Transfer", "Subaccount Transfer", "Withdrawal"
|
|
1248
1318
|
const enableUnifiedMargin = this.safeBool(this.options, 'enableUnifiedMargin');
|
|
@@ -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/coinbase.js
CHANGED
|
@@ -428,7 +428,7 @@ class coinbase extends coinbase$1 {
|
|
|
428
428
|
'fetchClosedOrders': {
|
|
429
429
|
'marginMode': false,
|
|
430
430
|
'limit': undefined,
|
|
431
|
-
'
|
|
431
|
+
'daysBack': undefined,
|
|
432
432
|
'daysBackCanceled': undefined,
|
|
433
433
|
'untilDays': 10000,
|
|
434
434
|
'trigger': false,
|
package/dist/cjs/src/coinex.js
CHANGED
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/exmo.js
CHANGED
|
@@ -865,39 +865,49 @@ class exmo extends exmo$1 {
|
|
|
865
865
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
866
866
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
867
867
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
868
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
868
869
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
869
870
|
*/
|
|
870
871
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
871
872
|
await this.loadMarkets();
|
|
872
873
|
const market = this.market(symbol);
|
|
874
|
+
const until = this.safeIntegerProduct(params, 'until', 0.001);
|
|
875
|
+
const untilIsDefined = (until !== undefined);
|
|
873
876
|
const request = {
|
|
874
877
|
'symbol': market['id'],
|
|
875
878
|
'resolution': this.safeString(this.timeframes, timeframe, timeframe),
|
|
876
879
|
};
|
|
877
880
|
const maxLimit = 3000;
|
|
878
881
|
const duration = this.parseTimeframe(timeframe);
|
|
879
|
-
const now = this.milliseconds();
|
|
882
|
+
const now = this.parseToInt(this.milliseconds() / 1000);
|
|
880
883
|
if (since === undefined) {
|
|
884
|
+
const to = untilIsDefined ? Math.min(until, now) : now;
|
|
881
885
|
if (limit === undefined) {
|
|
882
886
|
limit = 1000; // cap default at generous amount
|
|
883
887
|
}
|
|
884
888
|
else {
|
|
885
889
|
limit = Math.min(limit, maxLimit);
|
|
886
890
|
}
|
|
887
|
-
request['from'] =
|
|
888
|
-
request['to'] =
|
|
891
|
+
request['from'] = to - (limit * duration) - 1;
|
|
892
|
+
request['to'] = to;
|
|
889
893
|
}
|
|
890
894
|
else {
|
|
891
895
|
request['from'] = this.parseToInt(since / 1000) - 1;
|
|
892
|
-
if (
|
|
893
|
-
|
|
896
|
+
if (untilIsDefined) {
|
|
897
|
+
request['to'] = Math.min(until, now);
|
|
894
898
|
}
|
|
895
899
|
else {
|
|
896
|
-
|
|
900
|
+
if (limit === undefined) {
|
|
901
|
+
limit = maxLimit;
|
|
902
|
+
}
|
|
903
|
+
else {
|
|
904
|
+
limit = Math.min(limit, maxLimit);
|
|
905
|
+
}
|
|
906
|
+
const to = this.sum(since, limit * duration);
|
|
907
|
+
request['to'] = Math.min(to, now);
|
|
897
908
|
}
|
|
898
|
-
const to = this.sum(since, limit * duration * 1000);
|
|
899
|
-
request['to'] = this.parseToInt(to / 1000);
|
|
900
909
|
}
|
|
910
|
+
params = this.omit(params, 'until');
|
|
901
911
|
const response = await this.publicGetCandlesHistory(this.extend(request, params));
|
|
902
912
|
//
|
|
903
913
|
// {
|
package/dist/cjs/src/gate.js
CHANGED
|
@@ -716,7 +716,6 @@ class gate extends gate$1 {
|
|
|
716
716
|
'takeProfitPrice': true,
|
|
717
717
|
'attachedStopLossTakeProfit': undefined,
|
|
718
718
|
'timeInForce': {
|
|
719
|
-
'GTC': true,
|
|
720
719
|
'IOC': true,
|
|
721
720
|
'FOK': true,
|
|
722
721
|
'PO': true,
|
|
@@ -757,7 +756,7 @@ class gate extends gate$1 {
|
|
|
757
756
|
'trailing': false,
|
|
758
757
|
'limit': 100,
|
|
759
758
|
'untilDays': 30,
|
|
760
|
-
'
|
|
759
|
+
'daysBack': undefined,
|
|
761
760
|
'daysBackCanceled': undefined,
|
|
762
761
|
},
|
|
763
762
|
'fetchOHLCV': {
|
package/dist/cjs/src/hashkey.js
CHANGED
|
@@ -1455,10 +1455,16 @@ class hashkey extends hashkey$1 {
|
|
|
1455
1455
|
side = isBuyer ? 'buy' : 'sell';
|
|
1456
1456
|
}
|
|
1457
1457
|
let takerOrMaker = undefined;
|
|
1458
|
-
const isMaker = this.safeBoolN(trade, ['isMaker', 'isMarker'
|
|
1458
|
+
const isMaker = this.safeBoolN(trade, ['isMaker', 'isMarker']);
|
|
1459
1459
|
if (isMaker !== undefined) {
|
|
1460
1460
|
takerOrMaker = isMaker ? 'maker' : 'taker';
|
|
1461
1461
|
}
|
|
1462
|
+
const isBuyerMaker = this.safeBool(trade, 'ibm');
|
|
1463
|
+
// if public trade
|
|
1464
|
+
if (isBuyerMaker !== undefined) {
|
|
1465
|
+
takerOrMaker = 'taker';
|
|
1466
|
+
side = isBuyerMaker ? 'sell' : 'buy';
|
|
1467
|
+
}
|
|
1462
1468
|
let feeCost = this.safeString(trade, 'commission');
|
|
1463
1469
|
let feeCurrncyId = this.safeString(trade, 'commissionAsset');
|
|
1464
1470
|
const feeInfo = this.safeDict(trade, 'fee');
|