starknet 11.10.3 → 11.10.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.mjs CHANGED
@@ -12589,10 +12589,13 @@ var Block = class {
12589
12589
  */
12590
12590
  tag = null;
12591
12591
  setIdentifier(__identifier) {
12592
+ this.hash = null;
12593
+ this.number = null;
12594
+ this.tag = null;
12592
12595
  if (isString(__identifier)) {
12593
- if (isDecimalString2(__identifier)) {
12596
+ if (__identifier !== "" && isDecimalString2(__identifier)) {
12594
12597
  this.number = parseInt(__identifier, 10);
12595
- } else if (isHex(__identifier)) {
12598
+ } else if (isHex(__identifier) && !isEmptyHex(__identifier)) {
12596
12599
  this.hash = __identifier;
12597
12600
  } else if (validBlockTags.includes(__identifier)) {
12598
12601
  this.tag = __identifier;
@@ -12609,6 +12612,11 @@ var Block = class {
12609
12612
  if (isNumber(this.number) && this.number < 0) {
12610
12613
  throw TypeError(`Block number (${this.number}) can't be negative`);
12611
12614
  }
12615
+ if (isNumber(this.number) && !Number.isSafeInteger(this.number)) {
12616
+ throw TypeError(
12617
+ `Block number (${__identifier}) must be a whole number no larger than Number.MAX_SAFE_INTEGER`
12618
+ );
12619
+ }
12612
12620
  }
12613
12621
  /**
12614
12622
  * Create a Block instance
@@ -18845,8 +18853,9 @@ function validateAndParseAddress(address) {
18845
18853
  return result;
18846
18854
  }
18847
18855
  function getChecksumAddress(address) {
18848
- const chars = removeHexPrefix(validateAndParseAddress(address)).toLowerCase().split("");
18849
- const hex = removeHexPrefix(keccakBn(address));
18856
+ const parsedAddress = validateAndParseAddress(address);
18857
+ const chars = removeHexPrefix(parsedAddress).toLowerCase().split("");
18858
+ const hex = removeHexPrefix(keccakBn(parsedAddress));
18850
18859
  const hashed = hexToBytes2(hex.padStart(64, "0"));
18851
18860
  for (let i = 0; i < chars.length; i += 2) {
18852
18861
  if (hashed[i >> 1] >> 4 >= 8) {