@gearbox-protocol/deploy-tools 5.1.3 → 5.1.4

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.
Files changed (2) hide show
  1. package/dist/index.mjs +2668 -557
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -979,7 +979,7 @@ var require_command = __commonJS({
979
979
  "../../node_modules/commander/lib/command.js"(exports2) {
980
980
  var EventEmitter = __require("node:events").EventEmitter;
981
981
  var childProcess = __require("node:child_process");
982
- var path10 = __require("node:path");
982
+ var path11 = __require("node:path");
983
983
  var fs3 = __require("node:fs");
984
984
  var process3 = __require("node:process");
985
985
  var { Argument: Argument2, humanReadableArgName } = require_argument();
@@ -1912,9 +1912,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
1912
1912
  let launchWithNode = false;
1913
1913
  const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
1914
1914
  function findFile(baseDir, baseName) {
1915
- const localBin = path10.resolve(baseDir, baseName);
1915
+ const localBin = path11.resolve(baseDir, baseName);
1916
1916
  if (fs3.existsSync(localBin)) return localBin;
1917
- if (sourceExt.includes(path10.extname(baseName))) return void 0;
1917
+ if (sourceExt.includes(path11.extname(baseName))) return void 0;
1918
1918
  const foundExt = sourceExt.find(
1919
1919
  (ext) => fs3.existsSync(`${localBin}${ext}`)
1920
1920
  );
@@ -1932,17 +1932,17 @@ Expecting one of '${allowedValues.join("', '")}'`);
1932
1932
  } catch (err) {
1933
1933
  resolvedScriptPath = this._scriptPath;
1934
1934
  }
1935
- executableDir = path10.resolve(
1936
- path10.dirname(resolvedScriptPath),
1935
+ executableDir = path11.resolve(
1936
+ path11.dirname(resolvedScriptPath),
1937
1937
  executableDir
1938
1938
  );
1939
1939
  }
1940
1940
  if (executableDir) {
1941
1941
  let localFile = findFile(executableDir, executableFile);
1942
1942
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
1943
- const legacyName = path10.basename(
1943
+ const legacyName = path11.basename(
1944
1944
  this._scriptPath,
1945
- path10.extname(this._scriptPath)
1945
+ path11.extname(this._scriptPath)
1946
1946
  );
1947
1947
  if (legacyName !== this._name) {
1948
1948
  localFile = findFile(
@@ -1953,7 +1953,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1953
1953
  }
1954
1954
  executableFile = localFile || executableFile;
1955
1955
  }
1956
- launchWithNode = sourceExt.includes(path10.extname(executableFile));
1956
+ launchWithNode = sourceExt.includes(path11.extname(executableFile));
1957
1957
  let proc;
1958
1958
  if (process3.platform !== "win32") {
1959
1959
  if (launchWithNode) {
@@ -2793,7 +2793,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
2793
2793
  * @return {Command}
2794
2794
  */
2795
2795
  nameFromFilename(filename) {
2796
- this._name = path10.basename(filename, path10.extname(filename));
2796
+ this._name = path11.basename(filename, path11.extname(filename));
2797
2797
  return this;
2798
2798
  }
2799
2799
  /**
@@ -2807,9 +2807,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
2807
2807
  * @param {string} [path]
2808
2808
  * @return {(string|null|Command)}
2809
2809
  */
2810
- executableDir(path11) {
2811
- if (path11 === void 0) return this._executableDir;
2812
- this._executableDir = path11;
2810
+ executableDir(path12) {
2811
+ if (path12 === void 0) return this._executableDir;
2812
+ this._executableDir = path12;
2813
2813
  return this;
2814
2814
  }
2815
2815
  /**
@@ -17239,12 +17239,12 @@ var require_abstract_coder = __commonJS({
17239
17239
  var logger2 = new logger_1.Logger(_version_1.version);
17240
17240
  function checkResultErrors(result) {
17241
17241
  var errors = [];
17242
- var checkErrors = function(path10, object) {
17242
+ var checkErrors = function(path11, object) {
17243
17243
  if (!Array.isArray(object)) {
17244
17244
  return;
17245
17245
  }
17246
17246
  for (var key in object) {
17247
- var childPath = path10.slice();
17247
+ var childPath = path11.slice();
17248
17248
  childPath.push(key);
17249
17249
  try {
17250
17250
  checkErrors(childPath, object[key]);
@@ -31281,9 +31281,9 @@ var require_lib20 = __commonJS({
31281
31281
  if (index2 > 4294967295) {
31282
31282
  throw new Error("invalid index - " + String(index2));
31283
31283
  }
31284
- var path10 = this.path;
31285
- if (path10) {
31286
- path10 += "/" + (index2 & ~HardenedBit);
31284
+ var path11 = this.path;
31285
+ if (path11) {
31286
+ path11 += "/" + (index2 & ~HardenedBit);
31287
31287
  }
31288
31288
  var data = new Uint8Array(37);
31289
31289
  if (index2 & HardenedBit) {
@@ -31291,8 +31291,8 @@ var require_lib20 = __commonJS({
31291
31291
  throw new Error("cannot derive child of neutered node");
31292
31292
  }
31293
31293
  data.set((0, bytes_1.arrayify)(this.privateKey), 1);
31294
- if (path10) {
31295
- path10 += "'";
31294
+ if (path11) {
31295
+ path11 += "'";
31296
31296
  }
31297
31297
  } else {
31298
31298
  data.set((0, bytes_1.arrayify)(this.publicKey));
@@ -31311,21 +31311,21 @@ var require_lib20 = __commonJS({
31311
31311
  var ek = new signing_key_1.SigningKey((0, bytes_1.hexlify)(IL));
31312
31312
  Ki = ek._addPoint(this.publicKey);
31313
31313
  }
31314
- var mnemonicOrPath = path10;
31314
+ var mnemonicOrPath = path11;
31315
31315
  var srcMnemonic = this.mnemonic;
31316
31316
  if (srcMnemonic) {
31317
31317
  mnemonicOrPath = Object.freeze({
31318
31318
  phrase: srcMnemonic.phrase,
31319
- path: path10,
31319
+ path: path11,
31320
31320
  locale: srcMnemonic.locale || "en"
31321
31321
  });
31322
31322
  }
31323
31323
  return new HDNode2(_constructorGuard, ki, Ki, this.fingerprint, bytes32(IR), index2, this.depth + 1, mnemonicOrPath);
31324
31324
  };
31325
- HDNode2.prototype.derivePath = function(path10) {
31326
- var components = path10.split("/");
31325
+ HDNode2.prototype.derivePath = function(path11) {
31326
+ var components = path11.split("/");
31327
31327
  if (components.length === 0 || components[0] === "m" && this.depth !== 0) {
31328
- throw new Error("invalid path - " + path10);
31328
+ throw new Error("invalid path - " + path11);
31329
31329
  }
31330
31330
  if (components[0] === "m") {
31331
31331
  components.shift();
@@ -32079,9 +32079,9 @@ var require_utils4 = __commonJS({
32079
32079
  return (0, bytes_1.arrayify)(password);
32080
32080
  }
32081
32081
  exports2.getPassword = getPassword;
32082
- function searchPath(object, path10) {
32082
+ function searchPath(object, path11) {
32083
32083
  var currentChild = object;
32084
- var comps = path10.toLowerCase().split("/");
32084
+ var comps = path11.toLowerCase().split("/");
32085
32085
  for (var i = 0; i < comps.length; i++) {
32086
32086
  var matchingChild = null;
32087
32087
  for (var key in currentChild) {
@@ -32968,12 +32968,12 @@ var require_keystore = __commonJS({
32968
32968
  var mnemonicIv = (0, utils_1.looseArrayify)((0, utils_1.searchPath)(data, "x-ethers/mnemonicCounter"));
32969
32969
  var mnemonicCounter = new aes_js_1.default.Counter(mnemonicIv);
32970
32970
  var mnemonicAesCtr = new aes_js_1.default.ModeOfOperation.ctr(mnemonicKey, mnemonicCounter);
32971
- var path10 = (0, utils_1.searchPath)(data, "x-ethers/path") || hdnode_1.defaultPath;
32971
+ var path11 = (0, utils_1.searchPath)(data, "x-ethers/path") || hdnode_1.defaultPath;
32972
32972
  var locale = (0, utils_1.searchPath)(data, "x-ethers/locale") || "en";
32973
32973
  var entropy = (0, bytes_1.arrayify)(mnemonicAesCtr.decrypt(mnemonicCiphertext));
32974
32974
  try {
32975
32975
  var mnemonic = (0, hdnode_1.entropyToMnemonic)(entropy, locale);
32976
- var node = hdnode_1.HDNode.fromMnemonic(mnemonic, null, locale).derivePath(path10);
32976
+ var node = hdnode_1.HDNode.fromMnemonic(mnemonic, null, locale).derivePath(path11);
32977
32977
  if (node.privateKey != account.privateKey) {
32978
32978
  throw new Error("mnemonic mismatch");
32979
32979
  }
@@ -33083,12 +33083,12 @@ var require_keystore = __commonJS({
33083
33083
  var privateKey = (0, bytes_1.arrayify)(account.privateKey);
33084
33084
  var passwordBytes = (0, utils_1.getPassword)(password);
33085
33085
  var entropy = null;
33086
- var path10 = null;
33086
+ var path11 = null;
33087
33087
  var locale = null;
33088
33088
  if (hasMnemonic(account)) {
33089
33089
  var srcMnemonic = account.mnemonic;
33090
33090
  entropy = (0, bytes_1.arrayify)((0, hdnode_1.mnemonicToEntropy)(srcMnemonic.phrase, srcMnemonic.locale || "en"));
33091
- path10 = srcMnemonic.path || hdnode_1.defaultPath;
33091
+ path11 = srcMnemonic.path || hdnode_1.defaultPath;
33092
33092
  locale = srcMnemonic.locale || "en";
33093
33093
  }
33094
33094
  var client = options.client;
@@ -33174,7 +33174,7 @@ var require_keystore = __commonJS({
33174
33174
  gethFilename: "UTC--" + timestamp + "--" + data.address,
33175
33175
  mnemonicCounter: (0, bytes_1.hexlify)(mnemonicIv).substring(2),
33176
33176
  mnemonicCiphertext: (0, bytes_1.hexlify)(mnemonicCiphertext).substring(2),
33177
- path: path10,
33177
+ path: path11,
33178
33178
  locale,
33179
33179
  version: "0.1"
33180
33180
  };
@@ -34541,11 +34541,11 @@ var require_lib27 = __commonJS({
34541
34541
  Wallet2.fromEncryptedJsonSync = function(json, password) {
34542
34542
  return new Wallet2((0, json_wallets_1.decryptJsonWalletSync)(json, password));
34543
34543
  };
34544
- Wallet2.fromMnemonic = function(mnemonic, path10, wordlist) {
34545
- if (!path10) {
34546
- path10 = hdnode_1.defaultPath;
34544
+ Wallet2.fromMnemonic = function(mnemonic, path11, wordlist) {
34545
+ if (!path11) {
34546
+ path11 = hdnode_1.defaultPath;
34547
34547
  }
34548
- return new Wallet2(hdnode_1.HDNode.fromMnemonic(mnemonic, null, wordlist).derivePath(path10));
34548
+ return new Wallet2(hdnode_1.HDNode.fromMnemonic(mnemonic, null, wordlist).derivePath(path11));
34549
34549
  };
34550
34550
  return Wallet2;
34551
34551
  }(abstract_signer_1.Signer)
@@ -46608,13 +46608,13 @@ var require_ipc_provider = __commonJS({
46608
46608
  /** @class */
46609
46609
  function(_super) {
46610
46610
  __extends4(IpcProvider2, _super);
46611
- function IpcProvider2(path10, network) {
46611
+ function IpcProvider2(path11, network) {
46612
46612
  var _this = this;
46613
- if (path10 == null) {
46613
+ if (path11 == null) {
46614
46614
  logger2.throwError("missing path", logger_1.Logger.errors.MISSING_ARGUMENT, { arg: "path" });
46615
46615
  }
46616
- _this = _super.call(this, "ipc://" + path10, network) || this;
46617
- (0, properties_1.defineReadOnly)(_this, "path", path10);
46616
+ _this = _super.call(this, "ipc://" + path11, network) || this;
46617
+ (0, properties_1.defineReadOnly)(_this, "path", path11);
46618
46618
  return _this;
46619
46619
  }
46620
46620
  IpcProvider2.prototype.send = function(method, params) {
@@ -47213,21 +47213,21 @@ var require_web3_provider = __commonJS({
47213
47213
  if (provider == null) {
47214
47214
  logger2.throwArgumentError("missing provider", "provider", provider);
47215
47215
  }
47216
- var path10 = null;
47216
+ var path11 = null;
47217
47217
  var jsonRpcFetchFunc = null;
47218
47218
  var subprovider = null;
47219
47219
  if (typeof provider === "function") {
47220
- path10 = "unknown:";
47220
+ path11 = "unknown:";
47221
47221
  jsonRpcFetchFunc = provider;
47222
47222
  } else {
47223
- path10 = provider.host || provider.path || "";
47224
- if (!path10 && provider.isMetaMask) {
47225
- path10 = "metamask";
47223
+ path11 = provider.host || provider.path || "";
47224
+ if (!path11 && provider.isMetaMask) {
47225
+ path11 = "metamask";
47226
47226
  }
47227
47227
  subprovider = provider;
47228
47228
  if (provider.request) {
47229
- if (path10 === "") {
47230
- path10 = "eip-1193:";
47229
+ if (path11 === "") {
47230
+ path11 = "eip-1193:";
47231
47231
  }
47232
47232
  jsonRpcFetchFunc = buildEip1193Fetcher(provider);
47233
47233
  } else if (provider.sendAsync) {
@@ -47237,11 +47237,11 @@ var require_web3_provider = __commonJS({
47237
47237
  } else {
47238
47238
  logger2.throwArgumentError("unsupported provider", "provider", provider);
47239
47239
  }
47240
- if (!path10) {
47241
- path10 = "unknown:";
47240
+ if (!path11) {
47241
+ path11 = "unknown:";
47242
47242
  }
47243
47243
  }
47244
- _this = _super.call(this, path10, network) || this;
47244
+ _this = _super.call(this, path11, network) || this;
47245
47245
  (0, properties_1.defineReadOnly)(_this, "jsonRpcFetchFunc", jsonRpcFetchFunc);
47246
47246
  (0, properties_1.defineReadOnly)(_this, "provider", subprovider);
47247
47247
  return _this;
@@ -59521,11 +59521,11 @@ var require_mime_types = __commonJS({
59521
59521
  }
59522
59522
  return exts[0];
59523
59523
  }
59524
- function lookup(path10) {
59525
- if (!path10 || typeof path10 !== "string") {
59524
+ function lookup(path11) {
59525
+ if (!path11 || typeof path11 !== "string") {
59526
59526
  return false;
59527
59527
  }
59528
- var extension2 = extname("x." + path10).toLowerCase().substr(1);
59528
+ var extension2 = extname("x." + path11).toLowerCase().substr(1);
59529
59529
  if (!extension2) {
59530
59530
  return false;
59531
59531
  }
@@ -59782,7 +59782,7 @@ var require_form_data = __commonJS({
59782
59782
  "../../node_modules/form-data/lib/form_data.js"(exports2, module2) {
59783
59783
  var CombinedStream = require_combined_stream();
59784
59784
  var util2 = __require("util");
59785
- var path10 = __require("path");
59785
+ var path11 = __require("path");
59786
59786
  var http2 = __require("http");
59787
59787
  var https = __require("https");
59788
59788
  var parseUrl = __require("url").parse;
@@ -59908,11 +59908,11 @@ var require_form_data = __commonJS({
59908
59908
  FormData2.prototype._getContentDisposition = function(value, options) {
59909
59909
  var filename, contentDisposition;
59910
59910
  if (typeof options.filepath === "string") {
59911
- filename = path10.normalize(options.filepath).replace(/\\/g, "/");
59911
+ filename = path11.normalize(options.filepath).replace(/\\/g, "/");
59912
59912
  } else if (options.filename || value.name || value.path) {
59913
- filename = path10.basename(options.filename || value.name || value.path);
59913
+ filename = path11.basename(options.filename || value.name || value.path);
59914
59914
  } else if (value.readable && value.hasOwnProperty("httpVersion")) {
59915
- filename = path10.basename(value.client._httpMessage.path || "");
59915
+ filename = path11.basename(value.client._httpMessage.path || "");
59916
59916
  }
59917
59917
  if (filename) {
59918
59918
  contentDisposition = 'filename="' + filename + '"';
@@ -61926,9 +61926,9 @@ var require_axios = __commonJS({
61926
61926
  function removeBrackets(key) {
61927
61927
  return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
61928
61928
  }
61929
- function renderKey(path10, key, dots) {
61930
- if (!path10) return key;
61931
- return path10.concat(key).map(function each(token, i) {
61929
+ function renderKey(path11, key, dots) {
61930
+ if (!path11) return key;
61931
+ return path11.concat(key).map(function each(token, i) {
61932
61932
  token = removeBrackets(token);
61933
61933
  return !dots && i ? "[" + token + "]" : token;
61934
61934
  }).join(dots ? "." : "");
@@ -61973,9 +61973,9 @@ var require_axios = __commonJS({
61973
61973
  }
61974
61974
  return value;
61975
61975
  }
61976
- function defaultVisitor(value, key, path10) {
61976
+ function defaultVisitor(value, key, path11) {
61977
61977
  let arr = value;
61978
- if (value && !path10 && typeof value === "object") {
61978
+ if (value && !path11 && typeof value === "object") {
61979
61979
  if (utils$1.endsWith(key, "{}")) {
61980
61980
  key = metaTokens ? key : key.slice(0, -2);
61981
61981
  value = JSON.stringify(value);
@@ -61994,7 +61994,7 @@ var require_axios = __commonJS({
61994
61994
  if (isVisitable(value)) {
61995
61995
  return true;
61996
61996
  }
61997
- formData.append(renderKey(path10, key, dots), convertValue(value));
61997
+ formData.append(renderKey(path11, key, dots), convertValue(value));
61998
61998
  return false;
61999
61999
  }
62000
62000
  const stack = [];
@@ -62003,10 +62003,10 @@ var require_axios = __commonJS({
62003
62003
  convertValue,
62004
62004
  isVisitable
62005
62005
  });
62006
- function build(value, path10) {
62006
+ function build(value, path11) {
62007
62007
  if (utils$1.isUndefined(value)) return;
62008
62008
  if (stack.indexOf(value) !== -1) {
62009
- throw Error("Circular reference detected in " + path10.join("."));
62009
+ throw Error("Circular reference detected in " + path11.join("."));
62010
62010
  }
62011
62011
  stack.push(value);
62012
62012
  utils$1.forEach(value, function each(el, key) {
@@ -62014,11 +62014,11 @@ var require_axios = __commonJS({
62014
62014
  formData,
62015
62015
  el,
62016
62016
  utils$1.isString(key) ? key.trim() : key,
62017
- path10,
62017
+ path11,
62018
62018
  exposedHelpers
62019
62019
  );
62020
62020
  if (result === true) {
62021
- build(el, path10 ? path10.concat(key) : [key]);
62021
+ build(el, path11 ? path11.concat(key) : [key]);
62022
62022
  }
62023
62023
  });
62024
62024
  stack.pop();
@@ -62187,7 +62187,7 @@ var require_axios = __commonJS({
62187
62187
  };
62188
62188
  function toURLEncodedForm(data, options) {
62189
62189
  return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({
62190
- visitor: function(value, key, path10, helpers) {
62190
+ visitor: function(value, key, path11, helpers) {
62191
62191
  if (platform.isNode && utils$1.isBuffer(value)) {
62192
62192
  this.append(key, value.toString("base64"));
62193
62193
  return false;
@@ -62214,11 +62214,11 @@ var require_axios = __commonJS({
62214
62214
  return obj;
62215
62215
  }
62216
62216
  function formDataToJSON(formData) {
62217
- function buildPath(path10, value, target, index2) {
62218
- let name = path10[index2++];
62217
+ function buildPath(path11, value, target, index2) {
62218
+ let name = path11[index2++];
62219
62219
  if (name === "__proto__") return true;
62220
62220
  const isNumericKey = Number.isFinite(+name);
62221
- const isLast = index2 >= path10.length;
62221
+ const isLast = index2 >= path11.length;
62222
62222
  name = !name && utils$1.isArray(target) ? target.length : name;
62223
62223
  if (isLast) {
62224
62224
  if (utils$1.hasOwnProp(target, name)) {
@@ -62231,7 +62231,7 @@ var require_axios = __commonJS({
62231
62231
  if (!target[name] || !utils$1.isObject(target[name])) {
62232
62232
  target[name] = [];
62233
62233
  }
62234
- const result = buildPath(path10, value, target[name], index2);
62234
+ const result = buildPath(path11, value, target[name], index2);
62235
62235
  if (result && utils$1.isArray(target[name])) {
62236
62236
  target[name] = arrayToObject(target[name]);
62237
62237
  }
@@ -63289,9 +63289,9 @@ var require_axios = __commonJS({
63289
63289
  auth = urlUsername + ":" + urlPassword;
63290
63290
  }
63291
63291
  auth && headers.delete("authorization");
63292
- let path10;
63292
+ let path11;
63293
63293
  try {
63294
- path10 = buildURL(
63294
+ path11 = buildURL(
63295
63295
  parsed.pathname + parsed.search,
63296
63296
  config.params,
63297
63297
  config.paramsSerializer
@@ -63309,7 +63309,7 @@ var require_axios = __commonJS({
63309
63309
  false
63310
63310
  );
63311
63311
  const options = {
63312
- path: path10,
63312
+ path: path11,
63313
63313
  method,
63314
63314
  headers: headers.toJSON(),
63315
63315
  agents: { http: config.httpAgent, https: config.httpsAgent },
@@ -63535,10 +63535,10 @@ var require_axios = __commonJS({
63535
63535
  var cookies = platform.hasStandardBrowserEnv ? (
63536
63536
  // Standard browser envs support document.cookie
63537
63537
  {
63538
- write(name, value, expires, path10, domain, secure) {
63538
+ write(name, value, expires, path11, domain, secure) {
63539
63539
  const cookie = [name + "=" + encodeURIComponent(value)];
63540
63540
  utils$1.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
63541
- utils$1.isString(path10) && cookie.push("path=" + path10);
63541
+ utils$1.isString(path11) && cookie.push("path=" + path11);
63542
63542
  utils$1.isString(domain) && cookie.push("domain=" + domain);
63543
63543
  secure === true && cookie.push("secure");
63544
63544
  document.cookie = cookie.join("; ");
@@ -66080,8 +66080,8 @@ var require_parseUtil = __commonJS({
66080
66080
  var errors_1 = require_errors();
66081
66081
  var en_1 = __importDefault4(require_en());
66082
66082
  var makeIssue2 = (params) => {
66083
- const { data, path: path10, errorMaps, issueData } = params;
66084
- const fullPath = [...path10, ...issueData.path || []];
66083
+ const { data, path: path11, errorMaps, issueData } = params;
66084
+ const fullPath = [...path11, ...issueData.path || []];
66085
66085
  const fullIssue = {
66086
66086
  ...issueData,
66087
66087
  path: fullPath
@@ -66247,11 +66247,11 @@ var require_types3 = __commonJS({
66247
66247
  var util_1 = require_util();
66248
66248
  var ZodError_1 = require_ZodError();
66249
66249
  var ParseInputLazyPath2 = class {
66250
- constructor(parent, value, path10, key) {
66250
+ constructor(parent, value, path11, key) {
66251
66251
  this._cachedPath = [];
66252
66252
  this.parent = parent;
66253
66253
  this.data = value;
66254
- this._path = path10;
66254
+ this._path = path11;
66255
66255
  this._key = key;
66256
66256
  }
66257
66257
  get path() {
@@ -72651,11 +72651,11 @@ var require_lodash = __commonJS({
72651
72651
  return isFunction2(object[key]);
72652
72652
  });
72653
72653
  }
72654
- function baseGet2(object, path10) {
72655
- path10 = castPath2(path10, object);
72656
- var index2 = 0, length = path10.length;
72654
+ function baseGet2(object, path11) {
72655
+ path11 = castPath2(path11, object);
72656
+ var index2 = 0, length = path11.length;
72657
72657
  while (object != null && index2 < length) {
72658
- object = object[toKey2(path10[index2++])];
72658
+ object = object[toKey2(path11[index2++])];
72659
72659
  }
72660
72660
  return index2 && index2 == length ? object : undefined2;
72661
72661
  }
@@ -72719,10 +72719,10 @@ var require_lodash = __commonJS({
72719
72719
  });
72720
72720
  return accumulator;
72721
72721
  }
72722
- function baseInvoke(object, path10, args) {
72723
- path10 = castPath2(path10, object);
72724
- object = parent(object, path10);
72725
- var func = object == null ? object : object[toKey2(last(path10))];
72722
+ function baseInvoke(object, path11, args) {
72723
+ path11 = castPath2(path11, object);
72724
+ object = parent(object, path11);
72725
+ var func = object == null ? object : object[toKey2(last(path11))];
72726
72726
  return func == null ? undefined2 : apply(func, object, args);
72727
72727
  }
72728
72728
  function baseIsArguments2(value) {
@@ -72878,13 +72878,13 @@ var require_lodash = __commonJS({
72878
72878
  return object === source || baseIsMatch2(object, source, matchData);
72879
72879
  };
72880
72880
  }
72881
- function baseMatchesProperty2(path10, srcValue) {
72882
- if (isKey2(path10) && isStrictComparable2(srcValue)) {
72883
- return matchesStrictComparable2(toKey2(path10), srcValue);
72881
+ function baseMatchesProperty2(path11, srcValue) {
72882
+ if (isKey2(path11) && isStrictComparable2(srcValue)) {
72883
+ return matchesStrictComparable2(toKey2(path11), srcValue);
72884
72884
  }
72885
72885
  return function(object) {
72886
- var objValue = get2(object, path10);
72887
- return objValue === undefined2 && objValue === srcValue ? hasIn2(object, path10) : baseIsEqual2(srcValue, objValue, COMPARE_PARTIAL_FLAG7 | COMPARE_UNORDERED_FLAG5);
72886
+ var objValue = get2(object, path11);
72887
+ return objValue === undefined2 && objValue === srcValue ? hasIn2(object, path11) : baseIsEqual2(srcValue, objValue, COMPARE_PARTIAL_FLAG7 | COMPARE_UNORDERED_FLAG5);
72888
72888
  };
72889
72889
  }
72890
72890
  function baseMerge(object, source, srcIndex, customizer, stack) {
@@ -72981,23 +72981,23 @@ var require_lodash = __commonJS({
72981
72981
  });
72982
72982
  }
72983
72983
  function basePick(object, paths) {
72984
- return basePickBy(object, paths, function(value, path10) {
72985
- return hasIn2(object, path10);
72984
+ return basePickBy(object, paths, function(value, path11) {
72985
+ return hasIn2(object, path11);
72986
72986
  });
72987
72987
  }
72988
72988
  function basePickBy(object, paths, predicate) {
72989
72989
  var index2 = -1, length = paths.length, result2 = {};
72990
72990
  while (++index2 < length) {
72991
- var path10 = paths[index2], value = baseGet2(object, path10);
72992
- if (predicate(value, path10)) {
72993
- baseSet(result2, castPath2(path10, object), value);
72991
+ var path11 = paths[index2], value = baseGet2(object, path11);
72992
+ if (predicate(value, path11)) {
72993
+ baseSet(result2, castPath2(path11, object), value);
72994
72994
  }
72995
72995
  }
72996
72996
  return result2;
72997
72997
  }
72998
- function basePropertyDeep2(path10) {
72998
+ function basePropertyDeep2(path11) {
72999
72999
  return function(object) {
73000
- return baseGet2(object, path10);
73000
+ return baseGet2(object, path11);
73001
73001
  };
73002
73002
  }
73003
73003
  function basePullAll(array, values2, iteratee2, comparator) {
@@ -73071,14 +73071,14 @@ var require_lodash = __commonJS({
73071
73071
  var array = values(collection);
73072
73072
  return shuffleSelf(array, baseClamp(n, 0, array.length));
73073
73073
  }
73074
- function baseSet(object, path10, value, customizer) {
73074
+ function baseSet(object, path11, value, customizer) {
73075
73075
  if (!isObject2(object)) {
73076
73076
  return object;
73077
73077
  }
73078
- path10 = castPath2(path10, object);
73079
- var index2 = -1, length = path10.length, lastIndex = length - 1, nested = object;
73078
+ path11 = castPath2(path11, object);
73079
+ var index2 = -1, length = path11.length, lastIndex = length - 1, nested = object;
73080
73080
  while (nested != null && ++index2 < length) {
73081
- var key = toKey2(path10[index2]), newValue = value;
73081
+ var key = toKey2(path11[index2]), newValue = value;
73082
73082
  if (key === "__proto__" || key === "constructor" || key === "prototype") {
73083
73083
  return object;
73084
73084
  }
@@ -73086,7 +73086,7 @@ var require_lodash = __commonJS({
73086
73086
  var objValue = nested[key];
73087
73087
  newValue = customizer ? customizer(objValue, key, nested) : undefined2;
73088
73088
  if (newValue === undefined2) {
73089
- newValue = isObject2(objValue) ? objValue : isIndex2(path10[index2 + 1]) ? [] : {};
73089
+ newValue = isObject2(objValue) ? objValue : isIndex2(path11[index2 + 1]) ? [] : {};
73090
73090
  }
73091
73091
  }
73092
73092
  assignValue(nested, key, newValue);
@@ -73252,13 +73252,13 @@ var require_lodash = __commonJS({
73252
73252
  }
73253
73253
  return result2;
73254
73254
  }
73255
- function baseUnset(object, path10) {
73256
- path10 = castPath2(path10, object);
73257
- object = parent(object, path10);
73258
- return object == null || delete object[toKey2(last(path10))];
73255
+ function baseUnset(object, path11) {
73256
+ path11 = castPath2(path11, object);
73257
+ object = parent(object, path11);
73258
+ return object == null || delete object[toKey2(last(path11))];
73259
73259
  }
73260
- function baseUpdate(object, path10, updater, customizer) {
73261
- return baseSet(object, path10, updater(baseGet2(object, path10)), customizer);
73260
+ function baseUpdate(object, path11, updater, customizer) {
73261
+ return baseSet(object, path11, updater(baseGet2(object, path11)), customizer);
73262
73262
  }
73263
73263
  function baseWhile(array, predicate, isDrop, fromRight) {
73264
73264
  var length = array.length, index2 = fromRight ? length : -1;
@@ -74141,11 +74141,11 @@ var require_lodash = __commonJS({
74141
74141
  var match2 = source.match(reWrapDetails);
74142
74142
  return match2 ? match2[1].split(reSplitDetails) : [];
74143
74143
  }
74144
- function hasPath2(object, path10, hasFunc) {
74145
- path10 = castPath2(path10, object);
74146
- var index2 = -1, length = path10.length, result2 = false;
74144
+ function hasPath2(object, path11, hasFunc) {
74145
+ path11 = castPath2(path11, object);
74146
+ var index2 = -1, length = path11.length, result2 = false;
74147
74147
  while (++index2 < length) {
74148
- var key = toKey2(path10[index2]);
74148
+ var key = toKey2(path11[index2]);
74149
74149
  if (!(result2 = object != null && hasFunc(object, key))) {
74150
74150
  break;
74151
74151
  }
@@ -74347,8 +74347,8 @@ var require_lodash = __commonJS({
74347
74347
  return apply(func, this, otherArgs);
74348
74348
  };
74349
74349
  }
74350
- function parent(object, path10) {
74351
- return path10.length < 2 ? object : baseGet2(object, baseSlice2(path10, 0, -1));
74350
+ function parent(object, path11) {
74351
+ return path11.length < 2 ? object : baseGet2(object, baseSlice2(path11, 0, -1));
74352
74352
  }
74353
74353
  function reorder(array, indexes) {
74354
74354
  var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array);
@@ -74983,10 +74983,10 @@ var require_lodash = __commonJS({
74983
74983
  }
74984
74984
  return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
74985
74985
  }
74986
- var invokeMap = baseRest(function(collection, path10, args) {
74987
- var index2 = -1, isFunc = typeof path10 == "function", result2 = isArrayLike2(collection) ? Array2(collection.length) : [];
74986
+ var invokeMap = baseRest(function(collection, path11, args) {
74987
+ var index2 = -1, isFunc = typeof path11 == "function", result2 = isArrayLike2(collection) ? Array2(collection.length) : [];
74988
74988
  baseEach(collection, function(value) {
74989
- result2[++index2] = isFunc ? apply(path10, value, args) : baseInvoke(value, path10, args);
74989
+ result2[++index2] = isFunc ? apply(path11, value, args) : baseInvoke(value, path11, args);
74990
74990
  });
74991
74991
  return result2;
74992
74992
  });
@@ -75638,15 +75638,15 @@ var require_lodash = __commonJS({
75638
75638
  function functionsIn(object) {
75639
75639
  return object == null ? [] : baseFunctions(object, keysIn(object));
75640
75640
  }
75641
- function get2(object, path10, defaultValue) {
75642
- var result2 = object == null ? undefined2 : baseGet2(object, path10);
75641
+ function get2(object, path11, defaultValue) {
75642
+ var result2 = object == null ? undefined2 : baseGet2(object, path11);
75643
75643
  return result2 === undefined2 ? defaultValue : result2;
75644
75644
  }
75645
- function has2(object, path10) {
75646
- return object != null && hasPath2(object, path10, baseHas);
75645
+ function has2(object, path11) {
75646
+ return object != null && hasPath2(object, path11, baseHas);
75647
75647
  }
75648
- function hasIn2(object, path10) {
75649
- return object != null && hasPath2(object, path10, baseHasIn2);
75648
+ function hasIn2(object, path11) {
75649
+ return object != null && hasPath2(object, path11, baseHasIn2);
75650
75650
  }
75651
75651
  var invert2 = createInverter(function(result2, value, key) {
75652
75652
  if (value != null && typeof value.toString != "function") {
@@ -75699,10 +75699,10 @@ var require_lodash = __commonJS({
75699
75699
  return result2;
75700
75700
  }
75701
75701
  var isDeep = false;
75702
- paths = arrayMap2(paths, function(path10) {
75703
- path10 = castPath2(path10, object);
75704
- isDeep || (isDeep = path10.length > 1);
75705
- return path10;
75702
+ paths = arrayMap2(paths, function(path11) {
75703
+ path11 = castPath2(path11, object);
75704
+ isDeep || (isDeep = path11.length > 1);
75705
+ return path11;
75706
75706
  });
75707
75707
  copyObject(object, getAllKeysIn(object), result2);
75708
75708
  if (isDeep) {
@@ -75728,19 +75728,19 @@ var require_lodash = __commonJS({
75728
75728
  return [prop];
75729
75729
  });
75730
75730
  predicate = getIteratee(predicate);
75731
- return basePickBy(object, props, function(value, path10) {
75732
- return predicate(value, path10[0]);
75731
+ return basePickBy(object, props, function(value, path11) {
75732
+ return predicate(value, path11[0]);
75733
75733
  });
75734
75734
  }
75735
- function result(object, path10, defaultValue) {
75736
- path10 = castPath2(path10, object);
75737
- var index2 = -1, length = path10.length;
75735
+ function result(object, path11, defaultValue) {
75736
+ path11 = castPath2(path11, object);
75737
+ var index2 = -1, length = path11.length;
75738
75738
  if (!length) {
75739
75739
  length = 1;
75740
75740
  object = undefined2;
75741
75741
  }
75742
75742
  while (++index2 < length) {
75743
- var value = object == null ? undefined2 : object[toKey2(path10[index2])];
75743
+ var value = object == null ? undefined2 : object[toKey2(path11[index2])];
75744
75744
  if (value === undefined2) {
75745
75745
  index2 = length;
75746
75746
  value = defaultValue;
@@ -75749,12 +75749,12 @@ var require_lodash = __commonJS({
75749
75749
  }
75750
75750
  return object;
75751
75751
  }
75752
- function set(object, path10, value) {
75753
- return object == null ? object : baseSet(object, path10, value);
75752
+ function set(object, path11, value) {
75753
+ return object == null ? object : baseSet(object, path11, value);
75754
75754
  }
75755
- function setWith(object, path10, value, customizer) {
75755
+ function setWith(object, path11, value, customizer) {
75756
75756
  customizer = typeof customizer == "function" ? customizer : undefined2;
75757
- return object == null ? object : baseSet(object, path10, value, customizer);
75757
+ return object == null ? object : baseSet(object, path11, value, customizer);
75758
75758
  }
75759
75759
  var toPairs = createToPairs(keys2);
75760
75760
  var toPairsIn = createToPairs(keysIn);
@@ -75776,15 +75776,15 @@ var require_lodash = __commonJS({
75776
75776
  });
75777
75777
  return accumulator;
75778
75778
  }
75779
- function unset(object, path10) {
75780
- return object == null ? true : baseUnset(object, path10);
75779
+ function unset(object, path11) {
75780
+ return object == null ? true : baseUnset(object, path11);
75781
75781
  }
75782
- function update(object, path10, updater) {
75783
- return object == null ? object : baseUpdate(object, path10, castFunction(updater));
75782
+ function update(object, path11, updater) {
75783
+ return object == null ? object : baseUpdate(object, path11, castFunction(updater));
75784
75784
  }
75785
- function updateWith(object, path10, updater, customizer) {
75785
+ function updateWith(object, path11, updater, customizer) {
75786
75786
  customizer = typeof customizer == "function" ? customizer : undefined2;
75787
- return object == null ? object : baseUpdate(object, path10, castFunction(updater), customizer);
75787
+ return object == null ? object : baseUpdate(object, path11, castFunction(updater), customizer);
75788
75788
  }
75789
75789
  function values(object) {
75790
75790
  return object == null ? [] : baseValues(object, keys2(object));
@@ -76165,17 +76165,17 @@ var require_lodash = __commonJS({
76165
76165
  function matches(source) {
76166
76166
  return baseMatches2(baseClone(source, CLONE_DEEP_FLAG));
76167
76167
  }
76168
- function matchesProperty(path10, srcValue) {
76169
- return baseMatchesProperty2(path10, baseClone(srcValue, CLONE_DEEP_FLAG));
76168
+ function matchesProperty(path11, srcValue) {
76169
+ return baseMatchesProperty2(path11, baseClone(srcValue, CLONE_DEEP_FLAG));
76170
76170
  }
76171
- var method = baseRest(function(path10, args) {
76171
+ var method = baseRest(function(path11, args) {
76172
76172
  return function(object) {
76173
- return baseInvoke(object, path10, args);
76173
+ return baseInvoke(object, path11, args);
76174
76174
  };
76175
76175
  });
76176
76176
  var methodOf = baseRest(function(object, args) {
76177
- return function(path10) {
76178
- return baseInvoke(object, path10, args);
76177
+ return function(path11) {
76178
+ return baseInvoke(object, path11, args);
76179
76179
  };
76180
76180
  });
76181
76181
  function mixin(object, source, options) {
@@ -76222,12 +76222,12 @@ var require_lodash = __commonJS({
76222
76222
  var over = createOver(arrayMap2);
76223
76223
  var overEvery = createOver(arrayEvery);
76224
76224
  var overSome = createOver(arraySome2);
76225
- function property2(path10) {
76226
- return isKey2(path10) ? baseProperty2(toKey2(path10)) : basePropertyDeep2(path10);
76225
+ function property2(path11) {
76226
+ return isKey2(path11) ? baseProperty2(toKey2(path11)) : basePropertyDeep2(path11);
76227
76227
  }
76228
76228
  function propertyOf(object) {
76229
- return function(path10) {
76230
- return object == null ? undefined2 : baseGet2(object, path10);
76229
+ return function(path11) {
76230
+ return object == null ? undefined2 : baseGet2(object, path11);
76231
76231
  };
76232
76232
  }
76233
76233
  var range2 = createRange();
@@ -76680,12 +76680,12 @@ var require_lodash = __commonJS({
76680
76680
  LazyWrapper.prototype.findLast = function(predicate) {
76681
76681
  return this.reverse().find(predicate);
76682
76682
  };
76683
- LazyWrapper.prototype.invokeMap = baseRest(function(path10, args) {
76684
- if (typeof path10 == "function") {
76683
+ LazyWrapper.prototype.invokeMap = baseRest(function(path11, args) {
76684
+ if (typeof path11 == "function") {
76685
76685
  return new LazyWrapper(this);
76686
76686
  }
76687
76687
  return this.map(function(value) {
76688
- return baseInvoke(value, path10, args);
76688
+ return baseInvoke(value, path11, args);
76689
76689
  });
76690
76690
  });
76691
76691
  LazyWrapper.prototype.reject = function(predicate) {
@@ -95640,12 +95640,12 @@ var require_abstract_coder2 = __commonJS({
95640
95640
  exports2.Result = Result;
95641
95641
  function checkResultErrors(result) {
95642
95642
  const errors = [];
95643
- const checkErrors = function(path10, object) {
95643
+ const checkErrors = function(path11, object) {
95644
95644
  if (!Array.isArray(object)) {
95645
95645
  return;
95646
95646
  }
95647
95647
  for (let key in object) {
95648
- const childPath = path10.slice();
95648
+ const childPath = path11.slice();
95649
95649
  childPath.push(key);
95650
95650
  try {
95651
95651
  checkErrors(childPath, object[key]);
@@ -119085,9 +119085,9 @@ var require_provider_ipcsocket = __commonJS({
119085
119085
  get socket() {
119086
119086
  return this.#socket;
119087
119087
  }
119088
- constructor(path10, network, options) {
119088
+ constructor(path11, network, options) {
119089
119089
  super(network, options);
119090
- this.#socket = (0, net_1.connect)(path10);
119090
+ this.#socket = (0, net_1.connect)(path11);
119091
119091
  this.socket.on("ready", async () => {
119092
119092
  try {
119093
119093
  await this._start();
@@ -120398,11 +120398,11 @@ var require_utils11 = __commonJS({
120398
120398
  function spelunk(object, _path) {
120399
120399
  const match2 = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);
120400
120400
  (0, index_js_1.assertArgument)(match2 != null, "invalid path", "path", _path);
120401
- const path10 = match2[1];
120401
+ const path11 = match2[1];
120402
120402
  const type = match2[3];
120403
120403
  const reqd = match2[4] === "!";
120404
120404
  let cur = object;
120405
- for (const comp of path10.toLowerCase().split(".")) {
120405
+ for (const comp of path11.toLowerCase().split(".")) {
120406
120406
  if (Array.isArray(cur)) {
120407
120407
  if (!comp.match(/^[0-9]+$/)) {
120408
120408
  break;
@@ -120424,7 +120424,7 @@ var require_utils11 = __commonJS({
120424
120424
  break;
120425
120425
  }
120426
120426
  }
120427
- (0, index_js_1.assertArgument)(!reqd || cur != null, "missing required value", "path", path10);
120427
+ (0, index_js_1.assertArgument)(!reqd || cur != null, "missing required value", "path", path11);
120428
120428
  if (type && cur != null) {
120429
120429
  if (type === "int") {
120430
120430
  if (typeof cur === "string" && cur.match(/^-?[0-9]+$/)) {
@@ -120449,7 +120449,7 @@ var require_utils11 = __commonJS({
120449
120449
  if (type === typeof cur) {
120450
120450
  return cur;
120451
120451
  }
120452
- (0, index_js_1.assertArgument)(false, `wrong type found for ${type} `, "path", path10);
120452
+ (0, index_js_1.assertArgument)(false, `wrong type found for ${type} `, "path", path11);
120453
120453
  }
120454
120454
  return cur;
120455
120455
  }
@@ -120647,7 +120647,7 @@ var require_json_keystore = __commonJS({
120647
120647
  };
120648
120648
  if (account.mnemonic) {
120649
120649
  const client = options.client != null ? options.client : `ethers/${_version_js_1.version}`;
120650
- const path10 = account.mnemonic.path || defaultPath;
120650
+ const path11 = account.mnemonic.path || defaultPath;
120651
120651
  const locale = account.mnemonic.locale || "en";
120652
120652
  const mnemonicKey = key.slice(32, 64);
120653
120653
  const entropy = (0, index_js_4.getBytes)(account.mnemonic.entropy, "account.mnemonic.entropy");
@@ -120660,7 +120660,7 @@ var require_json_keystore = __commonJS({
120660
120660
  data["x-ethers"] = {
120661
120661
  client,
120662
120662
  gethFilename,
120663
- path: path10,
120663
+ path: path11,
120664
120664
  locale,
120665
120665
  mnemonicCounter: (0, index_js_4.hexlify)(mnemonicIv).substring(2),
120666
120666
  mnemonicCiphertext: (0, index_js_4.hexlify)(mnemonicCiphertext).substring(2),
@@ -120745,11 +120745,11 @@ var require_hdwallet = __commonJS({
120745
120745
  const I = (0, index_js_4.getBytes)((0, index_js_1.computeHmac)("sha512", chainCode, data));
120746
120746
  return { IL: I.slice(0, 32), IR: I.slice(32) };
120747
120747
  }
120748
- function derivePath(node, path10) {
120749
- const components = path10.split("/");
120750
- (0, index_js_4.assertArgument)(components.length > 0, "invalid path", "path", path10);
120748
+ function derivePath(node, path11) {
120749
+ const components = path11.split("/");
120750
+ (0, index_js_4.assertArgument)(components.length > 0, "invalid path", "path", path11);
120751
120751
  if (components[0] === "m") {
120752
- (0, index_js_4.assertArgument)(node.depth === 0, `cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${node.depth}`, "path", path10);
120752
+ (0, index_js_4.assertArgument)(node.depth === 0, `cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${node.depth}`, "path", path11);
120753
120753
  components.shift();
120754
120754
  }
120755
120755
  let result = node;
@@ -120819,7 +120819,7 @@ var require_hdwallet = __commonJS({
120819
120819
  /**
120820
120820
  * @private
120821
120821
  */
120822
- constructor(guard, signingKey, parentFingerprint, chainCode, path10, index2, depth, mnemonic, provider) {
120822
+ constructor(guard, signingKey, parentFingerprint, chainCode, path11, index2, depth, mnemonic, provider) {
120823
120823
  super(signingKey, provider);
120824
120824
  (0, index_js_4.assertPrivate)(guard, _guard, "HDNodeWallet");
120825
120825
  (0, index_js_4.defineProperties)(this, { publicKey: signingKey.compressedPublicKey });
@@ -120828,7 +120828,7 @@ var require_hdwallet = __commonJS({
120828
120828
  parentFingerprint,
120829
120829
  fingerprint,
120830
120830
  chainCode,
120831
- path: path10,
120831
+ path: path11,
120832
120832
  index: index2,
120833
120833
  depth
120834
120834
  });
@@ -120912,22 +120912,22 @@ var require_hdwallet = __commonJS({
120912
120912
  deriveChild(_index) {
120913
120913
  const index2 = (0, index_js_4.getNumber)(_index, "index");
120914
120914
  (0, index_js_4.assertArgument)(index2 <= 4294967295, "invalid index", "index", index2);
120915
- let path10 = this.path;
120916
- if (path10) {
120917
- path10 += "/" + (index2 & ~HardenedBit);
120915
+ let path11 = this.path;
120916
+ if (path11) {
120917
+ path11 += "/" + (index2 & ~HardenedBit);
120918
120918
  if (index2 & HardenedBit) {
120919
- path10 += "'";
120919
+ path11 += "'";
120920
120920
  }
120921
120921
  }
120922
120922
  const { IR, IL } = ser_I(index2, this.chainCode, this.publicKey, this.privateKey);
120923
120923
  const ki = new index_js_1.SigningKey((0, index_js_4.toBeHex)(((0, index_js_4.toBigInt)(IL) + BigInt(this.privateKey)) % N, 32));
120924
- return new _HDNodeWallet(_guard, ki, this.fingerprint, (0, index_js_4.hexlify)(IR), path10, index2, this.depth + 1, this.mnemonic, this.provider);
120924
+ return new _HDNodeWallet(_guard, ki, this.fingerprint, (0, index_js_4.hexlify)(IR), path11, index2, this.depth + 1, this.mnemonic, this.provider);
120925
120925
  }
120926
120926
  /**
120927
120927
  * Return the HDNode for %%path%% from this node.
120928
120928
  */
120929
- derivePath(path10) {
120930
- return derivePath(this, path10);
120929
+ derivePath(path11) {
120930
+ return derivePath(this, path11);
120931
120931
  }
120932
120932
  static #fromSeed(_seed, mnemonic) {
120933
120933
  (0, index_js_4.assertArgument)((0, index_js_4.isBytesLike)(_seed), "invalid seed", "seed", "[REDACTED]");
@@ -120972,43 +120972,43 @@ var require_hdwallet = __commonJS({
120972
120972
  /**
120973
120973
  * Creates a new random HDNode.
120974
120974
  */
120975
- static createRandom(password, path10, wordlist) {
120975
+ static createRandom(password, path11, wordlist) {
120976
120976
  if (password == null) {
120977
120977
  password = "";
120978
120978
  }
120979
- if (path10 == null) {
120980
- path10 = exports2.defaultPath;
120979
+ if (path11 == null) {
120980
+ path11 = exports2.defaultPath;
120981
120981
  }
120982
120982
  if (wordlist == null) {
120983
120983
  wordlist = lang_en_js_1.LangEn.wordlist();
120984
120984
  }
120985
120985
  const mnemonic = mnemonic_js_1.Mnemonic.fromEntropy((0, index_js_1.randomBytes)(16), password, wordlist);
120986
- return _HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path10);
120986
+ return _HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path11);
120987
120987
  }
120988
120988
  /**
120989
120989
  * Create an HD Node from %%mnemonic%%.
120990
120990
  */
120991
- static fromMnemonic(mnemonic, path10) {
120992
- if (!path10) {
120993
- path10 = exports2.defaultPath;
120991
+ static fromMnemonic(mnemonic, path11) {
120992
+ if (!path11) {
120993
+ path11 = exports2.defaultPath;
120994
120994
  }
120995
- return _HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path10);
120995
+ return _HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path11);
120996
120996
  }
120997
120997
  /**
120998
120998
  * Creates an HD Node from a mnemonic %%phrase%%.
120999
120999
  */
121000
- static fromPhrase(phrase, password, path10, wordlist) {
121000
+ static fromPhrase(phrase, password, path11, wordlist) {
121001
121001
  if (password == null) {
121002
121002
  password = "";
121003
121003
  }
121004
- if (path10 == null) {
121005
- path10 = exports2.defaultPath;
121004
+ if (path11 == null) {
121005
+ path11 = exports2.defaultPath;
121006
121006
  }
121007
121007
  if (wordlist == null) {
121008
121008
  wordlist = lang_en_js_1.LangEn.wordlist();
121009
121009
  }
121010
121010
  const mnemonic = mnemonic_js_1.Mnemonic.fromPhrase(phrase, password, wordlist);
121011
- return _HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path10);
121011
+ return _HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path11);
121012
121012
  }
121013
121013
  /**
121014
121014
  * Creates an HD Node from a %%seed%%.
@@ -121061,7 +121061,7 @@ var require_hdwallet = __commonJS({
121061
121061
  /**
121062
121062
  * @private
121063
121063
  */
121064
- constructor(guard, address, publicKey, parentFingerprint, chainCode, path10, index2, depth, provider) {
121064
+ constructor(guard, address, publicKey, parentFingerprint, chainCode, path11, index2, depth, provider) {
121065
121065
  super(address, provider);
121066
121066
  (0, index_js_4.assertPrivate)(guard, _guard, "HDNodeVoidWallet");
121067
121067
  (0, index_js_4.defineProperties)(this, { publicKey });
@@ -121071,7 +121071,7 @@ var require_hdwallet = __commonJS({
121071
121071
  fingerprint,
121072
121072
  parentFingerprint,
121073
121073
  chainCode,
121074
- path: path10,
121074
+ path: path11,
121075
121075
  index: index2,
121076
121076
  depth
121077
121077
  });
@@ -121109,23 +121109,23 @@ var require_hdwallet = __commonJS({
121109
121109
  deriveChild(_index) {
121110
121110
  const index2 = (0, index_js_4.getNumber)(_index, "index");
121111
121111
  (0, index_js_4.assertArgument)(index2 <= 4294967295, "invalid index", "index", index2);
121112
- let path10 = this.path;
121113
- if (path10) {
121114
- path10 += "/" + (index2 & ~HardenedBit);
121112
+ let path11 = this.path;
121113
+ if (path11) {
121114
+ path11 += "/" + (index2 & ~HardenedBit);
121115
121115
  if (index2 & HardenedBit) {
121116
- path10 += "'";
121116
+ path11 += "'";
121117
121117
  }
121118
121118
  }
121119
121119
  const { IR, IL } = ser_I(index2, this.chainCode, this.publicKey, null);
121120
121120
  const Ki = index_js_1.SigningKey.addPoints(IL, this.publicKey, true);
121121
121121
  const address = (0, index_js_3.computeAddress)(Ki);
121122
- return new _HDNodeVoidWallet(_guard, address, Ki, this.fingerprint, (0, index_js_4.hexlify)(IR), path10, index2, this.depth + 1, this.provider);
121122
+ return new _HDNodeVoidWallet(_guard, address, Ki, this.fingerprint, (0, index_js_4.hexlify)(IR), path11, index2, this.depth + 1, this.provider);
121123
121123
  }
121124
121124
  /**
121125
121125
  * Return the signer for %%path%% from this node.
121126
121126
  */
121127
- derivePath(path10) {
121128
- return derivePath(this, path10);
121127
+ derivePath(path11) {
121128
+ return derivePath(this, path11);
121129
121129
  }
121130
121130
  };
121131
121131
  exports2.HDNodeVoidWallet = HDNodeVoidWallet;
@@ -131960,11 +131960,11 @@ var require_soljson = __commonJS({
131960
131960
  var ENVIRONMENT_IS_WORKER = typeof importScripts == "function";
131961
131961
  var ENVIRONMENT_IS_NODE = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string";
131962
131962
  var scriptDirectory = "";
131963
- function locateFile(path10) {
131963
+ function locateFile(path11) {
131964
131964
  if (Module["locateFile"]) {
131965
- return Module["locateFile"](path10, scriptDirectory);
131965
+ return Module["locateFile"](path11, scriptDirectory);
131966
131966
  }
131967
- return scriptDirectory + path10;
131967
+ return scriptDirectory + path11;
131968
131968
  }
131969
131969
  var read_;
131970
131970
  var readAsync;
@@ -132755,7 +132755,7 @@ var require_soljson = __commonJS({
132755
132755
  var ret = UTF8ToString(ptr);
132756
132756
  return ret;
132757
132757
  } };
132758
- function ___syscall_faccessat(dirfd, path10, amode, flags) {
132758
+ function ___syscall_faccessat(dirfd, path11, amode, flags) {
132759
132759
  }
132760
132760
  function ___syscall_fcntl64(fd, cmd, varargs) {
132761
132761
  SYSCALLS.varargs = varargs;
@@ -132765,10 +132765,10 @@ var require_soljson = __commonJS({
132765
132765
  SYSCALLS.varargs = varargs;
132766
132766
  return 0;
132767
132767
  }
132768
- function ___syscall_openat(dirfd, path10, flags, varargs) {
132768
+ function ___syscall_openat(dirfd, path11, flags, varargs) {
132769
132769
  SYSCALLS.varargs = varargs;
132770
132770
  }
132771
- function ___syscall_stat64(path10, buf) {
132771
+ function ___syscall_stat64(path11, buf) {
132772
132772
  }
132773
132773
  function __emscripten_date_now() {
132774
132774
  return Date.now();
@@ -134697,9 +134697,9 @@ var require_filesystem = __commonJS({
134697
134697
  "use strict";
134698
134698
  var fs3 = __require("fs");
134699
134699
  var LDD_PATH = "/usr/bin/ldd";
134700
- var readFileSync = (path10) => fs3.readFileSync(path10, "utf-8");
134701
- var readFile9 = (path10) => new Promise((resolve2, reject) => {
134702
- fs3.readFile(path10, "utf-8", (err, data) => {
134700
+ var readFileSync = (path11) => fs3.readFileSync(path11, "utf-8");
134701
+ var readFile10 = (path11) => new Promise((resolve2, reject) => {
134702
+ fs3.readFile(path11, "utf-8", (err, data) => {
134703
134703
  if (err) {
134704
134704
  reject(err);
134705
134705
  } else {
@@ -134710,7 +134710,7 @@ var require_filesystem = __commonJS({
134710
134710
  module2.exports = {
134711
134711
  LDD_PATH,
134712
134712
  readFileSync,
134713
- readFile: readFile9
134713
+ readFile: readFile10
134714
134714
  };
134715
134715
  }
134716
134716
  });
@@ -134721,7 +134721,7 @@ var require_detect_libc = __commonJS({
134721
134721
  "use strict";
134722
134722
  var childProcess = __require("child_process");
134723
134723
  var { isLinux, getReport } = require_process();
134724
- var { LDD_PATH, readFile: readFile9, readFileSync } = require_filesystem();
134724
+ var { LDD_PATH, readFile: readFile10, readFileSync } = require_filesystem();
134725
134725
  var cachedFamilyFilesystem;
134726
134726
  var cachedVersionFilesystem;
134727
134727
  var command = "getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true";
@@ -134788,7 +134788,7 @@ var require_detect_libc = __commonJS({
134788
134788
  }
134789
134789
  cachedFamilyFilesystem = null;
134790
134790
  try {
134791
- const lddContent = await readFile9(LDD_PATH);
134791
+ const lddContent = await readFile10(LDD_PATH);
134792
134792
  cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
134793
134793
  } catch (e) {
134794
134794
  }
@@ -134842,7 +134842,7 @@ var require_detect_libc = __commonJS({
134842
134842
  }
134843
134843
  cachedVersionFilesystem = null;
134844
134844
  try {
134845
- const lddContent = await readFile9(LDD_PATH);
134845
+ const lddContent = await readFile10(LDD_PATH);
134846
134846
  const versionMatch = lddContent.match(RE_GLIBC_VERSION);
134847
134847
  if (versionMatch) {
134848
134848
  cachedVersionFilesystem = versionMatch[1];
@@ -134929,7 +134929,7 @@ var require_detect_libc = __commonJS({
134929
134929
  var require_node_gyp_build_optional_packages = __commonJS({
134930
134930
  "../../node_modules/node-gyp-build-optional-packages/index.js"(exports2, module2) {
134931
134931
  var fs3 = __require("fs");
134932
- var path10 = __require("path");
134932
+ var path11 = __require("path");
134933
134933
  var url = __require("url");
134934
134934
  var vars = process.config && process.config.variables || {};
134935
134935
  var prebuildsOnly = !!process.env.PREBUILDS_ONLY;
@@ -134952,30 +134952,30 @@ var require_node_gyp_build_optional_packages = __commonJS({
134952
134952
  return __require(load.path(dir));
134953
134953
  }
134954
134954
  load.path = function(dir) {
134955
- dir = path10.resolve(dir || ".");
134955
+ dir = path11.resolve(dir || ".");
134956
134956
  var packageName = "";
134957
134957
  try {
134958
134958
  if (typeof __webpack_require__ === "function")
134959
- packageName = __non_webpack_require__(path10.join(dir, "package.json")).name;
134959
+ packageName = __non_webpack_require__(path11.join(dir, "package.json")).name;
134960
134960
  else
134961
- packageName = __require(path10.join(dir, "package.json")).name;
134961
+ packageName = __require(path11.join(dir, "package.json")).name;
134962
134962
  var varName = packageName.toUpperCase().replace(/-/g, "_") + "_PREBUILD";
134963
134963
  if (process.env[varName]) dir = process.env[varName];
134964
134964
  } catch (err) {
134965
134965
  }
134966
134966
  if (!prebuildsOnly) {
134967
- var release = getFirst(path10.join(dir, "build/Release"), matchBuild);
134967
+ var release = getFirst(path11.join(dir, "build/Release"), matchBuild);
134968
134968
  if (release) return release;
134969
- var debug = getFirst(path10.join(dir, "build/Debug"), matchBuild);
134969
+ var debug = getFirst(path11.join(dir, "build/Debug"), matchBuild);
134970
134970
  if (debug) return debug;
134971
134971
  }
134972
134972
  var prebuild = resolve2(dir);
134973
134973
  if (prebuild) return prebuild;
134974
- var nearby = resolve2(path10.dirname(process.execPath));
134974
+ var nearby = resolve2(path11.dirname(process.execPath));
134975
134975
  if (nearby) return nearby;
134976
134976
  var platformPackage = (packageName[0] == "@" ? "" : "@" + packageName + "/") + packageName + "-" + platform + "-" + arch;
134977
134977
  try {
134978
- var prebuildPackage = path10.dirname(__require("module").createRequire(url.pathToFileURL(path10.join(dir, "package.json"))).resolve(platformPackage));
134978
+ var prebuildPackage = path11.dirname(__require("module").createRequire(url.pathToFileURL(path11.join(dir, "package.json"))).resolve(platformPackage));
134979
134979
  return resolveFile(prebuildPackage);
134980
134980
  } catch (error) {
134981
134981
  }
@@ -134994,16 +134994,16 @@ var require_node_gyp_build_optional_packages = __commonJS({
134994
134994
  ].filter(Boolean).join(" ");
134995
134995
  throw new Error("No native build was found for " + target + "\n attempted loading from: " + dir + " and package: " + platformPackage + "\n");
134996
134996
  function resolve2(dir2) {
134997
- var tuples = readdirSync(path10.join(dir2, "prebuilds")).map(parseTuple);
134997
+ var tuples = readdirSync(path11.join(dir2, "prebuilds")).map(parseTuple);
134998
134998
  var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0];
134999
134999
  if (!tuple) return;
135000
- return resolveFile(path10.join(dir2, "prebuilds", tuple.name));
135000
+ return resolveFile(path11.join(dir2, "prebuilds", tuple.name));
135001
135001
  }
135002
135002
  function resolveFile(prebuilds) {
135003
135003
  var parsed = readdirSync(prebuilds).map(parseTags);
135004
135004
  var candidates = parsed.filter(matchTags(runtime, abi30));
135005
135005
  var winner = candidates.sort(compareTags(runtime))[0];
135006
- if (winner) return path10.join(prebuilds, winner.file);
135006
+ if (winner) return path11.join(prebuilds, winner.file);
135007
135007
  }
135008
135008
  };
135009
135009
  function readdirSync(dir) {
@@ -135015,7 +135015,7 @@ var require_node_gyp_build_optional_packages = __commonJS({
135015
135015
  }
135016
135016
  function getFirst(dir, filter) {
135017
135017
  var files = readdirSync(dir).filter(filter);
135018
- return files[0] && path10.join(dir, files[0]);
135018
+ return files[0] && path11.join(dir, files[0]);
135019
135019
  }
135020
135020
  function matchBuild(name) {
135021
135021
  return /\.node$/.test(name);
@@ -138678,14 +138678,14 @@ var require_url_state_machine = __commonJS({
138678
138678
  return url.replace(/\u0009|\u000A|\u000D/g, "");
138679
138679
  }
138680
138680
  function shortenPath(url) {
138681
- const path10 = url.path;
138682
- if (path10.length === 0) {
138681
+ const path11 = url.path;
138682
+ if (path11.length === 0) {
138683
138683
  return;
138684
138684
  }
138685
- if (url.scheme === "file" && path10.length === 1 && isNormalizedWindowsDriveLetter(path10[0])) {
138685
+ if (url.scheme === "file" && path11.length === 1 && isNormalizedWindowsDriveLetter(path11[0])) {
138686
138686
  return;
138687
138687
  }
138688
- path10.pop();
138688
+ path11.pop();
138689
138689
  }
138690
138690
  function includesCredentials(url) {
138691
138691
  return url.username !== "" || url.password !== "";
@@ -172754,9 +172754,9 @@ var require_setupKzg = __commonJS({
172754
172754
  Object.defineProperty(exports2, "__esModule", { value: true });
172755
172755
  exports2.setupKzg = setupKzg;
172756
172756
  var defineKzg_js_1 = require_defineKzg();
172757
- function setupKzg(parameters, path10) {
172757
+ function setupKzg(parameters, path11) {
172758
172758
  try {
172759
- parameters.loadTrustedSetup(path10);
172759
+ parameters.loadTrustedSetup(path11);
172760
172760
  } catch (e) {
172761
172761
  const error = e;
172762
172762
  if (!error.message.includes("trusted setup is already loaded"))
@@ -216863,13 +216863,13 @@ function __disposeResources(env2) {
216863
216863
  }
216864
216864
  return next();
216865
216865
  }
216866
- function __rewriteRelativeImportExtension(path10, preserveJsx) {
216867
- if (typeof path10 === "string" && /^\.\.?\//.test(path10)) {
216868
- return path10.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
216866
+ function __rewriteRelativeImportExtension(path11, preserveJsx) {
216867
+ if (typeof path11 === "string" && /^\.\.?\//.test(path11)) {
216868
+ return path11.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
216869
216869
  return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
216870
216870
  });
216871
216871
  }
216872
- return path10;
216872
+ return path11;
216873
216873
  }
216874
216874
  var extendStatics2, __assign2, __createBinding2, __setModuleDefault2, ownKeys, _SuppressedError, tslib_es6_default;
216875
216875
  var init_tslib_es62 = __esm({
@@ -223139,14 +223139,14 @@ var require_lib40 = __commonJS({
223139
223139
  }
223140
223140
  this.pubHash = hash160(this.pubKey);
223141
223141
  }
223142
- derive(path10) {
223143
- if (!/^[mM]'?/.test(path10)) {
223142
+ derive(path11) {
223143
+ if (!/^[mM]'?/.test(path11)) {
223144
223144
  throw new Error('Path must start with "m" or "M"');
223145
223145
  }
223146
- if (/^[mM]'?$/.test(path10)) {
223146
+ if (/^[mM]'?$/.test(path11)) {
223147
223147
  return this;
223148
223148
  }
223149
- const parts = path10.replace(/^[mM]'?\//, "").split("/");
223149
+ const parts = path11.replace(/^[mM]'?\//, "").split("/");
223150
223150
  let child = this;
223151
223151
  for (const c of parts) {
223152
223152
  const m = /^(\d+)('?)$/.exec(c);
@@ -244050,10 +244050,10 @@ var require_generatePrivateKey = __commonJS({
244050
244050
  "../../node_modules/@safe-global/protocol-kit/node_modules/viem/_cjs/accounts/generatePrivateKey.js"(exports2) {
244051
244051
  "use strict";
244052
244052
  Object.defineProperty(exports2, "__esModule", { value: true });
244053
- exports2.generatePrivateKey = generatePrivateKey;
244053
+ exports2.generatePrivateKey = generatePrivateKey2;
244054
244054
  var secp256k1_1 = require_secp256k13();
244055
244055
  var toHex_js_1 = require_toHex();
244056
- function generatePrivateKey() {
244056
+ function generatePrivateKey2() {
244057
244057
  return (0, toHex_js_1.toHex)(secp256k1_1.secp256k1.utils.randomPrivateKey());
244058
244058
  }
244059
244059
  }
@@ -244269,8 +244269,8 @@ var require_hdKeyToAccount = __commonJS({
244269
244269
  exports2.hdKeyToAccount = hdKeyToAccount;
244270
244270
  var toHex_js_1 = require_toHex();
244271
244271
  var privateKeyToAccount_js_1 = require_privateKeyToAccount();
244272
- function hdKeyToAccount(hdKey_, { accountIndex = 0, addressIndex = 0, changeIndex = 0, path: path10, ...options } = {}) {
244273
- const hdKey = hdKey_.derive(path10 || `m/44'/60'/${accountIndex}'/${changeIndex}/${addressIndex}`);
244272
+ function hdKeyToAccount(hdKey_, { accountIndex = 0, addressIndex = 0, changeIndex = 0, path: path11, ...options } = {}) {
244273
+ const hdKey = hdKey_.derive(path11 || `m/44'/60'/${accountIndex}'/${changeIndex}/${addressIndex}`);
244274
244274
  const account = (0, privateKeyToAccount_js_1.privateKeyToAccount)((0, toHex_js_1.toHex)(hdKey.privateKey), options);
244275
244275
  return {
244276
244276
  ...account,
@@ -251316,12 +251316,12 @@ var require_abstract_coder3 = __commonJS({
251316
251316
  exports2.Result = Result;
251317
251317
  function checkResultErrors(result) {
251318
251318
  const errors = [];
251319
- const checkErrors = function(path10, object) {
251319
+ const checkErrors = function(path11, object) {
251320
251320
  if (!Array.isArray(object)) {
251321
251321
  return;
251322
251322
  }
251323
251323
  for (let key in object) {
251324
- const childPath = path10.slice();
251324
+ const childPath = path11.slice();
251325
251325
  childPath.push(key);
251326
251326
  try {
251327
251327
  checkErrors(childPath, object[key]);
@@ -274025,9 +274025,9 @@ var require_provider_ipcsocket2 = __commonJS({
274025
274025
  get socket() {
274026
274026
  return this.#socket;
274027
274027
  }
274028
- constructor(path10, network, options) {
274028
+ constructor(path11, network, options) {
274029
274029
  super(network, options);
274030
- this.#socket = (0, net_1.connect)(path10);
274030
+ this.#socket = (0, net_1.connect)(path11);
274031
274031
  this.socket.on("ready", async () => {
274032
274032
  try {
274033
274033
  await this._start();
@@ -274714,11 +274714,11 @@ var require_utils35 = __commonJS({
274714
274714
  function spelunk(object, _path) {
274715
274715
  const match2 = _path.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);
274716
274716
  (0, index_js_1.assertArgument)(match2 != null, "invalid path", "path", _path);
274717
- const path10 = match2[1];
274717
+ const path11 = match2[1];
274718
274718
  const type = match2[3];
274719
274719
  const reqd = match2[4] === "!";
274720
274720
  let cur = object;
274721
- for (const comp of path10.toLowerCase().split(".")) {
274721
+ for (const comp of path11.toLowerCase().split(".")) {
274722
274722
  if (Array.isArray(cur)) {
274723
274723
  if (!comp.match(/^[0-9]+$/)) {
274724
274724
  break;
@@ -274740,7 +274740,7 @@ var require_utils35 = __commonJS({
274740
274740
  break;
274741
274741
  }
274742
274742
  }
274743
- (0, index_js_1.assertArgument)(!reqd || cur != null, "missing required value", "path", path10);
274743
+ (0, index_js_1.assertArgument)(!reqd || cur != null, "missing required value", "path", path11);
274744
274744
  if (type && cur != null) {
274745
274745
  if (type === "int") {
274746
274746
  if (typeof cur === "string" && cur.match(/^-?[0-9]+$/)) {
@@ -274765,7 +274765,7 @@ var require_utils35 = __commonJS({
274765
274765
  if (type === typeof cur) {
274766
274766
  return cur;
274767
274767
  }
274768
- (0, index_js_1.assertArgument)(false, `wrong type found for ${type} `, "path", path10);
274768
+ (0, index_js_1.assertArgument)(false, `wrong type found for ${type} `, "path", path11);
274769
274769
  }
274770
274770
  return cur;
274771
274771
  }
@@ -274963,7 +274963,7 @@ var require_json_keystore2 = __commonJS({
274963
274963
  };
274964
274964
  if (account.mnemonic) {
274965
274965
  const client = options.client != null ? options.client : `ethers/${_version_js_1.version}`;
274966
- const path10 = account.mnemonic.path || defaultPath;
274966
+ const path11 = account.mnemonic.path || defaultPath;
274967
274967
  const locale = account.mnemonic.locale || "en";
274968
274968
  const mnemonicKey = key.slice(32, 64);
274969
274969
  const entropy = (0, index_js_4.getBytes)(account.mnemonic.entropy, "account.mnemonic.entropy");
@@ -274976,7 +274976,7 @@ var require_json_keystore2 = __commonJS({
274976
274976
  data["x-ethers"] = {
274977
274977
  client,
274978
274978
  gethFilename,
274979
- path: path10,
274979
+ path: path11,
274980
274980
  locale,
274981
274981
  mnemonicCounter: (0, index_js_4.hexlify)(mnemonicIv).substring(2),
274982
274982
  mnemonicCiphertext: (0, index_js_4.hexlify)(mnemonicCiphertext).substring(2),
@@ -275061,11 +275061,11 @@ var require_hdwallet2 = __commonJS({
275061
275061
  const I = (0, index_js_4.getBytes)((0, index_js_1.computeHmac)("sha512", chainCode, data));
275062
275062
  return { IL: I.slice(0, 32), IR: I.slice(32) };
275063
275063
  }
275064
- function derivePath(node, path10) {
275065
- const components = path10.split("/");
275066
- (0, index_js_4.assertArgument)(components.length > 0, "invalid path", "path", path10);
275064
+ function derivePath(node, path11) {
275065
+ const components = path11.split("/");
275066
+ (0, index_js_4.assertArgument)(components.length > 0, "invalid path", "path", path11);
275067
275067
  if (components[0] === "m") {
275068
- (0, index_js_4.assertArgument)(node.depth === 0, `cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${node.depth}`, "path", path10);
275068
+ (0, index_js_4.assertArgument)(node.depth === 0, `cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${node.depth}`, "path", path11);
275069
275069
  components.shift();
275070
275070
  }
275071
275071
  let result = node;
@@ -275135,7 +275135,7 @@ var require_hdwallet2 = __commonJS({
275135
275135
  /**
275136
275136
  * @private
275137
275137
  */
275138
- constructor(guard, signingKey, parentFingerprint, chainCode, path10, index2, depth, mnemonic, provider) {
275138
+ constructor(guard, signingKey, parentFingerprint, chainCode, path11, index2, depth, mnemonic, provider) {
275139
275139
  super(signingKey, provider);
275140
275140
  (0, index_js_4.assertPrivate)(guard, _guard, "HDNodeWallet");
275141
275141
  (0, index_js_4.defineProperties)(this, { publicKey: signingKey.compressedPublicKey });
@@ -275144,7 +275144,7 @@ var require_hdwallet2 = __commonJS({
275144
275144
  parentFingerprint,
275145
275145
  fingerprint,
275146
275146
  chainCode,
275147
- path: path10,
275147
+ path: path11,
275148
275148
  index: index2,
275149
275149
  depth
275150
275150
  });
@@ -275228,22 +275228,22 @@ var require_hdwallet2 = __commonJS({
275228
275228
  deriveChild(_index) {
275229
275229
  const index2 = (0, index_js_4.getNumber)(_index, "index");
275230
275230
  (0, index_js_4.assertArgument)(index2 <= 4294967295, "invalid index", "index", index2);
275231
- let path10 = this.path;
275232
- if (path10) {
275233
- path10 += "/" + (index2 & ~HardenedBit);
275231
+ let path11 = this.path;
275232
+ if (path11) {
275233
+ path11 += "/" + (index2 & ~HardenedBit);
275234
275234
  if (index2 & HardenedBit) {
275235
- path10 += "'";
275235
+ path11 += "'";
275236
275236
  }
275237
275237
  }
275238
275238
  const { IR, IL } = ser_I(index2, this.chainCode, this.publicKey, this.privateKey);
275239
275239
  const ki = new index_js_1.SigningKey((0, index_js_4.toBeHex)(((0, index_js_4.toBigInt)(IL) + BigInt(this.privateKey)) % N, 32));
275240
- return new _HDNodeWallet(_guard, ki, this.fingerprint, (0, index_js_4.hexlify)(IR), path10, index2, this.depth + 1, this.mnemonic, this.provider);
275240
+ return new _HDNodeWallet(_guard, ki, this.fingerprint, (0, index_js_4.hexlify)(IR), path11, index2, this.depth + 1, this.mnemonic, this.provider);
275241
275241
  }
275242
275242
  /**
275243
275243
  * Return the HDNode for %%path%% from this node.
275244
275244
  */
275245
- derivePath(path10) {
275246
- return derivePath(this, path10);
275245
+ derivePath(path11) {
275246
+ return derivePath(this, path11);
275247
275247
  }
275248
275248
  static #fromSeed(_seed, mnemonic) {
275249
275249
  (0, index_js_4.assertArgument)((0, index_js_4.isBytesLike)(_seed), "invalid seed", "seed", "[REDACTED]");
@@ -275288,43 +275288,43 @@ var require_hdwallet2 = __commonJS({
275288
275288
  /**
275289
275289
  * Creates a new random HDNode.
275290
275290
  */
275291
- static createRandom(password, path10, wordlist) {
275291
+ static createRandom(password, path11, wordlist) {
275292
275292
  if (password == null) {
275293
275293
  password = "";
275294
275294
  }
275295
- if (path10 == null) {
275296
- path10 = exports2.defaultPath;
275295
+ if (path11 == null) {
275296
+ path11 = exports2.defaultPath;
275297
275297
  }
275298
275298
  if (wordlist == null) {
275299
275299
  wordlist = lang_en_js_1.LangEn.wordlist();
275300
275300
  }
275301
275301
  const mnemonic = mnemonic_js_1.Mnemonic.fromEntropy((0, index_js_1.randomBytes)(16), password, wordlist);
275302
- return _HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path10);
275302
+ return _HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path11);
275303
275303
  }
275304
275304
  /**
275305
275305
  * Create an HD Node from %%mnemonic%%.
275306
275306
  */
275307
- static fromMnemonic(mnemonic, path10) {
275308
- if (!path10) {
275309
- path10 = exports2.defaultPath;
275307
+ static fromMnemonic(mnemonic, path11) {
275308
+ if (!path11) {
275309
+ path11 = exports2.defaultPath;
275310
275310
  }
275311
- return _HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path10);
275311
+ return _HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path11);
275312
275312
  }
275313
275313
  /**
275314
275314
  * Creates an HD Node from a mnemonic %%phrase%%.
275315
275315
  */
275316
- static fromPhrase(phrase, password, path10, wordlist) {
275316
+ static fromPhrase(phrase, password, path11, wordlist) {
275317
275317
  if (password == null) {
275318
275318
  password = "";
275319
275319
  }
275320
- if (path10 == null) {
275321
- path10 = exports2.defaultPath;
275320
+ if (path11 == null) {
275321
+ path11 = exports2.defaultPath;
275322
275322
  }
275323
275323
  if (wordlist == null) {
275324
275324
  wordlist = lang_en_js_1.LangEn.wordlist();
275325
275325
  }
275326
275326
  const mnemonic = mnemonic_js_1.Mnemonic.fromPhrase(phrase, password, wordlist);
275327
- return _HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path10);
275327
+ return _HDNodeWallet.#fromSeed(mnemonic.computeSeed(), mnemonic).derivePath(path11);
275328
275328
  }
275329
275329
  /**
275330
275330
  * Creates an HD Node from a %%seed%%.
@@ -275377,7 +275377,7 @@ var require_hdwallet2 = __commonJS({
275377
275377
  /**
275378
275378
  * @private
275379
275379
  */
275380
- constructor(guard, address, publicKey, parentFingerprint, chainCode, path10, index2, depth, provider) {
275380
+ constructor(guard, address, publicKey, parentFingerprint, chainCode, path11, index2, depth, provider) {
275381
275381
  super(address, provider);
275382
275382
  (0, index_js_4.assertPrivate)(guard, _guard, "HDNodeVoidWallet");
275383
275383
  (0, index_js_4.defineProperties)(this, { publicKey });
@@ -275387,7 +275387,7 @@ var require_hdwallet2 = __commonJS({
275387
275387
  fingerprint,
275388
275388
  parentFingerprint,
275389
275389
  chainCode,
275390
- path: path10,
275390
+ path: path11,
275391
275391
  index: index2,
275392
275392
  depth
275393
275393
  });
@@ -275425,23 +275425,23 @@ var require_hdwallet2 = __commonJS({
275425
275425
  deriveChild(_index) {
275426
275426
  const index2 = (0, index_js_4.getNumber)(_index, "index");
275427
275427
  (0, index_js_4.assertArgument)(index2 <= 4294967295, "invalid index", "index", index2);
275428
- let path10 = this.path;
275429
- if (path10) {
275430
- path10 += "/" + (index2 & ~HardenedBit);
275428
+ let path11 = this.path;
275429
+ if (path11) {
275430
+ path11 += "/" + (index2 & ~HardenedBit);
275431
275431
  if (index2 & HardenedBit) {
275432
- path10 += "'";
275432
+ path11 += "'";
275433
275433
  }
275434
275434
  }
275435
275435
  const { IR, IL } = ser_I(index2, this.chainCode, this.publicKey, null);
275436
275436
  const Ki = index_js_1.SigningKey.addPoints(IL, this.publicKey, true);
275437
275437
  const address = (0, index_js_3.computeAddress)(Ki);
275438
- return new _HDNodeVoidWallet(_guard, address, Ki, this.fingerprint, (0, index_js_4.hexlify)(IR), path10, index2, this.depth + 1, this.provider);
275438
+ return new _HDNodeVoidWallet(_guard, address, Ki, this.fingerprint, (0, index_js_4.hexlify)(IR), path11, index2, this.depth + 1, this.provider);
275439
275439
  }
275440
275440
  /**
275441
275441
  * Return the signer for %%path%% from this node.
275442
275442
  */
275443
- derivePath(path10) {
275444
- return derivePath(this, path10);
275443
+ derivePath(path11) {
275444
+ return derivePath(this, path11);
275445
275445
  }
275446
275446
  };
275447
275447
  exports2.HDNodeVoidWallet = HDNodeVoidWallet;
@@ -278148,10 +278148,10 @@ var require_CheckedContract = __commonJS({
278148
278148
  } catch (err) {
278149
278149
  return null;
278150
278150
  }
278151
- const pathContent = Object.keys(this.solidity).map((path10) => {
278151
+ const pathContent = Object.keys(this.solidity).map((path11) => {
278152
278152
  return {
278153
- path: path10,
278154
- content: this.solidity[path10] || ""
278153
+ path: path11,
278154
+ content: this.solidity[path11] || ""
278155
278155
  };
278156
278156
  });
278157
278157
  const byHash = (0, validation_1.storeByHash)(pathContent);
@@ -281453,8 +281453,8 @@ var require_utils37 = __commonJS({
281453
281453
  var result = transform[inputType][outputType](input);
281454
281454
  return result;
281455
281455
  };
281456
- exports2.resolve = function(path10) {
281457
- var parts = path10.split("/");
281456
+ exports2.resolve = function(path11) {
281457
+ var parts = path11.split("/");
281458
281458
  var result = [];
281459
281459
  for (var index2 = 0; index2 < parts.length; index2++) {
281460
281460
  var part = parts[index2];
@@ -287307,18 +287307,18 @@ var require_object = __commonJS({
287307
287307
  var object = new ZipObject(name, zipObjectContent, o);
287308
287308
  this.files[name] = object;
287309
287309
  };
287310
- var parentFolder = function(path10) {
287311
- if (path10.slice(-1) === "/") {
287312
- path10 = path10.substring(0, path10.length - 1);
287310
+ var parentFolder = function(path11) {
287311
+ if (path11.slice(-1) === "/") {
287312
+ path11 = path11.substring(0, path11.length - 1);
287313
287313
  }
287314
- var lastSlash = path10.lastIndexOf("/");
287315
- return lastSlash > 0 ? path10.substring(0, lastSlash) : "";
287314
+ var lastSlash = path11.lastIndexOf("/");
287315
+ return lastSlash > 0 ? path11.substring(0, lastSlash) : "";
287316
287316
  };
287317
- var forceTrailingSlash = function(path10) {
287318
- if (path10.slice(-1) !== "/") {
287319
- path10 += "/";
287317
+ var forceTrailingSlash = function(path11) {
287318
+ if (path11.slice(-1) !== "/") {
287319
+ path11 += "/";
287320
287320
  }
287321
- return path10;
287321
+ return path11;
287322
287322
  };
287323
287323
  var folderAdd = function(name, createFolders) {
287324
287324
  createFolders = typeof createFolders !== "undefined" ? createFolders : defaults.createFolders;
@@ -288355,15 +288355,15 @@ var require_validation5 = __commonJS({
288355
288355
  ];
288356
288356
  function checkPaths(solidityCompiler, paths, ignoring) {
288357
288357
  const files = [];
288358
- paths.forEach((path10) => {
288359
- if (fs_1.default.existsSync(path10)) {
288360
- traversePathRecursively(path10, (filePath) => {
288358
+ paths.forEach((path11) => {
288359
+ if (fs_1.default.existsSync(path11)) {
288360
+ traversePathRecursively(path11, (filePath) => {
288361
288361
  const fullPath = path_1.default.resolve(filePath);
288362
288362
  const file = { buffer: fs_1.default.readFileSync(filePath), path: fullPath };
288363
288363
  files.push(file);
288364
288364
  });
288365
288365
  } else if (ignoring) {
288366
- ignoring.push(path10);
288366
+ ignoring.push(path11);
288367
288367
  }
288368
288368
  });
288369
288369
  return checkFiles2(solidityCompiler, files);
@@ -288601,22 +288601,22 @@ var require_validation5 = __commonJS({
288601
288601
  var _a, _b, _c, _d;
288602
288602
  return (obj === null || obj === void 0 ? void 0 : obj.language) === "Solidity" && !!((_a = obj === null || obj === void 0 ? void 0 : obj.settings) === null || _a === void 0 ? void 0 : _a.compilationTarget) && !!(obj === null || obj === void 0 ? void 0 : obj.version) && !!((_b = obj === null || obj === void 0 ? void 0 : obj.output) === null || _b === void 0 ? void 0 : _b.abi) && !!((_c = obj === null || obj === void 0 ? void 0 : obj.output) === null || _c === void 0 ? void 0 : _c.userdoc) && !!((_d = obj === null || obj === void 0 ? void 0 : obj.output) === null || _d === void 0 ? void 0 : _d.devdoc) && !!(obj === null || obj === void 0 ? void 0 : obj.sources);
288603
288603
  }
288604
- function traversePathRecursively(path10, worker, afterDirectory) {
288605
- if (!fs_1.default.existsSync(path10)) {
288606
- const msg = `Encountered a nonexistent path: ${path10}`;
288604
+ function traversePathRecursively(path11, worker, afterDirectory) {
288605
+ if (!fs_1.default.existsSync(path11)) {
288606
+ const msg = `Encountered a nonexistent path: ${path11}`;
288607
288607
  const error = new Error(msg);
288608
288608
  throw error;
288609
288609
  }
288610
- const fileStat = fs_1.default.lstatSync(path10);
288610
+ const fileStat = fs_1.default.lstatSync(path11);
288611
288611
  if (fileStat.isFile()) {
288612
- worker(path10);
288612
+ worker(path11);
288613
288613
  } else if (fileStat.isDirectory()) {
288614
- fs_1.default.readdirSync(path10).forEach((nestedName) => {
288615
- const nestedPath = path_1.default.join(path10, nestedName);
288614
+ fs_1.default.readdirSync(path11).forEach((nestedName) => {
288615
+ const nestedPath = path_1.default.join(path11, nestedName);
288616
288616
  traversePathRecursively(nestedPath, worker, afterDirectory);
288617
288617
  });
288618
288618
  if (afterDirectory) {
288619
- afterDirectory(path10);
288619
+ afterDirectory(path11);
288620
288620
  }
288621
288621
  }
288622
288622
  }
@@ -288646,19 +288646,19 @@ var require_validation5 = __commonJS({
288646
288646
  const endTime = Date.now();
288647
288647
  (0, logger_1.logDebug)(`Parsing hardhat file took ${endTime - startTime} milliseconds.`);
288648
288648
  const hardhatSourceFilesObject = hardhatJson.input.sources;
288649
- for (const path10 in hardhatSourceFilesObject) {
288650
- if (hardhatSourceFilesObject[path10].content) {
288649
+ for (const path11 in hardhatSourceFilesObject) {
288650
+ if (hardhatSourceFilesObject[path11].content) {
288651
288651
  hardhatSourceFiles.push({
288652
- path: path10,
288653
- content: hardhatSourceFilesObject[path10].content
288652
+ path: path11,
288653
+ content: hardhatSourceFilesObject[path11].content
288654
288654
  });
288655
288655
  }
288656
288656
  }
288657
288657
  const contractsObject = hardhatJson.output.contracts;
288658
- for (const path10 in contractsObject) {
288659
- for (const contractName in contractsObject[path10]) {
288660
- if (contractsObject[path10][contractName].metadata) {
288661
- const metadataObj = extractMetadataFromString(contractsObject[path10][contractName].metadata);
288658
+ for (const path11 in contractsObject) {
288659
+ for (const contractName in contractsObject[path11]) {
288660
+ if (contractsObject[path11][contractName].metadata) {
288661
+ const metadataObj = extractMetadataFromString(contractsObject[path11][contractName].metadata);
288662
288662
  hardhatMetadataFiles.push(metadataObj);
288663
288663
  }
288664
288664
  }
@@ -290558,15 +290558,15 @@ var require_route = __commonJS({
290558
290558
  };
290559
290559
  }
290560
290560
  function wrapConversion(toModel, graph) {
290561
- const path10 = [graph[toModel].parent, toModel];
290561
+ const path11 = [graph[toModel].parent, toModel];
290562
290562
  let fn = conversions[graph[toModel].parent][toModel];
290563
290563
  let cur = graph[toModel].parent;
290564
290564
  while (graph[cur].parent) {
290565
- path10.unshift(graph[cur].parent);
290565
+ path11.unshift(graph[cur].parent);
290566
290566
  fn = link(conversions[graph[cur].parent][cur], fn);
290567
290567
  cur = graph[cur].parent;
290568
290568
  }
290569
- fn.conversion = path10;
290569
+ fn.conversion = path11;
290570
290570
  return fn;
290571
290571
  }
290572
290572
  module2.exports = function(fromModel) {
@@ -326246,26 +326246,7 @@ var optimism = /* @__PURE__ */ defineChain({
326246
326246
 
326247
326247
  // ../../node_modules/@gearbox-protocol/sdk/dist/esm/sdk/index.mjs
326248
326248
  var import_sdk_gov = __toESM(require_lib36(), 1);
326249
- var iAddressProviderV3_1Abi = [
326250
- {
326251
- type: "function",
326252
- inputs: [
326253
- { name: "_marketConfigurator", internalType: "address", type: "address" }
326254
- ],
326255
- name: "addMarketConfigurator",
326256
- outputs: [],
326257
- stateMutability: "nonpayable"
326258
- },
326259
- {
326260
- type: "function",
326261
- inputs: [
326262
- { name: "key", internalType: "string", type: "string" },
326263
- { name: "_version", internalType: "uint256", type: "uint256" }
326264
- ],
326265
- name: "addresses",
326266
- outputs: [{ name: "", internalType: "address", type: "address" }],
326267
- stateMutability: "view"
326268
- },
326249
+ var iCreditAccountCompressorAbi = [
326269
326250
  {
326270
326251
  type: "function",
326271
326252
  inputs: [],
@@ -326276,139 +326257,369 @@ var iAddressProviderV3_1Abi = [
326276
326257
  {
326277
326258
  type: "function",
326278
326259
  inputs: [
326279
- { name: "key", internalType: "string", type: "string" },
326280
- { name: "_version", internalType: "uint256", type: "uint256" }
326260
+ { name: "creditManager", internalType: "address", type: "address" },
326261
+ {
326262
+ name: "caFilter",
326263
+ internalType: "struct CreditAccountFilter",
326264
+ type: "tuple",
326265
+ components: [
326266
+ { name: "owner", internalType: "address", type: "address" },
326267
+ { name: "includeZeroDebt", internalType: "bool", type: "bool" },
326268
+ { name: "minHealthFactor", internalType: "uint16", type: "uint16" },
326269
+ { name: "maxHealthFactor", internalType: "uint16", type: "uint16" },
326270
+ { name: "reverting", internalType: "bool", type: "bool" }
326271
+ ]
326272
+ }
326281
326273
  ],
326282
- name: "getAddressOrRevert",
326283
- outputs: [{ name: "", internalType: "address", type: "address" }],
326274
+ name: "countCreditAccounts",
326275
+ outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
326284
326276
  stateMutability: "view"
326285
326277
  },
326286
326278
  {
326287
326279
  type: "function",
326288
326280
  inputs: [
326289
- { name: "key", internalType: "bytes32", type: "bytes32" },
326290
- { name: "_version", internalType: "uint256", type: "uint256" }
326281
+ {
326282
+ name: "cmFilter",
326283
+ internalType: "struct MarketFilter",
326284
+ type: "tuple",
326285
+ components: [
326286
+ { name: "curators", internalType: "address[]", type: "address[]" },
326287
+ { name: "pools", internalType: "address[]", type: "address[]" },
326288
+ { name: "underlying", internalType: "address", type: "address" }
326289
+ ]
326290
+ },
326291
+ {
326292
+ name: "caFilter",
326293
+ internalType: "struct CreditAccountFilter",
326294
+ type: "tuple",
326295
+ components: [
326296
+ { name: "owner", internalType: "address", type: "address" },
326297
+ { name: "includeZeroDebt", internalType: "bool", type: "bool" },
326298
+ { name: "minHealthFactor", internalType: "uint16", type: "uint16" },
326299
+ { name: "maxHealthFactor", internalType: "uint16", type: "uint16" },
326300
+ { name: "reverting", internalType: "bool", type: "bool" }
326301
+ ]
326302
+ }
326291
326303
  ],
326292
- name: "getAddressOrRevert",
326293
- outputs: [{ name: "", internalType: "address", type: "address" }],
326304
+ name: "countCreditAccounts",
326305
+ outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
326294
326306
  stateMutability: "view"
326295
326307
  },
326296
326308
  {
326297
326309
  type: "function",
326298
- inputs: [],
326299
- name: "getAllSavedContracts",
326310
+ inputs: [
326311
+ { name: "creditAccount", internalType: "address", type: "address" }
326312
+ ],
326313
+ name: "getCreditAccountData",
326300
326314
  outputs: [
326301
326315
  {
326302
326316
  name: "",
326303
- internalType: "struct ContractValue[]",
326304
- type: "tuple[]",
326317
+ internalType: "struct CreditAccountData",
326318
+ type: "tuple",
326305
326319
  components: [
326306
- { name: "key", internalType: "string", type: "string" },
326307
- { name: "value", internalType: "address", type: "address" },
326308
- { name: "version", internalType: "uint256", type: "uint256" }
326320
+ { name: "creditAccount", internalType: "address", type: "address" },
326321
+ { name: "creditManager", internalType: "address", type: "address" },
326322
+ { name: "creditFacade", internalType: "address", type: "address" },
326323
+ { name: "underlying", internalType: "address", type: "address" },
326324
+ { name: "owner", internalType: "address", type: "address" },
326325
+ {
326326
+ name: "enabledTokensMask",
326327
+ internalType: "uint256",
326328
+ type: "uint256"
326329
+ },
326330
+ { name: "debt", internalType: "uint256", type: "uint256" },
326331
+ { name: "accruedInterest", internalType: "uint256", type: "uint256" },
326332
+ { name: "accruedFees", internalType: "uint256", type: "uint256" },
326333
+ { name: "totalDebtUSD", internalType: "uint256", type: "uint256" },
326334
+ { name: "totalValueUSD", internalType: "uint256", type: "uint256" },
326335
+ { name: "twvUSD", internalType: "uint256", type: "uint256" },
326336
+ { name: "totalValue", internalType: "uint256", type: "uint256" },
326337
+ { name: "healthFactor", internalType: "uint16", type: "uint16" },
326338
+ { name: "success", internalType: "bool", type: "bool" },
326339
+ {
326340
+ name: "tokens",
326341
+ internalType: "struct TokenInfo[]",
326342
+ type: "tuple[]",
326343
+ components: [
326344
+ { name: "token", internalType: "address", type: "address" },
326345
+ { name: "mask", internalType: "uint256", type: "uint256" },
326346
+ { name: "balance", internalType: "uint256", type: "uint256" },
326347
+ { name: "quota", internalType: "uint256", type: "uint256" },
326348
+ { name: "success", internalType: "bool", type: "bool" }
326349
+ ]
326350
+ }
326309
326351
  ]
326310
326352
  }
326311
326353
  ],
326312
326354
  stateMutability: "view"
326313
326355
  },
326314
- {
326315
- type: "function",
326316
- inputs: [{ name: "_key", internalType: "bytes32", type: "bytes32" }],
326317
- name: "getLatestAddressOrRevert",
326318
- outputs: [{ name: "result", internalType: "address", type: "address" }],
326319
- stateMutability: "view"
326320
- },
326321
- {
326322
- type: "function",
326323
- inputs: [{ name: "key", internalType: "string", type: "string" }],
326324
- name: "getLatestAddressOrRevert",
326325
- outputs: [{ name: "", internalType: "address", type: "address" }],
326326
- stateMutability: "view"
326327
- },
326328
- {
326329
- type: "function",
326330
- inputs: [{ name: "riskCurator", internalType: "address", type: "address" }],
326331
- name: "isMarketConfigurator",
326332
- outputs: [{ name: "", internalType: "bool", type: "bool" }],
326333
- stateMutability: "view"
326334
- },
326335
326356
  {
326336
326357
  type: "function",
326337
326358
  inputs: [
326338
- { name: "creditManager", internalType: "address", type: "address" }
326359
+ {
326360
+ name: "cmFilter",
326361
+ internalType: "struct MarketFilter",
326362
+ type: "tuple",
326363
+ components: [
326364
+ { name: "curators", internalType: "address[]", type: "address[]" },
326365
+ { name: "pools", internalType: "address[]", type: "address[]" },
326366
+ { name: "underlying", internalType: "address", type: "address" }
326367
+ ]
326368
+ },
326369
+ {
326370
+ name: "caFilter",
326371
+ internalType: "struct CreditAccountFilter",
326372
+ type: "tuple",
326373
+ components: [
326374
+ { name: "owner", internalType: "address", type: "address" },
326375
+ { name: "includeZeroDebt", internalType: "bool", type: "bool" },
326376
+ { name: "minHealthFactor", internalType: "uint16", type: "uint16" },
326377
+ { name: "maxHealthFactor", internalType: "uint16", type: "uint16" },
326378
+ { name: "reverting", internalType: "bool", type: "bool" }
326379
+ ]
326380
+ },
326381
+ { name: "offset", internalType: "uint256", type: "uint256" }
326382
+ ],
326383
+ name: "getCreditAccounts",
326384
+ outputs: [
326385
+ {
326386
+ name: "data",
326387
+ internalType: "struct CreditAccountData[]",
326388
+ type: "tuple[]",
326389
+ components: [
326390
+ { name: "creditAccount", internalType: "address", type: "address" },
326391
+ { name: "creditManager", internalType: "address", type: "address" },
326392
+ { name: "creditFacade", internalType: "address", type: "address" },
326393
+ { name: "underlying", internalType: "address", type: "address" },
326394
+ { name: "owner", internalType: "address", type: "address" },
326395
+ {
326396
+ name: "enabledTokensMask",
326397
+ internalType: "uint256",
326398
+ type: "uint256"
326399
+ },
326400
+ { name: "debt", internalType: "uint256", type: "uint256" },
326401
+ { name: "accruedInterest", internalType: "uint256", type: "uint256" },
326402
+ { name: "accruedFees", internalType: "uint256", type: "uint256" },
326403
+ { name: "totalDebtUSD", internalType: "uint256", type: "uint256" },
326404
+ { name: "totalValueUSD", internalType: "uint256", type: "uint256" },
326405
+ { name: "twvUSD", internalType: "uint256", type: "uint256" },
326406
+ { name: "totalValue", internalType: "uint256", type: "uint256" },
326407
+ { name: "healthFactor", internalType: "uint16", type: "uint16" },
326408
+ { name: "success", internalType: "bool", type: "bool" },
326409
+ {
326410
+ name: "tokens",
326411
+ internalType: "struct TokenInfo[]",
326412
+ type: "tuple[]",
326413
+ components: [
326414
+ { name: "token", internalType: "address", type: "address" },
326415
+ { name: "mask", internalType: "uint256", type: "uint256" },
326416
+ { name: "balance", internalType: "uint256", type: "uint256" },
326417
+ { name: "quota", internalType: "uint256", type: "uint256" },
326418
+ { name: "success", internalType: "bool", type: "bool" }
326419
+ ]
326420
+ }
326421
+ ]
326422
+ },
326423
+ { name: "nextOffset", internalType: "uint256", type: "uint256" }
326339
326424
  ],
326340
- name: "marketConfiguratorByCreditManager",
326341
- outputs: [{ name: "", internalType: "address", type: "address" }],
326342
326425
  stateMutability: "view"
326343
326426
  },
326344
326427
  {
326345
326428
  type: "function",
326346
326429
  inputs: [
326347
- { name: "creditManager", internalType: "address", type: "address" }
326430
+ { name: "creditManager", internalType: "address", type: "address" },
326431
+ {
326432
+ name: "caFilter",
326433
+ internalType: "struct CreditAccountFilter",
326434
+ type: "tuple",
326435
+ components: [
326436
+ { name: "owner", internalType: "address", type: "address" },
326437
+ { name: "includeZeroDebt", internalType: "bool", type: "bool" },
326438
+ { name: "minHealthFactor", internalType: "uint16", type: "uint16" },
326439
+ { name: "maxHealthFactor", internalType: "uint16", type: "uint16" },
326440
+ { name: "reverting", internalType: "bool", type: "bool" }
326441
+ ]
326442
+ },
326443
+ { name: "offset", internalType: "uint256", type: "uint256" }
326444
+ ],
326445
+ name: "getCreditAccounts",
326446
+ outputs: [
326447
+ {
326448
+ name: "data",
326449
+ internalType: "struct CreditAccountData[]",
326450
+ type: "tuple[]",
326451
+ components: [
326452
+ { name: "creditAccount", internalType: "address", type: "address" },
326453
+ { name: "creditManager", internalType: "address", type: "address" },
326454
+ { name: "creditFacade", internalType: "address", type: "address" },
326455
+ { name: "underlying", internalType: "address", type: "address" },
326456
+ { name: "owner", internalType: "address", type: "address" },
326457
+ {
326458
+ name: "enabledTokensMask",
326459
+ internalType: "uint256",
326460
+ type: "uint256"
326461
+ },
326462
+ { name: "debt", internalType: "uint256", type: "uint256" },
326463
+ { name: "accruedInterest", internalType: "uint256", type: "uint256" },
326464
+ { name: "accruedFees", internalType: "uint256", type: "uint256" },
326465
+ { name: "totalDebtUSD", internalType: "uint256", type: "uint256" },
326466
+ { name: "totalValueUSD", internalType: "uint256", type: "uint256" },
326467
+ { name: "twvUSD", internalType: "uint256", type: "uint256" },
326468
+ { name: "totalValue", internalType: "uint256", type: "uint256" },
326469
+ { name: "healthFactor", internalType: "uint16", type: "uint16" },
326470
+ { name: "success", internalType: "bool", type: "bool" },
326471
+ {
326472
+ name: "tokens",
326473
+ internalType: "struct TokenInfo[]",
326474
+ type: "tuple[]",
326475
+ components: [
326476
+ { name: "token", internalType: "address", type: "address" },
326477
+ { name: "mask", internalType: "uint256", type: "uint256" },
326478
+ { name: "balance", internalType: "uint256", type: "uint256" },
326479
+ { name: "quota", internalType: "uint256", type: "uint256" },
326480
+ { name: "success", internalType: "bool", type: "bool" }
326481
+ ]
326482
+ }
326483
+ ]
326484
+ },
326485
+ { name: "nextOffset", internalType: "uint256", type: "uint256" }
326348
326486
  ],
326349
- name: "marketConfiguratorByPool",
326350
- outputs: [{ name: "", internalType: "address", type: "address" }],
326351
- stateMutability: "view"
326352
- },
326353
- {
326354
- type: "function",
326355
- inputs: [],
326356
- name: "marketConfigurators",
326357
- outputs: [{ name: "", internalType: "address[]", type: "address[]" }],
326358
- stateMutability: "view"
326359
- },
326360
- {
326361
- type: "function",
326362
- inputs: [],
326363
- name: "owner",
326364
- outputs: [{ name: "", internalType: "address", type: "address" }],
326365
326487
  stateMutability: "view"
326366
326488
  },
326367
326489
  {
326368
326490
  type: "function",
326369
326491
  inputs: [
326370
- { name: "creditManager", internalType: "address", type: "address" }
326492
+ { name: "creditManager", internalType: "address", type: "address" },
326493
+ {
326494
+ name: "caFilter",
326495
+ internalType: "struct CreditAccountFilter",
326496
+ type: "tuple",
326497
+ components: [
326498
+ { name: "owner", internalType: "address", type: "address" },
326499
+ { name: "includeZeroDebt", internalType: "bool", type: "bool" },
326500
+ { name: "minHealthFactor", internalType: "uint16", type: "uint16" },
326501
+ { name: "maxHealthFactor", internalType: "uint16", type: "uint16" },
326502
+ { name: "reverting", internalType: "bool", type: "bool" }
326503
+ ]
326504
+ },
326505
+ { name: "offset", internalType: "uint256", type: "uint256" },
326506
+ { name: "limit", internalType: "uint256", type: "uint256" }
326371
326507
  ],
326372
- name: "registerCreditManager",
326373
- outputs: [],
326374
- stateMutability: "nonpayable"
326375
- },
326376
- {
326377
- type: "function",
326378
- inputs: [{ name: "pool", internalType: "address", type: "address" }],
326379
- name: "registerPool",
326380
- outputs: [],
326381
- stateMutability: "nonpayable"
326382
- },
326383
- {
326384
- type: "function",
326385
- inputs: [
326386
- { name: "_marketConfigurator", internalType: "address", type: "address" }
326508
+ name: "getCreditAccounts",
326509
+ outputs: [
326510
+ {
326511
+ name: "data",
326512
+ internalType: "struct CreditAccountData[]",
326513
+ type: "tuple[]",
326514
+ components: [
326515
+ { name: "creditAccount", internalType: "address", type: "address" },
326516
+ { name: "creditManager", internalType: "address", type: "address" },
326517
+ { name: "creditFacade", internalType: "address", type: "address" },
326518
+ { name: "underlying", internalType: "address", type: "address" },
326519
+ { name: "owner", internalType: "address", type: "address" },
326520
+ {
326521
+ name: "enabledTokensMask",
326522
+ internalType: "uint256",
326523
+ type: "uint256"
326524
+ },
326525
+ { name: "debt", internalType: "uint256", type: "uint256" },
326526
+ { name: "accruedInterest", internalType: "uint256", type: "uint256" },
326527
+ { name: "accruedFees", internalType: "uint256", type: "uint256" },
326528
+ { name: "totalDebtUSD", internalType: "uint256", type: "uint256" },
326529
+ { name: "totalValueUSD", internalType: "uint256", type: "uint256" },
326530
+ { name: "twvUSD", internalType: "uint256", type: "uint256" },
326531
+ { name: "totalValue", internalType: "uint256", type: "uint256" },
326532
+ { name: "healthFactor", internalType: "uint16", type: "uint16" },
326533
+ { name: "success", internalType: "bool", type: "bool" },
326534
+ {
326535
+ name: "tokens",
326536
+ internalType: "struct TokenInfo[]",
326537
+ type: "tuple[]",
326538
+ components: [
326539
+ { name: "token", internalType: "address", type: "address" },
326540
+ { name: "mask", internalType: "uint256", type: "uint256" },
326541
+ { name: "balance", internalType: "uint256", type: "uint256" },
326542
+ { name: "quota", internalType: "uint256", type: "uint256" },
326543
+ { name: "success", internalType: "bool", type: "bool" }
326544
+ ]
326545
+ }
326546
+ ]
326547
+ },
326548
+ { name: "nextOffset", internalType: "uint256", type: "uint256" }
326387
326549
  ],
326388
- name: "removeMarketConfigurator",
326389
- outputs: [],
326390
- stateMutability: "nonpayable"
326550
+ stateMutability: "view"
326391
326551
  },
326392
326552
  {
326393
326553
  type: "function",
326394
326554
  inputs: [
326395
- { name: "key", internalType: "string", type: "string" },
326396
- { name: "addr", internalType: "address", type: "address" },
326397
- { name: "saveVersion", internalType: "bool", type: "bool" }
326555
+ {
326556
+ name: "cmFilter",
326557
+ internalType: "struct MarketFilter",
326558
+ type: "tuple",
326559
+ components: [
326560
+ { name: "curators", internalType: "address[]", type: "address[]" },
326561
+ { name: "pools", internalType: "address[]", type: "address[]" },
326562
+ { name: "underlying", internalType: "address", type: "address" }
326563
+ ]
326564
+ },
326565
+ {
326566
+ name: "caFilter",
326567
+ internalType: "struct CreditAccountFilter",
326568
+ type: "tuple",
326569
+ components: [
326570
+ { name: "owner", internalType: "address", type: "address" },
326571
+ { name: "includeZeroDebt", internalType: "bool", type: "bool" },
326572
+ { name: "minHealthFactor", internalType: "uint16", type: "uint16" },
326573
+ { name: "maxHealthFactor", internalType: "uint16", type: "uint16" },
326574
+ { name: "reverting", internalType: "bool", type: "bool" }
326575
+ ]
326576
+ },
326577
+ { name: "offset", internalType: "uint256", type: "uint256" },
326578
+ { name: "limit", internalType: "uint256", type: "uint256" }
326398
326579
  ],
326399
- name: "setAddress",
326400
- outputs: [],
326401
- stateMutability: "nonpayable"
326402
- },
326403
- {
326404
- type: "function",
326405
- inputs: [
326406
- { name: "addr", internalType: "address", type: "address" },
326407
- { name: "saveVersion", internalType: "bool", type: "bool" }
326580
+ name: "getCreditAccounts",
326581
+ outputs: [
326582
+ {
326583
+ name: "data",
326584
+ internalType: "struct CreditAccountData[]",
326585
+ type: "tuple[]",
326586
+ components: [
326587
+ { name: "creditAccount", internalType: "address", type: "address" },
326588
+ { name: "creditManager", internalType: "address", type: "address" },
326589
+ { name: "creditFacade", internalType: "address", type: "address" },
326590
+ { name: "underlying", internalType: "address", type: "address" },
326591
+ { name: "owner", internalType: "address", type: "address" },
326592
+ {
326593
+ name: "enabledTokensMask",
326594
+ internalType: "uint256",
326595
+ type: "uint256"
326596
+ },
326597
+ { name: "debt", internalType: "uint256", type: "uint256" },
326598
+ { name: "accruedInterest", internalType: "uint256", type: "uint256" },
326599
+ { name: "accruedFees", internalType: "uint256", type: "uint256" },
326600
+ { name: "totalDebtUSD", internalType: "uint256", type: "uint256" },
326601
+ { name: "totalValueUSD", internalType: "uint256", type: "uint256" },
326602
+ { name: "twvUSD", internalType: "uint256", type: "uint256" },
326603
+ { name: "totalValue", internalType: "uint256", type: "uint256" },
326604
+ { name: "healthFactor", internalType: "uint16", type: "uint16" },
326605
+ { name: "success", internalType: "bool", type: "bool" },
326606
+ {
326607
+ name: "tokens",
326608
+ internalType: "struct TokenInfo[]",
326609
+ type: "tuple[]",
326610
+ components: [
326611
+ { name: "token", internalType: "address", type: "address" },
326612
+ { name: "mask", internalType: "uint256", type: "uint256" },
326613
+ { name: "balance", internalType: "uint256", type: "uint256" },
326614
+ { name: "quota", internalType: "uint256", type: "uint256" },
326615
+ { name: "success", internalType: "bool", type: "bool" }
326616
+ ]
326617
+ }
326618
+ ]
326619
+ },
326620
+ { name: "nextOffset", internalType: "uint256", type: "uint256" }
326408
326621
  ],
326409
- name: "setAddress",
326410
- outputs: [],
326411
- stateMutability: "nonpayable"
326622
+ stateMutability: "view"
326412
326623
  },
326413
326624
  {
326414
326625
  type: "function",
@@ -326416,52 +326627,6 @@ var iAddressProviderV3_1Abi = [
326416
326627
  name: "version",
326417
326628
  outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
326418
326629
  stateMutability: "view"
326419
- },
326420
- {
326421
- type: "event",
326422
- anonymous: false,
326423
- inputs: [
326424
- {
326425
- name: "marketConfigurator",
326426
- internalType: "address",
326427
- type: "address",
326428
- indexed: true
326429
- }
326430
- ],
326431
- name: "AddMarketConfigurator"
326432
- },
326433
- {
326434
- type: "event",
326435
- anonymous: false,
326436
- inputs: [
326437
- {
326438
- name: "marketConfigurator",
326439
- internalType: "address",
326440
- type: "address",
326441
- indexed: true
326442
- }
326443
- ],
326444
- name: "RemoveMarketConfigurator"
326445
- },
326446
- {
326447
- type: "event",
326448
- anonymous: false,
326449
- inputs: [
326450
- { name: "key", internalType: "string", type: "string", indexed: false },
326451
- {
326452
- name: "value",
326453
- internalType: "address",
326454
- type: "address",
326455
- indexed: true
326456
- },
326457
- {
326458
- name: "version",
326459
- internalType: "uint256",
326460
- type: "uint256",
326461
- indexed: false
326462
- }
326463
- ],
326464
- name: "SetAddress"
326465
326630
  }
326466
326631
  ];
326467
326632
  var iMarketCompressorAbi = [
@@ -340065,6 +340230,358 @@ var iCreditFacadeV3MulticallAbi = [
340065
340230
  stateMutability: "nonpayable"
340066
340231
  }
340067
340232
  ];
340233
+ var iDegenNftv2Abi = [
340234
+ {
340235
+ type: "function",
340236
+ inputs: [
340237
+ { name: "to", internalType: "address", type: "address" },
340238
+ { name: "tokenId", internalType: "uint256", type: "uint256" }
340239
+ ],
340240
+ name: "approve",
340241
+ outputs: [],
340242
+ stateMutability: "nonpayable"
340243
+ },
340244
+ {
340245
+ type: "function",
340246
+ inputs: [{ name: "owner", internalType: "address", type: "address" }],
340247
+ name: "balanceOf",
340248
+ outputs: [{ name: "balance", internalType: "uint256", type: "uint256" }],
340249
+ stateMutability: "view"
340250
+ },
340251
+ {
340252
+ type: "function",
340253
+ inputs: [],
340254
+ name: "baseURI",
340255
+ outputs: [{ name: "", internalType: "string", type: "string" }],
340256
+ stateMutability: "view"
340257
+ },
340258
+ {
340259
+ type: "function",
340260
+ inputs: [
340261
+ { name: "from", internalType: "address", type: "address" },
340262
+ { name: "amount", internalType: "uint256", type: "uint256" }
340263
+ ],
340264
+ name: "burn",
340265
+ outputs: [],
340266
+ stateMutability: "nonpayable"
340267
+ },
340268
+ {
340269
+ type: "function",
340270
+ inputs: [{ name: "tokenId", internalType: "uint256", type: "uint256" }],
340271
+ name: "getApproved",
340272
+ outputs: [{ name: "operator", internalType: "address", type: "address" }],
340273
+ stateMutability: "view"
340274
+ },
340275
+ {
340276
+ type: "function",
340277
+ inputs: [
340278
+ { name: "owner", internalType: "address", type: "address" },
340279
+ { name: "operator", internalType: "address", type: "address" }
340280
+ ],
340281
+ name: "isApprovedForAll",
340282
+ outputs: [{ name: "", internalType: "bool", type: "bool" }],
340283
+ stateMutability: "view"
340284
+ },
340285
+ {
340286
+ type: "function",
340287
+ inputs: [
340288
+ { name: "to", internalType: "address", type: "address" },
340289
+ { name: "amount", internalType: "uint256", type: "uint256" }
340290
+ ],
340291
+ name: "mint",
340292
+ outputs: [],
340293
+ stateMutability: "nonpayable"
340294
+ },
340295
+ {
340296
+ type: "function",
340297
+ inputs: [],
340298
+ name: "minter",
340299
+ outputs: [{ name: "", internalType: "address", type: "address" }],
340300
+ stateMutability: "view"
340301
+ },
340302
+ {
340303
+ type: "function",
340304
+ inputs: [],
340305
+ name: "name",
340306
+ outputs: [{ name: "", internalType: "string", type: "string" }],
340307
+ stateMutability: "view"
340308
+ },
340309
+ {
340310
+ type: "function",
340311
+ inputs: [{ name: "tokenId", internalType: "uint256", type: "uint256" }],
340312
+ name: "ownerOf",
340313
+ outputs: [{ name: "owner", internalType: "address", type: "address" }],
340314
+ stateMutability: "view"
340315
+ },
340316
+ {
340317
+ type: "function",
340318
+ inputs: [
340319
+ { name: "from", internalType: "address", type: "address" },
340320
+ { name: "to", internalType: "address", type: "address" },
340321
+ { name: "tokenId", internalType: "uint256", type: "uint256" }
340322
+ ],
340323
+ name: "safeTransferFrom",
340324
+ outputs: [],
340325
+ stateMutability: "nonpayable"
340326
+ },
340327
+ {
340328
+ type: "function",
340329
+ inputs: [
340330
+ { name: "from", internalType: "address", type: "address" },
340331
+ { name: "to", internalType: "address", type: "address" },
340332
+ { name: "tokenId", internalType: "uint256", type: "uint256" },
340333
+ { name: "data", internalType: "bytes", type: "bytes" }
340334
+ ],
340335
+ name: "safeTransferFrom",
340336
+ outputs: [],
340337
+ stateMutability: "nonpayable"
340338
+ },
340339
+ {
340340
+ type: "function",
340341
+ inputs: [
340342
+ { name: "operator", internalType: "address", type: "address" },
340343
+ { name: "approved", internalType: "bool", type: "bool" }
340344
+ ],
340345
+ name: "setApprovalForAll",
340346
+ outputs: [],
340347
+ stateMutability: "nonpayable"
340348
+ },
340349
+ {
340350
+ type: "function",
340351
+ inputs: [{ name: "interfaceId", internalType: "bytes4", type: "bytes4" }],
340352
+ name: "supportsInterface",
340353
+ outputs: [{ name: "", internalType: "bool", type: "bool" }],
340354
+ stateMutability: "view"
340355
+ },
340356
+ {
340357
+ type: "function",
340358
+ inputs: [],
340359
+ name: "symbol",
340360
+ outputs: [{ name: "", internalType: "string", type: "string" }],
340361
+ stateMutability: "view"
340362
+ },
340363
+ {
340364
+ type: "function",
340365
+ inputs: [{ name: "tokenId", internalType: "uint256", type: "uint256" }],
340366
+ name: "tokenURI",
340367
+ outputs: [{ name: "", internalType: "string", type: "string" }],
340368
+ stateMutability: "view"
340369
+ },
340370
+ {
340371
+ type: "function",
340372
+ inputs: [],
340373
+ name: "totalSupply",
340374
+ outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
340375
+ stateMutability: "view"
340376
+ },
340377
+ {
340378
+ type: "function",
340379
+ inputs: [
340380
+ { name: "from", internalType: "address", type: "address" },
340381
+ { name: "to", internalType: "address", type: "address" },
340382
+ { name: "tokenId", internalType: "uint256", type: "uint256" }
340383
+ ],
340384
+ name: "transferFrom",
340385
+ outputs: [],
340386
+ stateMutability: "nonpayable"
340387
+ },
340388
+ {
340389
+ type: "function",
340390
+ inputs: [],
340391
+ name: "version",
340392
+ outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
340393
+ stateMutability: "view"
340394
+ },
340395
+ {
340396
+ type: "event",
340397
+ anonymous: false,
340398
+ inputs: [
340399
+ {
340400
+ name: "owner",
340401
+ internalType: "address",
340402
+ type: "address",
340403
+ indexed: true
340404
+ },
340405
+ {
340406
+ name: "approved",
340407
+ internalType: "address",
340408
+ type: "address",
340409
+ indexed: true
340410
+ },
340411
+ {
340412
+ name: "tokenId",
340413
+ internalType: "uint256",
340414
+ type: "uint256",
340415
+ indexed: true
340416
+ }
340417
+ ],
340418
+ name: "Approval"
340419
+ },
340420
+ {
340421
+ type: "event",
340422
+ anonymous: false,
340423
+ inputs: [
340424
+ {
340425
+ name: "owner",
340426
+ internalType: "address",
340427
+ type: "address",
340428
+ indexed: true
340429
+ },
340430
+ {
340431
+ name: "operator",
340432
+ internalType: "address",
340433
+ type: "address",
340434
+ indexed: true
340435
+ },
340436
+ { name: "approved", internalType: "bool", type: "bool", indexed: false }
340437
+ ],
340438
+ name: "ApprovalForAll"
340439
+ },
340440
+ {
340441
+ type: "event",
340442
+ anonymous: false,
340443
+ inputs: [
340444
+ { name: "", internalType: "address", type: "address", indexed: true }
340445
+ ],
340446
+ name: "NewCreditFacadeAdded"
340447
+ },
340448
+ {
340449
+ type: "event",
340450
+ anonymous: false,
340451
+ inputs: [
340452
+ { name: "", internalType: "address", type: "address", indexed: true }
340453
+ ],
340454
+ name: "NewCreditFacadeRemoved"
340455
+ },
340456
+ {
340457
+ type: "event",
340458
+ anonymous: false,
340459
+ inputs: [
340460
+ { name: "", internalType: "address", type: "address", indexed: true }
340461
+ ],
340462
+ name: "NewMinterSet"
340463
+ },
340464
+ {
340465
+ type: "event",
340466
+ anonymous: false,
340467
+ inputs: [
340468
+ { name: "from", internalType: "address", type: "address", indexed: true },
340469
+ { name: "to", internalType: "address", type: "address", indexed: true },
340470
+ {
340471
+ name: "tokenId",
340472
+ internalType: "uint256",
340473
+ type: "uint256",
340474
+ indexed: true
340475
+ }
340476
+ ],
340477
+ name: "Transfer"
340478
+ },
340479
+ {
340480
+ type: "error",
340481
+ inputs: [],
340482
+ name: "CreditFacadeOrConfiguratorOnlyException"
340483
+ },
340484
+ { type: "error", inputs: [], name: "InsufficientBalanceException" },
340485
+ { type: "error", inputs: [], name: "InvalidCreditFacadeException" },
340486
+ { type: "error", inputs: [], name: "MinterOnlyException" }
340487
+ ];
340488
+ var ierc20Abi = [
340489
+ {
340490
+ type: "function",
340491
+ inputs: [
340492
+ { name: "owner", internalType: "address", type: "address" },
340493
+ { name: "spender", internalType: "address", type: "address" }
340494
+ ],
340495
+ name: "allowance",
340496
+ outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
340497
+ stateMutability: "view"
340498
+ },
340499
+ {
340500
+ type: "function",
340501
+ inputs: [
340502
+ { name: "spender", internalType: "address", type: "address" },
340503
+ { name: "amount", internalType: "uint256", type: "uint256" }
340504
+ ],
340505
+ name: "approve",
340506
+ outputs: [{ name: "", internalType: "bool", type: "bool" }],
340507
+ stateMutability: "nonpayable"
340508
+ },
340509
+ {
340510
+ type: "function",
340511
+ inputs: [{ name: "account", internalType: "address", type: "address" }],
340512
+ name: "balanceOf",
340513
+ outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
340514
+ stateMutability: "view"
340515
+ },
340516
+ {
340517
+ type: "function",
340518
+ inputs: [],
340519
+ name: "totalSupply",
340520
+ outputs: [{ name: "", internalType: "uint256", type: "uint256" }],
340521
+ stateMutability: "view"
340522
+ },
340523
+ {
340524
+ type: "function",
340525
+ inputs: [
340526
+ { name: "to", internalType: "address", type: "address" },
340527
+ { name: "amount", internalType: "uint256", type: "uint256" }
340528
+ ],
340529
+ name: "transfer",
340530
+ outputs: [{ name: "", internalType: "bool", type: "bool" }],
340531
+ stateMutability: "nonpayable"
340532
+ },
340533
+ {
340534
+ type: "function",
340535
+ inputs: [
340536
+ { name: "from", internalType: "address", type: "address" },
340537
+ { name: "to", internalType: "address", type: "address" },
340538
+ { name: "amount", internalType: "uint256", type: "uint256" }
340539
+ ],
340540
+ name: "transferFrom",
340541
+ outputs: [{ name: "", internalType: "bool", type: "bool" }],
340542
+ stateMutability: "nonpayable"
340543
+ },
340544
+ {
340545
+ type: "event",
340546
+ anonymous: false,
340547
+ inputs: [
340548
+ {
340549
+ name: "owner",
340550
+ internalType: "address",
340551
+ type: "address",
340552
+ indexed: true
340553
+ },
340554
+ {
340555
+ name: "spender",
340556
+ internalType: "address",
340557
+ type: "address",
340558
+ indexed: true
340559
+ },
340560
+ {
340561
+ name: "value",
340562
+ internalType: "uint256",
340563
+ type: "uint256",
340564
+ indexed: false
340565
+ }
340566
+ ],
340567
+ name: "Approval"
340568
+ },
340569
+ {
340570
+ type: "event",
340571
+ anonymous: false,
340572
+ inputs: [
340573
+ { name: "from", internalType: "address", type: "address", indexed: true },
340574
+ { name: "to", internalType: "address", type: "address", indexed: true },
340575
+ {
340576
+ name: "value",
340577
+ internalType: "uint256",
340578
+ type: "uint256",
340579
+ indexed: false
340580
+ }
340581
+ ],
340582
+ name: "Transfer"
340583
+ }
340584
+ ];
340068
340585
  var iUpdatablePriceFeedAbi = [
340069
340586
  {
340070
340587
  type: "function",
@@ -345436,6 +345953,523 @@ var routerV3Abi = [
345436
345953
  name: "UnsupportedRouterComponent"
345437
345954
  }
345438
345955
  ];
345956
+ var iAddressProviderV3_1Abi = [
345957
+ {
345958
+ type: "constructor",
345959
+ inputs: [],
345960
+ stateMutability: "nonpayable"
345961
+ },
345962
+ {
345963
+ type: "function",
345964
+ name: "acceptOwnership",
345965
+ inputs: [],
345966
+ outputs: [],
345967
+ stateMutability: "nonpayable"
345968
+ },
345969
+ {
345970
+ type: "function",
345971
+ name: "addMarketConfigurator",
345972
+ inputs: [
345973
+ {
345974
+ name: "_marketConfigurator",
345975
+ type: "address",
345976
+ internalType: "address"
345977
+ }
345978
+ ],
345979
+ outputs: [],
345980
+ stateMutability: "nonpayable"
345981
+ },
345982
+ {
345983
+ type: "function",
345984
+ name: "addresses",
345985
+ inputs: [
345986
+ {
345987
+ name: "",
345988
+ type: "string",
345989
+ internalType: "string"
345990
+ },
345991
+ {
345992
+ name: "",
345993
+ type: "uint256",
345994
+ internalType: "uint256"
345995
+ }
345996
+ ],
345997
+ outputs: [
345998
+ {
345999
+ name: "",
346000
+ type: "address",
346001
+ internalType: "address"
346002
+ }
346003
+ ],
346004
+ stateMutability: "view"
346005
+ },
346006
+ {
346007
+ type: "function",
346008
+ name: "contractType",
346009
+ inputs: [],
346010
+ outputs: [
346011
+ {
346012
+ name: "",
346013
+ type: "bytes32",
346014
+ internalType: "bytes32"
346015
+ }
346016
+ ],
346017
+ stateMutability: "view"
346018
+ },
346019
+ {
346020
+ type: "function",
346021
+ name: "getAddressOrRevert",
346022
+ inputs: [
346023
+ {
346024
+ name: "key",
346025
+ type: "string",
346026
+ internalType: "string"
346027
+ },
346028
+ {
346029
+ name: "_version",
346030
+ type: "uint256",
346031
+ internalType: "uint256"
346032
+ }
346033
+ ],
346034
+ outputs: [
346035
+ {
346036
+ name: "result",
346037
+ type: "address",
346038
+ internalType: "address"
346039
+ }
346040
+ ],
346041
+ stateMutability: "view"
346042
+ },
346043
+ {
346044
+ type: "function",
346045
+ name: "getAddressOrRevert",
346046
+ inputs: [
346047
+ {
346048
+ name: "key",
346049
+ type: "bytes32",
346050
+ internalType: "bytes32"
346051
+ },
346052
+ {
346053
+ name: "_version",
346054
+ type: "uint256",
346055
+ internalType: "uint256"
346056
+ }
346057
+ ],
346058
+ outputs: [
346059
+ {
346060
+ name: "result",
346061
+ type: "address",
346062
+ internalType: "address"
346063
+ }
346064
+ ],
346065
+ stateMutability: "view"
346066
+ },
346067
+ {
346068
+ type: "function",
346069
+ name: "getAllSavedContracts",
346070
+ inputs: [],
346071
+ outputs: [
346072
+ {
346073
+ name: "",
346074
+ type: "tuple[]",
346075
+ internalType: "struct ContractValue[]",
346076
+ components: [
346077
+ {
346078
+ name: "key",
346079
+ type: "string",
346080
+ internalType: "string"
346081
+ },
346082
+ {
346083
+ name: "value",
346084
+ type: "address",
346085
+ internalType: "address"
346086
+ },
346087
+ {
346088
+ name: "version",
346089
+ type: "uint256",
346090
+ internalType: "uint256"
346091
+ }
346092
+ ]
346093
+ }
346094
+ ],
346095
+ stateMutability: "view"
346096
+ },
346097
+ {
346098
+ type: "function",
346099
+ name: "getLatestAddressOrRevert",
346100
+ inputs: [
346101
+ {
346102
+ name: "_key",
346103
+ type: "bytes32",
346104
+ internalType: "bytes32"
346105
+ }
346106
+ ],
346107
+ outputs: [
346108
+ {
346109
+ name: "result",
346110
+ type: "address",
346111
+ internalType: "address"
346112
+ }
346113
+ ],
346114
+ stateMutability: "view"
346115
+ },
346116
+ {
346117
+ type: "function",
346118
+ name: "getLatestAddressOrRevert",
346119
+ inputs: [
346120
+ {
346121
+ name: "key",
346122
+ type: "string",
346123
+ internalType: "string"
346124
+ }
346125
+ ],
346126
+ outputs: [
346127
+ {
346128
+ name: "result",
346129
+ type: "address",
346130
+ internalType: "address"
346131
+ }
346132
+ ],
346133
+ stateMutability: "view"
346134
+ },
346135
+ {
346136
+ type: "function",
346137
+ name: "isMarketConfigurator",
346138
+ inputs: [
346139
+ {
346140
+ name: "riskCurator",
346141
+ type: "address",
346142
+ internalType: "address"
346143
+ }
346144
+ ],
346145
+ outputs: [
346146
+ {
346147
+ name: "",
346148
+ type: "bool",
346149
+ internalType: "bool"
346150
+ }
346151
+ ],
346152
+ stateMutability: "view"
346153
+ },
346154
+ {
346155
+ type: "function",
346156
+ name: "latestVersions",
346157
+ inputs: [
346158
+ {
346159
+ name: "",
346160
+ type: "string",
346161
+ internalType: "string"
346162
+ }
346163
+ ],
346164
+ outputs: [
346165
+ {
346166
+ name: "",
346167
+ type: "uint256",
346168
+ internalType: "uint256"
346169
+ }
346170
+ ],
346171
+ stateMutability: "view"
346172
+ },
346173
+ {
346174
+ type: "function",
346175
+ name: "marketConfiguratorByCreditManager",
346176
+ inputs: [
346177
+ {
346178
+ name: "creditManager",
346179
+ type: "address",
346180
+ internalType: "address"
346181
+ }
346182
+ ],
346183
+ outputs: [
346184
+ {
346185
+ name: "",
346186
+ type: "address",
346187
+ internalType: "address"
346188
+ }
346189
+ ],
346190
+ stateMutability: "view"
346191
+ },
346192
+ {
346193
+ type: "function",
346194
+ name: "marketConfiguratorByPool",
346195
+ inputs: [
346196
+ {
346197
+ name: "",
346198
+ type: "address",
346199
+ internalType: "address"
346200
+ }
346201
+ ],
346202
+ outputs: [
346203
+ {
346204
+ name: "",
346205
+ type: "address",
346206
+ internalType: "address"
346207
+ }
346208
+ ],
346209
+ stateMutability: "view"
346210
+ },
346211
+ {
346212
+ type: "function",
346213
+ name: "marketConfigurators",
346214
+ inputs: [],
346215
+ outputs: [
346216
+ {
346217
+ name: "",
346218
+ type: "address[]",
346219
+ internalType: "address[]"
346220
+ }
346221
+ ],
346222
+ stateMutability: "view"
346223
+ },
346224
+ {
346225
+ type: "function",
346226
+ name: "owner",
346227
+ inputs: [],
346228
+ outputs: [
346229
+ {
346230
+ name: "",
346231
+ type: "address",
346232
+ internalType: "address"
346233
+ }
346234
+ ],
346235
+ stateMutability: "view"
346236
+ },
346237
+ {
346238
+ type: "function",
346239
+ name: "pendingOwner",
346240
+ inputs: [],
346241
+ outputs: [
346242
+ {
346243
+ name: "",
346244
+ type: "address",
346245
+ internalType: "address"
346246
+ }
346247
+ ],
346248
+ stateMutability: "view"
346249
+ },
346250
+ {
346251
+ type: "function",
346252
+ name: "registerCreditManager",
346253
+ inputs: [
346254
+ {
346255
+ name: "creditManager",
346256
+ type: "address",
346257
+ internalType: "address"
346258
+ }
346259
+ ],
346260
+ outputs: [],
346261
+ stateMutability: "nonpayable"
346262
+ },
346263
+ {
346264
+ type: "function",
346265
+ name: "registerPool",
346266
+ inputs: [
346267
+ {
346268
+ name: "pool",
346269
+ type: "address",
346270
+ internalType: "address"
346271
+ }
346272
+ ],
346273
+ outputs: [],
346274
+ stateMutability: "nonpayable"
346275
+ },
346276
+ {
346277
+ type: "function",
346278
+ name: "removeMarketConfigurator",
346279
+ inputs: [
346280
+ {
346281
+ name: "_marketConfigurator",
346282
+ type: "address",
346283
+ internalType: "address"
346284
+ }
346285
+ ],
346286
+ outputs: [],
346287
+ stateMutability: "nonpayable"
346288
+ },
346289
+ {
346290
+ type: "function",
346291
+ name: "renounceOwnership",
346292
+ inputs: [],
346293
+ outputs: [],
346294
+ stateMutability: "nonpayable"
346295
+ },
346296
+ {
346297
+ type: "function",
346298
+ name: "setAddress",
346299
+ inputs: [
346300
+ {
346301
+ name: "key",
346302
+ type: "string",
346303
+ internalType: "string"
346304
+ },
346305
+ {
346306
+ name: "value",
346307
+ type: "address",
346308
+ internalType: "address"
346309
+ },
346310
+ {
346311
+ name: "saveVersion",
346312
+ type: "bool",
346313
+ internalType: "bool"
346314
+ }
346315
+ ],
346316
+ outputs: [],
346317
+ stateMutability: "nonpayable"
346318
+ },
346319
+ {
346320
+ type: "function",
346321
+ name: "setAddress",
346322
+ inputs: [
346323
+ {
346324
+ name: "addr",
346325
+ type: "address",
346326
+ internalType: "address"
346327
+ },
346328
+ {
346329
+ name: "saveVersion",
346330
+ type: "bool",
346331
+ internalType: "bool"
346332
+ }
346333
+ ],
346334
+ outputs: [],
346335
+ stateMutability: "nonpayable"
346336
+ },
346337
+ {
346338
+ type: "function",
346339
+ name: "transferOwnership",
346340
+ inputs: [
346341
+ {
346342
+ name: "newOwner",
346343
+ type: "address",
346344
+ internalType: "address"
346345
+ }
346346
+ ],
346347
+ outputs: [],
346348
+ stateMutability: "nonpayable"
346349
+ },
346350
+ {
346351
+ type: "function",
346352
+ name: "version",
346353
+ inputs: [],
346354
+ outputs: [
346355
+ {
346356
+ name: "",
346357
+ type: "uint256",
346358
+ internalType: "uint256"
346359
+ }
346360
+ ],
346361
+ stateMutability: "view"
346362
+ },
346363
+ {
346364
+ type: "event",
346365
+ name: "AddMarketConfigurator",
346366
+ inputs: [
346367
+ {
346368
+ name: "marketConfigurator",
346369
+ type: "address",
346370
+ indexed: true,
346371
+ internalType: "address"
346372
+ }
346373
+ ],
346374
+ anonymous: false
346375
+ },
346376
+ {
346377
+ type: "event",
346378
+ name: "OwnershipTransferStarted",
346379
+ inputs: [
346380
+ {
346381
+ name: "previousOwner",
346382
+ type: "address",
346383
+ indexed: true,
346384
+ internalType: "address"
346385
+ },
346386
+ {
346387
+ name: "newOwner",
346388
+ type: "address",
346389
+ indexed: true,
346390
+ internalType: "address"
346391
+ }
346392
+ ],
346393
+ anonymous: false
346394
+ },
346395
+ {
346396
+ type: "event",
346397
+ name: "OwnershipTransferred",
346398
+ inputs: [
346399
+ {
346400
+ name: "previousOwner",
346401
+ type: "address",
346402
+ indexed: true,
346403
+ internalType: "address"
346404
+ },
346405
+ {
346406
+ name: "newOwner",
346407
+ type: "address",
346408
+ indexed: true,
346409
+ internalType: "address"
346410
+ }
346411
+ ],
346412
+ anonymous: false
346413
+ },
346414
+ {
346415
+ type: "event",
346416
+ name: "RemoveMarketConfigurator",
346417
+ inputs: [
346418
+ {
346419
+ name: "marketConfigurator",
346420
+ type: "address",
346421
+ indexed: true,
346422
+ internalType: "address"
346423
+ }
346424
+ ],
346425
+ anonymous: false
346426
+ },
346427
+ {
346428
+ type: "event",
346429
+ name: "SetAddress",
346430
+ inputs: [
346431
+ {
346432
+ name: "key",
346433
+ type: "string",
346434
+ indexed: false,
346435
+ internalType: "string"
346436
+ },
346437
+ {
346438
+ name: "value",
346439
+ type: "address",
346440
+ indexed: true,
346441
+ internalType: "address"
346442
+ },
346443
+ {
346444
+ name: "version",
346445
+ type: "uint256",
346446
+ indexed: false,
346447
+ internalType: "uint256"
346448
+ }
346449
+ ],
346450
+ anonymous: false
346451
+ },
346452
+ {
346453
+ type: "error",
346454
+ name: "AddressNotFoundException",
346455
+ inputs: []
346456
+ },
346457
+ {
346458
+ type: "error",
346459
+ name: "CantRemoveMarketConfiguratorWithExistingPoolsException",
346460
+ inputs: []
346461
+ },
346462
+ {
346463
+ type: "error",
346464
+ name: "MarketConfiguratorNotFoundException",
346465
+ inputs: []
346466
+ },
346467
+ {
346468
+ type: "error",
346469
+ name: "MarketConfiguratorsOnlyException",
346470
+ inputs: []
346471
+ }
346472
+ ];
345439
346473
  var iCreditFacadeV310Abi = [
345440
346474
  {
345441
346475
  type: "function",
@@ -349325,6 +350359,7 @@ var NO_VERSION = 0;
349325
350359
  var AP_MARKET_COMPRESSOR = "MARKET_COMPRESSOR";
349326
350360
  var AP_MARKET_CONFIGURATOR = "MARKET_CONFIGURATOR";
349327
350361
  var AP_PRICE_FEED_COMPRESSOR = "PRICE_FEED_COMPRESSOR";
350362
+ var AP_CREDIT_ACCOUNT_COMPRESSOR = "CREDIT_ACCOUNT_COMPRESSOR";
349328
350363
  var AP_GEAR_TOKEN = "GEAR_TOKEN";
349329
350364
  var AP_ROUTER = "ROUTER";
349330
350365
  var AP_BOT_LIST = "BOT_LIST";
@@ -349362,6 +350397,7 @@ function botPermissionsToString(value) {
349362
350397
  return result;
349363
350398
  }
349364
350399
  var MIN_INT96 = -39614081257132168796771975168n;
350400
+ var MAX_UINT256 = 115792089237316195423570985008687907853269984665640564039457584007913129639935n;
349365
350401
  var RAY_DECIMALS_POW = 27;
349366
350402
  var RAY = 10n ** BigInt(RAY_DECIMALS_POW);
349367
350403
  var halfRAY = RAY / 2n;
@@ -350038,12 +351074,12 @@ var UniswapV3AdapterContract = class extends AbstractAdapterContract {
350038
351074
  ];
350039
351075
  }
350040
351076
  case "exactInput": {
350041
- const [{ amountIn, amountOutMinimum, path: path10 }] = params.args;
350042
- const pathStr = this.trackInputPath(path10);
350043
- const token = `0x${path10.replace("0x", "").slice(0, 40)}`;
351077
+ const [{ amountIn, amountOutMinimum, path: path11 }] = params.args;
351078
+ const pathStr = this.trackInputPath(path11);
351079
+ const token = `0x${path11.replace("0x", "").slice(0, 40)}`;
350044
351080
  const amountInStr = this.sdk.tokensMeta.formatBN(token, amountIn);
350045
351081
  const amountOutMinimumStr = this.sdk.tokensMeta.formatBN(
350046
- `0x${path10.slice(-40, path10.length)}`,
351082
+ `0x${path11.slice(-40, path11.length)}`,
350047
351083
  amountOutMinimum
350048
351084
  );
350049
351085
  return [
@@ -350051,12 +351087,12 @@ var UniswapV3AdapterContract = class extends AbstractAdapterContract {
350051
351087
  ];
350052
351088
  }
350053
351089
  case "exactDiffInput": {
350054
- const [{ leftoverAmount, rateMinRAY, path: path10 }] = params.args;
351090
+ const [{ leftoverAmount, rateMinRAY, path: path11 }] = params.args;
350055
351091
  const leftoverAmountStr = this.sdk.tokensMeta.formatBN(
350056
- `0x${path10.replace("0x", "").slice(0, 40)}`,
351092
+ `0x${path11.replace("0x", "").slice(0, 40)}`,
350057
351093
  leftoverAmount
350058
351094
  );
350059
- const pathStr = this.trackInputPath(path10);
351095
+ const pathStr = this.trackInputPath(path11);
350060
351096
  return [
350061
351097
  `(leftoverAmount: ${leftoverAmountStr}, rate: ${formatBN(
350062
351098
  rateMinRAY,
@@ -350065,14 +351101,14 @@ var UniswapV3AdapterContract = class extends AbstractAdapterContract {
350065
351101
  ];
350066
351102
  }
350067
351103
  case "exactOutput": {
350068
- const [{ amountInMaximum, amountOut, path: path10 }] = params.args;
350069
- const pathStr = this.trackOutputPath(path10);
351104
+ const [{ amountInMaximum, amountOut, path: path11 }] = params.args;
351105
+ const pathStr = this.trackOutputPath(path11);
350070
351106
  const amountInMaximumStr = this.sdk.tokensMeta.formatBN(
350071
- `0x${path10.slice(-40, path10.length)}`,
351107
+ `0x${path11.slice(-40, path11.length)}`,
350072
351108
  amountInMaximum
350073
351109
  );
350074
351110
  const amountOutStr = this.sdk.tokensMeta.formatBN(
350075
- `0x${path10.replace("0x", "").slice(0, 40)}`,
351111
+ `0x${path11.replace("0x", "").slice(0, 40)}`,
350076
351112
  amountOut
350077
351113
  );
350078
351114
  return [
@@ -350096,30 +351132,30 @@ var UniswapV3AdapterContract = class extends AbstractAdapterContract {
350096
351132
  return void 0;
350097
351133
  }
350098
351134
  }
350099
- trackInputPath(path10) {
351135
+ trackInputPath(path11) {
350100
351136
  let result = "";
350101
- let pointer = path10.startsWith("0x") ? 2 : 0;
350102
- while (pointer <= path10.length - 40) {
350103
- const from = `0x${path10.slice(pointer, pointer + 40)}`.toLowerCase();
351137
+ let pointer = path11.startsWith("0x") ? 2 : 0;
351138
+ while (pointer <= path11.length - 40) {
351139
+ const from = `0x${path11.slice(pointer, pointer + 40)}`.toLowerCase();
350104
351140
  result += this.sdk.tokensMeta.symbol(from) || from;
350105
351141
  pointer += 40;
350106
- if (pointer > path10.length - 6) return result;
350107
- const fee = parseInt(path10.slice(pointer, pointer + 6), 16);
351142
+ if (pointer > path11.length - 6) return result;
351143
+ const fee = parseInt(path11.slice(pointer, pointer + 6), 16);
350108
351144
  pointer += 6;
350109
351145
  result += ` ==(fee: ${fee})==> `;
350110
351146
  }
350111
351147
  return result;
350112
351148
  }
350113
- trackOutputPath(path10) {
351149
+ trackOutputPath(path11) {
350114
351150
  let result = "";
350115
- let pointer = path10.length;
351151
+ let pointer = path11.length;
350116
351152
  while (pointer >= 40) {
350117
351153
  pointer -= 40;
350118
- const from = `0x${path10.slice(pointer, pointer + 40)}`;
351154
+ const from = `0x${path11.slice(pointer, pointer + 40)}`;
350119
351155
  result += this.sdk.tokensMeta.symbol(from) || from;
350120
351156
  if (pointer < 6) return result;
350121
351157
  pointer -= 6;
350122
- const fee = parseInt(path10.slice(pointer, pointer + 6), 16);
351158
+ const fee = parseInt(path11.slice(pointer, pointer + 6), 16);
350123
351159
  result += ` ==(fee: ${fee})==> `;
350124
351160
  }
350125
351161
  return result;
@@ -353011,9 +354047,9 @@ var PathOptionFactory = class _PathOptionFactory {
353011
354047
  const balancerSet = /* @__PURE__ */ new Set([...balancerPools, ...balancerTokensFromAura]);
353012
354048
  return Array.from(balancerSet.values());
353013
354049
  }
353014
- static next(path10) {
353015
- let newPath = [...path10];
353016
- for (let i = path10.length - 1; i >= 0; i--) {
354050
+ static next(path11) {
354051
+ let newPath = [...path11];
354052
+ for (let i = path11.length - 1; i >= 0; i--) {
353017
354053
  const po = { ...newPath[i] };
353018
354054
  po.option++;
353019
354055
  newPath[i] = po;
@@ -353315,6 +354351,689 @@ function balancesMap(assets) {
353315
354351
  function assetsMap(assets) {
353316
354352
  return new AddressMap(assets.map((a) => [a.token, a]));
353317
354353
  }
354354
+ var CreditAccountsService = class extends SDKConstruct {
354355
+ #compressor;
354356
+ constructor(sdk) {
354357
+ super(sdk);
354358
+ this.#compressor = sdk.addressProvider.getLatestVersion(
354359
+ AP_CREDIT_ACCOUNT_COMPRESSOR
354360
+ );
354361
+ }
354362
+ /**
354363
+ * Returns single credit account data, or undefined if it's not found
354364
+ * Performs all necessary price feed updates under the hood
354365
+ * @param account
354366
+ * @param options
354367
+ * @returns
354368
+ */
354369
+ async getCreditAccountData(account, options) {
354370
+ const blockNumber = options?.blockNumber;
354371
+ let raw;
354372
+ try {
354373
+ raw = await this.provider.publicClient.readContract({
354374
+ abi: iCreditAccountCompressorAbi,
354375
+ address: this.#compressor,
354376
+ functionName: "getCreditAccountData",
354377
+ args: [account],
354378
+ blockNumber
354379
+ });
354380
+ } catch (e) {
354381
+ return void 0;
354382
+ }
354383
+ if (raw.success) {
354384
+ return raw;
354385
+ }
354386
+ const { txs: priceUpdateTxs, timestamp: _ } = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs(void 0, {
354387
+ account
354388
+ });
354389
+ const resp = await simulateMulticall(this.provider.publicClient, {
354390
+ contracts: [
354391
+ ...priceUpdateTxs.map(rawTxToMulticallPriceUpdate),
354392
+ {
354393
+ abi: iCreditAccountCompressorAbi,
354394
+ address: this.#compressor,
354395
+ functionName: "getCreditAccountData",
354396
+ args: [account]
354397
+ }
354398
+ ],
354399
+ allowFailure: false,
354400
+ gas: 550000000n,
354401
+ batchSize: 0,
354402
+ // we cannot have price updates and compressor request in different batches
354403
+ blockNumber
354404
+ });
354405
+ const cad = resp.pop();
354406
+ return cad;
354407
+ }
354408
+ /**
354409
+ * Methods to get all credit accounts with some optional filtering
354410
+ * Performs all necessary price feed updates under the hood
354411
+ *
354412
+ * TODO: do we want to expose pagination?
354413
+ * TODO: do we want to expose "reverting"?
354414
+ * TODO: do we want to expose MarketFilter in any way? If so, we need to check that the MarketFilter is compatibled with attached markets?
354415
+ * @param args
354416
+ * @param options
354417
+ * @returns returned credit accounts are sorted by health factor in ascending order
354418
+ */
354419
+ async getCreditAccounts(args, options) {
354420
+ const {
354421
+ creditManager,
354422
+ includeZeroDebt = false,
354423
+ maxHealthFactor = 65535,
354424
+ // TODO: this will change to bigint
354425
+ minHealthFactor = 0,
354426
+ owner = ADDRESS_0X0
354427
+ } = args ?? {};
354428
+ const arg0 = creditManager ?? {
354429
+ curators: [],
354430
+ pools: this.pools,
354431
+ underlying: ADDRESS_0X0
354432
+ };
354433
+ const caFilter = {
354434
+ owner,
354435
+ includeZeroDebt,
354436
+ minHealthFactor,
354437
+ maxHealthFactor
354438
+ };
354439
+ const { txs: priceUpdateTxs, timestamp: _ } = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs();
354440
+ const allCAs = [];
354441
+ for (const reverting of [false, true]) {
354442
+ let offset = 0n;
354443
+ do {
354444
+ const [accounts, newOffset] = await this.#getCreditAccounts(
354445
+ [arg0, { ...caFilter, reverting }, offset],
354446
+ priceUpdateTxs,
354447
+ options
354448
+ );
354449
+ allCAs.push(...accounts);
354450
+ offset = newOffset;
354451
+ } while (offset !== 0n);
354452
+ }
354453
+ return allCAs.sort((a, b) => Number(a.healthFactor - b.healthFactor));
354454
+ }
354455
+ /**
354456
+ * Generates transaction to liquidate credit account
354457
+ * @param account
354458
+ * @param to Address to transfer underlying left after liquidation
354459
+ * @param slippage
354460
+ * @returns
354461
+ */
354462
+ async fullyLiquidate(account, to, slippage = 50n) {
354463
+ const cm = this.sdk.marketRegister.findCreditManager(account.creditManager);
354464
+ const routerCloseResult = await this.sdk.router.findBestClosePath({
354465
+ creditAccount: account,
354466
+ creditManager: cm.creditManager,
354467
+ slippage
354468
+ });
354469
+ const priceUpdates = await this.getPriceUpdatesForFacade(
354470
+ account.creditManager,
354471
+ account,
354472
+ void 0
354473
+ );
354474
+ const calls = [...priceUpdates, ...routerCloseResult.calls];
354475
+ const tx = cm.creditFacade.liquidateCreditAccount(
354476
+ account.creditAccount,
354477
+ to,
354478
+ calls
354479
+ );
354480
+ return { tx, calls, routerCloseResult, creditFacade: cm.creditFacade };
354481
+ }
354482
+ /**
354483
+ * Closes credit account or sets debt to zero (but keep account)
354484
+ * @param operation
354485
+ * @param creditAccount
354486
+ * @param assetsToWithdraw Tokens to withdraw from credit account
354487
+ * @param to Address to withdraw underlying to
354488
+ * @param slippage
354489
+ * @param closePath
354490
+ * @returns
354491
+ */
354492
+ async closeCreditAccount({
354493
+ operation,
354494
+ assetsToWithdraw,
354495
+ creditAccount: ca,
354496
+ to,
354497
+ slippage = 50n,
354498
+ closePath
354499
+ }) {
354500
+ const cm = this.sdk.marketRegister.findCreditManager(ca.creditManager);
354501
+ const routerCloseResult = closePath || await this.sdk.router.findBestClosePath({
354502
+ creditAccount: ca,
354503
+ creditManager: cm.creditManager,
354504
+ slippage
354505
+ });
354506
+ const calls = [
354507
+ ...routerCloseResult.calls,
354508
+ ...this.#prepareDisableQuotas(ca),
354509
+ ...this.#prepareDecreaseDebt(ca),
354510
+ ...this.#prepareDisableTokens(ca),
354511
+ ...assetsToWithdraw.map(
354512
+ (t) => this.#prepareWithdrawToken(ca.creditFacade, t, MAX_UINT256, to)
354513
+ )
354514
+ ];
354515
+ const tx = operation === "close" ? cm.creditFacade.closeCreditAccount(ca.creditAccount, calls) : cm.creditFacade.multicall(ca.creditAccount, calls);
354516
+ return { tx, calls, routerCloseResult, creditFacade: cm.creditFacade };
354517
+ }
354518
+ /**
354519
+ * Repays credit account or sets debt to zero (but keep account)
354520
+ * @param operation
354521
+ * @param creditAccount
354522
+ * @param assetsToWithdraw Tokens to withdraw from credit account
354523
+ * @param collateralAssets Tokens to pay for
354524
+ * @param to Address to withdraw underlying to
354525
+ * @param slippage
354526
+ * @param permits
354527
+ * @returns
354528
+ */
354529
+ async repayCreditAccount({
354530
+ operation,
354531
+ collateralAssets,
354532
+ assetsToWithdraw,
354533
+ creditAccount: ca,
354534
+ permits,
354535
+ to
354536
+ }) {
354537
+ const cm = this.sdk.marketRegister.findCreditManager(ca.creditManager);
354538
+ const addCollateral = collateralAssets.filter((a) => a.balance > 0);
354539
+ const calls = [
354540
+ ...this.#prepareAddCollateral(ca.creditFacade, addCollateral, permits),
354541
+ ...this.#prepareDisableQuotas(ca),
354542
+ ...this.#prepareDecreaseDebt(ca),
354543
+ ...this.#prepareDisableTokens(ca),
354544
+ // TODO: probably needs a better way to handle reward tokens
354545
+ ...assetsToWithdraw.map(
354546
+ (t) => this.#prepareWithdrawToken(ca.creditFacade, t, MAX_UINT256, to)
354547
+ )
354548
+ ];
354549
+ const tx = operation === "close" ? cm.creditFacade.closeCreditAccount(ca.creditAccount, calls) : cm.creditFacade.multicall(ca.creditAccount, calls);
354550
+ return { tx, calls, creditFacade: cm.creditFacade };
354551
+ }
354552
+ /**
354553
+ * Repays liquidatable credit account
354554
+ * @param creditAccount
354555
+ * @param assetsToWithdraw Tokens to withdraw from credit account
354556
+ * @param collateralAssets Tokens to pay for
354557
+ * @param to Address to withdraw underlying to
354558
+ * @param slippage
354559
+ * @returns
354560
+ */
354561
+ async repayAndLiquidateCreditAccount({
354562
+ collateralAssets,
354563
+ assetsToWithdraw,
354564
+ creditAccount: ca,
354565
+ permits,
354566
+ to
354567
+ }) {
354568
+ const cm = this.sdk.marketRegister.findCreditManager(ca.creditManager);
354569
+ const priceUpdates = await this.getPriceUpdatesForFacade(
354570
+ ca.creditManager,
354571
+ ca,
354572
+ void 0
354573
+ );
354574
+ const addCollateral = collateralAssets.filter((a) => a.balance > 0);
354575
+ const calls = [
354576
+ ...priceUpdates,
354577
+ ...this.#prepareAddCollateral(ca.creditFacade, addCollateral, permits),
354578
+ ...assetsToWithdraw.map(
354579
+ (t) => this.#prepareWithdrawToken(ca.creditFacade, t, MAX_UINT256, to)
354580
+ )
354581
+ ];
354582
+ const tx = cm.creditFacade.liquidateCreditAccount(
354583
+ ca.creditAccount,
354584
+ to,
354585
+ calls
354586
+ );
354587
+ return { tx, calls, creditFacade: cm.creditFacade };
354588
+ }
354589
+ async updateQuotas(props) {
354590
+ const { creditAccount } = props;
354591
+ const cm = this.sdk.marketRegister.findCreditManager(
354592
+ creditAccount.creditManager
354593
+ );
354594
+ const priceUpdates = await this.getPriceUpdatesForFacade(
354595
+ creditAccount.creditManager,
354596
+ creditAccount,
354597
+ void 0
354598
+ );
354599
+ const calls = [
354600
+ ...priceUpdates,
354601
+ ...this.#prepareUpdateQuotas(props.creditAccount.creditFacade, props)
354602
+ ];
354603
+ const tx = cm.creditFacade.multicall(creditAccount.creditAccount, [
354604
+ ...priceUpdates,
354605
+ ...this.#prepareUpdateQuotas(props.creditAccount.creditFacade, props)
354606
+ ]);
354607
+ return { tx, calls, creditFacade: cm.creditFacade };
354608
+ }
354609
+ async addCollateral(props) {
354610
+ const { creditAccount, asset, permit, ethAmount } = props;
354611
+ const cm = this.sdk.marketRegister.findCreditManager(
354612
+ creditAccount.creditManager
354613
+ );
354614
+ const priceUpdatesCalls = await this.getPriceUpdatesForFacade(
354615
+ creditAccount.creditManager,
354616
+ creditAccount,
354617
+ props.averageQuota
354618
+ );
354619
+ const calls = [
354620
+ ...priceUpdatesCalls,
354621
+ ...this.#prepareAddCollateral(
354622
+ creditAccount.creditFacade,
354623
+ [asset],
354624
+ permit ? { [asset.token]: permit } : {}
354625
+ ),
354626
+ ...this.#prepareUpdateQuotas(creditAccount.creditFacade, props)
354627
+ ];
354628
+ const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
354629
+ tx.value = ethAmount.toString(10);
354630
+ return { tx, calls, creditFacade: cm.creditFacade };
354631
+ }
354632
+ async changeDebt({
354633
+ creditAccount,
354634
+ amount
354635
+ }) {
354636
+ if (amount === 0n) {
354637
+ throw new Error("debt increase or decrease must be non-zero");
354638
+ }
354639
+ const isDecrease = amount < 0n;
354640
+ const change = isDecrease ? -amount : amount;
354641
+ const cm = this.sdk.marketRegister.findCreditManager(
354642
+ creditAccount.creditManager
354643
+ );
354644
+ const priceUpdatesCalls = await this.getPriceUpdatesForFacade(
354645
+ creditAccount.creditManager,
354646
+ creditAccount,
354647
+ void 0
354648
+ );
354649
+ const underlyingEnabled = (creditAccount.enabledTokensMask & 1n) === 1n;
354650
+ const shouldEnable = !isDecrease && !underlyingEnabled;
354651
+ const calls = [
354652
+ ...priceUpdatesCalls,
354653
+ ...shouldEnable ? this.#prepareEnableTokens(creditAccount.creditFacade, [
354654
+ creditAccount.underlying
354655
+ ]) : [],
354656
+ this.#prepareChangeDebt(creditAccount.creditFacade, change, isDecrease)
354657
+ ];
354658
+ const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
354659
+ return { tx, calls, creditFacade: cm.creditFacade };
354660
+ }
354661
+ async withdrawCollateral(props) {
354662
+ const { creditAccount, assetsToWithdraw, to } = props;
354663
+ const cm = this.sdk.marketRegister.findCreditManager(
354664
+ creditAccount.creditManager
354665
+ );
354666
+ const priceUpdatesCalls = await this.getPriceUpdatesForFacade(
354667
+ creditAccount.creditManager,
354668
+ creditAccount,
354669
+ void 0
354670
+ );
354671
+ const calls = [
354672
+ ...priceUpdatesCalls,
354673
+ ...assetsToWithdraw.map(
354674
+ (a) => this.#prepareWithdrawToken(
354675
+ creditAccount.creditFacade,
354676
+ a.token,
354677
+ a.balance,
354678
+ to
354679
+ )
354680
+ ),
354681
+ ...this.#prepareUpdateQuotas(creditAccount.creditFacade, props)
354682
+ ];
354683
+ const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
354684
+ return { tx, calls, creditFacade: cm.creditFacade };
354685
+ }
354686
+ async executeSwap(props) {
354687
+ const { creditAccount, calls: swapCalls } = props;
354688
+ if (swapCalls.length === 0) throw new Error("No path to execute");
354689
+ const cm = this.sdk.marketRegister.findCreditManager(
354690
+ creditAccount.creditManager
354691
+ );
354692
+ const priceUpdatesCalls = await this.getPriceUpdatesForFacade(
354693
+ creditAccount.creditManager,
354694
+ creditAccount,
354695
+ props.averageQuota
354696
+ );
354697
+ const calls = [
354698
+ ...priceUpdatesCalls,
354699
+ ...swapCalls,
354700
+ ...this.#prepareUpdateQuotas(creditAccount.creditFacade, props)
354701
+ ];
354702
+ const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
354703
+ return { tx, calls, creditFacade: cm.creditFacade };
354704
+ }
354705
+ async claimFarmRewards(props) {
354706
+ const { tokensToDisable, calls: claimCalls, creditAccount: ca } = props;
354707
+ if (claimCalls.length === 0) throw new Error("No path to execute");
354708
+ const cm = this.sdk.marketRegister.findCreditManager(ca.creditManager);
354709
+ const priceUpdatesCalls = await this.getPriceUpdatesForFacade(
354710
+ ca.creditManager,
354711
+ ca,
354712
+ props.averageQuota
354713
+ );
354714
+ const calls = [
354715
+ ...priceUpdatesCalls,
354716
+ ...claimCalls,
354717
+ ...tokensToDisable.map(
354718
+ (a) => this.#prepareDisableToken(ca.creditFacade, a.token)
354719
+ ),
354720
+ ...this.#prepareUpdateQuotas(ca.creditFacade, props)
354721
+ ];
354722
+ const tx = cm.creditFacade.multicall(ca.creditAccount, calls);
354723
+ return { tx, calls, creditFacade: cm.creditFacade };
354724
+ }
354725
+ async openCA(props) {
354726
+ const {
354727
+ ethAmount,
354728
+ creditManager,
354729
+ collateral,
354730
+ permits,
354731
+ debt,
354732
+ withdrawDebt,
354733
+ referralCode,
354734
+ to,
354735
+ calls: openPathCalls
354736
+ } = props;
354737
+ const cmFactory = this.sdk.marketRegister.findCreditManager(creditManager);
354738
+ const cm = cmFactory.creditManager;
354739
+ const priceUpdatesCalls = await this.getPriceUpdatesForFacade(
354740
+ cm.address,
354741
+ void 0,
354742
+ props.averageQuota
354743
+ );
354744
+ const calls = [
354745
+ ...priceUpdatesCalls,
354746
+ this.#prepareIncreaseDebt(cm.creditFacade, debt),
354747
+ ...this.#prepareAddCollateral(cm.creditFacade, collateral, permits),
354748
+ ...this.#prepareUpdateQuotas(cm.creditFacade, props),
354749
+ ...openPathCalls,
354750
+ ...withdrawDebt ? [this.#prepareWithdrawToken(cm.creditFacade, cm.underlying, debt, to)] : []
354751
+ ];
354752
+ const tx = cmFactory.creditFacade.openCreditAccount(
354753
+ to,
354754
+ calls,
354755
+ referralCode
354756
+ );
354757
+ tx.value = ethAmount.toString(10);
354758
+ return { calls, tx, creditFacade: cmFactory.creditFacade };
354759
+ }
354760
+ /**
354761
+ * Internal wrapper for CreditAccountCompressor.getCreditAccounts + price updates wrapped into multicall
354762
+ * @param args
354763
+ * @param priceUpdateTxs
354764
+ * @param options
354765
+ * @returns
354766
+ */
354767
+ async #getCreditAccounts(args, priceUpdateTxs, options) {
354768
+ const blockNumber = options?.blockNumber;
354769
+ if (priceUpdateTxs?.length) {
354770
+ const resp = await simulateMulticall(this.provider.publicClient, {
354771
+ contracts: [
354772
+ ...priceUpdateTxs.map(rawTxToMulticallPriceUpdate),
354773
+ {
354774
+ abi: iCreditAccountCompressorAbi,
354775
+ address: this.#compressor,
354776
+ functionName: "getCreditAccounts",
354777
+ args
354778
+ }
354779
+ ],
354780
+ allowFailure: false,
354781
+ gas: 550000000n,
354782
+ batchSize: 0,
354783
+ // we cannot have price updates and compressor request in different batches
354784
+ blockNumber
354785
+ });
354786
+ const getCreditAccountsResp = resp.pop();
354787
+ return getCreditAccountsResp;
354788
+ }
354789
+ return this.provider.publicClient.readContract({
354790
+ abi: iCreditAccountCompressorAbi,
354791
+ address: this.#compressor,
354792
+ functionName: "getCreditAccounts",
354793
+ args,
354794
+ blockNumber
354795
+ });
354796
+ }
354797
+ /**
354798
+ * Returns raw txs that are needed to update all price feeds so that all credit accounts (possibly from different markets) compute
354799
+ * @param accounts
354800
+ * @returns
354801
+ */
354802
+ async getUpdateForAccounts(accounts) {
354803
+ const tokensByPool = /* @__PURE__ */ new Map();
354804
+ const oracleByPool = /* @__PURE__ */ new Map();
354805
+ for (const acc of accounts) {
354806
+ const market = this.sdk.marketRegister.findByCreditManager(
354807
+ acc.creditManager
354808
+ );
354809
+ const pool = market.poolFactory.pool.address;
354810
+ oracleByPool.set(pool, market.priceOracle);
354811
+ for (const t of acc.tokens) {
354812
+ if (t.balance > 10n) {
354813
+ const tokens = tokensByPool.get(pool) ?? /* @__PURE__ */ new Set();
354814
+ tokens.add(t.token);
354815
+ tokensByPool.set(pool, tokens);
354816
+ }
354817
+ }
354818
+ }
354819
+ const priceFeeds = [];
354820
+ for (const [pool, priceFeedFactory] of oracleByPool.entries()) {
354821
+ const tokens = Array.from(tokensByPool.get(pool) ?? []);
354822
+ priceFeeds.push(...priceFeedFactory.priceFeedsForTokens(tokens));
354823
+ }
354824
+ return this.sdk.priceFeeds.generatePriceFeedsUpdateTxs(priceFeeds);
354825
+ }
354826
+ async getUpdateForAccount(creditManager, creditAccount, desiredQuotas) {
354827
+ const tokensByPool = /* @__PURE__ */ new Map();
354828
+ const oracleByPool = /* @__PURE__ */ new Map();
354829
+ const quotaRecord = desiredQuotas ? assetsMap(desiredQuotas) : desiredQuotas;
354830
+ const caBalancesRecord = creditAccount ? assetsMap(creditAccount.tokens) : creditAccount;
354831
+ const market = this.sdk.marketRegister.findByCreditManager(creditManager);
354832
+ const cm = this.sdk.marketRegister.findCreditManager(creditManager).creditManager;
354833
+ const pool = market.poolFactory.pool.address;
354834
+ oracleByPool.set(pool, market.priceOracle);
354835
+ const insertToken = (p, t) => {
354836
+ const tokens = tokensByPool.get(p) ?? /* @__PURE__ */ new Set();
354837
+ tokens.add(t);
354838
+ tokensByPool.set(pool, tokens);
354839
+ };
354840
+ for (const t of cm.collateralTokens) {
354841
+ if (creditAccount && caBalancesRecord && quotaRecord) {
354842
+ const balanceAsset = caBalancesRecord.get(t);
354843
+ const balance = balanceAsset?.balance || 0n;
354844
+ const mask = balanceAsset?.mask || 0n;
354845
+ const isEnabled = (mask & creditAccount.enabledTokensMask) !== 0n;
354846
+ const quotaAsset = quotaRecord.get(t);
354847
+ const quotaBalance = quotaAsset?.balance || 0n;
354848
+ if (balance > 10n && isEnabled || quotaBalance > 0)
354849
+ insertToken(pool, t);
354850
+ } else if (creditAccount && caBalancesRecord) {
354851
+ const balanceAsset = caBalancesRecord.get(t);
354852
+ const balance = balanceAsset?.balance || 0n;
354853
+ const mask = balanceAsset?.mask || 0n;
354854
+ const isEnabled = (mask & creditAccount.enabledTokensMask) !== 0n;
354855
+ if (balance > 10n && isEnabled) insertToken(pool, t);
354856
+ } else if (quotaRecord) {
354857
+ const quotaAsset = quotaRecord.get(t);
354858
+ const quotaBalance = quotaAsset?.balance || 0n;
354859
+ if (quotaBalance > 0) insertToken(pool, t);
354860
+ }
354861
+ }
354862
+ const priceFeeds = [];
354863
+ for (const [pool2, oracle] of oracleByPool.entries()) {
354864
+ const tokens = Array.from(tokensByPool.get(pool2) ?? []);
354865
+ priceFeeds.push(...oracle.priceFeedsForTokens(tokens));
354866
+ }
354867
+ return this.sdk.priceFeeds.generatePriceFeedsUpdateTxs(
354868
+ priceFeeds,
354869
+ creditAccount ? { account: creditAccount.creditAccount } : void 0
354870
+ );
354871
+ }
354872
+ /**
354873
+ * Returns account price updates in a non-encoded format
354874
+ * @param acc
354875
+ * @returns
354876
+ */
354877
+ async getOnDemandPriceUpdates(creditManager, creditAccount, desiredQuotas) {
354878
+ const market = this.sdk.marketRegister.findByCreditManager(creditManager);
354879
+ const update = await this.getUpdateForAccount(
354880
+ creditManager,
354881
+ creditAccount,
354882
+ desiredQuotas
354883
+ );
354884
+ return market.priceOracle.onDemandPriceUpdates(update);
354885
+ }
354886
+ /**
354887
+ * Returns price updates in format that is accepted by various credit facade methods (multicall, close/liquidate, etc...)
354888
+ * @param acc
354889
+ * @returns
354890
+ */
354891
+ async getPriceUpdatesForFacade(creditManager, creditAccount, desiredQuotas) {
354892
+ const cm = this.sdk.marketRegister.findCreditManager(creditManager);
354893
+ const updates = await this.getOnDemandPriceUpdates(
354894
+ creditManager,
354895
+ creditAccount,
354896
+ desiredQuotas
354897
+ );
354898
+ return cm.creditFacade.encodeOnDemandPriceUpdates(updates);
354899
+ }
354900
+ #prepareDisableQuotas(ca) {
354901
+ const calls = [];
354902
+ for (const { token, quota } of ca.tokens) {
354903
+ if (quota > 0n) {
354904
+ calls.push({
354905
+ target: ca.creditFacade,
354906
+ callData: encodeFunctionData({
354907
+ abi: iCreditFacadeV3MulticallAbi,
354908
+ functionName: "updateQuota",
354909
+ args: [token, MIN_INT96, 0n]
354910
+ })
354911
+ });
354912
+ }
354913
+ }
354914
+ return calls;
354915
+ }
354916
+ #prepareUpdateQuotas(creditFacade, { averageQuota, minQuota }) {
354917
+ const minRecord = assetsMap(minQuota);
354918
+ const calls = averageQuota.map((q) => {
354919
+ const minAsset = minRecord.get(q.token);
354920
+ const min = minAsset && minAsset?.balance > 0 ? minAsset.balance : 0n;
354921
+ return {
354922
+ target: creditFacade,
354923
+ callData: encodeFunctionData({
354924
+ abi: iCreditFacadeV3MulticallAbi,
354925
+ functionName: "updateQuota",
354926
+ args: [q.token, q.balance, min]
354927
+ })
354928
+ };
354929
+ });
354930
+ return calls;
354931
+ }
354932
+ #prepareDecreaseDebt(ca) {
354933
+ if (ca.debt > 0n) {
354934
+ return [
354935
+ {
354936
+ target: ca.creditFacade,
354937
+ callData: encodeFunctionData({
354938
+ abi: iCreditFacadeV3MulticallAbi,
354939
+ functionName: "decreaseDebt",
354940
+ args: [MAX_UINT256]
354941
+ })
354942
+ }
354943
+ ];
354944
+ }
354945
+ return [];
354946
+ }
354947
+ #prepareDisableTokens(ca) {
354948
+ const calls = [];
354949
+ for (const t of ca.tokens) {
354950
+ if (t.token !== ca.underlying && (t.mask & ca.enabledTokensMask) !== 0n && t.quota === 0n) {
354951
+ calls.push(this.#prepareDisableToken(ca.creditFacade, t.token));
354952
+ }
354953
+ }
354954
+ return calls;
354955
+ }
354956
+ #prepareDisableToken(creditFacade, token) {
354957
+ return {
354958
+ target: creditFacade,
354959
+ callData: encodeFunctionData({
354960
+ abi: iCreditFacadeV3MulticallAbi,
354961
+ functionName: "disableToken",
354962
+ args: [token]
354963
+ })
354964
+ };
354965
+ }
354966
+ #prepareEnableTokens(creditFacade, tokens) {
354967
+ return tokens.map((t) => ({
354968
+ target: creditFacade,
354969
+ callData: encodeFunctionData({
354970
+ abi: iCreditFacadeV3MulticallAbi,
354971
+ functionName: "enableToken",
354972
+ args: [t]
354973
+ })
354974
+ }));
354975
+ }
354976
+ #prepareWithdrawToken(creditFacade, token, amount, to) {
354977
+ return {
354978
+ target: creditFacade,
354979
+ callData: encodeFunctionData({
354980
+ abi: iCreditFacadeV3MulticallAbi,
354981
+ functionName: "withdrawCollateral",
354982
+ args: [token, amount, to]
354983
+ })
354984
+ };
354985
+ }
354986
+ #prepareIncreaseDebt(creditFacade, debt) {
354987
+ return {
354988
+ target: creditFacade,
354989
+ callData: encodeFunctionData({
354990
+ abi: iCreditFacadeV3MulticallAbi,
354991
+ functionName: "increaseDebt",
354992
+ args: [debt]
354993
+ })
354994
+ };
354995
+ }
354996
+ #prepareChangeDebt(creditFacade, change, isDecrease) {
354997
+ return {
354998
+ target: creditFacade,
354999
+ callData: encodeFunctionData({
355000
+ abi: iCreditFacadeV3MulticallAbi,
355001
+ functionName: isDecrease ? "decreaseDebt" : "increaseDebt",
355002
+ args: [change]
355003
+ })
355004
+ };
355005
+ }
355006
+ #prepareAddCollateral(creditFacade, assets, permits) {
355007
+ const calls = assets.map(({ token, balance }) => {
355008
+ const p = permits[token];
355009
+ if (p) {
355010
+ return {
355011
+ target: creditFacade,
355012
+ callData: encodeFunctionData({
355013
+ abi: iCreditFacadeV3MulticallAbi,
355014
+ functionName: "addCollateralWithPermit",
355015
+ args: [token, balance, p.deadline, p.v, p.r, p.s]
355016
+ })
355017
+ };
355018
+ }
355019
+ return {
355020
+ target: creditFacade,
355021
+ callData: encodeFunctionData({
355022
+ abi: iCreditFacadeV3MulticallAbi,
355023
+ functionName: "addCollateral",
355024
+ args: [token, balance]
355025
+ })
355026
+ };
355027
+ });
355028
+ return calls;
355029
+ }
355030
+ /**
355031
+ * Returns addresses of pools of attached markets
355032
+ */
355033
+ get pools() {
355034
+ return this.sdk.marketRegister.pools.map((p) => p.pool.address);
355035
+ }
355036
+ };
353318
355037
  var AddressProviderContractV3_1 = class extends BaseContract {
353319
355038
  #addresses = {};
353320
355039
  versions = {};
@@ -354425,9 +356144,9 @@ var log_default = logger;
354425
356144
  var log = log_default.getSubLogger({ name: "git" });
354426
356145
  function getGithubUrl(repo, https = false) {
354427
356146
  const credentials = process.env.GITHUB_TOKEN ?? process.env.GH_TOKEN;
354428
- const path10 = repo.replace(/^@/, "").replace(/\/$/, "");
356147
+ const path11 = repo.replace(/^@/, "").replace(/\/$/, "");
354429
356148
  const cred = credentials ? `${credentials}@` : "";
354430
- return https || credentials ? `https://${cred}github.com/${path10}.git` : `git@github.com:${path10}.git`;
356149
+ return https || credentials ? `https://${cred}github.com/${path11}.git` : `git@github.com:${path11}.git`;
354431
356150
  }
354432
356151
  async function cloneRepo(opts) {
354433
356152
  const { repo, commit, sandboxDir } = opts;
@@ -362720,7 +364439,7 @@ var iDegenDistributorV3Abi = [
362720
364439
  name: "RootUpdated"
362721
364440
  }
362722
364441
  ];
362723
- var iDegenNftv2Abi = [
364442
+ var iDegenNftv2Abi2 = [
362724
364443
  {
362725
364444
  type: "function",
362726
364445
  inputs: [
@@ -371724,8 +373443,8 @@ function asyncExecSolc(inputStringified, solcPath) {
371724
373443
  child.stdin.end();
371725
373444
  });
371726
373445
  }
371727
- function importWorker(path10, options) {
371728
- const resolvedPath = __require.resolve(path10);
373446
+ function importWorker(path11, options) {
373447
+ const resolvedPath = __require.resolve(path11);
371729
373448
  return new Worker(resolvedPath, {
371730
373449
  ...options,
371731
373450
  execArgv: /\.ts$/.test(resolvedPath) ? ["--require", "ts-node/register"] : void 0
@@ -371751,7 +373470,7 @@ function isCallExternalTransaction(t) {
371751
373470
  // ../../packages/node/dist/utils.js
371752
373471
  var import_bytecode_utils = __toESM(require_main(), 1);
371753
373472
  function extractFilesFromJSON(files) {
371754
- return Object.entries(files).map(([path10, file]) => {
373473
+ return Object.entries(files).map(([path11, file]) => {
371755
373474
  let buffer2 = null;
371756
373475
  if (Buffer.isBuffer(file)) {
371757
373476
  buffer2 = file;
@@ -371766,7 +373485,7 @@ function extractFilesFromJSON(files) {
371766
373485
  throw new Error(`cannot convert ${typeof file} into buffer`);
371767
373486
  }
371768
373487
  return {
371769
- path: path10,
373488
+ path: path11,
371770
373489
  buffer: buffer2
371771
373490
  };
371772
373491
  });
@@ -371827,8 +373546,8 @@ var Auditor = class {
371827
373546
  if (!meta2.files) {
371828
373547
  throw new Error("no files to audit");
371829
373548
  }
371830
- const files = extractFilesFromJSON(meta2.files).filter((f) => f.path !== "metadata.json").map(({ path: path10, buffer: buffer2 }) => {
371831
- const p = path10.includes("node_modules/") ? path10.replace("node_modules/", "") : meta2.source;
373549
+ const files = extractFilesFromJSON(meta2.files).filter((f) => f.path !== "metadata.json").map(({ path: path11, buffer: buffer2 }) => {
373550
+ const p = path11.includes("node_modules/") ? path11.replace("node_modules/", "") : meta2.source;
371832
373551
  const gearbox = p.startsWith("@gearbox-protocol");
371833
373552
  return {
371834
373553
  gearbox,
@@ -371848,8 +373567,8 @@ var Auditor = class {
371848
373567
  */
371849
373568
  async auditEtherscanVerified(contract) {
371850
373569
  const input = parseEtherscanSourceCode(contract);
371851
- const files = extractFilesFromJSON(input.sources).map(({ path: path10, buffer: buffer2 }) => {
371852
- const p = path10.replace("node_modules/", "");
373570
+ const files = extractFilesFromJSON(input.sources).map(({ path: path11, buffer: buffer2 }) => {
373571
+ const p = path11.replace("node_modules/", "");
371853
373572
  const gearbox = p.startsWith("@gearbox-protocol");
371854
373573
  return {
371855
373574
  gearbox,
@@ -372359,8 +374078,8 @@ function getErrorMap() {
372359
374078
  return overrideErrorMap;
372360
374079
  }
372361
374080
  var makeIssue = (params) => {
372362
- const { data, path: path10, errorMaps, issueData } = params;
372363
- const fullPath = [...path10, ...issueData.path || []];
374081
+ const { data, path: path11, errorMaps, issueData } = params;
374082
+ const fullPath = [...path11, ...issueData.path || []];
372364
374083
  const fullIssue = {
372365
374084
  ...issueData,
372366
374085
  path: fullPath
@@ -372485,11 +374204,11 @@ var errorUtil;
372485
374204
  var _ZodEnum_cache;
372486
374205
  var _ZodNativeEnum_cache;
372487
374206
  var ParseInputLazyPath = class {
372488
- constructor(parent, value, path10, key) {
374207
+ constructor(parent, value, path11, key) {
372489
374208
  this._cachedPath = [];
372490
374209
  this.parent = parent;
372491
374210
  this.data = value;
372492
- this._path = path10;
374211
+ this._path = path11;
372493
374212
  this._key = key;
372494
374213
  }
372495
374214
  get path() {
@@ -376814,19 +378533,19 @@ function toKey(value) {
376814
378533
  var toKey_default = toKey;
376815
378534
 
376816
378535
  // ../../node_modules/lodash-es/_baseGet.js
376817
- function baseGet(object, path10) {
376818
- path10 = castPath_default(path10, object);
376819
- var index2 = 0, length = path10.length;
378536
+ function baseGet(object, path11) {
378537
+ path11 = castPath_default(path11, object);
378538
+ var index2 = 0, length = path11.length;
376820
378539
  while (object != null && index2 < length) {
376821
- object = object[toKey_default(path10[index2++])];
378540
+ object = object[toKey_default(path11[index2++])];
376822
378541
  }
376823
378542
  return index2 && index2 == length ? object : void 0;
376824
378543
  }
376825
378544
  var baseGet_default = baseGet;
376826
378545
 
376827
378546
  // ../../node_modules/lodash-es/get.js
376828
- function get(object, path10, defaultValue) {
376829
- var result = object == null ? void 0 : baseGet_default(object, path10);
378547
+ function get(object, path11, defaultValue) {
378548
+ var result = object == null ? void 0 : baseGet_default(object, path11);
376830
378549
  return result === void 0 ? defaultValue : result;
376831
378550
  }
376832
378551
  var get_default = get;
@@ -377775,11 +379494,11 @@ function baseHasIn(object, key) {
377775
379494
  var baseHasIn_default = baseHasIn;
377776
379495
 
377777
379496
  // ../../node_modules/lodash-es/_hasPath.js
377778
- function hasPath(object, path10, hasFunc) {
377779
- path10 = castPath_default(path10, object);
377780
- var index2 = -1, length = path10.length, result = false;
379497
+ function hasPath(object, path11, hasFunc) {
379498
+ path11 = castPath_default(path11, object);
379499
+ var index2 = -1, length = path11.length, result = false;
377781
379500
  while (++index2 < length) {
377782
- var key = toKey_default(path10[index2]);
379501
+ var key = toKey_default(path11[index2]);
377783
379502
  if (!(result = object != null && hasFunc(object, key))) {
377784
379503
  break;
377785
379504
  }
@@ -377794,21 +379513,21 @@ function hasPath(object, path10, hasFunc) {
377794
379513
  var hasPath_default = hasPath;
377795
379514
 
377796
379515
  // ../../node_modules/lodash-es/hasIn.js
377797
- function hasIn(object, path10) {
377798
- return object != null && hasPath_default(object, path10, baseHasIn_default);
379516
+ function hasIn(object, path11) {
379517
+ return object != null && hasPath_default(object, path11, baseHasIn_default);
377799
379518
  }
377800
379519
  var hasIn_default = hasIn;
377801
379520
 
377802
379521
  // ../../node_modules/lodash-es/_baseMatchesProperty.js
377803
379522
  var COMPARE_PARTIAL_FLAG6 = 1;
377804
379523
  var COMPARE_UNORDERED_FLAG4 = 2;
377805
- function baseMatchesProperty(path10, srcValue) {
377806
- if (isKey_default(path10) && isStrictComparable_default(srcValue)) {
377807
- return matchesStrictComparable_default(toKey_default(path10), srcValue);
379524
+ function baseMatchesProperty(path11, srcValue) {
379525
+ if (isKey_default(path11) && isStrictComparable_default(srcValue)) {
379526
+ return matchesStrictComparable_default(toKey_default(path11), srcValue);
377808
379527
  }
377809
379528
  return function(object) {
377810
- var objValue = get_default(object, path10);
377811
- return objValue === void 0 && objValue === srcValue ? hasIn_default(object, path10) : baseIsEqual_default(srcValue, objValue, COMPARE_PARTIAL_FLAG6 | COMPARE_UNORDERED_FLAG4);
379529
+ var objValue = get_default(object, path11);
379530
+ return objValue === void 0 && objValue === srcValue ? hasIn_default(object, path11) : baseIsEqual_default(srcValue, objValue, COMPARE_PARTIAL_FLAG6 | COMPARE_UNORDERED_FLAG4);
377812
379531
  };
377813
379532
  }
377814
379533
  var baseMatchesProperty_default = baseMatchesProperty;
@@ -377822,16 +379541,16 @@ function baseProperty(key) {
377822
379541
  var baseProperty_default = baseProperty;
377823
379542
 
377824
379543
  // ../../node_modules/lodash-es/_basePropertyDeep.js
377825
- function basePropertyDeep(path10) {
379544
+ function basePropertyDeep(path11) {
377826
379545
  return function(object) {
377827
- return baseGet_default(object, path10);
379546
+ return baseGet_default(object, path11);
377828
379547
  };
377829
379548
  }
377830
379549
  var basePropertyDeep_default = basePropertyDeep;
377831
379550
 
377832
379551
  // ../../node_modules/lodash-es/property.js
377833
- function property(path10) {
377834
- return isKey_default(path10) ? baseProperty_default(toKey_default(path10)) : basePropertyDeep_default(path10);
379552
+ function property(path11) {
379553
+ return isKey_default(path11) ? baseProperty_default(toKey_default(path11)) : basePropertyDeep_default(path11);
377835
379554
  }
377836
379555
  var property_default = property;
377837
379556
 
@@ -378019,6 +379738,13 @@ import { setTimeout as setTimeout2 } from "node:timers/promises";
378019
379738
  // ../../node_modules/@gearbox-protocol/sdk/dist/esm/dev/index.mjs
378020
379739
  var import_sdk_gov3 = __toESM(require_lib36(), 1);
378021
379740
 
379741
+ // ../../node_modules/viem/_esm/accounts/generatePrivateKey.js
379742
+ init_secp256k1();
379743
+ init_toHex();
379744
+ function generatePrivateKey() {
379745
+ return toHex(secp256k1.utils.randomPrivateKey());
379746
+ }
379747
+
378022
379748
  // ../../node_modules/viem/_esm/accounts/privateKeyToAccount.js
378023
379749
  init_secp256k1();
378024
379750
  init_toHex();
@@ -378198,6 +379924,274 @@ async function evmMineDetailed(client, timestamp) {
378198
379924
  return void 0;
378199
379925
  }
378200
379926
  }
379927
+ var AccountOpener = class {
379928
+ #service;
379929
+ #anvil;
379930
+ #logger;
379931
+ #borrower;
379932
+ #faucet;
379933
+ constructor(service, options = {}) {
379934
+ this.#service = service;
379935
+ this.#logger = childLogger("AccountOpener", service.sdk.logger);
379936
+ this.#anvil = createAnvilClient({
379937
+ chain: service.sdk.provider.chain,
379938
+ transport: service.sdk.provider.transport
379939
+ });
379940
+ this.#faucet = options.faucet ?? service.sdk.addressProvider.getAddress("FAUCET");
379941
+ }
379942
+ get borrower() {
379943
+ if (!this.#borrower) {
379944
+ throw new Error("borrower can be used only after openCreditAccounts");
379945
+ }
379946
+ return this.#borrower.address;
379947
+ }
379948
+ /**
379949
+ * Tries to open account with underlying only in each CM
379950
+ */
379951
+ async openCreditAccounts(targets) {
379952
+ const borrower = await this.#prepareBorrower(targets);
379953
+ for (const target of targets) {
379954
+ try {
379955
+ await this.#openAccount(target);
379956
+ } catch (e) {
379957
+ this.#logger?.error(e);
379958
+ }
379959
+ }
379960
+ const accounts = await this.#service.getCreditAccounts({
379961
+ owner: borrower.address
379962
+ });
379963
+ this.#logger?.info(`opened ${accounts.length} accounts`);
379964
+ }
379965
+ async #openAccount({
379966
+ creditManager,
379967
+ collateral,
379968
+ leverage = 4,
379969
+ slippage = 50
379970
+ }) {
379971
+ const borrower = await this.#getBorrower();
379972
+ const cm = this.sdk.marketRegister.findCreditManager(creditManager);
379973
+ const symbol = this.sdk.tokensMeta.symbol(collateral);
379974
+ const logger2 = this.#logger?.child?.({
379975
+ creditManager: cm.name,
379976
+ collateral: symbol
379977
+ });
379978
+ const { minDebt, underlying } = cm.creditFacade;
379979
+ const expectedBalances = [];
379980
+ const leftoverBalances = [];
379981
+ for (const t of Object.keys(cm.collateralTokens)) {
379982
+ const token = t;
379983
+ expectedBalances.push({
379984
+ token,
379985
+ balance: token === underlying ? BigInt(leverage) * minDebt : 1n
379986
+ });
379987
+ leftoverBalances.push({
379988
+ token,
379989
+ balance: 1n
379990
+ });
379991
+ }
379992
+ logger2?.debug("looking for open strategy");
379993
+ const strategy = await this.sdk.router.findOpenStrategyPath({
379994
+ creditManager: cm.creditManager,
379995
+ expectedBalances,
379996
+ leftoverBalances,
379997
+ slippage,
379998
+ target: collateral
379999
+ });
380000
+ logger2?.debug("found open strategy");
380001
+ const { tx, calls } = await this.#service.openCA({
380002
+ creditManager: cm.creditManager.address,
380003
+ averageQuota: [],
380004
+ minQuota: [],
380005
+ collateral: [{ token: underlying, balance: minDebt }],
380006
+ debt: minDebt * BigInt(leverage - 1),
380007
+ calls: strategy.calls,
380008
+ ethAmount: 0n,
380009
+ permits: {},
380010
+ to: borrower.address,
380011
+ referralCode: 0n
380012
+ });
380013
+ for (let i = 0; i < calls.length; i++) {
380014
+ const call2 = calls[i];
380015
+ logger2?.debug(
380016
+ `call #${i + 1}: ${this.sdk.parseFunctionData(call2.target, call2.callData)}`
380017
+ );
380018
+ }
380019
+ logger2?.debug("prepared open account transaction");
380020
+ const hash2 = await sendRawTx(this.#anvil, {
380021
+ tx,
380022
+ account: borrower
380023
+ });
380024
+ logger2?.debug(`send transaction ${hash2}`);
380025
+ const receipt = await this.#anvil.waitForTransactionReceipt({ hash: hash2 });
380026
+ if (receipt.status === "reverted") {
380027
+ throw new Error(`open credit account tx ${hash2} reverted`);
380028
+ }
380029
+ logger2?.debug(
380030
+ `opened credit account in ${cm.name} with collateral ${symbol}`
380031
+ );
380032
+ return this.getOpenedAccounts();
380033
+ }
380034
+ async getOpenedAccounts() {
380035
+ return await this.#service.getCreditAccounts({
380036
+ owner: this.borrower
380037
+ });
380038
+ }
380039
+ /**
380040
+ * Creates borrower wallet,
380041
+ * Sets ETH balance,
380042
+ * Gets tokens from faucet,
380043
+ * Approves collateral tokens to credit manager,
380044
+ * Gets DEGEN_NFT,
380045
+ */
380046
+ async #prepareBorrower(targets) {
380047
+ const borrower = await this.#getBorrower();
380048
+ let claimUSD = 0n;
380049
+ let degenNFTS = {};
380050
+ for (const target of targets) {
380051
+ const cm = this.sdk.marketRegister.findCreditManager(
380052
+ target.creditManager
380053
+ );
380054
+ const market = this.sdk.marketRegister.findByCreditManager(
380055
+ target.creditManager
380056
+ );
380057
+ const { minDebt, degenNFT } = cm.creditFacade;
380058
+ claimUSD += market.priceOracle.convertToUSD(cm.underlying, minDebt);
380059
+ if (isAddress(degenNFT) && degenNFT !== import_sdk_gov3.ADDRESS_0X0) {
380060
+ degenNFTS[degenNFT] = (degenNFTS[degenNFT] ?? 0) + 1;
380061
+ }
380062
+ for (const t of Object.keys(cm.collateralTokens)) {
380063
+ await this.#approve(t, cm);
380064
+ }
380065
+ }
380066
+ claimUSD = claimUSD * 11n / 10n;
380067
+ this.#logger?.debug(`claiming ${(0, import_sdk_gov3.formatBN)(claimUSD, 8)} USD from faucet`);
380068
+ let hash2 = await this.#anvil.writeContract({
380069
+ account: borrower,
380070
+ address: this.#faucet,
380071
+ abi: [
380072
+ {
380073
+ type: "function",
380074
+ inputs: [
380075
+ { name: "amountUSD", internalType: "uint256", type: "uint256" }
380076
+ ],
380077
+ name: "claim",
380078
+ outputs: [],
380079
+ stateMutability: "nonpayable"
380080
+ }
380081
+ ],
380082
+ functionName: "claim",
380083
+ args: [claimUSD],
380084
+ chain: this.#anvil.chain
380085
+ });
380086
+ let receipt = await this.#anvil.waitForTransactionReceipt({
380087
+ hash: hash2
380088
+ });
380089
+ if (receipt.status === "reverted") {
380090
+ throw new Error(
380091
+ `borrower ${borrower.address} failed to claimed equivalent of ${(0, import_sdk_gov3.formatBN)(claimUSD, 8)} USD from faucet, tx: ${hash2}`
380092
+ );
380093
+ }
380094
+ this.#logger?.debug(
380095
+ `borrower ${borrower.address} claimed equivalent of ${(0, import_sdk_gov3.formatBN)(claimUSD, 8)} USD from faucet, tx: ${hash2}`
380096
+ );
380097
+ for (const [degenNFT, amount] of Object.entries(degenNFTS)) {
380098
+ await this.#mintDegenNft(degenNFT, borrower.address, amount);
380099
+ }
380100
+ this.#logger?.debug("prepared borrower");
380101
+ return borrower;
380102
+ }
380103
+ async #approve(token, cm) {
380104
+ const borrower = await this.#getBorrower();
380105
+ try {
380106
+ const hash2 = await this.#anvil.writeContract({
380107
+ account: borrower,
380108
+ address: token,
380109
+ abi: ierc20Abi,
380110
+ functionName: "approve",
380111
+ args: [cm.creditManager.address, MAX_UINT256],
380112
+ chain: this.#anvil.chain
380113
+ });
380114
+ const receipt = await this.#anvil.waitForTransactionReceipt({
380115
+ hash: hash2
380116
+ });
380117
+ if (receipt.status === "reverted") {
380118
+ this.#logger?.error(
380119
+ `failed to allowed credit manager ${cm.creditManager.name} to spend ${token}, tx reverted: ${hash2}`
380120
+ );
380121
+ } else {
380122
+ this.#logger?.debug(
380123
+ `allowed credit manager ${cm.creditManager.name} to spend ${token}, tx: ${hash2}`
380124
+ );
380125
+ }
380126
+ } catch (e) {
380127
+ this.#logger?.error(
380128
+ `failed to allowed credit manager ${cm.creditManager.name} to spend ${token}: ${e}`
380129
+ );
380130
+ }
380131
+ }
380132
+ async #mintDegenNft(degenNFT, to, amount) {
380133
+ if (amount <= 0) {
380134
+ return;
380135
+ }
380136
+ let minter;
380137
+ try {
380138
+ minter = await this.#anvil.readContract({
380139
+ address: degenNFT,
380140
+ abi: iDegenNftv2Abi,
380141
+ functionName: "minter"
380142
+ });
380143
+ } catch (e) {
380144
+ this.#logger?.error(`failed to get minter of degenNFT ${degenNFT}: ${e}`);
380145
+ return;
380146
+ }
380147
+ try {
380148
+ await this.#anvil.impersonateAccount({ address: minter });
380149
+ await this.#anvil.setBalance({
380150
+ address: minter,
380151
+ value: parseEther("100")
380152
+ });
380153
+ const hash2 = await this.#anvil.writeContract({
380154
+ account: minter,
380155
+ address: degenNFT,
380156
+ abi: iDegenNftv2Abi,
380157
+ functionName: "mint",
380158
+ args: [to, BigInt(amount)],
380159
+ chain: this.#anvil.chain
380160
+ });
380161
+ const receipt = await this.#anvil.waitForTransactionReceipt({
380162
+ hash: hash2
380163
+ });
380164
+ if (receipt.status === "reverted") {
380165
+ this.#logger?.error(
380166
+ `failed to mint ${amount} degenNFT ${degenNFT} to borrower ${to}, tx reverted: ${hash2}`
380167
+ );
380168
+ }
380169
+ this.#logger?.debug(
380170
+ `minted ${amount} degenNFT ${degenNFT} to borrower ${to}, tx: ${hash2}`
380171
+ );
380172
+ } catch (e) {
380173
+ this.#logger?.error(
380174
+ `failed to mint ${amount} degenNFT ${degenNFT} to borrower ${to}: ${e}`
380175
+ );
380176
+ } finally {
380177
+ await this.#anvil.stopImpersonatingAccount({ address: minter });
380178
+ }
380179
+ }
380180
+ async #getBorrower() {
380181
+ if (!this.#borrower) {
380182
+ this.#borrower = privateKeyToAccount(generatePrivateKey());
380183
+ await this.#anvil.setBalance({
380184
+ address: this.#borrower.address,
380185
+ value: parseEther("100")
380186
+ });
380187
+ this.#logger?.info(`created borrower ${this.#borrower.address}`);
380188
+ }
380189
+ return this.#borrower;
380190
+ }
380191
+ get sdk() {
380192
+ return this.#service.sdk;
380193
+ }
380194
+ };
378201
380195
  var iaclAbi2 = [
378202
380196
  {
378203
380197
  type: "function",
@@ -383319,7 +385313,7 @@ var DegenNFTParser = class extends AbstractParser {
383319
385313
  constructor(contractType) {
383320
385314
  super(contractType, "constructor(address addressProvider, string name, string symbol)");
383321
385315
  this._abi = [
383322
- ...iDegenNftv2Abi,
385316
+ ...iDegenNftv2Abi2,
383323
385317
  ...parseAbi(["function addCreditFacade(address creditFacade) external"])
383324
385318
  ];
383325
385319
  }
@@ -385789,21 +387783,137 @@ function audit() {
385789
387783
  });
385790
387784
  }
385791
387785
 
387786
+ // src/commands/open-accounts.ts
387787
+ import { readFile as readFile7, writeFile as writeFile4 } from "node:fs/promises";
387788
+ import path8 from "node:path";
387789
+ function openAccounts() {
387790
+ return newCommand().name("open-accounts").description("Script to open accounts in v3.1").addOption(
387791
+ new Option(
387792
+ "--address-provider <address>",
387793
+ "new address provider address"
387794
+ ).env("ADDRESS_PROVIDER")
387795
+ ).addOption(
387796
+ new Option("--shared-dir <dir>", "dir to put output files").env(
387797
+ "SHARED_DIR"
387798
+ )
387799
+ ).addOption(
387800
+ new Option("--anvil-url <url>", "anvil rpc url").env("ANVIL_URL")
387801
+ ).action(async (opts) => {
387802
+ log_default.info("starting sdk v3.1 example");
387803
+ let {
387804
+ addressProvider,
387805
+ addressProviderJson,
387806
+ anvilUrl = "http://127.0.0.1:8545",
387807
+ sharedDir = "."
387808
+ } = opts;
387809
+ if (!addressProvider) {
387810
+ if (!addressProviderJson) {
387811
+ throw new Error("addressProvider is not specified");
387812
+ }
387813
+ log_default.debug(`reading address provider json ${addressProviderJson}`);
387814
+ const apFile = await readFile7(addressProviderJson, "utf-8").then(
387815
+ JSON.parse
387816
+ );
387817
+ addressProvider = apFile.addressProvider;
387818
+ }
387819
+ if (!addressProvider) {
387820
+ throw new Error("addressProvider is not specified");
387821
+ }
387822
+ log_default.info(`using address provider ${addressProvider}`);
387823
+ const sdk = await GearboxSDK.attach({
387824
+ rpcURLs: [anvilUrl],
387825
+ timeout: 48e4,
387826
+ addressProvider,
387827
+ logger: log_default,
387828
+ ignoreUpdateablePrices: true,
387829
+ riskCurators: []
387830
+ // load without risk curator
387831
+ });
387832
+ const puTx = await sdk.priceFeeds.getUpdatePriceFeedsTx(
387833
+ GEARBOX_RISK_CURATORS[sdk.provider.networkType]
387834
+ );
387835
+ const updater = createWalletClient({
387836
+ account: privateKeyToAccount(
387837
+ "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
387838
+ // well-known anvil private key
387839
+ ),
387840
+ transport: http(anvilUrl)
387841
+ });
387842
+ const publicClient = createPublicClient({
387843
+ transport: http(anvilUrl)
387844
+ });
387845
+ const hash2 = await sendRawTx(updater, { tx: puTx });
387846
+ await publicClient.waitForTransactionReceipt({ hash: hash2 });
387847
+ await sdk.marketRegister.loadMarkets(
387848
+ GEARBOX_RISK_CURATORS[sdk.provider.networkType],
387849
+ true
387850
+ );
387851
+ log_default.info("attached sdk");
387852
+ const faucetAddr = await sdk.provider.publicClient.readContract({
387853
+ address: ADDRESS_PROVIDER[sdk.provider.networkType],
387854
+ abi: iAddressProviderV3_1Abi,
387855
+ functionName: "getAddressOrRevert",
387856
+ args: [stringToHex("FAUCET", { size: 32 }), 0n]
387857
+ });
387858
+ log_default.debug(`faucet address: ${faucetAddr}`);
387859
+ const accService = new CreditAccountsService(sdk);
387860
+ const accountOpener = new AccountOpener(accService, {
387861
+ faucet: faucetAddr
387862
+ });
387863
+ try {
387864
+ const opened = await accountOpener.openCreditAccounts([
387865
+ {
387866
+ creditManager: "0x50ba483272484fc5eebe8676dc87d814a11faef6",
387867
+ // restaking weth
387868
+ collateral: "0xbf5495Efe5DB9ce00f80364C8B423567e58d2110"
387869
+ // ezETH
387870
+ },
387871
+ {
387872
+ creditManager: "0x50ba483272484fc5eebe8676dc87d814a11faef6",
387873
+ // restaking weth
387874
+ collateral: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
387875
+ // WETH
387876
+ },
387877
+ {
387878
+ creditManager: "0x3EB95430FdB99439A86d3c6D7D01C3c561393556",
387879
+ // [Trade USDC Tier 1]
387880
+ collateral: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"
387881
+ // wbtc
387882
+ },
387883
+ {
387884
+ creditManager: "0x3EB95430FdB99439A86d3c6D7D01C3c561393556",
387885
+ // [Trade USDC Tier 1]
387886
+ collateral: "0x9D39A5DE30e57443BfF2A8307A4256c8797A3497"
387887
+ // sUSDe
387888
+ }
387889
+ ]);
387890
+ await writeFile4(
387891
+ path8.resolve(sharedDir, "opened-accounts.json"),
387892
+ json_stringify(opened),
387893
+ "utf-8"
387894
+ );
387895
+ } catch (e) {
387896
+ log_default.error(`failed to open accounts: ${e}`);
387897
+ }
387898
+ log_default.info("done");
387899
+ });
387900
+ }
387901
+
385792
387902
  // src/commands/parse.ts
385793
- import { writeFile as writeFile4 } from "node:fs/promises";
387903
+ import { writeFile as writeFile5 } from "node:fs/promises";
385794
387904
 
385795
387905
  // src/renderer/html/HtmlRenderer.tsx
385796
387906
  var import_react = __toESM(require_react(), 1);
385797
387907
  var import_server = __toESM(require_server_node(), 1);
385798
387908
  import { writeFileSync } from "node:fs";
385799
- import path8 from "node:path";
387909
+ import path9 from "node:path";
385800
387910
  var HtmlRenderer = class {
385801
387911
  #htmlFile;
385802
387912
  constructor(opts) {
385803
387913
  if (!opts.htmlFile) {
385804
387914
  throw new Error(`output HTML file not specified`);
385805
387915
  }
385806
- this.#htmlFile = path8.resolve(opts.htmlFile);
387916
+ this.#htmlFile = path9.resolve(opts.htmlFile);
385807
387917
  }
385808
387918
  render(updates) {
385809
387919
  const html = (0, import_server.renderToString)(/* @__PURE__ */ import_react.default.createElement("div", null));
@@ -385836,7 +387946,7 @@ function getRenderer(opts) {
385836
387946
  var package_default = {
385837
387947
  name: "@gearbox-protocol/deploy-tools",
385838
387948
  description: "Gearbox deploy tools",
385839
- version: "5.1.3",
387949
+ version: "5.1.4",
385840
387950
  homepage: "https://gearbox.fi",
385841
387951
  keywords: [
385842
387952
  "gearbox"
@@ -385879,7 +387989,7 @@ var package_default = {
385879
387989
  "@gearbox-protocol/deploy-tools-node": "0.0.0",
385880
387990
  "@gearbox-protocol/deploy-tools-shared": "0.0.0",
385881
387991
  "@gearbox-protocol/deploy-tools-types": "0.0.0",
385882
- "@gearbox-protocol/sdk": "^3.0.0-vfour.126",
387992
+ "@gearbox-protocol/sdk": "^3.0.0-vfour.128",
385883
387993
  "@gearbox-protocol/sdk-gov": "^2.33.1",
385884
387994
  "@types/lodash-es": "^4.17.12",
385885
387995
  "@types/node": "^22.10.2",
@@ -385958,7 +388068,7 @@ function parse() {
385958
388068
  const parser = new UpdateParser(opts, version_default);
385959
388069
  const result = await parser.parse(opts);
385960
388070
  if (opts.outFile) {
385961
- await writeFile4(opts.outFile, json_stringify(result), "utf-8");
388071
+ await writeFile5(opts.outFile, json_stringify(result), "utf-8");
385962
388072
  }
385963
388073
  const renderer = getRenderer(opts);
385964
388074
  return renderer?.render(result);
@@ -385979,8 +388089,8 @@ function printSafeTx() {
385979
388089
  }
385980
388090
 
385981
388091
  // src/commands/sdk-example.ts
385982
- import { readFile as readFile7, writeFile as writeFile5 } from "node:fs/promises";
385983
- import path9 from "node:path";
388092
+ import { readFile as readFile8, writeFile as writeFile6 } from "node:fs/promises";
388093
+ import path10 from "node:path";
385984
388094
  function sdkExample() {
385985
388095
  return newCommand().name("sdk-example").description("SDK example for v3.1").addOption(
385986
388096
  new Option(
@@ -386006,7 +388116,7 @@ function sdkExample() {
386006
388116
  throw new Error("addressProvider is not specified");
386007
388117
  }
386008
388118
  log_default.debug(`reading address provider json ${addressProviderJson}`);
386009
- const apFile = await readFile7(addressProviderJson, "utf-8").then(
388119
+ const apFile = await readFile8(addressProviderJson, "utf-8").then(
386010
388120
  JSON.parse
386011
388121
  );
386012
388122
  addressProvider = apFile.addressProvider;
@@ -386044,8 +388154,8 @@ function sdkExample() {
386044
388154
  true
386045
388155
  );
386046
388156
  log_default.info("attached sdk");
386047
- await writeFile5(
386048
- path9.resolve(sharedDir, "deploy-state", "stateAfter.human.json"),
388157
+ await writeFile6(
388158
+ path10.resolve(sharedDir, "deploy-state", "stateAfter.human.json"),
386049
388159
  json_stringify(sdk.stateHuman()),
386050
388160
  "utf-8"
386051
388161
  );
@@ -386054,7 +388164,7 @@ function sdkExample() {
386054
388164
  }
386055
388165
 
386056
388166
  // src/commands/verify-etherscan.ts
386057
- import { readFile as readFile8 } from "node:fs/promises";
388167
+ import { readFile as readFile9 } from "node:fs/promises";
386058
388168
  function verifyEtherscan() {
386059
388169
  return newCommand().name("verify-etherscan").description(
386060
388170
  "performs bulk verification of gearbox contracts using etherscan"
@@ -386071,7 +388181,7 @@ function verifyEtherscan() {
386071
388181
  }
386072
388182
  let addresses = opts.addresses ?? [];
386073
388183
  if (addresses.length === 0 && opts.addressesFile) {
386074
- const content = await readFile8(opts.addressesFile, "utf-8");
388184
+ const content = await readFile9(opts.addressesFile, "utf-8");
386075
388185
  addresses = Object.keys(json_parse(content));
386076
388186
  }
386077
388187
  if (!addresses.length) {
@@ -386103,6 +388213,7 @@ program2.addCommand(printSafeTx());
386103
388213
  program2.addCommand(verifyEtherscan());
386104
388214
  program2.addCommand(zeroLT());
386105
388215
  program2.addCommand(sdkExample());
388216
+ program2.addCommand(openAccounts());
386106
388217
  program2.parse();
386107
388218
  /*! Bundled license information:
386108
388219