diff --git a/packages/cli/src/deploy/getDeployClient.ts b/packages/cli/src/deploy/getDeployClient.ts index fa7b259d79..87d9672922 100644 --- a/packages/cli/src/deploy/getDeployClient.ts +++ b/packages/cli/src/deploy/getDeployClient.ts @@ -1,6 +1,6 @@ import { transactionQueue } from "@latticexyz/common/actions"; import { rhodolite } from "@latticexyz/common/chains"; -import { claimGasPass, getAllowance, hasPassIssuer, gasEstimator } from "@latticexyz/paymaster/internal"; +import { claimGasPass, getAllowance, hasPassIssuer } from "@latticexyz/paymaster/internal"; import { wiresaw } from "@latticexyz/wiresaw/internal"; import { smartAccountActions } from "permissionless"; import { toSimpleSmartAccount } from "permissionless/accounts"; @@ -61,8 +61,7 @@ export async function getDeployClient(opts: { const account = await toSimpleSmartAccount({ client, owner: opts.account }); const bundlerClient = createBundlerClient({ chain, - // TODO: figure out how to remove gas estimator (currently times out if not present) - transport: gasEstimator(wiresaw(http(bundlerHttpUrl))), + transport: wiresaw(http(bundlerHttpUrl)), account, paymaster: { getPaymasterData: async () => ({ diff --git a/packages/entrykit/src/getBundlerTransport.ts b/packages/entrykit/src/getBundlerTransport.ts index ed3b8325ae..9b71ee460d 100644 --- a/packages/entrykit/src/getBundlerTransport.ts +++ b/packages/entrykit/src/getBundlerTransport.ts @@ -2,13 +2,13 @@ import { transactionQueue } from "@latticexyz/common/actions"; import { Chain, createClient, fallback, http, webSocket } from "viem"; import { privateKeyToAccount, generatePrivateKey } from "viem/accounts"; import { wiresaw } from "@latticexyz/wiresaw/internal"; -import { gasEstimator, userOpExecutor } from "@latticexyz/paymaster/internal"; +import { userOpExecutor } from "@latticexyz/paymaster/internal"; export function getBundlerTransport(chain: Chain) { const bundlerHttpUrl = chain.rpcUrls.bundler?.http[0]; // TODO: bundler websocket const bundlerTransport = bundlerHttpUrl - ? gasEstimator(wiresaw(http(bundlerHttpUrl))) + ? wiresaw(http(bundlerHttpUrl)) : chain.id === 31337 ? userOpExecutor({ executor: createClient({ diff --git a/packages/entrykit/src/onboarding/useSetupSession.ts b/packages/entrykit/src/onboarding/useSetupSession.ts index 771e454cf7..ba270f872d 100644 --- a/packages/entrykit/src/onboarding/useSetupSession.ts +++ b/packages/entrykit/src/onboarding/useSetupSession.ts @@ -113,6 +113,15 @@ export function useSetupSession({ userClient }: { userClient: ConnectedClient }) if (!calls.length) return; + // if (!(await userClient.account.isDeployed())) { + // // send empty tx to create the smart account, otherwise the first tx may fail due to bad gas estimation + // console.log("creating smart account at", userClient.account.address); + // const hash = await getAction(userClient, sendUserOperation, "sendUserOperation")({ calls: [] }); + // console.log("tx:", hash); + // const receipt = await getAction(userClient, waitForTransactionReceipt, "waitForTransactionReceipt")({ hash }); + // console.log("receipt:", receipt.status); + // } + console.log("setting up account with", calls, userClient); const hash = await getAction(userClient, sendUserOperation, "sendUserOperation")({ calls }); console.log("got user op hash", hash);