From a653801b6710ccd16426095cb6d256e7b395d020 Mon Sep 17 00:00:00 2001 From: Jahanzeb Date: Tue, 10 Feb 2026 19:06:07 +0100 Subject: [PATCH 1/2] docs: add Openfort as a signer option Add documentation for using Openfort embedded wallets as a signer with ZeroDev Kernel accounts. Openfort provides: - Non-custodial embedded wallets - Passkey and social login authentication - EIP-1193 compatible provider - Built-in ERC-4337 smart account support Documentation added for both current SDK and v5.3.x. --- docs/pages/sdk/signers/openfort.mdx | 113 +++++++++++++++++++ docs/pages/sdk/v5_3_x/signers/openfort.mdx | 120 +++++++++++++++++++++ vocs.config.tsx | 8 ++ 3 files changed, 241 insertions(+) create mode 100644 docs/pages/sdk/signers/openfort.mdx create mode 100644 docs/pages/sdk/v5_3_x/signers/openfort.mdx diff --git a/docs/pages/sdk/signers/openfort.mdx b/docs/pages/sdk/signers/openfort.mdx new file mode 100644 index 0000000..d303323 --- /dev/null +++ b/docs/pages/sdk/signers/openfort.mdx @@ -0,0 +1,113 @@ +# Use Openfort with ZeroDev + +[Openfort](https://www.openfort.io/) is a wallet infrastructure platform that provides embedded wallets with built-in account abstraction support. It offers passkey authentication, social login, and seamless onboarding experiences for both web and mobile applications. Openfort's embedded wallets are non-custodial by design and support ERC-4337 smart accounts with features like gas sponsorship, transaction batching, and session keys. + +## Set up + +To use Openfort with ZeroDev, first create an application that integrates with Openfort. + +- Refer to the [Openfort documentation site](https://www.openfort.io/docs) for instructions on setting up an application. +- For a quick start, Openfort provides a demo application, available [here](https://demo.openfort.io/). + +## Integration + +Integrating ZeroDev with Openfort is straightforward after setting up your project. Openfort provides an EIP-1193 compatible provider that can be used as a signer with Kernel. + +### Create the Openfort client and get the provider + +After following the Openfort documentation, you will have access to an Openfort client. Here's how to set it up: + +```typescript +import { Openfort } from '@openfort/openfort-js' + +// Initialize Openfort with your keys +const openfort = new Openfort({ + baseConfiguration: { + publishableKey: "YOUR_OPENFORT_PUBLISHABLE_KEY" + }, + shieldConfiguration: { + shieldPublishableKey: "YOUR_SHIELD_PUBLISHABLE_KEY" + } +}) + +// Authenticate the user (e.g., with email, social login, or passkeys) +// See Openfort docs for authentication options + +// Get the EIP-1193 provider +const openfortProvider = await openfort.embeddedWallet.getEthereumProvider() +``` + +### Use with ZeroDev + +Use the provider from Openfort to create a smart account signer, which can be passed to a validator. For detailed guidance on using a validator, refer to our documentation on [creating accounts](/sdk/core-api/create-account#api). + +```typescript +import { signerToEcdsaValidator } from "@zerodev/ecdsa-validator" +import { KERNEL_V3_1, getEntryPoint } from "@zerodev/sdk/constants" +import { createPublicClient, http } from "viem" +import { polygonAmoy } from 'viem/chains' + +const publicClient = createPublicClient({ + // Use your own RPC provider (e.g. Infura/Alchemy). + transport: http('https://rpc-amoy.polygon.technology'), + chain: polygonAmoy, +}) + +// Pass your Openfort provider to the validator +const ecdsaValidator = await signerToEcdsaValidator(publicClient, { + signer: openfortProvider, + entryPoint: getEntryPoint("0.7"), + kernelVersion: KERNEL_V3_1 +}) + +// You can now use this ECDSA Validator to create a Kernel account +``` + +### Using with Viem + +Openfort's provider is also compatible with Viem's `createWalletClient`: + +```typescript +import { createWalletClient, custom } from 'viem' +import { polygonAmoy } from 'viem/chains' + +// Create a wallet client from the Openfort provider +const walletClient = createWalletClient({ + chain: polygonAmoy, + transport: custom(openfortProvider) +}) + +// Use the wallet client with ZeroDev +const ecdsaValidator = await signerToEcdsaValidator(publicClient, { + signer: walletClient, + entryPoint: getEntryPoint("0.7"), + kernelVersion: KERNEL_V3_1 +}) +``` + +## React Integration + +If you're using React, Openfort provides hooks for easier integration: + +```typescript +import { useOpenfort } from '@openfort/openfort-react' + +function App() { + const { embeddedWallet, user } = useOpenfort() + + const getProvider = async () => { + if (!user) { + throw new Error("User not authenticated") + } + return await embeddedWallet.getEthereumProvider() + } + + // Use the provider with ZeroDev as shown above +} +``` + +## Additional Resources + +- [Openfort Documentation](https://www.openfort.io/docs) +- [Openfort Demo](https://demo.openfort.io/) +- [Openfort GitHub](https://github.com/openfort-xyz) diff --git a/docs/pages/sdk/v5_3_x/signers/openfort.mdx b/docs/pages/sdk/v5_3_x/signers/openfort.mdx new file mode 100644 index 0000000..c226fa6 --- /dev/null +++ b/docs/pages/sdk/v5_3_x/signers/openfort.mdx @@ -0,0 +1,120 @@ +import VersionWarning from "../VersionWarning" + + + +# Use Openfort with ZeroDev + +[Openfort](https://www.openfort.io/) is a wallet infrastructure platform that provides embedded wallets with built-in account abstraction support. It offers passkey authentication, social login, and seamless onboarding experiences for both web and mobile applications. Openfort's embedded wallets are non-custodial by design and support ERC-4337 smart accounts with features like gas sponsorship, transaction batching, and session keys. + +## Set up + +To use Openfort with ZeroDev, first create an application that integrates with Openfort. + +- Refer to the [Openfort documentation site](https://www.openfort.io/docs) for instructions on setting up an application. +- For a quick start, Openfort provides a demo application, available [here](https://demo.openfort.io/). + +## Integration + +Integrating ZeroDev with Openfort is straightforward after setting up your project. Openfort provides an EIP-1193 compatible provider that can be used as a signer with Kernel. + +### Create the Openfort client and get the provider + +After following the Openfort documentation, you will have access to an Openfort client. Here's how to set it up: + +```typescript +import { Openfort } from '@openfort/openfort-js' + +// Initialize Openfort with your keys +const openfort = new Openfort({ + baseConfiguration: { + publishableKey: "YOUR_OPENFORT_PUBLISHABLE_KEY" + }, + shieldConfiguration: { + shieldPublishableKey: "YOUR_SHIELD_PUBLISHABLE_KEY" + } +}) + +// Authenticate the user (e.g., with email, social login, or passkeys) +// See Openfort docs for authentication options + +// Get the EIP-1193 provider +const openfortProvider = await openfort.embeddedWallet.getEthereumProvider() +``` + +### Use with ZeroDev + +Use the provider from Openfort to create a smart account signer, which can be passed to a validator. For detailed guidance on using a validator, refer to our documentation on [creating accounts](/sdk/v5_3_x/core-api/create-account#api). + +```typescript +import { signerToEcdsaValidator } from "@zerodev/ecdsa-validator" +import { KERNEL_V3_1 } from "@zerodev/sdk/constants" +import { providerToSmartAccountSigner, ENTRYPOINT_ADDRESS_V07 } from 'permissionless' +import { createPublicClient, http } from "viem" +import { polygonAmoy } from 'viem/chains' + +const publicClient = createPublicClient({ + // Use your own RPC provider (e.g. Infura/Alchemy). + transport: http('https://rpc-amoy.polygon.technology'), + chain: polygonAmoy, +}) + +// Create a SmartAccountSigner from the Openfort provider +const smartAccountSigner = await providerToSmartAccountSigner(openfortProvider) + +// Pass your smartAccountSigner to the validator +const ecdsaValidator = await signerToEcdsaValidator(publicClient, { + signer: smartAccountSigner, + entryPoint: ENTRYPOINT_ADDRESS_V07, + kernelVersion: KERNEL_V3_1 +}) + +// You can now use this ECDSA Validator to create a Kernel account +``` + +### Using with Viem + +Openfort's provider is also compatible with Viem's `createWalletClient`: + +```typescript +import { createWalletClient, custom } from 'viem' +import { walletClientToSmartAccountSigner } from 'permissionless' +import { polygonAmoy } from 'viem/chains' + +// Create a wallet client from the Openfort provider +const walletClient = createWalletClient({ + chain: polygonAmoy, + transport: custom(openfortProvider) +}) + +// Convert to a SmartAccountSigner +const smartAccountSigner = walletClientToSmartAccountSigner(walletClient) + +// Use with ZeroDev as shown above +``` + +## React Integration + +If you're using React, Openfort provides hooks for easier integration: + +```typescript +import { useOpenfort } from '@openfort/openfort-react' + +function App() { + const { embeddedWallet, user } = useOpenfort() + + const getProvider = async () => { + if (!user) { + throw new Error("User not authenticated") + } + return await embeddedWallet.getEthereumProvider() + } + + // Use the provider with ZeroDev as shown above +} +``` + +## Additional Resources + +- [Openfort Documentation](https://www.openfort.io/docs) +- [Openfort Demo](https://demo.openfort.io/) +- [Openfort GitHub](https://github.com/openfort-xyz) diff --git a/vocs.config.tsx b/vocs.config.tsx index fa7ff51..d27c805 100644 --- a/vocs.config.tsx +++ b/vocs.config.tsx @@ -356,6 +356,10 @@ export default defineConfig({ link: "/sdk/signers/magic", text: "Magic", }, + { + link: "/sdk/signers/openfort", + text: "Openfort", + }, { link: "/sdk/signers/web3auth", text: "Web3Auth", @@ -690,6 +694,10 @@ export default defineConfig({ link: "/sdk/v5_3_x/signers/magic", text: "Magic", }, + { + link: "/sdk/v5_3_x/signers/openfort", + text: "Openfort", + }, { link: "/sdk/v5_3_x/signers/web3auth", text: "Web3Auth", From f37afe911b481cbcd3e6b02564ad45100f6abe8b Mon Sep 17 00:00:00 2001 From: Jahanzeb Date: Mon, 16 Feb 2026 14:52:03 +0100 Subject: [PATCH 2/2] fix: use Openfort React SDK instead of JS SDK - Changed package from @openfort/openfort-js to @openfort/react - Updated to use wagmi's useConnectorClient hook for provider access - Added proper OpenfortProvider setup with getDefaultConfig - Added full authentication flow example with OpenfortButton - Fixed v5.3.x version to use walletClientToSmartAccountSigner --- docs/pages/sdk/signers/openfort.mdx | 218 +++++++++++++------- docs/pages/sdk/v5_3_x/signers/openfort.mdx | 228 ++++++++++++++------- 2 files changed, 293 insertions(+), 153 deletions(-) diff --git a/docs/pages/sdk/signers/openfort.mdx b/docs/pages/sdk/signers/openfort.mdx index d303323..e208bb0 100644 --- a/docs/pages/sdk/signers/openfort.mdx +++ b/docs/pages/sdk/signers/openfort.mdx @@ -11,103 +11,171 @@ To use Openfort with ZeroDev, first create an application that integrates with O ## Integration -Integrating ZeroDev with Openfort is straightforward after setting up your project. Openfort provides an EIP-1193 compatible provider that can be used as a signer with Kernel. +Integrating ZeroDev with Openfort is straightforward after setting up your project. Openfort's React SDK integrates with Wagmi, providing easy access to wallet clients that can be used as signers with Kernel. -### Create the Openfort client and get the provider +### Install dependencies -After following the Openfort documentation, you will have access to an Openfort client. Here's how to set it up: - -```typescript -import { Openfort } from '@openfort/openfort-js' - -// Initialize Openfort with your keys -const openfort = new Openfort({ - baseConfiguration: { - publishableKey: "YOUR_OPENFORT_PUBLISHABLE_KEY" - }, - shieldConfiguration: { - shieldPublishableKey: "YOUR_SHIELD_PUBLISHABLE_KEY" - } -}) - -// Authenticate the user (e.g., with email, social login, or passkeys) -// See Openfort docs for authentication options +```bash +npm install @openfort/react @zerodev/ecdsa-validator @zerodev/sdk wagmi viem @tanstack/react-query +``` -// Get the EIP-1193 provider -const openfortProvider = await openfort.embeddedWallet.getEthereumProvider() +### Set up providers + +First, configure the Openfort and Wagmi providers in your app: + +```tsx +import React from "react"; +import { + OpenfortProvider, + getDefaultConfig, + AuthProvider, + RecoveryMethod, +} from "@openfort/react"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { WagmiProvider, createConfig } from "wagmi"; +import { polygonAmoy } from "viem/chains"; + +const config = createConfig( + getDefaultConfig({ + appName: "Your App Name", + chains: [polygonAmoy], + }) +); + +const queryClient = new QueryClient(); + +export function Providers({ children }: { children: React.ReactNode }) { + return ( + + + + {children} + + + + ); +} ``` ### Use with ZeroDev -Use the provider from Openfort to create a smart account signer, which can be passed to a validator. For detailed guidance on using a validator, refer to our documentation on [creating accounts](/sdk/core-api/create-account#api). - -```typescript -import { signerToEcdsaValidator } from "@zerodev/ecdsa-validator" -import { KERNEL_V3_1, getEntryPoint } from "@zerodev/sdk/constants" -import { createPublicClient, http } from "viem" -import { polygonAmoy } from 'viem/chains' - -const publicClient = createPublicClient({ - // Use your own RPC provider (e.g. Infura/Alchemy). - transport: http('https://rpc-amoy.polygon.technology'), - chain: polygonAmoy, -}) - -// Pass your Openfort provider to the validator -const ecdsaValidator = await signerToEcdsaValidator(publicClient, { - signer: openfortProvider, - entryPoint: getEntryPoint("0.7"), - kernelVersion: KERNEL_V3_1 -}) +Once a user is authenticated with Openfort, use Wagmi's `useConnectorClient` hook to get the wallet client, which can be passed to ZeroDev's validator: -// You can now use this ECDSA Validator to create a Kernel account -``` - -### Using with Viem +```tsx +import { useConnectorClient } from "wagmi"; +import { signerToEcdsaValidator } from "@zerodev/ecdsa-validator"; +import { KERNEL_V3_1, getEntryPoint } from "@zerodev/sdk/constants"; +import { createPublicClient, http } from "viem"; +import { polygonAmoy } from "viem/chains"; -Openfort's provider is also compatible with Viem's `createWalletClient`: +function ZeroDevAccount() { + const { data: walletClient } = useConnectorClient(); -```typescript -import { createWalletClient, custom } from 'viem' -import { polygonAmoy } from 'viem/chains' - -// Create a wallet client from the Openfort provider -const walletClient = createWalletClient({ - chain: polygonAmoy, - transport: custom(openfortProvider) -}) + const createKernelAccount = async () => { + if (!walletClient) { + throw new Error("Wallet not connected"); + } -// Use the wallet client with ZeroDev -const ecdsaValidator = await signerToEcdsaValidator(publicClient, { - signer: walletClient, - entryPoint: getEntryPoint("0.7"), - kernelVersion: KERNEL_V3_1 -}) + const publicClient = createPublicClient({ + transport: http("https://rpc-amoy.polygon.technology"), + chain: polygonAmoy, + }); + + // Pass the Openfort wallet client to the validator + const ecdsaValidator = await signerToEcdsaValidator(publicClient, { + signer: walletClient, + entryPoint: getEntryPoint("0.7"), + kernelVersion: KERNEL_V3_1, + }); + + // You can now use this ECDSA Validator to create a Kernel account + return ecdsaValidator; + }; + + return ( + + ); +} ``` -## React Integration +### Full example with authentication -If you're using React, Openfort provides hooks for easier integration: +Here's a complete example showing the Openfort authentication flow with ZeroDev integration: -```typescript -import { useOpenfort } from '@openfort/openfort-react' +```tsx +import { OpenfortButton, useOpenfortAuth } from "@openfort/react"; +import { useConnectorClient } from "wagmi"; +import { signerToEcdsaValidator } from "@zerodev/ecdsa-validator"; +import { KERNEL_V3_1, getEntryPoint } from "@zerodev/sdk/constants"; +import { createKernelAccount } from "@zerodev/sdk"; +import { createPublicClient, http } from "viem"; +import { polygonAmoy } from "viem/chains"; function App() { - const { embeddedWallet, user } = useOpenfort() - - const getProvider = async () => { - if (!user) { - throw new Error("User not authenticated") - } - return await embeddedWallet.getEthereumProvider() - } - - // Use the provider with ZeroDev as shown above + const { isAuthenticated } = useOpenfortAuth(); + const { data: walletClient } = useConnectorClient(); + + const setupZeroDev = async () => { + if (!walletClient) return; + + const publicClient = createPublicClient({ + transport: http("https://rpc-amoy.polygon.technology"), + chain: polygonAmoy, + }); + + const ecdsaValidator = await signerToEcdsaValidator(publicClient, { + signer: walletClient, + entryPoint: getEntryPoint("0.7"), + kernelVersion: KERNEL_V3_1, + }); + + const kernelAccount = await createKernelAccount(publicClient, { + plugins: { + sudo: ecdsaValidator, + }, + entryPoint: getEntryPoint("0.7"), + kernelVersion: KERNEL_V3_1, + }); + + console.log("Kernel account address:", kernelAccount.address); + }; + + return ( +
+ {/* OpenfortButton handles authentication UI */} + + + {isAuthenticated && walletClient && ( + + )} +
+ ); } ``` ## Additional Resources - [Openfort Documentation](https://www.openfort.io/docs) +- [Openfort React SDK Guide](https://www.openfort.io/docs/products/embedded-wallet/react) - [Openfort Demo](https://demo.openfort.io/) - [Openfort GitHub](https://github.com/openfort-xyz) diff --git a/docs/pages/sdk/v5_3_x/signers/openfort.mdx b/docs/pages/sdk/v5_3_x/signers/openfort.mdx index c226fa6..2920a68 100644 --- a/docs/pages/sdk/v5_3_x/signers/openfort.mdx +++ b/docs/pages/sdk/v5_3_x/signers/openfort.mdx @@ -15,106 +15,178 @@ To use Openfort with ZeroDev, first create an application that integrates with O ## Integration -Integrating ZeroDev with Openfort is straightforward after setting up your project. Openfort provides an EIP-1193 compatible provider that can be used as a signer with Kernel. +Integrating ZeroDev with Openfort is straightforward after setting up your project. Openfort's React SDK integrates with Wagmi, providing easy access to wallet clients that can be used as signers with Kernel. -### Create the Openfort client and get the provider +### Install dependencies -After following the Openfort documentation, you will have access to an Openfort client. Here's how to set it up: - -```typescript -import { Openfort } from '@openfort/openfort-js' - -// Initialize Openfort with your keys -const openfort = new Openfort({ - baseConfiguration: { - publishableKey: "YOUR_OPENFORT_PUBLISHABLE_KEY" - }, - shieldConfiguration: { - shieldPublishableKey: "YOUR_SHIELD_PUBLISHABLE_KEY" - } -}) - -// Authenticate the user (e.g., with email, social login, or passkeys) -// See Openfort docs for authentication options - -// Get the EIP-1193 provider -const openfortProvider = await openfort.embeddedWallet.getEthereumProvider() +```bash +npm install @openfort/react @zerodev/ecdsa-validator @zerodev/sdk wagmi viem @tanstack/react-query permissionless ``` -### Use with ZeroDev - -Use the provider from Openfort to create a smart account signer, which can be passed to a validator. For detailed guidance on using a validator, refer to our documentation on [creating accounts](/sdk/v5_3_x/core-api/create-account#api). - -```typescript -import { signerToEcdsaValidator } from "@zerodev/ecdsa-validator" -import { KERNEL_V3_1 } from "@zerodev/sdk/constants" -import { providerToSmartAccountSigner, ENTRYPOINT_ADDRESS_V07 } from 'permissionless' -import { createPublicClient, http } from "viem" -import { polygonAmoy } from 'viem/chains' - -const publicClient = createPublicClient({ - // Use your own RPC provider (e.g. Infura/Alchemy). - transport: http('https://rpc-amoy.polygon.technology'), - chain: polygonAmoy, -}) - -// Create a SmartAccountSigner from the Openfort provider -const smartAccountSigner = await providerToSmartAccountSigner(openfortProvider) - -// Pass your smartAccountSigner to the validator -const ecdsaValidator = await signerToEcdsaValidator(publicClient, { - signer: smartAccountSigner, - entryPoint: ENTRYPOINT_ADDRESS_V07, - kernelVersion: KERNEL_V3_1 -}) - -// You can now use this ECDSA Validator to create a Kernel account +### Set up providers + +First, configure the Openfort and Wagmi providers in your app: + +```tsx +import React from "react"; +import { + OpenfortProvider, + getDefaultConfig, + AuthProvider, + RecoveryMethod, +} from "@openfort/react"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { WagmiProvider, createConfig } from "wagmi"; +import { polygonAmoy } from "viem/chains"; + +const config = createConfig( + getDefaultConfig({ + appName: "Your App Name", + chains: [polygonAmoy], + }) +); + +const queryClient = new QueryClient(); + +export function Providers({ children }: { children: React.ReactNode }) { + return ( + + + + {children} + + + + ); +} ``` -### Using with Viem +### Use with ZeroDev -Openfort's provider is also compatible with Viem's `createWalletClient`: +Once a user is authenticated with Openfort, use Wagmi's `useConnectorClient` hook to get the wallet client. For v5.3.x, convert it to a SmartAccountSigner using permissionless: -```typescript -import { createWalletClient, custom } from 'viem' -import { walletClientToSmartAccountSigner } from 'permissionless' -import { polygonAmoy } from 'viem/chains' +```tsx +import { useConnectorClient } from "wagmi"; +import { signerToEcdsaValidator } from "@zerodev/ecdsa-validator"; +import { KERNEL_V3_1 } from "@zerodev/sdk/constants"; +import { walletClientToSmartAccountSigner, ENTRYPOINT_ADDRESS_V07 } from "permissionless"; +import { createPublicClient, http } from "viem"; +import { polygonAmoy } from "viem/chains"; -// Create a wallet client from the Openfort provider -const walletClient = createWalletClient({ - chain: polygonAmoy, - transport: custom(openfortProvider) -}) +function ZeroDevAccount() { + const { data: walletClient } = useConnectorClient(); -// Convert to a SmartAccountSigner -const smartAccountSigner = walletClientToSmartAccountSigner(walletClient) + const createKernelAccount = async () => { + if (!walletClient) { + throw new Error("Wallet not connected"); + } -// Use with ZeroDev as shown above + const publicClient = createPublicClient({ + transport: http("https://rpc-amoy.polygon.technology"), + chain: polygonAmoy, + }); + + // Convert the wallet client to a SmartAccountSigner + const smartAccountSigner = walletClientToSmartAccountSigner(walletClient); + + // Pass the signer to the validator + const ecdsaValidator = await signerToEcdsaValidator(publicClient, { + signer: smartAccountSigner, + entryPoint: ENTRYPOINT_ADDRESS_V07, + kernelVersion: KERNEL_V3_1, + }); + + // You can now use this ECDSA Validator to create a Kernel account + return ecdsaValidator; + }; + + return ( + + ); +} ``` -## React Integration +### Full example with authentication -If you're using React, Openfort provides hooks for easier integration: +Here's a complete example showing the Openfort authentication flow with ZeroDev integration: -```typescript -import { useOpenfort } from '@openfort/openfort-react' +```tsx +import { OpenfortButton, useOpenfortAuth } from "@openfort/react"; +import { useConnectorClient } from "wagmi"; +import { signerToEcdsaValidator } from "@zerodev/ecdsa-validator"; +import { KERNEL_V3_1 } from "@zerodev/sdk/constants"; +import { createKernelAccount } from "@zerodev/sdk"; +import { walletClientToSmartAccountSigner, ENTRYPOINT_ADDRESS_V07 } from "permissionless"; +import { createPublicClient, http } from "viem"; +import { polygonAmoy } from "viem/chains"; function App() { - const { embeddedWallet, user } = useOpenfort() - - const getProvider = async () => { - if (!user) { - throw new Error("User not authenticated") - } - return await embeddedWallet.getEthereumProvider() - } - - // Use the provider with ZeroDev as shown above + const { isAuthenticated } = useOpenfortAuth(); + const { data: walletClient } = useConnectorClient(); + + const setupZeroDev = async () => { + if (!walletClient) return; + + const publicClient = createPublicClient({ + transport: http("https://rpc-amoy.polygon.technology"), + chain: polygonAmoy, + }); + + const smartAccountSigner = walletClientToSmartAccountSigner(walletClient); + + const ecdsaValidator = await signerToEcdsaValidator(publicClient, { + signer: smartAccountSigner, + entryPoint: ENTRYPOINT_ADDRESS_V07, + kernelVersion: KERNEL_V3_1, + }); + + const kernelAccount = await createKernelAccount(publicClient, { + plugins: { + sudo: ecdsaValidator, + }, + entryPoint: ENTRYPOINT_ADDRESS_V07, + kernelVersion: KERNEL_V3_1, + }); + + console.log("Kernel account address:", kernelAccount.address); + }; + + return ( +
+ {/* OpenfortButton handles authentication UI */} + + + {isAuthenticated && walletClient && ( + + )} +
+ ); } ``` ## Additional Resources - [Openfort Documentation](https://www.openfort.io/docs) +- [Openfort React SDK Guide](https://www.openfort.io/docs/products/embedded-wallet/react) - [Openfort Demo](https://demo.openfort.io/) - [Openfort GitHub](https://github.com/openfort-xyz)