starknet 10.6.3 → 10.6.5

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
@@ -572,7 +572,8 @@ var SYSTEM_MESSAGES = {
572
572
  unsupportedMethodForRpcVersion: "Unsupported method for RPC version",
573
573
  txEvictedFromMempool: "Transaction TTL, evicted from the mempool, try to increase the tip",
574
574
  consensusFailed: "Consensus failed to finalize the block proposal",
575
- txFailsBlockBuildingValidation: "Transaction fails block building validation"
575
+ txFailsBlockBuildingValidation: "Transaction fails block building validation",
576
+ snip36RequiresRPC010: "SNIP-36 `proof` and `proofFacts` are not supported by RPC 0.9, connect to a RPC 0.10.1+ node!"
576
577
  };
577
578
  var SN_VERSION_IMPLEMENTING_BLAKE_FOR_COMPILED_CLASS = "0.14.1";
578
579
 
@@ -6728,6 +6729,10 @@ var RpcChannel = class {
6728
6729
  versionType !== "transaction" || isRPC08Plus_ResourceBoundsBN(invocation.resourceBounds),
6729
6730
  SYSTEM_MESSAGES.SWOldV3
6730
6731
  );
6732
+ assert(
6733
+ !invocation.proofFacts?.length && !invocation.proof,
6734
+ SYSTEM_MESSAGES.snip36RequiresRPC010
6735
+ );
6731
6736
  const details = {
6732
6737
  signature: signatureToHexArray(invocation.signature),
6733
6738
  nonce: toHex(invocation.nonce),
@@ -7609,7 +7614,7 @@ var WebSocketChannel = class {
7609
7614
  this.websocket.addEventListener("error", this.errorListener);
7610
7615
  }
7611
7616
  idResolver(id) {
7612
- if (id) return id;
7617
+ if (id !== void 0) return id;
7613
7618
  return this.sendId++;
7614
7619
  }
7615
7620
  /**
@@ -7667,7 +7672,15 @@ var WebSocketChannel = class {
7667
7672
  logger.warn("WebSocket received non-string message data:", event.data);
7668
7673
  return;
7669
7674
  }
7670
- const message = JSON.parse(event.data);
7675
+ let message;
7676
+ try {
7677
+ message = JSON.parse(event.data);
7678
+ } catch (error) {
7679
+ logger.error(
7680
+ `WebSocketChannel: Error parsing incoming message: ${event.data}, Error: ${error}`
7681
+ );
7682
+ return;
7683
+ }
7671
7684
  if (message.id === sendId) {
7672
7685
  clearTimeout(timeoutId);
7673
7686
  this.websocket.removeEventListener("message", messageHandler);