ccxt 4.1.13 → 4.1.14
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 +219 -0
- package/CONTRIBUTING.md +1 -0
- package/README.md +3 -3
- package/dist/ccxt.browser.js +296 -106
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ascendex.js +1 -0
- package/dist/cjs/src/binance.js +6 -2
- package/dist/cjs/src/bingx.js +4 -2
- package/dist/cjs/src/bitget.js +192 -1
- package/dist/cjs/src/bitmart.js +2 -0
- package/dist/cjs/src/bittrex.js +6 -0
- package/dist/cjs/src/cex.js +1 -0
- package/dist/cjs/src/coinbase.js +1 -0
- package/dist/cjs/src/coinbasepro.js +1 -0
- package/dist/cjs/src/coinex.js +2 -0
- package/dist/cjs/src/coinfalcon.js +1 -0
- package/dist/cjs/src/coinmate.js +1 -0
- package/dist/cjs/src/coinone.js +2 -1
- package/dist/cjs/src/cryptocom.js +25 -87
- package/dist/cjs/src/currencycom.js +1 -0
- package/dist/cjs/src/delta.js +1 -0
- package/dist/cjs/src/deribit.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 +3 -0
- package/dist/cjs/src/gemini.js +1 -0
- package/dist/cjs/src/hitbtc.js +1 -0
- package/dist/cjs/src/hollaex.js +1 -0
- package/dist/cjs/src/huobijp.js +1 -0
- package/dist/cjs/src/idex.js +1 -0
- package/dist/cjs/src/independentreserve.js +1 -0
- package/dist/cjs/src/indodax.js +1 -0
- package/dist/cjs/src/kraken.js +9 -0
- package/dist/cjs/src/krakenfutures.js +1 -0
- package/dist/cjs/src/latoken.js +1 -0
- package/dist/cjs/src/poloniex.js +1 -0
- package/dist/cjs/src/poloniexfutures.js +8 -2
- package/dist/cjs/src/pro/krakenfutures.js +14 -10
- 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/binance.d.ts +4 -0
- package/js/src/abstract/binancecoinm.d.ts +4 -0
- package/js/src/abstract/binanceus.d.ts +4 -0
- package/js/src/abstract/binanceusdm.d.ts +4 -0
- package/js/src/abstract/kraken.d.ts +8 -0
- package/js/src/abstract/poloniexfutures.d.ts +6 -1
- package/js/src/ascendex.js +1 -0
- package/js/src/binance.js +6 -2
- package/js/src/bingx.js +4 -2
- package/js/src/bitget.d.ts +28 -0
- package/js/src/bitget.js +192 -1
- package/js/src/bitmart.js +2 -0
- package/js/src/bittrex.d.ts +2 -2
- package/js/src/bittrex.js +6 -0
- package/js/src/cex.js +1 -0
- package/js/src/coinbase.js +1 -0
- package/js/src/coinbasepro.js +1 -0
- package/js/src/coinex.js +2 -0
- package/js/src/coinfalcon.js +1 -0
- package/js/src/coinmate.js +1 -0
- package/js/src/coinone.js +2 -1
- package/js/src/cryptocom.d.ts +0 -2
- package/js/src/cryptocom.js +25 -87
- package/js/src/currencycom.js +1 -0
- package/js/src/delta.js +1 -0
- package/js/src/deribit.js +1 -0
- package/js/src/digifinex.js +1 -0
- package/js/src/exmo.js +1 -0
- package/js/src/gate.d.ts +1 -0
- package/js/src/gate.js +3 -0
- package/js/src/gemini.d.ts +1 -0
- package/js/src/gemini.js +1 -0
- package/js/src/hitbtc.js +1 -0
- package/js/src/hollaex.js +1 -0
- package/js/src/huobijp.js +1 -0
- package/js/src/idex.js +1 -0
- package/js/src/independentreserve.js +1 -0
- package/js/src/indodax.js +1 -0
- package/js/src/kraken.js +9 -0
- package/js/src/krakenfutures.js +1 -0
- package/js/src/latoken.js +1 -0
- package/js/src/poloniex.js +1 -0
- package/js/src/poloniexfutures.js +8 -2
- package/js/src/pro/krakenfutures.js +14 -10
- package/js/src/woo.js +1 -0
- package/package.json +1 -1
- package/skip-tests.json +33 -7
package/dist/cjs/ccxt.js
CHANGED
|
@@ -180,7 +180,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
180
180
|
|
|
181
181
|
//-----------------------------------------------------------------------------
|
|
182
182
|
// this is updated by vss.js when building
|
|
183
|
-
const version = '4.1.
|
|
183
|
+
const version = '4.1.14';
|
|
184
184
|
Exchange["default"].ccxtVersion = version;
|
|
185
185
|
const exchanges = {
|
|
186
186
|
'ace': ace,
|
package/dist/cjs/src/ascendex.js
CHANGED
package/dist/cjs/src/binance.js
CHANGED
|
@@ -247,7 +247,8 @@ class binance extends binance$1 {
|
|
|
247
247
|
'margin/exchange-small-liability-history': 0.6667,
|
|
248
248
|
'margin/next-hourly-interest-rate': 0.6667,
|
|
249
249
|
'margin/capital-flow': 10,
|
|
250
|
-
'margin/delist-schedule':
|
|
250
|
+
'margin/delist-schedule': 10,
|
|
251
|
+
'margin/available-inventory': 0.3334,
|
|
251
252
|
'loan/vip/loanable/data': 40,
|
|
252
253
|
'loan/vip/collateral/data': 40,
|
|
253
254
|
'loan/vip/request/data': 2.6668,
|
|
@@ -638,7 +639,8 @@ class binance extends binance$1 {
|
|
|
638
639
|
'premiumIndexKlines': { 'cost': 1, 'byLimit': [[99, 1], [499, 2], [1000, 5], [10000, 10]] },
|
|
639
640
|
'ticker/24hr': { 'cost': 1, 'noSymbol': 40 },
|
|
640
641
|
'ticker/price': { 'cost': 1, 'noSymbol': 2 },
|
|
641
|
-
'ticker/bookTicker': { 'cost':
|
|
642
|
+
'ticker/bookTicker': { 'cost': 2, 'noSymbol': 5 },
|
|
643
|
+
'constituents': 2,
|
|
642
644
|
'openInterest': 1,
|
|
643
645
|
},
|
|
644
646
|
},
|
|
@@ -723,6 +725,8 @@ class binance extends binance$1 {
|
|
|
723
725
|
'ticker/bookTicker': { 'cost': 1, 'noSymbol': 2 },
|
|
724
726
|
'openInterest': 1,
|
|
725
727
|
'indexInfo': 1,
|
|
728
|
+
'assetIndex': { 'cost': 1, 'noSymbol': 10 },
|
|
729
|
+
'constituents': 2,
|
|
726
730
|
'apiTradingStatus': { 'cost': 1, 'noSymbol': 10 },
|
|
727
731
|
'lvtKlines': 1,
|
|
728
732
|
},
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -2697,8 +2697,10 @@ class bingx extends bingx$1 {
|
|
|
2697
2697
|
const network = this.safeString(transaction, 'network');
|
|
2698
2698
|
const currencyId = this.safeString(transaction, 'coin');
|
|
2699
2699
|
let code = this.safeCurrencyCode(currencyId, currency);
|
|
2700
|
-
if (code !== undefined && code.indexOf(network) >= 0) {
|
|
2701
|
-
|
|
2700
|
+
if ((code !== undefined) && (code !== network) && code.indexOf(network) >= 0) {
|
|
2701
|
+
if (network !== undefined) {
|
|
2702
|
+
code = code.replace(network, '');
|
|
2703
|
+
}
|
|
2702
2704
|
}
|
|
2703
2705
|
const rawType = this.safeString(transaction, 'transferType');
|
|
2704
2706
|
const type = (rawType === '0') ? 'deposit' : 'withdrawal';
|
package/dist/cjs/src/bitget.js
CHANGED
|
@@ -25,11 +25,12 @@ class bitget extends bitget$1 {
|
|
|
25
25
|
'has': {
|
|
26
26
|
'CORS': undefined,
|
|
27
27
|
'spot': true,
|
|
28
|
-
'margin':
|
|
28
|
+
'margin': undefined,
|
|
29
29
|
'swap': true,
|
|
30
30
|
'future': true,
|
|
31
31
|
'option': false,
|
|
32
32
|
'addMargin': true,
|
|
33
|
+
'borrowMargin': true,
|
|
33
34
|
'cancelAllOrders': true,
|
|
34
35
|
'cancelOrder': true,
|
|
35
36
|
'cancelOrders': true,
|
|
@@ -88,6 +89,7 @@ class bitget extends bitget$1 {
|
|
|
88
89
|
'fetchWithdrawal': false,
|
|
89
90
|
'fetchWithdrawals': true,
|
|
90
91
|
'reduceMargin': true,
|
|
92
|
+
'repayMargin': true,
|
|
91
93
|
'setLeverage': true,
|
|
92
94
|
'setMarginMode': true,
|
|
93
95
|
'setPositionMode': true,
|
|
@@ -1292,6 +1294,7 @@ class bitget extends bitget$1 {
|
|
|
1292
1294
|
'max': undefined,
|
|
1293
1295
|
},
|
|
1294
1296
|
},
|
|
1297
|
+
'created': undefined,
|
|
1295
1298
|
'info': market,
|
|
1296
1299
|
};
|
|
1297
1300
|
}
|
|
@@ -5198,6 +5201,194 @@ class bitget extends bitget$1 {
|
|
|
5198
5201
|
'info': interest,
|
|
5199
5202
|
}, market);
|
|
5200
5203
|
}
|
|
5204
|
+
async borrowMargin(code, amount, symbol = undefined, params = {}) {
|
|
5205
|
+
/**
|
|
5206
|
+
* @method
|
|
5207
|
+
* @name bitget#borrowMargin
|
|
5208
|
+
* @description create a loan to borrow margin
|
|
5209
|
+
* @see https://bitgetlimited.github.io/apidoc/en/margin/#cross-borrow
|
|
5210
|
+
* @see https://bitgetlimited.github.io/apidoc/en/margin/#isolated-borrow
|
|
5211
|
+
* @param {string} code unified currency code of the currency to borrow
|
|
5212
|
+
* @param {string} amount the amount to borrow
|
|
5213
|
+
* @param {string} [symbol] unified market symbol
|
|
5214
|
+
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
5215
|
+
* @param {string} [params.marginMode] 'isolated' or 'cross', symbol is required for 'isolated'
|
|
5216
|
+
* @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
|
|
5217
|
+
*/
|
|
5218
|
+
await this.loadMarkets();
|
|
5219
|
+
const currency = this.currency(code);
|
|
5220
|
+
const request = {
|
|
5221
|
+
'coin': currency['info']['coinName'],
|
|
5222
|
+
'borrowAmount': this.currencyToPrecision(code, amount),
|
|
5223
|
+
};
|
|
5224
|
+
let response = undefined;
|
|
5225
|
+
let marginMode = undefined;
|
|
5226
|
+
[marginMode, params] = this.handleMarginModeAndParams('borrowMargin', params);
|
|
5227
|
+
if ((symbol !== undefined) || (marginMode === 'isolated')) {
|
|
5228
|
+
this.checkRequiredSymbol('borrowMargin', symbol);
|
|
5229
|
+
const market = this.market(symbol);
|
|
5230
|
+
const marketId = market['id'];
|
|
5231
|
+
const parts = marketId.split('_');
|
|
5232
|
+
const marginMarketId = this.safeStringUpper(parts, 0);
|
|
5233
|
+
request['symbol'] = marginMarketId;
|
|
5234
|
+
response = await this.privateMarginPostIsolatedAccountBorrow(this.extend(request, params));
|
|
5235
|
+
}
|
|
5236
|
+
else {
|
|
5237
|
+
response = await this.privateMarginPostCrossAccountBorrow(this.extend(request, params));
|
|
5238
|
+
}
|
|
5239
|
+
//
|
|
5240
|
+
// isolated
|
|
5241
|
+
//
|
|
5242
|
+
// {
|
|
5243
|
+
// "code": "00000",
|
|
5244
|
+
// "msg": "success",
|
|
5245
|
+
// "requestTime": 1697250952516,
|
|
5246
|
+
// "data": {
|
|
5247
|
+
// "clientOid": null,
|
|
5248
|
+
// "symbol": "BTCUSDT",
|
|
5249
|
+
// "coin": "BTC",
|
|
5250
|
+
// "borrowAmount": "0.001"
|
|
5251
|
+
// }
|
|
5252
|
+
// }
|
|
5253
|
+
//
|
|
5254
|
+
// cross
|
|
5255
|
+
//
|
|
5256
|
+
// {
|
|
5257
|
+
// "code": "00000",
|
|
5258
|
+
// "msg": "success",
|
|
5259
|
+
// "requestTime": 1697251314271,
|
|
5260
|
+
// "data": {
|
|
5261
|
+
// "clientOid": null,
|
|
5262
|
+
// "coin": "BTC",
|
|
5263
|
+
// "borrowAmount": "0.0001"
|
|
5264
|
+
// }
|
|
5265
|
+
// }
|
|
5266
|
+
//
|
|
5267
|
+
const data = this.safeValue(response, 'data', {});
|
|
5268
|
+
return this.parseMarginLoan(data, currency);
|
|
5269
|
+
}
|
|
5270
|
+
async repayMargin(code, amount, symbol = undefined, params = {}) {
|
|
5271
|
+
/**
|
|
5272
|
+
* @method
|
|
5273
|
+
* @name bitget#repayMargin
|
|
5274
|
+
* @description repay borrowed margin and interest
|
|
5275
|
+
* @see https://bitgetlimited.github.io/apidoc/en/margin/#cross-repay
|
|
5276
|
+
* @see https://bitgetlimited.github.io/apidoc/en/margin/#isolated-repay
|
|
5277
|
+
* @param {string} code unified currency code of the currency to repay
|
|
5278
|
+
* @param {string} amount the amount to repay
|
|
5279
|
+
* @param {string} [symbol] unified market symbol
|
|
5280
|
+
* @param {object} [params] extra parameters specific to the bitget api endpoint
|
|
5281
|
+
* @param {string} [params.marginMode] 'isolated' or 'cross', symbol is required for 'isolated'
|
|
5282
|
+
* @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
|
|
5283
|
+
*/
|
|
5284
|
+
await this.loadMarkets();
|
|
5285
|
+
const currency = this.currency(code);
|
|
5286
|
+
const request = {
|
|
5287
|
+
'coin': currency['info']['coinName'],
|
|
5288
|
+
'repayAmount': this.currencyToPrecision(code, amount),
|
|
5289
|
+
};
|
|
5290
|
+
let response = undefined;
|
|
5291
|
+
let marginMode = undefined;
|
|
5292
|
+
[marginMode, params] = this.handleMarginModeAndParams('repayMargin', params);
|
|
5293
|
+
if ((symbol !== undefined) || (marginMode === 'isolated')) {
|
|
5294
|
+
this.checkRequiredSymbol('repayMargin', symbol);
|
|
5295
|
+
const market = this.market(symbol);
|
|
5296
|
+
const marketId = market['id'];
|
|
5297
|
+
const parts = marketId.split('_');
|
|
5298
|
+
const marginMarketId = this.safeStringUpper(parts, 0);
|
|
5299
|
+
request['symbol'] = marginMarketId;
|
|
5300
|
+
response = await this.privateMarginPostIsolatedAccountRepay(this.extend(request, params));
|
|
5301
|
+
}
|
|
5302
|
+
else {
|
|
5303
|
+
response = await this.privateMarginPostCrossAccountRepay(this.extend(request, params));
|
|
5304
|
+
}
|
|
5305
|
+
//
|
|
5306
|
+
// isolated
|
|
5307
|
+
//
|
|
5308
|
+
// {
|
|
5309
|
+
// "code": "00000",
|
|
5310
|
+
// "msg": "success",
|
|
5311
|
+
// "requestTime": 1697251988593,
|
|
5312
|
+
// "data": {
|
|
5313
|
+
// "remainDebtAmount": "0",
|
|
5314
|
+
// "clientOid": null,
|
|
5315
|
+
// "symbol": "BTCUSDT",
|
|
5316
|
+
// "coin": "BTC",
|
|
5317
|
+
// "repayAmount": "0.00100001"
|
|
5318
|
+
// }
|
|
5319
|
+
// }
|
|
5320
|
+
//
|
|
5321
|
+
// cross
|
|
5322
|
+
//
|
|
5323
|
+
// {
|
|
5324
|
+
// "code": "00000",
|
|
5325
|
+
// "msg": "success",
|
|
5326
|
+
// "requestTime": 1697252151042,
|
|
5327
|
+
// "data": {
|
|
5328
|
+
// "remainDebtAmount": "0",
|
|
5329
|
+
// "clientOid": null,
|
|
5330
|
+
// "coin": "BTC",
|
|
5331
|
+
// "repayAmount": "0.00010001"
|
|
5332
|
+
// }
|
|
5333
|
+
// }
|
|
5334
|
+
//
|
|
5335
|
+
const data = this.safeValue(response, 'data', {});
|
|
5336
|
+
return this.parseMarginLoan(data, currency);
|
|
5337
|
+
}
|
|
5338
|
+
parseMarginLoan(info, currency = undefined) {
|
|
5339
|
+
//
|
|
5340
|
+
// isolated: borrowMargin
|
|
5341
|
+
//
|
|
5342
|
+
// {
|
|
5343
|
+
// "clientOid": null,
|
|
5344
|
+
// "symbol": "BTCUSDT",
|
|
5345
|
+
// "coin": "BTC",
|
|
5346
|
+
// "borrowAmount": "0.001"
|
|
5347
|
+
// }
|
|
5348
|
+
//
|
|
5349
|
+
// cross: borrowMargin
|
|
5350
|
+
//
|
|
5351
|
+
// {
|
|
5352
|
+
// "clientOid": null,
|
|
5353
|
+
// "coin": "BTC",
|
|
5354
|
+
// "borrowAmount": "0.0001"
|
|
5355
|
+
// }
|
|
5356
|
+
//
|
|
5357
|
+
// isolated: repayMargin
|
|
5358
|
+
//
|
|
5359
|
+
// {
|
|
5360
|
+
// "remainDebtAmount": "0",
|
|
5361
|
+
// "clientOid": null,
|
|
5362
|
+
// "symbol": "BTCUSDT",
|
|
5363
|
+
// "coin": "BTC",
|
|
5364
|
+
// "repayAmount": "0.00100001"
|
|
5365
|
+
// }
|
|
5366
|
+
//
|
|
5367
|
+
// cross: repayMargin
|
|
5368
|
+
//
|
|
5369
|
+
// {
|
|
5370
|
+
// "remainDebtAmount": "0",
|
|
5371
|
+
// "clientOid": null,
|
|
5372
|
+
// "coin": "BTC",
|
|
5373
|
+
// "repayAmount": "0.00010001"
|
|
5374
|
+
// }
|
|
5375
|
+
//
|
|
5376
|
+
const currencyId = this.safeString(info, 'coin');
|
|
5377
|
+
const marketId = this.safeString(info, 'symbol');
|
|
5378
|
+
let symbol = undefined;
|
|
5379
|
+
if (marketId !== undefined) {
|
|
5380
|
+
symbol = this.safeSymbol(marketId);
|
|
5381
|
+
}
|
|
5382
|
+
return {
|
|
5383
|
+
'id': this.safeString(info, 'clientOid'),
|
|
5384
|
+
'currency': this.safeCurrencyCode(currencyId, currency),
|
|
5385
|
+
'amount': this.safeNumber2(info, 'borrowAmount', 'repayAmount'),
|
|
5386
|
+
'symbol': symbol,
|
|
5387
|
+
'timestamp': undefined,
|
|
5388
|
+
'datetime': undefined,
|
|
5389
|
+
'info': info,
|
|
5390
|
+
};
|
|
5391
|
+
}
|
|
5201
5392
|
handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
|
|
5202
5393
|
if (!response) {
|
|
5203
5394
|
return undefined; // fallback to default error handler
|
package/dist/cjs/src/bitmart.js
CHANGED
|
@@ -757,6 +757,7 @@ class bitmart extends bitmart$1 {
|
|
|
757
757
|
'max': undefined,
|
|
758
758
|
},
|
|
759
759
|
},
|
|
760
|
+
'created': undefined,
|
|
760
761
|
'info': market,
|
|
761
762
|
});
|
|
762
763
|
}
|
|
@@ -863,6 +864,7 @@ class bitmart extends bitmart$1 {
|
|
|
863
864
|
'max': undefined,
|
|
864
865
|
},
|
|
865
866
|
},
|
|
867
|
+
'created': this.safeInteger(market, 'open_timestamp'),
|
|
866
868
|
'info': market,
|
|
867
869
|
});
|
|
868
870
|
}
|
package/dist/cjs/src/bittrex.js
CHANGED
|
@@ -905,8 +905,14 @@ class bittrex extends bittrex$1 {
|
|
|
905
905
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
906
906
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
907
907
|
* @param {object} [params] extra parameters specific to the bittrex api endpoint
|
|
908
|
+
* @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)
|
|
908
909
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
909
910
|
*/
|
|
911
|
+
let paginate = false;
|
|
912
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate', false);
|
|
913
|
+
if (paginate) {
|
|
914
|
+
return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 1440);
|
|
915
|
+
}
|
|
910
916
|
await this.loadMarkets();
|
|
911
917
|
const market = this.market(symbol);
|
|
912
918
|
const reverseId = market['baseId'] + '-' + market['quoteId'];
|
package/dist/cjs/src/cex.js
CHANGED
package/dist/cjs/src/coinbase.js
CHANGED
package/dist/cjs/src/coinex.js
CHANGED
|
@@ -533,6 +533,7 @@ class coinex extends coinex$1 {
|
|
|
533
533
|
'max': undefined,
|
|
534
534
|
},
|
|
535
535
|
},
|
|
536
|
+
'created': undefined,
|
|
536
537
|
'info': market,
|
|
537
538
|
});
|
|
538
539
|
}
|
|
@@ -629,6 +630,7 @@ class coinex extends coinex$1 {
|
|
|
629
630
|
'max': undefined,
|
|
630
631
|
},
|
|
631
632
|
},
|
|
633
|
+
'created': undefined,
|
|
632
634
|
'info': entry,
|
|
633
635
|
});
|
|
634
636
|
}
|
package/dist/cjs/src/coinmate.js
CHANGED
package/dist/cjs/src/coinone.js
CHANGED
|
@@ -229,6 +229,7 @@ class coinone extends coinone$1 {
|
|
|
229
229
|
'max': undefined,
|
|
230
230
|
},
|
|
231
231
|
},
|
|
232
|
+
'created': undefined,
|
|
232
233
|
'info': ticker,
|
|
233
234
|
});
|
|
234
235
|
}
|
|
@@ -886,7 +887,7 @@ class coinone extends coinone$1 {
|
|
|
886
887
|
const payload = this.stringToBase64(json);
|
|
887
888
|
body = payload;
|
|
888
889
|
const secret = this.secret.toUpperCase();
|
|
889
|
-
const signature = this.hmac(payload, this.encode(secret), sha512.sha512);
|
|
890
|
+
const signature = this.hmac(this.encode(payload), this.encode(secret), sha512.sha512);
|
|
890
891
|
headers = {
|
|
891
892
|
'Content-Type': 'application/json',
|
|
892
893
|
'X-COINONE-PAYLOAD': payload,
|
|
@@ -36,11 +36,11 @@ class cryptocom extends cryptocom$1 {
|
|
|
36
36
|
'fetchAccounts': true,
|
|
37
37
|
'fetchBalance': true,
|
|
38
38
|
'fetchBidsAsks': false,
|
|
39
|
-
'fetchBorrowInterest':
|
|
39
|
+
'fetchBorrowInterest': false,
|
|
40
40
|
'fetchBorrowRate': false,
|
|
41
41
|
'fetchBorrowRateHistories': false,
|
|
42
42
|
'fetchBorrowRateHistory': false,
|
|
43
|
-
'fetchBorrowRates':
|
|
43
|
+
'fetchBorrowRates': false,
|
|
44
44
|
'fetchClosedOrders': 'emulated',
|
|
45
45
|
'fetchCurrencies': false,
|
|
46
46
|
'fetchDepositAddress': true,
|
|
@@ -334,6 +334,7 @@ class cryptocom extends cryptocom$1 {
|
|
|
334
334
|
'precisionMode': number.TICK_SIZE,
|
|
335
335
|
'exceptions': {
|
|
336
336
|
'exact': {
|
|
337
|
+
'219': errors.InvalidOrder,
|
|
337
338
|
'10001': errors.ExchangeError,
|
|
338
339
|
'10002': errors.PermissionDenied,
|
|
339
340
|
'10003': errors.PermissionDenied,
|
|
@@ -563,6 +564,7 @@ class cryptocom extends cryptocom$1 {
|
|
|
563
564
|
'max': undefined,
|
|
564
565
|
},
|
|
565
566
|
},
|
|
567
|
+
'created': undefined,
|
|
566
568
|
'info': market,
|
|
567
569
|
});
|
|
568
570
|
}
|
|
@@ -1055,7 +1057,7 @@ class cryptocom extends cryptocom$1 {
|
|
|
1055
1057
|
}
|
|
1056
1058
|
const postOnly = this.safeValue(params, 'postOnly', false);
|
|
1057
1059
|
if ((postOnly) || (timeInForce === 'PO')) {
|
|
1058
|
-
request['exec_inst'] = 'POST_ONLY';
|
|
1060
|
+
request['exec_inst'] = ['POST_ONLY'];
|
|
1059
1061
|
request['time_in_force'] = 'GOOD_TILL_CANCEL';
|
|
1060
1062
|
}
|
|
1061
1063
|
const triggerPrice = this.safeStringN(params, ['stopPrice', 'triggerPrice', 'ref_price']);
|
|
@@ -1863,8 +1865,8 @@ class cryptocom extends cryptocom$1 {
|
|
|
1863
1865
|
'close': last,
|
|
1864
1866
|
'last': last,
|
|
1865
1867
|
'previousClose': undefined,
|
|
1866
|
-
'change':
|
|
1867
|
-
'percentage':
|
|
1868
|
+
'change': undefined,
|
|
1869
|
+
'percentage': this.safeString(ticker, 'c'),
|
|
1868
1870
|
'average': undefined,
|
|
1869
1871
|
'baseVolume': this.safeString(ticker, 'v'),
|
|
1870
1872
|
'quoteVolume': this.safeString(ticker, 'vv'),
|
|
@@ -2008,10 +2010,16 @@ class cryptocom extends cryptocom$1 {
|
|
|
2008
2010
|
const created = this.safeInteger(order, 'create_time');
|
|
2009
2011
|
const marketId = this.safeString(order, 'instrument_name');
|
|
2010
2012
|
const symbol = this.safeSymbol(marketId, market);
|
|
2011
|
-
const execInst = this.
|
|
2012
|
-
let postOnly =
|
|
2013
|
+
const execInst = this.safeValue(order, 'exec_inst');
|
|
2014
|
+
let postOnly = false;
|
|
2013
2015
|
if (execInst !== undefined) {
|
|
2014
|
-
|
|
2016
|
+
for (let i = 0; i < execInst.length; i++) {
|
|
2017
|
+
const inst = execInst[i];
|
|
2018
|
+
if (inst === 'POST_ONLY') {
|
|
2019
|
+
postOnly = true;
|
|
2020
|
+
break;
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2015
2023
|
}
|
|
2016
2024
|
const feeCurrency = this.safeString(order, 'fee_instrument_name');
|
|
2017
2025
|
return this.safeOrder({
|
|
@@ -2244,52 +2252,6 @@ class cryptocom extends cryptocom$1 {
|
|
|
2244
2252
|
'info': info,
|
|
2245
2253
|
};
|
|
2246
2254
|
}
|
|
2247
|
-
async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2248
|
-
await this.loadMarkets();
|
|
2249
|
-
const request = {};
|
|
2250
|
-
let market = undefined;
|
|
2251
|
-
let currency = undefined;
|
|
2252
|
-
if (symbol !== undefined) {
|
|
2253
|
-
market = this.market(symbol);
|
|
2254
|
-
}
|
|
2255
|
-
if (code !== undefined) {
|
|
2256
|
-
currency = this.currency(code);
|
|
2257
|
-
request['currency'] = currency['id'];
|
|
2258
|
-
}
|
|
2259
|
-
if (since !== undefined) {
|
|
2260
|
-
request['start_ts'] = since;
|
|
2261
|
-
}
|
|
2262
|
-
if (limit !== undefined) {
|
|
2263
|
-
request['page_size'] = limit;
|
|
2264
|
-
}
|
|
2265
|
-
const response = await this.v2PrivatePostPrivateMarginGetInterestHistory(this.extend(request, params));
|
|
2266
|
-
//
|
|
2267
|
-
// {
|
|
2268
|
-
// "id": 1656705829020,
|
|
2269
|
-
// "method": "private/margin/get-interest-history",
|
|
2270
|
-
// "code": 0,
|
|
2271
|
-
// "result": {
|
|
2272
|
-
// "list": [
|
|
2273
|
-
// {
|
|
2274
|
-
// "loan_id": "2643528867803765921",
|
|
2275
|
-
// "currency": "USDT",
|
|
2276
|
-
// "interest": 0.00000004,
|
|
2277
|
-
// "time": 1656702899559,
|
|
2278
|
-
// "stake_amount": 6,
|
|
2279
|
-
// "interest_rate": 0.000025
|
|
2280
|
-
// },
|
|
2281
|
-
// ]
|
|
2282
|
-
// }
|
|
2283
|
-
// }
|
|
2284
|
-
//
|
|
2285
|
-
const data = this.safeValue(response, 'result', {});
|
|
2286
|
-
const rows = this.safeValue(data, 'list', []);
|
|
2287
|
-
let interest = undefined;
|
|
2288
|
-
for (let i = 0; i < rows.length; i++) {
|
|
2289
|
-
interest = this.parseBorrowInterests(rows, market);
|
|
2290
|
-
}
|
|
2291
|
-
return this.filterByCurrencySinceLimit(interest, code, since, limit);
|
|
2292
|
-
}
|
|
2293
2255
|
parseBorrowInterest(info, market = undefined) {
|
|
2294
2256
|
//
|
|
2295
2257
|
// {
|
|
@@ -2318,38 +2280,6 @@ class cryptocom extends cryptocom$1 {
|
|
|
2318
2280
|
'info': info,
|
|
2319
2281
|
};
|
|
2320
2282
|
}
|
|
2321
|
-
async fetchBorrowRates(params = {}) {
|
|
2322
|
-
/**
|
|
2323
|
-
* @method
|
|
2324
|
-
* @name cryptocom#fetchBorrowRates
|
|
2325
|
-
* @description fetch the borrow interest rates of all currencies
|
|
2326
|
-
* @param {object} [params] extra parameters specific to the cryptocom api endpoint
|
|
2327
|
-
* @returns {object} a list of [borrow rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure}
|
|
2328
|
-
*/
|
|
2329
|
-
await this.loadMarkets();
|
|
2330
|
-
const response = await this.v2PrivatePostPrivateMarginGetUserConfig(params);
|
|
2331
|
-
//
|
|
2332
|
-
// {
|
|
2333
|
-
// "id": 1656707947456,
|
|
2334
|
-
// "method": "private/margin/get-user-config",
|
|
2335
|
-
// "code": 0,
|
|
2336
|
-
// "result": {
|
|
2337
|
-
// "stake_amount": 6,
|
|
2338
|
-
// "currency_configs": [
|
|
2339
|
-
// {
|
|
2340
|
-
// "currency": "AGLD",
|
|
2341
|
-
// "hourly_rate": 0.00003334,
|
|
2342
|
-
// "max_borrow_limit": 342.4032393,
|
|
2343
|
-
// "min_borrow_limit": 30
|
|
2344
|
-
// },
|
|
2345
|
-
// ]
|
|
2346
|
-
// }
|
|
2347
|
-
// }
|
|
2348
|
-
//
|
|
2349
|
-
const data = this.safeValue(response, 'result', {});
|
|
2350
|
-
const rates = this.safeValue(data, 'currency_configs', []);
|
|
2351
|
-
return this.parseBorrowRates(rates, 'currency');
|
|
2352
|
-
}
|
|
2353
2283
|
parseBorrowRates(info, codeKey) {
|
|
2354
2284
|
//
|
|
2355
2285
|
// {
|
|
@@ -3022,7 +2952,15 @@ class cryptocom extends cryptocom$1 {
|
|
|
3022
2952
|
const paramsKeys = Object.keys(keysorted);
|
|
3023
2953
|
let strSortKey = '';
|
|
3024
2954
|
for (let i = 0; i < paramsKeys.length; i++) {
|
|
3025
|
-
|
|
2955
|
+
const key = paramsKeys[i].toString();
|
|
2956
|
+
let value = requestParams[paramsKeys[i]];
|
|
2957
|
+
if (Array.isArray(value)) {
|
|
2958
|
+
value = value.join(',');
|
|
2959
|
+
}
|
|
2960
|
+
else {
|
|
2961
|
+
value = value.toString();
|
|
2962
|
+
}
|
|
2963
|
+
strSortKey = strSortKey + key + value;
|
|
3026
2964
|
}
|
|
3027
2965
|
const payload = path + nonce + this.apiKey + strSortKey + nonce;
|
|
3028
2966
|
const signature = this.hmac(this.encode(payload), this.encode(this.secret), sha256.sha256);
|
package/dist/cjs/src/delta.js
CHANGED
package/dist/cjs/src/deribit.js
CHANGED
package/dist/cjs/src/exmo.js
CHANGED
package/dist/cjs/src/gate.js
CHANGED
|
@@ -1095,6 +1095,7 @@ class gate extends gate$1 {
|
|
|
1095
1095
|
'max': margin ? this.safeNumber(market, 'max_quote_amount') : undefined,
|
|
1096
1096
|
},
|
|
1097
1097
|
},
|
|
1098
|
+
'created': undefined,
|
|
1098
1099
|
'info': market,
|
|
1099
1100
|
});
|
|
1100
1101
|
}
|
|
@@ -1292,6 +1293,7 @@ class gate extends gate$1 {
|
|
|
1292
1293
|
'max': undefined,
|
|
1293
1294
|
},
|
|
1294
1295
|
},
|
|
1296
|
+
'created': undefined,
|
|
1295
1297
|
'info': market,
|
|
1296
1298
|
};
|
|
1297
1299
|
}
|
|
@@ -1412,6 +1414,7 @@ class gate extends gate$1 {
|
|
|
1412
1414
|
'max': undefined,
|
|
1413
1415
|
},
|
|
1414
1416
|
},
|
|
1417
|
+
'created': this.safeIntegerProduct(market, 'create_time', 1000),
|
|
1415
1418
|
'info': market,
|
|
1416
1419
|
});
|
|
1417
1420
|
}
|