aomi-privy-provider
aomi/aomi-privy-providerFreeComponent
Privy-backed Aomi wallet kit provider using Privy's hosted smart wallets (EVM 4337) and Privy's embedded Solana wallets. Bundler, paymaster, and AA implementation are configured in the integrator's Privy dashboard.
Install it
npx shadcn@latest add https://aomi.dev/r/aomi-privy-provider.jsonSource
1"use client";23import {4 useCallback,5 useEffect,6 useMemo,7 useState,8 type ReactNode,9} from "react";10import { serializeSignature, type Chain, type Hex } from "viem";11import type {12 WalletAaSignPayload,13 WalletEip712Payload,14} from "@aomi-labs/react";15import { toViemSignTypedDataArgs } from "@aomi-labs/react";16import { AomiWalletKitComposer } from "../../composer/AomiWalletKitComposer";17import type { AuthRuntime, ExecutionRuntime } from "../../composer/types";18import { useResolvedAccountRuntime } from "../../account/use-resolved-account-runtime";19import { buildEvmExecutionRuntime } from "../../execution/execution-runtime";20import { useAomiWalletNetworkPreferences } from "../../network-preferences";21import { useEvmWalletRuntime } from "../../runtime/evm/wallet-runtime";22import { useSvmWalletRuntime } from "../../runtime/svm/wallet-runtime";23import { REGISTRY_STORAGE_KEY } from "../../registry/types";24import type { AomiAccount, AomiAccountCredential } from "../../types";25import type { AccountConfig, ExecutionConfig } from "../../config/types";26import {27 inferPrivyAuthMethod,28 inferPrivyPrimaryLabel,29 pickPrivyEmbeddedEvmWallet,30 pickPrivyEmbeddedEvmUserWallet,31 privyLoginMethodsToOptions,32 useSafePrivy,33 useSafeSmartWallets,34 useSafeSvmWallets,35 useSafeWallets,36} from "./privy-auth";37import {38 useSign7702Authorization,39 type PrivyClientConfig,40} from "@privy-io/react-auth";41import { buildPrivySvmWalletState } from "./privy-svm";42import { sendPrivySmartWalletTransaction } from "./privy-execution";43import { useEmbeddedSessionSource } from "../sources/embedded-session-source";4445export type AomiPrivyPluginProviderProps = {46 children: ReactNode;47 supportedChains: readonly Chain[];48 loginMethods?: PrivyClientConfig["loginMethods"];49 execution?: ExecutionConfig;50 account?: AccountConfig;51 preferDirectSend?: boolean;52};5354export function AomiPrivyPluginProvider({55 children,56 supportedChains,57 loginMethods,58 execution,59 account,60 preferDirectSend = true,61}: AomiPrivyPluginProviderProps) {62 const privy = useSafePrivy();63 const { client: smartWalletClient, getClientForChain } =64 useSafeSmartWallets();65 const { wallets: solanaWallets } = useSafeSvmWallets();66 const { wallets: connectedWallets } = useSafeWallets();67 const { signAuthorization } = useSign7702Authorization();68 const [activeSolanaAddress, setActiveSolanaAddress] = useState<69 string | undefined70 >();71 const {72 selectedEvmChainId,73 selectedSolanaNetwork,74// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from aomi
All 34 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | aomi | Components | Free | 2 deps | |
| alertalert | aomi | Components | Free | 1 dep | |
| aomi-frameaomi-frame | aomi | Components | Free | 1 dep | |
| aomi-para-provideraomi-para-provider | aomi | Components | Free | 9 deps · 27 files | |
| aomi-wallet-kitaomi-wallet-kit | aomi | Components | Free | 8 deps · 59 files | |
| aomi-widgetaomi-widget | aomi | Components | Free | 2 deps | |
| assistant-threadassistant-thread | aomi | Components | Free | 6 deps · 26 files | |
| assistant-thread-listassistant-thread-list | aomi | Components | Free | 2 deps |
