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/js/src/blofin.js
CHANGED
|
@@ -198,6 +198,18 @@ export default class blofin extends Exchange {
|
|
|
198
198
|
'trade/orders-tpsl-history': 1,
|
|
199
199
|
'user/query-apikey': 1,
|
|
200
200
|
'affiliate/basic': 1,
|
|
201
|
+
'copytrading/instruments': 1,
|
|
202
|
+
'copytrading/account/balance': 1,
|
|
203
|
+
'copytrading/account/positions-by-order': 1,
|
|
204
|
+
'copytrading/account/positions-details-by-order': 1,
|
|
205
|
+
'copytrading/account/positions-by-contract': 1,
|
|
206
|
+
'copytrading/account/position-mode': 1,
|
|
207
|
+
'copytrading/account/leverage-info': 1,
|
|
208
|
+
'copytrading/trade/orders-pending': 1,
|
|
209
|
+
'copytrading/trade/pending-tpsl-by-contract': 1,
|
|
210
|
+
'copytrading/trade/position-history-by-order': 1,
|
|
211
|
+
'copytrading/trade/orders-history': 1,
|
|
212
|
+
'copytrading/trade/pending-tpsl-by-order': 1,
|
|
201
213
|
},
|
|
202
214
|
'post': {
|
|
203
215
|
'trade/order': 1,
|
|
@@ -209,6 +221,16 @@ export default class blofin extends Exchange {
|
|
|
209
221
|
'trade/cancel-tpsl': 1,
|
|
210
222
|
'trade/close-position': 1,
|
|
211
223
|
'asset/transfer': 1,
|
|
224
|
+
'copytrading/account/set-position-mode': 1,
|
|
225
|
+
'copytrading/account/set-leverage': 1,
|
|
226
|
+
'copytrading/trade/place-order': 1,
|
|
227
|
+
'copytrading/trade/cancel-order': 1,
|
|
228
|
+
'copytrading/trade/place-tpsl-by-contract': 1,
|
|
229
|
+
'copytrading/trade/cancel-tpsl-by-contract': 1,
|
|
230
|
+
'copytrading/trade/place-tpsl-by-order': 1,
|
|
231
|
+
'copytrading/trade/cancel-tpsl-by-order': 1,
|
|
232
|
+
'copytrading/trade/close-position-by-order': 1,
|
|
233
|
+
'copytrading/trade/close-position-by-contract': 1,
|
|
212
234
|
},
|
|
213
235
|
},
|
|
214
236
|
},
|
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',
|
|
@@ -1101,7 +1171,7 @@ export default class bybit extends Exchange {
|
|
|
1101
1171
|
'mark': true,
|
|
1102
1172
|
'index': true,
|
|
1103
1173
|
},
|
|
1104
|
-
'
|
|
1174
|
+
'price': true,
|
|
1105
1175
|
},
|
|
1106
1176
|
'timeInForce': {
|
|
1107
1177
|
'IOC': true,
|
|
@@ -1141,7 +1211,7 @@ export default class bybit extends Exchange {
|
|
|
1141
1211
|
'fetchClosedOrders': {
|
|
1142
1212
|
'marginMode': false,
|
|
1143
1213
|
'limit': 50,
|
|
1144
|
-
'
|
|
1214
|
+
'daysBack': 365 * 2,
|
|
1145
1215
|
'daysBackCanceled': 1,
|
|
1146
1216
|
'untilDays': 7,
|
|
1147
1217
|
'trigger': true,
|
|
@@ -1158,7 +1228,7 @@ export default class bybit extends Exchange {
|
|
|
1158
1228
|
'triggerDirection': false,
|
|
1159
1229
|
'attachedStopLossTakeProfit': {
|
|
1160
1230
|
'triggerPriceType': undefined,
|
|
1161
|
-
'
|
|
1231
|
+
'price': true,
|
|
1162
1232
|
},
|
|
1163
1233
|
'marketBuyRequiresPrice': true,
|
|
1164
1234
|
},
|
|
@@ -1245,7 +1315,7 @@ export default class bybit extends Exchange {
|
|
|
1245
1315
|
* @returns {any} [enableUnifiedMargin, enableUnifiedAccount]
|
|
1246
1316
|
*/
|
|
1247
1317
|
async isUnifiedEnabled(params = {}) {
|
|
1248
|
-
// The API key of user id must own one of permissions will be allowed to call following API endpoints
|
|
1318
|
+
// The API key of user id must own one of permissions will be allowed to call following API endpoints:
|
|
1249
1319
|
// SUB UID: "Account Transfer"
|
|
1250
1320
|
// MASTER UID: "Account Transfer", "Subaccount Transfer", "Withdrawal"
|
|
1251
1321
|
const enableUnifiedMargin = this.safeBool(this.options, 'enableUnifiedMargin');
|
|
@@ -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/coinbase.js
CHANGED
|
@@ -431,7 +431,7 @@ export default class coinbase extends Exchange {
|
|
|
431
431
|
'fetchClosedOrders': {
|
|
432
432
|
'marginMode': false,
|
|
433
433
|
'limit': undefined,
|
|
434
|
-
'
|
|
434
|
+
'daysBack': undefined,
|
|
435
435
|
'daysBackCanceled': undefined,
|
|
436
436
|
'untilDays': 10000,
|
|
437
437
|
'trigger': false,
|
package/js/src/coinex.js
CHANGED
|
@@ -552,7 +552,7 @@ export default class coinex extends Exchange {
|
|
|
552
552
|
'fetchClosedOrders': {
|
|
553
553
|
'marginMode': true,
|
|
554
554
|
'limit': 1000,
|
|
555
|
-
'
|
|
555
|
+
'daysBack': undefined,
|
|
556
556
|
'daysBackCanceled': undefined,
|
|
557
557
|
'untilDays': undefined,
|
|
558
558
|
'trigger': true,
|
package/js/src/cryptocom.js
CHANGED
|
@@ -412,7 +412,7 @@ export default class cryptocom extends Exchange {
|
|
|
412
412
|
'fetchClosedOrders': {
|
|
413
413
|
'marginMode': false,
|
|
414
414
|
'limit': 100,
|
|
415
|
-
'
|
|
415
|
+
'daysBack': undefined,
|
|
416
416
|
'daysBackCanceled': undefined,
|
|
417
417
|
'untilDays': 1,
|
|
418
418
|
'trigger': false,
|
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/exmo.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ export default class exmo extends Exchange {
|
|
|
94
94
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
95
95
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
96
96
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
97
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
97
98
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
98
99
|
*/
|
|
99
100
|
fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
package/js/src/exmo.js
CHANGED
|
@@ -868,39 +868,49 @@ export default class exmo extends Exchange {
|
|
|
868
868
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
869
869
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
870
870
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
871
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
871
872
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
872
873
|
*/
|
|
873
874
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
874
875
|
await this.loadMarkets();
|
|
875
876
|
const market = this.market(symbol);
|
|
877
|
+
const until = this.safeIntegerProduct(params, 'until', 0.001);
|
|
878
|
+
const untilIsDefined = (until !== undefined);
|
|
876
879
|
const request = {
|
|
877
880
|
'symbol': market['id'],
|
|
878
881
|
'resolution': this.safeString(this.timeframes, timeframe, timeframe),
|
|
879
882
|
};
|
|
880
883
|
const maxLimit = 3000;
|
|
881
884
|
const duration = this.parseTimeframe(timeframe);
|
|
882
|
-
const now = this.milliseconds();
|
|
885
|
+
const now = this.parseToInt(this.milliseconds() / 1000);
|
|
883
886
|
if (since === undefined) {
|
|
887
|
+
const to = untilIsDefined ? Math.min(until, now) : now;
|
|
884
888
|
if (limit === undefined) {
|
|
885
889
|
limit = 1000; // cap default at generous amount
|
|
886
890
|
}
|
|
887
891
|
else {
|
|
888
892
|
limit = Math.min(limit, maxLimit);
|
|
889
893
|
}
|
|
890
|
-
request['from'] =
|
|
891
|
-
request['to'] =
|
|
894
|
+
request['from'] = to - (limit * duration) - 1;
|
|
895
|
+
request['to'] = to;
|
|
892
896
|
}
|
|
893
897
|
else {
|
|
894
898
|
request['from'] = this.parseToInt(since / 1000) - 1;
|
|
895
|
-
if (
|
|
896
|
-
|
|
899
|
+
if (untilIsDefined) {
|
|
900
|
+
request['to'] = Math.min(until, now);
|
|
897
901
|
}
|
|
898
902
|
else {
|
|
899
|
-
|
|
903
|
+
if (limit === undefined) {
|
|
904
|
+
limit = maxLimit;
|
|
905
|
+
}
|
|
906
|
+
else {
|
|
907
|
+
limit = Math.min(limit, maxLimit);
|
|
908
|
+
}
|
|
909
|
+
const to = this.sum(since, limit * duration);
|
|
910
|
+
request['to'] = Math.min(to, now);
|
|
900
911
|
}
|
|
901
|
-
const to = this.sum(since, limit * duration * 1000);
|
|
902
|
-
request['to'] = this.parseToInt(to / 1000);
|
|
903
912
|
}
|
|
913
|
+
params = this.omit(params, 'until');
|
|
904
914
|
const response = await this.publicGetCandlesHistory(this.extend(request, params));
|
|
905
915
|
//
|
|
906
916
|
// {
|
package/js/src/gate.js
CHANGED
|
@@ -719,7 +719,6 @@ export default class gate extends Exchange {
|
|
|
719
719
|
'takeProfitPrice': true,
|
|
720
720
|
'attachedStopLossTakeProfit': undefined,
|
|
721
721
|
'timeInForce': {
|
|
722
|
-
'GTC': true,
|
|
723
722
|
'IOC': true,
|
|
724
723
|
'FOK': true,
|
|
725
724
|
'PO': true,
|
|
@@ -760,7 +759,7 @@ export default class gate extends Exchange {
|
|
|
760
759
|
'trailing': false,
|
|
761
760
|
'limit': 100,
|
|
762
761
|
'untilDays': 30,
|
|
763
|
-
'
|
|
762
|
+
'daysBack': undefined,
|
|
764
763
|
'daysBackCanceled': undefined,
|
|
765
764
|
},
|
|
766
765
|
'fetchOHLCV': {
|
package/js/src/hashkey.js
CHANGED
|
@@ -1458,10 +1458,16 @@ export default class hashkey extends Exchange {
|
|
|
1458
1458
|
side = isBuyer ? 'buy' : 'sell';
|
|
1459
1459
|
}
|
|
1460
1460
|
let takerOrMaker = undefined;
|
|
1461
|
-
const isMaker = this.safeBoolN(trade, ['isMaker', 'isMarker'
|
|
1461
|
+
const isMaker = this.safeBoolN(trade, ['isMaker', 'isMarker']);
|
|
1462
1462
|
if (isMaker !== undefined) {
|
|
1463
1463
|
takerOrMaker = isMaker ? 'maker' : 'taker';
|
|
1464
1464
|
}
|
|
1465
|
+
const isBuyerMaker = this.safeBool(trade, 'ibm');
|
|
1466
|
+
// if public trade
|
|
1467
|
+
if (isBuyerMaker !== undefined) {
|
|
1468
|
+
takerOrMaker = 'taker';
|
|
1469
|
+
side = isBuyerMaker ? 'sell' : 'buy';
|
|
1470
|
+
}
|
|
1465
1471
|
let feeCost = this.safeString(trade, 'commission');
|
|
1466
1472
|
let feeCurrncyId = this.safeString(trade, 'commissionAsset');
|
|
1467
1473
|
const feeInfo = this.safeDict(trade, 'fee');
|
package/js/src/htx.js
CHANGED
|
@@ -1295,7 +1295,7 @@ export default class htx extends Exchange {
|
|
|
1295
1295
|
'trailing': false,
|
|
1296
1296
|
'untilDays': 2,
|
|
1297
1297
|
'limit': 500,
|
|
1298
|
-
'
|
|
1298
|
+
'daysBack': 180,
|
|
1299
1299
|
'daysBackCanceled': 1 / 12,
|
|
1300
1300
|
},
|
|
1301
1301
|
'fetchOHLCV': {
|
|
@@ -1336,7 +1336,7 @@ export default class htx extends Exchange {
|
|
|
1336
1336
|
'trailing': false,
|
|
1337
1337
|
'untilDays': 2,
|
|
1338
1338
|
'limit': 50,
|
|
1339
|
-
'
|
|
1339
|
+
'daysBack': 90,
|
|
1340
1340
|
'daysBackCanceled': 1 / 12,
|
|
1341
1341
|
},
|
|
1342
1342
|
'fetchOHLCV': {
|
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,
|
|
@@ -275,7 +274,7 @@ export default class hyperliquid extends Exchange {
|
|
|
275
274
|
'fetchClosedOrders': {
|
|
276
275
|
'marginMode': false,
|
|
277
276
|
'limit': 2000,
|
|
278
|
-
'
|
|
277
|
+
'daysBack': undefined,
|
|
279
278
|
'daysBackCanceled': undefined,
|
|
280
279
|
'untilDays': undefined,
|
|
281
280
|
'trigger': false,
|
|
@@ -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/kraken.js
CHANGED
|
@@ -477,7 +477,7 @@ export default class kraken extends Exchange {
|
|
|
477
477
|
'fetchClosedOrders': {
|
|
478
478
|
'marginMode': false,
|
|
479
479
|
'limit': undefined,
|
|
480
|
-
'
|
|
480
|
+
'daysBack': undefined,
|
|
481
481
|
'daysBackCanceled': undefined,
|
|
482
482
|
'untilDays': 100000,
|
|
483
483
|
'trigger': false,
|
package/js/src/krakenfutures.js
CHANGED
|
@@ -313,7 +313,7 @@ export default class krakenfutures extends Exchange {
|
|
|
313
313
|
'fetchClosedOrders': {
|
|
314
314
|
'marginMode': false,
|
|
315
315
|
'limit': undefined,
|
|
316
|
-
'
|
|
316
|
+
'daysBack': undefined,
|
|
317
317
|
'daysBackCanceled': undefined,
|
|
318
318
|
'untilDays': undefined,
|
|
319
319
|
'trigger': false,
|
package/js/src/kucoin.js
CHANGED
|
@@ -1039,7 +1039,7 @@ export default class kucoin extends Exchange {
|
|
|
1039
1039
|
'fetchClosedOrders': {
|
|
1040
1040
|
'marginMode': true,
|
|
1041
1041
|
'limit': 500,
|
|
1042
|
-
'
|
|
1042
|
+
'daysBack': undefined,
|
|
1043
1043
|
'daysBackCanceled': undefined,
|
|
1044
1044
|
'untilDays': 7,
|
|
1045
1045
|
'trigger': true,
|
package/js/src/kucoinfutures.js
CHANGED
|
@@ -376,9 +376,8 @@ export default class kucoinfutures extends kucoin {
|
|
|
376
376
|
'stopLossPrice': true,
|
|
377
377
|
'takeProfitPrice': true,
|
|
378
378
|
'attachedStopLossTakeProfit': {
|
|
379
|
-
'triggerPrice': undefined,
|
|
380
379
|
'triggerPriceType': undefined,
|
|
381
|
-
'
|
|
380
|
+
'price': true,
|
|
382
381
|
},
|
|
383
382
|
'timeInForce': {
|
|
384
383
|
'IOC': true,
|
|
@@ -418,7 +417,7 @@ export default class kucoinfutures extends kucoin {
|
|
|
418
417
|
'fetchClosedOrders': {
|
|
419
418
|
'marginMode': false,
|
|
420
419
|
'limit': 1000,
|
|
421
|
-
'
|
|
420
|
+
'daysBack': undefined,
|
|
422
421
|
'daysBackCanceled': undefined,
|
|
423
422
|
'untilDays': undefined,
|
|
424
423
|
'trigger': true,
|
package/js/src/lykke.js
CHANGED
|
@@ -204,7 +204,7 @@ export default class lykke extends Exchange {
|
|
|
204
204
|
// {
|
|
205
205
|
// "payload":[
|
|
206
206
|
// {
|
|
207
|
-
// "assetId":"115a60c2-0da1-40f9-a7f2-
|
|
207
|
+
// "assetId":"115a60c2-0da1-40f9-a7f2-41da723b9075",
|
|
208
208
|
// "name":"Monaco Token",
|
|
209
209
|
// "symbol":"MCO",
|
|
210
210
|
// "accuracy":6,
|
package/js/src/mexc.js
CHANGED
|
@@ -446,6 +446,7 @@ export default class mexc extends Exchange {
|
|
|
446
446
|
'1h': '60m',
|
|
447
447
|
'4h': '4h',
|
|
448
448
|
'1d': '1d',
|
|
449
|
+
'1w': '1W',
|
|
449
450
|
'1M': '1M',
|
|
450
451
|
},
|
|
451
452
|
'swap': {
|
|
@@ -737,7 +738,7 @@ export default class mexc extends Exchange {
|
|
|
737
738
|
'fetchClosedOrders': {
|
|
738
739
|
'marginMode': true,
|
|
739
740
|
'limit': 1000,
|
|
740
|
-
'
|
|
741
|
+
'daysBack': 7,
|
|
741
742
|
'daysBackCanceled': 7,
|
|
742
743
|
'untilDays': 7,
|
|
743
744
|
'trigger': false,
|
|
@@ -793,7 +794,7 @@ export default class mexc extends Exchange {
|
|
|
793
794
|
'fetchClosedOrders': {
|
|
794
795
|
'marginMode': false,
|
|
795
796
|
'limit': 100,
|
|
796
|
-
'
|
|
797
|
+
'daysBack': 90,
|
|
797
798
|
'daysBackCanceled': undefined,
|
|
798
799
|
'untilDays': 90,
|
|
799
800
|
'trigger': true,
|
package/js/src/myokx.js
CHANGED
package/js/src/okx.js
CHANGED
|
@@ -1202,7 +1202,7 @@ export default class okx extends Exchange {
|
|
|
1202
1202
|
'mark': true,
|
|
1203
1203
|
'index': true,
|
|
1204
1204
|
},
|
|
1205
|
-
'
|
|
1205
|
+
'price': true,
|
|
1206
1206
|
},
|
|
1207
1207
|
'timeInForce': {
|
|
1208
1208
|
'IOC': true,
|
|
@@ -1242,7 +1242,7 @@ export default class okx extends Exchange {
|
|
|
1242
1242
|
'fetchClosedOrders': {
|
|
1243
1243
|
'marginMode': false,
|
|
1244
1244
|
'limit': 100,
|
|
1245
|
-
'
|
|
1245
|
+
'daysBack': 90,
|
|
1246
1246
|
'daysBackCanceled': 1 / 12,
|
|
1247
1247
|
'untilDays': undefined,
|
|
1248
1248
|
'trigger': true,
|
|
@@ -1629,7 +1629,7 @@ export default class okx extends Exchange {
|
|
|
1629
1629
|
'contractSize': contract ? this.safeNumber(market, 'ctVal') : undefined,
|
|
1630
1630
|
'expiry': expiry,
|
|
1631
1631
|
'expiryDatetime': this.iso8601(expiry),
|
|
1632
|
-
'strike': strikePrice,
|
|
1632
|
+
'strike': this.parseNumber(strikePrice),
|
|
1633
1633
|
'optionType': optionType,
|
|
1634
1634
|
'created': this.safeInteger(market, 'listTime'),
|
|
1635
1635
|
'precision': {
|
|
@@ -1836,7 +1836,7 @@ export default class okx extends Exchange {
|
|
|
1836
1836
|
}
|
|
1837
1837
|
const firstChain = this.safeDict(chains, 0, {});
|
|
1838
1838
|
result[code] = {
|
|
1839
|
-
'info':
|
|
1839
|
+
'info': chains,
|
|
1840
1840
|
'code': code,
|
|
1841
1841
|
'id': currencyId,
|
|
1842
1842
|
'name': this.safeString(firstChain, 'name'),
|
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
|