@gearbox-protocol/deploy-tools 5.11.15 → 5.11.17

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 +19 -15
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -399348,15 +399348,16 @@ import path4 from "node:path";
399348
399348
 
399349
399349
  // ../../packages/shared/dist/etherscan.js
399350
399350
  function etherscanApiUrl(chainId) {
399351
- switch (chainId) {
399352
- case 1:
399353
- return `https://api.etherscan.io`;
399354
- case 10:
399355
- return `https://api-optimistic.etherscan.io`;
399356
- case 42161:
399357
- return `https://api.arbiscan.io`;
399358
- }
399359
- throw new Error(`etherscan api for ${chainId} not configured`);
399351
+ for (const chain of Object.values(chains)) {
399352
+ if (chain.id === chainId) {
399353
+ const url = chain.blockExplorers?.default?.apiUrl;
399354
+ if (url) {
399355
+ return url;
399356
+ }
399357
+ throw new Error(`etherscan api for ${chainId} not configured`);
399358
+ }
399359
+ }
399360
+ throw new Error(`unsupported chain id: ${chainId}`);
399360
399361
  }
399361
399362
 
399362
399363
  // ../../node_modules/zod/lib/index.mjs
@@ -407676,7 +407677,6 @@ var NetworkMismatchError = class extends Error {
407676
407677
  };
407677
407678
  var ProviderBase = class {
407678
407679
  logger = log_default;
407679
- // #service?: SafeApiKit;
407680
407680
  #service;
407681
407681
  #initialized = false;
407682
407682
  #client;
@@ -407699,9 +407699,13 @@ var ProviderBase = class {
407699
407699
  });
407700
407700
  this.#network = await detectNetwork(this.#client);
407701
407701
  this.#chainId = chains[this.#network].id;
407702
- this.#service = new import_api_kit.default.default({
407703
- chainId: BigInt(this.#chainId)
407704
- });
407702
+ try {
407703
+ this.#service = new import_api_kit.default.default({
407704
+ chainId: BigInt(this.#chainId)
407705
+ });
407706
+ } catch (e) {
407707
+ this.logger.error(`failed to instantiate SafeApiKit: ${e}`);
407708
+ }
407705
407709
  if (this.#options.addressProviderJson) {
407706
407710
  try {
407707
407711
  this.logger.debug(`reading address provider json ${this.#options.addressProviderJson}`);
@@ -407919,7 +407923,7 @@ var EtherscanVerifier = class extends ProviderBase {
407919
407923
  await writeFile3(cacheFile, json_stringify(result));
407920
407924
  }
407921
407925
  async #fetch(address) {
407922
- const url = `${this.etherscanBase}/api?module=contract&action=getsourcecode&address=${address}&apikey=${this.etherscanApiKey}`;
407926
+ const url = `${this.etherscanBase}?module=contract&action=getsourcecode&address=${address}&apikey=${this.etherscanApiKey}`;
407923
407927
  const _fetch = async () => {
407924
407928
  const resp = await fetch(url);
407925
407929
  const data = await resp.json();
@@ -414217,7 +414221,7 @@ function getRenderer(opts) {
414217
414221
  var package_default = {
414218
414222
  name: "@gearbox-protocol/deploy-tools",
414219
414223
  description: "Gearbox deploy tools",
414220
- version: "5.11.15",
414224
+ version: "5.11.17",
414221
414225
  homepage: "https://gearbox.fi",
414222
414226
  keywords: [
414223
414227
  "gearbox"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/deploy-tools",
3
3
  "description": "Gearbox deploy tools",
4
- "version": "5.11.15",
4
+ "version": "5.11.17",
5
5
  "homepage": "https://gearbox.fi",
6
6
  "keywords": [
7
7
  "gearbox"