import { Address } from 'viem'; import { Connector } from 'wagmi'; import { z } from 'zod'; import { SupportedClientChainId } from '../constants'; import { GraphAuthKitConnector } from '../types'; import { MockGraphAuthKitProviderProps } from './MockGraphAuthKit.context'; declare const BuildMockProviderStateArgs: z.ZodUnion; gatewayApiKey: z.ZodNullable>; status: z.ZodLiteral<"disconnected">; }, z.core.$strip>, z.ZodObject<{ infuraKey: z.ZodReadonly; gatewayApiKey: z.ZodNullable>; status: z.ZodLiteral<"connected">; account: z.ZodUnion; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"provided">; address: z.ZodCustom; chain: z.ZodDefault, z.ZodLiteral<11155111>, z.ZodLiteral<42161>, z.ZodLiteral<421614>]>>>>; connector: z.ZodUnion, z.ZodLiteral<"coinbaseWallet">, z.ZodLiteral<"walletConnect">]>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"multisig">; eoa: z.ZodCustom; network: z.ZodDefault, z.ZodLiteral<11155111>, z.ZodLiteral<42161>]>>>>; }, z.core.$strip>]>; }, z.core.$strip>]>; }, z.core.$strip>]>; export type BuildMockProviderStateArgs = z.infer; /** * Util function to build the correct props and state to setup the `MockGraphAuthKitProvider` * instance to be either connected or disconnected to test components/hooks that rely on the * apps connected state, wagmi hooks, or graph-auth-kit hooks. * * @example Disconnected * ```tsx * import { buildMockProviderState, MockGraphAuthKitProvider } from '@edgeandnode/graph-auth-kit/test-harness' * * const infuraKey = '' * * const { props } = buildMockProviderState({ status: 'disconnected', infuraKey }) * * return ( * * * * ) * ``` * * @example Connected | generated address * ```tsx * import { buildMockProviderState, MockGraphAuthKitProvider } from '@edgeandnode/graph-auth-kit/test-harness' * * const infuraKey = '' * * const { props } = buildMockProviderState({ status: 'connected', infuraKey, account: { type: 'generated' } }) * * return ( * * * * ) * ``` * * @example Connected | provided address | EoA account * ```tsx * import { buildMockProviderState, MockGraphAuthKitProvider } from '@edgeandnode/graph-auth-kit/test-harness' * * const infuraKey = '' * * const { props } = buildMockProviderState({ * status: 'connected', * infuraKey, * account: { * type: 'provided', * address: '0x8c1b521970fDAB85d71260E08ee1dA5Dd878c60D', * chain: 42161, * connector: { type: 'injected' } * } * }) * * return ( * * * * ) * ``` * * @example Connected | provided address | Multisig account * ```tsx * import { buildMockProviderState, MockGraphAuthKitProvider } from '@edgeandnode/graph-auth-kit/test-harness' * * const infuraKey = '' * * const { props } = buildMockProviderState({ * status: 'connected', * infuraKey, * account: { * type: 'provided', * address: '0x177A0331E70e137Fd9f678F19093eA08aD1F5685', * chain: 42161, * connector: { * type: 'multisig', * eoa: '0x8c1b521970fDAB85d71260E08ee1dA5Dd878c60D', * network: 42161 * } * } * }) * * return ( * * * * ) * ``` * * @returns the built MockGraphAuthKitProvider props and connected/disconnected state values */ export declare function buildMockProviderState(args: BuildMockProviderStateArgs): { props: Pick; connectedAddress: Address | null; connector: Connector | null; graphAuthKitConnector: GraphAuthKitConnector | null; chain: SupportedClientChainId | null; }; export declare const disconnectedMockState: { props: Pick; connectedAddress: Address | null; connector: Connector | null; graphAuthKitConnector: GraphAuthKitConnector | null; chain: SupportedClientChainId | null; }; export {}; //# sourceMappingURL=utils.d.ts.map