@bgd-labs/toolbox 0.0.51 → 0.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/node.js CHANGED
@@ -19837,10 +19837,6 @@ var etherscanExplorers = {
19837
19837
  api: "https://api.etherscan.io/v2/api",
19838
19838
  explorer: "https://testnet.bttcscan.com/"
19839
19839
  },
19840
- 1101: {
19841
- api: "https://api.etherscan.io/v2/api",
19842
- explorer: "https://zkevm.polygonscan.com/"
19843
- },
19844
19840
  1284: {
19845
19841
  api: "https://api.etherscan.io/v2/api",
19846
19842
  explorer: "https://moonbeam.moonscan.io/"
@@ -19873,10 +19869,6 @@ var etherscanExplorers = {
19873
19869
  api: "https://api.etherscan.io/v2/api",
19874
19870
  explorer: "https://sepolia.swellchainscan.io/"
19875
19871
  },
19876
- 2442: {
19877
- api: "https://api.etherscan.io/v2/api",
19878
- explorer: "https://cardona-zkevm.polygonscan.com/"
19879
- },
19880
19872
  2522: {
19881
19873
  api: "https://api.etherscan.io/v2/api",
19882
19874
  explorer: "https://holesky.fraxscan.com/"
@@ -19953,10 +19945,6 @@ var etherscanExplorers = {
19953
19945
  api: "https://api.etherscan.io/v2/api",
19954
19946
  explorer: "https://testnet.memecorescan.io/"
19955
19947
  },
19956
- 44787: {
19957
- api: "https://api.etherscan.io/v2/api",
19958
- explorer: "https://alfajores.celoscan.io/"
19959
- },
19960
19948
  50104: {
19961
19949
  api: "https://api.etherscan.io/v2/api",
19962
19950
  explorer: "https://sophscan.xyz/"
@@ -19993,9 +19981,9 @@ var etherscanExplorers = {
19993
19981
  api: "https://api.etherscan.io/v2/api",
19994
19982
  explorer: "https://taikoscan.io/"
19995
19983
  },
19996
- 167009: {
19984
+ 167012: {
19997
19985
  api: "https://api.etherscan.io/v2/api",
19998
- explorer: "https://hekla.taikoscan.io/"
19986
+ explorer: "https://hoodi.taikoscan.io/"
19999
19987
  },
20000
19988
  421614: {
20001
19989
  api: "https://api.etherscan.io/v2/api",
@@ -20013,10 +20001,18 @@ var etherscanExplorers = {
20013
20001
  api: "https://api.etherscan.io/v2/api",
20014
20002
  explorer: "https://hoodi.etherscan.io/"
20015
20003
  },
20004
+ 737373: {
20005
+ api: "https://api.etherscan.io/v2/api",
20006
+ explorer: "https://bokuto.katanascan.com/"
20007
+ },
20016
20008
  747474: {
20017
20009
  api: "https://api.etherscan.io/v2/api",
20018
20010
  explorer: "https://katanascan.com/"
20019
20011
  },
20012
+ 11142220: {
20013
+ api: "https://api.etherscan.io/v2/api",
20014
+ explorer: "https://sepolia.celoscan.io/"
20015
+ },
20020
20016
  11155111: {
20021
20017
  api: "https://api.etherscan.io/v2/api",
20022
20018
  explorer: "https://sepolia.etherscan.io/"
@@ -20201,10 +20197,6 @@ var routescanExplorers = {
20201
20197
  api: "https://api.routescan.io/v2/network/testnet/evm/2233/etherscan",
20202
20198
  explorer: "2233.routescan.io"
20203
20199
  },
20204
- 2368: {
20205
- api: "https://api.routescan.io/v2/network/testnet/evm/2368/etherscan",
20206
- explorer: "2368.routescan.io"
20207
- },
20208
20200
  2522: {
20209
20201
  api: "https://api.routescan.io/v2/network/testnet/evm/2522/etherscan",
20210
20202
  explorer: "2522.routescan.io"
@@ -20305,10 +20297,6 @@ var routescanExplorers = {
20305
20297
  api: "https://api.routescan.io/v2/network/testnet/evm/6911/etherscan",
20306
20298
  explorer: "6911.routescan.io"
20307
20299
  },
20308
- 7171: {
20309
- api: "https://api.routescan.io/v2/network/mainnet/evm/7171/etherscan",
20310
- explorer: "7171.routescan.io"
20311
- },
20312
20300
  7894: {
20313
20301
  api: "https://api.routescan.io/v2/network/testnet/evm/7894/etherscan",
20314
20302
  explorer: "7894.routescan.io"
@@ -20425,10 +20413,6 @@ var routescanExplorers = {
20425
20413
  api: "https://api.routescan.io/v2/network/mainnet/evm/34443/etherscan",
20426
20414
  explorer: "34443.routescan.io"
20427
20415
  },
20428
- 42069: {
20429
- api: "https://api.routescan.io/v2/network/mainnet/evm/42069/etherscan",
20430
- explorer: "42069.routescan.io"
20431
- },
20432
20416
  42161: {
20433
20417
  api: "https://api.routescan.io/v2/network/mainnet/evm/42161/etherscan",
20434
20418
  explorer: "42161.routescan.io"
@@ -20710,6 +20694,9 @@ function getExplorer(chainId) {
20710
20694
  throw new Error(`No explorer found for chainId: ${chainId}`);
20711
20695
  }
20712
20696
  async function getSourceCode(params) {
20697
+ if (params.chainId === ChainId.xLayer) {
20698
+ return getXLayerSourceCode(params);
20699
+ }
20713
20700
  const payload = {
20714
20701
  chainid: String(params.chainId),
20715
20702
  address: params.address,
@@ -20722,7 +20709,7 @@ async function getSourceCode(params) {
20722
20709
  console.log(url);
20723
20710
  const request = await fetch(url);
20724
20711
  const { status, message, result } = await request.json();
20725
- if (status != "1") {
20712
+ if (status !== "1") {
20726
20713
  throw new Error(result);
20727
20714
  }
20728
20715
  return result[0];
@@ -20751,6 +20738,33 @@ function parseBlockscoutStyleSourceCode(sourceCode) {
20751
20738
  };
20752
20739
  return result;
20753
20740
  }
20741
+ async function getXLayerSourceCode(params) {
20742
+ const payload = {
20743
+ chainShortName: "xlayer",
20744
+ contractAddress: params.address
20745
+ };
20746
+ const formattedPayload = new URLSearchParams(payload).toString();
20747
+ const apiUrl = "https://www.oklink.com/api/v5/explorer/contract/verify-contract-info";
20748
+ const url = `${apiUrl}?${formattedPayload}`;
20749
+ const request = await fetch(url);
20750
+ const { data, message } = await request.json();
20751
+ if (data.length === 0) {
20752
+ throw new Error(message);
20753
+ }
20754
+ return {
20755
+ SourceCode: data[0].sourceCode,
20756
+ ABI: data[0].contractAbi,
20757
+ CompilerVersion: data[0].compilerVersion,
20758
+ ContractName: data[0].contractName,
20759
+ EVMVersion: data[0].evmVersion,
20760
+ Implementation: data[0].implementation,
20761
+ Library: data[0].libraryInfo,
20762
+ LicenseType: data[0].licenseType,
20763
+ OptimizationUsed: data[0].optimization,
20764
+ Proxy: data[0].proxy,
20765
+ Runs: data[0].optimizationRuns
20766
+ };
20767
+ }
20754
20768
 
20755
20769
  // src/ecosystem/tenderly.ts
20756
20770
  var import_viem5 = require("viem");
@@ -23170,8 +23184,8 @@ var blockscoutExplorers = {
23170
23184
  explorer: "https://testnet3.cypherscan.ai/"
23171
23185
  },
23172
23186
  10200: {
23173
- api: "https://gnosis.blockscout.com/api",
23174
- explorer: "https://gnosis.blockscout.com/"
23187
+ api: "https://gnosis-chiado.blockscout.com/api",
23188
+ explorer: "https://gnosis-chiado.blockscout.com/"
23175
23189
  },
23176
23190
  10245: {
23177
23191
  api: "https://capxscan.com/api",