ccxt 4.4.78 → 4.4.82
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 +8 -12
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/apex.js +21 -31
- package/dist/cjs/src/ascendex.js +26 -5
- package/dist/cjs/src/base/Exchange.js +26 -3
- package/dist/cjs/src/base/functions/encode.js +1 -1
- package/dist/cjs/src/bigone.js +22 -14
- package/dist/cjs/src/binance.js +8 -0
- package/dist/cjs/src/bingx.js +16 -40
- package/dist/cjs/src/bitfinex.js +128 -88
- package/dist/cjs/src/bitget.js +60 -71
- package/dist/cjs/src/bitmart.js +7 -2
- package/dist/cjs/src/bitmex.js +12 -4
- package/dist/cjs/src/bitopro.js +5 -1
- package/dist/cjs/src/bitrue.js +2 -1
- package/dist/cjs/src/bitso.js +1 -1
- package/dist/cjs/src/bitteam.js +2 -0
- package/dist/cjs/src/bitvavo.js +28 -10
- package/dist/cjs/src/btcalpha.js +1 -1
- package/dist/cjs/src/btcmarkets.js +1 -1
- package/dist/cjs/src/btcturk.js +1 -1
- package/dist/cjs/src/bybit.js +34 -16
- package/dist/cjs/src/coinbase.js +4 -17
- package/dist/cjs/src/coinex.js +1 -0
- package/dist/cjs/src/coinlist.js +1 -0
- package/dist/cjs/src/coinone.js +1 -0
- package/dist/cjs/src/delta.js +4 -0
- package/dist/cjs/src/deribit.js +1 -0
- package/dist/cjs/src/hollaex.js +1 -0
- package/dist/cjs/src/htx.js +9 -5
- package/dist/cjs/src/huobijp.js +1 -0
- package/dist/cjs/src/hyperliquid.js +16 -0
- package/dist/cjs/src/kraken.js +2 -0
- package/dist/cjs/src/okx.js +2 -3
- package/dist/cjs/src/oxfun.js +21 -1
- package/dist/cjs/src/poloniex.js +1 -0
- package/dist/cjs/src/pro/binance.js +3 -3
- package/dist/cjs/src/pro/coinbase.js +43 -62
- package/dist/cjs/src/pro/hyperliquid.js +10 -2
- package/dist/cjs/src/pro/upbit.js +43 -0
- package/dist/cjs/src/timex.js +2 -2
- package/dist/cjs/src/upbit.js +43 -21
- package/dist/cjs/src/whitebit.js +65 -12
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitmart.d.ts +1 -0
- package/js/src/apex.js +21 -31
- package/js/src/ascendex.js +26 -5
- package/js/src/base/Exchange.d.ts +2 -1
- package/js/src/base/Exchange.js +26 -3
- package/js/src/base/functions/encode.d.ts +1 -1
- package/js/src/base/functions/encode.js +1 -1
- package/js/src/bigone.js +22 -14
- package/js/src/binance.js +8 -0
- package/js/src/bingx.d.ts +1 -1
- package/js/src/bingx.js +16 -40
- package/js/src/bitfinex.js +128 -88
- package/js/src/bitget.d.ts +1 -0
- package/js/src/bitget.js +60 -71
- package/js/src/bitmart.d.ts +1 -0
- package/js/src/bitmart.js +7 -2
- package/js/src/bitmex.js +12 -4
- package/js/src/bitopro.js +5 -1
- package/js/src/bitrue.js +2 -1
- package/js/src/bitso.js +1 -1
- package/js/src/bitteam.js +2 -0
- package/js/src/bitvavo.js +28 -10
- package/js/src/btcalpha.js +1 -1
- package/js/src/btcmarkets.js +1 -1
- package/js/src/btcturk.js +1 -1
- package/js/src/bybit.js +34 -16
- package/js/src/coinbase.d.ts +0 -2
- package/js/src/coinbase.js +4 -17
- package/js/src/coinex.js +1 -0
- package/js/src/coinlist.js +1 -0
- package/js/src/coinone.js +1 -0
- package/js/src/delta.js +4 -0
- package/js/src/deribit.js +1 -0
- package/js/src/hollaex.js +1 -0
- package/js/src/htx.js +9 -5
- package/js/src/huobijp.js +1 -0
- package/js/src/hyperliquid.js +16 -0
- package/js/src/kraken.js +2 -0
- package/js/src/okx.js +2 -3
- package/js/src/oxfun.d.ts +10 -0
- package/js/src/oxfun.js +21 -1
- package/js/src/poloniex.js +1 -0
- package/js/src/pro/binance.js +3 -3
- package/js/src/pro/coinbase.d.ts +4 -3
- package/js/src/pro/coinbase.js +43 -60
- package/js/src/pro/hyperliquid.js +10 -2
- package/js/src/pro/upbit.d.ts +16 -1
- package/js/src/pro/upbit.js +43 -0
- package/js/src/timex.js +2 -2
- package/js/src/upbit.d.ts +42 -20
- package/js/src/upbit.js +43 -21
- package/js/src/whitebit.js +65 -12
- package/package.json +1 -1
package/js/src/bitmex.js
CHANGED
|
@@ -498,6 +498,7 @@ export default class bitmex extends Exchange {
|
|
|
498
498
|
const maxWithdrawal = this.parseNumber(Precise.stringMul(maxWithdrawalString, precisionString));
|
|
499
499
|
const minDepositString = this.safeString(currency, 'minDepositAmount');
|
|
500
500
|
const minDeposit = this.parseNumber(Precise.stringMul(minDepositString, precisionString));
|
|
501
|
+
const isCrypto = this.safeString(currency, 'currencyType') === 'Crypto';
|
|
501
502
|
result[code] = {
|
|
502
503
|
'id': id,
|
|
503
504
|
'code': code,
|
|
@@ -523,6 +524,7 @@ export default class bitmex extends Exchange {
|
|
|
523
524
|
},
|
|
524
525
|
},
|
|
525
526
|
'networks': networks,
|
|
527
|
+
'type': isCrypto ? 'crypto' : 'other',
|
|
526
528
|
};
|
|
527
529
|
}
|
|
528
530
|
return result;
|
|
@@ -731,9 +733,9 @@ export default class bitmex extends Exchange {
|
|
|
731
733
|
const quote = this.safeCurrencyCode(quoteId);
|
|
732
734
|
const contract = swap || future;
|
|
733
735
|
let contractSize = undefined;
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
736
|
+
let isInverse = this.safeValue(market, 'isInverse'); // this is true when BASE and SETTLE are same, i.e. BTC/XXX:BTC
|
|
737
|
+
let isQuanto = this.safeValue(market, 'isQuanto'); // this is true when BASE and SETTLE are different, i.e. AXS/XXX:BTC
|
|
738
|
+
let linear = contract ? (!isInverse && !isQuanto) : undefined;
|
|
737
739
|
const status = this.safeString(market, 'state');
|
|
738
740
|
const active = status === 'Open'; // Open, Settled, Unlisted
|
|
739
741
|
let expiry = undefined;
|
|
@@ -768,6 +770,12 @@ export default class bitmex extends Exchange {
|
|
|
768
770
|
const maxOrderQty = this.safeNumber(market, 'maxOrderQty');
|
|
769
771
|
const initMargin = this.safeString(market, 'initMargin', '1');
|
|
770
772
|
const maxLeverage = this.parseNumber(Precise.stringDiv('1', initMargin));
|
|
773
|
+
// subtype should be undefined for spot markets
|
|
774
|
+
if (spot) {
|
|
775
|
+
isInverse = undefined;
|
|
776
|
+
isQuanto = undefined;
|
|
777
|
+
linear = undefined;
|
|
778
|
+
}
|
|
771
779
|
return {
|
|
772
780
|
'id': id,
|
|
773
781
|
'symbol': symbol,
|
|
@@ -817,7 +825,7 @@ export default class bitmex extends Exchange {
|
|
|
817
825
|
'max': positionIsQuote ? maxOrderQty : undefined,
|
|
818
826
|
},
|
|
819
827
|
},
|
|
820
|
-
'created':
|
|
828
|
+
'created': undefined,
|
|
821
829
|
'info': market,
|
|
822
830
|
};
|
|
823
831
|
}
|
package/js/src/bitopro.js
CHANGED
|
@@ -240,6 +240,7 @@ export default class bitopro extends Exchange {
|
|
|
240
240
|
'BEP20': 'BSC',
|
|
241
241
|
'BSC': 'BSC',
|
|
242
242
|
},
|
|
243
|
+
'fiatCurrencies': ['TWD'], // the only fiat currency for exchange
|
|
243
244
|
},
|
|
244
245
|
'features': {
|
|
245
246
|
'spot': {
|
|
@@ -367,6 +368,7 @@ export default class bitopro extends Exchange {
|
|
|
367
368
|
// }
|
|
368
369
|
//
|
|
369
370
|
const result = {};
|
|
371
|
+
const fiatCurrencies = this.safeList(this.options, 'fiatCurrencies', []);
|
|
370
372
|
for (let i = 0; i < currencies.length; i++) {
|
|
371
373
|
const currency = currencies[i];
|
|
372
374
|
const currencyId = this.safeString(currency, 'currency');
|
|
@@ -386,11 +388,12 @@ export default class bitopro extends Exchange {
|
|
|
386
388
|
'max': undefined,
|
|
387
389
|
},
|
|
388
390
|
};
|
|
391
|
+
const isFiat = this.inArray(code, fiatCurrencies);
|
|
389
392
|
result[code] = {
|
|
390
393
|
'id': currencyId,
|
|
391
394
|
'code': code,
|
|
392
395
|
'info': currency,
|
|
393
|
-
'type':
|
|
396
|
+
'type': isFiat ? 'fiat' : 'crypto',
|
|
394
397
|
'name': undefined,
|
|
395
398
|
'active': deposit && withdraw,
|
|
396
399
|
'deposit': deposit,
|
|
@@ -398,6 +401,7 @@ export default class bitopro extends Exchange {
|
|
|
398
401
|
'fee': fee,
|
|
399
402
|
'precision': undefined,
|
|
400
403
|
'limits': limits,
|
|
404
|
+
'networks': undefined,
|
|
401
405
|
};
|
|
402
406
|
}
|
|
403
407
|
return result;
|
package/js/src/bitrue.js
CHANGED
|
@@ -822,7 +822,8 @@ export default class bitrue extends Exchange {
|
|
|
822
822
|
'withdraw': withdraw,
|
|
823
823
|
'networks': networks,
|
|
824
824
|
'fee': this.parseNumber(minWithdrawFeeString),
|
|
825
|
-
|
|
825
|
+
'fees': undefined,
|
|
826
|
+
'type': 'crypto',
|
|
826
827
|
'limits': {
|
|
827
828
|
'withdraw': {
|
|
828
829
|
'min': this.parseNumber(minWithdrawString),
|
package/js/src/bitso.js
CHANGED
|
@@ -754,7 +754,7 @@ export default class bitso extends Exchange {
|
|
|
754
754
|
// {
|
|
755
755
|
// "bucket_start_time":1648219140000,
|
|
756
756
|
// "first_trade_time":1648219154990,
|
|
757
|
-
// "last_trade_time":
|
|
757
|
+
// "last_trade_time":1648219189442,
|
|
758
758
|
// "first_rate":"44958.60",
|
|
759
759
|
// "last_rate":"44979.88",
|
|
760
760
|
// "min_rate":"44957.33",
|
package/js/src/bitteam.js
CHANGED
|
@@ -647,6 +647,7 @@ export default class bitteam extends Exchange {
|
|
|
647
647
|
const networkIds = Object.keys(feesByNetworkId);
|
|
648
648
|
const networks = {};
|
|
649
649
|
const networkPrecision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals')));
|
|
650
|
+
const typeRaw = this.safeString(currency, 'type');
|
|
650
651
|
for (let j = 0; j < networkIds.length; j++) {
|
|
651
652
|
const networkId = networkIds[j];
|
|
652
653
|
const networkCode = this.networkIdToCode(networkId, code);
|
|
@@ -701,6 +702,7 @@ export default class bitteam extends Exchange {
|
|
|
701
702
|
'max': undefined,
|
|
702
703
|
},
|
|
703
704
|
},
|
|
705
|
+
'type': typeRaw,
|
|
704
706
|
'networks': networks,
|
|
705
707
|
};
|
|
706
708
|
}
|
package/js/src/bitvavo.js
CHANGED
|
@@ -346,6 +346,8 @@ export default class bitvavo extends Exchange {
|
|
|
346
346
|
'ERC20': 'ETH',
|
|
347
347
|
'TRC20': 'TRX',
|
|
348
348
|
},
|
|
349
|
+
'operatorId': undefined,
|
|
350
|
+
'fiatCurrencies': ['EUR'], // only fiat atm
|
|
349
351
|
},
|
|
350
352
|
'precisionMode': SIGNIFICANT_DIGITS,
|
|
351
353
|
'commonCurrencies': {
|
|
@@ -555,24 +557,24 @@ export default class bitvavo extends Exchange {
|
|
|
555
557
|
// },
|
|
556
558
|
// ]
|
|
557
559
|
//
|
|
560
|
+
const fiatCurrencies = this.safeList(this.options, 'fiatCurrencies', []);
|
|
558
561
|
const result = {};
|
|
559
562
|
for (let i = 0; i < currencies.length; i++) {
|
|
560
563
|
const currency = currencies[i];
|
|
561
564
|
const id = this.safeString(currency, 'symbol');
|
|
562
565
|
const code = this.safeCurrencyCode(id);
|
|
566
|
+
const isFiat = this.inArray(code, fiatCurrencies);
|
|
563
567
|
const networks = {};
|
|
564
|
-
const networksArray = this.
|
|
565
|
-
const
|
|
566
|
-
const
|
|
567
|
-
const deposit = (this.safeValue(currency, 'depositStatus') === 'OK');
|
|
568
|
-
const withdrawal = (this.safeValue(currency, 'withdrawalStatus') === 'OK');
|
|
568
|
+
const networksArray = this.safeList(currency, 'networks', []);
|
|
569
|
+
const deposit = this.safeString(currency, 'depositStatus') === 'OK';
|
|
570
|
+
const withdrawal = this.safeString(currency, 'withdrawalStatus') === 'OK';
|
|
569
571
|
const active = deposit && withdrawal;
|
|
570
572
|
const withdrawFee = this.safeNumber(currency, 'withdrawalFee');
|
|
571
573
|
const precision = this.safeInteger(currency, 'decimals', 8);
|
|
572
574
|
const minWithdraw = this.safeNumber(currency, 'withdrawalMinAmount');
|
|
573
|
-
// absolutely all of them have 1 network atm
|
|
574
|
-
|
|
575
|
-
const networkId = networksArray[
|
|
575
|
+
// btw, absolutely all of them have 1 network atm
|
|
576
|
+
for (let j = 0; j < networksArray.length; j++) {
|
|
577
|
+
const networkId = networksArray[j];
|
|
576
578
|
const networkCode = this.networkIdToCode(networkId);
|
|
577
579
|
networks[networkCode] = {
|
|
578
580
|
'info': currency,
|
|
@@ -591,7 +593,7 @@ export default class bitvavo extends Exchange {
|
|
|
591
593
|
},
|
|
592
594
|
};
|
|
593
595
|
}
|
|
594
|
-
result[code] = {
|
|
596
|
+
result[code] = this.safeCurrencyStructure({
|
|
595
597
|
'info': currency,
|
|
596
598
|
'id': id,
|
|
597
599
|
'code': code,
|
|
@@ -602,6 +604,7 @@ export default class bitvavo extends Exchange {
|
|
|
602
604
|
'networks': networks,
|
|
603
605
|
'fee': withdrawFee,
|
|
604
606
|
'precision': precision,
|
|
607
|
+
'type': isFiat ? 'fiat' : 'crypto',
|
|
605
608
|
'limits': {
|
|
606
609
|
'amount': {
|
|
607
610
|
'min': undefined,
|
|
@@ -616,7 +619,7 @@ export default class bitvavo extends Exchange {
|
|
|
616
619
|
'max': undefined,
|
|
617
620
|
},
|
|
618
621
|
},
|
|
619
|
-
};
|
|
622
|
+
});
|
|
620
623
|
}
|
|
621
624
|
// set currencies here to avoid calling publicGetAssets twice
|
|
622
625
|
this.currencies = this.deepExtend(this.currencies, result);
|
|
@@ -1186,6 +1189,11 @@ export default class bitvavo extends Exchange {
|
|
|
1186
1189
|
if (postOnly) {
|
|
1187
1190
|
request['postOnly'] = true;
|
|
1188
1191
|
}
|
|
1192
|
+
let operatorId = undefined;
|
|
1193
|
+
[operatorId, params] = this.handleOptionAndParams(params, 'createOrder', 'operatorId');
|
|
1194
|
+
if (operatorId !== undefined) {
|
|
1195
|
+
request['operatorId'] = this.parseToInt(operatorId);
|
|
1196
|
+
}
|
|
1189
1197
|
return this.extend(request, params);
|
|
1190
1198
|
}
|
|
1191
1199
|
/**
|
|
@@ -1285,6 +1293,11 @@ export default class bitvavo extends Exchange {
|
|
|
1285
1293
|
if (clientOrderId === undefined) {
|
|
1286
1294
|
request['orderId'] = id;
|
|
1287
1295
|
}
|
|
1296
|
+
let operatorId = undefined;
|
|
1297
|
+
[operatorId, params] = this.handleOptionAndParams(params, 'editOrder', 'operatorId');
|
|
1298
|
+
if (operatorId !== undefined) {
|
|
1299
|
+
request['operatorId'] = this.parseToInt(operatorId);
|
|
1300
|
+
}
|
|
1288
1301
|
request['market'] = market['id'];
|
|
1289
1302
|
return request;
|
|
1290
1303
|
}
|
|
@@ -1321,6 +1334,11 @@ export default class bitvavo extends Exchange {
|
|
|
1321
1334
|
if (clientOrderId === undefined) {
|
|
1322
1335
|
request['orderId'] = id;
|
|
1323
1336
|
}
|
|
1337
|
+
let operatorId = undefined;
|
|
1338
|
+
[operatorId, params] = this.handleOptionAndParams(params, 'cancelOrder', 'operatorId');
|
|
1339
|
+
if (operatorId !== undefined) {
|
|
1340
|
+
request['operatorId'] = this.parseToInt(operatorId);
|
|
1341
|
+
}
|
|
1324
1342
|
return this.extend(request, params);
|
|
1325
1343
|
}
|
|
1326
1344
|
/**
|
package/js/src/btcalpha.js
CHANGED
package/js/src/btcmarkets.js
CHANGED
|
@@ -457,7 +457,7 @@ export default class btcmarkets extends Exchange {
|
|
|
457
457
|
// "marketId":"COMP-AUD",
|
|
458
458
|
// "baseAssetName":"COMP",
|
|
459
459
|
// "quoteAssetName":"AUD",
|
|
460
|
-
// "minOrderAmount":"0.
|
|
460
|
+
// "minOrderAmount":"0.00006",
|
|
461
461
|
// "maxOrderAmount":"1000000",
|
|
462
462
|
// "amountDecimals":"8",
|
|
463
463
|
// "priceDecimals":"2",
|
package/js/src/btcturk.js
CHANGED
|
@@ -245,7 +245,7 @@ export default class btcturk extends Exchange {
|
|
|
245
245
|
// "minPrice": "0.0000000000001",
|
|
246
246
|
// "maxPrice": "10000000",
|
|
247
247
|
// "tickSize": "10",
|
|
248
|
-
// "minExchangeValue": "99.
|
|
248
|
+
// "minExchangeValue": "99.92",
|
|
249
249
|
// "minAmount": null,
|
|
250
250
|
// "maxAmount": null
|
|
251
251
|
// }
|
package/js/src/bybit.js
CHANGED
|
@@ -1026,9 +1026,6 @@ export default class bybit extends Exchange {
|
|
|
1026
1026
|
'usePrivateInstrumentsInfo': false,
|
|
1027
1027
|
'enableDemoTrading': false,
|
|
1028
1028
|
'fetchMarkets': ['spot', 'linear', 'inverse', 'option'],
|
|
1029
|
-
'createOrder': {
|
|
1030
|
-
'method': 'privatePostV5OrderCreate', // 'privatePostV5PositionTradingStop'
|
|
1031
|
-
},
|
|
1032
1029
|
'enableUnifiedMargin': undefined,
|
|
1033
1030
|
'enableUnifiedAccount': undefined,
|
|
1034
1031
|
'unifiedMarginStatus': undefined,
|
|
@@ -1720,6 +1717,7 @@ export default class bybit extends Exchange {
|
|
|
1720
1717
|
},
|
|
1721
1718
|
},
|
|
1722
1719
|
'networks': networks,
|
|
1720
|
+
'type': 'crypto', // atm exchange api provides only cryptos
|
|
1723
1721
|
};
|
|
1724
1722
|
}
|
|
1725
1723
|
return result;
|
|
@@ -2178,6 +2176,7 @@ export default class bybit extends Exchange {
|
|
|
2178
2176
|
const strike = this.safeString(splitId, 2);
|
|
2179
2177
|
const optionLetter = this.safeString(splitId, 3);
|
|
2180
2178
|
const isActive = (status === 'Trading');
|
|
2179
|
+
const isInverse = base === settle;
|
|
2181
2180
|
if (isActive || (this.options['loadAllOptions']) || (this.options['loadExpiredOptions'])) {
|
|
2182
2181
|
result.push(this.safeMarketStructure({
|
|
2183
2182
|
'id': id,
|
|
@@ -2189,7 +2188,7 @@ export default class bybit extends Exchange {
|
|
|
2189
2188
|
'quoteId': quoteId,
|
|
2190
2189
|
'settleId': settleId,
|
|
2191
2190
|
'type': 'option',
|
|
2192
|
-
'subType':
|
|
2191
|
+
'subType': undefined,
|
|
2193
2192
|
'spot': false,
|
|
2194
2193
|
'margin': false,
|
|
2195
2194
|
'swap': false,
|
|
@@ -2197,8 +2196,8 @@ export default class bybit extends Exchange {
|
|
|
2197
2196
|
'option': true,
|
|
2198
2197
|
'active': isActive,
|
|
2199
2198
|
'contract': true,
|
|
2200
|
-
'linear':
|
|
2201
|
-
'inverse':
|
|
2199
|
+
'linear': !isInverse,
|
|
2200
|
+
'inverse': isInverse,
|
|
2202
2201
|
'taker': this.safeNumber(market, 'takerFee', this.parseNumber('0.0006')),
|
|
2203
2202
|
'maker': this.safeNumber(market, 'makerFee', this.parseNumber('0.0001')),
|
|
2204
2203
|
'contractSize': this.parseNumber('1'),
|
|
@@ -3947,12 +3946,23 @@ export default class bybit extends Exchange {
|
|
|
3947
3946
|
const parts = await this.isUnifiedEnabled();
|
|
3948
3947
|
const enableUnifiedAccount = parts[1];
|
|
3949
3948
|
const trailingAmount = this.safeString2(params, 'trailingAmount', 'trailingStop');
|
|
3949
|
+
const stopLossPrice = this.safeString(params, 'stopLossPrice');
|
|
3950
|
+
const takeProfitPrice = this.safeString(params, 'takeProfitPrice');
|
|
3950
3951
|
const isTrailingAmountOrder = trailingAmount !== undefined;
|
|
3952
|
+
const isStopLoss = stopLossPrice !== undefined;
|
|
3953
|
+
const isTakeProfit = takeProfitPrice !== undefined;
|
|
3951
3954
|
const orderRequest = this.createOrderRequest(symbol, type, side, amount, price, params, enableUnifiedAccount);
|
|
3952
|
-
|
|
3953
|
-
|
|
3955
|
+
let defaultMethod = undefined;
|
|
3956
|
+
if (isTrailingAmountOrder || isStopLoss || isTakeProfit) {
|
|
3957
|
+
defaultMethod = 'privatePostV5PositionTradingStop';
|
|
3958
|
+
}
|
|
3959
|
+
else {
|
|
3960
|
+
defaultMethod = 'privatePostV5OrderCreate';
|
|
3961
|
+
}
|
|
3962
|
+
let method = undefined;
|
|
3963
|
+
[method, params] = this.handleOptionAndParams(params, 'createOrder', 'method', defaultMethod);
|
|
3954
3964
|
let response = undefined;
|
|
3955
|
-
if (
|
|
3965
|
+
if (method === 'privatePostV5PositionTradingStop') {
|
|
3956
3966
|
response = await this.privatePostV5PositionTradingStop(orderRequest);
|
|
3957
3967
|
}
|
|
3958
3968
|
else {
|
|
@@ -3980,8 +3990,6 @@ export default class bybit extends Exchange {
|
|
|
3980
3990
|
if ((price === undefined) && (lowerCaseType === 'limit')) {
|
|
3981
3991
|
throw new ArgumentsRequired(this.id + ' createOrder requires a price argument for limit orders');
|
|
3982
3992
|
}
|
|
3983
|
-
let defaultMethod = undefined;
|
|
3984
|
-
[defaultMethod, params] = this.handleOptionAndParams(params, 'createOrder', 'method', 'privatePostV5OrderCreate');
|
|
3985
3993
|
const request = {
|
|
3986
3994
|
'symbol': market['id'],
|
|
3987
3995
|
// 'side': this.capitalize (side),
|
|
@@ -4025,7 +4033,16 @@ export default class bybit extends Exchange {
|
|
|
4025
4033
|
const isMarket = lowerCaseType === 'market';
|
|
4026
4034
|
const isLimit = lowerCaseType === 'limit';
|
|
4027
4035
|
const isBuy = side === 'buy';
|
|
4028
|
-
|
|
4036
|
+
let defaultMethod = undefined;
|
|
4037
|
+
if (isTrailingAmountOrder || isStopLossTriggerOrder || isTakeProfitTriggerOrder) {
|
|
4038
|
+
defaultMethod = 'privatePostV5PositionTradingStop';
|
|
4039
|
+
}
|
|
4040
|
+
else {
|
|
4041
|
+
defaultMethod = 'privatePostV5OrderCreate';
|
|
4042
|
+
}
|
|
4043
|
+
let method = undefined;
|
|
4044
|
+
[method, params] = this.handleOptionAndParams(params, 'createOrder', 'method', defaultMethod);
|
|
4045
|
+
const isAlternativeEndpoint = method === 'privatePostV5PositionTradingStop';
|
|
4029
4046
|
const amountString = this.getAmount(symbol, amount);
|
|
4030
4047
|
const priceString = (price !== undefined) ? this.getPrice(symbol, this.numberToString(price)) : undefined;
|
|
4031
4048
|
if (isTrailingAmountOrder || isAlternativeEndpoint) {
|
|
@@ -4095,15 +4112,15 @@ export default class bybit extends Exchange {
|
|
|
4095
4112
|
if (market['spot']) {
|
|
4096
4113
|
request['category'] = 'spot';
|
|
4097
4114
|
}
|
|
4115
|
+
else if (market['option']) {
|
|
4116
|
+
request['category'] = 'option';
|
|
4117
|
+
}
|
|
4098
4118
|
else if (market['linear']) {
|
|
4099
4119
|
request['category'] = 'linear';
|
|
4100
4120
|
}
|
|
4101
4121
|
else if (market['inverse']) {
|
|
4102
4122
|
request['category'] = 'inverse';
|
|
4103
4123
|
}
|
|
4104
|
-
else if (market['option']) {
|
|
4105
|
-
request['category'] = 'option';
|
|
4106
|
-
}
|
|
4107
4124
|
const cost = this.safeString(params, 'cost');
|
|
4108
4125
|
params = this.omit(params, 'cost');
|
|
4109
4126
|
// if the cost is inferable, let's keep the old logic and ignore marketUnit, to minimize the impact of the changes
|
|
@@ -5981,7 +5998,8 @@ export default class bybit extends Exchange {
|
|
|
5981
5998
|
[subType, params] = this.handleSubTypeAndParams('fetchLedger', undefined, params);
|
|
5982
5999
|
let response = undefined;
|
|
5983
6000
|
if (enableUnified[1]) {
|
|
5984
|
-
|
|
6001
|
+
const unifiedMarginStatus = this.safeInteger(this.options, 'unifiedMarginStatus', 5); // 3/4 uta 1.0, 5/6 uta 2.0
|
|
6002
|
+
if (subType === 'inverse' && (unifiedMarginStatus < 5)) {
|
|
5985
6003
|
response = await this.privateGetV5AccountContractTransactionLog(this.extend(request, params));
|
|
5986
6004
|
}
|
|
5987
6005
|
else {
|
package/js/src/coinbase.d.ts
CHANGED
|
@@ -136,8 +136,6 @@ export default class coinbase extends Exchange {
|
|
|
136
136
|
fetchMarkets(params?: {}): Promise<Market[]>;
|
|
137
137
|
fetchMarketsV2(params?: {}): Promise<Market[]>;
|
|
138
138
|
fetchMarketsV3(params?: {}): Promise<Market[]>;
|
|
139
|
-
market(symbol: string): MarketInterface;
|
|
140
|
-
safeMarket(marketId?: Str, market?: Market, delimiter?: Str, marketType?: Str): MarketInterface;
|
|
141
139
|
parseSpotMarket(market: any, feeTier: any): MarketInterface;
|
|
142
140
|
parseContractMarket(market: any, feeTier: any): MarketInterface;
|
|
143
141
|
fetchCurrenciesFromCache(params?: {}): Promise<import("./base/types.js").Dictionary<any>>;
|
package/js/src/coinbase.js
CHANGED
|
@@ -378,8 +378,7 @@ export default class coinbase extends Exchange {
|
|
|
378
378
|
'fetchAccounts': 'fetchAccountsV3',
|
|
379
379
|
'fetchBalance': 'v2PrivateGetAccounts',
|
|
380
380
|
'fetchTime': 'v2PublicGetTime',
|
|
381
|
-
'user_native_currency': 'USD',
|
|
382
|
-
'aliasCbMarketIds': {},
|
|
381
|
+
'user_native_currency': 'USD', // needed to get fees for v3
|
|
383
382
|
},
|
|
384
383
|
'features': {
|
|
385
384
|
'default': {
|
|
@@ -1513,8 +1512,6 @@ export default class coinbase extends Exchange {
|
|
|
1513
1512
|
for (let i = 0; i < perpetualData.length; i++) {
|
|
1514
1513
|
result.push(this.parseContractMarket(perpetualData[i], perpetualFeeTier));
|
|
1515
1514
|
}
|
|
1516
|
-
// remove aliases
|
|
1517
|
-
this.options['aliasCbMarketIds'] = {};
|
|
1518
1515
|
const newMarkets = [];
|
|
1519
1516
|
for (let i = 0; i < result.length; i++) {
|
|
1520
1517
|
const market = result[i];
|
|
@@ -1522,25 +1519,15 @@ export default class coinbase extends Exchange {
|
|
|
1522
1519
|
const realMarketIds = this.safeList(info, 'alias_to', []);
|
|
1523
1520
|
const length = realMarketIds.length;
|
|
1524
1521
|
if (length > 0) {
|
|
1525
|
-
|
|
1526
|
-
this.options['aliasCbMarketIds'][market['symbol']] = realMarketIds[0];
|
|
1522
|
+
market['alias'] = realMarketIds[0];
|
|
1527
1523
|
}
|
|
1528
1524
|
else {
|
|
1529
|
-
|
|
1525
|
+
market['alias'] = undefined;
|
|
1530
1526
|
}
|
|
1527
|
+
newMarkets.push(market);
|
|
1531
1528
|
}
|
|
1532
1529
|
return newMarkets;
|
|
1533
1530
|
}
|
|
1534
|
-
market(symbol) {
|
|
1535
|
-
const finalSymbol = this.safeString(this.options['aliasCbMarketIds'], symbol, symbol);
|
|
1536
|
-
return super.market(finalSymbol);
|
|
1537
|
-
}
|
|
1538
|
-
safeMarket(marketId = undefined, market = undefined, delimiter = undefined, marketType = undefined) {
|
|
1539
|
-
if (marketId in this.options['aliasCbMarketIds']) {
|
|
1540
|
-
return this.market(marketId);
|
|
1541
|
-
}
|
|
1542
|
-
return super.safeMarket(marketId, market, delimiter, marketType);
|
|
1543
|
-
}
|
|
1544
1531
|
parseSpotMarket(market, feeTier) {
|
|
1545
1532
|
//
|
|
1546
1533
|
// {
|
package/js/src/coinex.js
CHANGED
package/js/src/coinlist.js
CHANGED
package/js/src/coinone.js
CHANGED
package/js/src/delta.js
CHANGED
|
@@ -351,6 +351,9 @@ export default class delta extends Exchange {
|
|
|
351
351
|
expiry = this.safeString(optionParts, 3);
|
|
352
352
|
optionType = this.safeString(optionParts, 0);
|
|
353
353
|
}
|
|
354
|
+
if (expiry !== undefined) {
|
|
355
|
+
expiry = expiry.slice(4) + expiry.slice(2, 4) + expiry.slice(0, 2);
|
|
356
|
+
}
|
|
354
357
|
const settle = quote;
|
|
355
358
|
const strike = this.safeString(optionParts, 2);
|
|
356
359
|
const datetime = this.convertExpireDate(expiry);
|
|
@@ -566,6 +569,7 @@ export default class delta extends Exchange {
|
|
|
566
569
|
},
|
|
567
570
|
},
|
|
568
571
|
'networks': {},
|
|
572
|
+
'type': 'crypto',
|
|
569
573
|
};
|
|
570
574
|
}
|
|
571
575
|
return result;
|
package/js/src/deribit.js
CHANGED
|
@@ -652,6 +652,7 @@ export default class deribit extends Exchange {
|
|
|
652
652
|
'active': undefined,
|
|
653
653
|
'deposit': undefined,
|
|
654
654
|
'withdraw': undefined,
|
|
655
|
+
'type': 'crypto',
|
|
655
656
|
'fee': this.safeNumber(currency, 'withdrawal_fee'),
|
|
656
657
|
'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'fee_precision'))),
|
|
657
658
|
'limits': {
|
package/js/src/hollaex.js
CHANGED
package/js/src/htx.js
CHANGED
|
@@ -947,6 +947,7 @@ export default class htx extends Exchange {
|
|
|
947
947
|
},
|
|
948
948
|
'precisionMode': TICK_SIZE,
|
|
949
949
|
'options': {
|
|
950
|
+
'include_OS_certificates': false,
|
|
950
951
|
'fetchMarkets': {
|
|
951
952
|
'types': {
|
|
952
953
|
'spot': true,
|
|
@@ -2210,7 +2211,7 @@ export default class htx extends Exchange {
|
|
|
2210
2211
|
let ask = undefined;
|
|
2211
2212
|
let askVolume = undefined;
|
|
2212
2213
|
if ('bid' in ticker) {
|
|
2213
|
-
if (Array.isArray(ticker['bid'])) {
|
|
2214
|
+
if (ticker['bid'] !== undefined && Array.isArray(ticker['bid'])) {
|
|
2214
2215
|
bid = this.safeString(ticker['bid'], 0);
|
|
2215
2216
|
bidVolume = this.safeString(ticker['bid'], 1);
|
|
2216
2217
|
}
|
|
@@ -2220,7 +2221,7 @@ export default class htx extends Exchange {
|
|
|
2220
2221
|
}
|
|
2221
2222
|
}
|
|
2222
2223
|
if ('ask' in ticker) {
|
|
2223
|
-
if (Array.isArray(ticker['ask'])) {
|
|
2224
|
+
if (ticker['ask'] !== undefined && Array.isArray(ticker['ask'])) {
|
|
2224
2225
|
ask = this.safeString(ticker['ask'], 0);
|
|
2225
2226
|
askVolume = this.safeString(ticker['ask'], 1);
|
|
2226
2227
|
}
|
|
@@ -3426,7 +3427,7 @@ export default class htx extends Exchange {
|
|
|
3426
3427
|
// "withdrawQuotaPerYear": null,
|
|
3427
3428
|
// "withdrawQuotaTotal": null,
|
|
3428
3429
|
// "withdrawFeeType": "fixed",
|
|
3429
|
-
// "transactFeeWithdraw": "11.
|
|
3430
|
+
// "transactFeeWithdraw": "11.1654",
|
|
3430
3431
|
// "addrWithTag": false,
|
|
3431
3432
|
// "addrDepositTag": false
|
|
3432
3433
|
// }
|
|
@@ -3449,6 +3450,8 @@ export default class htx extends Exchange {
|
|
|
3449
3450
|
const chains = this.safeValue(entry, 'chains', []);
|
|
3450
3451
|
const networks = {};
|
|
3451
3452
|
const instStatus = this.safeString(entry, 'instStatus');
|
|
3453
|
+
const assetType = this.safeString(entry, 'assetType');
|
|
3454
|
+
const type = assetType === '1' ? 'crypto' : 'fiat';
|
|
3452
3455
|
const currencyActive = instStatus === 'normal';
|
|
3453
3456
|
let minPrecision = undefined;
|
|
3454
3457
|
let minDeposit = undefined;
|
|
@@ -3508,6 +3511,7 @@ export default class htx extends Exchange {
|
|
|
3508
3511
|
'withdraw': withdraw,
|
|
3509
3512
|
'fee': undefined,
|
|
3510
3513
|
'name': undefined,
|
|
3514
|
+
'type': type,
|
|
3511
3515
|
'limits': {
|
|
3512
3516
|
'amount': {
|
|
3513
3517
|
'min': undefined,
|
|
@@ -7497,7 +7501,7 @@ export default class htx extends Exchange {
|
|
|
7497
7501
|
request = this.extend(request, query);
|
|
7498
7502
|
}
|
|
7499
7503
|
const sortedRequest = this.keysort(request);
|
|
7500
|
-
let auth = this.urlencode(sortedRequest);
|
|
7504
|
+
let auth = this.urlencode(sortedRequest, true); // true is a go only requirment
|
|
7501
7505
|
// unfortunately, PHP demands double quotes for the escaped newline symbol
|
|
7502
7506
|
const payload = [method, this.hostname, url, auth].join("\n"); // eslint-disable-line quotes
|
|
7503
7507
|
const signature = this.hmac(this.encode(payload), this.encode(this.secret), sha256, 'base64');
|
|
@@ -7579,7 +7583,7 @@ export default class htx extends Exchange {
|
|
|
7579
7583
|
const sortedQuery = this.keysort(query);
|
|
7580
7584
|
request = this.extend(request, sortedQuery);
|
|
7581
7585
|
}
|
|
7582
|
-
let auth = this.urlencode(request).replace('%2c', '%2C'); // in c# it manually needs to be uppercased
|
|
7586
|
+
let auth = this.urlencode(request, true).replace('%2c', '%2C'); // in c# it manually needs to be uppercased
|
|
7583
7587
|
// unfortunately, PHP demands double quotes for the escaped newline symbol
|
|
7584
7588
|
const payload = [method, hostname, url, auth].join("\n"); // eslint-disable-line quotes
|
|
7585
7589
|
const signature = this.hmac(this.encode(payload), this.encode(this.secret), sha256, 'base64');
|
package/js/src/huobijp.js
CHANGED
package/js/src/hyperliquid.js
CHANGED
|
@@ -371,6 +371,7 @@ export default class hyperliquid extends Exchange {
|
|
|
371
371
|
'withdraw': undefined,
|
|
372
372
|
'networks': undefined,
|
|
373
373
|
'fee': undefined,
|
|
374
|
+
'type': 'crypto',
|
|
374
375
|
'limits': {
|
|
375
376
|
'amount': {
|
|
376
377
|
'min': undefined,
|
|
@@ -2264,6 +2265,10 @@ export default class hyperliquid extends Exchange {
|
|
|
2264
2265
|
return this.parseOrder(data, market);
|
|
2265
2266
|
}
|
|
2266
2267
|
parseOrder(order, market = undefined) {
|
|
2268
|
+
//
|
|
2269
|
+
// createOrdersWs error
|
|
2270
|
+
//
|
|
2271
|
+
// {error: 'Insufficient margin to place order. asset=159'}
|
|
2267
2272
|
//
|
|
2268
2273
|
// fetchOpenOrders
|
|
2269
2274
|
//
|
|
@@ -2355,6 +2360,13 @@ export default class hyperliquid extends Exchange {
|
|
|
2355
2360
|
// "triggerPx": "0.6"
|
|
2356
2361
|
// }
|
|
2357
2362
|
//
|
|
2363
|
+
const error = this.safeString(order, 'error');
|
|
2364
|
+
if (error !== undefined) {
|
|
2365
|
+
return this.safeOrder({
|
|
2366
|
+
'info': order,
|
|
2367
|
+
'status': 'rejected',
|
|
2368
|
+
});
|
|
2369
|
+
}
|
|
2358
2370
|
let entry = this.safeDictN(order, ['order', 'resting', 'filled']);
|
|
2359
2371
|
if (entry === undefined) {
|
|
2360
2372
|
entry = order;
|
|
@@ -3600,10 +3612,14 @@ export default class hyperliquid extends Exchange {
|
|
|
3600
3612
|
// {"status":"ok","response":{"type":"order","data":{"statuses":[{"error":"Insufficient margin to place order. asset=84"}]}}}
|
|
3601
3613
|
//
|
|
3602
3614
|
const status = this.safeString(response, 'status', '');
|
|
3615
|
+
const error = this.safeString(response, 'error');
|
|
3603
3616
|
let message = undefined;
|
|
3604
3617
|
if (status === 'err') {
|
|
3605
3618
|
message = this.safeString(response, 'response');
|
|
3606
3619
|
}
|
|
3620
|
+
else if (error !== undefined) {
|
|
3621
|
+
message = error;
|
|
3622
|
+
}
|
|
3607
3623
|
else {
|
|
3608
3624
|
const responsePayload = this.safeDict(response, 'response', {});
|
|
3609
3625
|
const data = this.safeDict(responsePayload, 'data', {});
|