import { CreateThirdwebClientOptions, ThirdwebClient, Chain as Chain$1 } from 'thirdweb'; import * as thirdweb_chains from 'thirdweb/chains'; import { ChainOptions, Chain, ChainMetadata } from 'thirdweb/chains'; export { Chain, ChainMetadata, ChainOptions } from 'thirdweb/chains'; import * as thirdweb_dist_types_wallets_in_app_core_authentication_types from 'thirdweb/dist/types/wallets/in-app/core/authentication/types'; import { Wallet, Profile } from 'thirdweb/wallets'; export { Wallet as Account, InAppWalletAuth as AccountAuth, InAppWalletConnectionOptions as AccountConnectionOptions, Profile as LinkedAccount } from 'thirdweb/wallets'; import * as react_jsx_runtime from 'react/jsx-runtime'; import { ReactNode } from 'react'; import * as thirdweb_react from 'thirdweb/react'; import { ConnectButtonProps } from 'thirdweb/react'; export { useWalletImage as useAccountAvatar, useWalletBalance as useAccountBalance, useWalletDetailsModal as useAccountDetailsModal, useWalletInfo as useAccountInfo, useActiveAccount, useAutoConnect as useAutoLogin, useConnectedWallets as useConnectedAccounts, useLinkProfile as useLinkAccount, useConnect as useLogin, useConnectModal as useLoginModal, useDisconnect as useLogout, useSetActiveWallet as useSetActiveAccount, useSocialProfiles as useSocialAccounts, useUnlinkProfile as useUnlinkAccount, useProfiles as useUserProfiles } from 'thirdweb/react'; import * as thirdweb_dist_types_chains_types from 'thirdweb/dist/types/chains/types'; type CreatePannaClientOptions = CreateThirdwebClientOptions; type PannaClient = ThirdwebClient; /** * Creates a Panna client using the provided client ID (client-side) or secret key (server-side). * * @param options - Configuration options for the Panna client * @returns The created Panna client. * * @example * ```typescript * // Client-side usage * const client = createPannaClient({ clientId: "your-client-id" }); * * // Server-side usage * const client = createPannaClient({ secretKey: "your-secret-key" }); * ``` */ declare function createPannaClient(options: CreatePannaClientOptions): PannaClient; declare enum EcosystemId { LISK = "ecosystem.lisk" } interface EcosystemConfig { id: EcosystemId; partnerId: string; } /** * Defines a chain with the given options. * @param chainOptions The options for the chain. * @returns The defined chain. * @example * Just pass the chain ID to connect to: * ```ts * const chain = describeChain(1); * ``` * Or pass your own RPC or custom values: * ```ts * const chain = describeChain({ * id: 1, * rpc: "https://my-rpc.com", * nativeCurrency: { * name: "Ether", * symbol: "ETH", * decimals: 18, * }, * }); * ``` * @chain */ declare function describeChain(chainOptions: ChainOptions | number): Chain; /** * Retrieves the RPC URL for the specified chain. * If a custom RPC URL is defined in the options, it will be used. * Otherwise, a thirdweb RPC URL will be constructed using the chain ID and client ID. * @param options - The options object containing the chain and client information. * @returns The RPC URL for the specified chain. * @example * ```ts * import { getRpcUrlForChain } from "thirdweb/chains"; * const rpcUrl = getRpcUrlForChain({ * id: 1, * rpc: "https://my-rpc.com", * nativeCurrency: { * name: "Ether", * symbol: "ETH", * decimals: 18, * }, * }); * console.log(rpcUrl); // "https://1.rpc.thirdweb.com/... * ``` * @chain */ declare function getRpcUrlForChain(chain: Chain): string; /** * Retrieves chain data for a given chain. * @param chain - The chain object containing the chain ID. * @returns A Promise that resolves to the chain data. * @throws If there is an error fetching the chain data. * @example * ```ts * const chainData = await getChainInfo(chain); * console.log(chainData); * ``` * @chain */ declare function getChainInfo(chain: Chain): Promise; /** * @chain */ declare const lisk: Readonly; /** * @chain */ declare const liskSepolia: Readonly; interface AccountBalanceParams { address: string; client: PannaClient; chain: Chain$1; tokenAddress?: string; } interface AccountBalanceResult { value: bigint; decimals: number; symbol: string; name: string; displayValue: string; } type SocialProvider = 'google' | 'apple' | 'facebook' | 'discord' | 'line' | 'x' | 'coinbase' | 'farcaster' | 'telegram' | 'github' | 'twitch' | 'steam' | 'guest' | 'backend' | 'email' | 'phone' | 'passkey' | 'wallet'; declare const LoginStrategy: { readonly EMAIL: "email"; readonly PHONE: "phone"; }; type LoginStrategyType = (typeof LoginStrategy)[keyof typeof LoginStrategy]; interface BaseAuthParams { client: PannaClient; ecosystem: EcosystemConfig; } interface EmailAuthParams extends BaseAuthParams { strategy: typeof LoginStrategy.EMAIL; email: string; verificationCode: string; } interface PhoneAuthParams extends BaseAuthParams { strategy: typeof LoginStrategy.PHONE; phoneNumber: string; verificationCode: string; } interface EmailPrepareParams extends BaseAuthParams { strategy: typeof LoginStrategy.EMAIL; email: string; } interface PhonePrepareParams extends BaseAuthParams { strategy: typeof LoginStrategy.PHONE; phoneNumber: string; } type CreateAccountOptions = { ecosystemId?: EcosystemId | `ecosystem.${string}`; partnerId: string; }; type SingleStepAuthParams = EmailAuthParams | PhoneAuthParams; type MultiStepAuthParams = EmailPrepareParams | PhonePrepareParams; type AuthParams = SingleStepAuthParams | MultiStepAuthParams; /** * Login a user with various authentication methods * @param params - Login parameters including client and authentication method * @returns Authenticated result */ declare function login(params: AuthParams): Promise; /** * Prepare the login process (pre-authentication) * @param params - Parameters including client and authentication details * @returns Pre-authentication result (void) */ declare function prepareLogin(params: EmailPrepareParams | PhonePrepareParams): Promise; /** * Create a new user account (Lisk ecosystem wallet) * @param options - The account configuration options * @param [options.ecosystemId] - The ecosystem ID (defaults to EcosystemId.LISK) * @param options.partnerId - Partner ID for the dApp * @returns New user account */ declare function createAccount({ ecosystemId, partnerId }: CreateAccountOptions): Wallet; /** * Get the user's email address * @param params - Parameters including client and ecosystem configuration * @returns User's email address or undefined if not available */ declare function getEmail(params: { client: PannaClient; ecosystem: { id: EcosystemId; partnerId: string; }; }): Promise; /** * Get the user's phone number * @param params - Parameters including client and ecosystem configuration * @returns User's phone number or undefined if not available */ declare function getPhoneNumber(params: { client: PannaClient; ecosystem: { id: EcosystemId; partnerId: string; }; }): Promise; /** * Link an external account to the user's account * @param params - Parameters including client and authentication method * @returns Updated list of linked profiles */ declare function linkAccount(params: AuthParams): Promise; /** * Get all linked accounts for the current user * @param params - Parameters including client and ecosystem configuration * @returns List of linked accounts */ declare function getLinkedAccounts(params: { client: PannaClient; ecosystem: { id: EcosystemId; partnerId: string; }; }): Promise; /** * Unlink an external account from the user's account * @param params - Parameters including client and profile to unlink * @returns Updated list of profiles */ declare function unlinkAccount(params: { client: PannaClient; profileToUnlink: Profile; ecosystem: { id: EcosystemId; partnerId: string; }; }): Promise; /** * Get the balance of an account * @param params - Parameters for getting account balance * @returns Account balance information */ declare function accountBalance(params: AccountBalanceParams): Promise; /** * Get the icon URI for a social authentication provider * @param provider - The social provider name * @returns The icon URI string */ declare function getSocialIcon(provider: SocialProvider): string; type PannaProviderProps = { children?: ReactNode; clientId?: string; partnerId?: string; }; type PannaContextValue = { client: PannaClient; partnerId: string; }; /** * Framework-agnostic Panna Provider that wraps Thirdweb functionality. * * For SSR frameworks (like Next.js), wrap this component in a client-only boundary * at the application level to prevent hydration mismatches. * * @example * ```tsx * // Framework agnostic usage * * * * * // Next.js App Router - wrap in 'use client' component * 'use client'; * export function ClientProviders({ children }) { * return {children}; * } * ``` */ declare function PannaProvider(props: PannaProviderProps): react_jsx_runtime.JSX.Element; type LoginButtonProps = Omit & { isTesting?: boolean; }; /** * A login button component that connects users to their wallets using the Panna client from context. * * This component must be used within a PannaProvider that provides the Panna client via context. * It automatically configures the Lisk ecosystem wallet and defaults to the Lisk chain. * * @param props - All ConnectButtonProps except 'client' (which comes from PannaProvider context) * @param {boolean} [props.isTesting] - Optional flag to use the testing chain (default is false) * @throws {Error} When used outside of PannaProvider context or when no client is available * * @example * ```tsx * * * * ``` * * @example Custom styling (user styles override defaults) * ```tsx * * ``` */ declare function LoginButton({ connectButton, ...props }: LoginButtonProps): react_jsx_runtime.JSX.Element; /** * Hook to access the Panna context * * @returns The Panna context * @throws {Error} When used outside of PannaProvider context or when no client is available * * @example * ```tsx * function MyComponent() { * const { client, partnerId } = usePanna(); * * // client is guaranteed to be available here * return
Connected with client ID: {client.clientId} and partner ID: {partnerId}
; * } * ``` */ declare function usePanna(): PannaContextValue; /** * Get the supported tokens for a given chain. * @param testingStatus - The testing status * @returns The supported tokens for the given chain */ declare function getSupportedTokens(testingStatus?: boolean | undefined): thirdweb_react.SupportedTokens; /** * Get the chain settings for a given chain. * @param testingStatus - The testing status * @returns The chain settings for the given chain */ declare function getChain(testingStatus?: boolean | undefined): Readonly; /** * Get the account abstraction settings for a given chain. * @param testingStatus - The testing status * @returns The account abstraction settings for the given chain */ declare function getAAChain(testingStatus?: boolean | undefined): Readonly; export { type AccountBalanceParams, type AccountBalanceResult, type AuthParams, type CreatePannaClientOptions, type EcosystemConfig, EcosystemId, type EmailAuthParams, type EmailPrepareParams, LoginButton, type LoginButtonProps, LoginStrategy, type LoginStrategyType, type MultiStepAuthParams, type PannaClient, PannaProvider, type PannaProviderProps, type PhoneAuthParams, type PhonePrepareParams, type SingleStepAuthParams, type SocialProvider, accountBalance, createAccount, createPannaClient, describeChain, getAAChain, getChain, getChainInfo, getEmail, getLinkedAccounts, getPhoneNumber, getRpcUrlForChain as getRPCUrlForChain, getSocialIcon, getSupportedTokens, linkAccount, lisk, liskSepolia, login, prepareLogin, unlinkAccount, usePanna };