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/dist/cjs/ccxt.js
CHANGED
|
@@ -194,7 +194,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
194
194
|
|
|
195
195
|
//-----------------------------------------------------------------------------
|
|
196
196
|
// this is updated by vss.js when building
|
|
197
|
-
const version = '4.4.
|
|
197
|
+
const version = '4.4.82';
|
|
198
198
|
Exchange["default"].ccxtVersion = version;
|
|
199
199
|
const exchanges = {
|
|
200
200
|
'alpaca': alpaca,
|
package/dist/cjs/src/apex.js
CHANGED
|
@@ -490,11 +490,6 @@ class apex extends apex$1 {
|
|
|
490
490
|
const code = this.safeCurrencyCode(currencyId);
|
|
491
491
|
const name = this.safeString(currency, 'displayName');
|
|
492
492
|
const networks = {};
|
|
493
|
-
let minPrecision = undefined;
|
|
494
|
-
let minWithdrawFeeString = undefined;
|
|
495
|
-
let minWithdrawString = undefined;
|
|
496
|
-
let deposit = false;
|
|
497
|
-
let withdraw = false;
|
|
498
493
|
for (let j = 0; j < chains.length; j++) {
|
|
499
494
|
const chain = chains[j];
|
|
500
495
|
const tokens = this.safeList(chain, 'tokens', []);
|
|
@@ -504,31 +499,22 @@ class apex extends apex$1 {
|
|
|
504
499
|
if (tokenName === currencyId) {
|
|
505
500
|
const networkId = this.safeString(chain, 'chainId');
|
|
506
501
|
const networkCode = this.networkIdToCode(networkId);
|
|
507
|
-
const precision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals')));
|
|
508
|
-
minPrecision = (minPrecision === undefined) ? precision : Math.min(minPrecision, precision);
|
|
509
|
-
const depositAllowed = !this.safeBool(chain, 'stopDeposit');
|
|
510
|
-
deposit = (depositAllowed) ? depositAllowed : deposit;
|
|
511
|
-
const withdrawAllowed = this.safeBool(token, 'withdrawEnable');
|
|
512
|
-
withdraw = (withdrawAllowed) ? withdrawAllowed : withdraw;
|
|
513
|
-
minWithdrawFeeString = this.safeString(token, 'minFee');
|
|
514
|
-
minWithdrawString = this.safeString(token, 'minWithdraw');
|
|
515
|
-
const minNetworkDepositString = this.safeString(chain, 'depositMin');
|
|
516
502
|
networks[networkCode] = {
|
|
517
503
|
'info': chain,
|
|
518
504
|
'id': networkId,
|
|
519
505
|
'network': networkCode,
|
|
520
|
-
'active':
|
|
521
|
-
'deposit':
|
|
522
|
-
'withdraw':
|
|
523
|
-
'fee': this.
|
|
524
|
-
'precision':
|
|
506
|
+
'active': undefined,
|
|
507
|
+
'deposit': !this.safeBool(chain, 'depositDisable'),
|
|
508
|
+
'withdraw': this.safeBool(token, 'withdrawEnable'),
|
|
509
|
+
'fee': this.safeNumber(token, 'minFee'),
|
|
510
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(token, 'decimals'))),
|
|
525
511
|
'limits': {
|
|
526
512
|
'withdraw': {
|
|
527
|
-
'min': this.
|
|
513
|
+
'min': this.safeNumber(token, 'minWithdraw'),
|
|
528
514
|
'max': undefined,
|
|
529
515
|
},
|
|
530
516
|
'deposit': {
|
|
531
|
-
'min': this.
|
|
517
|
+
'min': this.safeNumber(chain, 'minDeposit'),
|
|
532
518
|
'max': undefined,
|
|
533
519
|
},
|
|
534
520
|
},
|
|
@@ -536,24 +522,28 @@ class apex extends apex$1 {
|
|
|
536
522
|
}
|
|
537
523
|
}
|
|
538
524
|
}
|
|
539
|
-
|
|
525
|
+
const networkKeys = Object.keys(networks);
|
|
526
|
+
const networksLength = networkKeys.length;
|
|
527
|
+
const emptyChains = networksLength === 0; // non-functional coins
|
|
528
|
+
const valueForEmpty = emptyChains ? false : undefined;
|
|
529
|
+
result[code] = this.safeCurrencyStructure({
|
|
540
530
|
'info': currency,
|
|
541
531
|
'code': code,
|
|
542
532
|
'id': currencyId,
|
|
543
533
|
'type': 'crypto',
|
|
544
534
|
'name': name,
|
|
545
|
-
'active':
|
|
546
|
-
'deposit':
|
|
547
|
-
'withdraw':
|
|
548
|
-
'fee':
|
|
549
|
-
'precision':
|
|
535
|
+
'active': undefined,
|
|
536
|
+
'deposit': valueForEmpty,
|
|
537
|
+
'withdraw': valueForEmpty,
|
|
538
|
+
'fee': undefined,
|
|
539
|
+
'precision': undefined,
|
|
550
540
|
'limits': {
|
|
551
541
|
'amount': {
|
|
552
542
|
'min': undefined,
|
|
553
543
|
'max': undefined,
|
|
554
544
|
},
|
|
555
545
|
'withdraw': {
|
|
556
|
-
'min':
|
|
546
|
+
'min': undefined,
|
|
557
547
|
'max': undefined,
|
|
558
548
|
},
|
|
559
549
|
'deposit': {
|
|
@@ -562,7 +552,7 @@ class apex extends apex$1 {
|
|
|
562
552
|
},
|
|
563
553
|
},
|
|
564
554
|
'networks': networks,
|
|
565
|
-
};
|
|
555
|
+
});
|
|
566
556
|
}
|
|
567
557
|
return result;
|
|
568
558
|
}
|
|
@@ -824,7 +814,7 @@ class apex extends apex$1 {
|
|
|
824
814
|
}
|
|
825
815
|
parseOHLCV(ohlcv, market = undefined) {
|
|
826
816
|
//
|
|
827
|
-
//
|
|
817
|
+
// {
|
|
828
818
|
// "start": 1647511440000,
|
|
829
819
|
// "symbol": "BTC-USD",
|
|
830
820
|
// "interval": "1",
|
|
@@ -834,7 +824,7 @@ class apex extends apex$1 {
|
|
|
834
824
|
// "close": "40000",
|
|
835
825
|
// "volume": "1.002",
|
|
836
826
|
// "turnover": "3"
|
|
837
|
-
//
|
|
827
|
+
// } {"s":"BTCUSDT","i":"1","t":1741265880000,"c":"90235","h":"90235","l":"90156","o":"90156","v":"0.052","tr":"4690.4466"}
|
|
838
828
|
//
|
|
839
829
|
return [
|
|
840
830
|
this.safeIntegerN(ohlcv, ['start', 't']),
|
package/dist/cjs/src/ascendex.js
CHANGED
|
@@ -512,6 +512,7 @@ class ascendex extends ascendex$1 {
|
|
|
512
512
|
// "data":[
|
|
513
513
|
// {
|
|
514
514
|
// "assetCode":"BTT",
|
|
515
|
+
// "displayName": "BTT",
|
|
515
516
|
// "borrowAssetCode":"BTT-B",
|
|
516
517
|
// "interestAssetCode":"BTT-I",
|
|
517
518
|
// "nativeScale":0,
|
|
@@ -532,12 +533,13 @@ class ascendex extends ascendex$1 {
|
|
|
532
533
|
// "data":[
|
|
533
534
|
// {
|
|
534
535
|
// "assetCode":"LTCBULL",
|
|
536
|
+
// "displayName": "LTCBULL",
|
|
535
537
|
// "nativeScale":4,
|
|
536
538
|
// "numConfirmations":20,
|
|
537
539
|
// "withdrawFee":"0.2",
|
|
538
540
|
// "minWithdrawalAmt":"1.0",
|
|
539
541
|
// "statusCode":"Normal",
|
|
540
|
-
// "statusMessage":""
|
|
542
|
+
// "statusMessage":"" // hideFromWalletTx
|
|
541
543
|
// }
|
|
542
544
|
// ]
|
|
543
545
|
// }
|
|
@@ -559,8 +561,27 @@ class ascendex extends ascendex$1 {
|
|
|
559
561
|
const scale = this.safeString2(currency, 'precisionScale', 'nativeScale');
|
|
560
562
|
const precision = this.parseNumber(this.parsePrecision(scale));
|
|
561
563
|
const fee = this.safeNumber2(currency, 'withdrawFee', 'withdrawalFee');
|
|
562
|
-
const status = this.
|
|
564
|
+
const status = this.safeString(currency, 'status');
|
|
565
|
+
const statusCode = this.safeString(currency, 'statusCode');
|
|
563
566
|
const active = (status === 'Normal');
|
|
567
|
+
let depositEnabled = undefined;
|
|
568
|
+
let withdrawEnabled = undefined;
|
|
569
|
+
if (status === 'Delisted' || statusCode === 'hideFromWalletTx') {
|
|
570
|
+
depositEnabled = false;
|
|
571
|
+
withdrawEnabled = false;
|
|
572
|
+
}
|
|
573
|
+
else if (status === 'Normal') {
|
|
574
|
+
depositEnabled = true;
|
|
575
|
+
withdrawEnabled = true;
|
|
576
|
+
}
|
|
577
|
+
else if (status === 'NoTransaction' || statusCode === 'NoTransaction') {
|
|
578
|
+
depositEnabled = true;
|
|
579
|
+
withdrawEnabled = false;
|
|
580
|
+
}
|
|
581
|
+
else if (status === 'NoDeposit') {
|
|
582
|
+
depositEnabled = false;
|
|
583
|
+
withdrawEnabled = true;
|
|
584
|
+
}
|
|
564
585
|
const marginInside = ('borrowAssetCode' in currency);
|
|
565
586
|
result[code] = {
|
|
566
587
|
'id': id,
|
|
@@ -570,8 +591,8 @@ class ascendex extends ascendex$1 {
|
|
|
570
591
|
'margin': marginInside,
|
|
571
592
|
'name': this.safeString(currency, 'assetName'),
|
|
572
593
|
'active': active,
|
|
573
|
-
'deposit':
|
|
574
|
-
'withdraw':
|
|
594
|
+
'deposit': depositEnabled,
|
|
595
|
+
'withdraw': withdrawEnabled,
|
|
575
596
|
'fee': fee,
|
|
576
597
|
'precision': precision,
|
|
577
598
|
'limits': {
|
|
@@ -584,7 +605,7 @@ class ascendex extends ascendex$1 {
|
|
|
584
605
|
'max': undefined,
|
|
585
606
|
},
|
|
586
607
|
},
|
|
587
|
-
'networks': {},
|
|
608
|
+
'networks': {}, // todo
|
|
588
609
|
};
|
|
589
610
|
}
|
|
590
611
|
return result;
|
|
@@ -500,7 +500,7 @@ class Exchange {
|
|
|
500
500
|
}
|
|
501
501
|
if (httpProxy) {
|
|
502
502
|
if (this.httpProxyAgentModule === undefined) {
|
|
503
|
-
throw new errors.NotSupported(this.id + ' you need to load JS proxy modules with
|
|
503
|
+
throw new errors.NotSupported(this.id + ' you need to load JS proxy modules with `await instance.loadProxyModules()` method at first to use proxies');
|
|
504
504
|
}
|
|
505
505
|
if (!(httpProxy in this.proxyDictionaries)) {
|
|
506
506
|
this.proxyDictionaries[httpProxy] = new this.httpProxyAgentModule.HttpProxyAgent(httpProxy);
|
|
@@ -509,7 +509,7 @@ class Exchange {
|
|
|
509
509
|
}
|
|
510
510
|
else if (httpsProxy) {
|
|
511
511
|
if (this.httpsProxyAgentModule === undefined) {
|
|
512
|
-
throw new errors.NotSupported(this.id + ' you need to load JS proxy modules with
|
|
512
|
+
throw new errors.NotSupported(this.id + ' you need to load JS proxy modules with `await instance.loadProxyModules()` method at first to use proxies');
|
|
513
513
|
}
|
|
514
514
|
if (!(httpsProxy in this.proxyDictionaries)) {
|
|
515
515
|
this.proxyDictionaries[httpsProxy] = new this.httpsProxyAgentModule.HttpsProxyAgent(httpsProxy);
|
|
@@ -519,7 +519,7 @@ class Exchange {
|
|
|
519
519
|
}
|
|
520
520
|
else if (socksProxy) {
|
|
521
521
|
if (this.socksProxyAgentModule === undefined) {
|
|
522
|
-
throw new errors.NotSupported(this.id + ' - to use SOCKS proxy with ccxt, at first you need install module "npm i socks-proxy-agent" and then initialize proxies with
|
|
522
|
+
throw new errors.NotSupported(this.id + ' - to use SOCKS proxy with ccxt, at first you need install module "npm i socks-proxy-agent" and then initialize proxies with `await instance.loadProxyModules()` method');
|
|
523
523
|
}
|
|
524
524
|
if (!(socksProxy in this.proxyDictionaries)) {
|
|
525
525
|
this.proxyDictionaries[socksProxy] = new this.socksProxyAgentModule.SocksProxyAgent(socksProxy);
|
|
@@ -5569,6 +5569,29 @@ class Exchange {
|
|
|
5569
5569
|
createExpiredOptionMarket(symbol) {
|
|
5570
5570
|
throw new errors.NotSupported(this.id + ' createExpiredOptionMarket () is not supported yet');
|
|
5571
5571
|
}
|
|
5572
|
+
isLeveragedCurrency(currencyCode, checkBaseCoin = false, existingCurrencies = undefined) {
|
|
5573
|
+
const leverageSuffixes = [
|
|
5574
|
+
'2L', '2S', '3L', '3S', '4L', '4S', '5L', '5S',
|
|
5575
|
+
'UP', 'DOWN',
|
|
5576
|
+
'BULL', 'BEAR', // similar
|
|
5577
|
+
];
|
|
5578
|
+
for (let i = 0; i < leverageSuffixes.length; i++) {
|
|
5579
|
+
const leverageSuffix = leverageSuffixes[i];
|
|
5580
|
+
if (currencyCode.endsWith(leverageSuffix)) {
|
|
5581
|
+
if (!checkBaseCoin) {
|
|
5582
|
+
return true;
|
|
5583
|
+
}
|
|
5584
|
+
else {
|
|
5585
|
+
// check if base currency is inside dict
|
|
5586
|
+
const baseCurrencyCode = currencyCode.replace(leverageSuffix, '');
|
|
5587
|
+
if (baseCurrencyCode in existingCurrencies) {
|
|
5588
|
+
return true;
|
|
5589
|
+
}
|
|
5590
|
+
}
|
|
5591
|
+
}
|
|
5592
|
+
}
|
|
5593
|
+
return false;
|
|
5594
|
+
}
|
|
5572
5595
|
handleWithdrawTagAndParams(tag, params) {
|
|
5573
5596
|
if ((tag !== undefined) && (typeof tag === 'object')) {
|
|
5574
5597
|
params = this.extend(tag, params);
|
|
@@ -11,7 +11,7 @@ var index$1 = require('../../static_dependencies/qs/index.cjs.js');
|
|
|
11
11
|
/* ------------------------------------------------------------------------ */
|
|
12
12
|
const json = (data, params = undefined) => JSON.stringify(data), isJsonEncodedObject = (object) => ((typeof object === 'string') &&
|
|
13
13
|
(object.length >= 2) &&
|
|
14
|
-
((object[0] === '{') || (object[0] === '['))), binaryToString = index.utf8.encode, stringToBinary = index.utf8.decode, stringToBase64 = (string) => index.base64.encode(index.utf8.decode(string)), base64ToString = (string) => index.utf8.encode(index.base64.decode(string)), base64ToBinary = index.base64.decode, binaryToBase64 = index.base64.encode, base16ToBinary = index.base16.decode, binaryToBase16 = index.base16.encode, base58ToBinary = index.base58.decode, binaryToBase58 = index.base58.encode, binaryConcat = utils.concatBytes, binaryConcatArray = (arr) => utils.concatBytes(...arr), urlencode = (object) => index$1.stringify(object), urlencodeNested = (object) => index$1.stringify(object) // implemented only in python
|
|
14
|
+
((object[0] === '{') || (object[0] === '['))), binaryToString = index.utf8.encode, stringToBinary = index.utf8.decode, stringToBase64 = (string) => index.base64.encode(index.utf8.decode(string)), base64ToString = (string) => index.utf8.encode(index.base64.decode(string)), base64ToBinary = index.base64.decode, binaryToBase64 = index.base64.encode, base16ToBinary = index.base16.decode, binaryToBase16 = index.base16.encode, base58ToBinary = index.base58.decode, binaryToBase58 = index.base58.encode, binaryConcat = utils.concatBytes, binaryConcatArray = (arr) => utils.concatBytes(...arr), urlencode = (object, sort = false) => index$1.stringify(object), urlencodeNested = (object) => index$1.stringify(object) // implemented only in python
|
|
15
15
|
, urlencodeWithArrayRepeat = (object) => index$1.stringify(object, { arrayFormat: 'repeat' }), rawencode = (object) => index$1.stringify(object, { encode: false }), encode = index.utf8.decode // lol
|
|
16
16
|
, decode = index.utf8.encode
|
|
17
17
|
// Url-safe-base64 without equals signs, with + replaced by - and slashes replaced by underscores
|
package/dist/cjs/src/bigone.js
CHANGED
|
@@ -502,19 +502,15 @@ class bigone extends bigone$1 {
|
|
|
502
502
|
const id = this.safeString(currency, 'symbol');
|
|
503
503
|
const code = this.safeCurrencyCode(id);
|
|
504
504
|
const name = this.safeString(currency, 'name');
|
|
505
|
-
const type = this.safeBool(currency, 'is_fiat') ? 'fiat' : 'crypto';
|
|
506
505
|
const networks = {};
|
|
507
506
|
const chains = this.safeList(currency, 'binding_gateways', []);
|
|
508
|
-
|
|
509
|
-
let currencyDepositEnabled = undefined;
|
|
510
|
-
let currencyWithdrawEnabled = undefined;
|
|
507
|
+
const currencyMaxPrecision = this.parsePrecision(this.safeString2(currency, 'withdrawal_scale', 'scale'));
|
|
511
508
|
for (let j = 0; j < chains.length; j++) {
|
|
512
509
|
const chain = chains[j];
|
|
513
510
|
const networkId = this.safeString(chain, 'gateway_name');
|
|
514
511
|
const networkCode = this.networkIdToCode(networkId);
|
|
515
512
|
const deposit = this.safeBool(chain, 'is_deposit_enabled');
|
|
516
513
|
const withdraw = this.safeBool(chain, 'is_withdrawal_enabled');
|
|
517
|
-
const isActive = (deposit && withdraw);
|
|
518
514
|
const minDepositAmount = this.safeString(chain, 'min_deposit_amount');
|
|
519
515
|
const minWithdrawalAmount = this.safeString(chain, 'min_withdrawal_amount');
|
|
520
516
|
const withdrawalFee = this.safeString(chain, 'withdrawal_fee');
|
|
@@ -525,7 +521,7 @@ class bigone extends bigone$1 {
|
|
|
525
521
|
'margin': undefined,
|
|
526
522
|
'deposit': deposit,
|
|
527
523
|
'withdraw': withdraw,
|
|
528
|
-
'active':
|
|
524
|
+
'active': undefined,
|
|
529
525
|
'fee': this.parseNumber(withdrawalFee),
|
|
530
526
|
'precision': this.parseNumber(precision),
|
|
531
527
|
'limits': {
|
|
@@ -540,20 +536,32 @@ class bigone extends bigone$1 {
|
|
|
540
536
|
},
|
|
541
537
|
'info': chain,
|
|
542
538
|
};
|
|
543
|
-
// fill global values
|
|
544
|
-
currencyDepositEnabled = (currencyDepositEnabled === undefined) || deposit ? deposit : currencyDepositEnabled;
|
|
545
|
-
currencyWithdrawEnabled = (currencyWithdrawEnabled === undefined) || withdraw ? withdraw : currencyWithdrawEnabled;
|
|
546
|
-
currencyMaxPrecision = (currencyMaxPrecision === undefined) || Precise["default"].stringGt(currencyMaxPrecision, precision) ? precision : currencyMaxPrecision;
|
|
547
539
|
}
|
|
548
|
-
|
|
540
|
+
const chainLength = chains.length;
|
|
541
|
+
let type = undefined;
|
|
542
|
+
if (this.safeBool(currency, 'is_fiat')) {
|
|
543
|
+
type = 'fiat';
|
|
544
|
+
}
|
|
545
|
+
else if (chainLength === 0) {
|
|
546
|
+
if (this.isLeveragedCurrency(id)) {
|
|
547
|
+
type = 'leveraged';
|
|
548
|
+
}
|
|
549
|
+
else {
|
|
550
|
+
type = 'other';
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
else {
|
|
554
|
+
type = 'crypto';
|
|
555
|
+
}
|
|
556
|
+
result[code] = this.safeCurrencyStructure({
|
|
549
557
|
'id': id,
|
|
550
558
|
'code': code,
|
|
551
559
|
'info': currency,
|
|
552
560
|
'name': name,
|
|
553
561
|
'type': type,
|
|
554
562
|
'active': undefined,
|
|
555
|
-
'deposit':
|
|
556
|
-
'withdraw':
|
|
563
|
+
'deposit': undefined,
|
|
564
|
+
'withdraw': undefined,
|
|
557
565
|
'fee': undefined,
|
|
558
566
|
'precision': this.parseNumber(currencyMaxPrecision),
|
|
559
567
|
'limits': {
|
|
@@ -567,7 +575,7 @@ class bigone extends bigone$1 {
|
|
|
567
575
|
},
|
|
568
576
|
},
|
|
569
577
|
'networks': networks,
|
|
570
|
-
};
|
|
578
|
+
});
|
|
571
579
|
}
|
|
572
580
|
return result;
|
|
573
581
|
}
|
package/dist/cjs/src/binance.js
CHANGED
|
@@ -1270,6 +1270,7 @@ class binance extends binance$1 {
|
|
|
1270
1270
|
'inverse', // allows CORS in browsers
|
|
1271
1271
|
// 'option', // does not allow CORS, enable outside of the browser only
|
|
1272
1272
|
],
|
|
1273
|
+
'loadAllOptions': false,
|
|
1273
1274
|
'fetchCurrencies': true,
|
|
1274
1275
|
// 'fetchTradesMethod': 'publicGetAggTrades', // publicGetTrades, publicGetHistoricalTrades, eapiPublicGetTrades
|
|
1275
1276
|
// 'repayCrossMarginMethod': 'papiPostRepayLoan', // papiPostMarginRepayDebt
|
|
@@ -3036,6 +3037,13 @@ class binance extends binance$1 {
|
|
|
3036
3037
|
async fetchMarkets(params = {}) {
|
|
3037
3038
|
const promisesRaw = [];
|
|
3038
3039
|
const rawFetchMarkets = this.safeList(this.options, 'fetchMarkets', ['spot', 'linear', 'inverse']);
|
|
3040
|
+
// handle loadAllOptions option
|
|
3041
|
+
const loadAllOptions = this.safeBool(this.options, 'loadAllOptions', false);
|
|
3042
|
+
if (loadAllOptions) {
|
|
3043
|
+
if (!this.inArray('option', rawFetchMarkets)) {
|
|
3044
|
+
rawFetchMarkets.push('option');
|
|
3045
|
+
}
|
|
3046
|
+
}
|
|
3039
3047
|
const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
|
|
3040
3048
|
const fetchMarkets = [];
|
|
3041
3049
|
for (let i = 0; i < rawFetchMarkets.length; i++) {
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -709,7 +709,7 @@ class bingx extends bingx$1 {
|
|
|
709
709
|
//
|
|
710
710
|
// {
|
|
711
711
|
// "code": 0,
|
|
712
|
-
// "timestamp":
|
|
712
|
+
// "timestamp": 1702623271476,
|
|
713
713
|
// "data": [
|
|
714
714
|
// {
|
|
715
715
|
// "coin": "BTC",
|
|
@@ -753,61 +753,43 @@ class bingx extends bingx$1 {
|
|
|
753
753
|
const name = this.safeString(entry, 'name');
|
|
754
754
|
const networkList = this.safeList(entry, 'networkList');
|
|
755
755
|
const networks = {};
|
|
756
|
-
let fee = undefined;
|
|
757
|
-
let depositEnabled = false;
|
|
758
|
-
let withdrawEnabled = false;
|
|
759
|
-
let defaultLimits = {};
|
|
760
756
|
for (let j = 0; j < networkList.length; j++) {
|
|
761
757
|
const rawNetwork = networkList[j];
|
|
762
758
|
const network = this.safeString(rawNetwork, 'network');
|
|
763
759
|
const networkCode = this.networkIdToCode(network);
|
|
764
|
-
const isDefault = this.safeBool(rawNetwork, 'isDefault');
|
|
765
|
-
const networkDepositEnabled = this.safeBool(rawNetwork, 'depositEnable');
|
|
766
|
-
if (networkDepositEnabled) {
|
|
767
|
-
depositEnabled = true;
|
|
768
|
-
}
|
|
769
|
-
const networkWithdrawEnabled = this.safeBool(rawNetwork, 'withdrawEnable');
|
|
770
|
-
if (networkWithdrawEnabled) {
|
|
771
|
-
withdrawEnabled = true;
|
|
772
|
-
}
|
|
773
760
|
const limits = {
|
|
774
761
|
'withdraw': {
|
|
775
762
|
'min': this.safeNumber(rawNetwork, 'withdrawMin'),
|
|
776
763
|
'max': this.safeNumber(rawNetwork, 'withdrawMax'),
|
|
777
764
|
},
|
|
778
765
|
};
|
|
779
|
-
|
|
780
|
-
if (isDefault) {
|
|
781
|
-
defaultLimits = limits;
|
|
782
|
-
}
|
|
783
|
-
const precision = this.safeNumber(rawNetwork, 'withdrawPrecision');
|
|
784
|
-
const networkActive = networkDepositEnabled || networkWithdrawEnabled;
|
|
766
|
+
const precision = this.parseNumber(this.parsePrecision(this.safeString(rawNetwork, 'withdrawPrecision')));
|
|
785
767
|
networks[networkCode] = {
|
|
786
768
|
'info': rawNetwork,
|
|
787
769
|
'id': network,
|
|
788
770
|
'network': networkCode,
|
|
789
|
-
'fee':
|
|
790
|
-
'active':
|
|
791
|
-
'deposit':
|
|
792
|
-
'withdraw':
|
|
771
|
+
'fee': this.safeNumber(rawNetwork, 'withdrawFee'),
|
|
772
|
+
'active': undefined,
|
|
773
|
+
'deposit': this.safeBool(rawNetwork, 'depositEnable'),
|
|
774
|
+
'withdraw': this.safeBool(rawNetwork, 'withdrawEnable'),
|
|
793
775
|
'precision': precision,
|
|
794
776
|
'limits': limits,
|
|
795
777
|
};
|
|
796
778
|
}
|
|
797
|
-
|
|
798
|
-
result[code] = {
|
|
779
|
+
result[code] = this.safeCurrencyStructure({
|
|
799
780
|
'info': entry,
|
|
800
781
|
'code': code,
|
|
801
782
|
'id': currencyId,
|
|
802
783
|
'precision': undefined,
|
|
803
784
|
'name': name,
|
|
804
|
-
'active':
|
|
805
|
-
'deposit':
|
|
806
|
-
'withdraw':
|
|
785
|
+
'active': undefined,
|
|
786
|
+
'deposit': undefined,
|
|
787
|
+
'withdraw': undefined,
|
|
807
788
|
'networks': networks,
|
|
808
|
-
'fee':
|
|
809
|
-
'limits':
|
|
810
|
-
|
|
789
|
+
'fee': undefined,
|
|
790
|
+
'limits': undefined,
|
|
791
|
+
'type': 'crypto', // only cryptos now
|
|
792
|
+
});
|
|
811
793
|
}
|
|
812
794
|
return result;
|
|
813
795
|
}
|
|
@@ -5797,7 +5779,7 @@ class bingx extends bingx$1 {
|
|
|
5797
5779
|
* @param {string} address the address to withdraw to
|
|
5798
5780
|
* @param {string} [tag]
|
|
5799
5781
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5800
|
-
* @param {int} [params.walletType] 1 fund account, 2 standard account, 3 perpetual account
|
|
5782
|
+
* @param {int} [params.walletType] 1 fund account, 2 standard account, 3 perpetual account, 15 spot account
|
|
5801
5783
|
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5802
5784
|
*/
|
|
5803
5785
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
@@ -5805,13 +5787,7 @@ class bingx extends bingx$1 {
|
|
|
5805
5787
|
this.checkAddress(address);
|
|
5806
5788
|
await this.loadMarkets();
|
|
5807
5789
|
const currency = this.currency(code);
|
|
5808
|
-
|
|
5809
|
-
if (walletType === undefined) {
|
|
5810
|
-
walletType = 1;
|
|
5811
|
-
}
|
|
5812
|
-
if (!this.inArray(walletType, [1, 2, 3])) {
|
|
5813
|
-
throw new errors.BadRequest(this.id + ' withdraw() requires either 1 fund account, 2 standard futures account, 3 perpetual account for walletType');
|
|
5814
|
-
}
|
|
5790
|
+
const walletType = this.safeInteger(params, 'walletType', 1);
|
|
5815
5791
|
const request = {
|
|
5816
5792
|
'coin': currency['id'],
|
|
5817
5793
|
'address': address,
|