ccxt 4.4.88 → 4.4.90
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 +61 -19
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +6 -3
- package/dist/cjs/src/base/functions/encode.js +1 -1
- package/dist/cjs/src/base/functions/generic.js +6 -0
- package/dist/cjs/src/base/functions.js +1 -0
- package/dist/cjs/src/binance.js +1 -1
- package/dist/cjs/src/bingx.js +60 -32
- package/dist/cjs/src/bitget.js +493 -154
- package/dist/cjs/src/bitrue.js +72 -66
- package/dist/cjs/src/bitvavo.js +34 -0
- package/dist/cjs/src/btcalpha.js +35 -0
- package/dist/cjs/src/btcbox.js +35 -0
- package/dist/cjs/src/btcmarkets.js +35 -0
- package/dist/cjs/src/btcturk.js +35 -0
- package/dist/cjs/src/bybit.js +9 -3
- package/dist/cjs/src/coinbase.js +1 -4
- package/dist/cjs/src/cryptocom.js +54 -0
- package/dist/cjs/src/delta.js +2 -2
- package/dist/cjs/src/digifinex.js +40 -109
- package/dist/cjs/src/gate.js +12 -5
- package/dist/cjs/src/hashkey.js +15 -28
- package/dist/cjs/src/hollaex.js +28 -24
- package/dist/cjs/src/kraken.js +30 -53
- package/dist/cjs/src/luno.js +92 -0
- package/dist/cjs/src/okx.js +2 -1
- package/dist/cjs/src/phemex.js +16 -8
- package/dist/cjs/src/pro/coinbase.js +2 -0
- package/dist/cjs/src/pro/cryptocom.js +27 -0
- package/dist/cjs/src/pro/kraken.js +3 -11
- package/dist/cjs/src/tradeogre.js +3 -3
- package/dist/cjs/src/xt.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitget.d.ts +58 -0
- package/js/src/abstract/cryptocom.d.ts +2 -0
- package/js/src/abstract/luno.d.ts +1 -0
- package/js/src/base/Exchange.d.ts +4 -1
- package/js/src/base/Exchange.js +6 -3
- package/js/src/base/functions/encode.d.ts +1 -1
- package/js/src/base/functions/encode.js +1 -1
- package/js/src/base/functions/generic.d.ts +2 -1
- package/js/src/base/functions/generic.js +6 -1
- package/js/src/binance.js +1 -1
- package/js/src/bingx.d.ts +9 -5
- package/js/src/bingx.js +60 -32
- package/js/src/bitget.d.ts +4 -1
- package/js/src/bitget.js +493 -154
- package/js/src/bitrue.js +72 -66
- package/js/src/bitvavo.js +34 -0
- package/js/src/btcalpha.js +35 -0
- package/js/src/btcbox.js +35 -0
- package/js/src/btcmarkets.js +35 -0
- package/js/src/btcturk.js +35 -0
- package/js/src/bybit.js +9 -3
- package/js/src/coinbase.d.ts +1 -1
- package/js/src/coinbase.js +1 -4
- package/js/src/cryptocom.d.ts +17 -0
- package/js/src/cryptocom.js +54 -0
- package/js/src/delta.js +2 -2
- package/js/src/digifinex.js +40 -109
- package/js/src/gate.d.ts +1 -1
- package/js/src/gate.js +12 -5
- package/js/src/hashkey.d.ts +0 -1
- package/js/src/hashkey.js +15 -28
- package/js/src/hollaex.d.ts +1 -2
- package/js/src/hollaex.js +29 -25
- package/js/src/kraken.d.ts +0 -1
- package/js/src/kraken.js +30 -53
- package/js/src/luno.d.ts +9 -1
- package/js/src/luno.js +92 -0
- package/js/src/okx.js +2 -1
- package/js/src/phemex.d.ts +1 -0
- package/js/src/phemex.js +16 -8
- package/js/src/pro/coinbase.js +2 -0
- package/js/src/pro/cryptocom.d.ts +16 -0
- package/js/src/pro/cryptocom.js +27 -0
- package/js/src/pro/kraken.js +3 -11
- package/js/src/tradeogre.js +3 -3
- package/js/src/xt.js +1 -1
- package/package.json +4 -7
- package/examples/README.md +0 -316
- package/examples/js/README.md +0 -15
- package/examples/js/cli.js +0 -559
package/dist/cjs/src/kraken.js
CHANGED
|
@@ -551,10 +551,13 @@ class kraken extends kraken$1 {
|
|
|
551
551
|
* @returns {object[]} an array of objects representing market data
|
|
552
552
|
*/
|
|
553
553
|
async fetchMarkets(params = {}) {
|
|
554
|
+
const promises = [];
|
|
555
|
+
promises.push(this.publicGetAssetPairs(params));
|
|
554
556
|
if (this.options['adjustForTimeDifference']) {
|
|
555
|
-
|
|
557
|
+
promises.push(this.loadTimeDifference());
|
|
556
558
|
}
|
|
557
|
-
const
|
|
559
|
+
const responses = await Promise.all(promises);
|
|
560
|
+
const assetsResponse = responses[0];
|
|
558
561
|
//
|
|
559
562
|
// {
|
|
560
563
|
// "error": [],
|
|
@@ -602,9 +605,10 @@ class kraken extends kraken$1 {
|
|
|
602
605
|
// }
|
|
603
606
|
// }
|
|
604
607
|
//
|
|
605
|
-
const markets = this.
|
|
608
|
+
const markets = this.safeDict(assetsResponse, 'result', {});
|
|
609
|
+
const cachedCurrencies = this.safeDict(this.options, 'cachedCurrencies', {});
|
|
606
610
|
const keys = Object.keys(markets);
|
|
607
|
-
|
|
611
|
+
const result = [];
|
|
608
612
|
for (let i = 0; i < keys.length; i++) {
|
|
609
613
|
const id = keys[i];
|
|
610
614
|
const market = markets[id];
|
|
@@ -612,41 +616,49 @@ class kraken extends kraken$1 {
|
|
|
612
616
|
const quoteId = this.safeString(market, 'quote');
|
|
613
617
|
const base = this.safeCurrencyCode(baseId);
|
|
614
618
|
const quote = this.safeCurrencyCode(quoteId);
|
|
615
|
-
const
|
|
616
|
-
const
|
|
617
|
-
const makerFees = this.safeValue(market, 'fees_maker', []);
|
|
618
|
-
const firstMakerFee = this.safeValue(makerFees, 0, []);
|
|
619
|
+
const makerFees = this.safeList(market, 'fees_maker', []);
|
|
620
|
+
const firstMakerFee = this.safeList(makerFees, 0, []);
|
|
619
621
|
const firstMakerFeeRate = this.safeString(firstMakerFee, 1);
|
|
620
622
|
let maker = undefined;
|
|
621
623
|
if (firstMakerFeeRate !== undefined) {
|
|
622
624
|
maker = this.parseNumber(Precise["default"].stringDiv(firstMakerFeeRate, '100'));
|
|
623
625
|
}
|
|
624
|
-
const takerFees = this.
|
|
625
|
-
const firstTakerFee = this.
|
|
626
|
+
const takerFees = this.safeList(market, 'fees', []);
|
|
627
|
+
const firstTakerFee = this.safeList(takerFees, 0, []);
|
|
626
628
|
const firstTakerFeeRate = this.safeString(firstTakerFee, 1);
|
|
627
629
|
let taker = undefined;
|
|
628
630
|
if (firstTakerFeeRate !== undefined) {
|
|
629
631
|
taker = this.parseNumber(Precise["default"].stringDiv(firstTakerFeeRate, '100'));
|
|
630
632
|
}
|
|
631
|
-
const leverageBuy = this.
|
|
633
|
+
const leverageBuy = this.safeList(market, 'leverage_buy', []);
|
|
632
634
|
const leverageBuyLength = leverageBuy.length;
|
|
633
635
|
const precisionPrice = this.parseNumber(this.parsePrecision(this.safeString(market, 'pair_decimals')));
|
|
636
|
+
let precisionAmount = this.parseNumber(this.parsePrecision(this.safeString(market, 'lot_decimals')));
|
|
637
|
+
const spot = true;
|
|
638
|
+
// fix https://github.com/freqtrade/freqtrade/issues/11765#issuecomment-2894224103
|
|
639
|
+
if ((base in cachedCurrencies)) {
|
|
640
|
+
const currency = cachedCurrencies[base];
|
|
641
|
+
const currencyPrecision = this.safeNumber(currency, 'precision');
|
|
642
|
+
// if currency precision is greater (e.g. 0.01) than market precision (e.g. 0.001)
|
|
643
|
+
if (currencyPrecision > precisionAmount) {
|
|
644
|
+
precisionAmount = currencyPrecision;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
634
647
|
const status = this.safeString(market, 'status');
|
|
635
648
|
const isActive = status === 'online';
|
|
636
649
|
result.push({
|
|
637
650
|
'id': id,
|
|
638
651
|
'wsId': this.safeString(market, 'wsname'),
|
|
639
|
-
'symbol':
|
|
652
|
+
'symbol': base + '/' + quote,
|
|
640
653
|
'base': base,
|
|
641
654
|
'quote': quote,
|
|
642
655
|
'settle': undefined,
|
|
643
656
|
'baseId': baseId,
|
|
644
657
|
'quoteId': quoteId,
|
|
645
658
|
'settleId': undefined,
|
|
646
|
-
'darkpool': darkpool,
|
|
647
659
|
'altname': market['altname'],
|
|
648
660
|
'type': 'spot',
|
|
649
|
-
'spot':
|
|
661
|
+
'spot': spot,
|
|
650
662
|
'margin': (leverageBuyLength > 0),
|
|
651
663
|
'swap': false,
|
|
652
664
|
'future': false,
|
|
@@ -663,7 +675,7 @@ class kraken extends kraken$1 {
|
|
|
663
675
|
'strike': undefined,
|
|
664
676
|
'optionType': undefined,
|
|
665
677
|
'precision': {
|
|
666
|
-
'amount':
|
|
678
|
+
'amount': precisionAmount,
|
|
667
679
|
'price': precisionPrice,
|
|
668
680
|
},
|
|
669
681
|
'limits': {
|
|
@@ -676,7 +688,7 @@ class kraken extends kraken$1 {
|
|
|
676
688
|
'max': undefined,
|
|
677
689
|
},
|
|
678
690
|
'price': {
|
|
679
|
-
'min':
|
|
691
|
+
'min': undefined,
|
|
680
692
|
'max': undefined,
|
|
681
693
|
},
|
|
682
694
|
'cost': {
|
|
@@ -688,7 +700,6 @@ class kraken extends kraken$1 {
|
|
|
688
700
|
'info': market,
|
|
689
701
|
});
|
|
690
702
|
}
|
|
691
|
-
result = this.appendInactiveMarkets(result);
|
|
692
703
|
this.options['marketsByAltname'] = this.indexBy(result, 'altname');
|
|
693
704
|
return result;
|
|
694
705
|
}
|
|
@@ -704,33 +715,6 @@ class kraken extends kraken$1 {
|
|
|
704
715
|
}
|
|
705
716
|
return super.safeCurrency(currencyId, currency);
|
|
706
717
|
}
|
|
707
|
-
appendInactiveMarkets(result) {
|
|
708
|
-
// result should be an array to append to
|
|
709
|
-
const precision = {
|
|
710
|
-
'amount': this.parseNumber('1e-8'),
|
|
711
|
-
'price': this.parseNumber('1e-8'),
|
|
712
|
-
};
|
|
713
|
-
const costLimits = { 'min': undefined, 'max': undefined };
|
|
714
|
-
const priceLimits = { 'min': precision['price'], 'max': undefined };
|
|
715
|
-
const amountLimits = { 'min': precision['amount'], 'max': undefined };
|
|
716
|
-
const limits = { 'amount': amountLimits, 'price': priceLimits, 'cost': costLimits };
|
|
717
|
-
const defaults = {
|
|
718
|
-
'darkpool': false,
|
|
719
|
-
'info': undefined,
|
|
720
|
-
'maker': undefined,
|
|
721
|
-
'taker': undefined,
|
|
722
|
-
'active': false,
|
|
723
|
-
'precision': precision,
|
|
724
|
-
'limits': limits,
|
|
725
|
-
};
|
|
726
|
-
const markets = [
|
|
727
|
-
// { 'id': 'XXLMZEUR', 'symbol': 'XLM/EUR', 'base': 'XLM', 'quote': 'EUR', 'altname': 'XLMEUR' },
|
|
728
|
-
];
|
|
729
|
-
for (let i = 0; i < markets.length; i++) {
|
|
730
|
-
result.push(this.extend(defaults, markets[i]));
|
|
731
|
-
}
|
|
732
|
-
return result;
|
|
733
|
-
}
|
|
734
718
|
/**
|
|
735
719
|
* @method
|
|
736
720
|
* @name kraken#fetchStatus
|
|
@@ -977,9 +961,6 @@ class kraken extends kraken$1 {
|
|
|
977
961
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
978
962
|
await this.loadMarkets();
|
|
979
963
|
const market = this.market(symbol);
|
|
980
|
-
if (market['darkpool']) {
|
|
981
|
-
throw new errors.ExchangeError(this.id + ' fetchOrderBook() does not provide an order book for darkpool symbol ' + symbol);
|
|
982
|
-
}
|
|
983
964
|
const request = {
|
|
984
965
|
'pair': market['id'],
|
|
985
966
|
};
|
|
@@ -1084,7 +1065,7 @@ class kraken extends kraken$1 {
|
|
|
1084
1065
|
for (let i = 0; i < symbols.length; i++) {
|
|
1085
1066
|
const symbol = symbols[i];
|
|
1086
1067
|
const market = this.markets[symbol];
|
|
1087
|
-
if (market['active']
|
|
1068
|
+
if (market['active']) {
|
|
1088
1069
|
marketIds.push(market['id']);
|
|
1089
1070
|
}
|
|
1090
1071
|
}
|
|
@@ -1114,10 +1095,6 @@ class kraken extends kraken$1 {
|
|
|
1114
1095
|
*/
|
|
1115
1096
|
async fetchTicker(symbol, params = {}) {
|
|
1116
1097
|
await this.loadMarkets();
|
|
1117
|
-
const darkpool = symbol.indexOf('.d') >= 0;
|
|
1118
|
-
if (darkpool) {
|
|
1119
|
-
throw new errors.ExchangeError(this.id + ' fetchTicker() does not provide a ticker for darkpool symbol ' + symbol);
|
|
1120
|
-
}
|
|
1121
1098
|
const market = this.market(symbol);
|
|
1122
1099
|
const request = {
|
|
1123
1100
|
'pair': market['id'],
|
|
@@ -3498,7 +3475,7 @@ class kraken extends kraken$1 {
|
|
|
3498
3475
|
for (let i = 0; i < response['error'].length; i++) {
|
|
3499
3476
|
const error = response['error'][i];
|
|
3500
3477
|
this.throwExactlyMatchedException(this.exceptions['exact'], error, message);
|
|
3501
|
-
this.
|
|
3478
|
+
this.throwBroadlyMatchedException(this.exceptions['broad'], error, message);
|
|
3502
3479
|
}
|
|
3503
3480
|
throw new errors.ExchangeError(message);
|
|
3504
3481
|
}
|
package/dist/cjs/src/luno.js
CHANGED
|
@@ -41,6 +41,7 @@ class luno extends luno$1 {
|
|
|
41
41
|
'fetchClosedOrders': true,
|
|
42
42
|
'fetchCrossBorrowRate': false,
|
|
43
43
|
'fetchCrossBorrowRates': false,
|
|
44
|
+
'fetchCurrencies': true,
|
|
44
45
|
'fetchDepositAddress': true,
|
|
45
46
|
'fetchFundingHistory': false,
|
|
46
47
|
'fetchFundingRate': false,
|
|
@@ -122,6 +123,7 @@ class luno extends luno$1 {
|
|
|
122
123
|
'accounts/{id}/transactions': 1,
|
|
123
124
|
'balance': 1,
|
|
124
125
|
'beneficiaries': 1,
|
|
126
|
+
'send/networks': 1,
|
|
125
127
|
'fee_info': 1,
|
|
126
128
|
'funding_address': 1,
|
|
127
129
|
'listorders': 1,
|
|
@@ -262,6 +264,96 @@ class luno extends luno$1 {
|
|
|
262
264
|
},
|
|
263
265
|
});
|
|
264
266
|
}
|
|
267
|
+
/**
|
|
268
|
+
* @method
|
|
269
|
+
* @name luno#fetchCurrencies
|
|
270
|
+
* @description fetches all available currencies on an exchange
|
|
271
|
+
* @param {dict} [params] extra parameters specific to the exchange API endpoint
|
|
272
|
+
* @returns {dict} an associative dictionary of currencies
|
|
273
|
+
*/
|
|
274
|
+
async fetchCurrencies(params = {}) {
|
|
275
|
+
if (!this.checkRequiredCredentials(false)) {
|
|
276
|
+
return undefined;
|
|
277
|
+
}
|
|
278
|
+
const response = await this.privateGetSendNetworks(params);
|
|
279
|
+
//
|
|
280
|
+
// {
|
|
281
|
+
// "networks": [
|
|
282
|
+
// {
|
|
283
|
+
// "id": 0,
|
|
284
|
+
// "name": "Ethereum",
|
|
285
|
+
// "native_currency": "ETH"
|
|
286
|
+
// },
|
|
287
|
+
// ...
|
|
288
|
+
// ]
|
|
289
|
+
// }
|
|
290
|
+
//
|
|
291
|
+
const currenciesData = this.safeList(response, 'data', []);
|
|
292
|
+
const result = {};
|
|
293
|
+
for (let i = 0; i < currenciesData.length; i++) {
|
|
294
|
+
const networkEntry = currenciesData[i];
|
|
295
|
+
const id = this.safeString(networkEntry, 'native_currency');
|
|
296
|
+
const code = this.safeCurrencyCode(id);
|
|
297
|
+
if (!(code in result)) {
|
|
298
|
+
result[code] = {
|
|
299
|
+
'id': id,
|
|
300
|
+
'code': code,
|
|
301
|
+
'precision': undefined,
|
|
302
|
+
'type': undefined,
|
|
303
|
+
'name': undefined,
|
|
304
|
+
'active': undefined,
|
|
305
|
+
'deposit': undefined,
|
|
306
|
+
'withdraw': undefined,
|
|
307
|
+
'fee': undefined,
|
|
308
|
+
'limits': {
|
|
309
|
+
'withdraw': {
|
|
310
|
+
'min': undefined,
|
|
311
|
+
'max': undefined,
|
|
312
|
+
},
|
|
313
|
+
'deposit': {
|
|
314
|
+
'min': undefined,
|
|
315
|
+
'max': undefined,
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
'networks': {},
|
|
319
|
+
'info': {},
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
const networkId = this.safeString(networkEntry, 'name');
|
|
323
|
+
const networkCode = this.networkIdToCode(networkId);
|
|
324
|
+
result[code]['networks'][networkCode] = {
|
|
325
|
+
'id': networkId,
|
|
326
|
+
'network': networkCode,
|
|
327
|
+
'limits': {
|
|
328
|
+
'withdraw': {
|
|
329
|
+
'min': undefined,
|
|
330
|
+
'max': undefined,
|
|
331
|
+
},
|
|
332
|
+
'deposit': {
|
|
333
|
+
'min': undefined,
|
|
334
|
+
'max': undefined,
|
|
335
|
+
},
|
|
336
|
+
},
|
|
337
|
+
'active': undefined,
|
|
338
|
+
'deposit': undefined,
|
|
339
|
+
'withdraw': undefined,
|
|
340
|
+
'fee': undefined,
|
|
341
|
+
'precision': undefined,
|
|
342
|
+
'info': networkEntry,
|
|
343
|
+
};
|
|
344
|
+
// add entry in info
|
|
345
|
+
const info = this.safeList(result[code], 'info', []);
|
|
346
|
+
info.push(networkEntry);
|
|
347
|
+
result[code]['info'] = info;
|
|
348
|
+
}
|
|
349
|
+
// only after all entries are formed in currencies, restructure each entry
|
|
350
|
+
const allKeys = Object.keys(result);
|
|
351
|
+
for (let i = 0; i < allKeys.length; i++) {
|
|
352
|
+
const code = allKeys[i];
|
|
353
|
+
result[code] = this.safeCurrencyStructure(result[code]); // this is needed after adding network entry
|
|
354
|
+
}
|
|
355
|
+
return result;
|
|
356
|
+
}
|
|
265
357
|
/**
|
|
266
358
|
* @method
|
|
267
359
|
* @name luno#fetchMarkets
|
package/dist/cjs/src/okx.js
CHANGED
|
@@ -1594,6 +1594,7 @@ class okx extends okx$1 {
|
|
|
1594
1594
|
// "instType": "OPTION",
|
|
1595
1595
|
// "lever": "",
|
|
1596
1596
|
// "listTime": "1631262612280",
|
|
1597
|
+
// "contTdSwTime": "1631262812280",
|
|
1597
1598
|
// "lotSz": "1",
|
|
1598
1599
|
// "minSz": "1",
|
|
1599
1600
|
// "optType": "P",
|
|
@@ -1681,7 +1682,7 @@ class okx extends okx$1 {
|
|
|
1681
1682
|
'expiryDatetime': this.iso8601(expiry),
|
|
1682
1683
|
'strike': this.parseNumber(strikePrice),
|
|
1683
1684
|
'optionType': optionType,
|
|
1684
|
-
'created': this.
|
|
1685
|
+
'created': this.safeInteger2(market, 'contTdSwTime', 'listTime'),
|
|
1685
1686
|
'precision': {
|
|
1686
1687
|
'amount': this.safeNumber(market, 'lotSz'),
|
|
1687
1688
|
'price': this.safeNumber(market, 'tickSz'),
|
package/dist/cjs/src/phemex.js
CHANGED
|
@@ -581,6 +581,7 @@ class phemex extends phemex$1 {
|
|
|
581
581
|
},
|
|
582
582
|
'defaultNetworks': {
|
|
583
583
|
'USDT': 'ETH',
|
|
584
|
+
'MKR': 'ETH',
|
|
584
585
|
},
|
|
585
586
|
'defaultSubType': 'linear',
|
|
586
587
|
'accountsByType': {
|
|
@@ -3531,6 +3532,7 @@ class phemex extends phemex$1 {
|
|
|
3531
3532
|
* @description fetch the deposit address for a currency associated with this account
|
|
3532
3533
|
* @param {string} code unified currency code
|
|
3533
3534
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3535
|
+
* @param {string} [params.network] the chain name to fetch the deposit address e.g. ETH, TRX, EOS, SOL, etc.
|
|
3534
3536
|
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
3535
3537
|
*/
|
|
3536
3538
|
async fetchDepositAddress(code, params = {}) {
|
|
@@ -3542,22 +3544,28 @@ class phemex extends phemex$1 {
|
|
|
3542
3544
|
const defaultNetworks = this.safeDict(this.options, 'defaultNetworks');
|
|
3543
3545
|
const defaultNetwork = this.safeStringUpper(defaultNetworks, code);
|
|
3544
3546
|
const networks = this.safeDict(this.options, 'networks', {});
|
|
3545
|
-
let network = this.
|
|
3547
|
+
let network = this.safeStringUpper2(params, 'network', 'chainName', defaultNetwork);
|
|
3546
3548
|
network = this.safeString(networks, network, network);
|
|
3547
3549
|
if (network === undefined) {
|
|
3548
|
-
|
|
3550
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchDepositAddress() requires a network parameter');
|
|
3549
3551
|
}
|
|
3550
3552
|
else {
|
|
3551
3553
|
request['chainName'] = network;
|
|
3552
3554
|
params = this.omit(params, 'network');
|
|
3553
3555
|
}
|
|
3554
|
-
const response = await this.
|
|
3556
|
+
const response = await this.privateGetExchangeWalletsV2DepositAddress(this.extend(request, params));
|
|
3557
|
+
//
|
|
3555
3558
|
// {
|
|
3556
|
-
// "code":0,
|
|
3557
|
-
// "msg":"OK",
|
|
3558
|
-
// "data":{
|
|
3559
|
-
// "address":"
|
|
3560
|
-
// "tag":
|
|
3559
|
+
// "code": 0,
|
|
3560
|
+
// "msg": "OK",
|
|
3561
|
+
// "data": {
|
|
3562
|
+
// "address": "tb1qxel5wq5gumt",
|
|
3563
|
+
// "tag": "",
|
|
3564
|
+
// "notice": false,
|
|
3565
|
+
// "accountType": 1,
|
|
3566
|
+
// "contractName": null,
|
|
3567
|
+
// "chainTokenUrl": null,
|
|
3568
|
+
// "sign": null
|
|
3561
3569
|
// }
|
|
3562
3570
|
// }
|
|
3563
3571
|
//
|
|
@@ -161,6 +161,7 @@ class coinbase extends coinbase$1 {
|
|
|
161
161
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
162
162
|
*/
|
|
163
163
|
async watchTicker(symbol, params = {}) {
|
|
164
|
+
await this.loadMarkets();
|
|
164
165
|
const name = 'ticker';
|
|
165
166
|
return await this.subscribe(name, false, symbol, params);
|
|
166
167
|
}
|
|
@@ -174,6 +175,7 @@ class coinbase extends coinbase$1 {
|
|
|
174
175
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
175
176
|
*/
|
|
176
177
|
async watchTickers(symbols = undefined, params = {}) {
|
|
178
|
+
await this.loadMarkets();
|
|
177
179
|
if (symbols === undefined) {
|
|
178
180
|
symbols = this.symbols;
|
|
179
181
|
}
|
|
@@ -27,6 +27,7 @@ class cryptocom extends cryptocom$1 {
|
|
|
27
27
|
'createOrderWs': true,
|
|
28
28
|
'cancelOrderWs': true,
|
|
29
29
|
'cancelAllOrders': true,
|
|
30
|
+
'editOrderWs': true,
|
|
30
31
|
},
|
|
31
32
|
'urls': {
|
|
32
33
|
'api': {
|
|
@@ -1059,6 +1060,31 @@ class cryptocom extends cryptocom$1 {
|
|
|
1059
1060
|
const messageHash = this.nonce();
|
|
1060
1061
|
return await this.watchPrivateRequest(messageHash, request);
|
|
1061
1062
|
}
|
|
1063
|
+
/**
|
|
1064
|
+
* @method
|
|
1065
|
+
* @name cryptocom#editOrderWs
|
|
1066
|
+
* @description edit a trade order
|
|
1067
|
+
* @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-amend-order
|
|
1068
|
+
* @param {string} id order id
|
|
1069
|
+
* @param {string} symbol unified market symbol of the order to edit
|
|
1070
|
+
* @param {string} [type] not used by cryptocom editOrder
|
|
1071
|
+
* @param {string} [side] not used by cryptocom editOrder
|
|
1072
|
+
* @param {float} amount (mandatory) how much of the currency you want to trade in units of the base currency
|
|
1073
|
+
* @param {float} price (mandatory) the price for the order, in units of the quote currency, ignored in market orders
|
|
1074
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1075
|
+
* @param {string} [params.clientOrderId] the original client order id of the order to edit, required if id is not provided
|
|
1076
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1077
|
+
*/
|
|
1078
|
+
async editOrderWs(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
1079
|
+
await this.loadMarkets();
|
|
1080
|
+
params = this.editOrderRequest(id, symbol, amount, price, params);
|
|
1081
|
+
const request = {
|
|
1082
|
+
'method': 'private/amend-order',
|
|
1083
|
+
'params': params,
|
|
1084
|
+
};
|
|
1085
|
+
const messageHash = this.nonce();
|
|
1086
|
+
return await this.watchPrivateRequest(messageHash, request);
|
|
1087
|
+
}
|
|
1062
1088
|
handleOrder(client, message) {
|
|
1063
1089
|
//
|
|
1064
1090
|
// {
|
|
@@ -1310,6 +1336,7 @@ class cryptocom extends cryptocom$1 {
|
|
|
1310
1336
|
'public/heartbeat': this.handlePing,
|
|
1311
1337
|
'public/auth': this.handleAuthenticate,
|
|
1312
1338
|
'private/create-order': this.handleOrder,
|
|
1339
|
+
'private/amend-order': this.handleOrder,
|
|
1313
1340
|
'private/cancel-order': this.handleOrder,
|
|
1314
1341
|
'private/cancel-all-orders': this.handleCancelAllOrders,
|
|
1315
1342
|
'private/close-position': this.handleOrder,
|
|
@@ -861,17 +861,9 @@ class kraken extends kraken$1 {
|
|
|
861
861
|
for (let i = 0; i < this.symbols.length; i++) {
|
|
862
862
|
const symbol = this.symbols[i];
|
|
863
863
|
const market = this.markets[symbol];
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
const wsName = altname.slice(0, 3) + '/' + altname.slice(3);
|
|
868
|
-
marketsByWsName[wsName] = market;
|
|
869
|
-
}
|
|
870
|
-
else {
|
|
871
|
-
const info = this.safeValue(market, 'info', {});
|
|
872
|
-
const wsName = this.safeString(info, 'wsname');
|
|
873
|
-
marketsByWsName[wsName] = market;
|
|
874
|
-
}
|
|
864
|
+
const info = this.safeValue(market, 'info', {});
|
|
865
|
+
const wsName = this.safeString(info, 'wsname');
|
|
866
|
+
marketsByWsName[wsName] = market;
|
|
875
867
|
}
|
|
876
868
|
this.options['marketsByWsName'] = marketsByWsName;
|
|
877
869
|
}
|
|
@@ -423,13 +423,13 @@ class tradeogre extends tradeogre$1 {
|
|
|
423
423
|
'vwap': undefined,
|
|
424
424
|
'open': this.safeString(ticker, 'initialprice'),
|
|
425
425
|
'close': this.safeString(ticker, 'price'),
|
|
426
|
-
'last':
|
|
426
|
+
'last': this.safeString(ticker, 'price'),
|
|
427
427
|
'previousClose': undefined,
|
|
428
428
|
'change': undefined,
|
|
429
429
|
'percentage': undefined,
|
|
430
430
|
'average': undefined,
|
|
431
|
-
'baseVolume':
|
|
432
|
-
'quoteVolume':
|
|
431
|
+
'baseVolume': this.safeString(ticker, 'volume'),
|
|
432
|
+
'quoteVolume': undefined,
|
|
433
433
|
'info': ticker,
|
|
434
434
|
}, market);
|
|
435
435
|
}
|
package/dist/cjs/src/xt.js
CHANGED
|
@@ -2969,7 +2969,7 @@ class xt extends xt$1 {
|
|
|
2969
2969
|
request['state'] = 'NOT_TRIGGERED';
|
|
2970
2970
|
}
|
|
2971
2971
|
else if (type === 'swap') {
|
|
2972
|
-
request['state'] = '
|
|
2972
|
+
request['state'] = 'UNFINISHED'; // NEW & PARTIALLY_FILLED
|
|
2973
2973
|
}
|
|
2974
2974
|
}
|
|
2975
2975
|
else if (status === 'closed') {
|
package/js/ccxt.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
|
|
|
4
4
|
import * as errors from './src/base/errors.js';
|
|
5
5
|
import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarketMarginModes, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, LongShortRatio, OrderBooks, OpenInterests, ConstructorArgs } from './src/base/types.js';
|
|
6
6
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
|
|
7
|
-
declare const version = "4.4.
|
|
7
|
+
declare const version = "4.4.89";
|
|
8
8
|
import alpaca from './src/alpaca.js';
|
|
9
9
|
import apex from './src/apex.js';
|
|
10
10
|
import ascendex from './src/ascendex.js';
|
package/js/ccxt.js
CHANGED
|
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
|
|
|
38
38
|
import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
|
|
39
39
|
//-----------------------------------------------------------------------------
|
|
40
40
|
// this is updated by vss.js when building
|
|
41
|
-
const version = '4.4.
|
|
41
|
+
const version = '4.4.89';
|
|
42
42
|
Exchange.ccxtVersion = version;
|
|
43
43
|
//-----------------------------------------------------------------------------
|
|
44
44
|
import alpaca from './src/alpaca.js';
|
|
@@ -77,6 +77,20 @@ interface Exchange {
|
|
|
77
77
|
publicMarginGetV2MarginMarketLongShortRatio(params?: {}): Promise<implicitReturnType>;
|
|
78
78
|
publicEarnGetV2EarnLoanPublicCoinInfos(params?: {}): Promise<implicitReturnType>;
|
|
79
79
|
publicEarnGetV2EarnLoanPublicHourInterest(params?: {}): Promise<implicitReturnType>;
|
|
80
|
+
publicUtaGetV3MarketInstruments(params?: {}): Promise<implicitReturnType>;
|
|
81
|
+
publicUtaGetV3MarketTickers(params?: {}): Promise<implicitReturnType>;
|
|
82
|
+
publicUtaGetV3MarketOrderbook(params?: {}): Promise<implicitReturnType>;
|
|
83
|
+
publicUtaGetV3MarketFills(params?: {}): Promise<implicitReturnType>;
|
|
84
|
+
publicUtaGetV3MarketOpenInterest(params?: {}): Promise<implicitReturnType>;
|
|
85
|
+
publicUtaGetV3MarketCandles(params?: {}): Promise<implicitReturnType>;
|
|
86
|
+
publicUtaGetV3MarketHistoryCandles(params?: {}): Promise<implicitReturnType>;
|
|
87
|
+
publicUtaGetV3MarketCurrentFundRate(params?: {}): Promise<implicitReturnType>;
|
|
88
|
+
publicUtaGetV3MarketHistoryFundRate(params?: {}): Promise<implicitReturnType>;
|
|
89
|
+
publicUtaGetV3MarketRiskReserve(params?: {}): Promise<implicitReturnType>;
|
|
90
|
+
publicUtaGetV3MarketDiscountRate(params?: {}): Promise<implicitReturnType>;
|
|
91
|
+
publicUtaGetV3MarketMarginLoans(params?: {}): Promise<implicitReturnType>;
|
|
92
|
+
publicUtaGetV3MarketPositionTier(params?: {}): Promise<implicitReturnType>;
|
|
93
|
+
publicUtaGetV3MarketOiLimit(params?: {}): Promise<implicitReturnType>;
|
|
80
94
|
privateSpotGetSpotV1WalletDepositAddress(params?: {}): Promise<implicitReturnType>;
|
|
81
95
|
privateSpotGetSpotV1WalletWithdrawalList(params?: {}): Promise<implicitReturnType>;
|
|
82
96
|
privateSpotGetSpotV1WalletDepositList(params?: {}): Promise<implicitReturnType>;
|
|
@@ -508,6 +522,50 @@ interface Exchange {
|
|
|
508
522
|
privateEarnPostV2EarnLoanRepay(params?: {}): Promise<implicitReturnType>;
|
|
509
523
|
privateEarnPostV2EarnLoanRevisePledge(params?: {}): Promise<implicitReturnType>;
|
|
510
524
|
privateCommonGetV2CommonTradeRate(params?: {}): Promise<implicitReturnType>;
|
|
525
|
+
privateUtaGetV3AccountAssets(params?: {}): Promise<implicitReturnType>;
|
|
526
|
+
privateUtaGetV3AccountSettings(params?: {}): Promise<implicitReturnType>;
|
|
527
|
+
privateUtaGetV3AccountFinancialRecords(params?: {}): Promise<implicitReturnType>;
|
|
528
|
+
privateUtaGetV3AccountRepayableCoins(params?: {}): Promise<implicitReturnType>;
|
|
529
|
+
privateUtaGetV3AccountPaymentCoins(params?: {}): Promise<implicitReturnType>;
|
|
530
|
+
privateUtaGetV3AccountConvertRecords(params?: {}): Promise<implicitReturnType>;
|
|
531
|
+
privateUtaGetV3AccountTransferableCoins(params?: {}): Promise<implicitReturnType>;
|
|
532
|
+
privateUtaGetV3AccountSubTransferRecord(params?: {}): Promise<implicitReturnType>;
|
|
533
|
+
privateUtaGetV3InsLoanTransfered(params?: {}): Promise<implicitReturnType>;
|
|
534
|
+
privateUtaGetV3InsLoanSymbols(params?: {}): Promise<implicitReturnType>;
|
|
535
|
+
privateUtaGetV3InsLoanRiskUnit(params?: {}): Promise<implicitReturnType>;
|
|
536
|
+
privateUtaGetV3InsLoanRepaidHistory(params?: {}): Promise<implicitReturnType>;
|
|
537
|
+
privateUtaGetV3InsLoanProductInfos(params?: {}): Promise<implicitReturnType>;
|
|
538
|
+
privateUtaGetV3InsLoanLoanOrder(params?: {}): Promise<implicitReturnType>;
|
|
539
|
+
privateUtaGetV3InsLoanLtvConvert(params?: {}): Promise<implicitReturnType>;
|
|
540
|
+
privateUtaGetV3InsLoanEnsureCoinsConvert(params?: {}): Promise<implicitReturnType>;
|
|
541
|
+
privateUtaGetV3PositionCurrentPosition(params?: {}): Promise<implicitReturnType>;
|
|
542
|
+
privateUtaGetV3PositionHistoryPosition(params?: {}): Promise<implicitReturnType>;
|
|
543
|
+
privateUtaGetV3TradeOrderInfo(params?: {}): Promise<implicitReturnType>;
|
|
544
|
+
privateUtaGetV3TradeUnfilledOrders(params?: {}): Promise<implicitReturnType>;
|
|
545
|
+
privateUtaGetV3TradeHistoryOrders(params?: {}): Promise<implicitReturnType>;
|
|
546
|
+
privateUtaGetV3TradeFills(params?: {}): Promise<implicitReturnType>;
|
|
547
|
+
privateUtaGetV3UserSubList(params?: {}): Promise<implicitReturnType>;
|
|
548
|
+
privateUtaGetV3UserSubApiList(params?: {}): Promise<implicitReturnType>;
|
|
549
|
+
privateUtaPostV3AccountSetLeverage(params?: {}): Promise<implicitReturnType>;
|
|
550
|
+
privateUtaPostV3AccountSetHoldMode(params?: {}): Promise<implicitReturnType>;
|
|
551
|
+
privateUtaPostV3AccountRepay(params?: {}): Promise<implicitReturnType>;
|
|
552
|
+
privateUtaPostV3AccountTransfer(params?: {}): Promise<implicitReturnType>;
|
|
553
|
+
privateUtaPostV3AccountSubTransfer(params?: {}): Promise<implicitReturnType>;
|
|
554
|
+
privateUtaPostV3AccountMaxOpenAvailable(params?: {}): Promise<implicitReturnType>;
|
|
555
|
+
privateUtaPostV3InsLoanBindUid(params?: {}): Promise<implicitReturnType>;
|
|
556
|
+
privateUtaPostV3TradePlaceOrder(params?: {}): Promise<implicitReturnType>;
|
|
557
|
+
privateUtaPostV3TradeModifyOrder(params?: {}): Promise<implicitReturnType>;
|
|
558
|
+
privateUtaPostV3TradeCancelOrder(params?: {}): Promise<implicitReturnType>;
|
|
559
|
+
privateUtaPostV3TradePlaceBatch(params?: {}): Promise<implicitReturnType>;
|
|
560
|
+
privateUtaPostV3TradeBatchModifyOrder(params?: {}): Promise<implicitReturnType>;
|
|
561
|
+
privateUtaPostV3TradeCancelBatch(params?: {}): Promise<implicitReturnType>;
|
|
562
|
+
privateUtaPostV3TradeCancelSymbolOrder(params?: {}): Promise<implicitReturnType>;
|
|
563
|
+
privateUtaPostV3TradeClosePositions(params?: {}): Promise<implicitReturnType>;
|
|
564
|
+
privateUtaPostV3UserCreateSub(params?: {}): Promise<implicitReturnType>;
|
|
565
|
+
privateUtaPostV3UserFreezeSub(params?: {}): Promise<implicitReturnType>;
|
|
566
|
+
privateUtaPostV3UserCreateSubApi(params?: {}): Promise<implicitReturnType>;
|
|
567
|
+
privateUtaPostV3UserUpdateSubApi(params?: {}): Promise<implicitReturnType>;
|
|
568
|
+
privateUtaPostV3UserDeleteSubApi(params?: {}): Promise<implicitReturnType>;
|
|
511
569
|
}
|
|
512
570
|
declare abstract class Exchange extends _Exchange {
|
|
513
571
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { implicitReturnType } from '../base/types.js';
|
|
2
2
|
import { Exchange as _Exchange } from '../base/Exchange.js';
|
|
3
3
|
interface Exchange {
|
|
4
|
+
basePublicGetV1PublicGetAnnouncements(params?: {}): Promise<implicitReturnType>;
|
|
4
5
|
v1PublicGetPublicAuth(params?: {}): Promise<implicitReturnType>;
|
|
5
6
|
v1PublicGetPublicGetInstruments(params?: {}): Promise<implicitReturnType>;
|
|
6
7
|
v1PublicGetPublicGetBook(params?: {}): Promise<implicitReturnType>;
|
|
@@ -18,6 +19,7 @@ interface Exchange {
|
|
|
18
19
|
v1PrivatePostPrivateUserBalanceHistory(params?: {}): Promise<implicitReturnType>;
|
|
19
20
|
v1PrivatePostPrivateGetPositions(params?: {}): Promise<implicitReturnType>;
|
|
20
21
|
v1PrivatePostPrivateCreateOrder(params?: {}): Promise<implicitReturnType>;
|
|
22
|
+
v1PrivatePostPrivateAmendOrder(params?: {}): Promise<implicitReturnType>;
|
|
21
23
|
v1PrivatePostPrivateCreateOrderList(params?: {}): Promise<implicitReturnType>;
|
|
22
24
|
v1PrivatePostPrivateCancelOrder(params?: {}): Promise<implicitReturnType>;
|
|
23
25
|
v1PrivatePostPrivateCancelOrderList(params?: {}): Promise<implicitReturnType>;
|
|
@@ -12,6 +12,7 @@ interface Exchange {
|
|
|
12
12
|
privateGetAccountsIdTransactions(params?: {}): Promise<implicitReturnType>;
|
|
13
13
|
privateGetBalance(params?: {}): Promise<implicitReturnType>;
|
|
14
14
|
privateGetBeneficiaries(params?: {}): Promise<implicitReturnType>;
|
|
15
|
+
privateGetSendNetworks(params?: {}): Promise<implicitReturnType>;
|
|
15
16
|
privateGetFeeInfo(params?: {}): Promise<implicitReturnType>;
|
|
16
17
|
privateGetFundingAddress(params?: {}): Promise<implicitReturnType>;
|
|
17
18
|
privateGetListorders(params?: {}): Promise<implicitReturnType>;
|
|
@@ -199,6 +199,7 @@ export default class Exchange {
|
|
|
199
199
|
streaming: {};
|
|
200
200
|
alias: boolean;
|
|
201
201
|
deepExtend: (...xs: any) => any;
|
|
202
|
+
deepExtendSafe: (...xs: any) => any;
|
|
202
203
|
isNode: boolean;
|
|
203
204
|
keys: {
|
|
204
205
|
(o: object): string[];
|
|
@@ -210,6 +211,7 @@ export default class Exchange {
|
|
|
210
211
|
flatten: (x: any[], out?: any[]) => any[];
|
|
211
212
|
unique: (x: any[]) => any[];
|
|
212
213
|
indexBy: (x: Dictionary<any>, k: IndexType, out?: Dictionary<any>) => Dictionary<any>;
|
|
214
|
+
indexBySafe: (x: Dictionary<any>, k: IndexType, out?: Dictionary<any>) => Dictionary<any>;
|
|
213
215
|
roundTimeframe: (timeframe: string, timestamp: number, direction?: number) => number;
|
|
214
216
|
sortBy: (array: any[], key: IndexType, descending?: boolean, defaultValue?: any, direction?: number) => any[];
|
|
215
217
|
sortBy2: (array: any[], key1: IndexType, key2: IndexType, descending?: boolean, direction?: number) => any[];
|
|
@@ -281,8 +283,9 @@ export default class Exchange {
|
|
|
281
283
|
base58ToBinary: (str: string) => Uint8Array;
|
|
282
284
|
base64ToBinary: (str: string) => Uint8Array;
|
|
283
285
|
safeTimestamp2: (o: any, k1: IndexType, k2: IndexType, $default?: number) => number;
|
|
284
|
-
rawencode: (object: object) => string;
|
|
286
|
+
rawencode: (object: object, sort?: boolean) => string;
|
|
285
287
|
keysort: (x: Dictionary<any>, out?: Dictionary<any>) => Dictionary<any>;
|
|
288
|
+
sort: (array: any) => any;
|
|
286
289
|
inArray: (needle: any, haystack: any[]) => boolean;
|
|
287
290
|
safeStringLower2: (o: any, k1: IndexType, k2: IndexType, $default?: string) => string;
|
|
288
291
|
safeStringUpper2: (o: any, k1: IndexType, k2: IndexType, $default?: string) => string;
|