import { EnsResolverConfig } from '@edgeandnode/ens'; import { Dispatch, ReactNode } from 'react'; import { Address } from 'viem'; import { Config, Connector, ResolvedRegister } from 'wagmi'; import { z } from 'zod'; import { SignerError } from '../errors'; import { SafeSupportedNetworks } from '../safe'; import { OptionalGatewayApiKey, RequiredInfuraKey } from '../types'; export declare const GraphAuthKitModalState: readonly ["primary", "safe_entry", "safe_eoa_signer"]; export type GraphAuthKitModalState = (typeof GraphAuthKitModalState)[number]; export declare const MultisigSchema: z.ZodObject<{ network: z.ZodCustom<1 | 11155111 | 42161, 1 | 11155111 | 42161>; address: z.ZodString; enteredSafeIsValid: z.ZodOptional; }, z.core.$strip>; export type MultisigSchema = z.infer; export type GraphAuthKitInnerState = { /** Infura key passed down from the top-level provider/app */ _infuraKey: RequiredInfuraKey['infuraKey']; /** Gateway API key passed down from the top-level provider/app */ _gatewayApiKey: OptionalGatewayApiKey['gatewayApiKey']; /** Safe API key passed down from the top-level provider/app */ _safeApiKey?: string; /** Access to a EnsResolverConfig instance. */ _ensResolver: EnsResolverConfig; /** The ConnectModal open state */ _connectModalOpen: boolean; /** Open/close the ConnectModal */ _setConnectModalOpen: Dispatch; /** * The ConnectModal title to display. * @default "Connect your wallet" */ _modalTitle: ReactNode; _setModalTitle: Dispatch; /** The ConnectModal subtitle to display */ _modalSubtitle?: ReactNode; _setModalSubtitle: Dispatch; /** Allows the `GraphAuthKit` to set the URL to set after the user connects */ _setAfterConnectUrl: Dispatch; /** * Which Wallet connect options to display based off the current ConnectModal state. * - 'primary' -> display the primary wallet connect options * - 'safe_entry' -> the user selected to connect via their Safe multisig. Display the multisig entry form * - 'safe_eoa_signer' -> let the user connect their EoA that is a signer on their entered safe * @default primary */ _modalState: GraphAuthKitModalState; /** Set the current modal state of which page in the modal to display */ _setModalState: Dispatch; /** * If the user is authenticating with a Safe, this is the entered Safe information. * @default null */ _enteredMultisigInfo?: MultisigSchema; _setSafeInfo: Dispatch; /** * The user has selected a Wallet connector option and is currently authenticating. * If true, displays a loading indicator in the modal */ _authenticating: boolean; _setAuthenticating: Dispatch; /** If the connection fails, display the error message */ _connectFailureMessage?: SignerError; /** Takes the wallet connector the user selected in the modal and connects the user to the wagmi context */ _connect(connector: Connector): void | Promise; /** * If the user is connecting via a Safe multisig, take their EoA signer, connect it, * and connect the Safe instance to the wagmi context. */ _connectMultisig(params: { connector: Connector; network: SafeSupportedNetworks; address: Address; }): void | Promise; /** The user has disconnected their wallet. Reset the state. */ _reset(): void; }; export declare const defInnerState: { readonly _infuraKey: ""; readonly _gatewayApiKey: null; readonly _safeApiKey: undefined; readonly _ensResolver: { readonly resolveEnsName: () => Promise; readonly resolveEnsNamesBatch: () => Promise<{}>; readonly resolveAvatar: () => Promise; readonly resolveAvatarsBatch: () => Promise<{}>; }; readonly _connectModalOpen: false; readonly _setConnectModalOpen: () => void; readonly _modalTitle: "Connect your wallet"; readonly _setModalTitle: () => void; readonly _setModalSubtitle: () => void; readonly _setAfterConnectUrl: () => void; readonly _modalState: "primary"; readonly _setModalState: () => void; readonly _setSafeInfo: () => void; readonly _authenticating: false; readonly _setAuthenticating: () => void; readonly _connect: () => void; readonly _connectMultisig: () => void; readonly _reset: () => void; }; export declare const GraphAuthKitInnerContext: import('react').Context; /** * We expose a minimal GraphAuthKit context state exported from this library. * That way the implementer only uses the `useGraphAuthKit` hook to open/close the connect modal. * Wagmi hooks should be used for all other wagmi connected auth state. * This hook is not exported from this library, but is used in the ConnectModal internals * to control the state of the modal itself. */ export declare function useGraphAuthKitInnerContext(): GraphAuthKitInnerState; export type GraphAuthKitInnerContextProviderProps = Readonly<{ config: config; infuraKey: RequiredInfuraKey['infuraKey']; gatewayApiKey: OptionalGatewayApiKey['gatewayApiKey']; safeApiKey?: string; children: ReactNode; }>; export declare function GraphAuthKitInnerContextProvider({ config, infuraKey, gatewayApiKey, safeApiKey, children, }: GraphAuthKitInnerContextProviderProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=GraphAuthKitInner.context.d.ts.map