ccxt 4.2.67 → 4.2.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/build.sh +2 -2
- package/dist/ccxt.browser.js +398 -111
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +7 -0
- package/dist/cjs/src/bitstamp.js +68 -0
- package/dist/cjs/src/gate.js +4 -1
- package/dist/cjs/src/gemini.js +163 -73
- package/dist/cjs/src/hitbtc.js +7 -0
- package/dist/cjs/src/htx.js +1 -0
- package/dist/cjs/src/hyperliquid.js +5 -2
- package/dist/cjs/src/krakenfutures.js +132 -29
- package/dist/cjs/src/kucoin.js +5 -2
- package/dist/cjs/src/pro/lbank.js +5 -3
- package/doc/requirements.txt +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/htx.d.ts +1 -0
- package/js/src/abstract/huobi.d.ts +1 -0
- package/js/src/base/Exchange.d.ts +2 -1
- package/js/src/base/Exchange.js +7 -0
- package/js/src/base/types.d.ts +3 -1
- package/js/src/bitstamp.d.ts +14 -1
- package/js/src/bitstamp.js +68 -0
- package/js/src/gate.js +4 -1
- package/js/src/gemini.d.ts +1 -1
- package/js/src/gemini.js +163 -73
- package/js/src/hitbtc.js +7 -0
- package/js/src/htx.js +1 -0
- package/js/src/hyperliquid.js +5 -2
- package/js/src/krakenfutures.js +132 -29
- package/js/src/kucoin.js +5 -2
- package/js/src/pro/lbank.js +5 -3
- package/package.json +1 -1
- package/skip-tests.json +1 -0
package/dist/cjs/ccxt.js
CHANGED
|
@@ -177,7 +177,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
177
177
|
|
|
178
178
|
//-----------------------------------------------------------------------------
|
|
179
179
|
// this is updated by vss.js when building
|
|
180
|
-
const version = '4.2.
|
|
180
|
+
const version = '4.2.69';
|
|
181
181
|
Exchange["default"].ccxtVersion = version;
|
|
182
182
|
const exchanges = {
|
|
183
183
|
'ace': ace,
|
|
@@ -3535,6 +3535,13 @@ class Exchange {
|
|
|
3535
3535
|
}
|
|
3536
3536
|
return [value, params];
|
|
3537
3537
|
}
|
|
3538
|
+
handleParamInteger(params, paramName, defaultValue = undefined) {
|
|
3539
|
+
const value = this.safeInteger(params, paramName, defaultValue);
|
|
3540
|
+
if (value !== undefined) {
|
|
3541
|
+
params = this.omit(params, paramName);
|
|
3542
|
+
}
|
|
3543
|
+
return [value, params];
|
|
3544
|
+
}
|
|
3538
3545
|
resolvePath(path, params) {
|
|
3539
3546
|
return [
|
|
3540
3547
|
this.implodeParams(path, params),
|
package/dist/cjs/src/bitstamp.js
CHANGED
|
@@ -85,6 +85,7 @@ class bitstamp extends bitstamp$1 {
|
|
|
85
85
|
'setLeverage': false,
|
|
86
86
|
'setMarginMode': false,
|
|
87
87
|
'setPositionMode': false,
|
|
88
|
+
'transfer': true,
|
|
88
89
|
'withdraw': true,
|
|
89
90
|
},
|
|
90
91
|
'urls': {
|
|
@@ -2119,6 +2120,73 @@ class bitstamp extends bitstamp$1 {
|
|
|
2119
2120
|
const response = await this[method](this.extend(request, params));
|
|
2120
2121
|
return this.parseTransaction(response, currency);
|
|
2121
2122
|
}
|
|
2123
|
+
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
2124
|
+
/**
|
|
2125
|
+
* @method
|
|
2126
|
+
* @name bitstamp#transfer
|
|
2127
|
+
* @description transfer currency internally between wallets on the same account
|
|
2128
|
+
* @see https://www.bitstamp.net/api/#tag/Sub-account/operation/TransferFromMainToSub
|
|
2129
|
+
* @see https://www.bitstamp.net/api/#tag/Sub-account/operation/TransferFromSubToMain
|
|
2130
|
+
* @param {string} code unified currency code
|
|
2131
|
+
* @param {float} amount amount to transfer
|
|
2132
|
+
* @param {string} fromAccount account to transfer from
|
|
2133
|
+
* @param {string} toAccount account to transfer to
|
|
2134
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2135
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
2136
|
+
*/
|
|
2137
|
+
await this.loadMarkets();
|
|
2138
|
+
const currency = this.currency(code);
|
|
2139
|
+
amount = this.currencyToPrecision(code, amount);
|
|
2140
|
+
amount = this.parseToNumeric(amount);
|
|
2141
|
+
const request = {
|
|
2142
|
+
'amount': amount,
|
|
2143
|
+
'currency': currency['id'].toUpperCase(),
|
|
2144
|
+
};
|
|
2145
|
+
let response = undefined;
|
|
2146
|
+
if (fromAccount === 'main') {
|
|
2147
|
+
request['subAccount'] = toAccount;
|
|
2148
|
+
response = await this.privatePostTransferFromMain(this.extend(request, params));
|
|
2149
|
+
}
|
|
2150
|
+
else if (toAccount === 'main') {
|
|
2151
|
+
request['subAccount'] = fromAccount;
|
|
2152
|
+
response = await this.privatePostTransferToMain(this.extend(request, params));
|
|
2153
|
+
}
|
|
2154
|
+
else {
|
|
2155
|
+
throw new errors.BadRequest(this.id + ' transfer() only supports from or to main');
|
|
2156
|
+
}
|
|
2157
|
+
//
|
|
2158
|
+
// { status: 'ok' }
|
|
2159
|
+
//
|
|
2160
|
+
const transfer = this.parseTransfer(response, currency);
|
|
2161
|
+
transfer['amount'] = amount;
|
|
2162
|
+
transfer['fromAccount'] = fromAccount;
|
|
2163
|
+
transfer['toAccount'] = toAccount;
|
|
2164
|
+
return transfer;
|
|
2165
|
+
}
|
|
2166
|
+
parseTransfer(transfer, currency = undefined) {
|
|
2167
|
+
//
|
|
2168
|
+
// { status: 'ok' }
|
|
2169
|
+
//
|
|
2170
|
+
const status = this.safeString(transfer, 'status');
|
|
2171
|
+
return {
|
|
2172
|
+
'info': transfer,
|
|
2173
|
+
'id': undefined,
|
|
2174
|
+
'timestamp': undefined,
|
|
2175
|
+
'datetime': undefined,
|
|
2176
|
+
'currency': currency['code'],
|
|
2177
|
+
'amount': undefined,
|
|
2178
|
+
'fromAccount': undefined,
|
|
2179
|
+
'toAccount': undefined,
|
|
2180
|
+
'status': this.parseTransferStatus(status),
|
|
2181
|
+
};
|
|
2182
|
+
}
|
|
2183
|
+
parseTransferStatus(status) {
|
|
2184
|
+
const statuses = {
|
|
2185
|
+
'ok': 'ok',
|
|
2186
|
+
'error': 'failed',
|
|
2187
|
+
};
|
|
2188
|
+
return this.safeString(statuses, status, status);
|
|
2189
|
+
}
|
|
2122
2190
|
nonce() {
|
|
2123
2191
|
return this.milliseconds();
|
|
2124
2192
|
}
|
package/dist/cjs/src/gate.js
CHANGED
|
@@ -4480,7 +4480,10 @@ class gate extends gate$1 {
|
|
|
4480
4480
|
if (lastTradeTimestamp === undefined) {
|
|
4481
4481
|
lastTradeTimestamp = this.safeTimestamp2(order, 'update_time', 'finish_time');
|
|
4482
4482
|
}
|
|
4483
|
-
|
|
4483
|
+
let marketType = 'contract';
|
|
4484
|
+
if (('currency_pair' in order) || ('market' in order)) {
|
|
4485
|
+
marketType = 'spot';
|
|
4486
|
+
}
|
|
4484
4487
|
const exchangeSymbol = this.safeString2(order, 'currency_pair', 'market', contract);
|
|
4485
4488
|
const symbol = this.safeSymbol(exchangeSymbol, market, '_', marketType);
|
|
4486
4489
|
// Everything below this(above return) is related to fees
|
package/dist/cjs/src/gemini.js
CHANGED
|
@@ -27,7 +27,7 @@ class gemini extends gemini$1 {
|
|
|
27
27
|
'CORS': undefined,
|
|
28
28
|
'spot': true,
|
|
29
29
|
'margin': false,
|
|
30
|
-
'swap':
|
|
30
|
+
'swap': true,
|
|
31
31
|
'future': false,
|
|
32
32
|
'option': false,
|
|
33
33
|
'addMargin': false,
|
|
@@ -252,11 +252,11 @@ class gemini extends gemini$1 {
|
|
|
252
252
|
},
|
|
253
253
|
},
|
|
254
254
|
'options': {
|
|
255
|
-
'fetchMarketsMethod': '
|
|
255
|
+
'fetchMarketsMethod': 'fetch_markets_from_api',
|
|
256
256
|
'fetchMarketFromWebRetries': 10,
|
|
257
257
|
'fetchMarketsFromAPI': {
|
|
258
258
|
'fetchDetailsForAllSymbols': false,
|
|
259
|
-
'
|
|
259
|
+
'quoteCurrencies': ['USDT', 'GUSD', 'USD', 'DAI', 'EUR', 'GBP', 'SGD', 'BTC', 'ETH', 'LTC', 'BCH'],
|
|
260
260
|
},
|
|
261
261
|
'fetchMarkets': {
|
|
262
262
|
'webApiEnable': true,
|
|
@@ -312,10 +312,7 @@ class gemini extends gemini$1 {
|
|
|
312
312
|
}
|
|
313
313
|
//
|
|
314
314
|
// {
|
|
315
|
-
// "tradingPairs": [
|
|
316
|
-
// [ "BTCAUD", 2, 8, "0.00001", 10, true ],
|
|
317
|
-
// ...
|
|
318
|
-
// ],
|
|
315
|
+
// "tradingPairs": [ [ 'BTCUSD', 2, 8, '0.00001', 10, true ], ... ],
|
|
319
316
|
// "currencies": [
|
|
320
317
|
// [ "ORCA", "Orca", 204, 6, 0, 6, 8, false, null, "solana" ], // as confirmed, precisions seem to be the 5th index
|
|
321
318
|
// [ "ATOM", "Cosmos", 44, 6, 0, 6, 8, false, null, "cosmos" ],
|
|
@@ -334,6 +331,7 @@ class gemini extends gemini$1 {
|
|
|
334
331
|
// }
|
|
335
332
|
//
|
|
336
333
|
const result = {};
|
|
334
|
+
this.options['tradingPairs'] = this.safeList(data, 'tradingPairs');
|
|
337
335
|
const currenciesArray = this.safeValue(data, 'currencies', []);
|
|
338
336
|
for (let i = 0; i < currenciesArray.length; i++) {
|
|
339
337
|
const currency = currenciesArray[i];
|
|
@@ -543,7 +541,7 @@ class gemini extends gemini$1 {
|
|
|
543
541
|
return result;
|
|
544
542
|
}
|
|
545
543
|
async fetchMarketsFromAPI(params = {}) {
|
|
546
|
-
const
|
|
544
|
+
const marketIdsRaw = await this.publicGetV1Symbols(params);
|
|
547
545
|
//
|
|
548
546
|
// [
|
|
549
547
|
// "btcusd",
|
|
@@ -551,93 +549,185 @@ class gemini extends gemini$1 {
|
|
|
551
549
|
// ...
|
|
552
550
|
// ]
|
|
553
551
|
//
|
|
554
|
-
const result =
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
552
|
+
const result = [];
|
|
553
|
+
const options = this.safeDict(this.options, 'fetchMarketsFromAPI', {});
|
|
554
|
+
const bugSymbol = 'efilfil'; // we skip this inexistent test symbol, which bugs other functions
|
|
555
|
+
const marketIds = [];
|
|
556
|
+
for (let i = 0; i < marketIdsRaw.length; i++) {
|
|
557
|
+
if (marketIdsRaw[i] !== bugSymbol) {
|
|
558
|
+
marketIds.push(marketIdsRaw[i]);
|
|
559
|
+
}
|
|
561
560
|
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
561
|
+
if (this.safeBool(options, 'fetchDetailsForAllSymbols', false)) {
|
|
562
|
+
const promises = [];
|
|
563
|
+
for (let i = 0; i < marketIds.length; i++) {
|
|
564
|
+
const marketId = marketIds[i];
|
|
565
|
+
const request = {
|
|
566
|
+
'symbol': marketId,
|
|
567
|
+
};
|
|
568
|
+
promises.push(this.publicGetV1SymbolsDetailsSymbol(this.extend(request, params)));
|
|
569
|
+
//
|
|
570
|
+
// {
|
|
571
|
+
// "symbol": "BTCUSD",
|
|
572
|
+
// "base_currency": "BTC",
|
|
573
|
+
// "quote_currency": "USD",
|
|
574
|
+
// "tick_size": 1E-8,
|
|
575
|
+
// "quote_increment": 0.01,
|
|
576
|
+
// "min_order_size": "0.00001",
|
|
577
|
+
// "status": "open",
|
|
578
|
+
// "wrap_enabled": false
|
|
579
|
+
// }
|
|
580
|
+
//
|
|
581
|
+
}
|
|
582
|
+
const responses = await Promise.all(promises);
|
|
583
|
+
for (let i = 0; i < responses.length; i++) {
|
|
584
|
+
result.push(this.parseMarket(responses[i]));
|
|
585
|
+
}
|
|
569
586
|
}
|
|
570
587
|
else {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
// "wrap_enabled": false
|
|
589
|
-
// }
|
|
590
|
-
//
|
|
591
|
-
}
|
|
592
|
-
promises = await Promise.all(promises);
|
|
593
|
-
for (let i = 0; i < promises.length; i++) {
|
|
594
|
-
const responseInner = promises[i];
|
|
595
|
-
const marketId = this.safeStringLower(responseInner, 'symbol');
|
|
596
|
-
result[marketId] = this.parseMarket(responseInner);
|
|
588
|
+
// use trading-pairs info, if it was fetched
|
|
589
|
+
const tradingPairs = this.safeList(this.options, 'tradingPairs');
|
|
590
|
+
if (tradingPairs !== undefined) {
|
|
591
|
+
const indexedTradingPairs = this.indexBy(tradingPairs, 0);
|
|
592
|
+
for (let i = 0; i < marketIds.length; i++) {
|
|
593
|
+
const marketId = marketIds[i];
|
|
594
|
+
const tradingPair = this.safeList(indexedTradingPairs, marketId.toUpperCase());
|
|
595
|
+
if (tradingPair !== undefined) {
|
|
596
|
+
result.push(this.parseMarket(tradingPair));
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
else {
|
|
601
|
+
for (let i = 0; i < marketIds.length; i++) {
|
|
602
|
+
result.push(this.parseMarket(marketIds[i]));
|
|
603
|
+
}
|
|
604
|
+
}
|
|
597
605
|
}
|
|
598
|
-
return
|
|
606
|
+
return result;
|
|
599
607
|
}
|
|
600
608
|
parseMarket(response) {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
609
|
+
//
|
|
610
|
+
// response might be:
|
|
611
|
+
//
|
|
612
|
+
// btcusd
|
|
613
|
+
//
|
|
614
|
+
// or
|
|
615
|
+
//
|
|
616
|
+
// [
|
|
617
|
+
// 'BTCUSD', // symbol
|
|
618
|
+
// 2, // priceTickDecimalPlaces
|
|
619
|
+
// 8, // quantityTickDecimalPlaces
|
|
620
|
+
// '0.00001', // quantityMinimum
|
|
621
|
+
// 10, // quantityRoundDecimalPlaces
|
|
622
|
+
// true // minimumsAreInclusive
|
|
623
|
+
// ],
|
|
624
|
+
//
|
|
625
|
+
// or
|
|
626
|
+
//
|
|
627
|
+
// {
|
|
628
|
+
// "symbol": "BTCUSD", // perpetuals have 'PERP' suffix, i.e. DOGEUSDPERP
|
|
629
|
+
// "base_currency": "BTC",
|
|
630
|
+
// "quote_currency": "USD",
|
|
631
|
+
// "tick_size": 1E-8,
|
|
632
|
+
// "quote_increment": 0.01,
|
|
633
|
+
// "min_order_size": "0.00001",
|
|
634
|
+
// "status": "open",
|
|
635
|
+
// "wrap_enabled": false
|
|
636
|
+
// "product_type": "swap", // only in perps
|
|
637
|
+
// "contract_type": "linear", // only in perps
|
|
638
|
+
// "contract_price_currency": "GUSD" // only in perps
|
|
639
|
+
// }
|
|
640
|
+
//
|
|
641
|
+
let marketId = undefined;
|
|
642
|
+
let baseId = undefined;
|
|
643
|
+
let quoteId = undefined;
|
|
644
|
+
let settleId = undefined;
|
|
645
|
+
let tickSize = undefined;
|
|
646
|
+
let increment = undefined;
|
|
647
|
+
let minSize = undefined;
|
|
648
|
+
let status = undefined;
|
|
649
|
+
let swap = false;
|
|
650
|
+
let contractSize = undefined;
|
|
651
|
+
let linear = undefined;
|
|
652
|
+
let inverse = undefined;
|
|
653
|
+
const isString = (typeof response === 'string');
|
|
654
|
+
const isArray = (Array.isArray(response));
|
|
655
|
+
if (!isString && !isArray) {
|
|
656
|
+
marketId = this.safeStringLower(response, 'symbol');
|
|
657
|
+
minSize = this.safeNumber(response, 'min_order_size');
|
|
658
|
+
tickSize = this.safeNumber(response, 'tick_size');
|
|
659
|
+
increment = this.safeNumber(response, 'quote_increment');
|
|
660
|
+
status = this.parseMarketActive(this.safeString(response, 'status'));
|
|
661
|
+
baseId = this.safeString(response, 'base_currency');
|
|
662
|
+
quoteId = this.safeString(response, 'quote_currency');
|
|
663
|
+
settleId = this.safeString(response, 'contract_price_currency');
|
|
664
|
+
}
|
|
665
|
+
else {
|
|
666
|
+
// if no detailed API was called, then parse either string or array
|
|
667
|
+
if (isString) {
|
|
668
|
+
marketId = response;
|
|
669
|
+
}
|
|
670
|
+
else {
|
|
671
|
+
marketId = this.safeStringLower(response, 0);
|
|
672
|
+
minSize = this.safeNumber(response, 3);
|
|
673
|
+
tickSize = this.parseNumber(this.parsePrecision(this.safeString(response, 1)));
|
|
674
|
+
increment = this.parseNumber(this.parsePrecision(this.safeString(response, 2)));
|
|
675
|
+
}
|
|
676
|
+
const marketIdUpper = marketId.toUpperCase();
|
|
677
|
+
const isPerp = (marketIdUpper.indexOf('PERP') >= 0);
|
|
678
|
+
const marketIdWithoutPerp = marketIdUpper.replace('PERP', '');
|
|
679
|
+
const quoteQurrencies = this.handleOption('fetchMarketsFromAPI', 'quoteCurrencies', []);
|
|
680
|
+
for (let i = 0; i < quoteQurrencies.length; i++) {
|
|
681
|
+
const quoteCurrency = quoteQurrencies[i];
|
|
682
|
+
if (marketIdWithoutPerp.endsWith(quoteCurrency)) {
|
|
683
|
+
baseId = marketIdWithoutPerp.replace(quoteCurrency, '');
|
|
684
|
+
quoteId = quoteCurrency;
|
|
685
|
+
if (isPerp) {
|
|
686
|
+
settleId = quoteCurrency; // always same
|
|
687
|
+
}
|
|
688
|
+
break;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
610
691
|
}
|
|
611
692
|
const base = this.safeCurrencyCode(baseId);
|
|
612
693
|
const quote = this.safeCurrencyCode(quoteId);
|
|
613
|
-
const
|
|
694
|
+
const settle = this.safeCurrencyCode(settleId);
|
|
695
|
+
let symbol = base + '/' + quote;
|
|
696
|
+
if (settleId !== undefined) {
|
|
697
|
+
symbol = symbol + ':' + settle;
|
|
698
|
+
swap = true;
|
|
699
|
+
contractSize = tickSize; // always same
|
|
700
|
+
linear = true; // always linear
|
|
701
|
+
inverse = false;
|
|
702
|
+
}
|
|
703
|
+
const type = swap ? 'swap' : 'spot';
|
|
614
704
|
return {
|
|
615
705
|
'id': marketId,
|
|
616
|
-
'symbol':
|
|
706
|
+
'symbol': symbol,
|
|
617
707
|
'base': base,
|
|
618
708
|
'quote': quote,
|
|
619
|
-
'settle':
|
|
709
|
+
'settle': settle,
|
|
620
710
|
'baseId': baseId,
|
|
621
711
|
'quoteId': quoteId,
|
|
622
|
-
'settleId':
|
|
623
|
-
'type':
|
|
624
|
-
'spot':
|
|
712
|
+
'settleId': settleId,
|
|
713
|
+
'type': type,
|
|
714
|
+
'spot': !swap,
|
|
625
715
|
'margin': false,
|
|
626
|
-
'swap':
|
|
716
|
+
'swap': swap,
|
|
627
717
|
'future': false,
|
|
628
718
|
'option': false,
|
|
629
|
-
'active':
|
|
630
|
-
'contract':
|
|
631
|
-
'linear':
|
|
632
|
-
'inverse':
|
|
633
|
-
'contractSize':
|
|
719
|
+
'active': status,
|
|
720
|
+
'contract': swap,
|
|
721
|
+
'linear': linear,
|
|
722
|
+
'inverse': inverse,
|
|
723
|
+
'contractSize': contractSize,
|
|
634
724
|
'expiry': undefined,
|
|
635
725
|
'expiryDatetime': undefined,
|
|
636
726
|
'strike': undefined,
|
|
637
727
|
'optionType': undefined,
|
|
638
728
|
'precision': {
|
|
639
|
-
'price':
|
|
640
|
-
'amount':
|
|
729
|
+
'price': increment,
|
|
730
|
+
'amount': tickSize,
|
|
641
731
|
},
|
|
642
732
|
'limits': {
|
|
643
733
|
'leverage': {
|
|
@@ -645,7 +735,7 @@ class gemini extends gemini$1 {
|
|
|
645
735
|
'max': undefined,
|
|
646
736
|
},
|
|
647
737
|
'amount': {
|
|
648
|
-
'min':
|
|
738
|
+
'min': minSize,
|
|
649
739
|
'max': undefined,
|
|
650
740
|
},
|
|
651
741
|
'price': {
|
package/dist/cjs/src/hitbtc.js
CHANGED
|
@@ -315,6 +315,7 @@ class hitbtc extends hitbtc$1 {
|
|
|
315
315
|
'2012': errors.BadRequest,
|
|
316
316
|
'2020': errors.BadRequest,
|
|
317
317
|
'2022': errors.BadRequest,
|
|
318
|
+
'2024': errors.InvalidOrder,
|
|
318
319
|
'10001': errors.BadRequest,
|
|
319
320
|
'10021': errors.AccountSuspended,
|
|
320
321
|
'10022': errors.BadRequest,
|
|
@@ -332,6 +333,7 @@ class hitbtc extends hitbtc$1 {
|
|
|
332
333
|
'20012': errors.ExchangeError,
|
|
333
334
|
'20014': errors.ExchangeError,
|
|
334
335
|
'20016': errors.ExchangeError,
|
|
336
|
+
'20018': errors.ExchangeError,
|
|
335
337
|
'20031': errors.ExchangeError,
|
|
336
338
|
'20032': errors.ExchangeError,
|
|
337
339
|
'20033': errors.ExchangeError,
|
|
@@ -342,10 +344,15 @@ class hitbtc extends hitbtc$1 {
|
|
|
342
344
|
'20043': errors.ExchangeError,
|
|
343
345
|
'20044': errors.PermissionDenied,
|
|
344
346
|
'20045': errors.InvalidOrder,
|
|
347
|
+
'20047': errors.InvalidOrder,
|
|
348
|
+
'20048': errors.InvalidOrder,
|
|
349
|
+
'20049': errors.InvalidOrder,
|
|
345
350
|
'20080': errors.ExchangeError,
|
|
346
351
|
'21001': errors.ExchangeError,
|
|
347
352
|
'21003': errors.AccountSuspended,
|
|
348
353
|
'21004': errors.AccountSuspended,
|
|
354
|
+
'22004': errors.ExchangeError,
|
|
355
|
+
'22008': errors.ExchangeError, // Gateway timeout exceeded.
|
|
349
356
|
},
|
|
350
357
|
'broad': {},
|
|
351
358
|
},
|
package/dist/cjs/src/htx.js
CHANGED
|
@@ -467,6 +467,7 @@ class htx extends htx$1 {
|
|
|
467
467
|
'v2/sub-user/api-key-modification': 1,
|
|
468
468
|
'v2/sub-user/api-key-deletion': 1,
|
|
469
469
|
'v1/subuser/transfer': 10,
|
|
470
|
+
'v1/trust/user/active/credit': 10,
|
|
470
471
|
// Trading
|
|
471
472
|
'v1/order/orders/place': 0.2,
|
|
472
473
|
'v1/order/batch-orders': 0.4,
|
|
@@ -882,13 +882,16 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
882
882
|
}
|
|
883
883
|
orderReq.push(orderObj);
|
|
884
884
|
}
|
|
885
|
+
const vaultAddress = this.safeString(params, 'vaultAddress');
|
|
885
886
|
const orderAction = {
|
|
886
887
|
'type': 'order',
|
|
887
888
|
'orders': orderReq,
|
|
888
889
|
'grouping': 'na',
|
|
889
|
-
'brokerCode': 1,
|
|
890
|
+
// 'brokerCode': 1, // cant
|
|
890
891
|
};
|
|
891
|
-
|
|
892
|
+
if (vaultAddress === undefined) {
|
|
893
|
+
orderAction['brokerCode'] = 1;
|
|
894
|
+
}
|
|
892
895
|
const signature = this.signL1Action(orderAction, nonce, vaultAddress);
|
|
893
896
|
const request = {
|
|
894
897
|
'action': orderAction,
|