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/kraken.js
CHANGED
|
@@ -833,66 +833,65 @@ export default class kraken extends Exchange {
|
|
|
833
833
|
// },
|
|
834
834
|
// }
|
|
835
835
|
//
|
|
836
|
-
const currencies = this.
|
|
837
|
-
const
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
836
|
+
const currencies = this.safeDict(response, 'result', {});
|
|
837
|
+
const enhancedArray = this.addKeyInArrayItems(currencies, '_coin_id');
|
|
838
|
+
return this.parseCurrencies(enhancedArray);
|
|
839
|
+
}
|
|
840
|
+
parseCurrency(rawCurrency) {
|
|
841
|
+
// todo: will need to rethink the fees
|
|
842
|
+
// see: https://support.kraken.com/hc/en-us/articles/201893608-What-are-the-withdrawal-fees-
|
|
843
|
+
// to add support for multiple withdrawal/deposit methods and
|
|
844
|
+
// differentiated fees for each particular method
|
|
845
|
+
//
|
|
846
|
+
// Notes about abbreviations:
|
|
847
|
+
// Z and X prefixes: https://support.kraken.com/hc/en-us/articles/360001206766-Bitcoin-currency-code-XBT-vs-BTC
|
|
848
|
+
// S and M suffixes: https://support.kraken.com/hc/en-us/articles/360039879471-What-is-Asset-S-and-Asset-M-
|
|
849
|
+
//
|
|
850
|
+
const id = this.safeString(rawCurrency, '_coin_id');
|
|
851
|
+
let code = this.safeCurrencyCode(id);
|
|
852
|
+
// the below cannot be reliably done in `safeCurrencyCode`, so we have to do it here
|
|
853
|
+
if (id.indexOf('.') < 0) {
|
|
854
|
+
const altName = this.safeString(rawCurrency, 'altname');
|
|
855
|
+
// handle cases like below:
|
|
850
856
|
//
|
|
851
|
-
|
|
852
|
-
//
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
//
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
code = this.safeCurrencyCode(altName);
|
|
863
|
-
// also, add map in commonCurrencies:
|
|
864
|
-
this.commonCurrencies[id] = code;
|
|
865
|
-
}
|
|
866
|
-
else {
|
|
867
|
-
code = this.safeCurrencyCode(id);
|
|
868
|
-
}
|
|
857
|
+
// id | altname
|
|
858
|
+
// ---------------
|
|
859
|
+
// XXBT | XBT
|
|
860
|
+
// ZUSD | USD
|
|
861
|
+
if (id !== altName && (id.startsWith('X') || id.startsWith('Z'))) {
|
|
862
|
+
code = this.safeCurrencyCode(altName);
|
|
863
|
+
// also, add map in commonCurrencies:
|
|
864
|
+
this.commonCurrencies[id] = code;
|
|
865
|
+
}
|
|
866
|
+
else {
|
|
867
|
+
code = this.safeCurrencyCode(id);
|
|
869
868
|
}
|
|
870
|
-
const isFiat = code.indexOf('.HOLD') >= 0;
|
|
871
|
-
result[code] = this.safeCurrencyStructure({
|
|
872
|
-
'id': id,
|
|
873
|
-
'code': code,
|
|
874
|
-
'info': currency,
|
|
875
|
-
'name': this.safeString(currency, 'altname'),
|
|
876
|
-
'active': this.safeString(currency, 'status') === 'enabled',
|
|
877
|
-
'type': isFiat ? 'fiat' : 'crypto',
|
|
878
|
-
'deposit': undefined,
|
|
879
|
-
'withdraw': undefined,
|
|
880
|
-
'fee': undefined,
|
|
881
|
-
'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals'))),
|
|
882
|
-
'limits': {
|
|
883
|
-
'amount': {
|
|
884
|
-
'min': undefined,
|
|
885
|
-
'max': undefined,
|
|
886
|
-
},
|
|
887
|
-
'withdraw': {
|
|
888
|
-
'min': undefined,
|
|
889
|
-
'max': undefined,
|
|
890
|
-
},
|
|
891
|
-
},
|
|
892
|
-
'networks': {},
|
|
893
|
-
});
|
|
894
869
|
}
|
|
895
|
-
|
|
870
|
+
const isFiat = code.indexOf('.HOLD') >= 0;
|
|
871
|
+
rawCurrency = this.omit(rawCurrency, '_coin_id');
|
|
872
|
+
return this.safeCurrencyStructure({
|
|
873
|
+
'id': id,
|
|
874
|
+
'code': code,
|
|
875
|
+
'info': rawCurrency,
|
|
876
|
+
'name': this.safeString(rawCurrency, 'altname'),
|
|
877
|
+
'active': this.safeString(rawCurrency, 'status') === 'enabled',
|
|
878
|
+
'type': isFiat ? 'fiat' : 'crypto',
|
|
879
|
+
'deposit': undefined,
|
|
880
|
+
'withdraw': undefined,
|
|
881
|
+
'fee': undefined,
|
|
882
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(rawCurrency, 'decimals'))),
|
|
883
|
+
'limits': {
|
|
884
|
+
'amount': {
|
|
885
|
+
'min': undefined,
|
|
886
|
+
'max': undefined,
|
|
887
|
+
},
|
|
888
|
+
'withdraw': {
|
|
889
|
+
'min': undefined,
|
|
890
|
+
'max': undefined,
|
|
891
|
+
},
|
|
892
|
+
},
|
|
893
|
+
'networks': {},
|
|
894
|
+
});
|
|
896
895
|
}
|
|
897
896
|
safeCurrencyCode(currencyId, currency = undefined) {
|
|
898
897
|
if (currencyId === undefined) {
|
|
@@ -970,7 +969,7 @@ export default class kraken extends Exchange {
|
|
|
970
969
|
'tierBased': true,
|
|
971
970
|
};
|
|
972
971
|
}
|
|
973
|
-
|
|
972
|
+
parseOrderBookBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
974
973
|
const price = this.safeNumber(bidask, priceKey);
|
|
975
974
|
const amount = this.safeNumber(bidask, amountKey);
|
|
976
975
|
const timestamp = this.safeInteger(bidask, 2);
|
package/js/src/kucoin.js
CHANGED
|
@@ -3609,7 +3609,7 @@ export default class kucoin extends Exchange {
|
|
|
3609
3609
|
let networkCode = undefined;
|
|
3610
3610
|
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
3611
3611
|
if (networkCode !== undefined) {
|
|
3612
|
-
request['chain'] = this.networkCodeToId(networkCode).toLowerCase();
|
|
3612
|
+
request['chain'] = this.networkCodeToId(networkCode, code).toLowerCase();
|
|
3613
3613
|
}
|
|
3614
3614
|
//
|
|
3615
3615
|
// {
|
|
@@ -4287,6 +4287,7 @@ export default class kucoin extends Exchange {
|
|
|
4287
4287
|
*/
|
|
4288
4288
|
async createUtaOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
4289
4289
|
await this.loadMarkets();
|
|
4290
|
+
const market = this.market(symbol);
|
|
4290
4291
|
const request = this.createUtaOrderRequest(symbol, type, side, amount, price, params);
|
|
4291
4292
|
const response = await this.utaPrivatePostAccountModeOrderPlace(request);
|
|
4292
4293
|
//
|
|
@@ -4301,7 +4302,7 @@ export default class kucoin extends Exchange {
|
|
|
4301
4302
|
// }
|
|
4302
4303
|
//
|
|
4303
4304
|
const data = this.safeDict(response, 'data', {});
|
|
4304
|
-
return this.parseOrder(data);
|
|
4305
|
+
return this.parseOrder(data, market);
|
|
4305
4306
|
}
|
|
4306
4307
|
createUtaOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
|
|
4307
4308
|
const market = this.market(symbol);
|
package/js/src/latoken.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export default class latoken extends Exchange {
|
|
|
33
33
|
* @returns {object} an associative dictionary of currencies
|
|
34
34
|
*/
|
|
35
35
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
36
|
+
parseCurrency(currency: Dict): Currency;
|
|
36
37
|
/**
|
|
37
38
|
* @method
|
|
38
39
|
* @name latoken#fetchBalance
|
package/js/src/latoken.js
CHANGED
|
@@ -511,39 +511,37 @@ export default class latoken extends Exchange {
|
|
|
511
511
|
// },
|
|
512
512
|
// ]
|
|
513
513
|
//
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
},
|
|
538
|
-
'withdraw': {
|
|
539
|
-
'min': undefined,
|
|
540
|
-
'max': undefined,
|
|
541
|
-
},
|
|
514
|
+
return this.parseCurrencies(response);
|
|
515
|
+
}
|
|
516
|
+
parseCurrency(currency) {
|
|
517
|
+
const id = this.safeString(currency, 'id');
|
|
518
|
+
const tag = this.safeString(currency, 'tag');
|
|
519
|
+
const code = this.safeCurrencyCode(tag);
|
|
520
|
+
const currencyType = this.safeString(currency, 'type');
|
|
521
|
+
const isCrypto = (currencyType === 'CURRENCY_TYPE_CRYPTO' || currencyType === 'CURRENCY_TYPE_IEO');
|
|
522
|
+
return this.safeCurrencyStructure({
|
|
523
|
+
'id': id,
|
|
524
|
+
'code': code,
|
|
525
|
+
'info': currency,
|
|
526
|
+
'name': this.safeString(currency, 'name'),
|
|
527
|
+
'type': isCrypto ? 'crypto' : 'other',
|
|
528
|
+
'active': this.safeString(currency, 'status') === 'CURRENCY_STATUS_ACTIVE',
|
|
529
|
+
'deposit': undefined,
|
|
530
|
+
'withdraw': undefined,
|
|
531
|
+
'fee': this.safeNumber(currency, 'fee'),
|
|
532
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals'))),
|
|
533
|
+
'limits': {
|
|
534
|
+
'amount': {
|
|
535
|
+
'min': this.safeNumber(currency, 'minTransferAmount'),
|
|
536
|
+
'max': undefined,
|
|
542
537
|
},
|
|
543
|
-
'
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
538
|
+
'withdraw': {
|
|
539
|
+
'min': undefined,
|
|
540
|
+
'max': undefined,
|
|
541
|
+
},
|
|
542
|
+
},
|
|
543
|
+
'networks': {},
|
|
544
|
+
});
|
|
547
545
|
}
|
|
548
546
|
/**
|
|
549
547
|
* @method
|
package/js/src/lbank.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export default class lbank extends Exchange {
|
|
|
24
24
|
* @returns {dict} an associative dictionary of currencies
|
|
25
25
|
*/
|
|
26
26
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
27
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
27
28
|
/**
|
|
28
29
|
* @method
|
|
29
30
|
* @name lbank#fetchMarkets
|
package/js/src/lbank.js
CHANGED
|
@@ -448,66 +448,65 @@ export default class lbank extends Exchange {
|
|
|
448
448
|
//
|
|
449
449
|
const currenciesData = this.safeList(response, 'data', []);
|
|
450
450
|
const grouped = this.groupBy(currenciesData, 'assetCode');
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
465
|
-
networks[networkCode] = {
|
|
466
|
-
'id': networkId,
|
|
467
|
-
'network': networkCode,
|
|
468
|
-
'limits': {
|
|
469
|
-
'withdraw': {
|
|
470
|
-
'min': this.safeNumber(networkEntry, 'min'),
|
|
471
|
-
'max': undefined,
|
|
472
|
-
},
|
|
473
|
-
'deposit': {
|
|
474
|
-
'min': this.safeNumber(networkEntry, 'minTransfer'),
|
|
475
|
-
'max': undefined,
|
|
476
|
-
},
|
|
477
|
-
},
|
|
478
|
-
'active': undefined,
|
|
479
|
-
'deposit': undefined,
|
|
480
|
-
'withdraw': this.safeBool(networkEntry, 'canWithDraw'),
|
|
481
|
-
'fee': this.safeNumber(networkEntry, 'fee'),
|
|
482
|
-
'precision': this.parseNumber(this.parsePrecision(this.safeString(networkEntry, 'transferAmtScale'))),
|
|
483
|
-
'info': networkEntry,
|
|
484
|
-
};
|
|
451
|
+
const values = Object.values(grouped);
|
|
452
|
+
return this.parseCurrencies(values);
|
|
453
|
+
}
|
|
454
|
+
parseCurrency(rawCurrency) {
|
|
455
|
+
const id = this.safeString(rawCurrency[0], 'assetCode'); // first member is guaranteed
|
|
456
|
+
const code = this.safeCurrencyCode(id);
|
|
457
|
+
const networksRaw = rawCurrency;
|
|
458
|
+
const networks = {};
|
|
459
|
+
for (let j = 0; j < networksRaw.length; j++) {
|
|
460
|
+
const networkEntry = networksRaw[j];
|
|
461
|
+
let networkId = this.safeString(networkEntry, 'chain');
|
|
462
|
+
if (networkId === undefined) {
|
|
463
|
+
networkId = this.safeString(networkEntry, 'assetCode'); // use type as fallback if networkId is not present
|
|
485
464
|
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
'
|
|
489
|
-
'
|
|
490
|
-
'type': undefined,
|
|
491
|
-
'name': undefined,
|
|
492
|
-
'active': undefined,
|
|
493
|
-
'deposit': undefined,
|
|
494
|
-
'withdraw': undefined,
|
|
495
|
-
'fee': undefined,
|
|
465
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
466
|
+
networks[networkCode] = {
|
|
467
|
+
'id': networkId,
|
|
468
|
+
'network': networkCode,
|
|
496
469
|
'limits': {
|
|
497
470
|
'withdraw': {
|
|
498
|
-
'min':
|
|
471
|
+
'min': this.safeNumber(networkEntry, 'min'),
|
|
499
472
|
'max': undefined,
|
|
500
473
|
},
|
|
501
474
|
'deposit': {
|
|
502
|
-
'min':
|
|
475
|
+
'min': this.safeNumber(networkEntry, 'minTransfer'),
|
|
503
476
|
'max': undefined,
|
|
504
477
|
},
|
|
505
478
|
},
|
|
506
|
-
'
|
|
507
|
-
'
|
|
508
|
-
|
|
479
|
+
'active': undefined,
|
|
480
|
+
'deposit': undefined,
|
|
481
|
+
'withdraw': this.safeBool(networkEntry, 'canWithDraw'),
|
|
482
|
+
'fee': this.safeNumber(networkEntry, 'fee'),
|
|
483
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(networkEntry, 'transferAmtScale'))),
|
|
484
|
+
'info': networkEntry,
|
|
485
|
+
};
|
|
509
486
|
}
|
|
510
|
-
return
|
|
487
|
+
return this.safeCurrencyStructure({
|
|
488
|
+
'id': id,
|
|
489
|
+
'code': code,
|
|
490
|
+
'precision': undefined,
|
|
491
|
+
'type': undefined,
|
|
492
|
+
'name': undefined,
|
|
493
|
+
'active': undefined,
|
|
494
|
+
'deposit': undefined,
|
|
495
|
+
'withdraw': undefined,
|
|
496
|
+
'fee': undefined,
|
|
497
|
+
'limits': {
|
|
498
|
+
'withdraw': {
|
|
499
|
+
'min': undefined,
|
|
500
|
+
'max': undefined,
|
|
501
|
+
},
|
|
502
|
+
'deposit': {
|
|
503
|
+
'min': undefined,
|
|
504
|
+
'max': undefined,
|
|
505
|
+
},
|
|
506
|
+
},
|
|
507
|
+
'networks': networks,
|
|
508
|
+
'info': networksRaw,
|
|
509
|
+
});
|
|
511
510
|
}
|
|
512
511
|
/**
|
|
513
512
|
* @method
|
|
@@ -2270,7 +2269,7 @@ export default class lbank extends Exchange {
|
|
|
2270
2269
|
return {
|
|
2271
2270
|
'info': response,
|
|
2272
2271
|
'currency': code,
|
|
2273
|
-
'network': this.networkIdToCode(this.safeString(result, 'netWork')),
|
|
2272
|
+
'network': this.networkIdToCode(this.safeString(result, 'netWork'), code),
|
|
2274
2273
|
'address': address,
|
|
2275
2274
|
'tag': tag,
|
|
2276
2275
|
};
|
|
@@ -2459,7 +2458,7 @@ export default class lbank extends Exchange {
|
|
|
2459
2458
|
'txid': txid,
|
|
2460
2459
|
'timestamp': timestamp,
|
|
2461
2460
|
'datetime': this.iso8601(timestamp),
|
|
2462
|
-
'network': this.networkIdToCode(this.safeString(transaction, 'networkName')),
|
|
2461
|
+
'network': this.networkIdToCode(this.safeString(transaction, 'networkName'), code),
|
|
2463
2462
|
'address': address,
|
|
2464
2463
|
'addressTo': addressTo,
|
|
2465
2464
|
'addressFrom': addressFrom,
|
|
@@ -2664,7 +2663,7 @@ export default class lbank extends Exchange {
|
|
|
2664
2663
|
const networkEntry = networkList[j];
|
|
2665
2664
|
const fee = this.safeNumber(networkEntry, 'withdrawFee');
|
|
2666
2665
|
if (fee !== undefined) {
|
|
2667
|
-
const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'));
|
|
2666
|
+
const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'), code);
|
|
2668
2667
|
withdrawFees[code][networkCode] = fee;
|
|
2669
2668
|
}
|
|
2670
2669
|
}
|
|
@@ -2716,7 +2715,7 @@ export default class lbank extends Exchange {
|
|
|
2716
2715
|
if (canWithdraw === 'true') {
|
|
2717
2716
|
const currencyId = this.safeString(item, 'assetCode');
|
|
2718
2717
|
const codeInner = this.safeCurrencyCode(currencyId);
|
|
2719
|
-
let network = this.networkIdToCode(this.safeString(item, 'chain'));
|
|
2718
|
+
let network = this.networkIdToCode(this.safeString(item, 'chain'), codeInner);
|
|
2720
2719
|
if (network === undefined) {
|
|
2721
2720
|
network = codeInner;
|
|
2722
2721
|
}
|
|
@@ -2867,7 +2866,7 @@ export default class lbank extends Exchange {
|
|
|
2867
2866
|
const resultCodeInfo = result[code]['info'];
|
|
2868
2867
|
resultCodeInfo.push(fee);
|
|
2869
2868
|
}
|
|
2870
|
-
const networkCode = this.networkIdToCode(this.safeString(fee, 'chain'));
|
|
2869
|
+
const networkCode = this.networkIdToCode(this.safeString(fee, 'chain'), code);
|
|
2871
2870
|
if (networkCode !== undefined) {
|
|
2872
2871
|
result[code]['networks'][networkCode] = {
|
|
2873
2872
|
'withdraw': {
|
|
@@ -2920,10 +2919,11 @@ export default class lbank extends Exchange {
|
|
|
2920
2919
|
// }
|
|
2921
2920
|
//
|
|
2922
2921
|
const result = this.depositWithdrawFee(fee);
|
|
2922
|
+
const code = this.safeString(currency, 'code');
|
|
2923
2923
|
const networkList = this.safeValue(fee, 'networkList', []);
|
|
2924
2924
|
for (let j = 0; j < networkList.length; j++) {
|
|
2925
2925
|
const networkEntry = networkList[j];
|
|
2926
|
-
const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'));
|
|
2926
|
+
const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'), code);
|
|
2927
2927
|
const withdrawFee = this.safeNumber(networkEntry, 'withdrawFee');
|
|
2928
2928
|
const isDefault = this.safeValue(networkEntry, 'isDefault');
|
|
2929
2929
|
if (withdrawFee !== undefined) {
|
package/js/src/lighter.d.ts
CHANGED
|
@@ -110,6 +110,7 @@ export default class lighter extends Exchange {
|
|
|
110
110
|
* @returns {object} an associative dictionary of currencies
|
|
111
111
|
*/
|
|
112
112
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
113
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
113
114
|
/**
|
|
114
115
|
* @method
|
|
115
116
|
* @name lighter#fetchOrderBook
|
package/js/src/lighter.js
CHANGED
|
@@ -1270,44 +1270,42 @@ export default class lighter extends Exchange {
|
|
|
1270
1270
|
// }
|
|
1271
1271
|
//
|
|
1272
1272
|
const data = this.safeList(response, 'asset_details', []);
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
},
|
|
1302
|
-
'withdraw': {
|
|
1303
|
-
'min': withdrawMin,
|
|
1304
|
-
'max': undefined,
|
|
1305
|
-
},
|
|
1273
|
+
return this.parseCurrencies(data);
|
|
1274
|
+
}
|
|
1275
|
+
parseCurrency(rawCurrency) {
|
|
1276
|
+
const id = this.safeString(rawCurrency, 'asset_id');
|
|
1277
|
+
const code = this.safeCurrencyCode(this.safeString(rawCurrency, 'symbol'));
|
|
1278
|
+
const decimals = this.safeString(rawCurrency, 'decimals');
|
|
1279
|
+
const isUSDC = (code === 'USDC');
|
|
1280
|
+
let depositMin = undefined;
|
|
1281
|
+
let withdrawMin = undefined;
|
|
1282
|
+
if (isUSDC) {
|
|
1283
|
+
depositMin = this.safeNumber(rawCurrency, 'min_transfer_amount');
|
|
1284
|
+
withdrawMin = this.safeNumber(rawCurrency, 'min_withdrawal_amount');
|
|
1285
|
+
}
|
|
1286
|
+
return this.safeCurrencyStructure({
|
|
1287
|
+
'id': id,
|
|
1288
|
+
'name': code,
|
|
1289
|
+
'code': code,
|
|
1290
|
+
'precision': this.parseNumber('1e-' + decimals),
|
|
1291
|
+
'active': true,
|
|
1292
|
+
'fee': undefined,
|
|
1293
|
+
'networks': {},
|
|
1294
|
+
'deposit': isUSDC,
|
|
1295
|
+
'withdraw': isUSDC,
|
|
1296
|
+
'type': 'crypto',
|
|
1297
|
+
'limits': {
|
|
1298
|
+
'deposit': {
|
|
1299
|
+
'min': depositMin,
|
|
1300
|
+
'max': undefined,
|
|
1306
1301
|
},
|
|
1307
|
-
'
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1302
|
+
'withdraw': {
|
|
1303
|
+
'min': withdrawMin,
|
|
1304
|
+
'max': undefined,
|
|
1305
|
+
},
|
|
1306
|
+
},
|
|
1307
|
+
'info': rawCurrency,
|
|
1308
|
+
});
|
|
1311
1309
|
}
|
|
1312
1310
|
/**
|
|
1313
1311
|
* @method
|
package/js/src/luno.d.ts
CHANGED
package/js/src/luno.js
CHANGED
|
@@ -326,39 +326,19 @@ export default class luno extends Exchange {
|
|
|
326
326
|
// }
|
|
327
327
|
//
|
|
328
328
|
const currenciesData = this.safeList(response, 'data', []);
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
'type': undefined,
|
|
340
|
-
'name': undefined,
|
|
341
|
-
'active': undefined,
|
|
342
|
-
'deposit': undefined,
|
|
343
|
-
'withdraw': undefined,
|
|
344
|
-
'fee': undefined,
|
|
345
|
-
'limits': {
|
|
346
|
-
'withdraw': {
|
|
347
|
-
'min': undefined,
|
|
348
|
-
'max': undefined,
|
|
349
|
-
},
|
|
350
|
-
'deposit': {
|
|
351
|
-
'min': undefined,
|
|
352
|
-
'max': undefined,
|
|
353
|
-
},
|
|
354
|
-
},
|
|
355
|
-
'networks': {},
|
|
356
|
-
'info': {},
|
|
357
|
-
};
|
|
358
|
-
}
|
|
329
|
+
const grouped = this.groupBy(currenciesData, 'native_currency');
|
|
330
|
+
const values = Object.values(grouped);
|
|
331
|
+
return this.parseCurrencies(values);
|
|
332
|
+
}
|
|
333
|
+
parseCurrency(rawCurrency) {
|
|
334
|
+
const id = this.safeString(rawCurrency[0], 'native_currency'); // first item is guaranteed
|
|
335
|
+
const code = this.safeCurrencyCode(id);
|
|
336
|
+
const networks = {};
|
|
337
|
+
for (let i = 0; i < rawCurrency.length; i++) {
|
|
338
|
+
const networkEntry = rawCurrency[i];
|
|
359
339
|
const networkId = this.safeString(networkEntry, 'name');
|
|
360
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
361
|
-
|
|
340
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
341
|
+
networks[networkCode] = {
|
|
362
342
|
'id': networkId,
|
|
363
343
|
'network': networkCode,
|
|
364
344
|
'limits': {
|
|
@@ -378,18 +358,30 @@ export default class luno extends Exchange {
|
|
|
378
358
|
'precision': undefined,
|
|
379
359
|
'info': networkEntry,
|
|
380
360
|
};
|
|
381
|
-
// add entry in info
|
|
382
|
-
const info = this.safeList(result[code], 'info', []);
|
|
383
|
-
info.push(networkEntry);
|
|
384
|
-
result[code]['info'] = info;
|
|
385
361
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
362
|
+
return this.safeCurrencyStructure({
|
|
363
|
+
'id': id,
|
|
364
|
+
'code': code,
|
|
365
|
+
'precision': undefined,
|
|
366
|
+
'type': undefined,
|
|
367
|
+
'name': undefined,
|
|
368
|
+
'active': undefined,
|
|
369
|
+
'deposit': undefined,
|
|
370
|
+
'withdraw': undefined,
|
|
371
|
+
'fee': undefined,
|
|
372
|
+
'limits': {
|
|
373
|
+
'withdraw': {
|
|
374
|
+
'min': undefined,
|
|
375
|
+
'max': undefined,
|
|
376
|
+
},
|
|
377
|
+
'deposit': {
|
|
378
|
+
'min': undefined,
|
|
379
|
+
'max': undefined,
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
'networks': networks,
|
|
383
|
+
'info': rawCurrency,
|
|
384
|
+
});
|
|
393
385
|
}
|
|
394
386
|
/**
|
|
395
387
|
* @method
|
package/js/src/mexc.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export default class mexc extends Exchange {
|
|
|
41
41
|
* @returns {object} an associative dictionary of currencies
|
|
42
42
|
*/
|
|
43
43
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
44
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
44
45
|
/**
|
|
45
46
|
* @method
|
|
46
47
|
* @name mexc#fetchMarkets
|
|
@@ -83,7 +84,7 @@ export default class mexc extends Exchange {
|
|
|
83
84
|
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/?id=order-book-structure} indexed by market symbols
|
|
84
85
|
*/
|
|
85
86
|
fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
|
|
86
|
-
|
|
87
|
+
parseOrderBookBidAsk(bidask: any, priceKey?: IndexType, amountKey?: IndexType, countOrIdKey?: IndexType): number[];
|
|
87
88
|
/**
|
|
88
89
|
* @method
|
|
89
90
|
* @name mexc#fetchTrades
|