Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // V7 Entry Point
- async createSmartAccountV7(signer: string) {
- const owner = createWalletClient({
- account: signer as Address,
- transport: http(BASE_RPC_URL),
- });
- const safeAccount = await toSafeSmartAccount({
- client: publicClient,
- entryPoint: {
- address: entryPoint07Address,
- version: '0.7',
- },
- owners: [owner],
- version: '1.4.1',
- });
- const smartAccountClient = createSmartAccountClient({
- account: safeAccount,
- chain: base,
- paymaster: paymasterClient,
- bundlerTransport: http(PIMLICO_URL),
- userOperation: {
- estimateFeesPerGas: async () =>
- (await paymasterClient.getUserOperationGasPrice()).fast,
- },
- });
- const txHash = await smartAccountClient.sendTransaction({
- to: zeroAddress,
- data: '0x',
- value: BigInt(0),
- });
- console.log('txHash', txHash);
- }
Advertisement
Add Comment
Please, Sign In to add comment