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.js CHANGED
@@ -12800,10 +12800,13 @@ var Block = class {
12800
12800
  */
12801
12801
  tag = null;
12802
12802
  setIdentifier(__identifier) {
12803
+ this.hash = null;
12804
+ this.number = null;
12805
+ this.tag = null;
12803
12806
  if (isString(__identifier)) {
12804
- if (isDecimalString2(__identifier)) {
12807
+ if (__identifier !== "" && isDecimalString2(__identifier)) {
12805
12808
  this.number = parseInt(__identifier, 10);
12806
- } else if (isHex(__identifier)) {
12809
+ } else if (isHex(__identifier) && !isEmptyHex(__identifier)) {
12807
12810
  this.hash = __identifier;
12808
12811
  } else if (validBlockTags.includes(__identifier)) {
12809
12812
  this.tag = __identifier;
@@ -12820,6 +12823,11 @@ var Block = class {
12820
12823
  if (isNumber(this.number) && this.number < 0) {
12821
12824
  throw TypeError(`Block number (${this.number}) can't be negative`);
12822
12825
  }
12826
+ if (isNumber(this.number) && !Number.isSafeInteger(this.number)) {
12827
+ throw TypeError(
12828
+ `Block number (${__identifier}) must be a whole number no larger than Number.MAX_SAFE_INTEGER`
12829
+ );
12830
+ }
12823
12831
  }
12824
12832
  /**
12825
12833
  * Create a Block instance
@@ -19056,8 +19064,9 @@ function validateAndParseAddress(address) {
19056
19064
  return result;
19057
19065
  }
19058
19066
  function getChecksumAddress(address) {
19059
- const chars = removeHexPrefix(validateAndParseAddress(address)).toLowerCase().split("");
19060
- const hex = removeHexPrefix(keccakBn(address));
19067
+ const parsedAddress = validateAndParseAddress(address);
19068
+ const chars = removeHexPrefix(parsedAddress).toLowerCase().split("");
19069
+ const hex = removeHexPrefix(keccakBn(parsedAddress));
19061
19070
  const hashed = (0, import_utils7.hexToBytes)(hex.padStart(64, "0"));
19062
19071
  for (let i = 0; i < chars.length; i += 2) {
19063
19072
  if (hashed[i >> 1] >> 4 >= 8) {