@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.d.mts
CHANGED
|
@@ -309,7 +309,7 @@ declare function tenderly_createVnet({ slug, displayName, baseChainId, forkChain
|
|
|
309
309
|
vnet: Tenderly_createVnetParamsResponse;
|
|
310
310
|
testClient: TestClient;
|
|
311
311
|
walletClient: WalletClient;
|
|
312
|
-
simulate: (body:
|
|
312
|
+
simulate: (body: object) => Promise<any>;
|
|
313
313
|
delete: () => Promise<Response>;
|
|
314
314
|
}>;
|
|
315
315
|
|
package/dist/index.d.ts
CHANGED
|
@@ -309,7 +309,7 @@ declare function tenderly_createVnet({ slug, displayName, baseChainId, forkChain
|
|
|
309
309
|
vnet: Tenderly_createVnetParamsResponse;
|
|
310
310
|
testClient: TestClient;
|
|
311
311
|
walletClient: WalletClient;
|
|
312
|
-
simulate: (body:
|
|
312
|
+
simulate: (body: object) => Promise<any>;
|
|
313
313
|
delete: () => Promise<Response>;
|
|
314
314
|
}>;
|
|
315
315
|
|
package/dist/index.js
CHANGED
|
@@ -2970,7 +2970,7 @@ async function tenderly_deleteVnet(vnetId, { accountSlug, projectSlug, accessTok
|
|
|
2970
2970
|
);
|
|
2971
2971
|
}
|
|
2972
2972
|
async function tenderly_simVnet(vnetId, { accountSlug, projectSlug, accessToken }, body) {
|
|
2973
|
-
|
|
2973
|
+
const response = await fetch(
|
|
2974
2974
|
// Note: this is subject to change and currently uses the internal api of tenderly
|
|
2975
2975
|
`${TENDERLY_BASE_URL}/account/${accountSlug}/project/${projectSlug}/testnet/${vnetId}/simulate`,
|
|
2976
2976
|
{
|
|
@@ -2981,7 +2981,8 @@ async function tenderly_simVnet(vnetId, { accountSlug, projectSlug, accessToken
|
|
|
2981
2981
|
"X-Access-Key": accessToken
|
|
2982
2982
|
})
|
|
2983
2983
|
}
|
|
2984
|
-
)
|
|
2984
|
+
);
|
|
2985
|
+
return response.json();
|
|
2985
2986
|
}
|
|
2986
2987
|
async function tenderly_getVnet(slug, { accountSlug, projectSlug, accessToken }) {
|
|
2987
2988
|
return (await fetch(
|
|
@@ -3040,7 +3041,7 @@ async function tenderly_createVnet({
|
|
|
3040
3041
|
)).json();
|
|
3041
3042
|
}
|
|
3042
3043
|
let response = await createVnet();
|
|
3043
|
-
if (response.error?.slug === "
|
|
3044
|
+
if (response.error?.slug === "conflict" && force) {
|
|
3044
3045
|
const staleVnet = await tenderly_getVnet(slug, {
|
|
3045
3046
|
accessToken,
|
|
3046
3047
|
accountSlug,
|
|
@@ -3057,16 +3058,19 @@ async function tenderly_createVnet({
|
|
|
3057
3058
|
console.info(response.error);
|
|
3058
3059
|
throw new Error("Tenderly vnet could not be created");
|
|
3059
3060
|
}
|
|
3061
|
+
const rpc = response.rpcs.find(
|
|
3062
|
+
(r) => r.name.includes("Admin") && r.url.includes("https://")
|
|
3063
|
+
);
|
|
3060
3064
|
return {
|
|
3061
3065
|
vnet: response,
|
|
3062
3066
|
testClient: (0, import_viem4.createTestClient)({
|
|
3063
3067
|
mode: "tenderly",
|
|
3064
|
-
transport: (0, import_viem4.http)(
|
|
3068
|
+
transport: (0, import_viem4.http)(rpc.url)
|
|
3065
3069
|
}),
|
|
3066
3070
|
walletClient: (0, import_viem4.createWalletClient)({
|
|
3067
3071
|
chain: { id: forkChainId },
|
|
3068
3072
|
account: "0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9",
|
|
3069
|
-
transport: (0, import_viem4.http)(
|
|
3073
|
+
transport: (0, import_viem4.http)(rpc.url)
|
|
3070
3074
|
}),
|
|
3071
3075
|
simulate: (body2) => tenderly_simVnet(
|
|
3072
3076
|
response.id,
|
|
@@ -3075,7 +3079,17 @@ async function tenderly_createVnet({
|
|
|
3075
3079
|
accountSlug,
|
|
3076
3080
|
projectSlug
|
|
3077
3081
|
},
|
|
3078
|
-
|
|
3082
|
+
{
|
|
3083
|
+
...body2,
|
|
3084
|
+
network_id: baseChainId.toString(),
|
|
3085
|
+
block_number: null,
|
|
3086
|
+
transaction_index: 0,
|
|
3087
|
+
gas_price: "0",
|
|
3088
|
+
access_list: [],
|
|
3089
|
+
generate_access_list: true,
|
|
3090
|
+
save: true,
|
|
3091
|
+
source: "dashboard"
|
|
3092
|
+
}
|
|
3079
3093
|
),
|
|
3080
3094
|
delete: () => tenderly_deleteVnet(response.id, {
|
|
3081
3095
|
accessToken,
|