ccxt 4.2.89 → 4.2.91
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/CHANGELOG.md +44 -16
- package/README.md +3 -3
- package/build.sh +1 -1
- package/dist/ccxt.browser.js +1167 -274
- package/dist/ccxt.browser.min.js +6 -4
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ascendex.js +1 -0
- package/dist/cjs/src/base/Exchange.js +39 -9
- package/dist/cjs/src/base/functions/crypto.js +37 -0
- package/dist/cjs/src/base/functions/rsa.js +19 -4
- package/dist/cjs/src/binance.js +90 -9
- package/dist/cjs/src/bingx.js +101 -1
- package/dist/cjs/src/bitfinex2.js +1 -0
- package/dist/cjs/src/bitget.js +2 -0
- package/dist/cjs/src/bitmex.js +1 -0
- package/dist/cjs/src/bitrue.js +1 -0
- package/dist/cjs/src/bybit.js +61 -0
- package/dist/cjs/src/coinbase.js +51 -25
- package/dist/cjs/src/coinbaseinternational.js +1 -0
- package/dist/cjs/src/coinex.js +102 -8
- package/dist/cjs/src/cryptocom.js +1 -0
- package/dist/cjs/src/delta.js +1 -0
- package/dist/cjs/src/digifinex.js +1 -0
- package/dist/cjs/src/exmo.js +1 -0
- package/dist/cjs/src/gate.js +2 -0
- package/dist/cjs/src/gemini.js +12 -10
- package/dist/cjs/src/hitbtc.js +1 -0
- package/dist/cjs/src/htx.js +1 -0
- package/dist/cjs/src/hyperliquid.js +1 -0
- package/dist/cjs/src/kraken.js +11 -9
- package/dist/cjs/src/kucoin.js +1 -0
- package/dist/cjs/src/kucoinfutures.js +34 -3
- package/dist/cjs/src/mexc.js +1 -0
- package/dist/cjs/src/okx.js +187 -38
- package/dist/cjs/src/phemex.js +1 -0
- package/dist/cjs/src/pro/bitmex.js +39 -18
- package/dist/cjs/src/pro/kucoin.js +91 -0
- package/dist/cjs/src/pro/kucoinfutures.js +151 -82
- package/dist/cjs/src/static_dependencies/noble-curves/p256.js +48 -0
- package/dist/cjs/src/woo.js +1 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bingx.d.ts +2 -0
- package/js/src/abstract/bybit.d.ts +2 -0
- package/js/src/ascendex.js +1 -0
- package/js/src/base/Exchange.d.ts +5 -0
- package/js/src/base/Exchange.js +39 -9
- package/js/src/base/functions/crypto.js +37 -0
- package/js/src/base/functions/rsa.d.ts +1 -1
- package/js/src/base/functions/rsa.js +21 -5
- package/js/src/base/types.d.ts +1 -0
- package/js/src/binance.d.ts +1 -0
- package/js/src/binance.js +90 -9
- package/js/src/bingx.d.ts +1 -0
- package/js/src/bingx.js +101 -1
- package/js/src/bitfinex2.js +1 -0
- package/js/src/bitget.js +2 -0
- package/js/src/bitmex.js +1 -0
- package/js/src/bitrue.js +1 -0
- package/js/src/bybit.d.ts +2 -0
- package/js/src/bybit.js +61 -0
- package/js/src/coinbase.js +51 -25
- package/js/src/coinbaseinternational.js +1 -0
- package/js/src/coinex.d.ts +2 -0
- package/js/src/coinex.js +102 -8
- package/js/src/cryptocom.js +1 -0
- package/js/src/delta.js +1 -0
- package/js/src/digifinex.js +1 -0
- package/js/src/exmo.js +1 -0
- package/js/src/gate.js +2 -0
- package/js/src/gemini.js +12 -10
- package/js/src/hitbtc.js +1 -0
- package/js/src/htx.js +1 -0
- package/js/src/hyperliquid.js +1 -0
- package/js/src/kraken.js +11 -9
- package/js/src/kucoin.js +1 -0
- package/js/src/kucoinfutures.d.ts +2 -9
- package/js/src/kucoinfutures.js +34 -3
- package/js/src/mexc.js +1 -0
- package/js/src/okx.d.ts +1 -0
- package/js/src/okx.js +187 -38
- package/js/src/phemex.js +1 -0
- package/js/src/pro/bitmex.d.ts +1 -0
- package/js/src/pro/bitmex.js +39 -18
- package/js/src/pro/kucoin.d.ts +4 -0
- package/js/src/pro/kucoin.js +91 -0
- package/js/src/pro/kucoinfutures.d.ts +9 -5
- package/js/src/pro/kucoinfutures.js +151 -82
- package/js/src/woo.js +1 -0
- package/package.json +1 -1
|
@@ -79,6 +79,7 @@ export default class coinbaseinternational extends Exchange {
|
|
|
79
79
|
'fetchLedger': false,
|
|
80
80
|
'fetchLeverage': false,
|
|
81
81
|
'fetchLeverageTiers': false,
|
|
82
|
+
'fetchMarginAdjustmentHistory': false,
|
|
82
83
|
'fetchMarginMode': false,
|
|
83
84
|
'fetchMarkets': true,
|
|
84
85
|
'fetchMarkOHLCV': false,
|
package/js/src/coinex.d.ts
CHANGED
|
@@ -124,6 +124,7 @@ export default class coinex extends Exchange {
|
|
|
124
124
|
transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
|
|
125
125
|
parseTransferStatus(status: any): string;
|
|
126
126
|
parseTransfer(transfer: any, currency?: Currency): {
|
|
127
|
+
info: any;
|
|
127
128
|
id: number;
|
|
128
129
|
timestamp: number;
|
|
129
130
|
datetime: string;
|
|
@@ -197,4 +198,5 @@ export default class coinex extends Exchange {
|
|
|
197
198
|
headers: any;
|
|
198
199
|
};
|
|
199
200
|
handleErrors(httpCode: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
|
|
201
|
+
fetchMarginAdjustmentHistory(symbol?: Str, type?: Str, since?: Num, limit?: Num, params?: {}): Promise<MarginModification[]>;
|
|
200
202
|
}
|
package/js/src/coinex.js
CHANGED
|
@@ -83,6 +83,7 @@ export default class coinex extends Exchange {
|
|
|
83
83
|
'fetchLeverage': 'emulated',
|
|
84
84
|
'fetchLeverages': true,
|
|
85
85
|
'fetchLeverageTiers': true,
|
|
86
|
+
'fetchMarginAdjustmentHistory': true,
|
|
86
87
|
'fetchMarketLeverageTiers': 'emulated',
|
|
87
88
|
'fetchMarkets': true,
|
|
88
89
|
'fetchMarkOHLCV': false,
|
|
@@ -4242,11 +4243,10 @@ export default class coinex extends Exchange {
|
|
|
4242
4243
|
// "message":"OK"
|
|
4243
4244
|
// }
|
|
4244
4245
|
//
|
|
4246
|
+
const data = this.safeDict(response, 'data');
|
|
4245
4247
|
const status = this.safeString(response, 'message');
|
|
4246
|
-
|
|
4247
|
-
return this.extend(this.parseMarginModification(response, market), {
|
|
4248
|
+
return this.extend(this.parseMarginModification(data, market), {
|
|
4248
4249
|
'amount': this.parseNumber(amount),
|
|
4249
|
-
'type': type,
|
|
4250
4250
|
'status': status,
|
|
4251
4251
|
});
|
|
4252
4252
|
}
|
|
@@ -4306,13 +4306,34 @@ export default class coinex extends Exchange {
|
|
|
4306
4306
|
// "user_id": 3620173
|
|
4307
4307
|
// }
|
|
4308
4308
|
//
|
|
4309
|
-
|
|
4309
|
+
// fetchMarginAdjustmentHistory
|
|
4310
|
+
//
|
|
4311
|
+
// {
|
|
4312
|
+
// bkr_price: '0',
|
|
4313
|
+
// leverage: '3',
|
|
4314
|
+
// liq_price: '0',
|
|
4315
|
+
// margin_amount: '5.33236666666666666666',
|
|
4316
|
+
// margin_change: '3',
|
|
4317
|
+
// market: 'XRPUSDT',
|
|
4318
|
+
// position_amount: '11',
|
|
4319
|
+
// position_id: '297155652',
|
|
4320
|
+
// position_type: '2',
|
|
4321
|
+
// settle_price: '0.6361',
|
|
4322
|
+
// time: '1711050906.382891',
|
|
4323
|
+
// type: '1',
|
|
4324
|
+
// user_id: '3685860'
|
|
4325
|
+
// }
|
|
4326
|
+
//
|
|
4327
|
+
const marketId = this.safeString(data, 'market');
|
|
4328
|
+
const type = this.safeString(data, 'type');
|
|
4329
|
+
const timestamp = this.safeIntegerProduct2(data, 'time', 'update_time', 1000);
|
|
4310
4330
|
return {
|
|
4311
4331
|
'info': data,
|
|
4312
|
-
'symbol': this.safeSymbol(undefined,
|
|
4313
|
-
'type':
|
|
4314
|
-
'
|
|
4315
|
-
'
|
|
4332
|
+
'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
|
|
4333
|
+
'type': (type === '1') ? 'add' : 'reduce',
|
|
4334
|
+
'marginMode': 'isolated',
|
|
4335
|
+
'amount': this.safeNumber(data, 'margin_change'),
|
|
4336
|
+
'total': this.safeNumber(data, 'position_amount'),
|
|
4316
4337
|
'code': market['quote'],
|
|
4317
4338
|
'status': undefined,
|
|
4318
4339
|
'timestamp': timestamp,
|
|
@@ -4963,6 +4984,7 @@ export default class coinex extends Exchange {
|
|
|
4963
4984
|
const currencyId = this.safeString(transfer, 'asset');
|
|
4964
4985
|
const currencyCode = this.safeCurrencyCode(currencyId, currency);
|
|
4965
4986
|
return {
|
|
4987
|
+
'info': transfer,
|
|
4966
4988
|
'id': this.safeInteger(transfer, 'id'),
|
|
4967
4989
|
'timestamp': timestamp,
|
|
4968
4990
|
'datetime': this.iso8601(timestamp),
|
|
@@ -5795,4 +5817,76 @@ export default class coinex extends Exchange {
|
|
|
5795
5817
|
}
|
|
5796
5818
|
return undefined;
|
|
5797
5819
|
}
|
|
5820
|
+
async fetchMarginAdjustmentHistory(symbol = undefined, type = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5821
|
+
/**
|
|
5822
|
+
* @method
|
|
5823
|
+
* @name coinex#fetchMarginAdjustmentHistory
|
|
5824
|
+
* @description fetches the history of margin added or reduced from contract isolated positions
|
|
5825
|
+
* @see https://viabtc.github.io/coinex_api_en_doc/futures/#docsfutures001_http046_position_margin_history
|
|
5826
|
+
* @param {string} [symbol] unified market symbol
|
|
5827
|
+
* @param {string} [type] not used by coinex fetchMarginAdjustmentHistory
|
|
5828
|
+
* @param {int} [since] timestamp in ms of the earliest change to fetch
|
|
5829
|
+
* @param {int} [limit] the maximum amount of changes to fetch, default=100, max=100
|
|
5830
|
+
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
5831
|
+
* @param {int} [params.until] timestamp in ms of the latest change to fetch
|
|
5832
|
+
*
|
|
5833
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
5834
|
+
* @param {int} [params.offset] offset
|
|
5835
|
+
* @returns {object[]} a list of [margin structures]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
5836
|
+
*/
|
|
5837
|
+
await this.loadMarkets();
|
|
5838
|
+
const until = this.safeInteger(params, 'until');
|
|
5839
|
+
params = this.omit(params, 'until');
|
|
5840
|
+
if (limit === undefined) {
|
|
5841
|
+
limit = 100;
|
|
5842
|
+
}
|
|
5843
|
+
const request = {
|
|
5844
|
+
'market': '',
|
|
5845
|
+
'position_id': 0,
|
|
5846
|
+
'offset': 0,
|
|
5847
|
+
'limit': limit,
|
|
5848
|
+
};
|
|
5849
|
+
if (symbol !== undefined) {
|
|
5850
|
+
const market = this.market(symbol);
|
|
5851
|
+
request['market'] = market['id'];
|
|
5852
|
+
}
|
|
5853
|
+
if (since !== undefined) {
|
|
5854
|
+
request['start_time'] = since;
|
|
5855
|
+
}
|
|
5856
|
+
if (until !== undefined) {
|
|
5857
|
+
request['end_time'] = until;
|
|
5858
|
+
}
|
|
5859
|
+
const response = await this.v1PerpetualPrivateGetPositionMarginHistory(this.extend(request, params));
|
|
5860
|
+
//
|
|
5861
|
+
// {
|
|
5862
|
+
// code: '0',
|
|
5863
|
+
// data: {
|
|
5864
|
+
// limit: '100',
|
|
5865
|
+
// offset: '0',
|
|
5866
|
+
// records: [
|
|
5867
|
+
// {
|
|
5868
|
+
// bkr_price: '0',
|
|
5869
|
+
// leverage: '3',
|
|
5870
|
+
// liq_price: '0',
|
|
5871
|
+
// margin_amount: '5.33236666666666666666',
|
|
5872
|
+
// margin_change: '3',
|
|
5873
|
+
// market: 'XRPUSDT',
|
|
5874
|
+
// position_amount: '11',
|
|
5875
|
+
// position_id: '297155652',
|
|
5876
|
+
// position_type: '2',
|
|
5877
|
+
// settle_price: '0.6361',
|
|
5878
|
+
// time: '1711050906.382891',
|
|
5879
|
+
// type: '1',
|
|
5880
|
+
// user_id: '3685860'
|
|
5881
|
+
// }
|
|
5882
|
+
// ]
|
|
5883
|
+
// },
|
|
5884
|
+
// message: 'OK'
|
|
5885
|
+
// }
|
|
5886
|
+
//
|
|
5887
|
+
const data = this.safeDict(response, 'data', {});
|
|
5888
|
+
const records = this.safeList(data, 'records', []);
|
|
5889
|
+
const modifications = this.parseMarginModifications(records, undefined, 'market', 'swap');
|
|
5890
|
+
return this.filterBySymbolSinceLimit(modifications, symbol, since, limit);
|
|
5891
|
+
}
|
|
5798
5892
|
}
|
package/js/src/cryptocom.js
CHANGED
|
@@ -69,6 +69,7 @@ export default class cryptocom extends Exchange {
|
|
|
69
69
|
'fetchLedger': true,
|
|
70
70
|
'fetchLeverage': false,
|
|
71
71
|
'fetchLeverageTiers': false,
|
|
72
|
+
'fetchMarginAdjustmentHistory': false,
|
|
72
73
|
'fetchMarginMode': false,
|
|
73
74
|
'fetchMarketLeverageTiers': false,
|
|
74
75
|
'fetchMarkets': true,
|
package/js/src/delta.js
CHANGED
|
@@ -2668,6 +2668,7 @@ export default class delta extends Exchange {
|
|
|
2668
2668
|
'info': data,
|
|
2669
2669
|
'symbol': market['symbol'],
|
|
2670
2670
|
'type': undefined,
|
|
2671
|
+
'marginMode': 'isolated',
|
|
2671
2672
|
'amount': undefined,
|
|
2672
2673
|
'total': this.safeNumber(data, 'margin'),
|
|
2673
2674
|
'code': undefined,
|
package/js/src/digifinex.js
CHANGED
|
@@ -4165,6 +4165,7 @@ export default class digifinex extends Exchange {
|
|
|
4165
4165
|
'info': data,
|
|
4166
4166
|
'symbol': this.safeSymbol(marketId, market, undefined, 'swap'),
|
|
4167
4167
|
'type': (rawType === 1) ? 'add' : 'reduce',
|
|
4168
|
+
'marginMode': 'isolated',
|
|
4168
4169
|
'amount': this.safeNumber(data, 'amount'),
|
|
4169
4170
|
'total': undefined,
|
|
4170
4171
|
'code': market['settle'],
|
package/js/src/exmo.js
CHANGED
|
@@ -267,6 +267,7 @@ export default class exmo extends Exchange {
|
|
|
267
267
|
'info': data,
|
|
268
268
|
'symbol': this.safeSymbol(undefined, market),
|
|
269
269
|
'type': undefined,
|
|
270
|
+
'marginMode': 'isolated',
|
|
270
271
|
'amount': undefined,
|
|
271
272
|
'total': undefined,
|
|
272
273
|
'code': this.safeValue(market, 'quote'),
|
package/js/src/gate.js
CHANGED
|
@@ -123,6 +123,7 @@ export default class gate extends Exchange {
|
|
|
123
123
|
'fetchLeverages': true,
|
|
124
124
|
'fetchLeverageTiers': true,
|
|
125
125
|
'fetchLiquidations': true,
|
|
126
|
+
'fetchMarginAdjustmentHistory': false,
|
|
126
127
|
'fetchMarginMode': false,
|
|
127
128
|
'fetchMarketLeverageTiers': true,
|
|
128
129
|
'fetchMarkets': true,
|
|
@@ -6122,6 +6123,7 @@ export default class gate extends Exchange {
|
|
|
6122
6123
|
'info': data,
|
|
6123
6124
|
'symbol': market['symbol'],
|
|
6124
6125
|
'type': undefined,
|
|
6126
|
+
'marginMode': 'isolated',
|
|
6125
6127
|
'amount': undefined,
|
|
6126
6128
|
'total': total,
|
|
6127
6129
|
'code': this.safeValue(market, 'quote'),
|
package/js/src/gemini.js
CHANGED
|
@@ -110,6 +110,7 @@ export default class gemini extends Exchange {
|
|
|
110
110
|
// https://github.com/ccxt/ccxt/issues/7874
|
|
111
111
|
// https://github.com/ccxt/ccxt/issues/7894
|
|
112
112
|
'web': 'https://docs.gemini.com',
|
|
113
|
+
'webExchange': 'https://exchange.gemini.com',
|
|
113
114
|
},
|
|
114
115
|
'fees': [
|
|
115
116
|
'https://gemini.com/api-fee-schedule',
|
|
@@ -445,7 +446,8 @@ export default class gemini extends Exchange {
|
|
|
445
446
|
// '<td>0.01 USD', // quote currency price increment
|
|
446
447
|
// '</tr>'
|
|
447
448
|
// ]
|
|
448
|
-
|
|
449
|
+
let marketId = cells[0].replace('<td>', '');
|
|
450
|
+
marketId = marketId.replace('*', '');
|
|
449
451
|
// const base = this.safeCurrencyCode (baseId);
|
|
450
452
|
const minAmountString = cells[1].replace('<td>', '');
|
|
451
453
|
const minAmountParts = minAmountString.split(' ');
|
|
@@ -647,7 +649,7 @@ export default class gemini extends Exchange {
|
|
|
647
649
|
let quoteId = undefined;
|
|
648
650
|
let settleId = undefined;
|
|
649
651
|
let tickSize = undefined;
|
|
650
|
-
let
|
|
652
|
+
let amountPrecision = undefined;
|
|
651
653
|
let minSize = undefined;
|
|
652
654
|
let status = undefined;
|
|
653
655
|
let swap = false;
|
|
@@ -658,9 +660,9 @@ export default class gemini extends Exchange {
|
|
|
658
660
|
const isArray = (Array.isArray(response));
|
|
659
661
|
if (!isString && !isArray) {
|
|
660
662
|
marketId = this.safeStringLower(response, 'symbol');
|
|
663
|
+
amountPrecision = this.safeNumber(response, 'tick_size'); // right, exchange has an imperfect naming and this turns out to be an amount-precision
|
|
664
|
+
tickSize = this.safeNumber(response, 'quote_increment'); // this is tick-size actually
|
|
661
665
|
minSize = this.safeNumber(response, 'min_order_size');
|
|
662
|
-
tickSize = this.safeNumber(response, 'tick_size');
|
|
663
|
-
increment = this.safeNumber(response, 'quote_increment');
|
|
664
666
|
status = this.parseMarketActive(this.safeString(response, 'status'));
|
|
665
667
|
baseId = this.safeString(response, 'base_currency');
|
|
666
668
|
quoteId = this.safeString(response, 'quote_currency');
|
|
@@ -673,9 +675,9 @@ export default class gemini extends Exchange {
|
|
|
673
675
|
}
|
|
674
676
|
else {
|
|
675
677
|
marketId = this.safeStringLower(response, 0);
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
678
|
+
tickSize = this.parseNumber(this.parsePrecision(this.safeString(response, 1))); // priceTickDecimalPlaces
|
|
679
|
+
amountPrecision = this.parseNumber(this.parsePrecision(this.safeString(response, 2))); // quantityTickDecimalPlaces
|
|
680
|
+
minSize = this.safeNumber(response, 3); // quantityMinimum
|
|
679
681
|
}
|
|
680
682
|
const marketIdUpper = marketId.toUpperCase();
|
|
681
683
|
const isPerp = (marketIdUpper.indexOf('PERP') >= 0);
|
|
@@ -730,8 +732,8 @@ export default class gemini extends Exchange {
|
|
|
730
732
|
'strike': undefined,
|
|
731
733
|
'optionType': undefined,
|
|
732
734
|
'precision': {
|
|
733
|
-
'price':
|
|
734
|
-
'amount':
|
|
735
|
+
'price': tickSize,
|
|
736
|
+
'amount': amountPrecision,
|
|
735
737
|
},
|
|
736
738
|
'limits': {
|
|
737
739
|
'leverage': {
|
|
@@ -1805,7 +1807,7 @@ export default class gemini extends Exchange {
|
|
|
1805
1807
|
if (apiKey.indexOf('account') < 0) {
|
|
1806
1808
|
throw new AuthenticationError(this.id + ' sign() requires an account-key, master-keys are not-supported');
|
|
1807
1809
|
}
|
|
1808
|
-
const nonce = this.nonce();
|
|
1810
|
+
const nonce = this.nonce().toString();
|
|
1809
1811
|
const request = this.extend({
|
|
1810
1812
|
'request': url,
|
|
1811
1813
|
'nonce': nonce,
|
package/js/src/hitbtc.js
CHANGED
|
@@ -3324,6 +3324,7 @@ export default class hitbtc extends Exchange {
|
|
|
3324
3324
|
'info': data,
|
|
3325
3325
|
'symbol': market['symbol'],
|
|
3326
3326
|
'type': undefined,
|
|
3327
|
+
'marginMode': 'isolated',
|
|
3327
3328
|
'amount': undefined,
|
|
3328
3329
|
'total': undefined,
|
|
3329
3330
|
'code': this.safeString(currencyInfo, 'code'),
|
package/js/src/htx.js
CHANGED
|
@@ -87,6 +87,7 @@ export default class htx extends Exchange {
|
|
|
87
87
|
'fetchLeverage': false,
|
|
88
88
|
'fetchLeverageTiers': true,
|
|
89
89
|
'fetchLiquidations': true,
|
|
90
|
+
'fetchMarginAdjustmentHistory': false,
|
|
90
91
|
'fetchMarketLeverageTiers': true,
|
|
91
92
|
'fetchMarkets': true,
|
|
92
93
|
'fetchMarkOHLCV': true,
|
package/js/src/hyperliquid.js
CHANGED
|
@@ -2140,6 +2140,7 @@ export default class hyperliquid extends Exchange {
|
|
|
2140
2140
|
'info': data,
|
|
2141
2141
|
'symbol': this.safeSymbol(undefined, market),
|
|
2142
2142
|
'type': undefined,
|
|
2143
|
+
'marginMode': 'isolated',
|
|
2143
2144
|
'amount': undefined,
|
|
2144
2145
|
'total': undefined,
|
|
2145
2146
|
'code': this.safeString(market, 'settle'),
|
package/js/src/kraken.js
CHANGED
|
@@ -599,10 +599,7 @@ export default class kraken extends Exchange {
|
|
|
599
599
|
if (currencyId !== undefined) {
|
|
600
600
|
if (currencyId.length > 3) {
|
|
601
601
|
if ((currencyId.indexOf('X') === 0) || (currencyId.indexOf('Z') === 0)) {
|
|
602
|
-
if (currencyId.indexOf('.') > 0) {
|
|
603
|
-
return super.safeCurrency(currencyId, currency);
|
|
604
|
-
}
|
|
605
|
-
else {
|
|
602
|
+
if (!(currencyId.indexOf('.') > 0)) {
|
|
606
603
|
currencyId = currencyId.slice(1);
|
|
607
604
|
}
|
|
608
605
|
}
|
|
@@ -651,8 +648,13 @@ export default class kraken extends Exchange {
|
|
|
651
648
|
// {
|
|
652
649
|
// "error": [],
|
|
653
650
|
// "result": {
|
|
654
|
-
// "
|
|
655
|
-
//
|
|
651
|
+
// "BCH": {
|
|
652
|
+
// "aclass": "currency",
|
|
653
|
+
// "altname": "BCH",
|
|
654
|
+
// "decimals": 10,
|
|
655
|
+
// "display_decimals": 5
|
|
656
|
+
// "status": "enabled",
|
|
657
|
+
// },
|
|
656
658
|
// ...
|
|
657
659
|
// },
|
|
658
660
|
// }
|
|
@@ -667,15 +669,15 @@ export default class kraken extends Exchange {
|
|
|
667
669
|
// see: https://support.kraken.com/hc/en-us/articles/201893608-What-are-the-withdrawal-fees-
|
|
668
670
|
// to add support for multiple withdrawal/deposit methods and
|
|
669
671
|
// differentiated fees for each particular method
|
|
670
|
-
const code = this.safeCurrencyCode(
|
|
672
|
+
const code = this.safeCurrencyCode(id);
|
|
671
673
|
const precision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals')));
|
|
672
674
|
// assumes all currencies are active except those listed above
|
|
673
|
-
const active =
|
|
675
|
+
const active = this.safeString(currency, 'status') === 'enabled';
|
|
674
676
|
result[code] = {
|
|
675
677
|
'id': id,
|
|
676
678
|
'code': code,
|
|
677
679
|
'info': currency,
|
|
678
|
-
'name':
|
|
680
|
+
'name': this.safeString(currency, 'altname'),
|
|
679
681
|
'active': active,
|
|
680
682
|
'deposit': undefined,
|
|
681
683
|
'withdraw': undefined,
|
package/js/src/kucoin.js
CHANGED
|
@@ -76,6 +76,7 @@ export default class kucoin extends Exchange {
|
|
|
76
76
|
'fetchL3OrderBook': true,
|
|
77
77
|
'fetchLedger': true,
|
|
78
78
|
'fetchLeverageTiers': false,
|
|
79
|
+
'fetchMarginAdjustmentHistory': false,
|
|
79
80
|
'fetchMarginMode': false,
|
|
80
81
|
'fetchMarketLeverageTiers': false,
|
|
81
82
|
'fetchMarkets': true,
|
|
@@ -38,17 +38,10 @@ export default class kucoinfutures extends kucoin {
|
|
|
38
38
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
|
|
39
39
|
cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
|
|
40
40
|
addMargin(symbol: string, amount: any, params?: {}): Promise<MarginModification>;
|
|
41
|
-
parseMarginModification(info: any, market?: Market):
|
|
42
|
-
info: any;
|
|
43
|
-
direction: any;
|
|
44
|
-
mode: string;
|
|
45
|
-
amount: any;
|
|
46
|
-
code: string;
|
|
47
|
-
symbol: string;
|
|
48
|
-
status: any;
|
|
49
|
-
};
|
|
41
|
+
parseMarginModification(info: any, market?: Market): MarginModification;
|
|
50
42
|
fetchOrdersByStatus(status: any, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
51
43
|
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
44
|
+
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
52
45
|
fetchOrder(id?: Str, symbol?: Str, params?: {}): Promise<Order>;
|
|
53
46
|
parseOrder(order: any, market?: Market): Order;
|
|
54
47
|
fetchFundingRate(symbol: string, params?: {}): Promise<{
|
package/js/src/kucoinfutures.js
CHANGED
|
@@ -70,6 +70,7 @@ export default class kucoinfutures extends kucoin {
|
|
|
70
70
|
'fetchL3OrderBook': true,
|
|
71
71
|
'fetchLedger': true,
|
|
72
72
|
'fetchLeverageTiers': false,
|
|
73
|
+
'fetchMarginAdjustmentHistory': false,
|
|
73
74
|
'fetchMarginMode': false,
|
|
74
75
|
'fetchMarketLeverageTiers': true,
|
|
75
76
|
'fetchMarkets': true,
|
|
@@ -1616,14 +1617,18 @@ export default class kucoinfutures extends kucoin {
|
|
|
1616
1617
|
const crossMode = this.safeValue(info, 'crossMode');
|
|
1617
1618
|
const mode = crossMode ? 'cross' : 'isolated';
|
|
1618
1619
|
const marketId = this.safeString(market, 'symbol');
|
|
1620
|
+
const timestamp = this.safeInteger(info, 'currentTimestamp');
|
|
1619
1621
|
return {
|
|
1620
1622
|
'info': info,
|
|
1621
|
-
'
|
|
1622
|
-
'
|
|
1623
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
1624
|
+
'type': undefined,
|
|
1625
|
+
'marginMode': mode,
|
|
1623
1626
|
'amount': undefined,
|
|
1627
|
+
'total': undefined,
|
|
1624
1628
|
'code': this.safeCurrencyCode(currencyId),
|
|
1625
|
-
'symbol': this.safeSymbol(marketId, market),
|
|
1626
1629
|
'status': undefined,
|
|
1630
|
+
'timestamp': timestamp,
|
|
1631
|
+
'datetime': this.iso8601(timestamp),
|
|
1627
1632
|
};
|
|
1628
1633
|
}
|
|
1629
1634
|
async fetchOrdersByStatus(status, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -1764,6 +1769,32 @@ export default class kucoinfutures extends kucoin {
|
|
|
1764
1769
|
}
|
|
1765
1770
|
return await this.fetchOrdersByStatus('done', symbol, since, limit, params);
|
|
1766
1771
|
}
|
|
1772
|
+
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1773
|
+
/**
|
|
1774
|
+
* @method
|
|
1775
|
+
* @name kucoinfutures#fetchOpenOrders
|
|
1776
|
+
* @description fetches information on multiple open orders made by the user
|
|
1777
|
+
* @see https://docs.kucoin.com/futures/#get-order-list
|
|
1778
|
+
* @see https://docs.kucoin.com/futures/#get-untriggered-stop-order-list
|
|
1779
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1780
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1781
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
1782
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1783
|
+
* @param {int} [params.till] end time in ms
|
|
1784
|
+
* @param {string} [params.side] buy or sell
|
|
1785
|
+
* @param {string} [params.type] limit, or market
|
|
1786
|
+
* @param {boolean} [params.trigger] set to true to retrieve untriggered stop orders
|
|
1787
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
1788
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1789
|
+
*/
|
|
1790
|
+
await this.loadMarkets();
|
|
1791
|
+
let paginate = false;
|
|
1792
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'paginate');
|
|
1793
|
+
if (paginate) {
|
|
1794
|
+
return await this.fetchPaginatedCallDynamic('fetchOpenOrders', symbol, since, limit, params);
|
|
1795
|
+
}
|
|
1796
|
+
return await this.fetchOrdersByStatus('open', symbol, since, limit, params);
|
|
1797
|
+
}
|
|
1767
1798
|
async fetchOrder(id = undefined, symbol = undefined, params = {}) {
|
|
1768
1799
|
/**
|
|
1769
1800
|
* @method
|
package/js/src/mexc.js
CHANGED
|
@@ -78,6 +78,7 @@ export default class mexc extends Exchange {
|
|
|
78
78
|
'fetchLeverage': true,
|
|
79
79
|
'fetchLeverages': false,
|
|
80
80
|
'fetchLeverageTiers': true,
|
|
81
|
+
'fetchMarginAdjustmentHistory': false,
|
|
81
82
|
'fetchMarginMode': false,
|
|
82
83
|
'fetchMarketLeverageTiers': undefined,
|
|
83
84
|
'fetchMarkets': true,
|
package/js/src/okx.d.ts
CHANGED
|
@@ -298,4 +298,5 @@ export default class okx extends Exchange {
|
|
|
298
298
|
quoteVolume: any;
|
|
299
299
|
};
|
|
300
300
|
handleErrors(httpCode: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
|
|
301
|
+
fetchMarginAdjustmentHistory(symbol?: Str, type?: Str, since?: Num, limit?: Num, params?: {}): Promise<MarginModification[]>;
|
|
301
302
|
}
|