ccxt 4.2.92 → 4.2.94

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.
Files changed (52) hide show
  1. package/README.md +3 -3
  2. package/build.sh +1 -1
  3. package/dist/ccxt.browser.js +807 -175
  4. package/dist/ccxt.browser.min.js +3 -3
  5. package/dist/cjs/ccxt.js +1 -1
  6. package/dist/cjs/src/base/Exchange.js +50 -9
  7. package/dist/cjs/src/base/functions/encode.js +4 -4
  8. package/dist/cjs/src/binance.js +63 -2
  9. package/dist/cjs/src/bitget.js +139 -0
  10. package/dist/cjs/src/coinex.js +0 -30
  11. package/dist/cjs/src/digifinex.js +1 -22
  12. package/dist/cjs/src/okx.js +153 -0
  13. package/dist/cjs/src/pro/kraken.js +107 -17
  14. package/dist/cjs/src/pro/krakenfutures.js +117 -40
  15. package/dist/cjs/src/pro/kucoin.js +30 -19
  16. package/dist/cjs/src/probit.js +3 -4
  17. package/dist/cjs/src/woo.js +139 -0
  18. package/examples/js/cli.js +4 -1
  19. package/examples/ts/cli.ts +4 -1
  20. package/js/ccxt.d.ts +3 -3
  21. package/js/ccxt.js +1 -1
  22. package/js/src/abstract/binance.d.ts +1 -0
  23. package/js/src/abstract/binancecoinm.d.ts +1 -0
  24. package/js/src/abstract/binanceus.d.ts +1 -0
  25. package/js/src/abstract/binanceusdm.d.ts +1 -0
  26. package/js/src/base/Exchange.d.ts +16 -10
  27. package/js/src/base/Exchange.js +50 -9
  28. package/js/src/base/functions/encode.d.ts +1 -1
  29. package/js/src/base/functions/encode.js +4 -4
  30. package/js/src/base/functions/rsa.d.ts +1 -1
  31. package/js/src/base/types.d.ts +12 -0
  32. package/js/src/binance.d.ts +1 -0
  33. package/js/src/binance.js +63 -2
  34. package/js/src/bitget.d.ts +4 -1
  35. package/js/src/bitget.js +139 -0
  36. package/js/src/coinex.d.ts +0 -1
  37. package/js/src/coinex.js +0 -30
  38. package/js/src/digifinex.d.ts +0 -1
  39. package/js/src/digifinex.js +1 -49
  40. package/js/src/okx.d.ts +4 -1
  41. package/js/src/okx.js +153 -0
  42. package/js/src/pro/kraken.d.ts +6 -1
  43. package/js/src/pro/kraken.js +107 -17
  44. package/js/src/pro/krakenfutures.d.ts +8 -2
  45. package/js/src/pro/krakenfutures.js +117 -40
  46. package/js/src/pro/kucoin.js +30 -19
  47. package/js/src/probit.d.ts +1 -1
  48. package/js/src/probit.js +3 -4
  49. package/js/src/woo.d.ts +4 -1
  50. package/js/src/woo.js +139 -0
  51. package/package.json +1 -1
  52. package/skip-tests.json +4 -0
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bitget.js';
2
- import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderRequest, FundingHistory, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Market, Strings, Currency, Position, Liquidation, TransferEntry, Leverage, MarginMode, Num, MarginModification, TradingFeeInterface, Currencies, TradingFees } from './base/types.js';
2
+ import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderRequest, FundingHistory, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Market, Strings, Currency, Position, Liquidation, TransferEntry, Leverage, MarginMode, Num, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion } from './base/types.js';
3
3
  /**
4
4
  * @class bitget
5
5
  * @augments Exchange
@@ -282,6 +282,9 @@ export default class bitget extends Exchange {
282
282
  closeAllPositions(params?: {}): Promise<Position[]>;
283
283
  fetchMarginMode(symbol: string, params?: {}): Promise<MarginMode>;
284
284
  parseMarginMode(marginMode: any, market?: any): MarginMode;
285
+ fetchConvertQuote(fromCode: string, toCode: string, amount?: Num, params?: {}): Promise<Conversion>;
286
+ parseConversion(conversion: any, fromCurrency?: Currency, toCurrency?: Currency): Conversion;
287
+ fetchConvertCurrencies(params?: {}): Promise<Currencies>;
285
288
  handleErrors(code: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
286
289
  sign(path: any, api?: any[], method?: string, params?: {}, headers?: any, body?: any): {
287
290
  url: string;
package/js/src/bitget.js CHANGED
@@ -66,6 +66,8 @@ export default class bitget extends Exchange {
66
66
  'fetchCanceledAndClosedOrders': true,
67
67
  'fetchCanceledOrders': true,
68
68
  'fetchClosedOrders': true,
69
+ 'fetchConvertCurrencies': true,
70
+ 'fetchConvertQuote': true,
69
71
  'fetchCrossBorrowRate': true,
70
72
  'fetchCrossBorrowRates': false,
71
73
  'fetchCurrencies': true,
@@ -8445,6 +8447,143 @@ export default class bitget extends Exchange {
8445
8447
  'marginMode': marginType,
8446
8448
  };
8447
8449
  }
8450
+ async fetchConvertQuote(fromCode, toCode, amount = undefined, params = {}) {
8451
+ /**
8452
+ * @method
8453
+ * @name bitget#fetchConvertQuote
8454
+ * @description fetch a quote for converting from one currency to another
8455
+ * @see https://www.bitget.com/api-doc/common/convert/Get-Quoted-Price
8456
+ * @param {string} fromCode the currency that you want to sell and convert from
8457
+ * @param {string} toCode the currency that you want to buy and convert into
8458
+ * @param {float} [amount] how much you want to trade in units of the from currency
8459
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
8460
+ * @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
8461
+ */
8462
+ await this.loadMarkets();
8463
+ const request = {
8464
+ 'fromCoin': fromCode.toUpperCase(),
8465
+ 'toCoin': toCode.toUpperCase(),
8466
+ 'fromCoinSize': this.numberToString(amount),
8467
+ };
8468
+ const response = await this.privateConvertGetV2ConvertQuotedPrice(this.extend(request, params));
8469
+ //
8470
+ // {
8471
+ // "code": "00000",
8472
+ // "msg": "success",
8473
+ // "requestTime": 1712121940158,
8474
+ // "data": {
8475
+ // "fromCoin": "USDT",
8476
+ // "fromCoinSize": "5",
8477
+ // "cnvtPrice": "0.9993007892377704",
8478
+ // "toCoin": "USDC",
8479
+ // "toCoinSize": "4.99650394",
8480
+ // "traceId": "1159288930228187140",
8481
+ // "fee": "0"
8482
+ // }
8483
+ // }
8484
+ //
8485
+ const data = this.safeDict(response, 'data', {});
8486
+ const fromCurrencyId = this.safeString(data, 'fromCoin', fromCode);
8487
+ const fromCurrency = this.currency(fromCurrencyId);
8488
+ const toCurrencyId = this.safeString(data, 'toCoin', toCode);
8489
+ const toCurrency = this.currency(toCurrencyId);
8490
+ return this.parseConversion(data, fromCurrency, toCurrency);
8491
+ }
8492
+ parseConversion(conversion, fromCurrency = undefined, toCurrency = undefined) {
8493
+ //
8494
+ // fetchConvertQuote
8495
+ //
8496
+ // {
8497
+ // "fromCoin": "USDT",
8498
+ // "fromCoinSize": "5",
8499
+ // "cnvtPrice": "0.9993007892377704",
8500
+ // "toCoin": "USDC",
8501
+ // "toCoinSize": "4.99650394",
8502
+ // "traceId": "1159288930228187140",
8503
+ // "fee": "0"
8504
+ // }
8505
+ //
8506
+ const timestamp = this.safeInteger(conversion, 'ts');
8507
+ const fromCoin = this.safeString(conversion, 'fromCoin');
8508
+ const fromCode = this.safeCurrencyCode(fromCoin, fromCurrency);
8509
+ const to = this.safeString(conversion, 'toCoin');
8510
+ const toCode = this.safeCurrencyCode(to, toCurrency);
8511
+ return {
8512
+ 'info': conversion,
8513
+ 'timestamp': timestamp,
8514
+ 'datetime': this.iso8601(timestamp),
8515
+ 'id': this.safeString(conversion, 'traceId'),
8516
+ 'fromCurrency': fromCode,
8517
+ 'fromAmount': this.safeNumber(conversion, 'fromCoinSize'),
8518
+ 'toCurrency': toCode,
8519
+ 'toAmount': this.safeNumber(conversion, 'toCoinSize'),
8520
+ 'price': this.safeNumber(conversion, 'cnvtPrice'),
8521
+ 'fee': this.safeNumber(conversion, 'fee'),
8522
+ };
8523
+ }
8524
+ async fetchConvertCurrencies(params = {}) {
8525
+ /**
8526
+ * @method
8527
+ * @name bitget#fetchConvertCurrencies
8528
+ * @description fetches all available currencies that can be converted
8529
+ * @see https://www.bitget.com/api-doc/common/convert/Get-Convert-Currencies
8530
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
8531
+ * @returns {object} an associative dictionary of currencies
8532
+ */
8533
+ await this.loadMarkets();
8534
+ const response = await this.privateConvertGetV2ConvertCurrencies(params);
8535
+ //
8536
+ // {
8537
+ // "code": "00000",
8538
+ // "msg": "success",
8539
+ // "requestTime": 1712121755897,
8540
+ // "data": [
8541
+ // {
8542
+ // "coin": "BTC",
8543
+ // "available": "0.00009850",
8544
+ // "maxAmount": "0.756266",
8545
+ // "minAmount": "0.00001"
8546
+ // },
8547
+ // ]
8548
+ // }
8549
+ //
8550
+ const result = {};
8551
+ const data = this.safeList(response, 'data', []);
8552
+ for (let i = 0; i < data.length; i++) {
8553
+ const entry = data[i];
8554
+ const id = this.safeString(entry, 'coin');
8555
+ const code = this.safeCurrencyCode(id);
8556
+ result[code] = {
8557
+ 'info': entry,
8558
+ 'id': id,
8559
+ 'code': code,
8560
+ 'networks': undefined,
8561
+ 'type': undefined,
8562
+ 'name': undefined,
8563
+ 'active': undefined,
8564
+ 'deposit': undefined,
8565
+ 'withdraw': this.safeNumber(entry, 'available'),
8566
+ 'fee': undefined,
8567
+ 'precision': undefined,
8568
+ 'limits': {
8569
+ 'amount': {
8570
+ 'min': this.safeNumber(entry, 'minAmount'),
8571
+ 'max': this.safeNumber(entry, 'maxAmount'),
8572
+ },
8573
+ 'withdraw': {
8574
+ 'min': undefined,
8575
+ 'max': undefined,
8576
+ },
8577
+ 'deposit': {
8578
+ 'min': undefined,
8579
+ 'max': undefined,
8580
+ },
8581
+ },
8582
+ 'created': undefined,
8583
+ };
8584
+ }
8585
+ return result;
8586
+ }
8448
8587
  handleErrors(code, reason, url, method, headers, body, response, requestHeaders, requestBody) {
8449
8588
  if (!response) {
8450
8589
  return undefined; // fallback to default error handler
@@ -71,7 +71,6 @@ export default class coinex extends Exchange {
71
71
  setMarginMode(marginMode: string, symbol?: Str, params?: {}): Promise<any>;
72
72
  setLeverage(leverage: Int, symbol?: Str, params?: {}): Promise<any>;
73
73
  fetchLeverageTiers(symbols?: Strings, params?: {}): Promise<{}>;
74
- parseLeverageTiers(response: any, symbols?: Strings, marketIdKey?: any): {};
75
74
  parseMarketLeverageTiers(item: any, market?: Market): any[];
76
75
  modifyMarginHelper(symbol: string, amount: any, addOrReduce: any, params?: {}): Promise<any>;
77
76
  parseMarginModification(data: any, market?: Market): MarginModification;
package/js/src/coinex.js CHANGED
@@ -4128,36 +4128,6 @@ export default class coinex extends Exchange {
4128
4128
  const data = this.safeValue(response, 'data', {});
4129
4129
  return this.parseLeverageTiers(data, symbols, undefined);
4130
4130
  }
4131
- parseLeverageTiers(response, symbols = undefined, marketIdKey = undefined) {
4132
- //
4133
- // {
4134
- // "BTCUSD": [
4135
- // ["500001", "100", "0.005"],
4136
- // ["1000001", "50", "0.01"],
4137
- // ["2000001", "30", "0.015"],
4138
- // ["5000001", "20", "0.02"],
4139
- // ["10000001", "15", "0.025"],
4140
- // ["20000001", "10", "0.03"]
4141
- // ],
4142
- // ...
4143
- // }
4144
- //
4145
- const tiers = {};
4146
- const marketIds = Object.keys(response);
4147
- for (let i = 0; i < marketIds.length; i++) {
4148
- const marketId = marketIds[i];
4149
- const market = this.safeMarket(marketId, undefined, undefined, 'spot');
4150
- const symbol = this.safeString(market, 'symbol');
4151
- let symbolsLength = 0;
4152
- if (symbols !== undefined) {
4153
- symbolsLength = symbols.length;
4154
- }
4155
- if (symbol !== undefined && (symbolsLength === 0 || this.inArray(symbols, symbol))) {
4156
- tiers[symbol] = this.parseMarketLeverageTiers(response[marketId], market);
4157
- }
4158
- }
4159
- return tiers;
4160
- }
4161
4131
  parseMarketLeverageTiers(item, market = undefined) {
4162
4132
  const tiers = [];
4163
4133
  let minNotional = 0;
@@ -145,7 +145,6 @@ export default class digifinex extends Exchange {
145
145
  setLeverage(leverage: Int, symbol?: Str, params?: {}): Promise<any>;
146
146
  fetchTransfers(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
147
147
  fetchLeverageTiers(symbols?: Strings, params?: {}): Promise<{}>;
148
- parseLeverageTiers(response: any, symbols?: Strings, marketIdKey?: any): {};
149
148
  fetchMarketLeverageTiers(symbol: string, params?: {}): Promise<any[]>;
150
149
  parseMarketLeverageTiers(info: any, market?: Market): any[];
151
150
  handleMarginModeAndParams(methodName: any, params?: {}, defaultValue?: any): any[];
@@ -3808,55 +3808,7 @@ export default class digifinex extends Exchange {
3808
3808
  //
3809
3809
  const data = this.safeValue(response, 'data', []);
3810
3810
  symbols = this.marketSymbols(symbols);
3811
- return this.parseLeverageTiers(data, symbols, 'symbol');
3812
- }
3813
- parseLeverageTiers(response, symbols = undefined, marketIdKey = undefined) {
3814
- //
3815
- // [
3816
- // {
3817
- // "instrument_id": "BTCUSDTPERP",
3818
- // "type": "REAL",
3819
- // "contract_type": "PERPETUAL",
3820
- // "base_currency": "BTC",
3821
- // "quote_currency": "USDT",
3822
- // "clear_currency": "USDT",
3823
- // "contract_value": "0.001",
3824
- // "contract_value_currency": "BTC",
3825
- // "is_inverse": false,
3826
- // "is_trading": true,
3827
- // "status": "ONLINE",
3828
- // "price_precision": 1,
3829
- // "tick_size": "0.1",
3830
- // "min_order_amount": 1,
3831
- // "open_max_limits": [
3832
- // {
3833
- // "leverage": "50",
3834
- // "max_limit": "1000000"
3835
- // }
3836
- // ]
3837
- // },
3838
- // ]
3839
- //
3840
- const tiers = {};
3841
- const result = {};
3842
- for (let i = 0; i < response.length; i++) {
3843
- const entry = response[i];
3844
- const marketId = this.safeString(entry, 'instrument_id');
3845
- const market = this.safeMarket(marketId);
3846
- const symbol = this.safeSymbol(marketId, market);
3847
- let symbolsLength = 0;
3848
- tiers[symbol] = this.parseMarketLeverageTiers(response[i], market);
3849
- if (symbols !== undefined) {
3850
- symbolsLength = symbols.length;
3851
- if (this.inArray(symbol, symbols)) {
3852
- result[symbol] = this.parseMarketLeverageTiers(response[i], market);
3853
- }
3854
- }
3855
- if (symbol !== undefined && (symbolsLength === 0 || this.inArray(symbols, symbol))) {
3856
- result[symbol] = this.parseMarketLeverageTiers(response[i], market);
3857
- }
3858
- }
3859
- return result;
3811
+ return this.parseLeverageTiers(data, symbols, 'instrument_id');
3860
3812
  }
3861
3813
  async fetchMarketLeverageTiers(symbol, params = {}) {
3862
3814
  /**
package/js/src/okx.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/okx.js';
2
- import type { TransferEntry, Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderRequest, FundingHistory, Str, Transaction, Ticker, OrderBook, Balances, Tickers, Market, Greeks, Strings, MarketInterface, Currency, Leverage, Num, Account, OptionChain, Option, MarginModification, TradingFeeInterface, Currencies } from './base/types.js';
2
+ import type { TransferEntry, Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderRequest, FundingHistory, Str, Transaction, Ticker, OrderBook, Balances, Tickers, Market, Greeks, Strings, MarketInterface, Currency, Leverage, Num, Account, OptionChain, Option, MarginModification, TradingFeeInterface, Currencies, Conversion } from './base/types.js';
3
3
  /**
4
4
  * @class okx
5
5
  * @augments Exchange
@@ -297,6 +297,9 @@ export default class okx extends Exchange {
297
297
  baseVolume: number;
298
298
  quoteVolume: any;
299
299
  };
300
+ fetchConvertQuote(fromCode: string, toCode: string, amount?: Num, params?: {}): Promise<Conversion>;
301
+ parseConversion(conversion: any, fromCurrency?: Currency, toCurrency?: Currency): Conversion;
302
+ fetchConvertCurrencies(params?: {}): Promise<Currencies>;
300
303
  handleErrors(httpCode: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
301
304
  fetchMarginAdjustmentHistory(symbol?: Str, type?: Str, since?: Num, limit?: Num, params?: {}): Promise<MarginModification[]>;
302
305
  }
package/js/src/okx.js CHANGED
@@ -63,6 +63,8 @@ export default class okx extends Exchange {
63
63
  'fetchCanceledOrders': true,
64
64
  'fetchClosedOrder': undefined,
65
65
  'fetchClosedOrders': true,
66
+ 'fetchConvertCurrencies': true,
67
+ 'fetchConvertQuote': true,
66
68
  'fetchCrossBorrowRate': true,
67
69
  'fetchCrossBorrowRates': true,
68
70
  'fetchCurrencies': true,
@@ -7607,6 +7609,157 @@ export default class okx extends Exchange {
7607
7609
  'quoteVolume': undefined,
7608
7610
  };
7609
7611
  }
7612
+ async fetchConvertQuote(fromCode, toCode, amount = undefined, params = {}) {
7613
+ /**
7614
+ * @method
7615
+ * @name okx#fetchConvertQuote
7616
+ * @description fetch a quote for converting from one currency to another
7617
+ * @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-estimate-quote
7618
+ * @param {string} fromCode the currency that you want to sell and convert from
7619
+ * @param {string} toCode the currency that you want to buy and convert into
7620
+ * @param {float} [amount] how much you want to trade in units of the from currency
7621
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7622
+ * @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
7623
+ */
7624
+ await this.loadMarkets();
7625
+ const request = {
7626
+ 'baseCcy': fromCode.toUpperCase(),
7627
+ 'quoteCcy': toCode.toUpperCase(),
7628
+ 'rfqSzCcy': fromCode.toUpperCase(),
7629
+ 'rfqSz': this.numberToString(amount),
7630
+ 'side': 'sell',
7631
+ };
7632
+ const response = await this.privatePostAssetConvertEstimateQuote(this.extend(request, params));
7633
+ //
7634
+ // {
7635
+ // "code": "0",
7636
+ // "data": [
7637
+ // {
7638
+ // "baseCcy": "ETH",
7639
+ // "baseSz": "0.01023052",
7640
+ // "clQReqId": "",
7641
+ // "cnvtPx": "2932.40104429",
7642
+ // "origRfqSz": "30",
7643
+ // "quoteCcy": "USDT",
7644
+ // "quoteId": "quoterETH-USDT16461885104612381",
7645
+ // "quoteSz": "30",
7646
+ // "quoteTime": "1646188510461",
7647
+ // "rfqSz": "30",
7648
+ // "rfqSzCcy": "USDT",
7649
+ // "side": "buy",
7650
+ // "ttlMs": "10000"
7651
+ // }
7652
+ // ],
7653
+ // "msg": ""
7654
+ // }
7655
+ //
7656
+ const data = this.safeList(response, 'data', []);
7657
+ const result = this.safeDict(data, 0, {});
7658
+ const fromCurrencyId = this.safeString(result, 'baseCcy', fromCode);
7659
+ const fromCurrency = this.currency(fromCurrencyId);
7660
+ const toCurrencyId = this.safeString(result, 'quoteCcy', toCode);
7661
+ const toCurrency = this.currency(toCurrencyId);
7662
+ return this.parseConversion(result, fromCurrency, toCurrency);
7663
+ }
7664
+ parseConversion(conversion, fromCurrency = undefined, toCurrency = undefined) {
7665
+ //
7666
+ // fetchConvertQuote
7667
+ //
7668
+ // {
7669
+ // "baseCcy": "ETH",
7670
+ // "baseSz": "0.01023052",
7671
+ // "clQReqId": "",
7672
+ // "cnvtPx": "2932.40104429",
7673
+ // "origRfqSz": "30",
7674
+ // "quoteCcy": "USDT",
7675
+ // "quoteId": "quoterETH-USDT16461885104612381",
7676
+ // "quoteSz": "30",
7677
+ // "quoteTime": "1646188510461",
7678
+ // "rfqSz": "30",
7679
+ // "rfqSzCcy": "USDT",
7680
+ // "side": "buy",
7681
+ // "ttlMs": "10000"
7682
+ // }
7683
+ //
7684
+ const timestamp = this.safeInteger(conversion, 'quoteTime');
7685
+ const fromCoin = this.safeString(conversion, 'baseCcy');
7686
+ const fromCode = this.safeCurrencyCode(fromCoin, fromCurrency);
7687
+ const to = this.safeString(conversion, 'quoteCcy');
7688
+ const toCode = this.safeCurrencyCode(to, toCurrency);
7689
+ return {
7690
+ 'info': conversion,
7691
+ 'timestamp': timestamp,
7692
+ 'datetime': this.iso8601(timestamp),
7693
+ 'id': this.safeString(conversion, 'clQReqId'),
7694
+ 'fromCurrency': fromCode,
7695
+ 'fromAmount': this.safeNumber(conversion, 'baseSz'),
7696
+ 'toCurrency': toCode,
7697
+ 'toAmount': this.safeNumber(conversion, 'quoteSz'),
7698
+ 'price': this.safeNumber(conversion, 'cnvtPx'),
7699
+ 'fee': undefined,
7700
+ };
7701
+ }
7702
+ async fetchConvertCurrencies(params = {}) {
7703
+ /**
7704
+ * @method
7705
+ * @name okx#fetchConvertCurrencies
7706
+ * @description fetches all available currencies that can be converted
7707
+ * @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-convert-currencies
7708
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
7709
+ * @returns {object} an associative dictionary of currencies
7710
+ */
7711
+ await this.loadMarkets();
7712
+ const response = await this.privateGetAssetConvertCurrencies(params);
7713
+ //
7714
+ // {
7715
+ // "code": "0",
7716
+ // "data": [
7717
+ // {
7718
+ // "ccy": "BTC",
7719
+ // "max": "",
7720
+ // "min": ""
7721
+ // },
7722
+ // ],
7723
+ // "msg": ""
7724
+ // }
7725
+ //
7726
+ const result = {};
7727
+ const data = this.safeList(response, 'data', []);
7728
+ for (let i = 0; i < data.length; i++) {
7729
+ const entry = data[i];
7730
+ const id = this.safeString(entry, 'ccy');
7731
+ const code = this.safeCurrencyCode(id);
7732
+ result[code] = {
7733
+ 'info': entry,
7734
+ 'id': id,
7735
+ 'code': code,
7736
+ 'networks': undefined,
7737
+ 'type': undefined,
7738
+ 'name': undefined,
7739
+ 'active': undefined,
7740
+ 'deposit': undefined,
7741
+ 'withdraw': undefined,
7742
+ 'fee': undefined,
7743
+ 'precision': undefined,
7744
+ 'limits': {
7745
+ 'amount': {
7746
+ 'min': this.safeNumber(entry, 'min'),
7747
+ 'max': this.safeNumber(entry, 'max'),
7748
+ },
7749
+ 'withdraw': {
7750
+ 'min': undefined,
7751
+ 'max': undefined,
7752
+ },
7753
+ 'deposit': {
7754
+ 'min': undefined,
7755
+ 'max': undefined,
7756
+ },
7757
+ },
7758
+ 'created': undefined,
7759
+ };
7760
+ }
7761
+ return result;
7762
+ }
7610
7763
  handleErrors(httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody) {
7611
7764
  if (!response) {
7612
7765
  return undefined; // fallback to default error handler
@@ -1,5 +1,5 @@
1
1
  import krakenRest from '../kraken.js';
2
- import type { Int, OrderSide, OrderType, Str, OrderBook, Order, Trade, Ticker, OHLCV, Num } from '../base/types.js';
2
+ import type { Int, Strings, OrderSide, OrderType, Str, OrderBook, Order, Trade, Ticker, Tickers, OHLCV, Num } from '../base/types.js';
3
3
  import Client from '../base/ws/Client.js';
4
4
  export default class kraken extends krakenRest {
5
5
  describe(): any;
@@ -17,8 +17,11 @@ export default class kraken extends krakenRest {
17
17
  requestId(): any;
18
18
  watchPublic(name: any, symbol: any, params?: {}): Promise<any>;
19
19
  watchTicker(symbol: string, params?: {}): Promise<Ticker>;
20
+ watchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
20
21
  watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
22
+ watchTradesForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
21
23
  watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
24
+ watchOrderBookForSymbols(symbols: string[], limit?: Int, params?: {}): Promise<OrderBook>;
22
25
  watchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
23
26
  loadMarkets(reload?: boolean, params?: {}): Promise<import("../base/types.js").Dictionary<import("../base/types.js").MarketInterface>>;
24
27
  watchHeartbeat(params?: {}): Promise<any>;
@@ -49,6 +52,8 @@ export default class kraken extends krakenRest {
49
52
  watchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
50
53
  handleOrders(client: Client, message: any, subscription?: any): void;
51
54
  parseWsOrder(order: any, market?: any): Order;
55
+ watchMultiHelper(unifiedName: string, channelName: string, symbols?: Strings, subscriptionArgs?: any, params?: {}): Promise<any>;
56
+ getMessageHash(unifiedElementName: string, subChannelName?: Str, symbol?: Str): string;
52
57
  handleSubscriptionStatus(client: Client, message: any): void;
53
58
  handleErrorMessage(client: Client, message: any): boolean;
54
59
  handleMessage(client: Client, message: any): void;