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/hollaex.js
CHANGED
|
@@ -491,66 +491,63 @@ class hollaex extends hollaex$1["default"] {
|
|
|
491
491
|
// }
|
|
492
492
|
//
|
|
493
493
|
const coins = this.safeDict(response, 'coins', {});
|
|
494
|
-
const
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
'precision': undefined,
|
|
519
|
-
'limits': {
|
|
520
|
-
'withdraw': {
|
|
521
|
-
'min': undefined,
|
|
522
|
-
'max': undefined,
|
|
523
|
-
},
|
|
524
|
-
},
|
|
525
|
-
'info': networkEntry,
|
|
526
|
-
};
|
|
527
|
-
}
|
|
528
|
-
result[code] = this.safeCurrencyStructure({
|
|
529
|
-
'id': id,
|
|
530
|
-
'numericId': this.safeInteger(currency, 'id'),
|
|
531
|
-
'code': code,
|
|
532
|
-
'info': currency,
|
|
533
|
-
'name': this.safeString(currency, 'fullname'),
|
|
534
|
-
'active': this.safeBool(currency, 'active'),
|
|
535
|
-
'deposit': this.safeBool(currency, 'allow_deposit'),
|
|
536
|
-
'withdraw': this.safeBool(currency, 'allow_withdrawal'),
|
|
537
|
-
'fee': this.safeNumber(currency, 'withdrawal_fee'),
|
|
538
|
-
'precision': this.safeNumber(currency, 'increment_unit'),
|
|
494
|
+
const values = Object.values(coins);
|
|
495
|
+
return this.parseCurrencies(values);
|
|
496
|
+
}
|
|
497
|
+
parseCurrency(rawCurrency) {
|
|
498
|
+
const id = this.safeString(rawCurrency, 'symbol');
|
|
499
|
+
const code = this.safeCurrencyCode(id);
|
|
500
|
+
const withdrawalLimits = this.safeList(rawCurrency, 'withdrawal_limits', []);
|
|
501
|
+
const rawType = this.safeString(rawCurrency, 'type');
|
|
502
|
+
const type = (rawType === 'blockchain') ? 'crypto' : 'other';
|
|
503
|
+
const rawNetworks = this.safeDict(rawCurrency, 'withdrawal_fees', {});
|
|
504
|
+
const networks = {};
|
|
505
|
+
const networkIds = Object.keys(rawNetworks);
|
|
506
|
+
for (let j = 0; j < networkIds.length; j++) {
|
|
507
|
+
const networkId = networkIds[j];
|
|
508
|
+
const networkEntry = this.safeDict(rawNetworks, networkId);
|
|
509
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
510
|
+
networks[networkCode] = {
|
|
511
|
+
'id': networkId,
|
|
512
|
+
'network': networkCode,
|
|
513
|
+
'active': this.safeBool(networkEntry, 'active'),
|
|
514
|
+
'deposit': undefined,
|
|
515
|
+
'withdraw': undefined,
|
|
516
|
+
'fee': this.safeNumber(networkEntry, 'value'),
|
|
517
|
+
'precision': undefined,
|
|
539
518
|
'limits': {
|
|
540
|
-
'amount': {
|
|
541
|
-
'min': this.safeNumber(currency, 'min'),
|
|
542
|
-
'max': this.safeNumber(currency, 'max'),
|
|
543
|
-
},
|
|
544
519
|
'withdraw': {
|
|
545
520
|
'min': undefined,
|
|
546
|
-
'max':
|
|
521
|
+
'max': undefined,
|
|
547
522
|
},
|
|
548
523
|
},
|
|
549
|
-
'
|
|
550
|
-
|
|
551
|
-
});
|
|
524
|
+
'info': networkEntry,
|
|
525
|
+
};
|
|
552
526
|
}
|
|
553
|
-
return
|
|
527
|
+
return this.safeCurrencyStructure({
|
|
528
|
+
'id': id,
|
|
529
|
+
'numericId': this.safeInteger(rawCurrency, 'id'),
|
|
530
|
+
'code': code,
|
|
531
|
+
'info': rawCurrency,
|
|
532
|
+
'name': this.safeString(rawCurrency, 'fullname'),
|
|
533
|
+
'active': this.safeBool(rawCurrency, 'active'),
|
|
534
|
+
'deposit': this.safeBool(rawCurrency, 'allow_deposit'),
|
|
535
|
+
'withdraw': this.safeBool(rawCurrency, 'allow_withdrawal'),
|
|
536
|
+
'fee': this.safeNumber(rawCurrency, 'withdrawal_fee'),
|
|
537
|
+
'precision': this.safeNumber(rawCurrency, 'increment_unit'),
|
|
538
|
+
'limits': {
|
|
539
|
+
'amount': {
|
|
540
|
+
'min': this.safeNumber(rawCurrency, 'min'),
|
|
541
|
+
'max': this.safeNumber(rawCurrency, 'max'),
|
|
542
|
+
},
|
|
543
|
+
'withdraw': {
|
|
544
|
+
'min': undefined,
|
|
545
|
+
'max': this.safeValue(withdrawalLimits, 0),
|
|
546
|
+
},
|
|
547
|
+
},
|
|
548
|
+
'networks': networks,
|
|
549
|
+
'type': type,
|
|
550
|
+
});
|
|
554
551
|
}
|
|
555
552
|
/**
|
|
556
553
|
* @method
|
package/dist/cjs/src/htx.js
CHANGED
|
@@ -189,7 +189,7 @@ class htx extends htx$1["default"] {
|
|
|
189
189
|
},
|
|
190
190
|
'www': 'https://www.huobi.com',
|
|
191
191
|
'referral': {
|
|
192
|
-
'url': 'https://www.htx.com
|
|
192
|
+
'url': 'https://www.htx.com/invite/en-us/1h?invite_code=6rmm2223',
|
|
193
193
|
'discount': 0.15,
|
|
194
194
|
},
|
|
195
195
|
'doc': [
|
|
@@ -1194,6 +1194,9 @@ class htx extends htx$1["default"] {
|
|
|
1194
1194
|
// 'BCC': 'BCC', BCH's somewhat chain
|
|
1195
1195
|
// 'DBC1': 'DBC1',
|
|
1196
1196
|
},
|
|
1197
|
+
'networksById': {
|
|
1198
|
+
'MATIC': 'MATIC',
|
|
1199
|
+
},
|
|
1197
1200
|
// https://github.com/ccxt/ccxt/issues/5376
|
|
1198
1201
|
'fetchOrdersByStatesMethod': 'spot_private_get_v1_order_orders',
|
|
1199
1202
|
'createMarketBuyOrderRequiresPrice': true,
|
|
@@ -3480,75 +3483,79 @@ class htx extends htx$1["default"] {
|
|
|
3480
3483
|
// }
|
|
3481
3484
|
//
|
|
3482
3485
|
const data = this.safeList(response, 'data', []);
|
|
3483
|
-
const result = {};
|
|
3484
|
-
this.options['networkChainIdsByNames'] = {};
|
|
3485
3486
|
this.options['networkNamesByChainIds'] = {};
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
},
|
|
3515
|
-
},
|
|
3516
|
-
'active': undefined,
|
|
3517
|
-
'deposit': this.safeString(chainEntry, 'depositStatus') === 'allowed',
|
|
3518
|
-
'withdraw': this.safeString(chainEntry, 'withdrawStatus') === 'allowed',
|
|
3519
|
-
'fee': this.safeNumber(chainEntry, 'transactFeeWithdraw'),
|
|
3520
|
-
'precision': this.parseNumber(this.parsePrecision(this.safeString(chainEntry, 'withdrawPrecision'))),
|
|
3521
|
-
};
|
|
3522
|
-
}
|
|
3523
|
-
result[code] = this.safeCurrencyStructure({
|
|
3524
|
-
'info': entry,
|
|
3525
|
-
'code': code,
|
|
3526
|
-
'id': currencyId,
|
|
3527
|
-
'active': this.safeString(entry, 'instStatus') === 'normal',
|
|
3528
|
-
'deposit': undefined,
|
|
3529
|
-
'withdraw': undefined,
|
|
3530
|
-
'fee': undefined,
|
|
3531
|
-
'name': undefined,
|
|
3532
|
-
'type': type,
|
|
3487
|
+
this.options['networkChainIdsByNames'] = {};
|
|
3488
|
+
return this.parseCurrencies(data);
|
|
3489
|
+
}
|
|
3490
|
+
parseCurrency(rawCurrency) {
|
|
3491
|
+
if (!('networkNamesByChainIds' in this.options)) {
|
|
3492
|
+
this.options['networkNamesByChainIds'] = {};
|
|
3493
|
+
}
|
|
3494
|
+
if (!('networkChainIdsByNames' in this.options)) {
|
|
3495
|
+
this.options['networkChainIdsByNames'] = {};
|
|
3496
|
+
}
|
|
3497
|
+
const currencyId = this.safeString(rawCurrency, 'currency');
|
|
3498
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
3499
|
+
const assetType = this.safeString(rawCurrency, 'assetType');
|
|
3500
|
+
const type = (assetType === '1') ? 'crypto' : 'fiat';
|
|
3501
|
+
this.options['networkChainIdsByNames'][code] = {};
|
|
3502
|
+
const chains = this.safeList(rawCurrency, 'chains', []);
|
|
3503
|
+
const networks = {};
|
|
3504
|
+
for (let j = 0; j < chains.length; j++) {
|
|
3505
|
+
const chainEntry = chains[j];
|
|
3506
|
+
const uniqueChainId = this.safeString(chainEntry, 'chain'); // i.e. usdterc20, trc20usdt ...
|
|
3507
|
+
const title = this.safeString2(chainEntry, 'baseChain', 'displayName'); // baseChain and baseChainProtocol are together existent or inexistent in entries, but baseChain is preferred. when they are both inexistent, then we use generic displayName
|
|
3508
|
+
this.options['networkChainIdsByNames'][code][title] = uniqueChainId;
|
|
3509
|
+
this.options['networkNamesByChainIds'][uniqueChainId] = title;
|
|
3510
|
+
const networkCode = this.networkIdToCode(uniqueChainId, code);
|
|
3511
|
+
networks[networkCode] = {
|
|
3512
|
+
'info': chainEntry,
|
|
3513
|
+
'id': uniqueChainId,
|
|
3514
|
+
'network': networkCode,
|
|
3533
3515
|
'limits': {
|
|
3534
|
-
'
|
|
3535
|
-
'min':
|
|
3516
|
+
'deposit': {
|
|
3517
|
+
'min': this.safeNumber(chainEntry, 'minDepositAmt'),
|
|
3536
3518
|
'max': undefined,
|
|
3537
3519
|
},
|
|
3538
3520
|
'withdraw': {
|
|
3539
|
-
'min':
|
|
3540
|
-
'max':
|
|
3541
|
-
},
|
|
3542
|
-
'deposit': {
|
|
3543
|
-
'min': undefined,
|
|
3544
|
-
'max': undefined,
|
|
3521
|
+
'min': this.safeNumber(chainEntry, 'minWithdrawAmt'),
|
|
3522
|
+
'max': this.safeNumber(chainEntry, 'maxWithdrawAmt'),
|
|
3545
3523
|
},
|
|
3546
3524
|
},
|
|
3547
|
-
'
|
|
3548
|
-
'
|
|
3549
|
-
|
|
3525
|
+
'active': undefined,
|
|
3526
|
+
'deposit': this.safeString(chainEntry, 'depositStatus') === 'allowed',
|
|
3527
|
+
'withdraw': this.safeString(chainEntry, 'withdrawStatus') === 'allowed',
|
|
3528
|
+
'fee': this.safeNumber(chainEntry, 'transactFeeWithdraw'),
|
|
3529
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(chainEntry, 'withdrawPrecision'))),
|
|
3530
|
+
};
|
|
3550
3531
|
}
|
|
3551
|
-
return
|
|
3532
|
+
return this.safeCurrencyStructure({
|
|
3533
|
+
'info': rawCurrency,
|
|
3534
|
+
'code': code,
|
|
3535
|
+
'id': currencyId,
|
|
3536
|
+
'active': this.safeString(rawCurrency, 'instStatus') === 'normal',
|
|
3537
|
+
'deposit': undefined,
|
|
3538
|
+
'withdraw': undefined,
|
|
3539
|
+
'fee': undefined,
|
|
3540
|
+
'name': undefined,
|
|
3541
|
+
'type': type,
|
|
3542
|
+
'limits': {
|
|
3543
|
+
'amount': {
|
|
3544
|
+
'min': undefined,
|
|
3545
|
+
'max': undefined,
|
|
3546
|
+
},
|
|
3547
|
+
'withdraw': {
|
|
3548
|
+
'min': undefined,
|
|
3549
|
+
'max': undefined,
|
|
3550
|
+
},
|
|
3551
|
+
'deposit': {
|
|
3552
|
+
'min': undefined,
|
|
3553
|
+
'max': undefined,
|
|
3554
|
+
},
|
|
3555
|
+
},
|
|
3556
|
+
'precision': undefined,
|
|
3557
|
+
'networks': networks,
|
|
3558
|
+
});
|
|
3552
3559
|
}
|
|
3553
3560
|
networkIdToCode(networkId = undefined, currencyCode = undefined) {
|
|
3554
3561
|
// here network-id is provided as a pair of currency & chain (i.e. trc20usdt)
|
|
@@ -3558,7 +3565,7 @@ class htx extends htx$1["default"] {
|
|
|
3558
3565
|
throw new errors.ExchangeError(this.id + ' networkIdToCode() - markets need to be loaded at first');
|
|
3559
3566
|
}
|
|
3560
3567
|
const networkTitle = this.safeValue(this.options['networkNamesByChainIds'], networkId, networkId);
|
|
3561
|
-
return super.networkIdToCode(networkTitle);
|
|
3568
|
+
return super.networkIdToCode(networkTitle, currencyCode);
|
|
3562
3569
|
}
|
|
3563
3570
|
networkCodeToId(networkCode, currencyCode = undefined) {
|
|
3564
3571
|
if (currencyCode === undefined) {
|
|
@@ -3574,7 +3581,7 @@ class htx extends htx$1["default"] {
|
|
|
3574
3581
|
return uniqueNetworkIds[networkCode];
|
|
3575
3582
|
}
|
|
3576
3583
|
else {
|
|
3577
|
-
const networkTitle = super.networkCodeToId(networkCode);
|
|
3584
|
+
const networkTitle = super.networkCodeToId(networkCode, currencyCode);
|
|
3578
3585
|
return this.safeValue(uniqueNetworkIds, networkTitle, networkTitle);
|
|
3579
3586
|
}
|
|
3580
3587
|
}
|
|
@@ -6599,7 +6606,7 @@ class htx extends htx$1["default"] {
|
|
|
6599
6606
|
'currency': code,
|
|
6600
6607
|
'address': address,
|
|
6601
6608
|
'tag': tag,
|
|
6602
|
-
'network': this.networkIdToCode(networkId),
|
|
6609
|
+
'network': this.networkIdToCode(networkId, code),
|
|
6603
6610
|
'note': note,
|
|
6604
6611
|
'info': depositAddress,
|
|
6605
6612
|
};
|
|
@@ -6880,7 +6887,7 @@ class htx extends htx$1["default"] {
|
|
|
6880
6887
|
'txid': txHash,
|
|
6881
6888
|
'timestamp': timestamp,
|
|
6882
6889
|
'datetime': this.iso8601(timestamp),
|
|
6883
|
-
'network': this.networkIdToCode(networkId),
|
|
6890
|
+
'network': this.networkIdToCode(networkId, code),
|
|
6884
6891
|
'address': this.safeString(transaction, 'address'),
|
|
6885
6892
|
'addressTo': undefined,
|
|
6886
6893
|
'addressFrom': undefined,
|
|
@@ -9414,12 +9421,13 @@ class htx extends htx$1["default"] {
|
|
|
9414
9421
|
// }
|
|
9415
9422
|
//
|
|
9416
9423
|
const chains = this.safeValue(fee, 'chains', []);
|
|
9424
|
+
const code = this.safeString(currency, 'code');
|
|
9417
9425
|
let result = this.depositWithdrawFee(fee);
|
|
9418
9426
|
for (let j = 0; j < chains.length; j++) {
|
|
9419
9427
|
const chainEntry = chains[j];
|
|
9420
9428
|
const networkId = this.safeString(chainEntry, 'chain');
|
|
9421
9429
|
const withdrawFeeType = this.safeString(chainEntry, 'withdrawFeeType');
|
|
9422
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
9430
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
9423
9431
|
let withdrawFee = undefined;
|
|
9424
9432
|
let withdrawResult = undefined;
|
|
9425
9433
|
if (withdrawFeeType === 'fixed') {
|
|
@@ -462,50 +462,49 @@ class hyperliquid extends hyperliquid$1["default"] {
|
|
|
462
462
|
const tokens = this.safeList(response, 'tokens', []);
|
|
463
463
|
// const meta = this.safeList (response, 'universe', []);
|
|
464
464
|
this.options['cachedCurrenciesById'] = {}; // used to map hip3 markets
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
},
|
|
490
|
-
'withdraw': {
|
|
491
|
-
'min': undefined,
|
|
492
|
-
'max': undefined,
|
|
493
|
-
},
|
|
465
|
+
return this.parseCurrencies(tokens);
|
|
466
|
+
}
|
|
467
|
+
parseCurrency(rawCurrency) {
|
|
468
|
+
// const id = i;
|
|
469
|
+
const id = this.safeString(rawCurrency, 'index');
|
|
470
|
+
const name = this.safeString(rawCurrency, 'name');
|
|
471
|
+
const code = this.safeCurrencyCode(name);
|
|
472
|
+
this.options['cachedCurrenciesById'][id] = name;
|
|
473
|
+
const result = this.safeCurrencyStructure({
|
|
474
|
+
'id': id,
|
|
475
|
+
'name': name,
|
|
476
|
+
'code': code,
|
|
477
|
+
'precision': this.parsePrecision(this.safeString(rawCurrency, 'weiDecimals')),
|
|
478
|
+
'info': rawCurrency,
|
|
479
|
+
'active': undefined,
|
|
480
|
+
'deposit': undefined,
|
|
481
|
+
'withdraw': undefined,
|
|
482
|
+
'networks': undefined,
|
|
483
|
+
'fee': undefined,
|
|
484
|
+
'type': 'crypto',
|
|
485
|
+
'limits': {
|
|
486
|
+
'amount': {
|
|
487
|
+
'min': undefined,
|
|
488
|
+
'max': undefined,
|
|
494
489
|
},
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
490
|
+
'withdraw': {
|
|
491
|
+
'min': undefined,
|
|
492
|
+
'max': undefined,
|
|
493
|
+
},
|
|
494
|
+
},
|
|
495
|
+
});
|
|
496
|
+
// add in wrapped map
|
|
497
|
+
const fullName = this.safeString(rawCurrency, 'fullName');
|
|
498
|
+
if (fullName !== undefined && name !== undefined) {
|
|
499
|
+
const isWrapped = fullName.startsWith('Unit ') && name.startsWith('U');
|
|
500
|
+
if (isWrapped) {
|
|
501
|
+
const parts = name.split('U');
|
|
502
|
+
let nameWithoutU = '';
|
|
503
|
+
for (let j = 0; j < parts.length; j++) {
|
|
504
|
+
nameWithoutU = nameWithoutU + parts[j];
|
|
508
505
|
}
|
|
506
|
+
const baseCode = this.safeCurrencyCode(nameWithoutU);
|
|
507
|
+
this.options['spotCurrencyMapping'][code] = baseCode;
|
|
509
508
|
}
|
|
510
509
|
}
|
|
511
510
|
return result;
|
package/dist/cjs/src/indodax.js
CHANGED
|
@@ -1384,11 +1384,11 @@ class indodax extends indodax$1["default"] {
|
|
|
1384
1384
|
network = [];
|
|
1385
1385
|
const networkIds = networkId.split(',');
|
|
1386
1386
|
for (let j = 0; j < networkIds.length; j++) {
|
|
1387
|
-
network.push(this.networkIdToCode(networkIds[j]).toUpperCase());
|
|
1387
|
+
network.push(this.networkIdToCode(networkIds[j], code).toUpperCase());
|
|
1388
1388
|
}
|
|
1389
1389
|
}
|
|
1390
1390
|
else {
|
|
1391
|
-
network = this.networkIdToCode(networkId).toUpperCase();
|
|
1391
|
+
network = this.networkIdToCode(networkId, code).toUpperCase();
|
|
1392
1392
|
}
|
|
1393
1393
|
}
|
|
1394
1394
|
const finalNetwork = network; // java req
|
package/dist/cjs/src/kraken.js
CHANGED
|
@@ -838,66 +838,65 @@ class kraken extends kraken$1["default"] {
|
|
|
838
838
|
// },
|
|
839
839
|
// }
|
|
840
840
|
//
|
|
841
|
-
const currencies = this.
|
|
842
|
-
const
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
841
|
+
const currencies = this.safeDict(response, 'result', {});
|
|
842
|
+
const enhancedArray = this.addKeyInArrayItems(currencies, '_coin_id');
|
|
843
|
+
return this.parseCurrencies(enhancedArray);
|
|
844
|
+
}
|
|
845
|
+
parseCurrency(rawCurrency) {
|
|
846
|
+
// todo: will need to rethink the fees
|
|
847
|
+
// see: https://support.kraken.com/hc/en-us/articles/201893608-What-are-the-withdrawal-fees-
|
|
848
|
+
// to add support for multiple withdrawal/deposit methods and
|
|
849
|
+
// differentiated fees for each particular method
|
|
850
|
+
//
|
|
851
|
+
// Notes about abbreviations:
|
|
852
|
+
// Z and X prefixes: https://support.kraken.com/hc/en-us/articles/360001206766-Bitcoin-currency-code-XBT-vs-BTC
|
|
853
|
+
// S and M suffixes: https://support.kraken.com/hc/en-us/articles/360039879471-What-is-Asset-S-and-Asset-M-
|
|
854
|
+
//
|
|
855
|
+
const id = this.safeString(rawCurrency, '_coin_id');
|
|
856
|
+
let code = this.safeCurrencyCode(id);
|
|
857
|
+
// the below cannot be reliably done in `safeCurrencyCode`, so we have to do it here
|
|
858
|
+
if (id.indexOf('.') < 0) {
|
|
859
|
+
const altName = this.safeString(rawCurrency, 'altname');
|
|
860
|
+
// handle cases like below:
|
|
855
861
|
//
|
|
856
|
-
|
|
857
|
-
//
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
//
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
code = this.safeCurrencyCode(altName);
|
|
868
|
-
// also, add map in commonCurrencies:
|
|
869
|
-
this.commonCurrencies[id] = code;
|
|
870
|
-
}
|
|
871
|
-
else {
|
|
872
|
-
code = this.safeCurrencyCode(id);
|
|
873
|
-
}
|
|
862
|
+
// id | altname
|
|
863
|
+
// ---------------
|
|
864
|
+
// XXBT | XBT
|
|
865
|
+
// ZUSD | USD
|
|
866
|
+
if (id !== altName && (id.startsWith('X') || id.startsWith('Z'))) {
|
|
867
|
+
code = this.safeCurrencyCode(altName);
|
|
868
|
+
// also, add map in commonCurrencies:
|
|
869
|
+
this.commonCurrencies[id] = code;
|
|
870
|
+
}
|
|
871
|
+
else {
|
|
872
|
+
code = this.safeCurrencyCode(id);
|
|
874
873
|
}
|
|
875
|
-
const isFiat = code.indexOf('.HOLD') >= 0;
|
|
876
|
-
result[code] = this.safeCurrencyStructure({
|
|
877
|
-
'id': id,
|
|
878
|
-
'code': code,
|
|
879
|
-
'info': currency,
|
|
880
|
-
'name': this.safeString(currency, 'altname'),
|
|
881
|
-
'active': this.safeString(currency, 'status') === 'enabled',
|
|
882
|
-
'type': isFiat ? 'fiat' : 'crypto',
|
|
883
|
-
'deposit': undefined,
|
|
884
|
-
'withdraw': undefined,
|
|
885
|
-
'fee': undefined,
|
|
886
|
-
'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals'))),
|
|
887
|
-
'limits': {
|
|
888
|
-
'amount': {
|
|
889
|
-
'min': undefined,
|
|
890
|
-
'max': undefined,
|
|
891
|
-
},
|
|
892
|
-
'withdraw': {
|
|
893
|
-
'min': undefined,
|
|
894
|
-
'max': undefined,
|
|
895
|
-
},
|
|
896
|
-
},
|
|
897
|
-
'networks': {},
|
|
898
|
-
});
|
|
899
874
|
}
|
|
900
|
-
|
|
875
|
+
const isFiat = code.indexOf('.HOLD') >= 0;
|
|
876
|
+
rawCurrency = this.omit(rawCurrency, '_coin_id');
|
|
877
|
+
return this.safeCurrencyStructure({
|
|
878
|
+
'id': id,
|
|
879
|
+
'code': code,
|
|
880
|
+
'info': rawCurrency,
|
|
881
|
+
'name': this.safeString(rawCurrency, 'altname'),
|
|
882
|
+
'active': this.safeString(rawCurrency, 'status') === 'enabled',
|
|
883
|
+
'type': isFiat ? 'fiat' : 'crypto',
|
|
884
|
+
'deposit': undefined,
|
|
885
|
+
'withdraw': undefined,
|
|
886
|
+
'fee': undefined,
|
|
887
|
+
'precision': this.parseNumber(this.parsePrecision(this.safeString(rawCurrency, 'decimals'))),
|
|
888
|
+
'limits': {
|
|
889
|
+
'amount': {
|
|
890
|
+
'min': undefined,
|
|
891
|
+
'max': undefined,
|
|
892
|
+
},
|
|
893
|
+
'withdraw': {
|
|
894
|
+
'min': undefined,
|
|
895
|
+
'max': undefined,
|
|
896
|
+
},
|
|
897
|
+
},
|
|
898
|
+
'networks': {},
|
|
899
|
+
});
|
|
901
900
|
}
|
|
902
901
|
safeCurrencyCode(currencyId, currency = undefined) {
|
|
903
902
|
if (currencyId === undefined) {
|
|
@@ -975,7 +974,7 @@ class kraken extends kraken$1["default"] {
|
|
|
975
974
|
'tierBased': true,
|
|
976
975
|
};
|
|
977
976
|
}
|
|
978
|
-
|
|
977
|
+
parseOrderBookBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
979
978
|
const price = this.safeNumber(bidask, priceKey);
|
|
980
979
|
const amount = this.safeNumber(bidask, amountKey);
|
|
981
980
|
const timestamp = this.safeInteger(bidask, 2);
|
package/dist/cjs/src/kucoin.js
CHANGED
|
@@ -3614,7 +3614,7 @@ class kucoin extends kucoin$1["default"] {
|
|
|
3614
3614
|
let networkCode = undefined;
|
|
3615
3615
|
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
3616
3616
|
if (networkCode !== undefined) {
|
|
3617
|
-
request['chain'] = this.networkCodeToId(networkCode).toLowerCase();
|
|
3617
|
+
request['chain'] = this.networkCodeToId(networkCode, code).toLowerCase();
|
|
3618
3618
|
}
|
|
3619
3619
|
//
|
|
3620
3620
|
// {
|
|
@@ -4292,6 +4292,7 @@ class kucoin extends kucoin$1["default"] {
|
|
|
4292
4292
|
*/
|
|
4293
4293
|
async createUtaOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
4294
4294
|
await this.loadMarkets();
|
|
4295
|
+
const market = this.market(symbol);
|
|
4295
4296
|
const request = this.createUtaOrderRequest(symbol, type, side, amount, price, params);
|
|
4296
4297
|
const response = await this.utaPrivatePostAccountModeOrderPlace(request);
|
|
4297
4298
|
//
|
|
@@ -4306,7 +4307,7 @@ class kucoin extends kucoin$1["default"] {
|
|
|
4306
4307
|
// }
|
|
4307
4308
|
//
|
|
4308
4309
|
const data = this.safeDict(response, 'data', {});
|
|
4309
|
-
return this.parseOrder(data);
|
|
4310
|
+
return this.parseOrder(data, market);
|
|
4310
4311
|
}
|
|
4311
4312
|
createUtaOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
|
|
4312
4313
|
const market = this.market(symbol);
|