import {
createSmartAccountClient,
walletClientToCustomSigner,
} from "permissionless";
import { signerToSimpleSmartAccount } from "permissionless/accounts";
import { useWalletClient } from "wagmi";
const { data: walletClient } = useWalletClient();
const customSigner = walletClientToCustomSigner(walletClient);
const simpleSmartAccountClient = await signerToSimpleSmartAccount(
publicClient,
{
entryPoint: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
signer: customSigner,
factoryAddress: "0x9406Cc6185a346906296840746125a0E44976454",
}
);
const smartAccountClient = createSmartAccountClient({
account: simpleSmartAccountClient,
chain: sepolia, // or whatever chain you are using
transport: http("<bundler_endpoint>"),
sponsorUserOperation: pimlicoPaymaster.sponsorUserOperation, // if using a paymaster
});