starknet 6.1.2 → 6.1.3

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.
@@ -6,13 +6,12 @@ var starknet = (() => {
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __getProtoOf = Object.getPrototypeOf;
8
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
10
9
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
11
10
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
12
11
  }) : x)(function(x) {
13
12
  if (typeof require !== "undefined")
14
13
  return require.apply(this, arguments);
15
- throw new Error('Dynamic require of "' + x + '" is not supported');
14
+ throw Error('Dynamic require of "' + x + '" is not supported');
16
15
  });
17
16
  var __esm = (fn, res) => function __init() {
18
17
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
@@ -41,10 +40,6 @@ var starknet = (() => {
41
40
  mod2
42
41
  ));
43
42
  var __toCommonJS = (mod2) => __copyProps(__defProp({}, "__esModule", { value: true }), mod2);
44
- var __publicField = (obj, key, value) => {
45
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
46
- return value;
47
- };
48
43
 
49
44
  // node_modules/punycode/punycode.es6.js
50
45
  var punycode_es6_exports = {};
@@ -10419,6 +10414,7 @@ var starknet = (() => {
10419
10414
  // node_modules/tough-cookie/lib/utilHelper.js
10420
10415
  var require_utilHelper = __commonJS({
10421
10416
  "node_modules/tough-cookie/lib/utilHelper.js"(exports) {
10417
+ "use strict";
10422
10418
  function requireUtil() {
10423
10419
  try {
10424
10420
  return __require("util");
@@ -10706,6 +10702,7 @@ var starknet = (() => {
10706
10702
  // node_modules/tough-cookie/lib/version.js
10707
10703
  var require_version = __commonJS({
10708
10704
  "node_modules/tough-cookie/lib/version.js"(exports, module) {
10705
+ "use strict";
10709
10706
  module.exports = "4.1.3";
10710
10707
  }
10711
10708
  });
@@ -11180,7 +11177,7 @@ var starknet = (() => {
11180
11177
  lastAccessed: null,
11181
11178
  sameSite: void 0
11182
11179
  };
11183
- var Cookie = class {
11180
+ var Cookie = class _Cookie {
11184
11181
  constructor(options = {}) {
11185
11182
  const customInspectSymbol = getCustomInspectSymbol();
11186
11183
  if (customInspectSymbol) {
@@ -11193,7 +11190,7 @@ var starknet = (() => {
11193
11190
  enumerable: false,
11194
11191
  // important for assert.deepEqual checks
11195
11192
  writable: true,
11196
- value: ++Cookie.cookiesCreated
11193
+ value: ++_Cookie.cookiesCreated
11197
11194
  });
11198
11195
  }
11199
11196
  inspect() {
@@ -11205,7 +11202,7 @@ var starknet = (() => {
11205
11202
  }
11206
11203
  toJSON() {
11207
11204
  const obj = {};
11208
- for (const prop of Cookie.serializableProperties) {
11205
+ for (const prop of _Cookie.serializableProperties) {
11209
11206
  if (this[prop] === cookieDefaults[prop]) {
11210
11207
  continue;
11211
11208
  }
@@ -11305,7 +11302,7 @@ var starknet = (() => {
11305
11302
  str += "; HttpOnly";
11306
11303
  }
11307
11304
  if (this.sameSite && this.sameSite !== "none") {
11308
- const ssCanon = Cookie.sameSiteCanonical[this.sameSite.toLowerCase()];
11305
+ const ssCanon = _Cookie.sameSiteCanonical[this.sameSite.toLowerCase()];
11309
11306
  str += `; SameSite=${ssCanon ? ssCanon : this.sameSite}`;
11310
11307
  }
11311
11308
  if (this.extensions) {
@@ -11400,7 +11397,7 @@ var starknet = (() => {
11400
11397
  }
11401
11398
  return PrefixSecurityEnum.SILENT;
11402
11399
  }
11403
- var CookieJar2 = class {
11400
+ var CookieJar2 = class _CookieJar {
11404
11401
  constructor(store, options = { rejectPublicSuffixes: true }) {
11405
11402
  if (typeof options === "boolean") {
11406
11403
  options = { rejectPublicSuffixes: options };
@@ -11746,7 +11743,7 @@ var starknet = (() => {
11746
11743
  if (err2) {
11747
11744
  return cb(err2);
11748
11745
  }
11749
- CookieJar2.deserialize(serialized, newStore, cb);
11746
+ _CookieJar.deserialize(serialized, newStore, cb);
11750
11747
  });
11751
11748
  }
11752
11749
  cloneSync(newStore) {
@@ -11809,7 +11806,7 @@ var starknet = (() => {
11809
11806
  } else {
11810
11807
  serialized = strOrObj;
11811
11808
  }
11812
- const jar = new CookieJar2(store, {
11809
+ const jar = new _CookieJar(store, {
11813
11810
  rejectPublicSuffixes: serialized.rejectPublicSuffixes,
11814
11811
  looseMode: serialized.enableLooseMode,
11815
11812
  allowSpecialUseDomain: serialized.allowSpecialUseDomain,
@@ -11824,7 +11821,7 @@ var starknet = (() => {
11824
11821
  }
11825
11822
  static deserializeSync(strOrObj, store) {
11826
11823
  const serialized = typeof strOrObj === "string" ? JSON.parse(strOrObj) : strOrObj;
11827
- const jar = new CookieJar2(store, {
11824
+ const jar = new _CookieJar(store, {
11828
11825
  rejectPublicSuffixes: serialized.rejectPublicSuffixes,
11829
11826
  looseMode: serialized.enableLooseMode
11830
11827
  });
@@ -12463,6 +12460,7 @@ var starknet = (() => {
12463
12460
  var g, support, viewClasses, isArrayBufferView, methods, redirectStatuses, DOMException;
12464
12461
  var init_fetch = __esm({
12465
12462
  "node_modules/whatwg-fetch/fetch.js"() {
12463
+ "use strict";
12466
12464
  g = typeof globalThis !== "undefined" && globalThis || typeof self !== "undefined" && self || // eslint-disable-next-line no-undef
12467
12465
  typeof global !== "undefined" && global || {};
12468
12466
  support = {
@@ -12599,6 +12597,7 @@ var starknet = (() => {
12599
12597
  // node_modules/isomorphic-fetch/fetch-npm-browserify.js
12600
12598
  var require_fetch_npm_browserify = __commonJS({
12601
12599
  "node_modules/isomorphic-fetch/fetch-npm-browserify.js"(exports, module) {
12600
+ "use strict";
12602
12601
  init_fetch();
12603
12602
  module.exports = self.fetch.bind(self);
12604
12603
  }
@@ -12607,6 +12606,7 @@ var starknet = (() => {
12607
12606
  // node_modules/url-join/lib/url-join.js
12608
12607
  var require_url_join = __commonJS({
12609
12608
  "node_modules/url-join/lib/url-join.js"(exports, module) {
12609
+ "use strict";
12610
12610
  (function(name, context, definition) {
12611
12611
  if (typeof module !== "undefined" && module.exports)
12612
12612
  module.exports = definition();
@@ -12615,7 +12615,7 @@ var starknet = (() => {
12615
12615
  else
12616
12616
  context[name] = definition();
12617
12617
  })("urljoin", exports, function() {
12618
- function normalize2(strArray) {
12618
+ function normalize(strArray) {
12619
12619
  var resultArray = [];
12620
12620
  if (strArray.length === 0) {
12621
12621
  return "";
@@ -12663,7 +12663,7 @@ var starknet = (() => {
12663
12663
  } else {
12664
12664
  input = [].slice.call(arguments);
12665
12665
  }
12666
- return normalize2(input);
12666
+ return normalize(input);
12667
12667
  };
12668
12668
  });
12669
12669
  }
@@ -12887,6 +12887,7 @@ var starknet = (() => {
12887
12887
  });
12888
12888
 
12889
12889
  // node_modules/@scure/base/lib/esm/index.js
12890
+ // @__NO_SIDE_EFFECTS__
12890
12891
  function assertNumber(n) {
12891
12892
  if (!Number.isSafeInteger(n))
12892
12893
  throw new Error(`Wrong integer: ${n}`);
@@ -12894,6 +12895,7 @@ var starknet = (() => {
12894
12895
  function isBytes(a) {
12895
12896
  return a instanceof Uint8Array || a != null && typeof a === "object" && a.constructor.name === "Uint8Array";
12896
12897
  }
12898
+ // @__NO_SIDE_EFFECTS__
12897
12899
  function chain(...args) {
12898
12900
  const id = (a) => a;
12899
12901
  const wrap = (a, b) => (c) => a(b(c));
@@ -12901,13 +12903,14 @@ var starknet = (() => {
12901
12903
  const decode3 = args.map((x) => x.decode).reduce(wrap, id);
12902
12904
  return { encode: encode2, decode: decode3 };
12903
12905
  }
12906
+ // @__NO_SIDE_EFFECTS__
12904
12907
  function alphabet(alphabet2) {
12905
12908
  return {
12906
12909
  encode: (digits) => {
12907
12910
  if (!Array.isArray(digits) || digits.length && typeof digits[0] !== "number")
12908
12911
  throw new Error("alphabet.encode input should be an array of numbers");
12909
12912
  return digits.map((i) => {
12910
- assertNumber(i);
12913
+ /* @__PURE__ */ assertNumber(i);
12911
12914
  if (i < 0 || i >= alphabet2.length)
12912
12915
  throw new Error(`Digit index outside alphabet: ${i} (alphabet: ${alphabet2.length})`);
12913
12916
  return alphabet2[i];
@@ -12927,6 +12930,7 @@ var starknet = (() => {
12927
12930
  }
12928
12931
  };
12929
12932
  }
12933
+ // @__NO_SIDE_EFFECTS__
12930
12934
  function join(separator = "") {
12931
12935
  if (typeof separator !== "string")
12932
12936
  throw new Error("join separator should be string");
@@ -12946,8 +12950,9 @@ var starknet = (() => {
12946
12950
  }
12947
12951
  };
12948
12952
  }
12953
+ // @__NO_SIDE_EFFECTS__
12949
12954
  function padding(bits, chr = "=") {
12950
- assertNumber(bits);
12955
+ /* @__PURE__ */ assertNumber(bits);
12951
12956
  if (typeof chr !== "string")
12952
12957
  throw new Error("padding chr should be string");
12953
12958
  return {
@@ -12978,19 +12983,9 @@ var starknet = (() => {
12978
12983
  }
12979
12984
  };
12980
12985
  }
12981
- function normalize(fn) {
12982
- if (typeof fn !== "function")
12983
- throw new Error("normalize fn should be function");
12984
- return { encode: (from) => from, decode: (to) => fn(to) };
12985
- }
12986
- var gcd = (
12987
- /* @__NO_SIDE_EFFECTS__ */
12988
- (a, b) => !b ? a : gcd(b, a % b)
12989
- );
12990
- var radix2carry = (
12991
- /*@__NO_SIDE_EFFECTS__ */
12992
- (from, to) => from + (to - gcd(from, to))
12993
- );
12986
+ var gcd = /* @__NO_SIDE_EFFECTS__ */ (a, b) => !b ? a : /* @__PURE__ */ gcd(b, a % b);
12987
+ var radix2carry = /* @__NO_SIDE_EFFECTS__ */ (from, to) => from + (to - /* @__PURE__ */ gcd(from, to));
12988
+ // @__NO_SIDE_EFFECTS__
12994
12989
  function convertRadix2(data, from, to, padding2) {
12995
12990
  if (!Array.isArray(data))
12996
12991
  throw new Error("convertRadix2: data should be array");
@@ -12998,15 +12993,15 @@ var starknet = (() => {
12998
12993
  throw new Error(`convertRadix2: wrong from=${from}`);
12999
12994
  if (to <= 0 || to > 32)
13000
12995
  throw new Error(`convertRadix2: wrong to=${to}`);
13001
- if (radix2carry(from, to) > 32) {
13002
- throw new Error(`convertRadix2: carry overflow from=${from} to=${to} carryBits=${radix2carry(from, to)}`);
12996
+ if (/* @__PURE__ */ radix2carry(from, to) > 32) {
12997
+ throw new Error(`convertRadix2: carry overflow from=${from} to=${to} carryBits=${/* @__PURE__ */ radix2carry(from, to)}`);
13003
12998
  }
13004
12999
  let carry = 0;
13005
13000
  let pos = 0;
13006
13001
  const mask = 2 ** to - 1;
13007
13002
  const res = [];
13008
13003
  for (const n of data) {
13009
- assertNumber(n);
13004
+ /* @__PURE__ */ assertNumber(n);
13010
13005
  if (n >= 2 ** from)
13011
13006
  throw new Error(`convertRadix2: invalid data word=${n} from=${from}`);
13012
13007
  carry = carry << from | n;
@@ -13026,38 +13021,27 @@ var starknet = (() => {
13026
13021
  res.push(carry >>> 0);
13027
13022
  return res;
13028
13023
  }
13024
+ // @__NO_SIDE_EFFECTS__
13029
13025
  function radix2(bits, revPadding = false) {
13030
- assertNumber(bits);
13026
+ /* @__PURE__ */ assertNumber(bits);
13031
13027
  if (bits <= 0 || bits > 32)
13032
13028
  throw new Error("radix2: bits should be in (0..32]");
13033
- if (radix2carry(8, bits) > 32 || radix2carry(bits, 8) > 32)
13029
+ if (/* @__PURE__ */ radix2carry(8, bits) > 32 || /* @__PURE__ */ radix2carry(bits, 8) > 32)
13034
13030
  throw new Error("radix2: carry overflow");
13035
13031
  return {
13036
13032
  encode: (bytes2) => {
13037
13033
  if (!isBytes(bytes2))
13038
13034
  throw new Error("radix2.encode input should be Uint8Array");
13039
- return convertRadix2(Array.from(bytes2), 8, bits, !revPadding);
13035
+ return /* @__PURE__ */ convertRadix2(Array.from(bytes2), 8, bits, !revPadding);
13040
13036
  },
13041
13037
  decode: (digits) => {
13042
13038
  if (!Array.isArray(digits) || digits.length && typeof digits[0] !== "number")
13043
13039
  throw new Error("radix2.decode input should be array of numbers");
13044
- return Uint8Array.from(convertRadix2(digits, bits, 8, revPadding));
13040
+ return Uint8Array.from(/* @__PURE__ */ convertRadix2(digits, bits, 8, revPadding));
13045
13041
  }
13046
13042
  };
13047
13043
  }
13048
- var base16 = /* @__PURE__ */ chain(radix2(4), alphabet("0123456789ABCDEF"), join(""));
13049
- var base32 = /* @__PURE__ */ chain(radix2(5), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"), padding(5), join(""));
13050
- var base32hex = /* @__PURE__ */ chain(radix2(5), alphabet("0123456789ABCDEFGHIJKLMNOPQRSTUV"), padding(5), join(""));
13051
- var base32crockford = /* @__PURE__ */ chain(radix2(5), alphabet("0123456789ABCDEFGHJKMNPQRSTVWXYZ"), join(""), normalize((s) => s.toUpperCase().replace(/O/g, "0").replace(/[IL]/g, "1")));
13052
- var base64 = /* @__PURE__ */ chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), padding(6), join(""));
13053
- var base64url = /* @__PURE__ */ chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"), padding(6), join(""));
13054
- var base64urlnopad = /* @__PURE__ */ chain(radix2(6), alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"), join(""));
13055
- var BECH_ALPHABET = /* @__PURE__ */ chain(alphabet("qpzry9x8gf2tvdw0s3jn54khce6mua7l"), join(""));
13056
- var hex = /* @__PURE__ */ chain(radix2(4), alphabet("0123456789abcdef"), join(""), normalize((s) => {
13057
- if (typeof s !== "string" || s.length % 2)
13058
- throw new TypeError(`hex.decode: expected string, got ${typeof s} with length ${s.length}`);
13059
- return s.toLowerCase();
13060
- }));
13044
+ var base64 = /* @__PURE__ */ chain(/* @__PURE__ */ radix2(6), /* @__PURE__ */ alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"), /* @__PURE__ */ padding(6), /* @__PURE__ */ join(""));
13061
13045
 
13062
13046
  // src/utils/encode.ts
13063
13047
  var IS_BROWSER = typeof window !== "undefined";
@@ -13080,11 +13064,11 @@ var starknet = (() => {
13080
13064
  function buf2hex(buffer) {
13081
13065
  return buffer.reduce((r, x) => r + x.toString(16).padStart(2, "0"), "");
13082
13066
  }
13083
- function removeHexPrefix(hex2) {
13084
- return hex2.replace(/^0x/i, "");
13067
+ function removeHexPrefix(hex) {
13068
+ return hex.replace(/^0x/i, "");
13085
13069
  }
13086
- function addHexPrefix(hex2) {
13087
- return `0x${removeHexPrefix(hex2)}`;
13070
+ function addHexPrefix(hex) {
13071
+ return `0x${removeHexPrefix(hex)}`;
13088
13072
  }
13089
13073
  function padString(str, length, left, padding2 = STRING_ZERO) {
13090
13074
  const diff = length - str.length;
@@ -13106,13 +13090,13 @@ var starknet = (() => {
13106
13090
  function sanitizeBytes(str, byteSize = 8, padding2 = STRING_ZERO) {
13107
13091
  return padLeft(str, calcByteLength(str, byteSize), padding2);
13108
13092
  }
13109
- function sanitizeHex(hex2) {
13110
- hex2 = removeHexPrefix(hex2);
13111
- hex2 = sanitizeBytes(hex2, 2);
13112
- if (hex2) {
13113
- hex2 = addHexPrefix(hex2);
13093
+ function sanitizeHex(hex) {
13094
+ hex = removeHexPrefix(hex);
13095
+ hex = sanitizeBytes(hex, 2);
13096
+ if (hex) {
13097
+ hex = addHexPrefix(hex);
13114
13098
  }
13115
- return hex2;
13099
+ return hex;
13116
13100
  }
13117
13101
  var pascalToSnake = (text) => /[a-z]/.test(text) ? text.split(/(?=[A-Z])/).join("_").toUpperCase() : text;
13118
13102
 
@@ -13375,20 +13359,20 @@ var starknet = (() => {
13375
13359
  function bytesToHex(bytes2) {
13376
13360
  if (!isBytes2(bytes2))
13377
13361
  throw new Error("Uint8Array expected");
13378
- let hex2 = "";
13362
+ let hex = "";
13379
13363
  for (let i = 0; i < bytes2.length; i++) {
13380
- hex2 += hexes[bytes2[i]];
13364
+ hex += hexes[bytes2[i]];
13381
13365
  }
13382
- return hex2;
13366
+ return hex;
13383
13367
  }
13384
13368
  function numberToHexUnpadded(num) {
13385
- const hex2 = num.toString(16);
13386
- return hex2.length & 1 ? `0${hex2}` : hex2;
13369
+ const hex = num.toString(16);
13370
+ return hex.length & 1 ? `0${hex}` : hex;
13387
13371
  }
13388
- function hexToNumber(hex2) {
13389
- if (typeof hex2 !== "string")
13390
- throw new Error("hex string expected, got " + typeof hex2);
13391
- return BigInt(hex2 === "" ? "0" : `0x${hex2}`);
13372
+ function hexToNumber(hex) {
13373
+ if (typeof hex !== "string")
13374
+ throw new Error("hex string expected, got " + typeof hex);
13375
+ return BigInt(hex === "" ? "0" : `0x${hex}`);
13392
13376
  }
13393
13377
  var asciis = { _0: 48, _9: 57, _A: 65, _F: 70, _a: 97, _f: 102 };
13394
13378
  function asciiToBase16(char) {
@@ -13400,19 +13384,19 @@ var starknet = (() => {
13400
13384
  return char - (asciis._a - 10);
13401
13385
  return;
13402
13386
  }
13403
- function hexToBytes(hex2) {
13404
- if (typeof hex2 !== "string")
13405
- throw new Error("hex string expected, got " + typeof hex2);
13406
- const hl = hex2.length;
13387
+ function hexToBytes(hex) {
13388
+ if (typeof hex !== "string")
13389
+ throw new Error("hex string expected, got " + typeof hex);
13390
+ const hl = hex.length;
13407
13391
  const al = hl / 2;
13408
13392
  if (hl % 2)
13409
13393
  throw new Error("padded hex string expected, got unpadded hex of length " + hl);
13410
13394
  const array = new Uint8Array(al);
13411
13395
  for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {
13412
- const n1 = asciiToBase16(hex2.charCodeAt(hi));
13413
- const n2 = asciiToBase16(hex2.charCodeAt(hi + 1));
13396
+ const n1 = asciiToBase16(hex.charCodeAt(hi));
13397
+ const n2 = asciiToBase16(hex.charCodeAt(hi + 1));
13414
13398
  if (n1 === void 0 || n2 === void 0) {
13415
- const char = hex2[hi] + hex2[hi + 1];
13399
+ const char = hex[hi] + hex[hi + 1];
13416
13400
  throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi);
13417
13401
  }
13418
13402
  array[ai] = n1 * 16 + n2;
@@ -13436,16 +13420,16 @@ var starknet = (() => {
13436
13420
  function numberToVarBytesBE(n) {
13437
13421
  return hexToBytes(numberToHexUnpadded(n));
13438
13422
  }
13439
- function ensureBytes(title, hex2, expectedLength) {
13423
+ function ensureBytes(title, hex, expectedLength) {
13440
13424
  let res;
13441
- if (typeof hex2 === "string") {
13425
+ if (typeof hex === "string") {
13442
13426
  try {
13443
- res = hexToBytes(hex2);
13427
+ res = hexToBytes(hex);
13444
13428
  } catch (e) {
13445
- throw new Error(`${title} must be valid hex string, got "${hex2}". Cause: ${e}`);
13429
+ throw new Error(`${title} must be valid hex string, got "${hex}". Cause: ${e}`);
13446
13430
  }
13447
- } else if (isBytes2(hex2)) {
13448
- res = Uint8Array.from(hex2);
13431
+ } else if (isBytes2(hex)) {
13432
+ res = Uint8Array.from(hex);
13449
13433
  } else {
13450
13434
  throw new Error(`${title} must be hex string or Uint8Array`);
13451
13435
  }
@@ -13578,8 +13562,8 @@ var starknet = (() => {
13578
13562
  }
13579
13563
 
13580
13564
  // src/utils/num.ts
13581
- function isHex(hex2) {
13582
- return /^0x[0-9a-f]*$/i.test(hex2);
13565
+ function isHex(hex) {
13566
+ return /^0x[0-9a-f]*$/i.test(hex);
13583
13567
  }
13584
13568
  function toBigInt(value) {
13585
13569
  return BigInt(value);
@@ -13595,10 +13579,10 @@ var starknet = (() => {
13595
13579
  const res = addHexPrefix(toBigInt(number3).toString(16).padStart(64, "0"));
13596
13580
  return res;
13597
13581
  }
13598
- function hexToDecimalString(hex2) {
13599
- return BigInt(addHexPrefix(hex2)).toString(10);
13582
+ function hexToDecimalString(hex) {
13583
+ return BigInt(addHexPrefix(hex)).toString(10);
13600
13584
  }
13601
- var cleanHex = (hex2) => hex2.toLowerCase().replace(/^(0x)0+/, "$1");
13585
+ var cleanHex = (hex) => hex.toLowerCase().replace(/^(0x)0+/, "$1");
13602
13586
  function assertInRange(input, lowerBound, upperBound, inputName = "") {
13603
13587
  const messageSuffix = inputName === "" ? "invalid length" : `invalid ${inputName} length`;
13604
13588
  const inputBigInt = BigInt(input);
@@ -13882,7 +13866,7 @@ var starknet = (() => {
13882
13866
  }
13883
13867
  B.fill(0);
13884
13868
  }
13885
- var Keccak = class extends Hash {
13869
+ var Keccak = class _Keccak extends Hash {
13886
13870
  // NOTE: we accept arguments in bytes instead of bits here.
13887
13871
  constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
13888
13872
  super();
@@ -13973,7 +13957,7 @@ var starknet = (() => {
13973
13957
  }
13974
13958
  _cloneInto(to) {
13975
13959
  const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
13976
- to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));
13960
+ to || (to = new _Keccak(blockLen, suffix, outputLen, enableXOF, rounds));
13977
13961
  to.state32.set(this.state32);
13978
13962
  to.pos = this.pos;
13979
13963
  to.posOut = this.posOut;
@@ -14798,9 +14782,9 @@ var starknet = (() => {
14798
14782
  throw new E("Invalid signature integer: unnecessary leading zero");
14799
14783
  return { d: b2n(res), l: data.subarray(len + 2) };
14800
14784
  },
14801
- toSig(hex2) {
14785
+ toSig(hex) {
14802
14786
  const { Err: E } = DER;
14803
- const data = typeof hex2 === "string" ? h2b(hex2) : hex2;
14787
+ const data = typeof hex === "string" ? h2b(hex) : hex;
14804
14788
  if (!isBytes2(data))
14805
14789
  throw new Error("ui8a expected");
14806
14790
  let l = data.length;
@@ -14817,8 +14801,8 @@ var starknet = (() => {
14817
14801
  hexFromSig(sig) {
14818
14802
  const slice = (s2) => Number.parseInt(s2[0], 16) & 8 ? "00" + s2 : s2;
14819
14803
  const h = (num) => {
14820
- const hex2 = num.toString(16);
14821
- return hex2.length & 1 ? `0${hex2}` : hex2;
14804
+ const hex = num.toString(16);
14805
+ return hex.length & 1 ? `0${hex}` : hex;
14822
14806
  };
14823
14807
  const s = slice(h(sig.s));
14824
14808
  const r = slice(h(sig.r));
@@ -14932,8 +14916,8 @@ var starknet = (() => {
14932
14916
  * Converts hash string or Uint8Array to Point.
14933
14917
  * @param hex short/long ECDSA hex
14934
14918
  */
14935
- static fromHex(hex2) {
14936
- const P = Point2.fromAffine(fromBytes(ensureBytes("pointHex", hex2)));
14919
+ static fromHex(hex) {
14920
+ const P = Point2.fromAffine(fromBytes(ensureBytes("pointHex", hex)));
14937
14921
  P.assertValidity();
14938
14922
  return P;
14939
14923
  }
@@ -15303,15 +15287,15 @@ var starknet = (() => {
15303
15287
  this.assertValidity();
15304
15288
  }
15305
15289
  // pair (bytes of r, bytes of s)
15306
- static fromCompact(hex2) {
15290
+ static fromCompact(hex) {
15307
15291
  const l = CURVE2.nByteLength;
15308
- hex2 = ensureBytes("compactSignature", hex2, l * 2);
15309
- return new Signature3(slcNum(hex2, 0, l), slcNum(hex2, l, 2 * l));
15292
+ hex = ensureBytes("compactSignature", hex, l * 2);
15293
+ return new Signature3(slcNum(hex, 0, l), slcNum(hex, l, 2 * l));
15310
15294
  }
15311
15295
  // DER encoded ECDSA signature
15312
15296
  // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script
15313
- static fromDER(hex2) {
15314
- const { r, s } = DER.toSig(ensureBytes("DER", hex2));
15297
+ static fromDER(hex) {
15298
+ const { r, s } = DER.toSig(ensureBytes("DER", hex));
15315
15299
  return new Signature3(r, s);
15316
15300
  }
15317
15301
  assertValidity() {
@@ -15730,13 +15714,13 @@ var starknet = (() => {
15730
15714
  const num = bytesToNumberBE(bytes2);
15731
15715
  return delta > 0 ? num >> BigInt(delta) : num;
15732
15716
  }
15733
- function hex0xToBytes(hex2) {
15734
- if (typeof hex2 === "string") {
15735
- hex2 = strip0x(hex2);
15736
- if (hex2.length & 1)
15737
- hex2 = "0" + hex2;
15717
+ function hex0xToBytes(hex) {
15718
+ if (typeof hex === "string") {
15719
+ hex = strip0x(hex);
15720
+ if (hex.length & 1)
15721
+ hex = "0" + hex;
15738
15722
  }
15739
- return hexToBytes(hex2);
15723
+ return hexToBytes(hex);
15740
15724
  }
15741
15725
  var curve = weierstrass({
15742
15726
  a: BigInt(1),
@@ -15751,15 +15735,15 @@ var starknet = (() => {
15751
15735
  ...getHash(sha256),
15752
15736
  bits2int,
15753
15737
  bits2int_modN: (bytes2) => {
15754
- const hex2 = bytesToNumberBE(bytes2).toString(16);
15755
- if (hex2.length === 63)
15756
- bytes2 = hex0xToBytes(hex2 + "0");
15738
+ const hex = bytesToNumberBE(bytes2).toString(16);
15739
+ if (hex.length === 63)
15740
+ bytes2 = hex0xToBytes(hex + "0");
15757
15741
  return mod(bits2int(bytes2), CURVE_ORDER);
15758
15742
  }
15759
15743
  });
15760
15744
  var _starkCurve = curve;
15761
- function ensureBytes2(hex2) {
15762
- return ensureBytes("", typeof hex2 === "string" ? hex0xToBytes(hex2) : hex2);
15745
+ function ensureBytes2(hex) {
15746
+ return ensureBytes("", typeof hex === "string" ? hex0xToBytes(hex) : hex);
15763
15747
  }
15764
15748
  function normPrivKey(privKey) {
15765
15749
  return bytesToHex(ensureBytes2(privKey)).padStart(64, "0");
@@ -15806,12 +15790,12 @@ var starknet = (() => {
15806
15790
  }
15807
15791
  var { CURVE, ProjectivePoint, Signature, utils } = curve;
15808
15792
  function extractX(bytes2) {
15809
- const hex2 = bytesToHex(bytes2.subarray(1));
15810
- const stripped = hex2.replace(/^0+/gm, "");
15793
+ const hex = bytesToHex(bytes2.subarray(1));
15794
+ const stripped = hex.replace(/^0+/gm, "");
15811
15795
  return `0x${stripped}`;
15812
15796
  }
15813
- function strip0x(hex2) {
15814
- return hex2.replace(/^0x/i, "");
15797
+ function strip0x(hex) {
15798
+ return hex.replace(/^0x/i, "");
15815
15799
  }
15816
15800
  function grindKey(seed) {
15817
15801
  const _seed = ensureBytes2(seed);
@@ -16050,7 +16034,7 @@ var starknet = (() => {
16050
16034
  if (!isASCII(str))
16051
16035
  throw new Error(`${str} is not an ASCII string`);
16052
16036
  if (isHex(str)) {
16053
- return removeHexPrefix(str).replace(/.{2}/g, (hex2) => String.fromCharCode(parseInt(hex2, 16)));
16037
+ return removeHexPrefix(str).replace(/.{2}/g, (hex) => String.fromCharCode(parseInt(hex, 16)));
16054
16038
  }
16055
16039
  if (isDecimalString(str)) {
16056
16040
  return decodeShortString("0X".concat(BigInt(str).toString(16)));
@@ -16161,9 +16145,10 @@ var starknet = (() => {
16161
16145
  var UINT_256_HIGH_MAX = 340282366920938463463374607431768211455n;
16162
16146
  var UINT_256_LOW_MIN = 0n;
16163
16147
  var UINT_256_HIGH_MIN = 0n;
16164
- var _CairoUint256 = class {
16148
+ var CairoUint256 = class _CairoUint256 {
16165
16149
  low;
16166
16150
  high;
16151
+ static abiSelector = "core::integer::u256";
16167
16152
  constructor(...arr) {
16168
16153
  if (typeof arr[0] === "object" && arr.length === 1 && "low" in arr[0] && "high" in arr[0]) {
16169
16154
  const props = _CairoUint256.validateProps(arr[0].low, arr[0].high);
@@ -16256,8 +16241,6 @@ var starknet = (() => {
16256
16241
  return [CairoFelt(this.low), CairoFelt(this.high)];
16257
16242
  }
16258
16243
  };
16259
- var CairoUint256 = _CairoUint256;
16260
- __publicField(CairoUint256, "abiSelector", "core::integer::u256");
16261
16244
 
16262
16245
  // src/utils/calldata/cairo.ts
16263
16246
  var isLen = (name) => /_len$/.test(name);
@@ -17395,14 +17378,14 @@ var starknet = (() => {
17395
17378
  }
17396
17379
 
17397
17380
  // src/utils/calldata/index.ts
17398
- var CallData = class {
17381
+ var CallData = class _CallData {
17399
17382
  abi;
17400
17383
  parser;
17401
17384
  structs;
17402
17385
  enums;
17403
17386
  constructor(abi) {
17404
- this.structs = CallData.getAbiStruct(abi);
17405
- this.enums = CallData.getAbiEnum(abi);
17387
+ this.structs = _CallData.getAbiStruct(abi);
17388
+ this.enums = _CallData.getAbiEnum(abi);
17406
17389
  this.parser = createAbiParser(abi);
17407
17390
  this.abi = this.parser.getLegacyFormat();
17408
17391
  }
@@ -17618,7 +17601,7 @@ var starknet = (() => {
17618
17601
  * @returns Calldata
17619
17602
  */
17620
17603
  static toCalldata(rawCalldata = []) {
17621
- return CallData.compile(rawCalldata);
17604
+ return _CallData.compile(rawCalldata);
17622
17605
  }
17623
17606
  /**
17624
17607
  * Helper: Convert raw to HexCalldata
@@ -17626,7 +17609,7 @@ var starknet = (() => {
17626
17609
  * @returns HexCalldata
17627
17610
  */
17628
17611
  static toHex(raw = []) {
17629
- const calldata = CallData.compile(raw);
17612
+ const calldata = _CallData.compile(raw);
17630
17613
  return calldata.map((it) => toHex(it));
17631
17614
  }
17632
17615
  /**
@@ -17954,15 +17937,15 @@ var starknet = (() => {
17954
17937
  }
17955
17938
  var NUMBER_REGEX = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
17956
17939
  function isSafeNumber(value, config2) {
17957
- var num = parseFloat(value);
17958
- var str = String(num);
17959
- var v = extractSignificantDigits(value);
17960
- var s = extractSignificantDigits(str);
17940
+ const num = parseFloat(value);
17941
+ const str = String(num);
17942
+ const v = extractSignificantDigits(value);
17943
+ const s = extractSignificantDigits(str);
17961
17944
  if (v === s) {
17962
17945
  return true;
17963
17946
  }
17964
- if ((config2 === null || config2 === void 0 ? void 0 : config2.approx) === true) {
17965
- var requiredDigits = 14;
17947
+ if (config2?.approx === true) {
17948
+ const requiredDigits = 14;
17966
17949
  if (!isInteger(value) && s.length >= requiredDigits && v.startsWith(s.substring(0, requiredDigits))) {
17967
17950
  return true;
17968
17951
  }
@@ -17985,7 +17968,7 @@ var starknet = (() => {
17985
17968
  if (isInteger(value)) {
17986
17969
  return UnsafeNumberReason.truncate_integer;
17987
17970
  }
17988
- var num = parseFloat(value);
17971
+ const num = parseFloat(value);
17989
17972
  if (!isFinite(num)) {
17990
17973
  return UnsafeNumberReason.overflow;
17991
17974
  }
@@ -18003,99 +17986,49 @@ var starknet = (() => {
18003
17986
  var TRAILING_ZEROS_REGEX = /0+$/;
18004
17987
 
18005
17988
  // node_modules/lossless-json/lib/esm/LosslessNumber.js
18006
- function _typeof(obj) {
18007
- "@babel/helpers - typeof";
18008
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
18009
- return typeof obj2;
18010
- } : function(obj2) {
18011
- return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
18012
- }, _typeof(obj);
18013
- }
18014
- function _classCallCheck(instance, Constructor) {
18015
- if (!(instance instanceof Constructor)) {
18016
- throw new TypeError("Cannot call a class as a function");
18017
- }
18018
- }
18019
- function _defineProperties(target, props) {
18020
- for (var i = 0; i < props.length; i++) {
18021
- var descriptor = props[i];
18022
- descriptor.enumerable = descriptor.enumerable || false;
18023
- descriptor.configurable = true;
18024
- if ("value" in descriptor)
18025
- descriptor.writable = true;
18026
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
18027
- }
18028
- }
18029
- function _createClass(Constructor, protoProps, staticProps) {
18030
- if (protoProps)
18031
- _defineProperties(Constructor.prototype, protoProps);
18032
- if (staticProps)
18033
- _defineProperties(Constructor, staticProps);
18034
- Object.defineProperty(Constructor, "prototype", { writable: false });
18035
- return Constructor;
18036
- }
18037
- function _defineProperty(obj, key, value) {
18038
- key = _toPropertyKey(key);
18039
- if (key in obj) {
18040
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
18041
- } else {
18042
- obj[key] = value;
18043
- }
18044
- return obj;
18045
- }
18046
- function _toPropertyKey(arg) {
18047
- var key = _toPrimitive(arg, "string");
18048
- return _typeof(key) === "symbol" ? key : String(key);
18049
- }
18050
- function _toPrimitive(input, hint) {
18051
- if (_typeof(input) !== "object" || input === null)
18052
- return input;
18053
- var prim = input[Symbol.toPrimitive];
18054
- if (prim !== void 0) {
18055
- var res = prim.call(input, hint || "default");
18056
- if (_typeof(res) !== "object")
18057
- return res;
18058
- throw new TypeError("@@toPrimitive must return a primitive value.");
18059
- }
18060
- return (hint === "string" ? String : Number)(input);
18061
- }
18062
- var LosslessNumber = /* @__PURE__ */ function() {
18063
- function LosslessNumber2(value) {
18064
- _classCallCheck(this, LosslessNumber2);
18065
- _defineProperty(this, "isLosslessNumber", true);
17989
+ var LosslessNumber = class {
17990
+ // numeric value as string
17991
+ // type information
17992
+ isLosslessNumber = true;
17993
+ constructor(value) {
18066
17994
  if (!isNumber(value)) {
18067
17995
  throw new Error('Invalid number (value: "' + value + '")');
18068
17996
  }
18069
17997
  this.value = value;
18070
17998
  }
18071
- _createClass(LosslessNumber2, [{
18072
- key: "valueOf",
18073
- value: function valueOf() {
18074
- var unsafeReason = getUnsafeNumberReason(this.value);
18075
- if (unsafeReason === void 0 || unsafeReason === UnsafeNumberReason.truncate_float) {
18076
- return parseFloat(this.value);
18077
- }
18078
- if (isInteger(this.value)) {
18079
- return BigInt(this.value);
18080
- }
18081
- throw new Error("Cannot safely convert to number: " + "the value '".concat(this.value, "' would ").concat(unsafeReason, " and become ").concat(parseFloat(this.value)));
17999
+ /**
18000
+ * Get the value of the LosslessNumber as number or bigint.
18001
+ *
18002
+ * - a number is returned for safe numbers and decimal values that only lose some insignificant digits
18003
+ * - a bigint is returned for big integer numbers
18004
+ * - an Error is thrown for values that will overflow or underflow
18005
+ *
18006
+ * Note that you can implement your own strategy for conversion by just getting the value as string
18007
+ * via .toString(), and using util functions like isInteger, isSafeNumber, getUnsafeNumberReason,
18008
+ * and toSafeNumberOrThrow to convert it to a numeric value.
18009
+ */
18010
+ valueOf() {
18011
+ const unsafeReason = getUnsafeNumberReason(this.value);
18012
+ if (unsafeReason === void 0 || unsafeReason === UnsafeNumberReason.truncate_float) {
18013
+ return parseFloat(this.value);
18082
18014
  }
18083
- /**
18084
- * Get the value of the LosslessNumber as string.
18085
- */
18086
- }, {
18087
- key: "toString",
18088
- value: function toString3() {
18089
- return this.value;
18090
- }
18091
- // Note: we do NOT implement a .toJSON() method, and you should not implement
18092
- // or use that, it cannot safely turn the numeric value in the string into
18093
- // stringified JSON since it has to be parsed into a number first.
18094
- }]);
18095
- return LosslessNumber2;
18096
- }();
18015
+ if (isInteger(this.value)) {
18016
+ return BigInt(this.value);
18017
+ }
18018
+ throw new Error(`Cannot safely convert to number: the value '${this.value}' would ${unsafeReason} and become ${parseFloat(this.value)}`);
18019
+ }
18020
+ /**
18021
+ * Get the value of the LosslessNumber as string.
18022
+ */
18023
+ toString() {
18024
+ return this.value;
18025
+ }
18026
+ // Note: we do NOT implement a .toJSON() method, and you should not implement
18027
+ // or use that, it cannot safely turn the numeric value in the string into
18028
+ // stringified JSON since it has to be parsed into a number first.
18029
+ };
18097
18030
  function isLosslessNumber(value) {
18098
- return value && _typeof(value) === "object" && value.isLosslessNumber === true || false;
18031
+ return value && typeof value === "object" && value.isLosslessNumber === true || false;
18099
18032
  }
18100
18033
 
18101
18034
  // node_modules/lossless-json/lib/esm/numberParsers.js
@@ -18107,14 +18040,6 @@ var starknet = (() => {
18107
18040
  }
18108
18041
 
18109
18042
  // node_modules/lossless-json/lib/esm/revive.js
18110
- function _typeof2(obj) {
18111
- "@babel/helpers - typeof";
18112
- return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
18113
- return typeof obj2;
18114
- } : function(obj2) {
18115
- return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
18116
- }, _typeof2(obj);
18117
- }
18118
18043
  function revive(json, reviver) {
18119
18044
  return reviveValue({
18120
18045
  "": json
@@ -18123,15 +18048,15 @@ var starknet = (() => {
18123
18048
  function reviveValue(context, key, value, reviver) {
18124
18049
  if (Array.isArray(value)) {
18125
18050
  return reviver.call(context, key, reviveArray(value, reviver));
18126
- } else if (value && _typeof2(value) === "object" && !isLosslessNumber(value)) {
18051
+ } else if (value && typeof value === "object" && !isLosslessNumber(value)) {
18127
18052
  return reviver.call(context, key, reviveObject(value, reviver));
18128
18053
  } else {
18129
18054
  return reviver.call(context, key, value);
18130
18055
  }
18131
18056
  }
18132
18057
  function reviveObject(object, reviver) {
18133
- Object.keys(object).forEach(function(key) {
18134
- var value = reviveValue(object, key, object[key], reviver);
18058
+ Object.keys(object).forEach((key) => {
18059
+ const value = reviveValue(object, key, object[key], reviver);
18135
18060
  if (value !== void 0) {
18136
18061
  object[key] = value;
18137
18062
  } else {
@@ -18141,59 +18066,17 @@ var starknet = (() => {
18141
18066
  return object;
18142
18067
  }
18143
18068
  function reviveArray(array, reviver) {
18144
- for (var i = 0; i < array.length; i++) {
18069
+ for (let i = 0; i < array.length; i++) {
18145
18070
  array[i] = reviveValue(array, i + "", array[i], reviver);
18146
18071
  }
18147
18072
  return array;
18148
18073
  }
18149
18074
 
18150
18075
  // node_modules/lossless-json/lib/esm/parse.js
18151
- function _typeof3(obj) {
18152
- "@babel/helpers - typeof";
18153
- return _typeof3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
18154
- return typeof obj2;
18155
- } : function(obj2) {
18156
- return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
18157
- }, _typeof3(obj);
18158
- }
18159
- function _toConsumableArray(arr) {
18160
- return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
18161
- }
18162
- function _nonIterableSpread() {
18163
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
18164
- }
18165
- function _unsupportedIterableToArray(o, minLen) {
18166
- if (!o)
18167
- return;
18168
- if (typeof o === "string")
18169
- return _arrayLikeToArray(o, minLen);
18170
- var n = Object.prototype.toString.call(o).slice(8, -1);
18171
- if (n === "Object" && o.constructor)
18172
- n = o.constructor.name;
18173
- if (n === "Map" || n === "Set")
18174
- return Array.from(o);
18175
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
18176
- return _arrayLikeToArray(o, minLen);
18177
- }
18178
- function _iterableToArray(iter) {
18179
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
18180
- return Array.from(iter);
18181
- }
18182
- function _arrayWithoutHoles(arr) {
18183
- if (Array.isArray(arr))
18184
- return _arrayLikeToArray(arr);
18185
- }
18186
- function _arrayLikeToArray(arr, len) {
18187
- if (len == null || len > arr.length)
18188
- len = arr.length;
18189
- for (var i = 0, arr2 = new Array(len); i < len; i++)
18190
- arr2[i] = arr[i];
18191
- return arr2;
18192
- }
18193
18076
  function parse(text, reviver) {
18194
- var parseNumber = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : parseLosslessNumber;
18195
- var i = 0;
18196
- var value = parseValue();
18077
+ let parseNumber = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : parseLosslessNumber;
18078
+ let i = 0;
18079
+ const value = parseValue();
18197
18080
  expectValue(value);
18198
18081
  expectEndOfInput();
18199
18082
  return reviver ? revive(value, reviver) : value;
@@ -18201,8 +18084,8 @@ var starknet = (() => {
18201
18084
  if (text.charCodeAt(i) === codeOpeningBrace) {
18202
18085
  i++;
18203
18086
  skipWhitespace();
18204
- var object = {};
18205
- var initial = true;
18087
+ const object = {};
18088
+ let initial = true;
18206
18089
  while (i < text.length && text.charCodeAt(i) !== codeClosingBrace) {
18207
18090
  if (!initial) {
18208
18091
  eatComma();
@@ -18210,21 +18093,23 @@ var starknet = (() => {
18210
18093
  } else {
18211
18094
  initial = false;
18212
18095
  }
18213
- var start = i;
18214
- var key = parseString();
18096
+ const start = i;
18097
+ const key = parseString();
18215
18098
  if (key === void 0) {
18216
18099
  throwObjectKeyExpected();
18100
+ return;
18217
18101
  }
18218
18102
  skipWhitespace();
18219
18103
  eatColon();
18220
- var _value = parseValue();
18221
- if (_value === void 0) {
18104
+ const value2 = parseValue();
18105
+ if (value2 === void 0) {
18222
18106
  throwObjectValueExpected();
18107
+ return;
18223
18108
  }
18224
- if (Object.prototype.hasOwnProperty.call(object, key) && !isDeepEqual(_value, object[key])) {
18109
+ if (Object.prototype.hasOwnProperty.call(object, key) && !isDeepEqual(value2, object[key])) {
18225
18110
  throwDuplicateKey(key, start + 1);
18226
18111
  }
18227
- object[key] = _value;
18112
+ object[key] = value2;
18228
18113
  }
18229
18114
  if (text.charCodeAt(i) !== codeClosingBrace) {
18230
18115
  throwObjectKeyOrEndExpected();
@@ -18237,17 +18122,17 @@ var starknet = (() => {
18237
18122
  if (text.charCodeAt(i) === codeOpeningBracket) {
18238
18123
  i++;
18239
18124
  skipWhitespace();
18240
- var array = [];
18241
- var initial = true;
18125
+ const array = [];
18126
+ let initial = true;
18242
18127
  while (i < text.length && text.charCodeAt(i) !== codeClosingBracket) {
18243
18128
  if (!initial) {
18244
18129
  eatComma();
18245
18130
  } else {
18246
18131
  initial = false;
18247
18132
  }
18248
- var _value2 = parseValue();
18249
- expectArrayItem(_value2);
18250
- array.push(_value2);
18133
+ const value2 = parseValue();
18134
+ expectArrayItem(value2);
18135
+ array.push(value2);
18251
18136
  }
18252
18137
  if (text.charCodeAt(i) !== codeClosingBracket) {
18253
18138
  throwArrayItemOrEndExpected();
@@ -18257,9 +18142,8 @@ var starknet = (() => {
18257
18142
  }
18258
18143
  }
18259
18144
  function parseValue() {
18260
- var _ref, _ref2, _ref3, _ref4, _ref5, _parseString;
18261
18145
  skipWhitespace();
18262
- var value2 = (_ref = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_parseString = parseString()) !== null && _parseString !== void 0 ? _parseString : parseNumeric()) !== null && _ref5 !== void 0 ? _ref5 : parseObject()) !== null && _ref4 !== void 0 ? _ref4 : parseArray()) !== null && _ref3 !== void 0 ? _ref3 : parseKeyword("true", true)) !== null && _ref2 !== void 0 ? _ref2 : parseKeyword("false", false)) !== null && _ref !== void 0 ? _ref : parseKeyword("null", null);
18146
+ const value2 = parseString() ?? parseNumeric() ?? parseObject() ?? parseArray() ?? parseKeyword("true", true) ?? parseKeyword("false", false) ?? parseKeyword("null", null);
18263
18147
  skipWhitespace();
18264
18148
  return value2;
18265
18149
  }
@@ -18277,11 +18161,11 @@ var starknet = (() => {
18277
18161
  function parseString() {
18278
18162
  if (text.charCodeAt(i) === codeDoubleQuote) {
18279
18163
  i++;
18280
- var result = "";
18164
+ let result = "";
18281
18165
  while (i < text.length && text.charCodeAt(i) !== codeDoubleQuote) {
18282
18166
  if (text.charCodeAt(i) === codeBackslash) {
18283
- var char = text[i + 1];
18284
- var escapeChar = escapeCharacters[char];
18167
+ const char = text[i + 1];
18168
+ const escapeChar = escapeCharacters[char];
18285
18169
  if (escapeChar !== void 0) {
18286
18170
  result += escapeChar;
18287
18171
  i++;
@@ -18310,7 +18194,7 @@ var starknet = (() => {
18310
18194
  }
18311
18195
  }
18312
18196
  function parseNumeric() {
18313
- var start = i;
18197
+ const start = i;
18314
18198
  if (text.charCodeAt(i) === codeMinus) {
18315
18199
  i++;
18316
18200
  expectDigit(start);
@@ -18346,77 +18230,73 @@ var starknet = (() => {
18346
18230
  }
18347
18231
  function eatComma() {
18348
18232
  if (text.charCodeAt(i) !== codeComma) {
18349
- throw new SyntaxError("Comma ',' expected after value ".concat(gotAt()));
18233
+ throw new SyntaxError(`Comma ',' expected after value ${gotAt()}`);
18350
18234
  }
18351
18235
  i++;
18352
18236
  }
18353
18237
  function eatColon() {
18354
18238
  if (text.charCodeAt(i) !== codeColon) {
18355
- throw new SyntaxError("Colon ':' expected after property name ".concat(gotAt()));
18239
+ throw new SyntaxError(`Colon ':' expected after property name ${gotAt()}`);
18356
18240
  }
18357
18241
  i++;
18358
18242
  }
18359
18243
  function expectValue(value2) {
18360
18244
  if (value2 === void 0) {
18361
- throw new SyntaxError("JSON value expected ".concat(gotAt()));
18245
+ throw new SyntaxError(`JSON value expected ${gotAt()}`);
18362
18246
  }
18363
18247
  }
18364
18248
  function expectArrayItem(value2) {
18365
18249
  if (value2 === void 0) {
18366
- throw new SyntaxError("Array item expected ".concat(gotAt()));
18250
+ throw new SyntaxError(`Array item expected ${gotAt()}`);
18367
18251
  }
18368
18252
  }
18369
18253
  function expectEndOfInput() {
18370
18254
  if (i < text.length) {
18371
- throw new SyntaxError("Expected end of input ".concat(gotAt()));
18255
+ throw new SyntaxError(`Expected end of input ${gotAt()}`);
18372
18256
  }
18373
18257
  }
18374
18258
  function expectDigit(start) {
18375
18259
  if (!isDigit(text.charCodeAt(i))) {
18376
- var numSoFar = text.slice(start, i);
18377
- throw new SyntaxError("Invalid number '".concat(numSoFar, "', expecting a digit ").concat(gotAt()));
18260
+ const numSoFar = text.slice(start, i);
18261
+ throw new SyntaxError(`Invalid number '${numSoFar}', expecting a digit ${gotAt()}`);
18378
18262
  }
18379
18263
  }
18380
18264
  function expectEndOfString() {
18381
18265
  if (text.charCodeAt(i) !== codeDoubleQuote) {
18382
- throw new SyntaxError(`End of string '"' expected `.concat(gotAt()));
18266
+ throw new SyntaxError(`End of string '"' expected ${gotAt()}`);
18383
18267
  }
18384
18268
  }
18385
18269
  function throwObjectKeyExpected() {
18386
- throw new SyntaxError("Quoted object key expected ".concat(gotAt()));
18270
+ throw new SyntaxError(`Quoted object key expected ${gotAt()}`);
18387
18271
  }
18388
18272
  function throwDuplicateKey(key, pos2) {
18389
- throw new SyntaxError("Duplicate key '".concat(key, "' encountered at position ").concat(pos2));
18273
+ throw new SyntaxError(`Duplicate key '${key}' encountered at position ${pos2}`);
18390
18274
  }
18391
18275
  function throwObjectKeyOrEndExpected() {
18392
- throw new SyntaxError("Quoted object key or end of object '}' expected ".concat(gotAt()));
18276
+ throw new SyntaxError(`Quoted object key or end of object '}' expected ${gotAt()}`);
18393
18277
  }
18394
18278
  function throwArrayItemOrEndExpected() {
18395
- throw new SyntaxError("Array item or end of array ']' expected ".concat(gotAt()));
18279
+ throw new SyntaxError(`Array item or end of array ']' expected ${gotAt()}`);
18396
18280
  }
18397
18281
  function throwInvalidCharacter(char) {
18398
- throw new SyntaxError("Invalid character '".concat(char, "' ").concat(pos()));
18282
+ throw new SyntaxError(`Invalid character '${char}' ${pos()}`);
18399
18283
  }
18400
18284
  function throwInvalidEscapeCharacter(start) {
18401
- var chars = text.slice(start, start + 2);
18402
- throw new SyntaxError("Invalid escape character '".concat(chars, "' ").concat(pos()));
18285
+ const chars = text.slice(start, start + 2);
18286
+ throw new SyntaxError(`Invalid escape character '${chars}' ${pos()}`);
18403
18287
  }
18404
18288
  function throwObjectValueExpected() {
18405
- throw new SyntaxError("Object value expected after ':' ".concat(pos()));
18289
+ throw new SyntaxError(`Object value expected after ':' ${pos()}`);
18406
18290
  }
18407
18291
  function throwInvalidUnicodeCharacter(start) {
18408
- var end = start + 2;
18409
- while (/\w/.test(text[end])) {
18410
- end++;
18411
- }
18412
- var chars = text.slice(start, end);
18413
- throw new SyntaxError("Invalid unicode character '".concat(chars, "' ").concat(pos()));
18292
+ const chars = text.slice(start, start + 6);
18293
+ throw new SyntaxError(`Invalid unicode character '${chars}' ${pos()}`);
18414
18294
  }
18415
18295
  function pos() {
18416
- return "at position ".concat(i);
18296
+ return `at position ${i}`;
18417
18297
  }
18418
18298
  function got() {
18419
- return i < text.length ? "but got '".concat(text[i], "'") : "but reached end of input";
18299
+ return i < text.length ? `but got '${text[i]}'` : "but reached end of input";
18420
18300
  }
18421
18301
  function gotAt() {
18422
18302
  return got() + " " + pos();
@@ -18442,20 +18322,16 @@ var starknet = (() => {
18442
18322
  return true;
18443
18323
  }
18444
18324
  if (Array.isArray(a) && Array.isArray(b)) {
18445
- return a.length === b.length && a.every(function(item, index) {
18446
- return isDeepEqual(item, b[index]);
18447
- });
18325
+ return a.length === b.length && a.every((item, index) => isDeepEqual(item, b[index]));
18448
18326
  }
18449
18327
  if (isObject(a) && isObject(b)) {
18450
- var keys = _toConsumableArray(new Set([].concat(_toConsumableArray(Object.keys(a)), _toConsumableArray(Object.keys(b)))));
18451
- return keys.every(function(key) {
18452
- return isDeepEqual(a[key], b[key]);
18453
- });
18328
+ const keys = [.../* @__PURE__ */ new Set([...Object.keys(a), ...Object.keys(b)])];
18329
+ return keys.every((key) => isDeepEqual(a[key], b[key]));
18454
18330
  }
18455
18331
  return false;
18456
18332
  }
18457
18333
  function isObject(value) {
18458
- return _typeof3(value) === "object" && value !== null;
18334
+ return typeof value === "object" && value !== null;
18459
18335
  }
18460
18336
  var escapeCharacters = {
18461
18337
  '"': '"',
@@ -18494,29 +18370,19 @@ var starknet = (() => {
18494
18370
  var codeLowercaseF = 102;
18495
18371
 
18496
18372
  // node_modules/lossless-json/lib/esm/stringify.js
18497
- function _typeof4(obj) {
18498
- "@babel/helpers - typeof";
18499
- return _typeof4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
18500
- return typeof obj2;
18501
- } : function(obj2) {
18502
- return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
18503
- }, _typeof4(obj);
18504
- }
18505
18373
  function stringify(value, replacer, space, numberStringifiers) {
18506
- var resolvedSpace = resolveSpace(space);
18507
- var replacedValue = typeof replacer === "function" ? replacer.call({
18374
+ const resolvedSpace = resolveSpace(space);
18375
+ const replacedValue = typeof replacer === "function" ? replacer.call({
18508
18376
  "": value
18509
18377
  }, "", value) : value;
18510
18378
  return stringifyValue(replacedValue, "");
18511
18379
  function stringifyValue(value2, indent) {
18512
18380
  if (Array.isArray(numberStringifiers)) {
18513
- var stringifier = numberStringifiers.find(function(item) {
18514
- return item.test(value2);
18515
- });
18381
+ const stringifier = numberStringifiers.find((item) => item.test(value2));
18516
18382
  if (stringifier) {
18517
- var str = stringifier.stringify(value2);
18383
+ const str = stringifier.stringify(value2);
18518
18384
  if (typeof str !== "string" || !isNumber(str)) {
18519
- throw new Error("Invalid JSON number: output of a number stringifier must be a string containing a JSON number " + "(output: ".concat(str, ")"));
18385
+ throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${str})`);
18520
18386
  }
18521
18387
  return str;
18522
18388
  }
@@ -18533,7 +18399,7 @@ var starknet = (() => {
18533
18399
  if (Array.isArray(value2)) {
18534
18400
  return stringifyArray(value2, indent);
18535
18401
  }
18536
- if (value2 && _typeof4(value2) === "object") {
18402
+ if (value2 && typeof value2 === "object") {
18537
18403
  return stringifyObject(value2, indent);
18538
18404
  }
18539
18405
  return void 0;
@@ -18542,10 +18408,10 @@ var starknet = (() => {
18542
18408
  if (array.length === 0) {
18543
18409
  return "[]";
18544
18410
  }
18545
- var childIndent = resolvedSpace ? indent + resolvedSpace : void 0;
18546
- var str = resolvedSpace ? "[\n" : "[";
18547
- for (var i = 0; i < array.length; i++) {
18548
- var item = typeof replacer === "function" ? replacer.call(array, String(i), array[i]) : array[i];
18411
+ const childIndent = resolvedSpace ? indent + resolvedSpace : void 0;
18412
+ let str = resolvedSpace ? "[\n" : "[";
18413
+ for (let i = 0; i < array.length; i++) {
18414
+ const item = typeof replacer === "function" ? replacer.call(array, String(i), array[i]) : array[i];
18549
18415
  if (resolvedSpace) {
18550
18416
  str += childIndent;
18551
18417
  }
@@ -18565,22 +18431,22 @@ var starknet = (() => {
18565
18431
  if (typeof object.toJSON === "function") {
18566
18432
  return stringify(object.toJSON(), replacer, space, void 0);
18567
18433
  }
18568
- var keys = Array.isArray(replacer) ? replacer.map(String) : Object.keys(object);
18434
+ const keys = Array.isArray(replacer) ? replacer.map(String) : Object.keys(object);
18569
18435
  if (keys.length === 0) {
18570
18436
  return "{}";
18571
18437
  }
18572
- var childIndent = resolvedSpace ? indent + resolvedSpace : void 0;
18573
- var first = true;
18574
- var str = resolvedSpace ? "{\n" : "{";
18575
- keys.forEach(function(key) {
18576
- var value2 = typeof replacer === "function" ? replacer.call(object, key, object[key]) : object[key];
18438
+ const childIndent = resolvedSpace ? indent + resolvedSpace : void 0;
18439
+ let first = true;
18440
+ let str = resolvedSpace ? "{\n" : "{";
18441
+ keys.forEach((key) => {
18442
+ const value2 = typeof replacer === "function" ? replacer.call(object, key, object[key]) : object[key];
18577
18443
  if (includeProperty(key, value2)) {
18578
18444
  if (first) {
18579
18445
  first = false;
18580
18446
  } else {
18581
18447
  str += resolvedSpace ? ",\n" : ",";
18582
18448
  }
18583
- var keyStr = JSON.stringify(key);
18449
+ const keyStr = JSON.stringify(key);
18584
18450
  str += resolvedSpace ? childIndent + keyStr + ": " : keyStr + ":";
18585
18451
  str += stringifyValue(value2, childIndent);
18586
18452
  }
@@ -18589,7 +18455,7 @@ var starknet = (() => {
18589
18455
  return str;
18590
18456
  }
18591
18457
  function includeProperty(key, value2) {
18592
- return typeof value2 !== "undefined" && typeof value2 !== "function" && _typeof4(value2) !== "symbol";
18458
+ return typeof value2 !== "undefined" && typeof value2 !== "function" && typeof value2 !== "symbol";
18593
18459
  }
18594
18460
  }
18595
18461
  function resolveSpace(space) {
@@ -24355,7 +24221,7 @@ var starknet = (() => {
24355
24221
  prototypeStrategy: "copy",
24356
24222
  decoratorInheritance: "deep"
24357
24223
  };
24358
- var mixins = /* @__PURE__ */ new Map();
24224
+ var mixins = /* @__PURE__ */ new WeakMap();
24359
24225
  var getMixinsForClass = (clazz) => mixins.get(clazz);
24360
24226
  var registerMixins = (mixedClass, constituents) => mixins.set(mixedClass, constituents);
24361
24227
  var mergeObjectsOfDecorators = (o1, o2) => {
@@ -24579,9 +24445,9 @@ var starknet = (() => {
24579
24445
  }
24580
24446
 
24581
24447
  // src/provider/extensions/starknetId.ts
24582
- var StarknetId = class {
24448
+ var StarknetId = class _StarknetId {
24583
24449
  async getStarkName(address, StarknetIdContract2) {
24584
- return StarknetId.getStarkName(
24450
+ return _StarknetId.getStarkName(
24585
24451
  // After Mixin, this is ProviderInterface
24586
24452
  this,
24587
24453
  address,
@@ -24589,7 +24455,7 @@ var starknet = (() => {
24589
24455
  );
24590
24456
  }
24591
24457
  async getAddressFromStarkName(name, StarknetIdContract2) {
24592
- return StarknetId.getAddressFromStarkName(
24458
+ return _StarknetId.getAddressFromStarkName(
24593
24459
  // After Mixin, this is ProviderInterface
24594
24460
  this,
24595
24461
  name,
@@ -24675,7 +24541,7 @@ var starknet = (() => {
24675
24541
  MerkleTree: () => MerkleTree,
24676
24542
  proofMerklePath: () => proofMerklePath
24677
24543
  });
24678
- var MerkleTree = class {
24544
+ var MerkleTree = class _MerkleTree {
24679
24545
  leaves;
24680
24546
  branches = [];
24681
24547
  root;
@@ -24700,9 +24566,9 @@ var starknet = (() => {
24700
24566
  const newLeaves = [];
24701
24567
  for (let i = 0; i < leaves.length; i += 2) {
24702
24568
  if (i + 1 === leaves.length) {
24703
- newLeaves.push(MerkleTree.hash(leaves[i], "0x0", this.hashMethod));
24569
+ newLeaves.push(_MerkleTree.hash(leaves[i], "0x0", this.hashMethod));
24704
24570
  } else {
24705
- newLeaves.push(MerkleTree.hash(leaves[i], leaves[i + 1], this.hashMethod));
24571
+ newLeaves.push(_MerkleTree.hash(leaves[i], leaves[i + 1], this.hashMethod));
24706
24572
  }
24707
24573
  }
24708
24574
  return this.build(newLeaves);
@@ -24736,7 +24602,7 @@ var starknet = (() => {
24736
24602
  const currentBranchLevelIndex = this.leaves.length === branch.length ? -1 : this.branches.findIndex((b) => b.length === branch.length);
24737
24603
  const nextBranch = this.branches[currentBranchLevelIndex + 1] ?? [this.root];
24738
24604
  return this.getProof(
24739
- MerkleTree.hash(isLeft ? leaf : neededBranch, isLeft ? neededBranch : leaf, this.hashMethod),
24605
+ _MerkleTree.hash(isLeft ? leaf : neededBranch, isLeft ? neededBranch : leaf, this.hashMethod),
24740
24606
  nextBranch,
24741
24607
  newHashPath
24742
24608
  );
@@ -26327,8 +26193,8 @@ var starknet = (() => {
26327
26193
  }
26328
26194
  function getChecksumAddress(address) {
26329
26195
  const chars = removeHexPrefix(validateAndParseAddress(address)).toLowerCase().split("");
26330
- const hex2 = removeHexPrefix(keccakBn(address));
26331
- const hashed = hexToBytes(hex2.padStart(64, "0"));
26196
+ const hex = removeHexPrefix(keccakBn(address));
26197
+ const hashed = hexToBytes(hex.padStart(64, "0"));
26332
26198
  for (let i = 0; i < chars.length; i += 2) {
26333
26199
  if (hashed[i >> 1] >> 4 >= 8) {
26334
26200
  chars[i] = chars[i].toUpperCase();