ccxt 4.5.56 → 4.5.57
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 +10 -9
- package/dist/ccxt.browser.min.js +10 -10
- package/dist/cjs/ccxt.js +6 -11
- package/dist/cjs/src/apex.js +1 -1
- package/dist/cjs/src/arkham.js +3 -3
- package/dist/cjs/src/ascendex.js +2 -2
- package/dist/cjs/src/aster.js +7 -4
- package/dist/cjs/src/backpack.js +4 -4
- package/dist/cjs/src/base/Exchange.js +69 -32
- package/dist/cjs/src/base/functions/io.js +25 -0
- package/dist/cjs/src/base/functions.js +1 -0
- package/dist/cjs/src/bigone.js +3 -3
- package/dist/cjs/src/binance.js +192 -194
- package/dist/cjs/src/bingx.js +3 -3
- package/dist/cjs/src/bitfinex.js +71 -58
- package/dist/cjs/src/bitget.js +2 -2
- package/dist/cjs/src/bitmart.js +13 -6
- package/dist/cjs/src/bitmex.js +1 -1
- package/dist/cjs/src/bitopro.js +1 -1
- package/dist/cjs/src/bitrue.js +2 -2
- package/dist/cjs/src/bitso.js +1 -1
- package/dist/cjs/src/bitstamp.js +2 -1
- package/dist/cjs/src/bitteam.js +1 -1
- package/dist/cjs/src/bittrade.js +0 -1
- package/dist/cjs/src/bitvavo.js +457 -34
- package/dist/cjs/src/blofin.js +26 -3
- package/dist/cjs/src/bullish.js +6 -5
- package/dist/cjs/src/bydfi.js +1 -1
- package/dist/cjs/src/cex.js +3 -3
- package/dist/cjs/src/coinbase.js +75 -65
- package/dist/cjs/src/coinbaseexchange.js +2 -2
- package/dist/cjs/src/coinbaseinternational.js +2 -1
- package/dist/cjs/src/coinex.js +74 -74
- package/dist/cjs/src/coinmetro.js +1 -1
- package/dist/cjs/src/coinsph.js +1 -1
- package/dist/cjs/src/cryptocom.js +46 -48
- package/dist/cjs/src/cryptomus.js +43 -39
- package/dist/cjs/src/deepcoin.js +3 -2
- package/dist/cjs/src/delta.js +51 -52
- package/dist/cjs/src/deribit.js +31 -33
- package/dist/cjs/src/derive.js +26 -28
- package/dist/cjs/src/digifinex.js +43 -44
- package/dist/cjs/src/exmo.js +92 -83
- package/dist/cjs/src/extended.js +3497 -0
- package/dist/cjs/src/foxbit.js +71 -75
- package/dist/cjs/src/gate.js +53 -53
- package/dist/cjs/src/gemini.js +41 -43
- package/dist/cjs/src/grvt.js +4 -4
- package/dist/cjs/src/hashkey.js +52 -54
- package/dist/cjs/src/hitbtc.js +3 -13
- package/dist/cjs/src/hollaex.js +51 -54
- package/dist/cjs/src/htx.js +75 -67
- package/dist/cjs/src/hyperliquid.js +41 -42
- package/dist/cjs/src/indodax.js +2 -2
- package/dist/cjs/src/kraken.js +57 -58
- package/dist/cjs/src/kucoin.js +3 -2
- package/dist/cjs/src/latoken.js +30 -32
- package/dist/cjs/src/lbank.js +56 -56
- package/dist/cjs/src/lighter.js +35 -37
- package/dist/cjs/src/luno.js +35 -43
- package/dist/cjs/src/mexc.js +48 -49
- package/dist/cjs/src/modetrade.js +50 -52
- package/dist/cjs/src/ndax.js +35 -37
- package/dist/cjs/src/okx.js +17 -2
- package/dist/cjs/src/onetrading.js +21 -23
- package/dist/cjs/src/phemex.js +43 -45
- package/dist/cjs/src/poloniex.js +17 -12
- package/dist/cjs/src/pro/alpaca.js +1 -1
- package/dist/cjs/src/pro/apex.js +1 -1
- package/dist/cjs/src/pro/arkham.js +1 -1
- package/dist/cjs/src/pro/backpack.js +1 -1
- package/dist/cjs/src/pro/binance.js +3 -3
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bithumb.js +1 -1
- package/dist/cjs/src/pro/bitstamp.js +1 -1
- package/dist/cjs/src/pro/blockchaincom.js +1 -1
- package/dist/cjs/src/pro/bybit.js +1 -1
- package/dist/cjs/src/pro/cex.js +1 -1
- package/dist/cjs/src/pro/coinex.js +1 -1
- package/dist/cjs/src/pro/coinone.js +1 -1
- package/dist/cjs/src/pro/cryptocom.js +3 -1
- package/dist/cjs/src/pro/dydx.js +1 -1
- package/dist/cjs/src/pro/exmo.js +1 -1
- package/dist/cjs/src/pro/extended.js +865 -0
- package/dist/cjs/src/pro/gate.js +1 -1
- package/dist/cjs/src/pro/independentreserve.js +1 -1
- package/dist/cjs/src/pro/kucoin.js +1 -1
- package/dist/cjs/src/pro/luno.js +3 -3
- package/dist/cjs/src/pro/onetrading.js +1 -1
- package/dist/cjs/src/pro/toobit.js +1 -1
- package/dist/cjs/src/pro/weex.js +1 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/hash/classHash.js +7 -7
- package/dist/cjs/src/tokocrypto.js +1 -1
- package/dist/cjs/src/toobit.js +2 -2
- package/dist/cjs/src/upbit.js +3 -3
- package/dist/cjs/src/weex.js +57 -62
- package/dist/cjs/src/whitebit.js +61 -63
- package/dist/cjs/src/woo.js +65 -54
- package/dist/cjs/src/woofipro.js +53 -47
- package/dist/cjs/src/xt.js +1 -1
- package/dist/cjs/src/zebpay.js +70 -72
- package/js/ccxt.d.ts +8 -14
- package/js/ccxt.js +6 -10
- package/js/src/abstract/bitvavo.d.ts +15 -7
- package/js/src/abstract/extended.d.ts +58 -0
- package/js/src/apex.js +1 -1
- package/js/src/arkham.js +3 -3
- package/js/src/ascendex.js +2 -2
- package/js/src/aster.js +7 -4
- package/js/src/backpack.js +4 -4
- package/js/src/base/Exchange.d.ts +10 -6
- package/js/src/base/Exchange.js +69 -32
- package/js/src/base/functions/io.d.ts +7 -0
- package/js/src/base/functions/io.js +24 -0
- package/js/src/bigone.js +3 -3
- package/js/src/binance.d.ts +2 -0
- package/js/src/binance.js +196 -198
- package/js/src/bingx.js +3 -3
- package/js/src/bitfinex.d.ts +2 -0
- package/js/src/bitfinex.js +71 -58
- package/js/src/bitget.js +2 -2
- package/js/src/bitmart.js +13 -6
- package/js/src/bitmex.js +1 -1
- package/js/src/bitopro.js +1 -1
- package/js/src/bitrue.js +2 -2
- package/js/src/bitso.js +1 -1
- package/js/src/bitstamp.js +2 -1
- package/js/src/bitteam.js +1 -1
- package/js/src/bittrade.js +0 -1
- package/js/src/bitvavo.d.ts +114 -21
- package/js/src/bitvavo.js +457 -34
- package/js/src/blofin.d.ts +1 -0
- package/js/src/blofin.js +26 -3
- package/js/src/bullish.js +6 -5
- package/js/src/bydfi.js +1 -1
- package/js/src/cex.js +3 -3
- package/js/src/coinbase.d.ts +63 -56
- package/js/src/coinbase.js +75 -65
- package/js/src/coinbaseexchange.js +2 -2
- package/js/src/coinbaseinternational.js +2 -1
- package/js/src/coinex.d.ts +1 -0
- package/js/src/coinex.js +74 -74
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +1 -1
- package/js/src/coinsph.js +1 -1
- package/js/src/cryptocom.d.ts +1 -0
- package/js/src/cryptocom.js +46 -48
- package/js/src/cryptomus.d.ts +2 -1
- package/js/src/cryptomus.js +43 -39
- package/js/src/deepcoin.js +3 -2
- package/js/src/delta.d.ts +1 -0
- package/js/src/delta.js +51 -52
- package/js/src/deribit.d.ts +1 -0
- package/js/src/deribit.js +31 -33
- package/js/src/derive.d.ts +1 -0
- package/js/src/derive.js +26 -28
- package/js/src/digifinex.d.ts +1 -0
- package/js/src/digifinex.js +43 -44
- package/js/src/exmo.d.ts +1 -0
- package/js/src/exmo.js +92 -83
- package/js/src/extended.d.ts +554 -0
- package/js/src/extended.js +3490 -0
- package/js/src/foxbit.d.ts +1 -0
- package/js/src/foxbit.js +71 -75
- package/js/src/gate.d.ts +1 -0
- package/js/src/gate.js +53 -53
- package/js/src/gemini.d.ts +2 -1
- package/js/src/gemini.js +41 -43
- package/js/src/grvt.js +4 -4
- package/js/src/hashkey.d.ts +1 -0
- package/js/src/hashkey.js +52 -54
- package/js/src/hitbtc.d.ts +0 -1
- package/js/src/hitbtc.js +3 -13
- package/js/src/hollaex.d.ts +1 -0
- package/js/src/hollaex.js +51 -54
- package/js/src/htx.d.ts +1 -0
- package/js/src/htx.js +75 -67
- package/js/src/hyperliquid.d.ts +1 -0
- package/js/src/hyperliquid.js +41 -42
- package/js/src/indodax.js +2 -2
- package/js/src/kraken.d.ts +2 -1
- package/js/src/kraken.js +57 -58
- package/js/src/kucoin.js +3 -2
- package/js/src/latoken.d.ts +1 -0
- package/js/src/latoken.js +30 -32
- package/js/src/lbank.d.ts +1 -0
- package/js/src/lbank.js +56 -56
- package/js/src/lighter.d.ts +1 -0
- package/js/src/lighter.js +35 -37
- package/js/src/luno.d.ts +1 -0
- package/js/src/luno.js +35 -43
- package/js/src/mexc.d.ts +2 -1
- package/js/src/mexc.js +48 -49
- package/js/src/modetrade.d.ts +1 -0
- package/js/src/modetrade.js +50 -52
- package/js/src/ndax.d.ts +1 -0
- package/js/src/ndax.js +35 -37
- package/js/src/okx.js +17 -2
- package/js/src/onetrading.d.ts +2 -1
- package/js/src/onetrading.js +21 -23
- package/js/src/phemex.d.ts +1 -0
- package/js/src/phemex.js +43 -45
- package/js/src/poloniex.js +17 -12
- package/js/src/pro/alpaca.js +1 -1
- package/js/src/pro/apex.js +1 -1
- package/js/src/pro/arkham.js +1 -1
- package/js/src/pro/backpack.js +1 -1
- package/js/src/pro/binance.js +3 -3
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bithumb.js +1 -1
- package/js/src/pro/bitstamp.js +1 -1
- package/js/src/pro/blockchaincom.js +1 -1
- package/js/src/pro/bybit.js +1 -1
- package/js/src/pro/cex.js +1 -1
- package/js/src/pro/coinex.js +1 -1
- package/js/src/pro/coinone.js +1 -1
- package/js/src/pro/cryptocom.js +3 -1
- package/js/src/pro/dydx.js +1 -1
- package/js/src/pro/exmo.js +1 -1
- package/js/src/pro/extended.d.ts +126 -0
- package/js/src/pro/extended.js +858 -0
- package/js/src/pro/gate.js +1 -1
- package/js/src/pro/independentreserve.js +1 -1
- package/js/src/pro/kucoin.js +1 -1
- package/js/src/pro/luno.d.ts +1 -1
- package/js/src/pro/luno.js +3 -3
- package/js/src/pro/onetrading.js +1 -1
- package/js/src/pro/toobit.js +1 -1
- package/js/src/pro/weex.js +1 -1
- package/js/src/tokocrypto.js +1 -1
- package/js/src/toobit.js +2 -2
- package/js/src/upbit.js +3 -3
- package/js/src/weex.d.ts +1 -0
- package/js/src/weex.js +57 -62
- package/js/src/whitebit.d.ts +1 -0
- package/js/src/whitebit.js +61 -63
- package/js/src/woo.d.ts +1 -0
- package/js/src/woo.js +65 -54
- package/js/src/woofipro.d.ts +1 -0
- package/js/src/woofipro.js +53 -47
- package/js/src/xt.js +1 -1
- package/js/src/zebpay.d.ts +2 -1
- package/js/src/zebpay.js +70 -72
- package/package.json +7 -7
- package/dist/cjs/src/gateio.js +0 -18
- package/dist/cjs/src/oxfun.js +0 -2933
- package/dist/cjs/src/pro/gateio.js +0 -18
- package/dist/cjs/src/pro/oxfun.js +0 -1113
- package/js/src/abstract/gateio.d.ts +0 -346
- package/js/src/abstract/gateio.js +0 -5
- package/js/src/abstract/oxfun.d.ts +0 -37
- package/js/src/gateio.d.ts +0 -4
- package/js/src/gateio.js +0 -11
- package/js/src/oxfun.d.ts +0 -442
- package/js/src/oxfun.js +0 -2926
- package/js/src/pro/gateio.d.ts +0 -4
- package/js/src/pro/gateio.js +0 -11
- package/js/src/pro/oxfun.d.ts +0 -234
- package/js/src/pro/oxfun.js +0 -1106
- /package/dist/cjs/src/abstract/{oxfun.js → extended.js} +0 -0
- /package/js/src/abstract/{oxfun.js → extended.js} +0 -0
|
@@ -630,7 +630,6 @@ class modetrade extends modetrade$1["default"] {
|
|
|
630
630
|
* @returns {object} an associative dictionary of currencies
|
|
631
631
|
*/
|
|
632
632
|
async fetchCurrencies(params = {}) {
|
|
633
|
-
const result = {};
|
|
634
633
|
const response = await this.v1PublicGetPublicToken(params);
|
|
635
634
|
//
|
|
636
635
|
// {
|
|
@@ -656,66 +655,65 @@ class modetrade extends modetrade$1["default"] {
|
|
|
656
655
|
//
|
|
657
656
|
const data = this.safeDict(response, 'data', {});
|
|
658
657
|
const tokenRows = this.safeList(data, 'rows', []);
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
resultingNetworks[networkId] = {
|
|
675
|
-
'id': networkId,
|
|
676
|
-
'network': networkId,
|
|
677
|
-
'limits': {
|
|
678
|
-
'withdraw': {
|
|
679
|
-
'min': undefined,
|
|
680
|
-
'max': undefined,
|
|
681
|
-
},
|
|
682
|
-
'deposit': {
|
|
683
|
-
'min': undefined,
|
|
684
|
-
'max': undefined,
|
|
685
|
-
},
|
|
686
|
-
},
|
|
687
|
-
'active': undefined,
|
|
688
|
-
'deposit': undefined,
|
|
689
|
-
'withdraw': undefined,
|
|
690
|
-
'fee': this.safeNumber(network, 'withdrawal_fee'),
|
|
691
|
-
'precision': this.parseNumber(precision),
|
|
692
|
-
'info': network,
|
|
693
|
-
};
|
|
658
|
+
return this.parseCurrencies(tokenRows);
|
|
659
|
+
}
|
|
660
|
+
parseCurrency(rawCurrency) {
|
|
661
|
+
const currencyId = this.safeString(rawCurrency, 'token');
|
|
662
|
+
const networks = this.safeList(rawCurrency, 'chain_details');
|
|
663
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
664
|
+
let minPrecision = undefined;
|
|
665
|
+
const resultingNetworks = {};
|
|
666
|
+
for (let j = 0; j < networks.length; j++) {
|
|
667
|
+
const network = networks[j];
|
|
668
|
+
// TODO: transform chain id to human readable name
|
|
669
|
+
const networkId = this.safeString(network, 'chain_id');
|
|
670
|
+
const precision = this.parsePrecision(this.safeString(network, 'decimals'));
|
|
671
|
+
if (precision !== undefined) {
|
|
672
|
+
minPrecision = (minPrecision === undefined) ? precision : Precise["default"].stringMin(precision, minPrecision);
|
|
694
673
|
}
|
|
695
|
-
|
|
696
|
-
'id':
|
|
697
|
-
'
|
|
698
|
-
'code': code,
|
|
699
|
-
'precision': this.parseNumber(minPrecision),
|
|
700
|
-
'active': undefined,
|
|
701
|
-
'fee': undefined,
|
|
702
|
-
'networks': resultingNetworks,
|
|
703
|
-
'deposit': undefined,
|
|
704
|
-
'withdraw': undefined,
|
|
674
|
+
resultingNetworks[networkId] = {
|
|
675
|
+
'id': networkId,
|
|
676
|
+
'network': networkId,
|
|
705
677
|
'limits': {
|
|
706
|
-
'
|
|
678
|
+
'withdraw': {
|
|
707
679
|
'min': undefined,
|
|
708
680
|
'max': undefined,
|
|
709
681
|
},
|
|
710
|
-
'
|
|
711
|
-
'min':
|
|
682
|
+
'deposit': {
|
|
683
|
+
'min': undefined,
|
|
712
684
|
'max': undefined,
|
|
713
685
|
},
|
|
714
686
|
},
|
|
715
|
-
'
|
|
716
|
-
|
|
687
|
+
'active': undefined,
|
|
688
|
+
'deposit': undefined,
|
|
689
|
+
'withdraw': undefined,
|
|
690
|
+
'fee': this.safeNumber(network, 'withdrawal_fee'),
|
|
691
|
+
'precision': this.parseNumber(precision),
|
|
692
|
+
'info': network,
|
|
693
|
+
};
|
|
717
694
|
}
|
|
718
|
-
return
|
|
695
|
+
return this.safeCurrencyStructure({
|
|
696
|
+
'id': currencyId,
|
|
697
|
+
'name': currencyId,
|
|
698
|
+
'code': code,
|
|
699
|
+
'precision': this.parseNumber(minPrecision),
|
|
700
|
+
'active': undefined,
|
|
701
|
+
'fee': undefined,
|
|
702
|
+
'networks': resultingNetworks,
|
|
703
|
+
'deposit': undefined,
|
|
704
|
+
'withdraw': undefined,
|
|
705
|
+
'limits': {
|
|
706
|
+
'deposit': {
|
|
707
|
+
'min': undefined,
|
|
708
|
+
'max': undefined,
|
|
709
|
+
},
|
|
710
|
+
'withdraw': {
|
|
711
|
+
'min': this.safeNumber(rawCurrency, 'minimum_withdraw_amount'),
|
|
712
|
+
'max': undefined,
|
|
713
|
+
},
|
|
714
|
+
},
|
|
715
|
+
'info': rawCurrency,
|
|
716
|
+
});
|
|
719
717
|
}
|
|
720
718
|
parseTokenAndFeeTemp(item, feeTokenKey, feeAmountKey) {
|
|
721
719
|
const feeCost = this.safeString(item, feeAmountKey);
|
package/dist/cjs/src/ndax.js
CHANGED
|
@@ -480,43 +480,41 @@ class ndax extends ndax$1["default"] {
|
|
|
480
480
|
// },
|
|
481
481
|
// ...
|
|
482
482
|
//
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
}
|
|
494
|
-
result[code] = this.safeCurrencyStructure({
|
|
495
|
-
'id': id,
|
|
496
|
-
'name': this.safeString(currency, 'ProductFullName'),
|
|
497
|
-
'code': code,
|
|
498
|
-
'type': type,
|
|
499
|
-
'precision': this.safeNumber(currency, 'TickSize'),
|
|
500
|
-
'info': currency,
|
|
501
|
-
'active': !this.safeBool(currency, 'IsDisabled'),
|
|
502
|
-
'deposit': this.safeBool(currency, 'DepositEnabled'),
|
|
503
|
-
'withdraw': this.safeBool(currency, 'WithdrawEnabled'),
|
|
504
|
-
'fee': undefined,
|
|
505
|
-
'limits': {
|
|
506
|
-
'amount': {
|
|
507
|
-
'min': undefined,
|
|
508
|
-
'max': undefined,
|
|
509
|
-
},
|
|
510
|
-
'withdraw': {
|
|
511
|
-
'min': undefined,
|
|
512
|
-
'max': undefined,
|
|
513
|
-
},
|
|
514
|
-
},
|
|
515
|
-
'networks': {},
|
|
516
|
-
'margin': this.safeBool(currency, 'MarginEnabled'),
|
|
517
|
-
});
|
|
483
|
+
return this.parseCurrencies(response);
|
|
484
|
+
}
|
|
485
|
+
parseCurrency(rawCurrency) {
|
|
486
|
+
const id = this.safeString(rawCurrency, 'ProductId');
|
|
487
|
+
const code = this.safeCurrencyCode(this.safeString(rawCurrency, 'Product'));
|
|
488
|
+
const ProductType = this.safeString(rawCurrency, 'ProductType');
|
|
489
|
+
let type = (ProductType === 'NationalCurrency') ? 'fiat' : 'crypto';
|
|
490
|
+
if (ProductType === 'Unknown') {
|
|
491
|
+
// such currency is just a blanket entry
|
|
492
|
+
type = 'other';
|
|
518
493
|
}
|
|
519
|
-
return
|
|
494
|
+
return this.safeCurrencyStructure({
|
|
495
|
+
'id': id,
|
|
496
|
+
'name': this.safeString(rawCurrency, 'ProductFullName'),
|
|
497
|
+
'code': code,
|
|
498
|
+
'type': type,
|
|
499
|
+
'precision': this.safeNumber(rawCurrency, 'TickSize'),
|
|
500
|
+
'info': rawCurrency,
|
|
501
|
+
'active': !this.safeBool(rawCurrency, 'IsDisabled'),
|
|
502
|
+
'deposit': this.safeBool(rawCurrency, 'DepositEnabled'),
|
|
503
|
+
'withdraw': this.safeBool(rawCurrency, 'WithdrawEnabled'),
|
|
504
|
+
'fee': undefined,
|
|
505
|
+
'limits': {
|
|
506
|
+
'amount': {
|
|
507
|
+
'min': undefined,
|
|
508
|
+
'max': undefined,
|
|
509
|
+
},
|
|
510
|
+
'withdraw': {
|
|
511
|
+
'min': undefined,
|
|
512
|
+
'max': undefined,
|
|
513
|
+
},
|
|
514
|
+
},
|
|
515
|
+
'networks': {},
|
|
516
|
+
'margin': this.safeBool(rawCurrency, 'MarginEnabled'),
|
|
517
|
+
});
|
|
520
518
|
}
|
|
521
519
|
/**
|
|
522
520
|
* @method
|
|
@@ -666,7 +664,7 @@ class ndax extends ndax$1["default"] {
|
|
|
666
664
|
const newNonce = this.safeInteger(level, 0);
|
|
667
665
|
nonce = Math.max(nonce, newNonce);
|
|
668
666
|
}
|
|
669
|
-
const bidask = this.
|
|
667
|
+
const bidask = this.parseOrderBookBidAsk(level, priceKey, amountKey);
|
|
670
668
|
const levelSide = this.safeInteger(level, 9);
|
|
671
669
|
const side = levelSide ? asksKey : bidsKey;
|
|
672
670
|
const resultSide = result[side];
|
package/dist/cjs/src/okx.js
CHANGED
|
@@ -1517,7 +1517,18 @@ class okx extends okx$1["default"] {
|
|
|
1517
1517
|
};
|
|
1518
1518
|
}
|
|
1519
1519
|
safeMarket(marketId = undefined, market = undefined, delimiter = undefined, marketType = undefined) {
|
|
1520
|
-
|
|
1520
|
+
let isOption = false;
|
|
1521
|
+
if (marketId !== undefined) {
|
|
1522
|
+
const parts = marketId.split('-');
|
|
1523
|
+
const partsLength = parts.length;
|
|
1524
|
+
// a valid OKX option ends with the call/put flag and carries expiry+strike segments,
|
|
1525
|
+
// e.g. the market id BTC-USD-220325-194000-P (5 parts) or the unified symbol
|
|
1526
|
+
// BTC/USD:USD-260611-54000-C (4 parts). Requiring more than 3 dash-separated parts avoids
|
|
1527
|
+
// misclassifying ordinary ids that merely contain "-C"/"-P" (such as a SPOT id like
|
|
1528
|
+
// "PERFTESTA-PERFTESTB") as expired options, which would crash createExpiredOptionMarket
|
|
1529
|
+
// on the missing expiry.
|
|
1530
|
+
isOption = (partsLength > 3) && (marketId.endsWith('-C') || marketId.endsWith('-P'));
|
|
1531
|
+
}
|
|
1521
1532
|
if (isOption && !(marketId in this.markets_by_id)) {
|
|
1522
1533
|
// handle expired option contracts
|
|
1523
1534
|
return this.createExpiredOptionMarket(marketId);
|
|
@@ -1938,6 +1949,10 @@ class okx extends okx$1["default"] {
|
|
|
1938
1949
|
const marketsWithoutTest = [];
|
|
1939
1950
|
for (let i = 0; i < dataResponse.length; i++) {
|
|
1940
1951
|
const data = dataResponse[i];
|
|
1952
|
+
const instId = this.safeString(data, 'instId', '');
|
|
1953
|
+
if (instId === '') {
|
|
1954
|
+
continue; // skip broken "preopen" placeholder instruments that have no instId
|
|
1955
|
+
}
|
|
1941
1956
|
if (this.isSandboxModeEnabled) {
|
|
1942
1957
|
const instFamily = this.safeString(data, 'instFamily', '');
|
|
1943
1958
|
if (instFamily.startsWith('TEST')) {
|
|
@@ -9208,7 +9223,7 @@ class okx extends okx$1["default"] {
|
|
|
9208
9223
|
request['end'] = until;
|
|
9209
9224
|
}
|
|
9210
9225
|
if (timeframe !== undefined) {
|
|
9211
|
-
request['period'] = timeframe;
|
|
9226
|
+
request['period'] = this.safeString(this.timeframes, timeframe, timeframe);
|
|
9212
9227
|
}
|
|
9213
9228
|
if (since !== undefined) {
|
|
9214
9229
|
request['begin'] = since;
|
|
@@ -435,29 +435,27 @@ class onetrading extends onetrading$1["default"] {
|
|
|
435
435
|
// },
|
|
436
436
|
// ]
|
|
437
437
|
//
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
}
|
|
460
|
-
return result;
|
|
438
|
+
return this.parseCurrencies(response);
|
|
439
|
+
}
|
|
440
|
+
parseCurrency(rawCurrency) {
|
|
441
|
+
const id = this.safeString(rawCurrency, 'code');
|
|
442
|
+
const code = this.safeCurrencyCode(id);
|
|
443
|
+
return this.safeCurrencyStructure({
|
|
444
|
+
'id': id,
|
|
445
|
+
'code': code,
|
|
446
|
+
'name': this.safeString(rawCurrency, 'name'),
|
|
447
|
+
'info': rawCurrency,
|
|
448
|
+
'active': undefined,
|
|
449
|
+
'fee': undefined,
|
|
450
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(rawCurrency, 'precision'))),
|
|
451
|
+
'withdraw': undefined,
|
|
452
|
+
'deposit': undefined,
|
|
453
|
+
'limits': {
|
|
454
|
+
'amount': { 'min': undefined, 'max': undefined },
|
|
455
|
+
'withdraw': { 'min': undefined, 'max': undefined },
|
|
456
|
+
},
|
|
457
|
+
'networks': {},
|
|
458
|
+
});
|
|
461
459
|
}
|
|
462
460
|
/**
|
|
463
461
|
* @method
|
package/dist/cjs/src/phemex.js
CHANGED
|
@@ -1144,50 +1144,48 @@ class phemex extends phemex$1["default"] {
|
|
|
1144
1144
|
// }
|
|
1145
1145
|
const data = this.safeValue(response, 'data', {});
|
|
1146
1146
|
const currencies = this.safeValue(data, 'currencies', []);
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
},
|
|
1180
|
-
'withdraw': {
|
|
1181
|
-
'min': undefined,
|
|
1182
|
-
'max': undefined,
|
|
1183
|
-
},
|
|
1147
|
+
return this.parseCurrencies(currencies);
|
|
1148
|
+
}
|
|
1149
|
+
parseCurrency(rawCurrency) {
|
|
1150
|
+
const id = this.safeString(rawCurrency, 'currency');
|
|
1151
|
+
const code = this.safeCurrencyCode(id);
|
|
1152
|
+
const valueScaleString = this.safeString(rawCurrency, 'valueScale');
|
|
1153
|
+
const valueScale = parseInt(valueScaleString);
|
|
1154
|
+
const minValueEv = this.safeString(rawCurrency, 'minValueEv');
|
|
1155
|
+
const maxValueEv = this.safeString(rawCurrency, 'maxValueEv');
|
|
1156
|
+
let minAmount = undefined;
|
|
1157
|
+
let maxAmount = undefined;
|
|
1158
|
+
let precision = undefined;
|
|
1159
|
+
if (valueScale !== undefined) {
|
|
1160
|
+
const precisionString = this.parsePrecision(valueScaleString);
|
|
1161
|
+
precision = this.parseNumber(precisionString);
|
|
1162
|
+
minAmount = this.parseNumber(Precise["default"].stringMul(minValueEv, precisionString));
|
|
1163
|
+
maxAmount = this.parseNumber(Precise["default"].stringMul(maxValueEv, precisionString));
|
|
1164
|
+
}
|
|
1165
|
+
return this.safeCurrencyStructure({
|
|
1166
|
+
'id': id,
|
|
1167
|
+
'info': rawCurrency,
|
|
1168
|
+
'code': code,
|
|
1169
|
+
'name': this.safeString(rawCurrency, 'name'),
|
|
1170
|
+
'active': this.safeString(rawCurrency, 'status') === 'Listed',
|
|
1171
|
+
'deposit': undefined,
|
|
1172
|
+
'withdraw': undefined,
|
|
1173
|
+
'fee': undefined,
|
|
1174
|
+
'precision': precision,
|
|
1175
|
+
'limits': {
|
|
1176
|
+
'amount': {
|
|
1177
|
+
'min': minAmount,
|
|
1178
|
+
'max': maxAmount,
|
|
1184
1179
|
},
|
|
1185
|
-
'
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1180
|
+
'withdraw': {
|
|
1181
|
+
'min': undefined,
|
|
1182
|
+
'max': undefined,
|
|
1183
|
+
},
|
|
1184
|
+
},
|
|
1185
|
+
'valueScale': valueScale,
|
|
1186
|
+
'networks': undefined,
|
|
1187
|
+
'type': 'crypto',
|
|
1188
|
+
});
|
|
1191
1189
|
}
|
|
1192
1190
|
customParseBidAsk(bidask, priceKey = 0, amountKey = 1, market = undefined) {
|
|
1193
1191
|
if (market === undefined) {
|
|
@@ -3811,7 +3809,7 @@ class phemex extends phemex$1["default"] {
|
|
|
3811
3809
|
'txid': txid,
|
|
3812
3810
|
'timestamp': timestamp,
|
|
3813
3811
|
'datetime': this.iso8601(timestamp),
|
|
3814
|
-
'network': this.networkIdToCode(networkId),
|
|
3812
|
+
'network': this.networkIdToCode(networkId, code),
|
|
3815
3813
|
'address': address,
|
|
3816
3814
|
'addressTo': address,
|
|
3817
3815
|
'addressFrom': undefined,
|
|
@@ -5084,7 +5082,7 @@ class phemex extends phemex$1["default"] {
|
|
|
5084
5082
|
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
5085
5083
|
let networkId = undefined;
|
|
5086
5084
|
if (networkCode !== undefined) {
|
|
5087
|
-
networkId = this.networkCodeToId(networkCode);
|
|
5085
|
+
networkId = this.networkCodeToId(networkCode, code);
|
|
5088
5086
|
}
|
|
5089
5087
|
const stableCoins = this.safeValue(this.options, 'stableCoins');
|
|
5090
5088
|
if (networkId === undefined) {
|
package/dist/cjs/src/poloniex.js
CHANGED
|
@@ -2778,14 +2778,23 @@ class poloniex extends poloniex$1["default"] {
|
|
|
2778
2778
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
2779
2779
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
2780
2780
|
this.checkAddress(address);
|
|
2781
|
-
const
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2781
|
+
const currency = this.currency(code);
|
|
2782
|
+
const request = {
|
|
2783
|
+
'coin': currency['id'],
|
|
2784
|
+
'amount': this.currencyToPrecision(code, amount),
|
|
2785
|
+
'address': address,
|
|
2786
|
+
};
|
|
2787
|
+
let networkCode = undefined;
|
|
2788
|
+
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2789
|
+
if (networkCode === undefined) {
|
|
2790
|
+
// we need to know the network to find out the currency-junction
|
|
2791
|
+
throw new errors.ArgumentsRequired(this.id + ' withdraw requires a network parameter for ' + code + '.');
|
|
2792
|
+
}
|
|
2793
|
+
request['network'] = this.networkCodeToId(networkCode, code);
|
|
2785
2794
|
if (tag !== undefined) {
|
|
2786
2795
|
request['paymentId'] = tag;
|
|
2787
2796
|
}
|
|
2788
|
-
const response = await this.
|
|
2797
|
+
const response = await this.privatePostV2WalletsWithdraw(this.extend(request, params));
|
|
2789
2798
|
//
|
|
2790
2799
|
// {
|
|
2791
2800
|
// "response": "Withdrew 1.00000000 USDT.",
|
|
@@ -2793,11 +2802,7 @@ class poloniex extends poloniex$1["default"] {
|
|
|
2793
2802
|
// "withdrawalNumber": 13449869
|
|
2794
2803
|
// }
|
|
2795
2804
|
//
|
|
2796
|
-
|
|
2797
|
-
'response': response,
|
|
2798
|
-
'withdrawNetworkEntry': networkEntry,
|
|
2799
|
-
};
|
|
2800
|
-
return this.parseTransaction(withdrawResponse, currency);
|
|
2805
|
+
return this.parseTransaction(response, currency);
|
|
2801
2806
|
}
|
|
2802
2807
|
async fetchTransactionsHelper(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2803
2808
|
await this.loadMarkets();
|
|
@@ -3010,7 +3015,7 @@ class poloniex extends poloniex$1["default"] {
|
|
|
3010
3015
|
for (let j = 0; j < childChains.length; j++) {
|
|
3011
3016
|
let networkId = childChains[j];
|
|
3012
3017
|
networkId = networkId.replace(code, '');
|
|
3013
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
3018
|
+
const networkCode = this.networkIdToCode(networkId, currency['code']);
|
|
3014
3019
|
const networkInfo = this.safeValue(response, networkId);
|
|
3015
3020
|
const networkObject = {};
|
|
3016
3021
|
const withdrawFee = this.safeNumber(networkInfo, 'withdrawalFee');
|
|
@@ -3046,7 +3051,7 @@ class poloniex extends poloniex$1["default"] {
|
|
|
3046
3051
|
};
|
|
3047
3052
|
depositWithdrawFee['withdraw'] = withdrawResult;
|
|
3048
3053
|
depositWithdrawFee['deposit'] = depositResult;
|
|
3049
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
3054
|
+
const networkCode = this.networkIdToCode(networkId, this.safeString(currency, 'code'));
|
|
3050
3055
|
depositWithdrawFee['networks'][networkCode] = {
|
|
3051
3056
|
'withdraw': withdrawResult,
|
|
3052
3057
|
'deposit': depositResult,
|
|
@@ -267,7 +267,7 @@ class alpaca extends alpaca$1["default"] {
|
|
|
267
267
|
client.resolve(orderbook, messageHash);
|
|
268
268
|
}
|
|
269
269
|
handleDelta(bookside, delta) {
|
|
270
|
-
const bidAsk = this.
|
|
270
|
+
const bidAsk = this.parseOrderBookBidAsk(delta, 'p', 's');
|
|
271
271
|
bookside.storeArray(bidAsk);
|
|
272
272
|
}
|
|
273
273
|
handleDeltas(bookside, deltas) {
|
package/dist/cjs/src/pro/apex.js
CHANGED
|
@@ -341,7 +341,7 @@ class apex extends apex$1["default"] {
|
|
|
341
341
|
client.resolve(orderbook, messageHash);
|
|
342
342
|
}
|
|
343
343
|
handleDelta(bookside, delta) {
|
|
344
|
-
const bidAsk = this.
|
|
344
|
+
const bidAsk = this.parseOrderBookBidAsk(delta, 0, 1);
|
|
345
345
|
bookside.storeArray(bidAsk);
|
|
346
346
|
}
|
|
347
347
|
handleDeltas(bookside, deltas) {
|
|
@@ -297,7 +297,7 @@ class arkham extends arkham$1["default"] {
|
|
|
297
297
|
client.resolve(this.orderbooks[symbol], messageHash);
|
|
298
298
|
}
|
|
299
299
|
handleDelta(bookside, delta) {
|
|
300
|
-
const bidAsk = this.
|
|
300
|
+
const bidAsk = this.parseOrderBookBidAsk(delta, 'price', 'size');
|
|
301
301
|
bookside.storeArray(bidAsk);
|
|
302
302
|
}
|
|
303
303
|
/**
|
|
@@ -894,7 +894,7 @@ class backpack extends backpack$1["default"] {
|
|
|
894
894
|
}
|
|
895
895
|
handleBidAsks(bookSide, bidAsks) {
|
|
896
896
|
for (let i = 0; i < bidAsks.length; i++) {
|
|
897
|
-
const bidAsk = this.
|
|
897
|
+
const bidAsk = this.parseOrderBookBidAsk(bidAsks[i]);
|
|
898
898
|
bookSide.storeArray(bidAsk);
|
|
899
899
|
}
|
|
900
900
|
}
|
|
@@ -2244,7 +2244,7 @@ class binance extends binance$1["default"] {
|
|
|
2244
2244
|
// "status":200,
|
|
2245
2245
|
// "result":{
|
|
2246
2246
|
// "symbol":"BTCUSDT",
|
|
2247
|
-
// "price":"73178.
|
|
2247
|
+
// "price":"73178.60",
|
|
2248
2248
|
// "time":1712527052374
|
|
2249
2249
|
// }
|
|
2250
2250
|
// }
|
|
@@ -3679,8 +3679,8 @@ class binance extends binance$1["default"] {
|
|
|
3679
3679
|
await this.loadMarkets();
|
|
3680
3680
|
const market = this.market(symbol);
|
|
3681
3681
|
const type = this.getMarketType('fetchOpenOrdersWs', market, params);
|
|
3682
|
-
if (type !== 'spot'
|
|
3683
|
-
throw new errors.BadRequest(this.id + ' fetchOpenOrdersWs only supports spot
|
|
3682
|
+
if (type !== 'spot') {
|
|
3683
|
+
throw new errors.BadRequest(this.id + ' fetchOpenOrdersWs only supports spot markets');
|
|
3684
3684
|
}
|
|
3685
3685
|
const url = this.urls['api']['ws']['ws-api'][type];
|
|
3686
3686
|
const requestId = this.requestId(url);
|
|
@@ -942,7 +942,7 @@ class bitget extends bitget$1["default"] {
|
|
|
942
942
|
client.reject(error, messageHash);
|
|
943
943
|
}
|
|
944
944
|
handleDelta(bookside, delta) {
|
|
945
|
-
const bidAsk = this.
|
|
945
|
+
const bidAsk = this.parseOrderBookBidAsk(delta, 0, 1);
|
|
946
946
|
// we store the string representations in the orderbook for checksum calculation
|
|
947
947
|
// this simplifies the code for generating checksums as we do not need to do any complex number transformations
|
|
948
948
|
bidAsk.push(delta);
|
|
@@ -252,7 +252,7 @@ class bithumb extends bithumb$1["default"] {
|
|
|
252
252
|
//
|
|
253
253
|
const sideId = this.safeString(delta, 'orderType');
|
|
254
254
|
const side = (sideId === 'bid') ? 'bids' : 'asks';
|
|
255
|
-
const bidAsk = this.
|
|
255
|
+
const bidAsk = this.parseOrderBookBidAsk(delta, 'price', 'quantity');
|
|
256
256
|
const orderbookSide = orderbook[side];
|
|
257
257
|
orderbookSide.storeArray(bidAsk);
|
|
258
258
|
}
|
|
@@ -135,7 +135,7 @@ class bitstamp extends bitstamp$1["default"] {
|
|
|
135
135
|
}
|
|
136
136
|
handleBidAsks(bookSide, bidAsks) {
|
|
137
137
|
for (let i = 0; i < bidAsks.length; i++) {
|
|
138
|
-
const bidAsk = this.
|
|
138
|
+
const bidAsk = this.parseOrderBookBidAsk(bidAsks[i]);
|
|
139
139
|
bookSide.storeArray(bidAsk);
|
|
140
140
|
}
|
|
141
141
|
}
|
|
@@ -711,7 +711,7 @@ class blockchaincom extends blockchaincom$1["default"] {
|
|
|
711
711
|
client.resolve(orderbook, messageHash);
|
|
712
712
|
}
|
|
713
713
|
handleDelta(bookside, delta) {
|
|
714
|
-
const bookArray = this.
|
|
714
|
+
const bookArray = this.parseOrderBookBidAsk(delta, 'px', 'qty', 'num');
|
|
715
715
|
bookside.storeArray(bookArray);
|
|
716
716
|
}
|
|
717
717
|
handleDeltas(bookside, deltas) {
|
|
@@ -1024,7 +1024,7 @@ class bybit extends bybit$1["default"] {
|
|
|
1024
1024
|
}
|
|
1025
1025
|
}
|
|
1026
1026
|
handleDelta(bookside, delta) {
|
|
1027
|
-
const bidAsk = this.
|
|
1027
|
+
const bidAsk = this.parseOrderBookBidAsk(delta, 0, 1);
|
|
1028
1028
|
bookside.storeArray(bidAsk);
|
|
1029
1029
|
}
|
|
1030
1030
|
handleDeltas(bookside, deltas) {
|
package/dist/cjs/src/pro/cex.js
CHANGED
|
@@ -1034,7 +1034,7 @@ class cex extends cex$1["default"] {
|
|
|
1034
1034
|
client.resolve(storedOrderBook, messageHash);
|
|
1035
1035
|
}
|
|
1036
1036
|
handleDelta(bookside, delta) {
|
|
1037
|
-
const bidAsk = this.
|
|
1037
|
+
const bidAsk = this.parseOrderBookBidAsk(delta, 0, 1);
|
|
1038
1038
|
bookside.storeArray(bidAsk);
|
|
1039
1039
|
}
|
|
1040
1040
|
handleDeltas(bookside, deltas) {
|
|
@@ -814,7 +814,7 @@ class coinex extends coinex$1["default"] {
|
|
|
814
814
|
return await this.watchOrderBookForSymbols([symbol], limit, params);
|
|
815
815
|
}
|
|
816
816
|
handleDelta(bookside, delta) {
|
|
817
|
-
const bidAsk = this.
|
|
817
|
+
const bidAsk = this.parseOrderBookBidAsk(delta, 0, 1);
|
|
818
818
|
bookside.storeArray(bidAsk);
|
|
819
819
|
}
|
|
820
820
|
handleDeltas(bookside, deltas) {
|
|
@@ -126,7 +126,7 @@ class coinone extends coinone$1["default"] {
|
|
|
126
126
|
client.resolve(orderbook, messageHash);
|
|
127
127
|
}
|
|
128
128
|
handleDelta(bookside, delta) {
|
|
129
|
-
const bidAsk = this.
|
|
129
|
+
const bidAsk = this.parseOrderBookBidAsk(delta, 'price', 'qty');
|
|
130
130
|
bookside.storeArray(bidAsk);
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
@@ -1039,7 +1039,9 @@ class cryptocom extends cryptocom$1["default"] {
|
|
|
1039
1039
|
}
|
|
1040
1040
|
client.resolve(this.balance, messageHash);
|
|
1041
1041
|
const messageHashRequest = this.safeString(message, 'id');
|
|
1042
|
-
|
|
1042
|
+
if (messageHashRequest !== undefined) {
|
|
1043
|
+
client.resolve(this.balance, messageHashRequest);
|
|
1044
|
+
}
|
|
1043
1045
|
}
|
|
1044
1046
|
/**
|
|
1045
1047
|
* @method
|