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/dist/cjs/src/latoken.js
CHANGED
|
@@ -516,39 +516,37 @@ class latoken extends latoken$1["default"] {
|
|
|
516
516
|
// },
|
|
517
517
|
// ]
|
|
518
518
|
//
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
},
|
|
543
|
-
'withdraw': {
|
|
544
|
-
'min': undefined,
|
|
545
|
-
'max': undefined,
|
|
546
|
-
},
|
|
519
|
+
return this.parseCurrencies(response);
|
|
520
|
+
}
|
|
521
|
+
parseCurrency(currency) {
|
|
522
|
+
const id = this.safeString(currency, 'id');
|
|
523
|
+
const tag = this.safeString(currency, 'tag');
|
|
524
|
+
const code = this.safeCurrencyCode(tag);
|
|
525
|
+
const currencyType = this.safeString(currency, 'type');
|
|
526
|
+
const isCrypto = (currencyType === 'CURRENCY_TYPE_CRYPTO' || currencyType === 'CURRENCY_TYPE_IEO');
|
|
527
|
+
return this.safeCurrencyStructure({
|
|
528
|
+
'id': id,
|
|
529
|
+
'code': code,
|
|
530
|
+
'info': currency,
|
|
531
|
+
'name': this.safeString(currency, 'name'),
|
|
532
|
+
'type': isCrypto ? 'crypto' : 'other',
|
|
533
|
+
'active': this.safeString(currency, 'status') === 'CURRENCY_STATUS_ACTIVE',
|
|
534
|
+
'deposit': undefined,
|
|
535
|
+
'withdraw': undefined,
|
|
536
|
+
'fee': this.safeNumber(currency, 'fee'),
|
|
537
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals'))),
|
|
538
|
+
'limits': {
|
|
539
|
+
'amount': {
|
|
540
|
+
'min': this.safeNumber(currency, 'minTransferAmount'),
|
|
541
|
+
'max': undefined,
|
|
547
542
|
},
|
|
548
|
-
'
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
543
|
+
'withdraw': {
|
|
544
|
+
'min': undefined,
|
|
545
|
+
'max': undefined,
|
|
546
|
+
},
|
|
547
|
+
},
|
|
548
|
+
'networks': {},
|
|
549
|
+
});
|
|
552
550
|
}
|
|
553
551
|
/**
|
|
554
552
|
* @method
|
package/dist/cjs/src/lbank.js
CHANGED
|
@@ -453,66 +453,65 @@ class lbank extends lbank$1["default"] {
|
|
|
453
453
|
//
|
|
454
454
|
const currenciesData = this.safeList(response, 'data', []);
|
|
455
455
|
const grouped = this.groupBy(currenciesData, 'assetCode');
|
|
456
|
-
const
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
470
|
-
networks[networkCode] = {
|
|
471
|
-
'id': networkId,
|
|
472
|
-
'network': networkCode,
|
|
473
|
-
'limits': {
|
|
474
|
-
'withdraw': {
|
|
475
|
-
'min': this.safeNumber(networkEntry, 'min'),
|
|
476
|
-
'max': undefined,
|
|
477
|
-
},
|
|
478
|
-
'deposit': {
|
|
479
|
-
'min': this.safeNumber(networkEntry, 'minTransfer'),
|
|
480
|
-
'max': undefined,
|
|
481
|
-
},
|
|
482
|
-
},
|
|
483
|
-
'active': undefined,
|
|
484
|
-
'deposit': undefined,
|
|
485
|
-
'withdraw': this.safeBool(networkEntry, 'canWithDraw'),
|
|
486
|
-
'fee': this.safeNumber(networkEntry, 'fee'),
|
|
487
|
-
'precision': this.parseNumber(this.parsePrecision(this.safeString(networkEntry, 'transferAmtScale'))),
|
|
488
|
-
'info': networkEntry,
|
|
489
|
-
};
|
|
456
|
+
const values = Object.values(grouped);
|
|
457
|
+
return this.parseCurrencies(values);
|
|
458
|
+
}
|
|
459
|
+
parseCurrency(rawCurrency) {
|
|
460
|
+
const id = this.safeString(rawCurrency[0], 'assetCode'); // first member is guaranteed
|
|
461
|
+
const code = this.safeCurrencyCode(id);
|
|
462
|
+
const networksRaw = rawCurrency;
|
|
463
|
+
const networks = {};
|
|
464
|
+
for (let j = 0; j < networksRaw.length; j++) {
|
|
465
|
+
const networkEntry = networksRaw[j];
|
|
466
|
+
let networkId = this.safeString(networkEntry, 'chain');
|
|
467
|
+
if (networkId === undefined) {
|
|
468
|
+
networkId = this.safeString(networkEntry, 'assetCode'); // use type as fallback if networkId is not present
|
|
490
469
|
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
'
|
|
494
|
-
'
|
|
495
|
-
'type': undefined,
|
|
496
|
-
'name': undefined,
|
|
497
|
-
'active': undefined,
|
|
498
|
-
'deposit': undefined,
|
|
499
|
-
'withdraw': undefined,
|
|
500
|
-
'fee': undefined,
|
|
470
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
471
|
+
networks[networkCode] = {
|
|
472
|
+
'id': networkId,
|
|
473
|
+
'network': networkCode,
|
|
501
474
|
'limits': {
|
|
502
475
|
'withdraw': {
|
|
503
|
-
'min':
|
|
476
|
+
'min': this.safeNumber(networkEntry, 'min'),
|
|
504
477
|
'max': undefined,
|
|
505
478
|
},
|
|
506
479
|
'deposit': {
|
|
507
|
-
'min':
|
|
480
|
+
'min': this.safeNumber(networkEntry, 'minTransfer'),
|
|
508
481
|
'max': undefined,
|
|
509
482
|
},
|
|
510
483
|
},
|
|
511
|
-
'
|
|
512
|
-
'
|
|
513
|
-
|
|
484
|
+
'active': undefined,
|
|
485
|
+
'deposit': undefined,
|
|
486
|
+
'withdraw': this.safeBool(networkEntry, 'canWithDraw'),
|
|
487
|
+
'fee': this.safeNumber(networkEntry, 'fee'),
|
|
488
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(networkEntry, 'transferAmtScale'))),
|
|
489
|
+
'info': networkEntry,
|
|
490
|
+
};
|
|
514
491
|
}
|
|
515
|
-
return
|
|
492
|
+
return this.safeCurrencyStructure({
|
|
493
|
+
'id': id,
|
|
494
|
+
'code': code,
|
|
495
|
+
'precision': undefined,
|
|
496
|
+
'type': undefined,
|
|
497
|
+
'name': undefined,
|
|
498
|
+
'active': undefined,
|
|
499
|
+
'deposit': undefined,
|
|
500
|
+
'withdraw': undefined,
|
|
501
|
+
'fee': undefined,
|
|
502
|
+
'limits': {
|
|
503
|
+
'withdraw': {
|
|
504
|
+
'min': undefined,
|
|
505
|
+
'max': undefined,
|
|
506
|
+
},
|
|
507
|
+
'deposit': {
|
|
508
|
+
'min': undefined,
|
|
509
|
+
'max': undefined,
|
|
510
|
+
},
|
|
511
|
+
},
|
|
512
|
+
'networks': networks,
|
|
513
|
+
'info': networksRaw,
|
|
514
|
+
});
|
|
516
515
|
}
|
|
517
516
|
/**
|
|
518
517
|
* @method
|
|
@@ -2275,7 +2274,7 @@ class lbank extends lbank$1["default"] {
|
|
|
2275
2274
|
return {
|
|
2276
2275
|
'info': response,
|
|
2277
2276
|
'currency': code,
|
|
2278
|
-
'network': this.networkIdToCode(this.safeString(result, 'netWork')),
|
|
2277
|
+
'network': this.networkIdToCode(this.safeString(result, 'netWork'), code),
|
|
2279
2278
|
'address': address,
|
|
2280
2279
|
'tag': tag,
|
|
2281
2280
|
};
|
|
@@ -2464,7 +2463,7 @@ class lbank extends lbank$1["default"] {
|
|
|
2464
2463
|
'txid': txid,
|
|
2465
2464
|
'timestamp': timestamp,
|
|
2466
2465
|
'datetime': this.iso8601(timestamp),
|
|
2467
|
-
'network': this.networkIdToCode(this.safeString(transaction, 'networkName')),
|
|
2466
|
+
'network': this.networkIdToCode(this.safeString(transaction, 'networkName'), code),
|
|
2468
2467
|
'address': address,
|
|
2469
2468
|
'addressTo': addressTo,
|
|
2470
2469
|
'addressFrom': addressFrom,
|
|
@@ -2669,7 +2668,7 @@ class lbank extends lbank$1["default"] {
|
|
|
2669
2668
|
const networkEntry = networkList[j];
|
|
2670
2669
|
const fee = this.safeNumber(networkEntry, 'withdrawFee');
|
|
2671
2670
|
if (fee !== undefined) {
|
|
2672
|
-
const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'));
|
|
2671
|
+
const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'), code);
|
|
2673
2672
|
withdrawFees[code][networkCode] = fee;
|
|
2674
2673
|
}
|
|
2675
2674
|
}
|
|
@@ -2721,7 +2720,7 @@ class lbank extends lbank$1["default"] {
|
|
|
2721
2720
|
if (canWithdraw === 'true') {
|
|
2722
2721
|
const currencyId = this.safeString(item, 'assetCode');
|
|
2723
2722
|
const codeInner = this.safeCurrencyCode(currencyId);
|
|
2724
|
-
let network = this.networkIdToCode(this.safeString(item, 'chain'));
|
|
2723
|
+
let network = this.networkIdToCode(this.safeString(item, 'chain'), codeInner);
|
|
2725
2724
|
if (network === undefined) {
|
|
2726
2725
|
network = codeInner;
|
|
2727
2726
|
}
|
|
@@ -2872,7 +2871,7 @@ class lbank extends lbank$1["default"] {
|
|
|
2872
2871
|
const resultCodeInfo = result[code]['info'];
|
|
2873
2872
|
resultCodeInfo.push(fee);
|
|
2874
2873
|
}
|
|
2875
|
-
const networkCode = this.networkIdToCode(this.safeString(fee, 'chain'));
|
|
2874
|
+
const networkCode = this.networkIdToCode(this.safeString(fee, 'chain'), code);
|
|
2876
2875
|
if (networkCode !== undefined) {
|
|
2877
2876
|
result[code]['networks'][networkCode] = {
|
|
2878
2877
|
'withdraw': {
|
|
@@ -2925,10 +2924,11 @@ class lbank extends lbank$1["default"] {
|
|
|
2925
2924
|
// }
|
|
2926
2925
|
//
|
|
2927
2926
|
const result = this.depositWithdrawFee(fee);
|
|
2927
|
+
const code = this.safeString(currency, 'code');
|
|
2928
2928
|
const networkList = this.safeValue(fee, 'networkList', []);
|
|
2929
2929
|
for (let j = 0; j < networkList.length; j++) {
|
|
2930
2930
|
const networkEntry = networkList[j];
|
|
2931
|
-
const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'));
|
|
2931
|
+
const networkCode = this.networkIdToCode(this.safeString(networkEntry, 'name'), code);
|
|
2932
2932
|
const withdrawFee = this.safeNumber(networkEntry, 'withdrawFee');
|
|
2933
2933
|
const isDefault = this.safeValue(networkEntry, 'isDefault');
|
|
2934
2934
|
if (withdrawFee !== undefined) {
|
package/dist/cjs/src/lighter.js
CHANGED
|
@@ -1275,44 +1275,42 @@ class lighter extends lighter$1["default"] {
|
|
|
1275
1275
|
// }
|
|
1276
1276
|
//
|
|
1277
1277
|
const data = this.safeList(response, 'asset_details', []);
|
|
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
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
},
|
|
1307
|
-
'withdraw': {
|
|
1308
|
-
'min': withdrawMin,
|
|
1309
|
-
'max': undefined,
|
|
1310
|
-
},
|
|
1278
|
+
return this.parseCurrencies(data);
|
|
1279
|
+
}
|
|
1280
|
+
parseCurrency(rawCurrency) {
|
|
1281
|
+
const id = this.safeString(rawCurrency, 'asset_id');
|
|
1282
|
+
const code = this.safeCurrencyCode(this.safeString(rawCurrency, 'symbol'));
|
|
1283
|
+
const decimals = this.safeString(rawCurrency, 'decimals');
|
|
1284
|
+
const isUSDC = (code === 'USDC');
|
|
1285
|
+
let depositMin = undefined;
|
|
1286
|
+
let withdrawMin = undefined;
|
|
1287
|
+
if (isUSDC) {
|
|
1288
|
+
depositMin = this.safeNumber(rawCurrency, 'min_transfer_amount');
|
|
1289
|
+
withdrawMin = this.safeNumber(rawCurrency, 'min_withdrawal_amount');
|
|
1290
|
+
}
|
|
1291
|
+
return this.safeCurrencyStructure({
|
|
1292
|
+
'id': id,
|
|
1293
|
+
'name': code,
|
|
1294
|
+
'code': code,
|
|
1295
|
+
'precision': this.parseNumber('1e-' + decimals),
|
|
1296
|
+
'active': true,
|
|
1297
|
+
'fee': undefined,
|
|
1298
|
+
'networks': {},
|
|
1299
|
+
'deposit': isUSDC,
|
|
1300
|
+
'withdraw': isUSDC,
|
|
1301
|
+
'type': 'crypto',
|
|
1302
|
+
'limits': {
|
|
1303
|
+
'deposit': {
|
|
1304
|
+
'min': depositMin,
|
|
1305
|
+
'max': undefined,
|
|
1311
1306
|
},
|
|
1312
|
-
'
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1307
|
+
'withdraw': {
|
|
1308
|
+
'min': withdrawMin,
|
|
1309
|
+
'max': undefined,
|
|
1310
|
+
},
|
|
1311
|
+
},
|
|
1312
|
+
'info': rawCurrency,
|
|
1313
|
+
});
|
|
1316
1314
|
}
|
|
1317
1315
|
/**
|
|
1318
1316
|
* @method
|
package/dist/cjs/src/luno.js
CHANGED
|
@@ -331,39 +331,19 @@ class luno extends luno$1["default"] {
|
|
|
331
331
|
// }
|
|
332
332
|
//
|
|
333
333
|
const currenciesData = this.safeList(response, 'data', []);
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
'type': undefined,
|
|
345
|
-
'name': undefined,
|
|
346
|
-
'active': undefined,
|
|
347
|
-
'deposit': undefined,
|
|
348
|
-
'withdraw': undefined,
|
|
349
|
-
'fee': undefined,
|
|
350
|
-
'limits': {
|
|
351
|
-
'withdraw': {
|
|
352
|
-
'min': undefined,
|
|
353
|
-
'max': undefined,
|
|
354
|
-
},
|
|
355
|
-
'deposit': {
|
|
356
|
-
'min': undefined,
|
|
357
|
-
'max': undefined,
|
|
358
|
-
},
|
|
359
|
-
},
|
|
360
|
-
'networks': {},
|
|
361
|
-
'info': {},
|
|
362
|
-
};
|
|
363
|
-
}
|
|
334
|
+
const grouped = this.groupBy(currenciesData, 'native_currency');
|
|
335
|
+
const values = Object.values(grouped);
|
|
336
|
+
return this.parseCurrencies(values);
|
|
337
|
+
}
|
|
338
|
+
parseCurrency(rawCurrency) {
|
|
339
|
+
const id = this.safeString(rawCurrency[0], 'native_currency'); // first item is guaranteed
|
|
340
|
+
const code = this.safeCurrencyCode(id);
|
|
341
|
+
const networks = {};
|
|
342
|
+
for (let i = 0; i < rawCurrency.length; i++) {
|
|
343
|
+
const networkEntry = rawCurrency[i];
|
|
364
344
|
const networkId = this.safeString(networkEntry, 'name');
|
|
365
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
366
|
-
|
|
345
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
346
|
+
networks[networkCode] = {
|
|
367
347
|
'id': networkId,
|
|
368
348
|
'network': networkCode,
|
|
369
349
|
'limits': {
|
|
@@ -383,18 +363,30 @@ class luno extends luno$1["default"] {
|
|
|
383
363
|
'precision': undefined,
|
|
384
364
|
'info': networkEntry,
|
|
385
365
|
};
|
|
386
|
-
// add entry in info
|
|
387
|
-
const info = this.safeList(result[code], 'info', []);
|
|
388
|
-
info.push(networkEntry);
|
|
389
|
-
result[code]['info'] = info;
|
|
390
366
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
367
|
+
return this.safeCurrencyStructure({
|
|
368
|
+
'id': id,
|
|
369
|
+
'code': code,
|
|
370
|
+
'precision': undefined,
|
|
371
|
+
'type': undefined,
|
|
372
|
+
'name': undefined,
|
|
373
|
+
'active': undefined,
|
|
374
|
+
'deposit': undefined,
|
|
375
|
+
'withdraw': undefined,
|
|
376
|
+
'fee': undefined,
|
|
377
|
+
'limits': {
|
|
378
|
+
'withdraw': {
|
|
379
|
+
'min': undefined,
|
|
380
|
+
'max': undefined,
|
|
381
|
+
},
|
|
382
|
+
'deposit': {
|
|
383
|
+
'min': undefined,
|
|
384
|
+
'max': undefined,
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
'networks': networks,
|
|
388
|
+
'info': rawCurrency,
|
|
389
|
+
});
|
|
398
390
|
}
|
|
399
391
|
/**
|
|
400
392
|
* @method
|
package/dist/cjs/src/mexc.js
CHANGED
|
@@ -1151,56 +1151,54 @@ class mexc extends mexc$1["default"] {
|
|
|
1151
1151
|
// ]
|
|
1152
1152
|
// }
|
|
1153
1153
|
//
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
'active': undefined,
|
|
1170
|
-
'deposit': this.safeBool(chain, 'depositEnable', false),
|
|
1171
|
-
'withdraw': this.safeBool(chain, 'withdrawEnable', false),
|
|
1172
|
-
'fee': this.safeNumber(chain, 'withdrawFee'),
|
|
1173
|
-
'precision': undefined,
|
|
1174
|
-
'limits': {
|
|
1175
|
-
'withdraw': {
|
|
1176
|
-
'min': this.safeString(chain, 'withdrawMin'),
|
|
1177
|
-
'max': this.safeString(chain, 'withdrawMax'),
|
|
1178
|
-
},
|
|
1179
|
-
},
|
|
1180
|
-
'contract': this.safeString(chain, 'contract'),
|
|
1181
|
-
};
|
|
1182
|
-
}
|
|
1183
|
-
result[code] = this.safeCurrencyStructure({
|
|
1184
|
-
'info': currency,
|
|
1185
|
-
'id': id,
|
|
1186
|
-
'code': code,
|
|
1187
|
-
'name': this.safeString(currency, 'name'),
|
|
1154
|
+
return this.parseCurrencies(response);
|
|
1155
|
+
}
|
|
1156
|
+
parseCurrency(rawCurrency) {
|
|
1157
|
+
const id = this.safeString(rawCurrency, 'coin');
|
|
1158
|
+
const code = this.safeCurrencyCode(id);
|
|
1159
|
+
const networks = {};
|
|
1160
|
+
const chains = this.safeValue(rawCurrency, 'networkList', []);
|
|
1161
|
+
for (let j = 0; j < chains.length; j++) {
|
|
1162
|
+
const chain = chains[j];
|
|
1163
|
+
const networkId = this.safeString2(chain, 'netWork', 'network');
|
|
1164
|
+
const network = this.networkIdToCode(networkId, code);
|
|
1165
|
+
networks[network] = {
|
|
1166
|
+
'info': chain,
|
|
1167
|
+
'id': networkId,
|
|
1168
|
+
'network': network,
|
|
1188
1169
|
'active': undefined,
|
|
1189
|
-
'deposit':
|
|
1190
|
-
'withdraw':
|
|
1191
|
-
'fee':
|
|
1170
|
+
'deposit': this.safeBool(chain, 'depositEnable', false),
|
|
1171
|
+
'withdraw': this.safeBool(chain, 'withdrawEnable', false),
|
|
1172
|
+
'fee': this.safeNumber(chain, 'withdrawFee'),
|
|
1192
1173
|
'precision': undefined,
|
|
1193
1174
|
'limits': {
|
|
1194
|
-
'
|
|
1195
|
-
'min':
|
|
1196
|
-
'max':
|
|
1175
|
+
'withdraw': {
|
|
1176
|
+
'min': this.safeString(chain, 'withdrawMin'),
|
|
1177
|
+
'max': this.safeString(chain, 'withdrawMax'),
|
|
1197
1178
|
},
|
|
1198
1179
|
},
|
|
1199
|
-
'
|
|
1200
|
-
|
|
1201
|
-
});
|
|
1180
|
+
'contract': this.safeString(chain, 'contract'),
|
|
1181
|
+
};
|
|
1202
1182
|
}
|
|
1203
|
-
return
|
|
1183
|
+
return this.safeCurrencyStructure({
|
|
1184
|
+
'info': rawCurrency,
|
|
1185
|
+
'id': id,
|
|
1186
|
+
'code': code,
|
|
1187
|
+
'name': this.safeString(rawCurrency, 'name'),
|
|
1188
|
+
'active': undefined,
|
|
1189
|
+
'deposit': undefined,
|
|
1190
|
+
'withdraw': undefined,
|
|
1191
|
+
'fee': undefined,
|
|
1192
|
+
'precision': undefined,
|
|
1193
|
+
'limits': {
|
|
1194
|
+
'amount': {
|
|
1195
|
+
'min': undefined,
|
|
1196
|
+
'max': undefined,
|
|
1197
|
+
},
|
|
1198
|
+
},
|
|
1199
|
+
'type': 'crypto',
|
|
1200
|
+
'networks': networks,
|
|
1201
|
+
});
|
|
1204
1202
|
}
|
|
1205
1203
|
/**
|
|
1206
1204
|
* @method
|
|
@@ -1538,7 +1536,7 @@ class mexc extends mexc$1["default"] {
|
|
|
1538
1536
|
}
|
|
1539
1537
|
return orderbook;
|
|
1540
1538
|
}
|
|
1541
|
-
|
|
1539
|
+
parseOrderBookBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
1542
1540
|
const countKey = 2;
|
|
1543
1541
|
const price = this.safeNumber(bidask, priceKey);
|
|
1544
1542
|
const amount = this.safeNumber(bidask, amountKey);
|
|
@@ -4767,11 +4765,12 @@ class mexc extends mexc$1["default"] {
|
|
|
4767
4765
|
//
|
|
4768
4766
|
const address = this.safeString(depositAddress, 'address');
|
|
4769
4767
|
const currencyId = this.safeString(depositAddress, 'coin');
|
|
4768
|
+
const code = this.safeCurrencyCode(currencyId, currency);
|
|
4770
4769
|
const networkId = this.safeString(depositAddress, 'netWork');
|
|
4771
4770
|
return {
|
|
4772
4771
|
'info': depositAddress,
|
|
4773
|
-
'currency':
|
|
4774
|
-
'network': this.networkIdToCode(networkId,
|
|
4772
|
+
'currency': code,
|
|
4773
|
+
'network': this.networkIdToCode(networkId, code),
|
|
4775
4774
|
'address': address,
|
|
4776
4775
|
'tag': this.safeString(depositAddress, 'memo'),
|
|
4777
4776
|
};
|
|
@@ -5090,12 +5089,12 @@ class mexc extends mexc$1["default"] {
|
|
|
5090
5089
|
if (currencyWithNetwork !== undefined) {
|
|
5091
5090
|
currencyId = currencyWithNetwork.split('-')[0];
|
|
5092
5091
|
}
|
|
5092
|
+
const code = this.safeCurrencyCode(currencyId, currency);
|
|
5093
5093
|
let network = undefined;
|
|
5094
5094
|
const rawNetwork = this.safeString(transaction, 'network');
|
|
5095
5095
|
if (rawNetwork !== undefined) {
|
|
5096
|
-
network = this.networkIdToCode(rawNetwork);
|
|
5096
|
+
network = this.networkIdToCode(rawNetwork, code);
|
|
5097
5097
|
}
|
|
5098
|
-
const code = this.safeCurrencyCode(currencyId, currency);
|
|
5099
5098
|
const status = this.parseTransactionStatusByType(this.safeString(transaction, 'status'), type);
|
|
5100
5099
|
let amountString = this.safeString(transaction, 'amount');
|
|
5101
5100
|
const address = this.safeString(transaction, 'address');
|