From d001b43023b4b4a3b2f845f618412000873aa49e Mon Sep 17 00:00:00 2001 From: AyushBherwani1998 Date: Tue, 15 Oct 2024 09:22:51 +0530 Subject: [PATCH] make it more copy friendly --- docs/sdk/pnp/web/providers/aa-provider.mdx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/sdk/pnp/web/providers/aa-provider.mdx b/docs/sdk/pnp/web/providers/aa-provider.mdx index 86ed4f2cd..d693c16aa 100644 --- a/docs/sdk/pnp/web/providers/aa-provider.mdx +++ b/docs/sdk/pnp/web/providers/aa-provider.mdx @@ -277,7 +277,8 @@ blockNumber, blockHash and transactionHash. const bundlerClient = accountAbstractionProvider.bundlerClient!; const smartAccount = accountAbstractionProvider.smartAccount!; -const amount = ethers.parseEther("0.00001"); +// 0.00001 ETH in WEI format +const amount = 10000000000000n; const userOperationHash = await bundlerClient.sendUserOperation({ account: smartAccount, @@ -325,7 +326,11 @@ const pimlicoPaymasterAddress = "0x0000000000000039cd5e8aE05257CE51C473ddd1"; // USDC address on Ethereum Sepolia const usdcAddress = "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"; -const amount = ethers.parseEther("0.00001"); +// 0.00001 ETH in WEI format +const amount = 10000000000000n; + +// 10 USDC in WEI format. Since USDC has 6 decimals, 10 * 10^6 +const approvalAmount = 10000000n; const userOpHash = await bundlerClient.sendUserOperation({ account: smartAccount, @@ -335,7 +340,7 @@ const userOpHash = await bundlerClient.sendUserOperation({ to: usdcAddress, abi: parseAbi(["function approve(address,uint)"]), functionName: "approve", - args: [pimlicoPaymasterAddress, maxUint256], + args: [pimlicoPaymasterAddress, approvalAmount], }, { to: "DESTINATION_ADDRESS",