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.mjs CHANGED
@@ -319,8 +319,8 @@ var DEFAULT_GLOBAL_CONFIG = {
319
319
  blake: void 0
320
320
  };
321
321
  var RPC_DEFAULT_NODES = {
322
- SN_MAIN: [`https://starknet-mainnet.public.blastapi.io/rpc/`],
323
- SN_SEPOLIA: [`https://starknet-sepolia.public.blastapi.io/rpc/`]
322
+ SN_MAIN: [`https://starknet-mainnet.g.alchemy.com/starknet/version/rpc`],
323
+ SN_SEPOLIA: [`https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/`]
324
324
  };
325
325
  var PAYMASTER_RPC_NODES = {
326
326
  SN_MAIN: [`https://starknet.paymaster.avnu.fi`],
@@ -5544,6 +5544,12 @@ function getDefaultNodes(rpcVersion) {
5544
5544
  const nodes = { ...RPC_DEFAULT_NODES };
5545
5545
  Object.keys(nodes).forEach(function(key, _) {
5546
5546
  nodes[key] = nodes[key].map((it) => {
5547
+ if (it === "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/") {
5548
+ return `${it}${toApiVersion(rpcVersion)}/uYLxCteYbHTFJpKSoKdVm`;
5549
+ }
5550
+ if (it === "https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/") {
5551
+ return `${it}${toApiVersion(rpcVersion)}/uYLxCteYbHTFJpKSoKdVm`;
5552
+ }
5547
5553
  return `${it}${toApiVersion(rpcVersion)}`;
5548
5554
  });
5549
5555
  });
@@ -7070,7 +7076,8 @@ var WebSocketChannel = class {
7070
7076
  this.autoReconnect = options.autoReconnect ?? true;
7071
7077
  this.reconnectOptions = {
7072
7078
  retries: options.reconnectOptions?.retries ?? 5,
7073
- delay: options.reconnectOptions?.delay ?? 2e3
7079
+ delay: options.reconnectOptions?.delay ?? 2e3,
7080
+ exponential: options.reconnectOptions?.exponential ?? true
7074
7081
  };
7075
7082
  this.requestTimeout = options.requestTimeout ?? 6e4;
7076
7083
  this.WsImplementation = options.websocket || config.get("websocket") || ws_default;
@@ -7331,7 +7338,7 @@ var WebSocketChannel = class {
7331
7338
  this.events.emit("open", new Event("open"));
7332
7339
  };
7333
7340
  this.websocket.onerror = () => {
7334
- const delay = this.reconnectOptions.delay * 2 ** (this.reconnectAttempts - 1);
7341
+ const delay = this.reconnectOptions.exponential ? this.reconnectOptions.delay * 2 ** (this.reconnectAttempts - 1) : this.reconnectOptions.delay;
7335
7342
  logger.info(`WebSocket: Reconnect attempt failed. Retrying in ${delay}ms.`);
7336
7343
  this.reconnectTimeoutId = setTimeout(tryReconnect, delay);
7337
7344
  };