@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/index.d.mts +26 -30
- package/dist/index.d.ts +26 -30
- package/dist/index.js +43 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -29
- package/dist/index.mjs.map +1 -1
- package/dist/node.js +43 -29
- package/dist/node.js.map +1 -1
- package/dist/node.mjs +43 -29
- package/dist/node.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -19669,10 +19669,6 @@ var etherscanExplorers = {
|
|
|
19669
19669
|
api: "https://api.etherscan.io/v2/api",
|
|
19670
19670
|
explorer: "https://testnet.bttcscan.com/"
|
|
19671
19671
|
},
|
|
19672
|
-
1101: {
|
|
19673
|
-
api: "https://api.etherscan.io/v2/api",
|
|
19674
|
-
explorer: "https://zkevm.polygonscan.com/"
|
|
19675
|
-
},
|
|
19676
19672
|
1284: {
|
|
19677
19673
|
api: "https://api.etherscan.io/v2/api",
|
|
19678
19674
|
explorer: "https://moonbeam.moonscan.io/"
|
|
@@ -19705,10 +19701,6 @@ var etherscanExplorers = {
|
|
|
19705
19701
|
api: "https://api.etherscan.io/v2/api",
|
|
19706
19702
|
explorer: "https://sepolia.swellchainscan.io/"
|
|
19707
19703
|
},
|
|
19708
|
-
2442: {
|
|
19709
|
-
api: "https://api.etherscan.io/v2/api",
|
|
19710
|
-
explorer: "https://cardona-zkevm.polygonscan.com/"
|
|
19711
|
-
},
|
|
19712
19704
|
2522: {
|
|
19713
19705
|
api: "https://api.etherscan.io/v2/api",
|
|
19714
19706
|
explorer: "https://holesky.fraxscan.com/"
|
|
@@ -19785,10 +19777,6 @@ var etherscanExplorers = {
|
|
|
19785
19777
|
api: "https://api.etherscan.io/v2/api",
|
|
19786
19778
|
explorer: "https://testnet.memecorescan.io/"
|
|
19787
19779
|
},
|
|
19788
|
-
44787: {
|
|
19789
|
-
api: "https://api.etherscan.io/v2/api",
|
|
19790
|
-
explorer: "https://alfajores.celoscan.io/"
|
|
19791
|
-
},
|
|
19792
19780
|
50104: {
|
|
19793
19781
|
api: "https://api.etherscan.io/v2/api",
|
|
19794
19782
|
explorer: "https://sophscan.xyz/"
|
|
@@ -19825,9 +19813,9 @@ var etherscanExplorers = {
|
|
|
19825
19813
|
api: "https://api.etherscan.io/v2/api",
|
|
19826
19814
|
explorer: "https://taikoscan.io/"
|
|
19827
19815
|
},
|
|
19828
|
-
|
|
19816
|
+
167012: {
|
|
19829
19817
|
api: "https://api.etherscan.io/v2/api",
|
|
19830
|
-
explorer: "https://
|
|
19818
|
+
explorer: "https://hoodi.taikoscan.io/"
|
|
19831
19819
|
},
|
|
19832
19820
|
421614: {
|
|
19833
19821
|
api: "https://api.etherscan.io/v2/api",
|
|
@@ -19845,10 +19833,18 @@ var etherscanExplorers = {
|
|
|
19845
19833
|
api: "https://api.etherscan.io/v2/api",
|
|
19846
19834
|
explorer: "https://hoodi.etherscan.io/"
|
|
19847
19835
|
},
|
|
19836
|
+
737373: {
|
|
19837
|
+
api: "https://api.etherscan.io/v2/api",
|
|
19838
|
+
explorer: "https://bokuto.katanascan.com/"
|
|
19839
|
+
},
|
|
19848
19840
|
747474: {
|
|
19849
19841
|
api: "https://api.etherscan.io/v2/api",
|
|
19850
19842
|
explorer: "https://katanascan.com/"
|
|
19851
19843
|
},
|
|
19844
|
+
11142220: {
|
|
19845
|
+
api: "https://api.etherscan.io/v2/api",
|
|
19846
|
+
explorer: "https://sepolia.celoscan.io/"
|
|
19847
|
+
},
|
|
19852
19848
|
11155111: {
|
|
19853
19849
|
api: "https://api.etherscan.io/v2/api",
|
|
19854
19850
|
explorer: "https://sepolia.etherscan.io/"
|
|
@@ -20033,10 +20029,6 @@ var routescanExplorers = {
|
|
|
20033
20029
|
api: "https://api.routescan.io/v2/network/testnet/evm/2233/etherscan",
|
|
20034
20030
|
explorer: "2233.routescan.io"
|
|
20035
20031
|
},
|
|
20036
|
-
2368: {
|
|
20037
|
-
api: "https://api.routescan.io/v2/network/testnet/evm/2368/etherscan",
|
|
20038
|
-
explorer: "2368.routescan.io"
|
|
20039
|
-
},
|
|
20040
20032
|
2522: {
|
|
20041
20033
|
api: "https://api.routescan.io/v2/network/testnet/evm/2522/etherscan",
|
|
20042
20034
|
explorer: "2522.routescan.io"
|
|
@@ -20137,10 +20129,6 @@ var routescanExplorers = {
|
|
|
20137
20129
|
api: "https://api.routescan.io/v2/network/testnet/evm/6911/etherscan",
|
|
20138
20130
|
explorer: "6911.routescan.io"
|
|
20139
20131
|
},
|
|
20140
|
-
7171: {
|
|
20141
|
-
api: "https://api.routescan.io/v2/network/mainnet/evm/7171/etherscan",
|
|
20142
|
-
explorer: "7171.routescan.io"
|
|
20143
|
-
},
|
|
20144
20132
|
7894: {
|
|
20145
20133
|
api: "https://api.routescan.io/v2/network/testnet/evm/7894/etherscan",
|
|
20146
20134
|
explorer: "7894.routescan.io"
|
|
@@ -20257,10 +20245,6 @@ var routescanExplorers = {
|
|
|
20257
20245
|
api: "https://api.routescan.io/v2/network/mainnet/evm/34443/etherscan",
|
|
20258
20246
|
explorer: "34443.routescan.io"
|
|
20259
20247
|
},
|
|
20260
|
-
42069: {
|
|
20261
|
-
api: "https://api.routescan.io/v2/network/mainnet/evm/42069/etherscan",
|
|
20262
|
-
explorer: "42069.routescan.io"
|
|
20263
|
-
},
|
|
20264
20248
|
42161: {
|
|
20265
20249
|
api: "https://api.routescan.io/v2/network/mainnet/evm/42161/etherscan",
|
|
20266
20250
|
explorer: "42161.routescan.io"
|
|
@@ -20542,6 +20526,9 @@ function getExplorer(chainId) {
|
|
|
20542
20526
|
throw new Error(`No explorer found for chainId: ${chainId}`);
|
|
20543
20527
|
}
|
|
20544
20528
|
async function getSourceCode(params) {
|
|
20529
|
+
if (params.chainId === ChainId.xLayer) {
|
|
20530
|
+
return getXLayerSourceCode(params);
|
|
20531
|
+
}
|
|
20545
20532
|
const payload = {
|
|
20546
20533
|
chainid: String(params.chainId),
|
|
20547
20534
|
address: params.address,
|
|
@@ -20554,7 +20541,7 @@ async function getSourceCode(params) {
|
|
|
20554
20541
|
console.log(url);
|
|
20555
20542
|
const request = await fetch(url);
|
|
20556
20543
|
const { status, message, result } = await request.json();
|
|
20557
|
-
if (status
|
|
20544
|
+
if (status !== "1") {
|
|
20558
20545
|
throw new Error(result);
|
|
20559
20546
|
}
|
|
20560
20547
|
return result[0];
|
|
@@ -20583,6 +20570,33 @@ function parseBlockscoutStyleSourceCode(sourceCode) {
|
|
|
20583
20570
|
};
|
|
20584
20571
|
return result;
|
|
20585
20572
|
}
|
|
20573
|
+
async function getXLayerSourceCode(params) {
|
|
20574
|
+
const payload = {
|
|
20575
|
+
chainShortName: "xlayer",
|
|
20576
|
+
contractAddress: params.address
|
|
20577
|
+
};
|
|
20578
|
+
const formattedPayload = new URLSearchParams(payload).toString();
|
|
20579
|
+
const apiUrl = "https://www.oklink.com/api/v5/explorer/contract/verify-contract-info";
|
|
20580
|
+
const url = `${apiUrl}?${formattedPayload}`;
|
|
20581
|
+
const request = await fetch(url);
|
|
20582
|
+
const { data, message } = await request.json();
|
|
20583
|
+
if (data.length === 0) {
|
|
20584
|
+
throw new Error(message);
|
|
20585
|
+
}
|
|
20586
|
+
return {
|
|
20587
|
+
SourceCode: data[0].sourceCode,
|
|
20588
|
+
ABI: data[0].contractAbi,
|
|
20589
|
+
CompilerVersion: data[0].compilerVersion,
|
|
20590
|
+
ContractName: data[0].contractName,
|
|
20591
|
+
EVMVersion: data[0].evmVersion,
|
|
20592
|
+
Implementation: data[0].implementation,
|
|
20593
|
+
Library: data[0].libraryInfo,
|
|
20594
|
+
LicenseType: data[0].licenseType,
|
|
20595
|
+
OptimizationUsed: data[0].optimization,
|
|
20596
|
+
Proxy: data[0].proxy,
|
|
20597
|
+
Runs: data[0].optimizationRuns
|
|
20598
|
+
};
|
|
20599
|
+
}
|
|
20586
20600
|
|
|
20587
20601
|
// src/ecosystem/tenderly.ts
|
|
20588
20602
|
import {
|
|
@@ -23049,8 +23063,8 @@ var blockscoutExplorers = {
|
|
|
23049
23063
|
explorer: "https://testnet3.cypherscan.ai/"
|
|
23050
23064
|
},
|
|
23051
23065
|
10200: {
|
|
23052
|
-
api: "https://gnosis.blockscout.com/api",
|
|
23053
|
-
explorer: "https://gnosis.blockscout.com/"
|
|
23066
|
+
api: "https://gnosis-chiado.blockscout.com/api",
|
|
23067
|
+
explorer: "https://gnosis-chiado.blockscout.com/"
|
|
23054
23068
|
},
|
|
23055
23069
|
10245: {
|
|
23056
23070
|
api: "https://capxscan.com/api",
|