diff --git a/packages/permissionless-test/ep-0.6/bundlerActions.test.ts b/packages/permissionless-test/ep-0.6/bundlerActions.test.ts index a2fdef3d..2d83ccb0 100644 --- a/packages/permissionless-test/ep-0.6/bundlerActions.test.ts +++ b/packages/permissionless-test/ep-0.6/bundlerActions.test.ts @@ -2,8 +2,6 @@ import dotenv from "dotenv" import { BundlerClient, ENTRYPOINT_ADDRESS_V06, - ENTRYPOINT_ADDRESS_V07, - UserOperation, WaitForUserOperationReceiptTimeoutError, createBundlerClient, createSmartAccountClient, @@ -40,6 +38,7 @@ import { getEntryPoint, getEoaWalletClient, getPimlicoBundlerClient, + getPimlicoPaymasterClient, getPrivateKeyAccount, getPublicClient, getSignerToSimpleSmartAccount, @@ -93,8 +92,6 @@ describe("BUNDLER ACTIONS", () => { test("Estimate user operation gas", async () => { const publicClient = getPublicClient() - const eoaWalletClient = getEoaWalletClient() - const simpleAccount = await signerToSimpleSmartAccount(publicClient, { signer: privateKeyToAccount( process.env.TEST_PRIVATE_KEY as Address @@ -104,21 +101,33 @@ describe("BUNDLER ACTIONS", () => { index: 3n }) + const paymasterClient = getPimlicoPaymasterClient() + const pimlicoBundlerClient = getPimlicoBundlerClient() + const smartAccountClient = createSmartAccountClient({ account: simpleAccount, chain: getTestingChain(), - bundlerTransport: http(`${process.env.BUNDLER_RPC_HOST}`) + bundlerTransport: http(`${process.env.BUNDLER_RPC_HOST}`), + middleware: { + gasPrice: async () => { + const gasPrices = + await pimlicoBundlerClient.getUserOperationGasPrice() + return gasPrices.fast + }, + sponsorUserOperation: paymasterClient.sponsorUserOperation + } }) - await eoaWalletClient.sendTransaction({ - to: simpleAccount.address, - value: parseEther("1") - }) + // await eoaWalletClient.sendTransaction({ + // to: simpleAccount.address, + // value: parseEther("1") + // }) const response = await smartAccountClient.sendTransaction({ to: zeroAddress, value: 0n }) + console.log(`Transaction hash: ${response}`) }, 100000) test("Sending user operation", async () => { diff --git a/packages/permissionless-test/ep-0.7/bundlerActions.test.ts b/packages/permissionless-test/ep-0.7/bundlerActions.test.ts index 3a5c5c70..91d9006c 100644 --- a/packages/permissionless-test/ep-0.7/bundlerActions.test.ts +++ b/packages/permissionless-test/ep-0.7/bundlerActions.test.ts @@ -37,6 +37,8 @@ import { getBundlerClient, getEntryPoint, getEoaWalletClient, + getPimlicoBundlerClient, + getPimlicoPaymasterClient, getPrivateKeyAccount, getPublicClient, getSignerToSimpleSmartAccount, @@ -91,8 +93,6 @@ describe("BUNDLER ACTIONS", () => { test("Estimate user operation gas", async () => { const publicClient = getPublicClient() - const eoaWalletClient = getEoaWalletClient() - const simpleAccount = await signerToSimpleSmartAccount(publicClient, { signer: privateKeyToAccount( process.env.TEST_PRIVATE_KEY as Address @@ -102,22 +102,34 @@ describe("BUNDLER ACTIONS", () => { index: 3n }) + // const paymasterClient = getPimlicoPaymasterClient() + const pimlicoBundlerClient = getPimlicoBundlerClient() + const smartAccountClient = createSmartAccountClient({ account: simpleAccount, chain: getTestingChain(), - bundlerTransport: http(`${process.env.BUNDLER_RPC_HOST}`) + bundlerTransport: http(`${process.env.BUNDLER_RPC_HOST}`), + middleware: { + gasPrice: async () => { + const gasPrices = + await pimlicoBundlerClient.getUserOperationGasPrice() + return gasPrices.fast + } + // sponsorUserOperation: paymasterClient.sponsorUserOperation + } }) - await eoaWalletClient.sendTransaction({ - to: simpleAccount.address, - value: parseEther("1") - }) + // await eoaWalletClient.sendTransaction({ + // to: simpleAccount.address, + // value: parseEther("1") + // }) const response = await smartAccountClient.sendTransaction({ to: zeroAddress, value: 0n }) - }) + console.log(`Transaction hash: ${response}`) + }, 100000) test("Sending user operation", async () => { const publicClient = getPublicClient()