ccxt 4.5.55 → 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 +215 -10
- package/dist/ccxt.browser.min.js +10 -10
- package/dist/cjs/ccxt.js +6 -11
- package/dist/cjs/src/aftermath.js +10 -5
- package/dist/cjs/src/alpaca.js +2 -2
- package/dist/cjs/src/apex.js +26 -17
- package/dist/cjs/src/arkham.js +10 -7
- package/dist/cjs/src/ascendex.js +8 -5
- package/dist/cjs/src/aster.js +7 -4
- package/dist/cjs/src/backpack.js +4 -4
- package/dist/cjs/src/base/Exchange.js +72 -35
- 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 +10 -7
- package/dist/cjs/src/binance.js +196 -198
- package/dist/cjs/src/bingx.js +7 -7
- package/dist/cjs/src/bitfinex.js +71 -58
- package/dist/cjs/src/bitflyer.js +2 -1
- package/dist/cjs/src/bitget.js +16 -5
- package/dist/cjs/src/bitmart.js +18 -10
- package/dist/cjs/src/bitmex.js +8 -5
- package/dist/cjs/src/bitopro.js +2 -2
- package/dist/cjs/src/bitrue.js +4 -3
- package/dist/cjs/src/bitso.js +7 -4
- package/dist/cjs/src/bitstamp.js +7 -4
- package/dist/cjs/src/bitteam.js +1 -1
- package/dist/cjs/src/bittrade.js +2 -2
- package/dist/cjs/src/bitvavo.js +457 -34
- package/dist/cjs/src/blofin.js +28 -4
- package/dist/cjs/src/bullish.js +6 -5
- package/dist/cjs/src/bybit.js +19 -17
- package/dist/cjs/src/bybiteu.js +1 -0
- 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 +4 -3
- package/dist/cjs/src/coinbaseinternational.js +17 -10
- package/dist/cjs/src/coinex.js +79 -77
- package/dist/cjs/src/coinmetro.js +1 -1
- package/dist/cjs/src/coinsph.js +5 -5
- package/dist/cjs/src/cryptocom.js +52 -54
- package/dist/cjs/src/cryptomus.js +43 -39
- package/dist/cjs/src/deepcoin.js +9 -5
- package/dist/cjs/src/delta.js +53 -53
- package/dist/cjs/src/deribit.js +35 -35
- package/dist/cjs/src/derive.js +31 -31
- package/dist/cjs/src/digifinex.js +45 -45
- package/dist/cjs/src/exmo.js +104 -122
- package/dist/cjs/src/extended.js +3497 -0
- package/dist/cjs/src/foxbit.js +72 -76
- package/dist/cjs/src/gate.js +53 -53
- package/dist/cjs/src/gemini.js +45 -45
- package/dist/cjs/src/grvt.js +17 -11
- package/dist/cjs/src/hashkey.js +56 -58
- package/dist/cjs/src/hibachi.js +1 -1
- package/dist/cjs/src/hitbtc.js +5 -14
- package/dist/cjs/src/hollaex.js +51 -54
- package/dist/cjs/src/htx.js +84 -72
- package/dist/cjs/src/hyperliquid.js +60 -55
- package/dist/cjs/src/indodax.js +4 -3
- package/dist/cjs/src/kraken.js +71 -71
- package/dist/cjs/src/krakenfutures.js +2 -1
- package/dist/cjs/src/kucoin.js +3 -2
- package/dist/cjs/src/latoken.js +30 -32
- package/dist/cjs/src/lbank.js +64 -60
- package/dist/cjs/src/lighter.js +36 -38
- package/dist/cjs/src/luno.js +36 -44
- package/dist/cjs/src/mercado.js +2 -1
- package/dist/cjs/src/mexc.js +72 -63
- package/dist/cjs/src/modetrade.js +51 -53
- package/dist/cjs/src/ndax.js +35 -37
- package/dist/cjs/src/okx.js +23 -5
- package/dist/cjs/src/onetrading.js +21 -23
- package/dist/cjs/src/p2b.js +8 -4
- package/dist/cjs/src/paradex.js +3 -2
- package/dist/cjs/src/phemex.js +47 -47
- package/dist/cjs/src/poloniex.js +19 -13
- package/dist/cjs/src/pro/alpaca.js +1 -1
- package/dist/cjs/src/pro/apex.js +11 -2
- package/dist/cjs/src/pro/arkham.js +1 -1
- package/dist/cjs/src/pro/aster.js +10 -9
- package/dist/cjs/src/pro/backpack.js +1 -1
- package/dist/cjs/src/pro/binance.js +6 -6
- package/dist/cjs/src/pro/bingx.js +7 -2
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bithumb.js +1 -1
- package/dist/cjs/src/pro/bitmart.js +10 -0
- package/dist/cjs/src/pro/bitmex.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/grvt.js +8 -0
- package/dist/cjs/src/pro/htx.js +4 -4
- package/dist/cjs/src/pro/independentreserve.js +1 -1
- package/dist/cjs/src/pro/krakenfutures.js +16 -4
- package/dist/cjs/src/pro/kucoin.js +1 -1
- package/dist/cjs/src/pro/luno.js +3 -3
- package/dist/cjs/src/pro/modetrade.js +3 -3
- package/dist/cjs/src/pro/okx.js +4 -4
- 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/pro/woo.js +4 -4
- package/dist/cjs/src/pro/woofipro.js +3 -3
- package/dist/cjs/src/pro/xt.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 +3 -3
- 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 +66 -55
- package/dist/cjs/src/woofipro.js +54 -48
- package/dist/cjs/src/xt.js +3 -2
- package/dist/cjs/src/yobit.js +4 -2
- package/dist/cjs/src/zebpay.js +73 -75
- 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/abstract/mexc.d.ts +1 -0
- package/js/src/aftermath.js +10 -5
- package/js/src/alpaca.js +2 -2
- package/js/src/apex.d.ts +1 -1
- package/js/src/apex.js +26 -17
- package/js/src/arkham.js +10 -7
- package/js/src/ascendex.js +8 -5
- 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 +72 -35
- package/js/src/base/functions/io.d.ts +7 -0
- package/js/src/base/functions/io.js +24 -0
- package/js/src/bigone.js +10 -7
- package/js/src/binance.d.ts +2 -0
- package/js/src/binance.js +200 -202
- package/js/src/bingx.js +7 -7
- package/js/src/bitfinex.d.ts +2 -0
- package/js/src/bitfinex.js +71 -58
- package/js/src/bitflyer.js +2 -1
- package/js/src/bitget.js +16 -5
- package/js/src/bitmart.js +18 -10
- package/js/src/bitmex.js +8 -5
- package/js/src/bitopro.js +2 -2
- package/js/src/bitrue.js +4 -3
- package/js/src/bitso.js +7 -4
- package/js/src/bitstamp.js +7 -4
- package/js/src/bitteam.js +1 -1
- package/js/src/bittrade.js +2 -2
- 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 +28 -4
- package/js/src/bullish.js +6 -5
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +19 -17
- package/js/src/bybiteu.js +1 -0
- 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 +4 -3
- package/js/src/coinbaseinternational.d.ts +1 -1
- package/js/src/coinbaseinternational.js +17 -10
- package/js/src/coinex.d.ts +2 -1
- package/js/src/coinex.js +79 -77
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +1 -1
- package/js/src/coinsph.js +5 -5
- package/js/src/cryptocom.d.ts +1 -0
- package/js/src/cryptocom.js +52 -54
- package/js/src/cryptomus.d.ts +2 -1
- package/js/src/cryptomus.js +43 -39
- package/js/src/deepcoin.js +9 -5
- package/js/src/delta.d.ts +1 -0
- package/js/src/delta.js +53 -53
- package/js/src/deribit.d.ts +1 -0
- package/js/src/deribit.js +35 -35
- package/js/src/derive.d.ts +1 -0
- package/js/src/derive.js +31 -31
- package/js/src/digifinex.d.ts +1 -0
- package/js/src/digifinex.js +45 -45
- package/js/src/exmo.d.ts +1 -0
- package/js/src/exmo.js +104 -122
- 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 +72 -76
- 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 +45 -45
- package/js/src/grvt.d.ts +1 -1
- package/js/src/grvt.js +17 -11
- package/js/src/hashkey.d.ts +1 -0
- package/js/src/hashkey.js +56 -58
- package/js/src/hibachi.d.ts +1 -1
- package/js/src/hibachi.js +1 -1
- package/js/src/hitbtc.d.ts +0 -1
- package/js/src/hitbtc.js +5 -14
- 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 +84 -72
- package/js/src/hyperliquid.d.ts +5 -4
- package/js/src/hyperliquid.js +60 -55
- package/js/src/indodax.js +4 -3
- package/js/src/kraken.d.ts +2 -1
- package/js/src/kraken.js +71 -71
- package/js/src/krakenfutures.js +2 -1
- 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 +64 -60
- package/js/src/lighter.d.ts +2 -1
- package/js/src/lighter.js +36 -38
- package/js/src/luno.d.ts +1 -0
- package/js/src/luno.js +36 -44
- package/js/src/mercado.js +2 -1
- package/js/src/mexc.d.ts +4 -3
- package/js/src/mexc.js +72 -63
- package/js/src/modetrade.d.ts +1 -0
- package/js/src/modetrade.js +51 -53
- package/js/src/ndax.d.ts +1 -0
- package/js/src/ndax.js +35 -37
- package/js/src/okx.js +23 -5
- package/js/src/onetrading.d.ts +2 -1
- package/js/src/onetrading.js +21 -23
- package/js/src/p2b.js +8 -4
- package/js/src/paradex.js +3 -2
- package/js/src/phemex.d.ts +1 -0
- package/js/src/phemex.js +47 -47
- package/js/src/poloniex.js +19 -13
- package/js/src/pro/alpaca.js +1 -1
- package/js/src/pro/apex.js +11 -2
- package/js/src/pro/arkham.js +1 -1
- package/js/src/pro/aster.js +10 -9
- package/js/src/pro/backpack.js +1 -1
- package/js/src/pro/binance.d.ts +1 -1
- package/js/src/pro/binance.js +6 -6
- package/js/src/pro/bingx.js +7 -2
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bithumb.js +1 -1
- package/js/src/pro/bitmart.js +10 -0
- package/js/src/pro/bitmex.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/grvt.js +8 -0
- package/js/src/pro/htx.d.ts +4 -4
- package/js/src/pro/htx.js +4 -4
- package/js/src/pro/independentreserve.js +1 -1
- package/js/src/pro/krakenfutures.d.ts +4 -4
- package/js/src/pro/krakenfutures.js +16 -4
- 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/modetrade.d.ts +3 -3
- package/js/src/pro/modetrade.js +3 -3
- package/js/src/pro/okx.d.ts +4 -4
- package/js/src/pro/okx.js +4 -4
- 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/pro/woo.d.ts +4 -4
- package/js/src/pro/woo.js +4 -4
- package/js/src/pro/woofipro.d.ts +3 -3
- package/js/src/pro/woofipro.js +3 -3
- package/js/src/pro/xt.js +1 -1
- package/js/src/tokocrypto.js +1 -1
- package/js/src/toobit.d.ts +1 -1
- package/js/src/toobit.js +3 -3
- 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 +66 -55
- package/js/src/woofipro.d.ts +1 -0
- package/js/src/woofipro.js +54 -48
- package/js/src/xt.js +3 -2
- package/js/src/yobit.js +4 -2
- package/js/src/zebpay.d.ts +2 -1
- package/js/src/zebpay.js +73 -75
- package/package.json +25 -11
- package/dist/cjs/src/gateio.js +0 -18
- package/dist/cjs/src/oxfun.js +0 -2931
- 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 -2924
- 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/hyperliquid.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export default class hyperliquid extends Exchange {
|
|
|
39
39
|
* @returns {object} an associative dictionary of currencies
|
|
40
40
|
*/
|
|
41
41
|
fetchCurrencies(params?: {}): Promise<Currencies>;
|
|
42
|
+
parseCurrency(rawCurrency: Dict): Currency;
|
|
42
43
|
/**
|
|
43
44
|
* @method
|
|
44
45
|
* @name hyperliquid#fetchMarkets
|
|
@@ -237,8 +238,8 @@ export default class hyperliquid extends Exchange {
|
|
|
237
238
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-abstraction-state
|
|
238
239
|
* @description returns enableUnifiedMargin so the user can check if unified account is enabled
|
|
239
240
|
* @param {string} method the method for which we want to check if unified margin is enabled, this is used to check options for specific methods (e.g. fetchBalance can have a specific option to enable unified margin)
|
|
240
|
-
* @param address
|
|
241
|
-
* @param shouldRefresh
|
|
241
|
+
* @param {string} [address] the wallet address to query; defaults to the configured walletAddress
|
|
242
|
+
* @param {boolean} [shouldRefresh] force a fresh request instead of returning the cached value
|
|
242
243
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
243
244
|
* @returns {bool} enableUnifiedMargin
|
|
244
245
|
*/
|
|
@@ -258,8 +259,8 @@ export default class hyperliquid extends Exchange {
|
|
|
258
259
|
* @method
|
|
259
260
|
* @name hyperliquid#enableUserDexAbstraction
|
|
260
261
|
* @description If set, actions on HIP-3 perps will automatically transfer collateral from validator-operated USDC perps balance for HIP-3 DEXs where USDC is the collateral token, and spot otherwise
|
|
261
|
-
* @param enabled
|
|
262
|
-
* @param params
|
|
262
|
+
* @param {boolean} enabled whether to enable user dex abstraction
|
|
263
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
263
264
|
* @param {string} [params.type] 'userDexAbstraction' or 'agentEnableDexAbstraction' default is 'userDexAbstraction'
|
|
264
265
|
* @returns dictionary response from the exchange
|
|
265
266
|
*/
|
package/js/src/hyperliquid.js
CHANGED
|
@@ -457,50 +457,49 @@ export default class hyperliquid extends Exchange {
|
|
|
457
457
|
const tokens = this.safeList(response, 'tokens', []);
|
|
458
458
|
// const meta = this.safeList (response, 'universe', []);
|
|
459
459
|
this.options['cachedCurrenciesById'] = {}; // used to map hip3 markets
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
},
|
|
485
|
-
'withdraw': {
|
|
486
|
-
'min': undefined,
|
|
487
|
-
'max': undefined,
|
|
488
|
-
},
|
|
460
|
+
return this.parseCurrencies(tokens);
|
|
461
|
+
}
|
|
462
|
+
parseCurrency(rawCurrency) {
|
|
463
|
+
// const id = i;
|
|
464
|
+
const id = this.safeString(rawCurrency, 'index');
|
|
465
|
+
const name = this.safeString(rawCurrency, 'name');
|
|
466
|
+
const code = this.safeCurrencyCode(name);
|
|
467
|
+
this.options['cachedCurrenciesById'][id] = name;
|
|
468
|
+
const result = this.safeCurrencyStructure({
|
|
469
|
+
'id': id,
|
|
470
|
+
'name': name,
|
|
471
|
+
'code': code,
|
|
472
|
+
'precision': this.parsePrecision(this.safeString(rawCurrency, 'weiDecimals')),
|
|
473
|
+
'info': rawCurrency,
|
|
474
|
+
'active': undefined,
|
|
475
|
+
'deposit': undefined,
|
|
476
|
+
'withdraw': undefined,
|
|
477
|
+
'networks': undefined,
|
|
478
|
+
'fee': undefined,
|
|
479
|
+
'type': 'crypto',
|
|
480
|
+
'limits': {
|
|
481
|
+
'amount': {
|
|
482
|
+
'min': undefined,
|
|
483
|
+
'max': undefined,
|
|
489
484
|
},
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
485
|
+
'withdraw': {
|
|
486
|
+
'min': undefined,
|
|
487
|
+
'max': undefined,
|
|
488
|
+
},
|
|
489
|
+
},
|
|
490
|
+
});
|
|
491
|
+
// add in wrapped map
|
|
492
|
+
const fullName = this.safeString(rawCurrency, 'fullName');
|
|
493
|
+
if (fullName !== undefined && name !== undefined) {
|
|
494
|
+
const isWrapped = fullName.startsWith('Unit ') && name.startsWith('U');
|
|
495
|
+
if (isWrapped) {
|
|
496
|
+
const parts = name.split('U');
|
|
497
|
+
let nameWithoutU = '';
|
|
498
|
+
for (let j = 0; j < parts.length; j++) {
|
|
499
|
+
nameWithoutU = nameWithoutU + parts[j];
|
|
503
500
|
}
|
|
501
|
+
const baseCode = this.safeCurrencyCode(nameWithoutU);
|
|
502
|
+
this.options['spotCurrencyMapping'][code] = baseCode;
|
|
504
503
|
}
|
|
505
504
|
}
|
|
506
505
|
return result;
|
|
@@ -1836,8 +1835,8 @@ export default class hyperliquid extends Exchange {
|
|
|
1836
1835
|
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-abstraction-state
|
|
1837
1836
|
* @description returns enableUnifiedMargin so the user can check if unified account is enabled
|
|
1838
1837
|
* @param {string} method the method for which we want to check if unified margin is enabled, this is used to check options for specific methods (e.g. fetchBalance can have a specific option to enable unified margin)
|
|
1839
|
-
* @param address
|
|
1840
|
-
* @param shouldRefresh
|
|
1838
|
+
* @param {string} [address] the wallet address to query; defaults to the configured walletAddress
|
|
1839
|
+
* @param {boolean} [shouldRefresh] force a fresh request instead of returning the cached value
|
|
1841
1840
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1842
1841
|
* @returns {bool} enableUnifiedMargin
|
|
1843
1842
|
*/
|
|
@@ -1931,8 +1930,8 @@ export default class hyperliquid extends Exchange {
|
|
|
1931
1930
|
* @method
|
|
1932
1931
|
* @name hyperliquid#enableUserDexAbstraction
|
|
1933
1932
|
* @description If set, actions on HIP-3 perps will automatically transfer collateral from validator-operated USDC perps balance for HIP-3 DEXs where USDC is the collateral token, and spot otherwise
|
|
1934
|
-
* @param enabled
|
|
1935
|
-
* @param params
|
|
1933
|
+
* @param {boolean} enabled whether to enable user dex abstraction
|
|
1934
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1936
1935
|
* @param {string} [params.type] 'userDexAbstraction' or 'agentEnableDexAbstraction' default is 'userDexAbstraction'
|
|
1937
1936
|
* @returns dictionary response from the exchange
|
|
1938
1937
|
*/
|
|
@@ -2144,7 +2143,7 @@ export default class hyperliquid extends Exchange {
|
|
|
2144
2143
|
ordersToBeParsed.push(order);
|
|
2145
2144
|
}
|
|
2146
2145
|
}
|
|
2147
|
-
return this.parseOrders(ordersToBeParsed
|
|
2146
|
+
return this.parseOrders(ordersToBeParsed);
|
|
2148
2147
|
}
|
|
2149
2148
|
createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
|
|
2150
2149
|
const market = this.market(symbol);
|
|
@@ -2188,10 +2187,11 @@ export default class hyperliquid extends Exchange {
|
|
|
2188
2187
|
else {
|
|
2189
2188
|
triggerPrice = this.priceToPrecision(symbol, stopLossPrice);
|
|
2190
2189
|
}
|
|
2190
|
+
const tpSlType = (isTp) ? 'tp' : 'sl';
|
|
2191
2191
|
orderType['trigger'] = {
|
|
2192
2192
|
'isMarket': isMarket,
|
|
2193
2193
|
'triggerPx': triggerPrice,
|
|
2194
|
-
'tpsl':
|
|
2194
|
+
'tpsl': tpSlType,
|
|
2195
2195
|
};
|
|
2196
2196
|
}
|
|
2197
2197
|
else {
|
|
@@ -2512,9 +2512,10 @@ export default class hyperliquid extends Exchange {
|
|
|
2512
2512
|
else {
|
|
2513
2513
|
cancelAction['type'] = 'cancel';
|
|
2514
2514
|
for (let i = 0; i < ids.length; i++) {
|
|
2515
|
+
const o = this.parseToNumeric(ids[i]);
|
|
2515
2516
|
cancelReq.push({
|
|
2516
2517
|
'a': baseId,
|
|
2517
|
-
'o':
|
|
2518
|
+
'o': o,
|
|
2518
2519
|
});
|
|
2519
2520
|
}
|
|
2520
2521
|
}
|
|
@@ -2722,10 +2723,11 @@ export default class hyperliquid extends Exchange {
|
|
|
2722
2723
|
else {
|
|
2723
2724
|
triggerPrice = this.priceToPrecision(symbol, stopLossPrice);
|
|
2724
2725
|
}
|
|
2726
|
+
const tpSlType = (isTp) ? 'tp' : 'sl';
|
|
2725
2727
|
orderType['trigger'] = {
|
|
2726
2728
|
'isMarket': isMarket,
|
|
2727
2729
|
'triggerPx': triggerPrice,
|
|
2728
|
-
'tpsl':
|
|
2730
|
+
'tpsl': tpSlType,
|
|
2729
2731
|
};
|
|
2730
2732
|
}
|
|
2731
2733
|
else {
|
|
@@ -3316,8 +3318,9 @@ export default class hyperliquid extends Exchange {
|
|
|
3316
3318
|
//
|
|
3317
3319
|
const error = this.safeString(order, 'error');
|
|
3318
3320
|
if (error !== undefined) {
|
|
3321
|
+
const finalOrder = order; // java req
|
|
3319
3322
|
return this.safeOrder({
|
|
3320
|
-
'info':
|
|
3323
|
+
'info': finalOrder,
|
|
3321
3324
|
'status': 'rejected',
|
|
3322
3325
|
});
|
|
3323
3326
|
}
|
|
@@ -3352,6 +3355,7 @@ export default class hyperliquid extends Exchange {
|
|
|
3352
3355
|
if (tif !== undefined) {
|
|
3353
3356
|
postOnly = (tif === 'ALO');
|
|
3354
3357
|
}
|
|
3358
|
+
const triggerPx = this.safeBool(entry, 'isTrigger') ? this.safeNumber(entry, 'triggerPx') : undefined;
|
|
3355
3359
|
return this.safeOrder({
|
|
3356
3360
|
'info': order,
|
|
3357
3361
|
'id': this.safeString(entry, 'oid'),
|
|
@@ -3367,7 +3371,7 @@ export default class hyperliquid extends Exchange {
|
|
|
3367
3371
|
'reduceOnly': this.safeBool(entry, 'reduceOnly'),
|
|
3368
3372
|
'side': side,
|
|
3369
3373
|
'price': this.safeString(entry, 'limitPx'),
|
|
3370
|
-
'triggerPrice':
|
|
3374
|
+
'triggerPrice': triggerPx,
|
|
3371
3375
|
'amount': totalAmount,
|
|
3372
3376
|
'cost': undefined,
|
|
3373
3377
|
'average': this.safeString(entry, 'avgPx'),
|
|
@@ -3639,7 +3643,7 @@ export default class hyperliquid extends Exchange {
|
|
|
3639
3643
|
const data = this.safeList(response, 'assetPositions', []);
|
|
3640
3644
|
const result = [];
|
|
3641
3645
|
for (let i = 0; i < data.length; i++) {
|
|
3642
|
-
result.push(this.parsePosition(data[i]
|
|
3646
|
+
result.push(this.parsePosition(data[i]));
|
|
3643
3647
|
}
|
|
3644
3648
|
return this.filterByArrayPositions(result, 'symbol', symbols, false);
|
|
3645
3649
|
}
|
|
@@ -3953,10 +3957,11 @@ export default class hyperliquid extends Exchange {
|
|
|
3953
3957
|
vaultAddress = this.formatVaultAddress(vaultAddress);
|
|
3954
3958
|
strAmount = strAmount + ' subaccount:' + vaultAddress;
|
|
3955
3959
|
}
|
|
3960
|
+
const strAmountFinal = strAmount; // java req
|
|
3956
3961
|
const toPerp = (toAccount === 'perp') || (toAccount === 'swap');
|
|
3957
3962
|
const transferPayload = {
|
|
3958
3963
|
'hyperliquidChain': isSandboxMode ? 'Testnet' : 'Mainnet',
|
|
3959
|
-
'amount':
|
|
3964
|
+
'amount': strAmountFinal,
|
|
3960
3965
|
'toPerp': toPerp,
|
|
3961
3966
|
'nonce': nonce,
|
|
3962
3967
|
};
|
|
@@ -3966,7 +3971,7 @@ export default class hyperliquid extends Exchange {
|
|
|
3966
3971
|
'hyperliquidChain': transferPayload['hyperliquidChain'],
|
|
3967
3972
|
'signatureChainId': '0x66eee',
|
|
3968
3973
|
'type': 'usdClassTransfer',
|
|
3969
|
-
'amount':
|
|
3974
|
+
'amount': strAmountFinal,
|
|
3970
3975
|
'toPerp': toPerp,
|
|
3971
3976
|
'nonce': nonce,
|
|
3972
3977
|
},
|
package/js/src/indodax.js
CHANGED
|
@@ -1379,17 +1379,18 @@ export default class indodax extends Exchange {
|
|
|
1379
1379
|
network = [];
|
|
1380
1380
|
const networkIds = networkId.split(',');
|
|
1381
1381
|
for (let j = 0; j < networkIds.length; j++) {
|
|
1382
|
-
network.push(this.networkIdToCode(networkIds[j]).toUpperCase());
|
|
1382
|
+
network.push(this.networkIdToCode(networkIds[j], code).toUpperCase());
|
|
1383
1383
|
}
|
|
1384
1384
|
}
|
|
1385
1385
|
else {
|
|
1386
|
-
network = this.networkIdToCode(networkId).toUpperCase();
|
|
1386
|
+
network = this.networkIdToCode(networkId, code).toUpperCase();
|
|
1387
1387
|
}
|
|
1388
1388
|
}
|
|
1389
|
+
const finalNetwork = network; // java req
|
|
1389
1390
|
result[code] = {
|
|
1390
1391
|
'info': {},
|
|
1391
1392
|
'currency': code,
|
|
1392
|
-
'network':
|
|
1393
|
+
'network': finalNetwork,
|
|
1393
1394
|
'address': address,
|
|
1394
1395
|
'tag': undefined,
|
|
1395
1396
|
};
|
package/js/src/kraken.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export default class kraken 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
|
safeCurrencyCode(currencyId: Str, currency?: Currency): Str;
|
|
45
46
|
/**
|
|
46
47
|
* @method
|
|
@@ -60,7 +61,7 @@ export default class kraken extends Exchange {
|
|
|
60
61
|
percentage: boolean;
|
|
61
62
|
tierBased: boolean;
|
|
62
63
|
};
|
|
63
|
-
|
|
64
|
+
parseOrderBookBidAsk(bidask: any, priceKey?: IndexType, amountKey?: IndexType, countOrIdKey?: IndexType): number[];
|
|
64
65
|
/**
|
|
65
66
|
* @method
|
|
66
67
|
* @name kraken#fetchOrderBook
|
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);
|
|
@@ -1728,10 +1727,11 @@ export default class kraken extends Exchange {
|
|
|
1728
1727
|
const amount = this.safeValue(rawOrder, 'amount');
|
|
1729
1728
|
const price = this.safeValue(rawOrder, 'price');
|
|
1730
1729
|
const orderParams = this.safeDict(rawOrder, 'params', {});
|
|
1730
|
+
const parsedAmount = this.amountToPrecision(market['symbol'], amount);
|
|
1731
1731
|
const req = {
|
|
1732
1732
|
'type': side,
|
|
1733
1733
|
'ordertype': type,
|
|
1734
|
-
'volume':
|
|
1734
|
+
'volume': parsedAmount,
|
|
1735
1735
|
};
|
|
1736
1736
|
const orderRequest = this.orderRequest('createOrders', marketId, type, req, amount, price, orderParams);
|
|
1737
1737
|
ordersRequests.push(orderRequest[0]);
|
|
@@ -2069,12 +2069,12 @@ export default class kraken extends Exchange {
|
|
|
2069
2069
|
stopLossPrice = triggerPrice;
|
|
2070
2070
|
}
|
|
2071
2071
|
}
|
|
2072
|
-
let
|
|
2072
|
+
let typeParsed = this.parseOrderType(rawType);
|
|
2073
2073
|
// unlike from endpoints which provide eg: "take-profit-limit"
|
|
2074
2074
|
// for "space-delimited" orders we dont have market/limit suffixes, their format is
|
|
2075
2075
|
// eg: `stop loss > limit 123`, so we need to parse them manually
|
|
2076
|
-
if (this.inArray(
|
|
2077
|
-
|
|
2076
|
+
if (this.inArray(typeParsed, ['stop loss', 'take profit'])) {
|
|
2077
|
+
typeParsed = (price === undefined) ? 'market' : 'limit';
|
|
2078
2078
|
}
|
|
2079
2079
|
const amendId = this.safeString(order, 'amend_id');
|
|
2080
2080
|
if (amendId !== undefined) {
|
|
@@ -2089,7 +2089,7 @@ export default class kraken extends Exchange {
|
|
|
2089
2089
|
'lastTradeTimestamp': undefined,
|
|
2090
2090
|
'status': status,
|
|
2091
2091
|
'symbol': symbol,
|
|
2092
|
-
'type':
|
|
2092
|
+
'type': typeParsed,
|
|
2093
2093
|
'timeInForce': undefined,
|
|
2094
2094
|
'postOnly': isPostOnly,
|
|
2095
2095
|
'side': side,
|
|
@@ -3491,16 +3491,16 @@ export default class kraken extends Exchange {
|
|
|
3491
3491
|
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
3492
3492
|
await this.loadMarkets();
|
|
3493
3493
|
const currency = this.currency(code);
|
|
3494
|
-
|
|
3495
|
-
|
|
3494
|
+
const fromAccountParsed = this.parseAccountType(fromAccount);
|
|
3495
|
+
const toAccountParsed = this.parseAccountType(toAccount);
|
|
3496
3496
|
const request = {
|
|
3497
3497
|
'amount': this.currencyToPrecision(code, amount),
|
|
3498
|
-
'from':
|
|
3499
|
-
'to':
|
|
3498
|
+
'from': fromAccountParsed,
|
|
3499
|
+
'to': toAccountParsed,
|
|
3500
3500
|
'asset': currency['id'],
|
|
3501
3501
|
};
|
|
3502
|
-
if (
|
|
3503
|
-
throw new BadRequest(this.id + ' transfer cannot transfer from ' +
|
|
3502
|
+
if (fromAccountParsed !== 'Spot Wallet') {
|
|
3503
|
+
throw new BadRequest(this.id + ' transfer cannot transfer from ' + fromAccountParsed + ' to ' + toAccountParsed + '. Use krakenfutures instead to transfer from the futures account.');
|
|
3504
3504
|
}
|
|
3505
3505
|
const response = await this.privatePostWalletTransfer(this.extend(request, params));
|
|
3506
3506
|
//
|
|
@@ -3515,8 +3515,8 @@ export default class kraken extends Exchange {
|
|
|
3515
3515
|
const transfer = this.parseTransfer(response, currency);
|
|
3516
3516
|
return this.extend(transfer, {
|
|
3517
3517
|
'amount': amount,
|
|
3518
|
-
'fromAccount':
|
|
3519
|
-
'toAccount':
|
|
3518
|
+
'fromAccount': fromAccountParsed,
|
|
3519
|
+
'toAccount': toAccountParsed,
|
|
3520
3520
|
});
|
|
3521
3521
|
}
|
|
3522
3522
|
parseTransfer(transfer, currency = undefined) {
|
package/js/src/krakenfutures.js
CHANGED
|
@@ -2045,6 +2045,7 @@ export default class krakenfutures extends Exchange {
|
|
|
2045
2045
|
const innerStatus = this.safeString(order, 'status');
|
|
2046
2046
|
const fetchOrderPriceTriggerOptions = this.safeDict(orderDictFromFetchOrder, 'priceTriggerOptions', {});
|
|
2047
2047
|
const fetchOrderTriggerPrice = this.safeString(fetchOrderPriceTriggerOptions, 'triggerPrice');
|
|
2048
|
+
const unifiedSymbol = this.safeSymbol(this.safeString(orderDictFromFetchOrder, 'symbol'), market);
|
|
2048
2049
|
return this.safeOrder({
|
|
2049
2050
|
'info': order,
|
|
2050
2051
|
'id': this.safeString(orderDictFromFetchOrder, 'orderId'),
|
|
@@ -2053,7 +2054,7 @@ export default class krakenfutures extends Exchange {
|
|
|
2053
2054
|
'datetime': datetime,
|
|
2054
2055
|
'lastTradeTimestamp': undefined,
|
|
2055
2056
|
'lastUpdateTimestamp': this.parse8601(this.safeString(orderDictFromFetchOrder, 'lastUpdateTimestamp')),
|
|
2056
|
-
'symbol':
|
|
2057
|
+
'symbol': unifiedSymbol,
|
|
2057
2058
|
'type': undefined,
|
|
2058
2059
|
'timeInForce': undefined,
|
|
2059
2060
|
'postOnly': undefined,
|
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
|