Function createSmartAccountClient

  • Creates a new instance of BiconomySmartAccountV2

    This method will create a BiconomySmartAccountV2 instance but will not deploy the Smart Account Deployment of the Smart Account will be donewith the first user operation.

    Parameters

    Returns Promise<BiconomySmartAccountV2>

    A promise that resolves to a new instance of BiconomySmartAccountV2.

    Throws

    An error if something is wrong with the smart account instance creation.

    Example

    import { createClient } from "viem"
    import { createSmartAccountClient, BiconomySmartAccountV2 } from "@biconomy/account"
    import { createWalletClient, http } from "viem";
    import { polygonAmoy } from "viem/chains";

    const signer = createWalletClient({
    account,
    chain: polygonAmoy,
    transport: http(),
    });

    const bundlerUrl = "" // Retrieve bundler url from dashboard

    const smartAccountFromStaticCreate = await BiconomySmartAccountV2.create({ signer, bundlerUrl });

    // Is the same as...

    const smartAccount = await createSmartAccountClient({ signer, bundlerUrl });