ccxt 4.2.41 → 4.2.42

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/dist/cjs/ccxt.js CHANGED
@@ -177,7 +177,7 @@ var woo$1 = require('./src/pro/woo.js');
177
177
 
178
178
  //-----------------------------------------------------------------------------
179
179
  // this is updated by vss.js when building
180
- const version = '4.2.41';
180
+ const version = '4.2.42';
181
181
  Exchange["default"].ccxtVersion = version;
182
182
  const exchanges = {
183
183
  'ace': ace,
@@ -2418,7 +2418,10 @@ class bitget extends bitget$1 {
2418
2418
  await this.loadMarkets();
2419
2419
  const networkCode = this.safeString2(params, 'chain', 'network');
2420
2420
  params = this.omit(params, 'network');
2421
- const networkId = this.networkCodeToId(networkCode, code);
2421
+ let networkId = undefined;
2422
+ if (networkCode !== undefined) {
2423
+ networkId = this.networkCodeToId(networkCode, code);
2424
+ }
2422
2425
  const currency = this.currency(code);
2423
2426
  const request = {
2424
2427
  'coin': currency['code'],
@@ -2457,11 +2460,15 @@ class bitget extends bitget$1 {
2457
2460
  const currencyId = this.safeString(depositAddress, 'coin');
2458
2461
  const networkId = this.safeString(depositAddress, 'chain');
2459
2462
  const parsedCurrency = this.safeCurrencyCode(currencyId, currency);
2463
+ let network = undefined;
2464
+ if (networkId !== undefined) {
2465
+ network = this.networkIdToCode(networkId, parsedCurrency);
2466
+ }
2460
2467
  return {
2461
2468
  'currency': parsedCurrency,
2462
2469
  'address': this.safeString(depositAddress, 'address'),
2463
2470
  'tag': this.safeString(depositAddress, 'tag'),
2464
- 'network': this.networkIdToCode(networkId, parsedCurrency),
2471
+ 'network': network,
2465
2472
  'info': depositAddress,
2466
2473
  };
2467
2474
  }
@@ -2777,28 +2777,20 @@ class bitrue extends bitrue$1 {
2777
2777
  this.checkAddress(address);
2778
2778
  await this.loadMarkets();
2779
2779
  const currency = this.currency(code);
2780
- let chainName = this.safeString2(params, 'network', 'chainName');
2781
- if (chainName === undefined) {
2782
- const networks = this.safeValue(currency, 'networks', {});
2783
- const optionsNetworks = this.safeValue(this.options, 'networks', {});
2784
- let network = this.safeStringUpper(params, 'network'); // this line allows the user to specify either ERC20 or ETH
2785
- network = this.safeString(optionsNetworks, network, network);
2786
- const networkEntry = this.safeValue(networks, network, {});
2787
- chainName = this.safeString(networkEntry, 'id'); // handle ERC20>ETH alias
2788
- if (chainName === undefined) {
2789
- throw new errors.ArgumentsRequired(this.id + ' withdraw() requires a network parameter or a chainName parameter');
2790
- }
2791
- params = this.omit(params, 'network');
2792
- }
2793
2780
  const request = {
2794
- 'coin': currency['id'].toUpperCase(),
2781
+ 'coin': currency['id'],
2795
2782
  'amount': amount,
2796
2783
  'addressTo': address,
2797
- 'chainName': chainName, // 'ERC20', 'TRC20', 'SOL'
2784
+ // 'chainName': chainName, // 'ERC20', 'TRC20', 'SOL'
2798
2785
  // 'addressMark': '', // mark of address
2799
2786
  // 'addrType': '', // type of address
2800
2787
  // 'tag': tag,
2801
2788
  };
2789
+ let networkCode = undefined;
2790
+ [networkCode, params] = this.handleNetworkCodeAndParams(params);
2791
+ if (networkCode !== undefined) {
2792
+ request['chainName'] = this.networkCodeToId(networkCode);
2793
+ }
2802
2794
  if (tag !== undefined) {
2803
2795
  request['tag'] = tag;
2804
2796
  }
@@ -412,7 +412,10 @@ class digifinex extends digifinex$1 {
412
412
  const minFoundPrecision = Precise["default"].stringMin(feeString, Precise["default"].stringMin(minDepositString, minWithdrawString));
413
413
  const precision = this.parseNumber(minFoundPrecision);
414
414
  const networkId = this.safeString(currency, 'chain');
415
- const networkCode = this.networkIdToCode(networkId);
415
+ let networkCode = undefined;
416
+ if (networkId !== undefined) {
417
+ networkCode = this.networkIdToCode(networkId);
418
+ }
416
419
  const network = {
417
420
  'info': currency,
418
421
  'id': networkId,
@@ -1587,7 +1587,10 @@ class gate extends gate$1 {
1587
1587
  const currency = parts[0];
1588
1588
  const code = this.safeCurrencyCode(currency);
1589
1589
  const networkId = this.safeString(entry, 'chain');
1590
- const networkCode = this.networkIdToCode(networkId, code);
1590
+ let networkCode = undefined;
1591
+ if (networkId !== undefined) {
1592
+ networkCode = this.networkIdToCode(networkId, code);
1593
+ }
1591
1594
  const delisted = this.safeValue(entry, 'delisted');
1592
1595
  const withdrawDisabled = this.safeBool(entry, 'withdraw_disabled', false);
1593
1596
  const depositDisabled = this.safeBool(entry, 'deposit_disabled', false);
@@ -343,7 +343,10 @@ class gemini extends gemini$1 {
343
343
  const precision = this.parseNumber(this.parsePrecision(this.safeString(currency, 5)));
344
344
  const networks = {};
345
345
  const networkId = this.safeString(currency, 9);
346
- const networkCode = this.networkIdToCode(networkId);
346
+ let networkCode = undefined;
347
+ if (networkId !== undefined) {
348
+ networkCode = this.networkIdToCode(networkId);
349
+ }
347
350
  if (networkCode !== undefined) {
348
351
  networks[networkCode] = {
349
352
  'info': currency,
@@ -4326,7 +4326,10 @@ class mexc extends mexc$1 {
4326
4326
  'coin': currency['id'],
4327
4327
  };
4328
4328
  const networkCode = this.safeString(params, 'network');
4329
- const networkId = this.networkCodeToId(networkCode, code);
4329
+ let networkId = undefined;
4330
+ if (networkCode !== undefined) {
4331
+ networkId = this.networkCodeToId(networkCode, code);
4332
+ }
4330
4333
  if (networkId !== undefined) {
4331
4334
  request['network'] = networkId;
4332
4335
  }
@@ -4663,7 +4663,10 @@ class phemex extends phemex$1 {
4663
4663
  const currency = this.currency(code);
4664
4664
  let networkCode = undefined;
4665
4665
  [networkCode, params] = this.handleNetworkCodeAndParams(params);
4666
- let networkId = this.networkCodeToId(networkCode);
4666
+ let networkId = undefined;
4667
+ if (networkCode !== undefined) {
4668
+ networkId = this.networkCodeToId(networkCode);
4669
+ }
4667
4670
  const stableCoins = this.safeValue(this.options, 'stableCoins');
4668
4671
  if (networkId === undefined) {
4669
4672
  if (!(this.inArray(code, stableCoins))) {
@@ -711,7 +711,10 @@ class poloniex extends poloniex$1 {
711
711
  const code = this.safeCurrencyCode(id);
712
712
  const name = this.safeString(currency, 'name');
713
713
  const networkId = this.safeString(currency, 'blockchain');
714
- const networkCode = this.networkIdToCode(networkId, code);
714
+ let networkCode = undefined;
715
+ if (networkId !== undefined) {
716
+ networkCode = this.networkIdToCode(networkId, code);
717
+ }
715
718
  const delisted = this.safeValue(currency, 'delisted');
716
719
  const walletEnabled = this.safeString(currency, 'walletState') === 'ENABLED';
717
720
  const depositEnabled = this.safeString(currency, 'walletDepositState') === 'ENABLED';
@@ -171,7 +171,7 @@ class hitbtc extends hitbtc$1 {
171
171
  await this.loadMarkets();
172
172
  await this.authenticate();
173
173
  const url = this.urls['api']['ws']['private'];
174
- const messageHash = this.nonce();
174
+ const messageHash = this.nonce().toString();
175
175
  const subscribe = {
176
176
  'method': name,
177
177
  'params': params,
@@ -172,7 +172,7 @@ class poloniex extends poloniex$1 {
172
172
  * @returns {object} data from the websocket stream
173
173
  */
174
174
  const url = this.urls['api']['ws']['private'];
175
- const messageHash = this.nonce();
175
+ const messageHash = this.nonce().toString();
176
176
  const subscribe = {
177
177
  'id': messageHash,
178
178
  'event': name,
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, FundingHistory, MarginMode, Greeks } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
7
- declare const version = "4.2.40";
7
+ declare const version = "4.2.41";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.2.41';
41
+ const version = '4.2.42';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -557,14 +557,14 @@ export default class Exchange {
557
557
  countedOrderBook(snapshot?: {}, depth?: number): CountedOrderBook;
558
558
  handleMessage(client: any, message: any): void;
559
559
  ping(client: any): any;
560
- client(url: any): WsClient;
561
- watchMultiple(url: any, messageHashes: any, message?: any, subscribeHashes?: any, subscription?: any): import("./ws/Future.js").FutureInterface;
562
- watch(url: any, messageHash: any, message?: any, subscribeHash?: any, subscription?: any): any;
560
+ client(url: string): WsClient;
561
+ watchMultiple(url: string, messageHashes: string[], message?: any, subscribeHashes?: any, subscription?: any): import("./ws/Future.js").FutureInterface;
562
+ watch(url: string, messageHash: string, message?: any, subscribeHash?: any, subscription?: any): any;
563
563
  onConnected(client: any, message?: any): void;
564
564
  onError(client: any, error: any): void;
565
565
  onClose(client: any, error: any): void;
566
566
  close(): Promise<void>;
567
- loadOrderBook(client: any, messageHash: any, symbol: any, limit?: any, params?: {}): Promise<void>;
567
+ loadOrderBook(client: any, messageHash: string, symbol: string, limit?: Int, params?: {}): Promise<void>;
568
568
  convertToBigInt(value: string): bigint;
569
569
  stringToCharsArray(value: any): any;
570
570
  valueIsDefined(value: any): boolean;
@@ -572,7 +572,7 @@ export default class Exchange {
572
572
  getProperty(obj: any, property: any, defaultValue?: any): any;
573
573
  setProperty(obj: any, property: any, defaultValue?: any): void;
574
574
  axolotl(payload: any, hexKey: any, ed25519: any): string;
575
- fixStringifiedJsonMembers(content: any): any;
575
+ fixStringifiedJsonMembers(content: string): any;
576
576
  safeBoolN(dictionaryOrList: any, keys: IndexType[], defaultValue?: boolean): boolean | undefined;
577
577
  safeBool2(dictionary: any, key1: IndexType, key2: IndexType, defaultValue?: boolean): boolean | undefined;
578
578
  safeBool(dictionary: any, key: IndexType, defaultValue?: boolean): boolean | undefined;
@@ -586,8 +586,8 @@ export default class Exchange {
586
586
  handleDelta(bookside: any, delta: any): void;
587
587
  getCacheIndex(orderbook: any, deltas: any): number;
588
588
  findTimeframe(timeframe: any, timeframes?: any): string;
589
- checkProxyUrlSettings(url?: any, method?: any, headers?: any, body?: any): any;
590
- checkProxySettings(url?: any, method?: any, headers?: any, body?: any): any[];
589
+ checkProxyUrlSettings(url?: string, method?: string, headers?: any, body?: any): any;
590
+ checkProxySettings(url?: string, method?: string, headers?: any, body?: any): any[];
591
591
  checkWsProxySettings(): any[];
592
592
  checkConflictingProxies(proxyAgentSet: any, proxyUrlSet: any): void;
593
593
  findMessageHashes(client: any, element: string): string[];
@@ -718,8 +718,8 @@ export default class Exchange {
718
718
  fetchL2OrderBook(symbol: string, limit?: Int, params?: {}): Promise<any>;
719
719
  filterBySymbol(objects: any, symbol?: string): any;
720
720
  parseOHLCV(ohlcv: any, market?: Market): OHLCV;
721
- networkCodeToId(networkCode: any, currencyCode?: any): string;
722
- networkIdToCode(networkId: any, currencyCode?: any): string;
721
+ networkCodeToId(networkCode: string, currencyCode?: string): string;
722
+ networkIdToCode(networkId: string, currencyCode?: string): string;
723
723
  handleNetworkCodeAndParams(params: any): any[];
724
724
  defaultNetworkCode(currencyCode: string): any;
725
725
  selectNetworkCodeFromUnifiedNetworks(currencyCode: any, networkCode: any, indexedNetworkEntries: any): any;
@@ -728,14 +728,14 @@ export default class Exchange {
728
728
  safeNumber2(dictionary: object, key1: IndexType, key2: IndexType, d?: any): number;
729
729
  parseOrderBook(orderbook: object, symbol: string, timestamp?: Int, bidsKey?: string, asksKey?: string, priceKey?: IndexType, amountKey?: IndexType, countOrIdKey?: IndexType): OrderBook;
730
730
  parseOHLCVs(ohlcvs: object[], market?: any, timeframe?: string, since?: Int, limit?: Int): OHLCV[];
731
- parseLeverageTiers(response: any, symbols?: string[], marketIdKey?: any): {};
731
+ parseLeverageTiers(response: object[], symbols?: string[], marketIdKey?: any): {};
732
732
  loadTradingLimits(symbols?: string[], reload?: boolean, params?: {}): Promise<Dictionary<any>>;
733
733
  safePosition(position: any): Position;
734
- parsePositions(positions: any, symbols?: string[], params?: {}): Position[];
735
- parseAccounts(accounts: any, params?: {}): any[];
736
- parseTrades(trades: any, market?: Market, since?: Int, limit?: Int, params?: {}): Trade[];
737
- parseTransactions(transactions: any, currency?: Currency, since?: Int, limit?: Int, params?: {}): Transaction[];
738
- parseTransfers(transfers: any, currency?: Currency, since?: Int, limit?: Int, params?: {}): any;
734
+ parsePositions(positions: any[], symbols?: string[], params?: {}): Position[];
735
+ parseAccounts(accounts: any[], params?: {}): any[];
736
+ parseTrades(trades: any[], market?: Market, since?: Int, limit?: Int, params?: {}): Trade[];
737
+ parseTransactions(transactions: any[], currency?: Currency, since?: Int, limit?: Int, params?: {}): Transaction[];
738
+ parseTransfers(transfers: any[], currency?: Currency, since?: Int, limit?: Int, params?: {}): any;
739
739
  parseLedger(data: any, currency?: Currency, since?: Int, limit?: Int, params?: {}): any;
740
740
  nonce(): number;
741
741
  setHeaders(headers: any): any;
@@ -748,9 +748,9 @@ export default class Exchange {
748
748
  loadAccounts(reload?: boolean, params?: {}): Promise<any>;
749
749
  buildOHLCVC(trades: Trade[], timeframe?: string, since?: number, limit?: number): OHLCVC[];
750
750
  parseTradingViewOHLCV(ohlcvs: any, market?: any, timeframe?: string, since?: Int, limit?: Int): OHLCV[];
751
- editLimitBuyOrder(id: any, symbol: any, amount: number, price?: number, params?: {}): Promise<Order>;
752
- editLimitSellOrder(id: any, symbol: any, amount: number, price?: number, params?: {}): Promise<Order>;
753
- editLimitOrder(id: any, symbol: any, side: any, amount: number, price?: number, params?: {}): Promise<Order>;
751
+ editLimitBuyOrder(id: string, symbol: string, amount: number, price?: number, params?: {}): Promise<Order>;
752
+ editLimitSellOrder(id: string, symbol: string, amount: number, price?: number, params?: {}): Promise<Order>;
753
+ editLimitOrder(id: string, symbol: string, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
754
754
  editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: number, price?: number, params?: {}): Promise<Order>;
755
755
  editOrderWs(id: string, symbol: string, type: OrderType, side: OrderSide, amount: number, price?: number, params?: {}): Promise<Order>;
756
756
  fetchPermissions(params?: {}): Promise<{}>;
@@ -912,7 +912,7 @@ export default class Exchange {
912
912
  fetchPremiumIndexOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
913
913
  handleTimeInForce(params?: {}): string;
914
914
  convertTypeToAccount(account: any): any;
915
- checkRequiredArgument(methodName: any, argument: any, argumentName: any, options?: any[]): void;
915
+ checkRequiredArgument(methodName: string, argument: any, argumentName: any, options?: any[]): void;
916
916
  checkRequiredMarginArgument(methodName: string, symbol: Str, marginMode: string): void;
917
917
  parseDepositWithdrawFees(response: any, codes?: string[], currencyIdKey?: any): any;
918
918
  parseDepositWithdrawFee(fee: any, currency?: Currency): any;
@@ -934,7 +934,7 @@ export default class Exchange {
934
934
  fetchPaginatedCallIncremental(method: string, symbol?: string, since?: any, limit?: any, params?: {}, pageKey?: any, maxEntriesPerRequest?: any): Promise<any>;
935
935
  sortCursorPaginatedResult(result: any): any;
936
936
  removeRepeatedElementsFromArray(input: any): any;
937
- handleUntilOption(key: any, request: any, params: any, multiplier?: number): any[];
937
+ handleUntilOption(key: string, request: any, params: any, multiplier?: number): any[];
938
938
  safeOpenInterest(interest: any, market?: Market): OpenInterest;
939
939
  parseLiquidation(liquidation: any, market?: Market): Liquidation;
940
940
  parseLiquidations(liquidations: any, market?: any, since?: Int, limit?: Int): Liquidation[];
@@ -25,14 +25,14 @@ export default class bitget extends Exchange {
25
25
  currency: string;
26
26
  address: string;
27
27
  tag: string;
28
- network: string;
28
+ network: any;
29
29
  info: any;
30
30
  }>;
31
31
  parseDepositAddress(depositAddress: any, currency?: Currency): {
32
32
  currency: string;
33
33
  address: string;
34
34
  tag: string;
35
- network: string;
35
+ network: any;
36
36
  info: any;
37
37
  };
38
38
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
package/js/src/bitget.js CHANGED
@@ -2421,7 +2421,10 @@ export default class bitget extends Exchange {
2421
2421
  await this.loadMarkets();
2422
2422
  const networkCode = this.safeString2(params, 'chain', 'network');
2423
2423
  params = this.omit(params, 'network');
2424
- const networkId = this.networkCodeToId(networkCode, code);
2424
+ let networkId = undefined;
2425
+ if (networkCode !== undefined) {
2426
+ networkId = this.networkCodeToId(networkCode, code);
2427
+ }
2425
2428
  const currency = this.currency(code);
2426
2429
  const request = {
2427
2430
  'coin': currency['code'],
@@ -2460,11 +2463,15 @@ export default class bitget extends Exchange {
2460
2463
  const currencyId = this.safeString(depositAddress, 'coin');
2461
2464
  const networkId = this.safeString(depositAddress, 'chain');
2462
2465
  const parsedCurrency = this.safeCurrencyCode(currencyId, currency);
2466
+ let network = undefined;
2467
+ if (networkId !== undefined) {
2468
+ network = this.networkIdToCode(networkId, parsedCurrency);
2469
+ }
2463
2470
  return {
2464
2471
  'currency': parsedCurrency,
2465
2472
  'address': this.safeString(depositAddress, 'address'),
2466
2473
  'tag': this.safeString(depositAddress, 'tag'),
2467
- 'network': this.networkIdToCode(networkId, parsedCurrency),
2474
+ 'network': network,
2468
2475
  'info': depositAddress,
2469
2476
  };
2470
2477
  }
package/js/src/bitrue.js CHANGED
@@ -2780,28 +2780,20 @@ export default class bitrue extends Exchange {
2780
2780
  this.checkAddress(address);
2781
2781
  await this.loadMarkets();
2782
2782
  const currency = this.currency(code);
2783
- let chainName = this.safeString2(params, 'network', 'chainName');
2784
- if (chainName === undefined) {
2785
- const networks = this.safeValue(currency, 'networks', {});
2786
- const optionsNetworks = this.safeValue(this.options, 'networks', {});
2787
- let network = this.safeStringUpper(params, 'network'); // this line allows the user to specify either ERC20 or ETH
2788
- network = this.safeString(optionsNetworks, network, network);
2789
- const networkEntry = this.safeValue(networks, network, {});
2790
- chainName = this.safeString(networkEntry, 'id'); // handle ERC20>ETH alias
2791
- if (chainName === undefined) {
2792
- throw new ArgumentsRequired(this.id + ' withdraw() requires a network parameter or a chainName parameter');
2793
- }
2794
- params = this.omit(params, 'network');
2795
- }
2796
2783
  const request = {
2797
- 'coin': currency['id'].toUpperCase(),
2784
+ 'coin': currency['id'],
2798
2785
  'amount': amount,
2799
2786
  'addressTo': address,
2800
- 'chainName': chainName, // 'ERC20', 'TRC20', 'SOL'
2787
+ // 'chainName': chainName, // 'ERC20', 'TRC20', 'SOL'
2801
2788
  // 'addressMark': '', // mark of address
2802
2789
  // 'addrType': '', // type of address
2803
2790
  // 'tag': tag,
2804
2791
  };
2792
+ let networkCode = undefined;
2793
+ [networkCode, params] = this.handleNetworkCodeAndParams(params);
2794
+ if (networkCode !== undefined) {
2795
+ request['chainName'] = this.networkCodeToId(networkCode);
2796
+ }
2805
2797
  if (tag !== undefined) {
2806
2798
  request['tag'] = tag;
2807
2799
  }
@@ -415,7 +415,10 @@ export default class digifinex extends Exchange {
415
415
  const minFoundPrecision = Precise.stringMin(feeString, Precise.stringMin(minDepositString, minWithdrawString));
416
416
  const precision = this.parseNumber(minFoundPrecision);
417
417
  const networkId = this.safeString(currency, 'chain');
418
- const networkCode = this.networkIdToCode(networkId);
418
+ let networkCode = undefined;
419
+ if (networkId !== undefined) {
420
+ networkCode = this.networkIdToCode(networkId);
421
+ }
419
422
  const network = {
420
423
  'info': currency,
421
424
  'id': networkId,
package/js/src/gate.js CHANGED
@@ -1590,7 +1590,10 @@ export default class gate extends Exchange {
1590
1590
  const currency = parts[0];
1591
1591
  const code = this.safeCurrencyCode(currency);
1592
1592
  const networkId = this.safeString(entry, 'chain');
1593
- const networkCode = this.networkIdToCode(networkId, code);
1593
+ let networkCode = undefined;
1594
+ if (networkId !== undefined) {
1595
+ networkCode = this.networkIdToCode(networkId, code);
1596
+ }
1594
1597
  const delisted = this.safeValue(entry, 'delisted');
1595
1598
  const withdrawDisabled = this.safeBool(entry, 'withdraw_disabled', false);
1596
1599
  const depositDisabled = this.safeBool(entry, 'deposit_disabled', false);
package/js/src/gemini.js CHANGED
@@ -346,7 +346,10 @@ export default class gemini extends Exchange {
346
346
  const precision = this.parseNumber(this.parsePrecision(this.safeString(currency, 5)));
347
347
  const networks = {};
348
348
  const networkId = this.safeString(currency, 9);
349
- const networkCode = this.networkIdToCode(networkId);
349
+ let networkCode = undefined;
350
+ if (networkId !== undefined) {
351
+ networkCode = this.networkIdToCode(networkId);
352
+ }
350
353
  if (networkCode !== undefined) {
351
354
  networks[networkCode] = {
352
355
  'info': currency,
package/js/src/mexc.js CHANGED
@@ -4330,7 +4330,10 @@ export default class mexc extends Exchange {
4330
4330
  'coin': currency['id'],
4331
4331
  };
4332
4332
  const networkCode = this.safeString(params, 'network');
4333
- const networkId = this.networkCodeToId(networkCode, code);
4333
+ let networkId = undefined;
4334
+ if (networkCode !== undefined) {
4335
+ networkId = this.networkCodeToId(networkCode, code);
4336
+ }
4334
4337
  if (networkId !== undefined) {
4335
4338
  request['network'] = networkId;
4336
4339
  }
package/js/src/phemex.js CHANGED
@@ -4666,7 +4666,10 @@ export default class phemex extends Exchange {
4666
4666
  const currency = this.currency(code);
4667
4667
  let networkCode = undefined;
4668
4668
  [networkCode, params] = this.handleNetworkCodeAndParams(params);
4669
- let networkId = this.networkCodeToId(networkCode);
4669
+ let networkId = undefined;
4670
+ if (networkCode !== undefined) {
4671
+ networkId = this.networkCodeToId(networkCode);
4672
+ }
4670
4673
  const stableCoins = this.safeValue(this.options, 'stableCoins');
4671
4674
  if (networkId === undefined) {
4672
4675
  if (!(this.inArray(code, stableCoins))) {
@@ -714,7 +714,10 @@ export default class poloniex extends Exchange {
714
714
  const code = this.safeCurrencyCode(id);
715
715
  const name = this.safeString(currency, 'name');
716
716
  const networkId = this.safeString(currency, 'blockchain');
717
- const networkCode = this.networkIdToCode(networkId, code);
717
+ let networkCode = undefined;
718
+ if (networkId !== undefined) {
719
+ networkCode = this.networkIdToCode(networkId, code);
720
+ }
718
721
  const delisted = this.safeValue(currency, 'delisted');
719
722
  const walletEnabled = this.safeString(currency, 'walletState') === 'ENABLED';
720
723
  const depositEnabled = this.safeString(currency, 'walletDepositState') === 'ENABLED';
@@ -174,7 +174,7 @@ export default class hitbtc extends hitbtcRest {
174
174
  await this.loadMarkets();
175
175
  await this.authenticate();
176
176
  const url = this.urls['api']['ws']['private'];
177
- const messageHash = this.nonce();
177
+ const messageHash = this.nonce().toString();
178
178
  const subscribe = {
179
179
  'method': name,
180
180
  'params': params,
@@ -175,7 +175,7 @@ export default class poloniex extends poloniexRest {
175
175
  * @returns {object} data from the websocket stream
176
176
  */
177
177
  const url = this.urls['api']['ws']['private'];
178
- const messageHash = this.nonce();
178
+ const messageHash = this.nonce().toString();
179
179
  const subscribe = {
180
180
  'id': messageHash,
181
181
  'event': name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.2.41",
3
+ "version": "4.2.42",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.js",
6
6
  "type": "module",