Function BiconomyProvider

  • Parameters

    Returns Element

    Description

    The BiconomyProvider component in TypeScript React sets up a context provider for managing BiconomySmartAccountV2 related state and functionality.

    Example

    import { BiconomyProvider } from "@biconomy/use-aa";
    import { createConfig, http, WagmiProvider } from "wagmi";
    import { polygonAmoy } from "wagmi/chains";
    import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
    import { StrictMode } from "react";
    import ReactDOM from "react-dom/client";
    import { bundlerUrl, biconomyPaymasterApiKey } from "./config";

    const wagmiConfig = createConfig({
    chains: [polygonAmoy],
    transports: { [polygonAmoy.id]: http() },
    });

    const queryClient = new QueryClient();

    ReactDOM.createRoot(document?.getElementById("root")!).render(
    <StrictMode>
    <WagmiProvider config={wagmiConfig}>
    <QueryClientProvider client={queryClient}>
    <BiconomyProvider
    config={{
    biconomyPaymasterApiKey,
    bundlerUrl,
    }}
    queryClient={queryClient}
    >
    <App />
    </BiconomyProvider>
    </QueryClientProvider>
    </WagmiProvider>
    </StrictMode>
    );