ccxt 4.2.86 → 4.2.87
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/build.sh +1 -1
- package/dist/ccxt.browser.js +671 -130
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ascendex.js +11 -1
- package/dist/cjs/src/binance.js +14 -1
- package/dist/cjs/src/bingx.js +37 -1
- package/dist/cjs/src/bitfinex.js +3 -0
- package/dist/cjs/src/bitfinex2.js +16 -1
- package/dist/cjs/src/bitflyer.js +19 -0
- package/dist/cjs/src/bitget.js +15 -1
- package/dist/cjs/src/bitopro.js +3 -0
- package/dist/cjs/src/bitrue.js +13 -7
- package/dist/cjs/src/bitvavo.js +3 -0
- package/dist/cjs/src/btcmarkets.js +1 -1
- package/dist/cjs/src/btcturk.js +2 -1
- package/dist/cjs/src/coinex.js +182 -54
- package/dist/cjs/src/currencycom.js +1 -1
- package/dist/cjs/src/delta.js +3 -1
- package/dist/cjs/src/digifinex.js +4 -2
- package/dist/cjs/src/exmo.js +11 -12
- package/dist/cjs/src/gate.js +5 -2
- package/dist/cjs/src/hitbtc.js +26 -2
- package/dist/cjs/src/htx.js +2 -2
- package/dist/cjs/src/huobijp.js +1 -1
- package/dist/cjs/src/hyperliquid.js +249 -12
- package/dist/cjs/src/idex.js +1 -1
- package/dist/cjs/src/krakenfutures.js +2 -6
- package/dist/cjs/src/lbank.js +3 -0
- package/dist/cjs/src/oceanex.js +1 -1
- package/dist/cjs/src/okx.js +24 -10
- package/dist/cjs/src/phemex.js +3 -1
- package/dist/cjs/src/pro/kucoin.js +11 -6
- package/dist/cjs/src/wazirx.js +1 -1
- package/dist/cjs/src/zonda.js +3 -0
- package/examples/js/benchmark.js +104 -0
- package/examples/ts/benchmark.ts +134 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/ascendex.d.ts +5 -12
- package/js/src/ascendex.js +11 -1
- package/js/src/base/Exchange.d.ts +4 -4
- package/js/src/base/types.d.ts +11 -0
- package/js/src/binance.d.ts +4 -11
- package/js/src/binance.js +14 -1
- package/js/src/bingx.d.ts +5 -2
- package/js/src/bingx.js +37 -1
- package/js/src/bitfinex.js +3 -0
- package/js/src/bitfinex2.d.ts +3 -17
- package/js/src/bitfinex2.js +16 -1
- package/js/src/bitflyer.d.ts +1 -0
- package/js/src/bitflyer.js +20 -1
- package/js/src/bitget.d.ts +5 -12
- package/js/src/bitget.js +15 -1
- package/js/src/bitopro.js +3 -0
- package/js/src/bitrue.d.ts +3 -17
- package/js/src/bitrue.js +13 -7
- package/js/src/bitvavo.js +3 -0
- package/js/src/btcmarkets.js +1 -1
- package/js/src/btcturk.js +2 -1
- package/js/src/coinex.d.ts +4 -11
- package/js/src/coinex.js +182 -54
- package/js/src/currencycom.js +1 -1
- package/js/src/delta.d.ts +5 -37
- package/js/src/delta.js +3 -1
- package/js/src/digifinex.d.ts +5 -13
- package/js/src/digifinex.js +4 -2
- package/js/src/exmo.d.ts +5 -37
- package/js/src/exmo.js +11 -12
- package/js/src/gate.d.ts +5 -33
- package/js/src/gate.js +5 -2
- package/js/src/hitbtc.d.ts +5 -12
- package/js/src/hitbtc.js +26 -2
- package/js/src/htx.js +2 -2
- package/js/src/huobijp.js +1 -1
- package/js/src/hyperliquid.d.ts +7 -4
- package/js/src/hyperliquid.js +249 -12
- package/js/src/idex.js +1 -1
- package/js/src/krakenfutures.js +2 -6
- package/js/src/kucoinfutures.d.ts +2 -2
- package/js/src/lbank.js +3 -0
- package/js/src/mexc.d.ts +3 -3
- package/js/src/oceanex.js +1 -1
- package/js/src/okx.d.ts +5 -33
- package/js/src/okx.js +24 -10
- package/js/src/phemex.d.ts +3 -11
- package/js/src/phemex.js +3 -1
- package/js/src/pro/kucoin.js +11 -6
- package/js/src/wazirx.js +1 -1
- package/js/src/zonda.js +3 -0
- package/package.json +3 -2
- package/skip-tests.json +3 -3
package/js/src/coinex.js
CHANGED
|
@@ -1068,19 +1068,22 @@ export default class coinex extends Exchange {
|
|
|
1068
1068
|
* @method
|
|
1069
1069
|
* @name coinex#fetchTime
|
|
1070
1070
|
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
1071
|
-
* @see https://
|
|
1071
|
+
* @see https://docs.coinex.com/api/v2/common/http/time
|
|
1072
1072
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1073
1073
|
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
1074
1074
|
*/
|
|
1075
|
-
const response = await this.
|
|
1075
|
+
const response = await this.v2PublicGetTime(params);
|
|
1076
1076
|
//
|
|
1077
1077
|
// {
|
|
1078
|
-
// "code":
|
|
1079
|
-
// "data":
|
|
1078
|
+
// "code": 0,
|
|
1079
|
+
// "data": {
|
|
1080
|
+
// "timestamp": 1711699867777
|
|
1081
|
+
// },
|
|
1080
1082
|
// "message": "OK"
|
|
1081
1083
|
// }
|
|
1082
1084
|
//
|
|
1083
|
-
|
|
1085
|
+
const data = this.safeDict(response, 'data', {});
|
|
1086
|
+
return this.safeInteger(data, 'timestamp');
|
|
1084
1087
|
}
|
|
1085
1088
|
async fetchOrderBook(symbol, limit = 20, params = {}) {
|
|
1086
1089
|
/**
|
|
@@ -1340,7 +1343,8 @@ export default class coinex extends Exchange {
|
|
|
1340
1343
|
* @method
|
|
1341
1344
|
* @name coinex#fetchTradingFee
|
|
1342
1345
|
* @description fetch the trading fees for a market
|
|
1343
|
-
* @see https://
|
|
1346
|
+
* @see https://docs.coinex.com/api/v2/spot/market/http/list-market
|
|
1347
|
+
* @see https://docs.coinex.com/api/v2/futures/market/http/list-market
|
|
1344
1348
|
* @param {string} symbol unified market symbol
|
|
1345
1349
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1346
1350
|
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
@@ -1350,67 +1354,132 @@ export default class coinex extends Exchange {
|
|
|
1350
1354
|
const request = {
|
|
1351
1355
|
'market': market['id'],
|
|
1352
1356
|
};
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1357
|
+
let response = undefined;
|
|
1358
|
+
if (market['spot']) {
|
|
1359
|
+
response = await this.v2PublicGetSpotMarket(this.extend(request, params));
|
|
1360
|
+
//
|
|
1361
|
+
// {
|
|
1362
|
+
// "code": 0,
|
|
1363
|
+
// "data": [
|
|
1364
|
+
// {
|
|
1365
|
+
// "base_ccy": "BTC",
|
|
1366
|
+
// "base_ccy_precision": 8,
|
|
1367
|
+
// "is_amm_available": false,
|
|
1368
|
+
// "is_margin_available": true,
|
|
1369
|
+
// "maker_fee_rate": "0.002",
|
|
1370
|
+
// "market": "BTCUSDT",
|
|
1371
|
+
// "min_amount": "0.0001",
|
|
1372
|
+
// "quote_ccy": "USDT",
|
|
1373
|
+
// "quote_ccy_precision": 2,
|
|
1374
|
+
// "taker_fee_rate": "0.002"
|
|
1375
|
+
// }
|
|
1376
|
+
// ],
|
|
1377
|
+
// "message": "OK"
|
|
1378
|
+
// }
|
|
1379
|
+
//
|
|
1380
|
+
}
|
|
1381
|
+
else {
|
|
1382
|
+
response = await this.v2PublicGetFuturesMarket(this.extend(request, params));
|
|
1383
|
+
//
|
|
1384
|
+
// {
|
|
1385
|
+
// "code": 0,
|
|
1386
|
+
// "data": [
|
|
1387
|
+
// {
|
|
1388
|
+
// "base_ccy": "BTC",
|
|
1389
|
+
// "base_ccy_precision": 8,
|
|
1390
|
+
// "contract_type": "linear",
|
|
1391
|
+
// "leverage": ["1","2","3","5","8","10","15","20","30","50","100"],
|
|
1392
|
+
// "maker_fee_rate": "0",
|
|
1393
|
+
// "market": "BTCUSDT",
|
|
1394
|
+
// "min_amount": "0.0001",
|
|
1395
|
+
// "open_interest_volume": "185.7498",
|
|
1396
|
+
// "quote_ccy": "USDT",
|
|
1397
|
+
// "quote_ccy_precision": 2,
|
|
1398
|
+
// "taker_fee_rate": "0"
|
|
1399
|
+
// }
|
|
1400
|
+
// ],
|
|
1401
|
+
// "message": "OK"
|
|
1402
|
+
// }
|
|
1403
|
+
//
|
|
1404
|
+
}
|
|
1405
|
+
const data = this.safeList(response, 'data', []);
|
|
1406
|
+
const result = this.safeDict(data, 0, {});
|
|
1407
|
+
return this.parseTradingFee(result, market);
|
|
1372
1408
|
}
|
|
1373
1409
|
async fetchTradingFees(params = {}) {
|
|
1374
1410
|
/**
|
|
1375
1411
|
* @method
|
|
1376
1412
|
* @name coinex#fetchTradingFees
|
|
1377
1413
|
* @description fetch the trading fees for multiple markets
|
|
1378
|
-
* @see https://
|
|
1414
|
+
* @see https://docs.coinex.com/api/v2/spot/market/http/list-market
|
|
1415
|
+
* @see https://docs.coinex.com/api/v2/futures/market/http/list-market
|
|
1379
1416
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1380
1417
|
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
1381
1418
|
*/
|
|
1382
1419
|
await this.loadMarkets();
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1420
|
+
let type = undefined;
|
|
1421
|
+
[type, params] = this.handleMarketTypeAndParams('fetchTradingFees', undefined, params);
|
|
1422
|
+
let response = undefined;
|
|
1423
|
+
if (type === 'swap') {
|
|
1424
|
+
response = await this.v2PublicGetFuturesMarket(params);
|
|
1425
|
+
//
|
|
1426
|
+
// {
|
|
1427
|
+
// "code": 0,
|
|
1428
|
+
// "data": [
|
|
1429
|
+
// {
|
|
1430
|
+
// "base_ccy": "BTC",
|
|
1431
|
+
// "base_ccy_precision": 8,
|
|
1432
|
+
// "contract_type": "linear",
|
|
1433
|
+
// "leverage": ["1","2","3","5","8","10","15","20","30","50","100"],
|
|
1434
|
+
// "maker_fee_rate": "0",
|
|
1435
|
+
// "market": "BTCUSDT",
|
|
1436
|
+
// "min_amount": "0.0001",
|
|
1437
|
+
// "open_interest_volume": "185.7498",
|
|
1438
|
+
// "quote_ccy": "USDT",
|
|
1439
|
+
// "quote_ccy_precision": 2,
|
|
1440
|
+
// "taker_fee_rate": "0"
|
|
1441
|
+
// }
|
|
1442
|
+
// ],
|
|
1443
|
+
// "message": "OK"
|
|
1444
|
+
// }
|
|
1445
|
+
//
|
|
1446
|
+
}
|
|
1447
|
+
else {
|
|
1448
|
+
response = await this.v2PublicGetSpotMarket(params);
|
|
1449
|
+
//
|
|
1450
|
+
// {
|
|
1451
|
+
// "code": 0,
|
|
1452
|
+
// "data": [
|
|
1453
|
+
// {
|
|
1454
|
+
// "base_ccy": "BTC",
|
|
1455
|
+
// "base_ccy_precision": 8,
|
|
1456
|
+
// "is_amm_available": false,
|
|
1457
|
+
// "is_margin_available": true,
|
|
1458
|
+
// "maker_fee_rate": "0.002",
|
|
1459
|
+
// "market": "BTCUSDT",
|
|
1460
|
+
// "min_amount": "0.0001",
|
|
1461
|
+
// "quote_ccy": "USDT",
|
|
1462
|
+
// "quote_ccy_precision": 2,
|
|
1463
|
+
// "taker_fee_rate": "0.002"
|
|
1464
|
+
// },
|
|
1465
|
+
// ],
|
|
1466
|
+
// "message": "OK"
|
|
1467
|
+
// }
|
|
1468
|
+
//
|
|
1469
|
+
}
|
|
1470
|
+
const data = this.safeList(response, 'data', []);
|
|
1403
1471
|
const result = {};
|
|
1404
|
-
for (let i = 0; i <
|
|
1405
|
-
const
|
|
1406
|
-
const
|
|
1407
|
-
const
|
|
1408
|
-
|
|
1472
|
+
for (let i = 0; i < data.length; i++) {
|
|
1473
|
+
const entry = data[i];
|
|
1474
|
+
const marketId = this.safeString(entry, 'market');
|
|
1475
|
+
const market = this.safeMarket(marketId, undefined, undefined, type);
|
|
1476
|
+
const symbol = market['symbol'];
|
|
1477
|
+
result[symbol] = this.parseTradingFee(entry, market);
|
|
1409
1478
|
}
|
|
1410
1479
|
return result;
|
|
1411
1480
|
}
|
|
1412
1481
|
parseTradingFee(fee, market = undefined) {
|
|
1413
|
-
const marketId = this.safeValue(fee, '
|
|
1482
|
+
const marketId = this.safeValue(fee, 'market');
|
|
1414
1483
|
const symbol = this.safeSymbol(marketId, market);
|
|
1415
1484
|
return {
|
|
1416
1485
|
'info': fee,
|
|
@@ -4182,13 +4251,72 @@ export default class coinex extends Exchange {
|
|
|
4182
4251
|
});
|
|
4183
4252
|
}
|
|
4184
4253
|
parseMarginModification(data, market = undefined) {
|
|
4254
|
+
//
|
|
4255
|
+
// addMargin/reduceMargin
|
|
4256
|
+
//
|
|
4257
|
+
// {
|
|
4258
|
+
// "adl_sort": 1,
|
|
4259
|
+
// "adl_sort_val": "0.00004320",
|
|
4260
|
+
// "amount": "0.0005",
|
|
4261
|
+
// "amount_max": "0.0005",
|
|
4262
|
+
// "amount_max_margin": "6.57352000000000000000",
|
|
4263
|
+
// "bkr_price": "16294.08000000000000011090",
|
|
4264
|
+
// "bkr_price_imply": "0.00000000000000000000",
|
|
4265
|
+
// "close_left": "0.0005",
|
|
4266
|
+
// "create_time": 1651202571.320778,
|
|
4267
|
+
// "deal_all": "19.72000000000000000000",
|
|
4268
|
+
// "deal_asset_fee": "0.00000000000000000000",
|
|
4269
|
+
// "fee_asset": "",
|
|
4270
|
+
// "finish_type": 1,
|
|
4271
|
+
// "first_price": "39441.12",
|
|
4272
|
+
// "insurance": "0.00000000000000000000",
|
|
4273
|
+
// "latest_price": "39441.12",
|
|
4274
|
+
// "leverage": "3",
|
|
4275
|
+
// "liq_amount": "0.00000000000000000000",
|
|
4276
|
+
// "liq_order_price": "0",
|
|
4277
|
+
// "liq_order_time": 0,
|
|
4278
|
+
// "liq_price": "16491.28560000000000011090",
|
|
4279
|
+
// "liq_price_imply": "0.00000000000000000000",
|
|
4280
|
+
// "liq_profit": "0.00000000000000000000",
|
|
4281
|
+
// "liq_time": 0,
|
|
4282
|
+
// "mainten_margin": "0.005",
|
|
4283
|
+
// "mainten_margin_amount": "0.09860280000000000000",
|
|
4284
|
+
// "maker_fee": "0.00000000000000000000",
|
|
4285
|
+
// "margin_amount": "11.57352000000000000000",
|
|
4286
|
+
// "market": "BTCUSDT",
|
|
4287
|
+
// "open_margin": "0.58687582908396110455",
|
|
4288
|
+
// "open_margin_imply": "0.00000000000000000000",
|
|
4289
|
+
// "open_price": "39441.12000000000000000000",
|
|
4290
|
+
// "open_val": "19.72056000000000000000",
|
|
4291
|
+
// "open_val_max": "19.72056000000000000000",
|
|
4292
|
+
// "position_id": 65171206,
|
|
4293
|
+
// "profit_clearing": "-0.00986028000000000000",
|
|
4294
|
+
// "profit_real": "-0.00986028000000000000",
|
|
4295
|
+
// "profit_unreal": "0.00",
|
|
4296
|
+
// "side": 2,
|
|
4297
|
+
// "stop_loss_price": "0.00000000000000000000",
|
|
4298
|
+
// "stop_loss_type": 0,
|
|
4299
|
+
// "sys": 0,
|
|
4300
|
+
// "take_profit_price": "0.00000000000000000000",
|
|
4301
|
+
// "take_profit_type": 0,
|
|
4302
|
+
// "taker_fee": "0.00000000000000000000",
|
|
4303
|
+
// "total": 3464,
|
|
4304
|
+
// "type": 1,
|
|
4305
|
+
// "update_time": 1651202638.911212,
|
|
4306
|
+
// "user_id": 3620173
|
|
4307
|
+
// }
|
|
4308
|
+
//
|
|
4309
|
+
const timestamp = this.safeIntegerProduct(data, 'update_time', 1000);
|
|
4185
4310
|
return {
|
|
4186
4311
|
'info': data,
|
|
4312
|
+
'symbol': this.safeSymbol(undefined, market),
|
|
4187
4313
|
'type': undefined,
|
|
4188
|
-
'amount':
|
|
4314
|
+
'amount': this.safeNumber(data, 'margin_amount'),
|
|
4315
|
+
'total': undefined,
|
|
4189
4316
|
'code': market['quote'],
|
|
4190
|
-
'symbol': this.safeSymbol(undefined, market),
|
|
4191
4317
|
'status': undefined,
|
|
4318
|
+
'timestamp': timestamp,
|
|
4319
|
+
'datetime': this.iso8601(timestamp),
|
|
4192
4320
|
};
|
|
4193
4321
|
}
|
|
4194
4322
|
async addMargin(symbol, amount, params = {}) {
|
package/js/src/currencycom.js
CHANGED
|
@@ -988,7 +988,7 @@ export default class currencycom extends Exchange {
|
|
|
988
988
|
request['startTime'] = since;
|
|
989
989
|
}
|
|
990
990
|
if (limit !== undefined) {
|
|
991
|
-
request['limit'] = limit; // default 500, max 1000
|
|
991
|
+
request['limit'] = Math.min(limit, 1000); // default 500, max 1000
|
|
992
992
|
}
|
|
993
993
|
const response = await this.publicGetV2Klines(this.extend(request, params));
|
|
994
994
|
//
|
package/js/src/delta.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/delta.js';
|
|
2
|
-
import type { Balances, Currency, Greeks, Int, Market, MarketInterface, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Position, Leverage, MarginMode, Num, Option } from './base/types.js';
|
|
2
|
+
import type { Balances, Currency, Greeks, Int, Market, MarketInterface, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Position, Leverage, MarginMode, Num, Option, MarginModification } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class delta
|
|
5
5
|
* @augments Exchange
|
|
@@ -115,42 +115,10 @@ export default class delta extends Exchange {
|
|
|
115
115
|
previousFundingTimestamp: any;
|
|
116
116
|
previousFundingDatetime: any;
|
|
117
117
|
};
|
|
118
|
-
addMargin(symbol: string, amount: any, params?: {}): Promise<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
total: number;
|
|
123
|
-
code: any;
|
|
124
|
-
symbol: string;
|
|
125
|
-
status: any;
|
|
126
|
-
}>;
|
|
127
|
-
reduceMargin(symbol: string, amount: any, params?: {}): Promise<{
|
|
128
|
-
info: any;
|
|
129
|
-
type: any;
|
|
130
|
-
amount: any;
|
|
131
|
-
total: number;
|
|
132
|
-
code: any;
|
|
133
|
-
symbol: string;
|
|
134
|
-
status: any;
|
|
135
|
-
}>;
|
|
136
|
-
modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<{
|
|
137
|
-
info: any;
|
|
138
|
-
type: any;
|
|
139
|
-
amount: any;
|
|
140
|
-
total: number;
|
|
141
|
-
code: any;
|
|
142
|
-
symbol: string;
|
|
143
|
-
status: any;
|
|
144
|
-
}>;
|
|
145
|
-
parseMarginModification(data: any, market?: Market): {
|
|
146
|
-
info: any;
|
|
147
|
-
type: any;
|
|
148
|
-
amount: any;
|
|
149
|
-
total: number;
|
|
150
|
-
code: any;
|
|
151
|
-
symbol: string;
|
|
152
|
-
status: any;
|
|
153
|
-
};
|
|
118
|
+
addMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
|
|
119
|
+
reduceMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
|
|
120
|
+
modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<MarginModification>;
|
|
121
|
+
parseMarginModification(data: any, market?: Market): MarginModification;
|
|
154
122
|
fetchOpenInterest(symbol: string, params?: {}): Promise<import("./base/types.js").OpenInterest>;
|
|
155
123
|
parseOpenInterest(interest: any, market?: Market): import("./base/types.js").OpenInterest;
|
|
156
124
|
fetchLeverage(symbol: string, params?: {}): Promise<Leverage>;
|
package/js/src/delta.js
CHANGED
|
@@ -2666,12 +2666,14 @@ export default class delta extends Exchange {
|
|
|
2666
2666
|
market = this.safeMarket(marketId, market);
|
|
2667
2667
|
return {
|
|
2668
2668
|
'info': data,
|
|
2669
|
+
'symbol': market['symbol'],
|
|
2669
2670
|
'type': undefined,
|
|
2670
2671
|
'amount': undefined,
|
|
2671
2672
|
'total': this.safeNumber(data, 'margin'),
|
|
2672
2673
|
'code': undefined,
|
|
2673
|
-
'symbol': market['symbol'],
|
|
2674
2674
|
'status': undefined,
|
|
2675
|
+
'timestamp': undefined,
|
|
2676
|
+
'datetime': undefined,
|
|
2675
2677
|
};
|
|
2676
2678
|
}
|
|
2677
2679
|
async fetchOpenInterest(symbol, params = {}) {
|
package/js/src/digifinex.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/digifinex.js';
|
|
2
|
-
import type { FundingRateHistory, Int, OHLCV, Order, OrderSide, OrderType, OrderRequest, Trade, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Strings, Market, Currency, TransferEntry, Num } from './base/types.js';
|
|
2
|
+
import type { FundingRateHistory, Int, OHLCV, Order, OrderSide, OrderType, OrderRequest, Trade, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Strings, Market, Currency, TransferEntry, Num, MarginModification } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class digifinex
|
|
5
5
|
* @augments Exchange
|
|
@@ -161,18 +161,10 @@ export default class digifinex extends Exchange {
|
|
|
161
161
|
handleMarginModeAndParams(methodName: any, params?: {}, defaultValue?: any): any[];
|
|
162
162
|
fetchDepositWithdrawFees(codes?: Strings, params?: {}): Promise<{}>;
|
|
163
163
|
parseDepositWithdrawFees(response: any, codes?: any, currencyIdKey?: any): {};
|
|
164
|
-
addMargin(symbol: string, amount: any, params?: {}): Promise<
|
|
165
|
-
reduceMargin(symbol: string, amount: any, params?: {}): Promise<
|
|
166
|
-
modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<
|
|
167
|
-
parseMarginModification(data: any, market?: Market):
|
|
168
|
-
info: any;
|
|
169
|
-
type: string;
|
|
170
|
-
amount: number;
|
|
171
|
-
total: any;
|
|
172
|
-
code: string;
|
|
173
|
-
symbol: string;
|
|
174
|
-
status: any;
|
|
175
|
-
};
|
|
164
|
+
addMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
|
|
165
|
+
reduceMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
|
|
166
|
+
modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<MarginModification>;
|
|
167
|
+
parseMarginModification(data: any, market?: Market): MarginModification;
|
|
176
168
|
fetchFundingHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").FundingHistory[]>;
|
|
177
169
|
parseIncome(income: any, market?: Market): {
|
|
178
170
|
info: any;
|
package/js/src/digifinex.js
CHANGED
|
@@ -1508,7 +1508,7 @@ export default class digifinex extends Exchange {
|
|
|
1508
1508
|
request['instrument_id'] = market['id'];
|
|
1509
1509
|
request['granularity'] = timeframe;
|
|
1510
1510
|
if (limit !== undefined) {
|
|
1511
|
-
request['limit'] = limit;
|
|
1511
|
+
request['limit'] = Math.min(limit, 100);
|
|
1512
1512
|
}
|
|
1513
1513
|
response = await this.publicSwapGetPublicCandles(this.extend(request, params));
|
|
1514
1514
|
}
|
|
@@ -4161,12 +4161,14 @@ export default class digifinex extends Exchange {
|
|
|
4161
4161
|
const rawType = this.safeInteger(data, 'type');
|
|
4162
4162
|
return {
|
|
4163
4163
|
'info': data,
|
|
4164
|
+
'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
|
|
4164
4165
|
'type': (rawType === 1) ? 'add' : 'reduce',
|
|
4165
4166
|
'amount': this.safeNumber(data, 'amount'),
|
|
4166
4167
|
'total': undefined,
|
|
4167
4168
|
'code': market['settle'],
|
|
4168
|
-
'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
|
|
4169
4169
|
'status': undefined,
|
|
4170
|
+
'timestamp': undefined,
|
|
4171
|
+
'datetime': undefined,
|
|
4170
4172
|
};
|
|
4171
4173
|
}
|
|
4172
4174
|
async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
package/js/src/exmo.d.ts
CHANGED
|
@@ -1,47 +1,15 @@
|
|
|
1
1
|
import Exchange from './abstract/exmo.js';
|
|
2
|
-
import type { Dictionary, Int, Order, OrderSide, OrderType, Trade, OrderBook, OHLCV, Balances, Str, Transaction, Ticker, Tickers, Strings, Market, Currency, Num } from './base/types.js';
|
|
2
|
+
import type { Dictionary, Int, Order, OrderSide, OrderType, Trade, OrderBook, OHLCV, Balances, Str, Transaction, Ticker, Tickers, Strings, Market, Currency, Num, MarginModification } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class exmo
|
|
5
5
|
* @augments Exchange
|
|
6
6
|
*/
|
|
7
7
|
export default class exmo extends Exchange {
|
|
8
8
|
describe(): any;
|
|
9
|
-
modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
code: any;
|
|
14
|
-
symbol: string;
|
|
15
|
-
total: any;
|
|
16
|
-
status: string;
|
|
17
|
-
}>;
|
|
18
|
-
parseMarginModification(data: any, market?: Market): {
|
|
19
|
-
info: any;
|
|
20
|
-
type: any;
|
|
21
|
-
amount: any;
|
|
22
|
-
code: any;
|
|
23
|
-
symbol: string;
|
|
24
|
-
total: any;
|
|
25
|
-
status: string;
|
|
26
|
-
};
|
|
27
|
-
reduceMargin(symbol: string, amount: any, params?: {}): Promise<{
|
|
28
|
-
info: any;
|
|
29
|
-
type: any;
|
|
30
|
-
amount: any;
|
|
31
|
-
code: any;
|
|
32
|
-
symbol: string;
|
|
33
|
-
total: any;
|
|
34
|
-
status: string;
|
|
35
|
-
}>;
|
|
36
|
-
addMargin(symbol: string, amount: any, params?: {}): Promise<{
|
|
37
|
-
info: any;
|
|
38
|
-
type: any;
|
|
39
|
-
amount: any;
|
|
40
|
-
code: any;
|
|
41
|
-
symbol: string;
|
|
42
|
-
total: any;
|
|
43
|
-
status: string;
|
|
44
|
-
}>;
|
|
9
|
+
modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<MarginModification>;
|
|
10
|
+
parseMarginModification(data: any, market?: Market): MarginModification;
|
|
11
|
+
reduceMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
|
|
12
|
+
addMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
|
|
45
13
|
fetchTradingFees(params?: {}): Promise<{}>;
|
|
46
14
|
fetchPrivateTradingFees(params?: {}): Promise<{}>;
|
|
47
15
|
fetchPublicTradingFees(params?: {}): Promise<{}>;
|
package/js/src/exmo.js
CHANGED
|
@@ -265,12 +265,14 @@ export default class exmo extends Exchange {
|
|
|
265
265
|
//
|
|
266
266
|
return {
|
|
267
267
|
'info': data,
|
|
268
|
+
'symbol': this.safeSymbol(undefined, market),
|
|
268
269
|
'type': undefined,
|
|
269
270
|
'amount': undefined,
|
|
270
|
-
'code': this.safeValue(market, 'quote'),
|
|
271
|
-
'symbol': this.safeSymbol(undefined, market),
|
|
272
271
|
'total': undefined,
|
|
272
|
+
'code': this.safeValue(market, 'quote'),
|
|
273
273
|
'status': 'ok',
|
|
274
|
+
'timestamp': undefined,
|
|
275
|
+
'datetime': undefined,
|
|
274
276
|
};
|
|
275
277
|
}
|
|
276
278
|
async reduceMargin(symbol, amount, params = {}) {
|
|
@@ -863,16 +865,15 @@ export default class exmo extends Exchange {
|
|
|
863
865
|
'symbol': market['id'],
|
|
864
866
|
'resolution': this.safeString(this.timeframes, timeframe, timeframe),
|
|
865
867
|
};
|
|
866
|
-
const
|
|
867
|
-
const maxLimit = this.safeInteger(options, 'maxLimit', 3000);
|
|
868
|
+
const maxLimit = 3000;
|
|
868
869
|
const duration = this.parseTimeframe(timeframe);
|
|
869
870
|
const now = this.milliseconds();
|
|
870
871
|
if (since === undefined) {
|
|
871
872
|
if (limit === undefined) {
|
|
872
873
|
limit = 1000; // cap default at generous amount
|
|
873
874
|
}
|
|
874
|
-
|
|
875
|
-
limit = maxLimit;
|
|
875
|
+
else {
|
|
876
|
+
limit = Math.min(limit, maxLimit);
|
|
876
877
|
}
|
|
877
878
|
request['from'] = this.parseToInt(now / 1000) - limit * duration - 1;
|
|
878
879
|
request['to'] = this.parseToInt(now / 1000);
|
|
@@ -880,15 +881,13 @@ export default class exmo extends Exchange {
|
|
|
880
881
|
else {
|
|
881
882
|
request['from'] = this.parseToInt(since / 1000) - 1;
|
|
882
883
|
if (limit === undefined) {
|
|
883
|
-
|
|
884
|
+
limit = maxLimit;
|
|
884
885
|
}
|
|
885
886
|
else {
|
|
886
|
-
|
|
887
|
-
throw new BadRequest(this.id + ' fetchOHLCV() will serve ' + maxLimit.toString() + ' candles at most');
|
|
888
|
-
}
|
|
889
|
-
const to = this.sum(since, limit * duration * 1000);
|
|
890
|
-
request['to'] = this.parseToInt(to / 1000);
|
|
887
|
+
limit = Math.min(limit, maxLimit);
|
|
891
888
|
}
|
|
889
|
+
const to = this.sum(since, limit * duration * 1000);
|
|
890
|
+
request['to'] = this.parseToInt(to / 1000);
|
|
892
891
|
}
|
|
893
892
|
const response = await this.publicGetCandlesHistory(this.extend(request, params));
|
|
894
893
|
//
|
package/js/src/gate.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/gate.js';
|
|
2
|
-
import type { Int, OrderSide, OrderType, OHLCV, Trade, FundingRateHistory, OpenInterest, Order, Balances, OrderRequest, FundingHistory, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry, Leverage, Leverages, Num, OptionChain, Option } from './base/types.js';
|
|
2
|
+
import type { Int, OrderSide, OrderType, OHLCV, Trade, FundingRateHistory, OpenInterest, Order, Balances, OrderRequest, FundingHistory, Str, Transaction, Ticker, OrderBook, Tickers, Greeks, Strings, Market, Currency, MarketInterface, TransferEntry, Leverage, Leverages, Num, OptionChain, Option, MarginModification } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class gate
|
|
5
5
|
* @augments Exchange
|
|
@@ -262,38 +262,10 @@ export default class gate extends Exchange {
|
|
|
262
262
|
body: any;
|
|
263
263
|
headers: any;
|
|
264
264
|
};
|
|
265
|
-
modifyMarginHelper(symbol: string, amount: any, params?: {}): Promise<
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
symbol: string;
|
|
270
|
-
total: number;
|
|
271
|
-
status: string;
|
|
272
|
-
}>;
|
|
273
|
-
parseMarginModification(data: any, market?: Market): {
|
|
274
|
-
info: any;
|
|
275
|
-
amount: any;
|
|
276
|
-
code: any;
|
|
277
|
-
symbol: string;
|
|
278
|
-
total: number;
|
|
279
|
-
status: string;
|
|
280
|
-
};
|
|
281
|
-
reduceMargin(symbol: string, amount: any, params?: {}): Promise<{
|
|
282
|
-
info: any;
|
|
283
|
-
amount: any;
|
|
284
|
-
code: any;
|
|
285
|
-
symbol: string;
|
|
286
|
-
total: number;
|
|
287
|
-
status: string;
|
|
288
|
-
}>;
|
|
289
|
-
addMargin(symbol: string, amount: any, params?: {}): Promise<{
|
|
290
|
-
info: any;
|
|
291
|
-
amount: any;
|
|
292
|
-
code: any;
|
|
293
|
-
symbol: string;
|
|
294
|
-
total: number;
|
|
295
|
-
status: string;
|
|
296
|
-
}>;
|
|
265
|
+
modifyMarginHelper(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
|
|
266
|
+
parseMarginModification(data: any, market?: Market): MarginModification;
|
|
267
|
+
reduceMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
|
|
268
|
+
addMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
|
|
297
269
|
fetchOpenInterestHistory(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OpenInterest[]>;
|
|
298
270
|
parseOpenInterest(interest: any, market?: Market): {
|
|
299
271
|
symbol: string;
|
package/js/src/gate.js
CHANGED
|
@@ -6118,11 +6118,14 @@ export default class gate extends Exchange {
|
|
|
6118
6118
|
const total = this.safeNumber(data, 'margin');
|
|
6119
6119
|
return {
|
|
6120
6120
|
'info': data,
|
|
6121
|
-
'amount': undefined,
|
|
6122
|
-
'code': this.safeValue(market, 'quote'),
|
|
6123
6121
|
'symbol': market['symbol'],
|
|
6122
|
+
'type': undefined,
|
|
6123
|
+
'amount': undefined,
|
|
6124
6124
|
'total': total,
|
|
6125
|
+
'code': this.safeValue(market, 'quote'),
|
|
6125
6126
|
'status': 'ok',
|
|
6127
|
+
'timestamp': undefined,
|
|
6128
|
+
'datetime': undefined,
|
|
6126
6129
|
};
|
|
6127
6130
|
}
|
|
6128
6131
|
async reduceMargin(symbol, amount, params = {}) {
|
package/js/src/hitbtc.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/hitbtc.js';
|
|
2
|
-
import type { TransferEntry, Int, OrderSide, OrderType, FundingRateHistory, OHLCV, Ticker, Order, OrderBook, Dictionary, Position, Str, Trade, Balances, Transaction, MarginMode, Tickers, Strings, Market, Currency, MarginModes, Leverage, Num } from './base/types.js';
|
|
2
|
+
import type { TransferEntry, Int, OrderSide, OrderType, FundingRateHistory, OHLCV, Ticker, Order, OrderBook, Dictionary, Position, Str, Trade, Balances, Transaction, MarginMode, Tickers, Strings, Market, Currency, MarginModes, Leverage, Num, MarginModification } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class hitbtc
|
|
5
5
|
* @augments Exchange
|
|
@@ -132,17 +132,10 @@ export default class hitbtc extends Exchange {
|
|
|
132
132
|
previousFundingTimestamp: any;
|
|
133
133
|
previousFundingDatetime: any;
|
|
134
134
|
};
|
|
135
|
-
modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<
|
|
136
|
-
parseMarginModification(data: any, market?: Market):
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
amount: any;
|
|
140
|
-
code: string;
|
|
141
|
-
symbol: string;
|
|
142
|
-
status: any;
|
|
143
|
-
};
|
|
144
|
-
reduceMargin(symbol: string, amount: any, params?: {}): Promise<any>;
|
|
145
|
-
addMargin(symbol: string, amount: any, params?: {}): Promise<any>;
|
|
135
|
+
modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<MarginModification>;
|
|
136
|
+
parseMarginModification(data: any, market?: Market): MarginModification;
|
|
137
|
+
reduceMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
|
|
138
|
+
addMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
|
|
146
139
|
fetchLeverage(symbol: string, params?: {}): Promise<Leverage>;
|
|
147
140
|
parseLeverage(leverage: any, market?: any): Leverage;
|
|
148
141
|
setLeverage(leverage: Int, symbol?: Str, params?: {}): Promise<any>;
|