ccxt 4.1.11 → 4.1.12
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.js +110 -52
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/binance.js +79 -36
- package/dist/cjs/src/bitget.js +9 -2
- package/dist/cjs/src/bybit.js +12 -6
- package/dist/cjs/src/cryptocom.js +1 -1
- package/dist/cjs/src/delta.js +2 -2
- package/dist/cjs/src/huobi.js +3 -4
- package/dist/cjs/src/okx.js +1 -0
- package/dist/cjs/src/poloniex.js +1 -0
- package/dist/cjs/src/whitebit.js +1 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/binance.js +79 -36
- package/js/src/bitget.js +9 -2
- package/js/src/bybit.d.ts +3 -3
- package/js/src/bybit.js +12 -6
- package/js/src/cryptocom.d.ts +1 -1
- package/js/src/cryptocom.js +1 -1
- package/js/src/delta.d.ts +2 -54
- package/js/src/delta.js +2 -2
- package/js/src/huobi.d.ts +1 -1
- package/js/src/huobi.js +3 -4
- package/js/src/mexc.d.ts +4 -4
- package/js/src/okx.js +1 -0
- package/js/src/poloniex.js +1 -0
- package/js/src/whitebit.js +1 -0
- package/package.json +1 -1
package/js/src/binance.js
CHANGED
|
@@ -1810,14 +1810,16 @@ export default class binance extends Exchange {
|
|
|
1810
1810
|
const query = this.omit(params, 'type');
|
|
1811
1811
|
let subType = undefined;
|
|
1812
1812
|
[subType, params] = this.handleSubTypeAndParams('fetchTime', undefined, params);
|
|
1813
|
-
let
|
|
1813
|
+
let response = undefined;
|
|
1814
1814
|
if (this.isLinear(type, subType)) {
|
|
1815
|
-
|
|
1815
|
+
response = await this.fapiPublicGetTime(query);
|
|
1816
1816
|
}
|
|
1817
1817
|
else if (this.isInverse(type, subType)) {
|
|
1818
|
-
|
|
1818
|
+
response = await this.dapiPublicGetTime(query);
|
|
1819
|
+
}
|
|
1820
|
+
else {
|
|
1821
|
+
response = await this.publicGetTime(query);
|
|
1819
1822
|
}
|
|
1820
|
-
const response = await this[method](query);
|
|
1821
1823
|
return this.safeInteger(response, 'serverTime');
|
|
1822
1824
|
}
|
|
1823
1825
|
async fetchCurrencies(params = {}) {
|
|
@@ -2803,17 +2805,19 @@ export default class binance extends Exchange {
|
|
|
2803
2805
|
if (limit !== undefined) {
|
|
2804
2806
|
request['limit'] = limit; // default 100, max 5000, see https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#order-book
|
|
2805
2807
|
}
|
|
2806
|
-
let
|
|
2808
|
+
let response = undefined;
|
|
2807
2809
|
if (market['option']) {
|
|
2808
|
-
|
|
2810
|
+
response = await this.eapiPublicGetDepth(this.extend(request, params));
|
|
2809
2811
|
}
|
|
2810
2812
|
else if (market['linear']) {
|
|
2811
|
-
|
|
2813
|
+
response = await this.fapiPublicGetDepth(this.extend(request, params));
|
|
2812
2814
|
}
|
|
2813
2815
|
else if (market['inverse']) {
|
|
2814
|
-
|
|
2816
|
+
response = await this.dapiPublicGetDepth(this.extend(request, params));
|
|
2817
|
+
}
|
|
2818
|
+
else {
|
|
2819
|
+
response = await this.publicGetDepth(this.extend(request, params));
|
|
2815
2820
|
}
|
|
2816
|
-
const response = await this[method](this.extend(request, params));
|
|
2817
2821
|
//
|
|
2818
2822
|
// future
|
|
2819
2823
|
//
|
|
@@ -3047,17 +3051,19 @@ export default class binance extends Exchange {
|
|
|
3047
3051
|
const request = {
|
|
3048
3052
|
'symbol': market['id'],
|
|
3049
3053
|
};
|
|
3050
|
-
let
|
|
3054
|
+
let response = undefined;
|
|
3051
3055
|
if (market['option']) {
|
|
3052
|
-
|
|
3056
|
+
response = await this.eapiPublicGetTicker(this.extend(request, params));
|
|
3053
3057
|
}
|
|
3054
3058
|
else if (market['linear']) {
|
|
3055
|
-
|
|
3059
|
+
response = await this.fapiPublicGetTicker24hr(this.extend(request, params));
|
|
3056
3060
|
}
|
|
3057
3061
|
else if (market['inverse']) {
|
|
3058
|
-
|
|
3062
|
+
response = await this.dapiPublicGetTicker24hr(this.extend(request, params));
|
|
3063
|
+
}
|
|
3064
|
+
else {
|
|
3065
|
+
response = await this.publicGetTicker24hr(this.extend(request, params));
|
|
3059
3066
|
}
|
|
3060
|
-
const response = await this[method](this.extend(request, params));
|
|
3061
3067
|
if (Array.isArray(response)) {
|
|
3062
3068
|
const firstTicker = this.safeValue(response, 0, {});
|
|
3063
3069
|
return this.parseTicker(firstTicker, market);
|
|
@@ -3087,17 +3093,16 @@ export default class binance extends Exchange {
|
|
|
3087
3093
|
let subType = undefined;
|
|
3088
3094
|
[subType, params] = this.handleSubTypeAndParams('fetchBidsAsks', market, params);
|
|
3089
3095
|
[type, params] = this.handleMarketTypeAndParams('fetchBidsAsks', market, params);
|
|
3090
|
-
let
|
|
3096
|
+
let response = undefined;
|
|
3091
3097
|
if (this.isLinear(type, subType)) {
|
|
3092
|
-
|
|
3098
|
+
response = await this.fapiPublicGetTickerBookTicker(params);
|
|
3093
3099
|
}
|
|
3094
3100
|
else if (this.isInverse(type, subType)) {
|
|
3095
|
-
|
|
3101
|
+
response = await this.dapiPublicGetTickerBookTicker(params);
|
|
3096
3102
|
}
|
|
3097
3103
|
else {
|
|
3098
|
-
|
|
3104
|
+
response = await this.publicGetTickerBookTicker(params);
|
|
3099
3105
|
}
|
|
3100
|
-
const response = await this[method](params);
|
|
3101
3106
|
return this.parseTickers(response, symbols);
|
|
3102
3107
|
}
|
|
3103
3108
|
async fetchLastPrices(symbols = undefined, params = {}) {
|
|
@@ -3119,9 +3124,9 @@ export default class binance extends Exchange {
|
|
|
3119
3124
|
let subType = undefined;
|
|
3120
3125
|
[subType, params] = this.handleSubTypeAndParams('fetchLastPrices', market, params);
|
|
3121
3126
|
[type, params] = this.handleMarketTypeAndParams('fetchLastPrices', market, params);
|
|
3122
|
-
let
|
|
3127
|
+
let response = undefined;
|
|
3123
3128
|
if (this.isLinear(type, subType)) {
|
|
3124
|
-
|
|
3129
|
+
response = await this.fapiPublicGetTickerPrice(params);
|
|
3125
3130
|
//
|
|
3126
3131
|
// [
|
|
3127
3132
|
// {
|
|
@@ -3134,7 +3139,7 @@ export default class binance extends Exchange {
|
|
|
3134
3139
|
//
|
|
3135
3140
|
}
|
|
3136
3141
|
else if (this.isInverse(type, subType)) {
|
|
3137
|
-
|
|
3142
|
+
response = await this.dapiPublicGetTickerPrice(params);
|
|
3138
3143
|
//
|
|
3139
3144
|
// [
|
|
3140
3145
|
// {
|
|
@@ -3147,7 +3152,7 @@ export default class binance extends Exchange {
|
|
|
3147
3152
|
//
|
|
3148
3153
|
}
|
|
3149
3154
|
else if (type === 'spot') {
|
|
3150
|
-
|
|
3155
|
+
response = await this.publicGetTickerPrice(params);
|
|
3151
3156
|
//
|
|
3152
3157
|
// [
|
|
3153
3158
|
// {
|
|
@@ -3161,7 +3166,6 @@ export default class binance extends Exchange {
|
|
|
3161
3166
|
else {
|
|
3162
3167
|
throw new NotSupported(this.id + ' fetchLastPrices() does not support ' + type + ' markets yet');
|
|
3163
3168
|
}
|
|
3164
|
-
const response = await this[method](params);
|
|
3165
3169
|
return this.parseLastPrices(response, symbols);
|
|
3166
3170
|
}
|
|
3167
3171
|
parseLastPrice(info, market = undefined) {
|
|
@@ -6481,10 +6485,20 @@ export default class binance extends Exchange {
|
|
|
6481
6485
|
}
|
|
6482
6486
|
parseTradingFee(fee, market = undefined) {
|
|
6483
6487
|
//
|
|
6488
|
+
// spot
|
|
6489
|
+
// [
|
|
6490
|
+
// {
|
|
6491
|
+
// "symbol": "BTCUSDT",
|
|
6492
|
+
// "makerCommission": "0.001",
|
|
6493
|
+
// "takerCommission": "0.001"
|
|
6494
|
+
// }
|
|
6495
|
+
// ]
|
|
6496
|
+
//
|
|
6497
|
+
// swap
|
|
6484
6498
|
// {
|
|
6485
|
-
// "symbol": "
|
|
6486
|
-
// "
|
|
6487
|
-
// "
|
|
6499
|
+
// "symbol": "BTCUSD_PERP",
|
|
6500
|
+
// "makerCommissionRate": "0.00015", // 0.015%
|
|
6501
|
+
// "takerCommissionRate": "0.00040" // 0.040%
|
|
6488
6502
|
// }
|
|
6489
6503
|
//
|
|
6490
6504
|
const marketId = this.safeString(fee, 'symbol');
|
|
@@ -6492,8 +6506,8 @@ export default class binance extends Exchange {
|
|
|
6492
6506
|
return {
|
|
6493
6507
|
'info': fee,
|
|
6494
6508
|
'symbol': symbol,
|
|
6495
|
-
'maker': this.
|
|
6496
|
-
'taker': this.
|
|
6509
|
+
'maker': this.safeNumber2(fee, 'makerCommission', 'makerCommissionRate'),
|
|
6510
|
+
'taker': this.safeNumber2(fee, 'takerCommission', 'takerCommissionRate'),
|
|
6497
6511
|
};
|
|
6498
6512
|
}
|
|
6499
6513
|
async fetchTradingFee(symbol, params = {}) {
|
|
@@ -6502,17 +6516,37 @@ export default class binance extends Exchange {
|
|
|
6502
6516
|
* @name binance#fetchTradingFee
|
|
6503
6517
|
* @description fetch the trading fees for a market
|
|
6504
6518
|
* @see https://binance-docs.github.io/apidocs/spot/en/#trade-fee-user_data
|
|
6519
|
+
* @see https://binance-docs.github.io/apidocs/futures/en/#user-commission-rate-user_data
|
|
6520
|
+
* @see https://binance-docs.github.io/apidocs/delivery/en/#user-commission-rate-user_data
|
|
6505
6521
|
* @param {string} symbol unified market symbol
|
|
6506
6522
|
* @param {object} [params] extra parameters specific to the binance api endpoint
|
|
6507
6523
|
* @returns {object} a [fee structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#fee-structure}
|
|
6508
6524
|
*/
|
|
6509
6525
|
await this.loadMarkets();
|
|
6510
6526
|
const market = this.market(symbol);
|
|
6527
|
+
const defaultType = this.safeString2(this.options, 'fetchTradingFee', 'defaultType', 'linear');
|
|
6528
|
+
const type = this.safeString(params, 'type', defaultType);
|
|
6529
|
+
params = this.omit(params, 'type');
|
|
6530
|
+
let subType = undefined;
|
|
6531
|
+
[subType, params] = this.handleSubTypeAndParams('fetchTradingFee', market, params);
|
|
6532
|
+
const isSpotOrMargin = (type === 'spot') || (type === 'margin');
|
|
6533
|
+
const isLinear = this.isLinear(type, subType);
|
|
6534
|
+
const isInverse = this.isInverse(type, subType);
|
|
6511
6535
|
const request = {
|
|
6512
6536
|
'symbol': market['id'],
|
|
6513
6537
|
};
|
|
6514
|
-
|
|
6538
|
+
let response = undefined;
|
|
6539
|
+
if (isSpotOrMargin) {
|
|
6540
|
+
response = await this.sapiGetAssetTradeFee(this.extend(request, params));
|
|
6541
|
+
}
|
|
6542
|
+
else if (isLinear) {
|
|
6543
|
+
response = await this.fapiPrivateGetCommissionRate(this.extend(request, params));
|
|
6544
|
+
}
|
|
6545
|
+
else if (isInverse) {
|
|
6546
|
+
response = await this.dapiPrivateGetCommissionRate(this.extend(request, params));
|
|
6547
|
+
}
|
|
6515
6548
|
//
|
|
6549
|
+
// spot
|
|
6516
6550
|
// [
|
|
6517
6551
|
// {
|
|
6518
6552
|
// "symbol": "BTCUSDT",
|
|
@@ -6521,8 +6555,18 @@ export default class binance extends Exchange {
|
|
|
6521
6555
|
// }
|
|
6522
6556
|
// ]
|
|
6523
6557
|
//
|
|
6524
|
-
|
|
6525
|
-
|
|
6558
|
+
// swap
|
|
6559
|
+
// {
|
|
6560
|
+
// "symbol": "BTCUSD_PERP",
|
|
6561
|
+
// "makerCommissionRate": "0.00015", // 0.015%
|
|
6562
|
+
// "takerCommissionRate": "0.00040" // 0.040%
|
|
6563
|
+
// }
|
|
6564
|
+
//
|
|
6565
|
+
let data = response;
|
|
6566
|
+
if (Array.isArray(data)) {
|
|
6567
|
+
data = this.safeValue(data, 0, {});
|
|
6568
|
+
}
|
|
6569
|
+
return this.parseTradingFee(data);
|
|
6526
6570
|
}
|
|
6527
6571
|
async fetchTradingFees(params = {}) {
|
|
6528
6572
|
/**
|
|
@@ -6537,11 +6581,10 @@ export default class binance extends Exchange {
|
|
|
6537
6581
|
*/
|
|
6538
6582
|
await this.loadMarkets();
|
|
6539
6583
|
let method = undefined;
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
params = this.omit(params, 'type');
|
|
6584
|
+
let type = undefined;
|
|
6585
|
+
[type, params] = this.handleMarketTypeAndParams('fetchTradingFees', undefined, params);
|
|
6543
6586
|
let subType = undefined;
|
|
6544
|
-
[subType, params] = this.handleSubTypeAndParams('fetchTradingFees', undefined, params);
|
|
6587
|
+
[subType, params] = this.handleSubTypeAndParams('fetchTradingFees', undefined, params, 'linear');
|
|
6545
6588
|
const isSpotOrMargin = (type === 'spot') || (type === 'margin');
|
|
6546
6589
|
const isLinear = this.isLinear(type, subType);
|
|
6547
6590
|
const isInverse = this.isInverse(type, subType);
|
package/js/src/bitget.js
CHANGED
|
@@ -1576,7 +1576,7 @@ export default class bitget extends Exchange {
|
|
|
1576
1576
|
}
|
|
1577
1577
|
const currency = this.currency(code);
|
|
1578
1578
|
if (since === undefined) {
|
|
1579
|
-
since = this.milliseconds() -
|
|
1579
|
+
since = this.milliseconds() - 7776000000; // 90 days
|
|
1580
1580
|
}
|
|
1581
1581
|
let request = {
|
|
1582
1582
|
'coin': currency['code'],
|
|
@@ -1732,7 +1732,7 @@ export default class bitget extends Exchange {
|
|
|
1732
1732
|
}
|
|
1733
1733
|
const currency = this.currency(code);
|
|
1734
1734
|
if (since === undefined) {
|
|
1735
|
-
since = this.milliseconds() -
|
|
1735
|
+
since = this.milliseconds() - 7776000000; // 90 days
|
|
1736
1736
|
}
|
|
1737
1737
|
let request = {
|
|
1738
1738
|
'coin': currency['code'],
|
|
@@ -4045,10 +4045,17 @@ export default class bitget extends Exchange {
|
|
|
4045
4045
|
response = await this.privateSpotPostTradeFills(this.extend(request, params));
|
|
4046
4046
|
}
|
|
4047
4047
|
else {
|
|
4048
|
+
const orderId = this.safeString(params, 'orderId'); // when order id is not defined, startTime and endTime are required
|
|
4048
4049
|
if (since !== undefined) {
|
|
4049
4050
|
request['startTime'] = since;
|
|
4050
4051
|
}
|
|
4052
|
+
else if (orderId === undefined) {
|
|
4053
|
+
request['startTime'] = 0;
|
|
4054
|
+
}
|
|
4051
4055
|
[request, params] = this.handleUntilOption('endTime', params, request);
|
|
4056
|
+
if (!('endTime' in request) && (orderId === undefined)) {
|
|
4057
|
+
request['endTime'] = this.milliseconds();
|
|
4058
|
+
}
|
|
4052
4059
|
response = await this.privateMixGetOrderFills(this.extend(request, params));
|
|
4053
4060
|
}
|
|
4054
4061
|
//
|
package/js/src/bybit.d.ts
CHANGED
|
@@ -197,9 +197,9 @@ export default class bybit extends Exchange {
|
|
|
197
197
|
updated: number;
|
|
198
198
|
fee: any;
|
|
199
199
|
}>;
|
|
200
|
-
fetchPosition(symbol: string, params?: {}): Promise<
|
|
201
|
-
fetchUsdcPositions(symbols?: string[], params?: {}): Promise<
|
|
202
|
-
fetchPositions(symbols?: string[], params?: {}): Promise<
|
|
200
|
+
fetchPosition(symbol: string, params?: {}): Promise<import("./base/types.js").Position>;
|
|
201
|
+
fetchUsdcPositions(symbols?: string[], params?: {}): Promise<import("./base/types.js").Position[]>;
|
|
202
|
+
fetchPositions(symbols?: string[], params?: {}): Promise<import("./base/types.js").Position[]>;
|
|
203
203
|
parsePosition(position: any, market?: any): import("./base/types.js").Position;
|
|
204
204
|
setMarginMode(marginMode: any, symbol?: string, params?: {}): Promise<any>;
|
|
205
205
|
setLeverage(leverage: any, symbol?: string, params?: {}): Promise<any>;
|
package/js/src/bybit.js
CHANGED
|
@@ -1753,6 +1753,7 @@ export default class bybit extends Exchange {
|
|
|
1753
1753
|
'max': this.safeNumber(lotSizeFilter, 'maxOrderAmt'),
|
|
1754
1754
|
},
|
|
1755
1755
|
},
|
|
1756
|
+
'created': undefined,
|
|
1756
1757
|
'info': market,
|
|
1757
1758
|
});
|
|
1758
1759
|
}
|
|
@@ -1927,6 +1928,7 @@ export default class bybit extends Exchange {
|
|
|
1927
1928
|
'max': undefined,
|
|
1928
1929
|
},
|
|
1929
1930
|
},
|
|
1931
|
+
'created': this.safeInteger(market, 'launchTime'),
|
|
1930
1932
|
'info': market,
|
|
1931
1933
|
});
|
|
1932
1934
|
}
|
|
@@ -2059,6 +2061,7 @@ export default class bybit extends Exchange {
|
|
|
2059
2061
|
'max': undefined,
|
|
2060
2062
|
},
|
|
2061
2063
|
},
|
|
2064
|
+
'created': this.safeInteger(market, 'launchTime'),
|
|
2062
2065
|
'info': market,
|
|
2063
2066
|
});
|
|
2064
2067
|
}
|
|
@@ -3513,10 +3516,14 @@ export default class bybit extends Exchange {
|
|
|
3513
3516
|
// }
|
|
3514
3517
|
//
|
|
3515
3518
|
const marketId = this.safeString(order, 'symbol');
|
|
3516
|
-
|
|
3519
|
+
const isContract = ('tpslMode' in order);
|
|
3520
|
+
let marketType = undefined;
|
|
3517
3521
|
if (market !== undefined) {
|
|
3518
3522
|
marketType = market['type'];
|
|
3519
3523
|
}
|
|
3524
|
+
else {
|
|
3525
|
+
marketType = isContract ? 'contract' : 'spot';
|
|
3526
|
+
}
|
|
3520
3527
|
market = this.safeMarket(marketId, market, undefined, marketType);
|
|
3521
3528
|
const symbol = market['symbol'];
|
|
3522
3529
|
const timestamp = this.safeInteger2(order, 'createdTime', 'createdAt');
|
|
@@ -5693,10 +5700,9 @@ export default class bybit extends Exchange {
|
|
|
5693
5700
|
const timestamp = this.safeInteger(response, 'time');
|
|
5694
5701
|
const first = this.safeValue(positions, 0, {});
|
|
5695
5702
|
const position = this.parsePosition(first, market);
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
});
|
|
5703
|
+
position['timestamp'] = timestamp;
|
|
5704
|
+
position['datetime'] = this.iso8601(timestamp);
|
|
5705
|
+
return position;
|
|
5700
5706
|
}
|
|
5701
5707
|
async fetchUsdcPositions(symbols = undefined, params = {}) {
|
|
5702
5708
|
await this.loadMarkets();
|
|
@@ -5771,7 +5777,7 @@ export default class bybit extends Exchange {
|
|
|
5771
5777
|
}
|
|
5772
5778
|
results.push(this.parsePosition(rawPosition, market));
|
|
5773
5779
|
}
|
|
5774
|
-
return this.
|
|
5780
|
+
return this.filterByArrayPositions(results, 'symbol', symbols, false);
|
|
5775
5781
|
}
|
|
5776
5782
|
async fetchPositions(symbols = undefined, params = {}) {
|
|
5777
5783
|
/**
|
package/js/src/cryptocom.d.ts
CHANGED
|
@@ -181,7 +181,7 @@ export default class cryptocom extends Exchange {
|
|
|
181
181
|
parseSettlements(settlements: any, market: any): any[];
|
|
182
182
|
fetchFundingRateHistory(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<FundingRateHistory[]>;
|
|
183
183
|
fetchPosition(symbol: string, params?: {}): Promise<import("./base/types.js").Position>;
|
|
184
|
-
fetchPositions(symbols?: string[], params?: {}): Promise<
|
|
184
|
+
fetchPositions(symbols?: string[], params?: {}): Promise<import("./base/types.js").Position[]>;
|
|
185
185
|
parsePosition(position: any, market?: any): import("./base/types.js").Position;
|
|
186
186
|
nonce(): number;
|
|
187
187
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
package/js/src/cryptocom.js
CHANGED
|
@@ -2956,7 +2956,7 @@ export default class cryptocom extends Exchange {
|
|
|
2956
2956
|
const marketInner = this.safeMarket(marketId, undefined, undefined, 'contract');
|
|
2957
2957
|
result.push(this.parsePosition(entry, marketInner));
|
|
2958
2958
|
}
|
|
2959
|
-
return this.
|
|
2959
|
+
return this.filterByArrayPositions(result, 'symbol', undefined, false);
|
|
2960
2960
|
}
|
|
2961
2961
|
parsePosition(position, market = undefined) {
|
|
2962
2962
|
//
|
package/js/src/delta.d.ts
CHANGED
|
@@ -74,61 +74,9 @@ export default class delta extends Exchange {
|
|
|
74
74
|
fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<import("./base/types.js").OHLCV[]>;
|
|
75
75
|
parseBalance(response: any): import("./base/types.js").Balances;
|
|
76
76
|
fetchBalance(params?: {}): Promise<import("./base/types.js").Balances>;
|
|
77
|
-
fetchPosition(symbol: string, params?: {}): Promise<
|
|
78
|
-
info: any;
|
|
79
|
-
id: any;
|
|
80
|
-
symbol: any;
|
|
81
|
-
notional: any;
|
|
82
|
-
marginMode: any;
|
|
83
|
-
liquidationPrice: number;
|
|
84
|
-
entryPrice: number;
|
|
85
|
-
unrealizedPnl: any;
|
|
86
|
-
percentage: any;
|
|
87
|
-
contracts: number;
|
|
88
|
-
contractSize: number;
|
|
89
|
-
markPrice: any;
|
|
90
|
-
side: any;
|
|
91
|
-
hedged: any;
|
|
92
|
-
timestamp: number;
|
|
93
|
-
datetime: string;
|
|
94
|
-
maintenanceMargin: any;
|
|
95
|
-
maintenanceMarginPercentage: any;
|
|
96
|
-
collateral: any;
|
|
97
|
-
initialMargin: any;
|
|
98
|
-
initialMarginPercentage: any;
|
|
99
|
-
leverage: any;
|
|
100
|
-
marginRatio: any;
|
|
101
|
-
stopLossPrice: any;
|
|
102
|
-
takeProfitPrice: any;
|
|
103
|
-
}>;
|
|
77
|
+
fetchPosition(symbol: string, params?: {}): Promise<import("./base/types.js").Position>;
|
|
104
78
|
fetchPositions(symbols?: string[], params?: {}): Promise<import("./base/types.js").Position[]>;
|
|
105
|
-
parsePosition(position: any, market?: any):
|
|
106
|
-
info: any;
|
|
107
|
-
id: any;
|
|
108
|
-
symbol: any;
|
|
109
|
-
notional: any;
|
|
110
|
-
marginMode: any;
|
|
111
|
-
liquidationPrice: number;
|
|
112
|
-
entryPrice: number;
|
|
113
|
-
unrealizedPnl: any;
|
|
114
|
-
percentage: any;
|
|
115
|
-
contracts: number;
|
|
116
|
-
contractSize: number;
|
|
117
|
-
markPrice: any;
|
|
118
|
-
side: any;
|
|
119
|
-
hedged: any;
|
|
120
|
-
timestamp: number;
|
|
121
|
-
datetime: string;
|
|
122
|
-
maintenanceMargin: any;
|
|
123
|
-
maintenanceMarginPercentage: any;
|
|
124
|
-
collateral: any;
|
|
125
|
-
initialMargin: any;
|
|
126
|
-
initialMarginPercentage: any;
|
|
127
|
-
leverage: any;
|
|
128
|
-
marginRatio: any;
|
|
129
|
-
stopLossPrice: any;
|
|
130
|
-
takeProfitPrice: any;
|
|
131
|
-
};
|
|
79
|
+
parsePosition(position: any, market?: any): import("./base/types.js").Position;
|
|
132
80
|
parseOrderStatus(status: any): string;
|
|
133
81
|
parseOrder(order: any, market?: any): import("./base/types.js").Order;
|
|
134
82
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: any, price?: any, params?: {}): Promise<import("./base/types.js").Order>;
|
package/js/src/delta.js
CHANGED
|
@@ -1675,7 +1675,7 @@ export default class delta extends Exchange {
|
|
|
1675
1675
|
side = 'sell';
|
|
1676
1676
|
}
|
|
1677
1677
|
}
|
|
1678
|
-
return {
|
|
1678
|
+
return this.safePosition({
|
|
1679
1679
|
'info': position,
|
|
1680
1680
|
'id': undefined,
|
|
1681
1681
|
'symbol': symbol,
|
|
@@ -1701,7 +1701,7 @@ export default class delta extends Exchange {
|
|
|
1701
1701
|
'marginRatio': undefined,
|
|
1702
1702
|
'stopLossPrice': undefined,
|
|
1703
1703
|
'takeProfitPrice': undefined,
|
|
1704
|
-
};
|
|
1704
|
+
});
|
|
1705
1705
|
}
|
|
1706
1706
|
parseOrderStatus(status) {
|
|
1707
1707
|
const statuses = {
|
package/js/src/huobi.d.ts
CHANGED
|
@@ -269,7 +269,7 @@ export default class huobi extends Exchange {
|
|
|
269
269
|
};
|
|
270
270
|
parsePosition(position: any, market?: any): import("./base/types.js").Position;
|
|
271
271
|
fetchPositions(symbols?: string[], params?: {}): Promise<import("./base/types.js").Position[]>;
|
|
272
|
-
fetchPosition(symbol: string, params?: {}): Promise<
|
|
272
|
+
fetchPosition(symbol: string, params?: {}): Promise<import("./base/types.js").Position>;
|
|
273
273
|
parseLedgerEntryType(type: any): string;
|
|
274
274
|
parseLedgerEntry(item: any, currency?: any): {
|
|
275
275
|
id: string;
|
package/js/src/huobi.js
CHANGED
|
@@ -7218,10 +7218,9 @@ export default class huobi extends Exchange {
|
|
|
7218
7218
|
}
|
|
7219
7219
|
const timestamp = this.safeInteger(response, 'ts');
|
|
7220
7220
|
const parsed = this.parsePosition(this.extend(position, omitted));
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
});
|
|
7221
|
+
parsed['timestamp'] = timestamp;
|
|
7222
|
+
parsed['datetime'] = this.iso8601(timestamp);
|
|
7223
|
+
return parsed;
|
|
7225
7224
|
}
|
|
7226
7225
|
parseLedgerEntryType(type) {
|
|
7227
7226
|
const types = {
|
package/js/src/mexc.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/mexc.js';
|
|
2
|
-
import { IndexType, Int, OrderSide, Balances, OrderType, OHLCV, FundingRateHistory } from './base/types.js';
|
|
2
|
+
import { IndexType, Int, OrderSide, Balances, OrderType, OHLCV, FundingRateHistory, Position } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class mexc
|
|
5
5
|
* @extends Exchange
|
|
@@ -141,9 +141,9 @@ export default class mexc extends Exchange {
|
|
|
141
141
|
fee: any;
|
|
142
142
|
};
|
|
143
143
|
parseTransactionStatusByType(status: any, type?: any): string;
|
|
144
|
-
fetchPosition(symbol: string, params?: {}): Promise<
|
|
145
|
-
fetchPositions(symbols?: string[], params?: {}): Promise<
|
|
146
|
-
parsePosition(position: any, market?: any):
|
|
144
|
+
fetchPosition(symbol: string, params?: {}): Promise<Position>;
|
|
145
|
+
fetchPositions(symbols?: string[], params?: {}): Promise<Position[]>;
|
|
146
|
+
parsePosition(position: any, market?: any): Position;
|
|
147
147
|
fetchTransfer(id: string, since?: Int, limit?: Int, params?: {}): Promise<{
|
|
148
148
|
info: any;
|
|
149
149
|
id: string;
|
package/js/src/okx.js
CHANGED
|
@@ -2115,6 +2115,7 @@ export default class okx extends Exchange {
|
|
|
2115
2115
|
}
|
|
2116
2116
|
}
|
|
2117
2117
|
else if (price === 'index') {
|
|
2118
|
+
request['instId'] = market['info']['instFamily']; // okx index candles require instFamily instead of instId
|
|
2118
2119
|
if (isHistoryCandles) {
|
|
2119
2120
|
response = await this.publicGetMarketHistoryIndexCandles(this.extend(request, params));
|
|
2120
2121
|
}
|
package/js/src/poloniex.js
CHANGED
package/js/src/whitebit.js
CHANGED
package/package.json
CHANGED