0x0x230x

Untitled

Feb 5th, 2025
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. // V7 Entry Point
  2. async createSmartAccountV7(signer: string) {
  3. const owner = createWalletClient({
  4. account: signer as Address,
  5. transport: http(BASE_RPC_URL),
  6. });
  7.  
  8. const safeAccount = await toSafeSmartAccount({
  9. client: publicClient,
  10. entryPoint: {
  11. address: entryPoint07Address,
  12. version: '0.7',
  13. },
  14. owners: [owner],
  15. version: '1.4.1',
  16. });
  17.  
  18. const smartAccountClient = createSmartAccountClient({
  19. account: safeAccount,
  20. chain: base,
  21. paymaster: paymasterClient,
  22. bundlerTransport: http(PIMLICO_URL),
  23. userOperation: {
  24. estimateFeesPerGas: async () =>
  25. (await paymasterClient.getUserOperationGasPrice()).fast,
  26. },
  27. });
  28.  
  29. const txHash = await smartAccountClient.sendTransaction({
  30. to: zeroAddress,
  31. data: '0x',
  32. value: BigInt(0),
  33. });
  34.  
  35. console.log('txHash', txHash);
  36. }
Advertisement
Add Comment
Please, Sign In to add comment