starknet 8.6.0 → 8.7.0

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/index.js CHANGED
@@ -494,8 +494,8 @@ var DEFAULT_GLOBAL_CONFIG = {
494
494
  blake: void 0
495
495
  };
496
496
  var RPC_DEFAULT_NODES = {
497
- SN_MAIN: [`https://starknet-mainnet.public.blastapi.io/rpc/`],
498
- SN_SEPOLIA: [`https://starknet-sepolia.public.blastapi.io/rpc/`]
497
+ SN_MAIN: [`https://starknet-mainnet.g.alchemy.com/starknet/version/rpc`],
498
+ SN_SEPOLIA: [`https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/`]
499
499
  };
500
500
  var PAYMASTER_RPC_NODES = {
501
501
  SN_MAIN: [`https://starknet.paymaster.avnu.fi`],
@@ -5719,6 +5719,12 @@ function getDefaultNodes(rpcVersion) {
5719
5719
  const nodes = { ...RPC_DEFAULT_NODES };
5720
5720
  Object.keys(nodes).forEach(function(key, _) {
5721
5721
  nodes[key] = nodes[key].map((it) => {
5722
+ if (it === "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/") {
5723
+ return `${it}${toApiVersion(rpcVersion)}/uYLxCteYbHTFJpKSoKdVm`;
5724
+ }
5725
+ if (it === "https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/") {
5726
+ return `${it}${toApiVersion(rpcVersion)}/uYLxCteYbHTFJpKSoKdVm`;
5727
+ }
5722
5728
  return `${it}${toApiVersion(rpcVersion)}`;
5723
5729
  });
5724
5730
  });
@@ -7245,7 +7251,8 @@ var WebSocketChannel = class {
7245
7251
  this.autoReconnect = options.autoReconnect ?? true;
7246
7252
  this.reconnectOptions = {
7247
7253
  retries: options.reconnectOptions?.retries ?? 5,
7248
- delay: options.reconnectOptions?.delay ?? 2e3
7254
+ delay: options.reconnectOptions?.delay ?? 2e3,
7255
+ exponential: options.reconnectOptions?.exponential ?? true
7249
7256
  };
7250
7257
  this.requestTimeout = options.requestTimeout ?? 6e4;
7251
7258
  this.WsImplementation = options.websocket || config.get("websocket") || ws_default;
@@ -7506,7 +7513,7 @@ var WebSocketChannel = class {
7506
7513
  this.events.emit("open", new Event("open"));
7507
7514
  };
7508
7515
  this.websocket.onerror = () => {
7509
- const delay = this.reconnectOptions.delay * 2 ** (this.reconnectAttempts - 1);
7516
+ const delay = this.reconnectOptions.exponential ? this.reconnectOptions.delay * 2 ** (this.reconnectAttempts - 1) : this.reconnectOptions.delay;
7510
7517
  logger.info(`WebSocket: Reconnect attempt failed. Retrying in ${delay}ms.`);
7511
7518
  this.reconnectTimeoutId = setTimeout(tryReconnect, delay);
7512
7519
  };