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
package/js/src/coinex.js
CHANGED
|
@@ -725,90 +725,88 @@ export default class coinex extends Exchange {
|
|
|
725
725
|
// }
|
|
726
726
|
//
|
|
727
727
|
const data = this.safeList(response, 'data', []);
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
}
|
|
750
|
-
const precisionString = this.parsePrecision(this.safeString(chain, 'withdrawal_precision'));
|
|
751
|
-
const feeString = this.safeString(chain, 'withdrawal_fee');
|
|
752
|
-
const minNetworkDepositString = this.safeString(chain, 'min_deposit_amount');
|
|
753
|
-
const minNetworkWithdrawString = this.safeString(chain, 'min_withdraw_amount');
|
|
754
|
-
const canDepositChain = this.safeBool(chain, 'deposit_enabled');
|
|
755
|
-
const canWithdrawChain = this.safeBool(chain, 'withdraw_enabled');
|
|
756
|
-
const network = {
|
|
757
|
-
'id': networkId,
|
|
758
|
-
'network': networkCode,
|
|
759
|
-
'name': undefined,
|
|
760
|
-
'active': canDepositChain && canWithdrawChain,
|
|
761
|
-
'deposit': canDepositChain,
|
|
762
|
-
'withdraw': canWithdrawChain,
|
|
763
|
-
'fee': this.parseNumber(feeString),
|
|
764
|
-
'precision': this.parseNumber(precisionString),
|
|
765
|
-
'limits': {
|
|
766
|
-
'amount': {
|
|
767
|
-
'min': undefined,
|
|
768
|
-
'max': undefined,
|
|
769
|
-
},
|
|
770
|
-
'deposit': {
|
|
771
|
-
'min': this.parseNumber(minNetworkDepositString),
|
|
772
|
-
'max': undefined,
|
|
773
|
-
},
|
|
774
|
-
'withdraw': {
|
|
775
|
-
'min': this.parseNumber(minNetworkWithdrawString),
|
|
776
|
-
'max': undefined,
|
|
777
|
-
},
|
|
778
|
-
},
|
|
779
|
-
'info': chain,
|
|
780
|
-
};
|
|
781
|
-
networks[networkCode] = network;
|
|
728
|
+
return this.parseCurrencies(data);
|
|
729
|
+
}
|
|
730
|
+
parseCurrency(coin) {
|
|
731
|
+
const asset = this.safeDict(coin, 'asset', {});
|
|
732
|
+
const chains = this.safeList(coin, 'chains', []);
|
|
733
|
+
const currencyId = this.safeString(asset, 'ccy');
|
|
734
|
+
if (currencyId === undefined) {
|
|
735
|
+
return undefined; // coinex returns empty structures for some reason
|
|
736
|
+
}
|
|
737
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
738
|
+
const canDeposit = this.safeBool(asset, 'deposit_enabled');
|
|
739
|
+
const canWithdraw = this.safeBool(asset, 'withdraw_enabled');
|
|
740
|
+
const firstChain = this.safeDict(chains, 0, {});
|
|
741
|
+
const firstPrecisionString = this.parsePrecision(this.safeString(firstChain, 'withdrawal_precision'));
|
|
742
|
+
const networks = {};
|
|
743
|
+
for (let j = 0; j < chains.length; j++) {
|
|
744
|
+
const chain = chains[j];
|
|
745
|
+
const networkId = this.safeString(chain, 'chain');
|
|
746
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
747
|
+
if (networkId === undefined) {
|
|
748
|
+
continue;
|
|
782
749
|
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
750
|
+
const precisionString = this.parsePrecision(this.safeString(chain, 'withdrawal_precision'));
|
|
751
|
+
const feeString = this.safeString(chain, 'withdrawal_fee');
|
|
752
|
+
const minNetworkDepositString = this.safeString(chain, 'min_deposit_amount');
|
|
753
|
+
const minNetworkWithdrawString = this.safeString(chain, 'min_withdraw_amount');
|
|
754
|
+
const canDepositChain = this.safeBool(chain, 'deposit_enabled');
|
|
755
|
+
const canWithdrawChain = this.safeBool(chain, 'withdraw_enabled');
|
|
756
|
+
const network = {
|
|
757
|
+
'id': networkId,
|
|
758
|
+
'network': networkCode,
|
|
786
759
|
'name': undefined,
|
|
787
|
-
'active':
|
|
788
|
-
'deposit':
|
|
789
|
-
'withdraw':
|
|
790
|
-
'fee':
|
|
791
|
-
'precision': this.parseNumber(
|
|
760
|
+
'active': canDepositChain && canWithdrawChain,
|
|
761
|
+
'deposit': canDepositChain,
|
|
762
|
+
'withdraw': canWithdrawChain,
|
|
763
|
+
'fee': this.parseNumber(feeString),
|
|
764
|
+
'precision': this.parseNumber(precisionString),
|
|
792
765
|
'limits': {
|
|
793
766
|
'amount': {
|
|
794
767
|
'min': undefined,
|
|
795
768
|
'max': undefined,
|
|
796
769
|
},
|
|
797
770
|
'deposit': {
|
|
798
|
-
'min':
|
|
771
|
+
'min': this.parseNumber(minNetworkDepositString),
|
|
799
772
|
'max': undefined,
|
|
800
773
|
},
|
|
801
774
|
'withdraw': {
|
|
802
|
-
'min':
|
|
775
|
+
'min': this.parseNumber(minNetworkWithdrawString),
|
|
803
776
|
'max': undefined,
|
|
804
777
|
},
|
|
805
778
|
},
|
|
806
|
-
'
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
779
|
+
'info': chain,
|
|
780
|
+
};
|
|
781
|
+
networks[networkCode] = network;
|
|
782
|
+
}
|
|
783
|
+
return this.safeCurrencyStructure({
|
|
784
|
+
'id': currencyId,
|
|
785
|
+
'code': code,
|
|
786
|
+
'name': undefined,
|
|
787
|
+
'active': canDeposit && canWithdraw,
|
|
788
|
+
'deposit': canDeposit,
|
|
789
|
+
'withdraw': canWithdraw,
|
|
790
|
+
'fee': undefined,
|
|
791
|
+
'precision': this.parseNumber(firstPrecisionString),
|
|
792
|
+
'limits': {
|
|
793
|
+
'amount': {
|
|
794
|
+
'min': undefined,
|
|
795
|
+
'max': undefined,
|
|
796
|
+
},
|
|
797
|
+
'deposit': {
|
|
798
|
+
'min': undefined,
|
|
799
|
+
'max': undefined,
|
|
800
|
+
},
|
|
801
|
+
'withdraw': {
|
|
802
|
+
'min': undefined,
|
|
803
|
+
'max': undefined,
|
|
804
|
+
},
|
|
805
|
+
},
|
|
806
|
+
'networks': networks,
|
|
807
|
+
'type': 'crypto',
|
|
808
|
+
'info': coin,
|
|
809
|
+
});
|
|
812
810
|
}
|
|
813
811
|
/**
|
|
814
812
|
* @method
|
|
@@ -3993,7 +3991,7 @@ export default class coinex extends Exchange {
|
|
|
3993
3991
|
if (networkCode === undefined) {
|
|
3994
3992
|
throw new ArgumentsRequired(this.id + ' fetchDepositAddress() requires a "network" parameter');
|
|
3995
3993
|
}
|
|
3996
|
-
request['chain'] = this.networkCodeToId(networkCode); // required for on-chain, not required for inter-user transfer
|
|
3994
|
+
request['chain'] = this.networkCodeToId(networkCode, currency['code']); // required for on-chain, not required for inter-user transfer
|
|
3997
3995
|
const response = await this.v2PrivateGetAssetsDepositAddress(this.extend(request, params));
|
|
3998
3996
|
//
|
|
3999
3997
|
// {
|
|
@@ -4919,7 +4917,7 @@ export default class coinex extends Exchange {
|
|
|
4919
4917
|
let networkCode = undefined;
|
|
4920
4918
|
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
4921
4919
|
if (networkCode !== undefined) {
|
|
4922
|
-
request['chain'] = this.networkCodeToId(networkCode); // required for on-chain, not required for inter-user transfer
|
|
4920
|
+
request['chain'] = this.networkCodeToId(networkCode, currency['code']); // required for on-chain, not required for inter-user transfer
|
|
4923
4921
|
}
|
|
4924
4922
|
const response = await this.v2PrivatePostAssetsWithdraw(this.extend(request, params));
|
|
4925
4923
|
//
|
|
@@ -5126,7 +5124,7 @@ export default class coinex extends Exchange {
|
|
|
5126
5124
|
'txid': txid,
|
|
5127
5125
|
'timestamp': timestamp,
|
|
5128
5126
|
'datetime': this.iso8601(timestamp),
|
|
5129
|
-
'network': this.networkIdToCode(networkId),
|
|
5127
|
+
'network': this.networkIdToCode(networkId, code),
|
|
5130
5128
|
'address': address,
|
|
5131
5129
|
'addressTo': address,
|
|
5132
5130
|
'addressFrom': undefined,
|
|
@@ -5829,7 +5827,9 @@ export default class coinex extends Exchange {
|
|
|
5829
5827
|
result['withdraw']['percentage'] = false;
|
|
5830
5828
|
const networkId = this.safeString(entry, 'chain');
|
|
5831
5829
|
if (networkId) {
|
|
5832
|
-
const
|
|
5830
|
+
const currencyId = this.safeString(asset, 'ccy');
|
|
5831
|
+
const feeCode = this.safeCurrencyCode(currencyId, currency);
|
|
5832
|
+
const networkCode = this.networkIdToCode(networkId, feeCode);
|
|
5833
5833
|
result['networks'][networkCode] = {
|
|
5834
5834
|
'withdraw': {
|
|
5835
5835
|
'fee': this.safeNumber(entry, 'withdrawal_fee'),
|
package/js/src/coinmetro.d.ts
CHANGED
|
@@ -79,7 +79,7 @@ export default class coinmetro extends Exchange {
|
|
|
79
79
|
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
|
|
80
80
|
*/
|
|
81
81
|
fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
|
|
82
|
-
|
|
82
|
+
parseOrderBookBidsAsks(bidasks: any, priceKey?: IndexType, amountKey?: IndexType, countOrIdKey?: IndexType): any[];
|
|
83
83
|
/**
|
|
84
84
|
* @method
|
|
85
85
|
* @name coinmetro#fetchTickers
|
package/js/src/coinmetro.js
CHANGED
|
@@ -886,7 +886,7 @@ export default class coinmetro extends Exchange {
|
|
|
886
886
|
orderbook['nonce'] = this.safeInteger(book, 'seqNumber');
|
|
887
887
|
return orderbook;
|
|
888
888
|
}
|
|
889
|
-
|
|
889
|
+
parseOrderBookBidsAsks(bidasks, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
890
890
|
const prices = Object.keys(bidasks);
|
|
891
891
|
const result = [];
|
|
892
892
|
for (let i = 0; i < prices.length; i++) {
|
package/js/src/coinsph.js
CHANGED
|
@@ -623,7 +623,7 @@ export default class coinsph extends Exchange {
|
|
|
623
623
|
for (let j = 0; j < networkList.length; j++) {
|
|
624
624
|
const networkItem = networkList[j];
|
|
625
625
|
const network = this.safeString(networkItem, 'network');
|
|
626
|
-
const networkCode = this.networkIdToCode(network);
|
|
626
|
+
const networkCode = this.networkIdToCode(network, code);
|
|
627
627
|
networks[networkCode] = {
|
|
628
628
|
'info': networkItem,
|
|
629
629
|
'id': network,
|
package/js/src/cryptocom.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export default class cryptocom extends Exchange {
|
|
|
15
15
|
* @returns {object} an associative dictionary of currencies
|
|
16
16
|
*/
|
|
17
17
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
18
|
+
parseCurrency(currency: Dict): Currency;
|
|
18
19
|
/**
|
|
19
20
|
* @method
|
|
20
21
|
* @name cryptocom#fetchMarkets
|
package/js/src/cryptocom.js
CHANGED
|
@@ -559,7 +559,8 @@ export default class cryptocom extends Exchange {
|
|
|
559
559
|
response = await this.v1PrivatePostPrivateGetCurrencyNetworks(params);
|
|
560
560
|
}
|
|
561
561
|
catch (e) {
|
|
562
|
-
|
|
562
|
+
const erString = this.exceptionMessage(e);
|
|
563
|
+
if (erString.indexOf('"msg":"SYS_ERROR"') >= 0) {
|
|
563
564
|
// sub-accounts can't access this endpoint
|
|
564
565
|
// {"code":"10001","msg":"SYS_ERROR"}
|
|
565
566
|
return {};
|
|
@@ -612,57 +613,54 @@ export default class cryptocom extends Exchange {
|
|
|
612
613
|
//
|
|
613
614
|
const resultData = this.safeDict(response, 'result', {});
|
|
614
615
|
const currencyMap = this.safeDict(resultData, 'currency_map', {});
|
|
615
|
-
const
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
'network': network,
|
|
632
|
-
'active': undefined,
|
|
633
|
-
'deposit': this.safeBool(chain, 'deposit_enabled', false),
|
|
634
|
-
'withdraw': this.safeBool(chain, 'withdraw_enabled', false),
|
|
635
|
-
'fee': this.safeNumber(chain, 'withdrawal_fee'),
|
|
636
|
-
'precision': undefined,
|
|
637
|
-
'limits': {
|
|
638
|
-
'withdraw': {
|
|
639
|
-
'min': this.safeNumber(chain, 'min_withdrawal_amount'),
|
|
640
|
-
'max': undefined,
|
|
641
|
-
},
|
|
642
|
-
},
|
|
643
|
-
};
|
|
644
|
-
}
|
|
645
|
-
result[code] = this.safeCurrencyStructure({
|
|
646
|
-
'info': currency,
|
|
647
|
-
'id': id,
|
|
648
|
-
'code': code,
|
|
649
|
-
'name': this.safeString(currency, 'full_name'),
|
|
616
|
+
const enhancedArray = this.addKeyInArrayItems(currencyMap, '_coin_id');
|
|
617
|
+
return this.parseCurrencies(enhancedArray);
|
|
618
|
+
}
|
|
619
|
+
parseCurrency(currency) {
|
|
620
|
+
const id = this.safeString(currency, '_coin_id');
|
|
621
|
+
const code = this.safeCurrencyCode(id);
|
|
622
|
+
const networks = {};
|
|
623
|
+
const chains = this.safeList(currency, 'network_list', []);
|
|
624
|
+
for (let j = 0; j < chains.length; j++) {
|
|
625
|
+
const chain = chains[j];
|
|
626
|
+
const networkId = this.safeString(chain, 'network_id');
|
|
627
|
+
const network = this.networkIdToCode(networkId, code);
|
|
628
|
+
networks[network] = {
|
|
629
|
+
'info': chain,
|
|
630
|
+
'id': networkId,
|
|
631
|
+
'network': network,
|
|
650
632
|
'active': undefined,
|
|
651
|
-
'deposit':
|
|
652
|
-
'withdraw':
|
|
653
|
-
'fee':
|
|
633
|
+
'deposit': this.safeBool(chain, 'deposit_enabled', false),
|
|
634
|
+
'withdraw': this.safeBool(chain, 'withdraw_enabled', false),
|
|
635
|
+
'fee': this.safeNumber(chain, 'withdrawal_fee'),
|
|
654
636
|
'precision': undefined,
|
|
655
637
|
'limits': {
|
|
656
|
-
'
|
|
657
|
-
'min':
|
|
638
|
+
'withdraw': {
|
|
639
|
+
'min': this.safeNumber(chain, 'min_withdrawal_amount'),
|
|
658
640
|
'max': undefined,
|
|
659
641
|
},
|
|
660
642
|
},
|
|
661
|
-
|
|
662
|
-
'networks': networks,
|
|
663
|
-
});
|
|
643
|
+
};
|
|
664
644
|
}
|
|
665
|
-
return
|
|
645
|
+
return this.safeCurrencyStructure({
|
|
646
|
+
'info': currency,
|
|
647
|
+
'id': id,
|
|
648
|
+
'code': code,
|
|
649
|
+
'name': this.safeString(currency, 'full_name'),
|
|
650
|
+
'active': undefined,
|
|
651
|
+
'deposit': undefined,
|
|
652
|
+
'withdraw': undefined,
|
|
653
|
+
'fee': undefined,
|
|
654
|
+
'precision': undefined,
|
|
655
|
+
'limits': {
|
|
656
|
+
'amount': {
|
|
657
|
+
'min': undefined,
|
|
658
|
+
'max': undefined,
|
|
659
|
+
},
|
|
660
|
+
},
|
|
661
|
+
'type': 'crypto',
|
|
662
|
+
'networks': networks,
|
|
663
|
+
});
|
|
666
664
|
}
|
|
667
665
|
/**
|
|
668
666
|
* @method
|
|
@@ -2016,7 +2014,7 @@ export default class cryptocom extends Exchange {
|
|
|
2016
2014
|
}
|
|
2017
2015
|
let networkCode = undefined;
|
|
2018
2016
|
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2019
|
-
const networkId = this.networkCodeToId(networkCode);
|
|
2017
|
+
const networkId = this.networkCodeToId(networkCode, code);
|
|
2020
2018
|
if (networkId !== undefined) {
|
|
2021
2019
|
request['network_id'] = networkId;
|
|
2022
2020
|
}
|
|
@@ -3329,8 +3327,8 @@ export default class cryptocom extends Exchange {
|
|
|
3329
3327
|
paramsKeys = object;
|
|
3330
3328
|
}
|
|
3331
3329
|
else {
|
|
3332
|
-
const
|
|
3333
|
-
paramsKeys =
|
|
3330
|
+
const objectKeys = Object.keys(object);
|
|
3331
|
+
paramsKeys = this.sort(objectKeys);
|
|
3334
3332
|
}
|
|
3335
3333
|
for (let i = 0; i < paramsKeys.length; i++) {
|
|
3336
3334
|
const key = paramsKeys[i];
|
package/js/src/cryptomus.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/cryptomus.js';
|
|
2
|
-
import type { Balances, Currencies, Dict, int, Int, Market, Num, Order, OrderBook, OrderType, OrderSide, Str, Strings, Ticker, Tickers, Trade, TradingFees } from './base/types.js';
|
|
2
|
+
import type { Balances, Currencies, Dict, int, Int, Market, Num, Order, OrderBook, OrderType, OrderSide, Str, Strings, Ticker, Tickers, Trade, TradingFees, Currency } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class cryptomus
|
|
5
5
|
* @augments Exchange
|
|
@@ -25,6 +25,7 @@ export default class cryptomus extends Exchange {
|
|
|
25
25
|
* @returns {object} an associative dictionary of currencies
|
|
26
26
|
*/
|
|
27
27
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
28
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
28
29
|
/**
|
|
29
30
|
* @method
|
|
30
31
|
* @name cryptomus#fetchTickers
|
package/js/src/cryptomus.js
CHANGED
|
@@ -74,7 +74,7 @@ export default class cryptomus extends Exchange {
|
|
|
74
74
|
'fetchConvertTradeHistory': false,
|
|
75
75
|
'fetchCrossBorrowRate': false,
|
|
76
76
|
'fetchCrossBorrowRates': false,
|
|
77
|
-
'fetchCurrencies':
|
|
77
|
+
'fetchCurrencies': true,
|
|
78
78
|
'fetchDepositAddress': false,
|
|
79
79
|
'fetchDeposits': false,
|
|
80
80
|
'fetchDepositsWithdrawals': false,
|
|
@@ -401,46 +401,50 @@ export default class cryptomus extends Exchange {
|
|
|
401
401
|
//
|
|
402
402
|
const coins = this.safeList(response, 'result');
|
|
403
403
|
const groupedById = this.groupBy(coins, 'currency_code');
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
'limits': {
|
|
419
|
-
'withdraw': {
|
|
420
|
-
'min': this.safeNumber(networkEntry, 'min_withdraw'),
|
|
421
|
-
'max': this.safeNumber(networkEntry, 'max_withdraw'),
|
|
422
|
-
},
|
|
423
|
-
'deposit': {
|
|
424
|
-
'min': this.safeNumber(networkEntry, 'min_deposit'),
|
|
425
|
-
'max': this.safeNumber(networkEntry, 'max_deposit'),
|
|
426
|
-
},
|
|
427
|
-
},
|
|
428
|
-
'active': undefined,
|
|
429
|
-
'deposit': this.safeBool(networkEntry, 'can_withdraw'),
|
|
430
|
-
'withdraw': this.safeBool(networkEntry, 'can_deposit'),
|
|
431
|
-
'fee': undefined,
|
|
432
|
-
'precision': undefined,
|
|
433
|
-
'info': networkEntry,
|
|
434
|
-
};
|
|
404
|
+
const groupedArray = Object.values(groupedById);
|
|
405
|
+
return this.parseCurrencies(groupedArray);
|
|
406
|
+
}
|
|
407
|
+
parseCurrency(rawCurrency) {
|
|
408
|
+
// currency here is array of networks
|
|
409
|
+
let id = undefined; // all entried have same id, as they were grouped by
|
|
410
|
+
let code = undefined;
|
|
411
|
+
const networks = {};
|
|
412
|
+
for (let i = 0; i < rawCurrency.length; i++) {
|
|
413
|
+
const networkEntry = rawCurrency[i];
|
|
414
|
+
// set ID on first loop
|
|
415
|
+
if (id === undefined) {
|
|
416
|
+
id = this.safeString(networkEntry, 'currency_code');
|
|
417
|
+
code = this.safeCurrencyCode(id);
|
|
435
418
|
}
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
'
|
|
440
|
-
'
|
|
441
|
-
|
|
419
|
+
const networkId = this.safeString(networkEntry, 'network_code');
|
|
420
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
421
|
+
networks[networkCode] = {
|
|
422
|
+
'id': networkId,
|
|
423
|
+
'network': networkCode,
|
|
424
|
+
'limits': {
|
|
425
|
+
'withdraw': {
|
|
426
|
+
'min': this.safeNumber(networkEntry, 'min_withdraw'),
|
|
427
|
+
'max': this.safeNumber(networkEntry, 'max_withdraw'),
|
|
428
|
+
},
|
|
429
|
+
'deposit': {
|
|
430
|
+
'min': this.safeNumber(networkEntry, 'min_deposit'),
|
|
431
|
+
'max': this.safeNumber(networkEntry, 'max_deposit'),
|
|
432
|
+
},
|
|
433
|
+
},
|
|
434
|
+
'active': undefined,
|
|
435
|
+
'deposit': this.safeBool(networkEntry, 'can_deposit'),
|
|
436
|
+
'withdraw': this.safeBool(networkEntry, 'can_withdraw'),
|
|
437
|
+
'fee': undefined,
|
|
438
|
+
'precision': undefined,
|
|
439
|
+
'info': networkEntry,
|
|
440
|
+
};
|
|
442
441
|
}
|
|
443
|
-
return
|
|
442
|
+
return this.safeCurrencyStructure({
|
|
443
|
+
'id': id,
|
|
444
|
+
'code': code,
|
|
445
|
+
'networks': networks,
|
|
446
|
+
'info': rawCurrency,
|
|
447
|
+
});
|
|
444
448
|
}
|
|
445
449
|
/**
|
|
446
450
|
* @method
|
package/js/src/deepcoin.js
CHANGED
|
@@ -1061,7 +1061,7 @@ export default class deepcoin extends Exchange {
|
|
|
1061
1061
|
const amount = this.safeNumber(transaction, 'amount');
|
|
1062
1062
|
const timestamp = this.safeTimestamp(transaction, 'createTime');
|
|
1063
1063
|
const networkId = this.safeString(transaction, 'chainName');
|
|
1064
|
-
const network = this.networkIdToCode(networkId);
|
|
1064
|
+
const network = this.networkIdToCode(networkId, code);
|
|
1065
1065
|
const status = this.parseTransactionStatus(this.safeString(transaction, 'status'));
|
|
1066
1066
|
return {
|
|
1067
1067
|
'info': transaction,
|
|
@@ -1208,10 +1208,11 @@ export default class deepcoin extends Exchange {
|
|
|
1208
1208
|
const chain = this.safeString(response, 'chain');
|
|
1209
1209
|
const address = this.safeString(response, 'address');
|
|
1210
1210
|
this.checkAddress(address);
|
|
1211
|
+
const code = this.safeString(currency, 'code');
|
|
1211
1212
|
return {
|
|
1212
1213
|
'info': response,
|
|
1213
1214
|
'currency': undefined,
|
|
1214
|
-
'network': this.networkIdToCode(chain),
|
|
1215
|
+
'network': this.networkIdToCode(chain, code),
|
|
1215
1216
|
'address': address,
|
|
1216
1217
|
'tag': this.safeString(response, 'memo'),
|
|
1217
1218
|
};
|
package/js/src/delta.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export default class delta extends Exchange {
|
|
|
39
39
|
* @returns {object} an associative dictionary of currencies
|
|
40
40
|
*/
|
|
41
41
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
42
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
42
43
|
loadMarkets(reload?: boolean, params?: {}): Promise<import("./base/types.js").Dictionary<MarketInterface>>;
|
|
43
44
|
indexByStringifiedNumericId(input: any): Dict;
|
|
44
45
|
/**
|
package/js/src/delta.js
CHANGED
|
@@ -560,62 +560,60 @@ export default class delta extends Exchange {
|
|
|
560
560
|
// }
|
|
561
561
|
//
|
|
562
562
|
const currencies = this.safeList(response, 'result', []);
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
'limits': {
|
|
585
|
-
'deposit': {
|
|
586
|
-
'min': this.safeNumber(chain, 'min_deposit_amount'),
|
|
587
|
-
'max': undefined,
|
|
588
|
-
},
|
|
589
|
-
'withdraw': {
|
|
590
|
-
'min': this.safeNumber(chain, 'min_withdrawal_amount'),
|
|
591
|
-
'max': undefined,
|
|
592
|
-
},
|
|
593
|
-
},
|
|
594
|
-
};
|
|
595
|
-
}
|
|
596
|
-
result[code] = this.safeCurrencyStructure({
|
|
597
|
-
'id': id,
|
|
598
|
-
'numericId': numericId,
|
|
599
|
-
'code': code,
|
|
600
|
-
'name': this.safeString(currency, 'name'),
|
|
601
|
-
'info': currency,
|
|
602
|
-
'active': undefined,
|
|
603
|
-
'deposit': this.safeString(currency, 'deposit_status') === 'enabled',
|
|
604
|
-
'withdraw': this.safeString(currency, 'withdrawal_status') === 'enabled',
|
|
605
|
-
'fee': this.safeNumber(currency, 'base_withdrawal_fee'),
|
|
606
|
-
'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'precision'))),
|
|
563
|
+
return this.parseCurrencies(currencies);
|
|
564
|
+
}
|
|
565
|
+
parseCurrency(rawCurrency) {
|
|
566
|
+
const id = this.safeString(rawCurrency, 'symbol');
|
|
567
|
+
const numericId = this.safeInteger(rawCurrency, 'id');
|
|
568
|
+
const code = this.safeCurrencyCode(id);
|
|
569
|
+
const chains = this.safeList(rawCurrency, 'networks', []);
|
|
570
|
+
const networks = {};
|
|
571
|
+
for (let j = 0; j < chains.length; j++) {
|
|
572
|
+
const chain = chains[j];
|
|
573
|
+
const networkId = this.safeString(chain, 'network');
|
|
574
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
575
|
+
networks[networkCode] = {
|
|
576
|
+
'id': networkId,
|
|
577
|
+
'network': networkCode,
|
|
578
|
+
'name': this.safeString(chain, 'name'),
|
|
579
|
+
'info': chain,
|
|
580
|
+
'active': this.safeString(chain, 'status') === 'enabled',
|
|
581
|
+
'deposit': this.safeString(chain, 'deposit_status') === 'enabled',
|
|
582
|
+
'withdraw': this.safeString(chain, 'withdrawal_status') === 'enabled',
|
|
583
|
+
'fee': this.safeNumber(chain, 'base_withdrawal_fee'),
|
|
607
584
|
'limits': {
|
|
608
|
-
'
|
|
585
|
+
'deposit': {
|
|
586
|
+
'min': this.safeNumber(chain, 'min_deposit_amount'),
|
|
587
|
+
'max': undefined,
|
|
588
|
+
},
|
|
609
589
|
'withdraw': {
|
|
610
|
-
'min': this.safeNumber(
|
|
590
|
+
'min': this.safeNumber(chain, 'min_withdrawal_amount'),
|
|
611
591
|
'max': undefined,
|
|
612
592
|
},
|
|
613
593
|
},
|
|
614
|
-
|
|
615
|
-
'type': 'crypto',
|
|
616
|
-
});
|
|
594
|
+
};
|
|
617
595
|
}
|
|
618
|
-
return
|
|
596
|
+
return this.safeCurrencyStructure({
|
|
597
|
+
'id': id,
|
|
598
|
+
'numericId': numericId,
|
|
599
|
+
'code': code,
|
|
600
|
+
'name': this.safeString(rawCurrency, 'name'),
|
|
601
|
+
'info': rawCurrency,
|
|
602
|
+
'active': undefined,
|
|
603
|
+
'deposit': this.safeString(rawCurrency, 'deposit_status') === 'enabled',
|
|
604
|
+
'withdraw': this.safeString(rawCurrency, 'withdrawal_status') === 'enabled',
|
|
605
|
+
'fee': this.safeNumber(rawCurrency, 'base_withdrawal_fee'),
|
|
606
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(rawCurrency, 'precision'))),
|
|
607
|
+
'limits': {
|
|
608
|
+
'amount': { 'min': undefined, 'max': undefined },
|
|
609
|
+
'withdraw': {
|
|
610
|
+
'min': this.safeNumber(rawCurrency, 'min_withdrawal_amount'),
|
|
611
|
+
'max': undefined,
|
|
612
|
+
},
|
|
613
|
+
},
|
|
614
|
+
'networks': networks,
|
|
615
|
+
'type': 'crypto',
|
|
616
|
+
});
|
|
619
617
|
}
|
|
620
618
|
async loadMarkets(reload = false, params = {}) {
|
|
621
619
|
const markets = await super.loadMarkets(reload, params);
|
|
@@ -2603,11 +2601,12 @@ export default class delta extends Exchange {
|
|
|
2603
2601
|
const address = this.safeString(depositAddress, 'address');
|
|
2604
2602
|
const marketId = this.safeString(depositAddress, 'asset_symbol');
|
|
2605
2603
|
const networkId = this.safeString(depositAddress, 'network');
|
|
2604
|
+
const code = this.safeCurrencyCode(marketId, currency);
|
|
2606
2605
|
this.checkAddress(address);
|
|
2607
2606
|
return {
|
|
2608
2607
|
'info': depositAddress,
|
|
2609
|
-
'currency':
|
|
2610
|
-
'network': this.networkIdToCode(networkId),
|
|
2608
|
+
'currency': code,
|
|
2609
|
+
'network': this.networkIdToCode(networkId, code),
|
|
2611
2610
|
'address': address,
|
|
2612
2611
|
'tag': this.safeString(depositAddress, 'memo'),
|
|
2613
2612
|
};
|