Deploy User's SC Wallet if not Deployed
Note - You need to send some Native Token for Gas to the SC Wallet Address before you can deploy it.
const { walletAPI, bundler } = useBundler();
const isUserWalletNotDeployed = useIsWalletDeployed();
const account = useAccount();
if(isUserWalletNotDeployed && userSCWalletBalance > 0) {
  const op = await walletAPI.createSignedUserOp({
    target: account.address,
    data: "0x",
    value: 0n,
  });
  
  const deployWalletUserOp = await bundler.sendUserOpToBundler(op);
}Last updated
Was this helpful?