import * as _tanstack_react_query from '@tanstack/react-query'; import { QueryClient, QueryKey, UseInfiniteQueryOptions, QueryFunction, InfiniteQueryObserverResult, UseMutationOptions, UseMutationResult, MutationFunction, MutationKey, UseQueryOptions, QueryObserverResult } from '@tanstack/react-query'; import { Persister, PersistedClient } from '@tanstack/react-query-persist-client'; import * as _wagmi_core from '@wagmi/core'; import { Provider, WebSocketProvider, ClientConfig, Client as Client$1, GetAccountResult, FetchBalanceResult, FetchBalanceArgs, ConnectArgs, ConnectResult, Signer, FetchSignerResult, FetchSignerArgs, SignMessageArgs, SignMessageResult, SignTypedDataArgs, SignTypedDataResult, SwitchNetworkArgs, SwitchNetworkResult, GetContractResult, GetContractArgs, ReadContractsResult, ReadContractsConfig, ReadContractConfig, ReadContractResult, WriteContractArgs, WriteContractResult, PrepareWriteContractResult, PrepareWriteContractConfig, FetchTokenResult, FetchTokenArgs, FetchEnsAddressArgs, FetchEnsAddressResult, FetchEnsAvatarArgs, FetchEnsAvatarResult, FetchEnsNameArgs, FetchEnsNameResult, FetchEnsResolverArgs, FetchEnsResolverResult, FetchBlockNumberArgs, FetchBlockNumberResult, FetchFeeDataResult, FetchFeeDataArgs, GetProviderArgs, GetWebSocketProviderArgs, PrepareSendTransactionResult, PrepareSendTransactionArgs, SendTransactionResult, SendTransactionArgs, SendTransactionPreparedRequest, SendTransactionUnpreparedRequest, FetchTransactionArgs, FetchTransactionResult, WaitForTransactionArgs, WaitForTransactionResult } from '@wagmi/core'; export { AddChainError, Chain, ChainDoesNotSupportMulticallError, ChainMismatchError, ChainNotConfiguredError, ChainProviderFn, Connector, ConnectorAlreadyConnectedError, ConnectorData, ConnectorEvents, ConnectorNotFoundError, ContractMethodDoesNotExistError, ContractMethodNoResultError, ContractMethodRevertedError, ContractResultDecodeError, ProviderChainsNotFound, ProviderRpcError, ResourceUnavailableError, RpcError, Storage, SwitchChainError, SwitchChainNotSupportedError, Unit, UserRejectedRequestError, alchemyRpcUrls, allChains, chain, chainId, configureChains, createStorage, deepEqual, defaultChains, defaultL2Chains, erc20ABI, erc4626ABI, erc721ABI, etherscanBlockExplorers, infuraRpcUrls, publicRpcUrls, readContracts } from '@wagmi/core'; import * as React from 'react'; import { Address, TypedData, TypedDataToPrimitiveTypes, TypedDataDomain, ResolvedConfig, Abi, ExtractAbiEventNames, ExtractAbiEvent, AbiEvent, Narrow, AbiParametersToPrimitiveTypes } from 'abitype'; export { Address } from 'abitype'; import { BigNumber } from 'ethers'; import * as _wagmi_core_internal from '@wagmi/core/internal'; import { Optional, IsNever, Or, NotEqual, Event, ContractsConfig } from '@wagmi/core/internal'; import * as _ethersproject_providers from '@ethersproject/providers'; declare type CreateClientConfig = ClientConfig & { queryClient?: QueryClient; persister?: Persister | null; }; declare function createClient({ queryClient, persister, ...config }: CreateClientConfig): Client$1 & { queryClient: QueryClient; }; declare type Client = Client$1 & { queryClient: QueryClient; }; declare const Context: React.Context | undefined>; declare type WagmiConfigProps = { /** React-decorated Client instance */ client: Client; }; declare function WagmiConfig({ children, client, }: React.PropsWithChildren>): React.FunctionComponentElement | undefined>>; declare function useClient(): Client; declare type UseAccountConfig = { /** Function to invoke when connected */ onConnect?({ address, connector, isReconnected, }: { address?: GetAccountResult['address']; connector?: GetAccountResult['connector']; isReconnected: boolean; }): void; /** Function to invoke when disconnected */ onDisconnect?(): void; }; declare function useAccount({ onConnect, onDisconnect }?: UseAccountConfig): GetAccountResult<_wagmi_core.Provider>; declare type UseInfiniteQueryResult = Pick, 'data' | 'error' | 'fetchNextPage' | 'fetchStatus' | 'hasNextPage' | 'isError' | 'isFetched' | 'isFetchedAfterMount' | 'isFetching' | 'isFetchingNextPage' | 'isLoading' | 'isRefetching' | 'isSuccess' | 'refetch'> & { isIdle: boolean; status: 'idle' | 'loading' | 'success' | 'error'; internal: Pick; }; declare function useInfiniteQuery(options: UseInfiniteQueryOptions): UseInfiniteQueryResult; declare function useInfiniteQuery(queryKey: TQueryKey, options?: Omit, 'queryKey'>): UseInfiniteQueryResult; declare function useInfiniteQuery(queryKey: TQueryKey, queryFn: QueryFunction, options?: Omit, 'queryKey' | 'queryFn'>): UseInfiniteQueryResult; declare function useMutation(options: UseMutationOptions): UseMutationResult; declare function useMutation(mutationFn: MutationFunction, options?: Omit, 'mutationFn'>): UseMutationResult; declare function useMutation(mutationKey: MutationKey, options?: Omit, 'mutationKey'>): UseMutationResult; declare function useMutation(mutationKey: MutationKey, mutationFn?: MutationFunction, options?: Omit, 'mutationKey' | 'mutationFn'>): UseMutationResult; declare type UseQueryResult = Pick, 'data' | 'error' | 'fetchStatus' | 'isError' | 'isFetched' | 'isFetchedAfterMount' | 'isFetching' | 'isLoading' | 'isRefetching' | 'isSuccess' | 'refetch'> & { isIdle: boolean; status: 'idle' | 'loading' | 'success' | 'error'; internal: Pick; }; declare type DefinedUseQueryResult = Omit, 'data'> & { data: TData; }; declare function useQuery(queryKey: TQueryKey, options?: Omit, 'queryKey' | 'initialData'> & { initialData?: () => undefined; }): UseQueryResult; declare function useQuery(queryKey: TQueryKey, options?: Omit, 'queryKey' | 'initialData'> & { initialData: TQueryFnData | (() => TQueryFnData); }): DefinedUseQueryResult; declare function useQuery(queryKey: TQueryKey, queryFn: QueryFunction, options?: Omit, 'queryKey' | 'queryFn' | 'initialData'> & { initialData?: () => undefined; }): UseQueryResult; declare function useQuery(queryKey: TQueryKey, queryFn: QueryFunction, options?: Omit, 'queryKey' | 'queryFn' | 'initialData'> & { initialData: TQueryFnData | (() => TQueryFnData); }): DefinedUseQueryResult; declare const useQueryClient: () => _tanstack_react_query.QueryClient; declare module 'abitype' { interface Config { BigIntType: BigNumber; IntType: number; } } declare module 'ethers/lib/utils.js' { function getAddress(address: string): Address; function verifyTypedData>(domain: TypedDataDomain, types: TTypedData, value: TSchema[keyof TSchema] extends infer TValue ? { [x: string]: any; } extends TValue ? Record : TValue : never, signature: { r: string; s?: string; _vs?: string; recoveryParam?: number; v?: number; } | ResolvedConfig['BytesType'] | string): string; } declare type QueryConfig = Pick, 'cacheTime' | 'enabled' | 'isDataEqual' | 'keepPreviousData' | 'select' | 'staleTime' | 'structuralSharing' | 'suspense' | 'onError' | 'onSettled' | 'onSuccess'> & { /** Scope the cache to a given context. */ scopeKey?: string; }; declare type InfiniteQueryConfig = Pick, 'cacheTime' | 'enabled' | 'getNextPageParam' | 'isDataEqual' | 'keepPreviousData' | 'select' | 'staleTime' | 'structuralSharing' | 'suspense' | 'onError' | 'onSettled' | 'onSuccess'> & { /** Scope the cache to a given context. */ scopeKey?: string; }; declare type MutationConfig = { /** Function fires if mutation encounters error */ onError?: UseMutationOptions['onError']; /** * Function fires before mutation function and is passed same variables mutation function would receive. * Value returned from this function will be passed to both onError and onSettled functions in event of a mutation failure. */ onMutate?: UseMutationOptions['onMutate']; /** Function fires when mutation is either successfully fetched or encounters error */ onSettled?: UseMutationOptions['onSettled']; /** Function fires when mutation is successful and will be passed the mutation's result */ onSuccess?: UseMutationOptions['onSuccess']; }; declare type UseBalanceArgs = Partial & { /** Subscribe to changes */ watch?: boolean; }; declare type UseBalanceConfig = QueryConfig; declare function useBalance({ address, cacheTime, chainId: chainId_, enabled, formatUnits, scopeKey, staleTime, suspense, token, watch, onError, onSettled, onSuccess, }?: UseBalanceArgs & UseBalanceConfig): UseQueryResult; declare type UseConnectArgs = Partial; declare type UseConnectConfig = MutationConfig; declare function useConnect({ chainId, connector, onError, onMutate, onSettled, onSuccess, }?: UseConnectArgs & UseConnectConfig): { readonly connect: (args?: Partial) => void; readonly connectAsync: (args?: Partial) => Promise>; readonly connectors: _wagmi_core.Connector[]; readonly data: ConnectResult<_wagmi_core.Provider> | undefined; readonly error: Error | null; readonly isError: boolean; readonly isIdle: boolean; readonly isLoading: boolean; readonly isSuccess: boolean; readonly pendingConnector: _wagmi_core.Connector | undefined; readonly reset: () => void; readonly status: "success" | "error" | "loading" | "idle"; readonly variables: ConnectArgs | undefined; }; declare type UseDisconnectConfig = { /** Function to invoke when an error is thrown while connecting. */ onError?: (error: Error, context: unknown) => void | Promise; /** * Function fires before mutation function and is passed same variables mutation function would receive. * Value returned from this function will be passed to both onError and onSettled functions in event of a mutation failure. */ onMutate?: () => unknown; /** Function to invoke when connect is settled (either successfully connected, or an error has thrown). */ onSettled?: (error: Error | null, context: unknown) => void | Promise; /** Function fires when mutation is successful and will be passed the mutation's result */ onSuccess?: (context: unknown) => void | Promise; }; declare function useDisconnect({ onError, onMutate, onSettled, onSuccess, }?: UseDisconnectConfig): { readonly disconnect: _tanstack_react_query.UseMutateFunction; readonly disconnectAsync: _tanstack_react_query.UseMutateAsyncFunction; readonly error: Error | null; readonly isError: boolean; readonly isIdle: boolean; readonly isLoading: boolean; readonly isSuccess: boolean; readonly reset: () => void; readonly status: "success" | "error" | "loading" | "idle"; }; declare function useNetwork(): _wagmi_core.GetNetworkResult; declare type UseSignerConfig = Omit, 'cacheTime' | 'staleTime' | 'enabled'> & FetchSignerArgs; declare function useSigner({ chainId: chainId_, suspense, onError, onSettled, onSuccess, }?: UseSignerConfig): UseQueryResult, Error>; declare type UseSignMessageArgs = Partial; declare type UseSignMessageConfig = MutationConfig; declare function useSignMessage({ message, onError, onMutate, onSettled, onSuccess, }?: UseSignMessageArgs & UseSignMessageConfig): { data: `0x${string}` | undefined; error: Error | null; isError: boolean; isIdle: boolean; isLoading: boolean; isSuccess: boolean; reset: () => void; signMessage: (args?: SignMessageArgs) => void; signMessageAsync: (args?: SignMessageArgs) => Promise<`0x${string}`>; status: "success" | "error" | "loading" | "idle"; variables: SignMessageArgs | undefined; }; declare type UseSignTypedDataArgs = Optional, 'domain' | 'types' | 'value'>; declare type UseSignTypedDataConfig = MutationConfig> & UseSignTypedDataArgs; declare function useSignTypedData({ domain, types, value, onError, onMutate, onSettled, onSuccess, }?: UseSignTypedDataConfig): { data: string | undefined; error: Error | null; isError: boolean; isIdle: boolean; isLoading: boolean; isSuccess: boolean; reset: () => void; signTypedData: (args?: UseSignTypedDataArgs | undefined) => void; signTypedDataAsync: (args?: UseSignTypedDataArgs | undefined) => Promise; status: "success" | "error" | "loading" | "idle"; variables: SignTypedDataArgs | undefined; }; declare type UseSwitchNetworkArgs = Partial; declare type UseSwitchNetworkConfig = MutationConfig & { throwForSwitchChainNotSupported?: boolean; }; declare function useSwitchNetwork({ chainId, throwForSwitchChainNotSupported, onError, onMutate, onSettled, onSuccess, }?: UseSwitchNetworkArgs & UseSwitchNetworkConfig): { readonly chains: _wagmi_core.Chain[]; readonly data: _wagmi_core.Chain | undefined; readonly error: Error | null; readonly isError: boolean; readonly isIdle: boolean; readonly isLoading: boolean; readonly isSuccess: boolean; readonly pendingChainId: number | undefined; readonly reset: () => void; readonly status: "success" | "error" | "loading" | "idle"; readonly switchNetwork: ((chainId_?: SwitchNetworkArgs['chainId']) => void) | undefined; readonly switchNetworkAsync: ((chainId_?: SwitchNetworkArgs['chainId']) => Promise<_wagmi_core.Chain>) | undefined; readonly variables: SwitchNetworkArgs | undefined; }; declare type UseContractConfig = Partial, 'abi' | 'address'>> & { /** Signer or provider to attach to contract */ signerOrProvider?: GetContractArgs['signerOrProvider'] | null; }; declare function useContract({ address, abi, signerOrProvider, }?: UseContractConfig): GetContractResult | null; declare type GetListener = AbiParametersToPrimitiveTypes extends infer TArgs extends readonly unknown[] ? Or, NotEqual> extends true ? { /** * Callback when event is emitted * * Use a [const assertion](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions) on {@link abi} for type inference. */ listener: (...args: any) => void; } : { /** Callback when event is emitted */ listener: (...args: [...args: TArgs, event: Event]) => void; } : never; declare type ContractEventConfig : never> = { /** Contract address */ address?: string; /** Contract ABI */ abi?: Narrow; /** Chain id to use for provider */ chainId?: number; /** Event to listen for */ eventName?: IsNever extends true ? string : TEventName; /** Receive only a single event */ once?: boolean; } & GetListener; declare type GetConfig = T extends { abi: infer TAbi extends Abi; eventName: infer TEventName extends string; } ? ContractEventConfig, ExtractAbiEvent> : T extends { abi: infer TAbi extends readonly unknown[]; eventName: infer TEventName extends string; } ? ContractEventConfig : ContractEventConfig; declare type UseContractEventConfig = GetConfig<{ abi: TAbi; eventName: TEventName; }>; declare function useContractEvent({ address, chainId, abi, listener, eventName, once, }?: UseContractEventConfig): void; declare type UseContractInfiniteReadsConfig = Pick, 'allowFailure' | 'overrides'> & { cacheKey: string; contracts(pageParam: TPageParam): readonly [ ...ContractsConfig ]; } & InfiniteQueryConfig, Error>; declare function useContractInfiniteReads({ allowFailure, cacheKey, cacheTime, contracts, enabled: enabled_, getNextPageParam, isDataEqual, keepPreviousData, onError, onSettled, onSuccess, overrides, scopeKey, select, staleTime, structuralSharing, suspense, }: UseContractInfiniteReadsConfig): UseInfiniteQueryResult, Error>; declare function paginatedIndexesConfig(fn: UseContractInfiniteReadsConfig['contracts'], { perPage, start, direction, }: { perPage: number; start: number; direction: 'increment' | 'decrement'; }): { contracts: UseContractInfiniteReadsConfig['contracts']; getNextPageParam: InfiniteQueryConfig['getNextPageParam']; }; declare type UseContractReadConfig = ReadContractConfig & QueryConfig, Error> & { /** If set to `true`, the cache will depend on the block number */ cacheOnBlock?: boolean; /** Subscribe to changes */ watch?: boolean; }; declare function useContractRead({ abi, address, args, cacheOnBlock, cacheTime, chainId: chainId_, enabled: enabled_, functionName, isDataEqual, onError, onSettled, onSuccess, overrides, scopeKey, select, staleTime, structuralSharing, suspense, watch, }?: UseContractReadConfig): UseQueryResult<_wagmi_core_internal.GetReturnType<{ abi: TAbi; functionName: TFunctionName; }>, Error>; declare type UseContractReadsConfig = ReadContractsConfig & QueryConfig, Error> & { /** If set to `true`, the cache will depend on the block number */ cacheOnBlock?: boolean; /** Subscribe to changes */ watch?: boolean; }; declare function useContractReads({ allowFailure, cacheOnBlock, cacheTime, contracts, enabled: enabled_, isDataEqual, keepPreviousData, onError, onSettled, onSuccess, overrides, scopeKey, select, staleTime, structuralSharing, suspense, watch, }?: UseContractReadsConfig): UseQueryResult, Error>; declare type UseContractWriteArgs = WriteContractArgs; declare type UseContractWriteConfig = MutationConfig & UseContractWriteArgs; declare type UseContractWriteMutationArgs = Mode extends 'prepared' ? undefined : { /** * Recklessly pass through unprepared config. Note: This has * [UX pitfalls](https://wagmi.sh/docs/prepare-hooks/intro#ux-pitfalls-without-prepare-hooks), * it is highly recommended to not use this and instead prepare the config upfront * using the `usePrepareContractWrite` function. */ recklesslySetUnpreparedArgs?: WriteContractArgs['args']; recklesslySetUnpreparedOverrides?: WriteContractArgs['overrides']; }; /** * @description Hook for calling an ethers Contract [write](https://docs.ethers.io/v5/api/contract/contract/#Contract--write) * method. * * It is highly recommended to pair this with the [`usePrepareContractWrite` hook](/docs/prepare-hooks/usePrepareContractWrite) * to [avoid UX pitfalls](https://wagmi.sh/docs/prepare-hooks/intro#ux-pitfalls-without-prepare-hooks). * * @example * import { useContractWrite, usePrepareContractWrite } from 'wagmi' * * const { config } = usePrepareContractWrite({ * address: '0xecb504d39723b0be0e3a9aa33d646642d1051ee1', * abi: wagmigotchiABI, * functionName: 'feed', * }) * const { data, isLoading, isSuccess, write } = useContractWrite(config) * */ declare function useContractWrite({ address, args, chainId, abi, functionName, mode, overrides, request, onError, onMutate, onSettled, onSuccess, }?: UseContractWriteConfig): { data: _wagmi_core.SendTransactionResult | undefined; error: Error | null; isError: boolean; isIdle: boolean; isLoading: boolean; isSuccess: boolean; reset: () => void; status: "success" | "error" | "loading" | "idle"; variables: UseContractWriteArgs | undefined; write: ((overrideConfig?: UseContractWriteMutationArgs) => void) | undefined; writeAsync: ((overrideConfig?: UseContractWriteMutationArgs) => Promise<_wagmi_core.SendTransactionResult>) | undefined; }; declare type UsePrepareContractWriteConfig = PrepareWriteContractConfig & QueryConfig, Error>; /** * @description Hook for preparing a contract write to be sent via [`useContractWrite`](/docs/hooks/useContractWrite). * * Eagerly fetches the parameters required for sending a contract write transaction such as the gas estimate. * * @example * import { useContractWrite, usePrepareContractWrite } from 'wagmi' * * const { config } = usePrepareContractWrite({ * address: '0xecb504d39723b0be0e3a9aa33d646642d1051ee1', * abi: wagmigotchiABI, * functionName: 'feed', * }) * const { data, isLoading, isSuccess, write } = useContractWrite(config) * */ declare function usePrepareContractWrite({ address, abi, functionName, chainId, args, overrides, cacheTime, enabled, scopeKey, staleTime, suspense, onError, onSettled, onSuccess, }?: UsePrepareContractWriteConfig): Pick<_tanstack_react_query.QueryObserverResult, Error>, "data" | "error" | "isError" | "isLoading" | "isSuccess" | "isFetched" | "isFetchedAfterMount" | "isFetching" | "isRefetching" | "refetch" | "fetchStatus"> & { isIdle: boolean; status: "success" | "error" | "loading" | "idle"; internal: Pick<_tanstack_react_query.QueryObserverResult, "isLoadingError" | "isRefetchError" | "dataUpdatedAt" | "errorUpdatedAt" | "failureCount" | "isPaused" | "isPlaceholderData" | "isPreviousData" | "isStale" | "remove">; } & { config: PrepareWriteContractResult; }; declare type UseTokenArgs = Partial; declare type UseTokenConfig = QueryConfig; declare function useToken({ address, chainId: chainId_, formatUnits, cacheTime, enabled, scopeKey, staleTime, // 24 hours suspense, onError, onSettled, onSuccess, }?: UseTokenArgs & UseTokenConfig): UseQueryResult; declare type UseEnsAddressArgs = Partial; declare type UseEnsAddressConfig = QueryConfig; declare function useEnsAddress({ cacheTime, chainId: chainId_, enabled, name, scopeKey, staleTime, // 24 hours suspense, onError, onSettled, onSuccess, }?: UseEnsAddressArgs & UseEnsAddressConfig): UseQueryResult<`0x${string}` | null, Error>; declare type UseEnsAvatarArgs = Partial; declare type UseEnsLookupConfig = QueryConfig; declare function useEnsAvatar({ address, cacheTime, chainId: chainId_, enabled, scopeKey, staleTime, // 24 hours suspense, onError, onSettled, onSuccess, }?: UseEnsAvatarArgs & UseEnsLookupConfig): UseQueryResult; declare type UseEnsNameArgs = Partial; declare type UseEnsNameConfig = QueryConfig; declare function useEnsName({ address, cacheTime, chainId: chainId_, enabled, scopeKey, staleTime, // 24 hours suspense, onError, onSettled, onSuccess, }?: UseEnsNameArgs & UseEnsNameConfig): UseQueryResult; declare type UseEnsResolverArgs = Partial; declare type UseEnsResolverConfig = QueryConfig; declare function useEnsResolver({ cacheTime, chainId: chainId_, name, enabled, scopeKey, staleTime, // 24 hours suspense, onError, onSettled, onSuccess, }?: UseEnsResolverArgs & UseEnsResolverConfig): UseQueryResult<_ethersproject_providers.Resolver | null, Error>; declare type UseBlockNumberArgs = Partial & { /** Function fires when a new block is created */ onBlock?: (blockNumber: number) => void; /** Subscribe to changes */ watch?: boolean; }; declare type UseBlockNumberConfig = QueryConfig; declare function useBlockNumber({ cacheTime, chainId: chainId_, enabled, scopeKey, staleTime, suspense, watch, onBlock, onError, onSettled, onSuccess, }?: UseBlockNumberArgs & UseBlockNumberConfig): UseQueryResult; declare type UseFeeDataArgs = Partial & { /** Subscribe to changes */ watch?: boolean; }; declare type UseFeedDataConfig = QueryConfig; declare function useFeeData({ cacheTime, chainId: chainId_, enabled, formatUnits, scopeKey, staleTime, suspense, watch, onError, onSettled, onSuccess, }?: UseFeeDataArgs & UseFeedDataConfig): UseQueryResult; declare type UseProviderArgs = Partial; declare function useProvider({ chainId, }?: UseProviderArgs): TProvider; declare type UseWebSocketProviderArgs = Partial; declare function useWebSocketProvider({ chainId }?: UseWebSocketProviderArgs): _wagmi_core.GetWebSocketProviderResult; declare type UsePrepareSendTransactionConfig = Partial & QueryConfig; /** * @description Hook for preparing a transaction to be sent via [`useSendTransaction`](/docs/hooks/useSendTransaction). * * Eagerly fetches the parameters required for sending a transaction such as the gas estimate and resolving an ENS address (if required). * * @example * import { useSendTransaction, usePrepareSendTransaction } from 'wagmi' * * const config = usePrepareSendTransaction({ * to: 'moxey.eth', * value: parseEther('1'), * }) * const result = useSendTransaction(config) */ declare function usePrepareSendTransaction({ chainId, request, cacheTime, enabled, scopeKey, staleTime, // 24 hours suspense, onError, onSettled, onSuccess, }?: UsePrepareSendTransactionConfig): Pick<_tanstack_react_query.QueryObserverResult, "data" | "error" | "isError" | "isLoading" | "isSuccess" | "isFetched" | "isFetchedAfterMount" | "isFetching" | "isRefetching" | "refetch" | "fetchStatus"> & { isIdle: boolean; status: "success" | "error" | "loading" | "idle"; internal: Pick<_tanstack_react_query.QueryObserverResult, "isLoadingError" | "isRefetchError" | "dataUpdatedAt" | "errorUpdatedAt" | "failureCount" | "isPaused" | "isPlaceholderData" | "isPreviousData" | "isStale" | "remove">; } & { config: PrepareSendTransactionResult; }; declare type UseSendTransactionArgs = Omit & ({ /** * `recklesslyUnprepared`: Allow to pass through an unprepared `request`. Note: This has * [UX pitfalls](https://wagmi.sh/docs/prepare-hooks/intro#ux-pitfalls-without-prepare-hooks), it * is highly recommended to not use this and instead prepare the request upfront * using the `usePrepareSendTransaction` hook. * * `prepared`: The request has been prepared with parameters required for sending a transaction * via the [`usePrepareSendTransaction` hook](https://wagmi.sh/docs/prepare-hooks/usePrepareSendTransaction) * */ mode: 'prepared'; /** The prepared request to send the transaction. */ request: SendTransactionPreparedRequest['request'] | undefined; } | { mode: 'recklesslyUnprepared'; /** The unprepared request to send the transaction. */ request?: SendTransactionUnpreparedRequest['request']; }); declare type UseSendTransactionMutationArgs = { /** * Recklessly pass through an unprepared `request`. Note: This has * [UX pitfalls](https://wagmi.sh/docs/prepare-hooks/intro#ux-pitfalls-without-prepare-hooks), it is * highly recommended to not use this and instead prepare the request upfront * using the `usePrepareSendTransaction` hook. */ recklesslySetUnpreparedRequest: SendTransactionUnpreparedRequest['request']; }; declare type UseSendTransactionConfig = MutationConfig; declare type SendTransactionFn = (overrideConfig?: UseSendTransactionMutationArgs) => void; declare type SendTransactionAsyncFn = (overrideConfig?: UseSendTransactionMutationArgs) => Promise; declare type MutateFnReturnValue = Args extends { mode: 'recklesslyUnprepared'; } ? Fn : Fn | undefined; /** * @description Hook for sending a transaction. * * It is recommended to pair this with the [`usePrepareSendTransaction` hook](/docs/prepare-hooks/usePrepareSendTransaction) * to [avoid UX pitfalls](https://wagmi.sh/docs/prepare-hooks/intro#ux-pitfalls-without-prepare-hooks). * * @example * import { useSendTransaction, usePrepareSendTransaction } from 'wagmi' * * const config = usePrepareSendTransaction({ * request: { * to: 'moxey.eth', * value: parseEther('1'), * } * }) * const result = useSendTransaction(config) */ declare function useSendTransaction({ chainId, mode, request, onError, onMutate, onSettled, onSuccess, }: Args & UseSendTransactionConfig): { data: SendTransactionResult | undefined; error: Error | null; isError: boolean; isIdle: boolean; isLoading: boolean; isSuccess: boolean; reset: () => void; sendTransaction: MutateFnReturnValue; sendTransactionAsync: MutateFnReturnValue; status: "success" | "error" | "loading" | "idle"; variables: SendTransactionArgs | undefined; }; declare type UseTransactionArgs = Partial; declare type UseTransactionConfig = QueryConfig; /** * @description Fetches transaction for hash * * @example * import { useTransaction } from 'wagmi' * * const result = useTransaction({ * chainId: 1, * hash: '0x...', * }) */ declare function useTransaction({ cacheTime, chainId: chainId_, enabled, hash, scopeKey, staleTime, suspense, onError, onSettled, onSuccess, }?: UseTransactionArgs & UseTransactionConfig): UseQueryResult<_ethersproject_providers.TransactionResponse, Error>; declare type UseWaitForTransactionArgs = Partial; declare type UseWaitForTransactionConfig = QueryConfig; declare function useWaitForTransaction({ chainId: chainId_, confirmations, hash, timeout, wait, cacheTime, enabled, scopeKey, staleTime, suspense, onError, onSettled, onSuccess, }?: UseWaitForTransactionArgs & UseWaitForTransactionConfig): UseQueryResult<_ethersproject_providers.TransactionReceipt, Error>; declare function deserialize(cachedString: string): PersistedClient; declare type StandardReplacer = (key: string, value: any) => any; declare type CircularReplacer = (key: string, value: any, referenceKey: string) => any; /** * @function stringify * * @description * stringifier that handles circular values * Forked from https://github.com/planttheidea/fast-stringify * * @param value to stringify * @param [replacer] a custom replacer function for handling standard values * @param [indent] the number of spaces to indent the output by * @param [circularReplacer] a custom replacer function for handling circular values * @returns the stringified output */ declare function serialize(value: any, replacer?: StandardReplacer | null | undefined, indent?: number | null | undefined, circularReplacer?: CircularReplacer | null | undefined): string; export { Client, Context, CreateClientConfig, WagmiConfig, WagmiConfigProps, createClient, deserialize, paginatedIndexesConfig, serialize, useAccount, useBalance, useBlockNumber, useClient, useConnect, useContract, useContractEvent, useContractInfiniteReads, useContractRead, useContractReads, useContractWrite, useDisconnect, useEnsAddress, useEnsAvatar, useEnsName, useEnsResolver, useFeeData, useInfiniteQuery, useMutation, useNetwork, usePrepareContractWrite, usePrepareSendTransaction, useProvider, useQuery, useQueryClient, useSendTransaction, useSignMessage, useSignTypedData, useSigner, useSwitchNetwork, useToken, useTransaction, useWaitForTransaction, useWebSocketProvider };