@bgd-labs/toolbox 0.0.7 → 0.0.8
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +20 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2886,7 +2886,7 @@ async function tenderly_deleteVnet(vnetId, { accountSlug, projectSlug, accessTok
|
|
|
2886
2886
|
);
|
|
2887
2887
|
}
|
|
2888
2888
|
async function tenderly_simVnet(vnetId, { accountSlug, projectSlug, accessToken }, body) {
|
|
2889
|
-
|
|
2889
|
+
const response = await fetch(
|
|
2890
2890
|
// Note: this is subject to change and currently uses the internal api of tenderly
|
|
2891
2891
|
`${TENDERLY_BASE_URL}/account/${accountSlug}/project/${projectSlug}/testnet/${vnetId}/simulate`,
|
|
2892
2892
|
{
|
|
@@ -2897,7 +2897,8 @@ async function tenderly_simVnet(vnetId, { accountSlug, projectSlug, accessToken
|
|
|
2897
2897
|
"X-Access-Key": accessToken
|
|
2898
2898
|
})
|
|
2899
2899
|
}
|
|
2900
|
-
)
|
|
2900
|
+
);
|
|
2901
|
+
return response.json();
|
|
2901
2902
|
}
|
|
2902
2903
|
async function tenderly_getVnet(slug, { accountSlug, projectSlug, accessToken }) {
|
|
2903
2904
|
return (await fetch(
|
|
@@ -2956,7 +2957,7 @@ async function tenderly_createVnet({
|
|
|
2956
2957
|
)).json();
|
|
2957
2958
|
}
|
|
2958
2959
|
let response = await createVnet();
|
|
2959
|
-
if (response.error?.slug === "
|
|
2960
|
+
if (response.error?.slug === "conflict" && force) {
|
|
2960
2961
|
const staleVnet = await tenderly_getVnet(slug, {
|
|
2961
2962
|
accessToken,
|
|
2962
2963
|
accountSlug,
|
|
@@ -2973,16 +2974,19 @@ async function tenderly_createVnet({
|
|
|
2973
2974
|
console.info(response.error);
|
|
2974
2975
|
throw new Error("Tenderly vnet could not be created");
|
|
2975
2976
|
}
|
|
2977
|
+
const rpc = response.rpcs.find(
|
|
2978
|
+
(r) => r.name.includes("Admin") && r.url.includes("https://")
|
|
2979
|
+
);
|
|
2976
2980
|
return {
|
|
2977
2981
|
vnet: response,
|
|
2978
2982
|
testClient: createTestClient({
|
|
2979
2983
|
mode: "tenderly",
|
|
2980
|
-
transport: http(
|
|
2984
|
+
transport: http(rpc.url)
|
|
2981
2985
|
}),
|
|
2982
2986
|
walletClient: createWalletClient({
|
|
2983
2987
|
chain: { id: forkChainId },
|
|
2984
2988
|
account: "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",
|
|
2985
|
-
transport: http(
|
|
2989
|
+
transport: http(rpc.url)
|
|
2986
2990
|
}),
|
|
2987
2991
|
simulate: (body2) => tenderly_simVnet(
|
|
2988
2992
|
response.id,
|
|
@@ -2991,7 +2995,17 @@ async function tenderly_createVnet({
|
|
|
2991
2995
|
accountSlug,
|
|
2992
2996
|
projectSlug
|
|
2993
2997
|
},
|
|
2994
|
-
|
|
2998
|
+
{
|
|
2999
|
+
...body2,
|
|
3000
|
+
network_id: baseChainId.toString(),
|
|
3001
|
+
block_number: null,
|
|
3002
|
+
transaction_index: 0,
|
|
3003
|
+
gas_price: "0",
|
|
3004
|
+
access_list: [],
|
|
3005
|
+
generate_access_list: true,
|
|
3006
|
+
save: true,
|
|
3007
|
+
source: "dashboard"
|
|
3008
|
+
}
|
|
2995
3009
|
),
|
|
2996
3010
|
delete: () => tenderly_deleteVnet(response.id, {
|
|
2997
3011
|
accessToken,
|