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 } from '@tanstack/react-query-persist-client'; import * as _wagmi_core from '@wagmi/core'; import { PublicClient, WebSocketPublicClient, CreateConfigParameters as CreateConfigParameters$1, Config as Config$1, GetAccountResult, FetchBalanceResult, FetchBalanceArgs, ConnectArgs, ConnectResult, SignMessageArgs, SignMessageResult, SignTypedDataArgs, SignTypedDataResult, SwitchNetworkResult, SwitchNetworkArgs, WatchContractEventConfig, WatchContractEventCallback, ReadContractsResult, ReadContractsConfig, ReadContractResult, ReadContractConfig, WriteContractMode, WriteContractResult, WriteContractUnpreparedArgs, PrepareWriteContractResult, WalletClient, PrepareWriteContractConfig, FetchTokenResult, FetchTokenArgs, FetchEnsAddressArgs, FetchEnsAddressResult, FetchEnsAvatarArgs, FetchEnsAvatarResult, FetchEnsNameArgs, FetchEnsNameResult, FetchEnsResolverArgs, FetchEnsResolverResult, FetchBlockNumberArgs, FetchBlockNumberResult, FetchFeeDataResult, FetchFeeDataArgs, GetPublicClientArgs, GetWalletClientResult, GetWalletClientArgs, GetWebSocketPublicClientArgs, PrepareSendTransactionResult, PrepareSendTransactionArgs, SendTransactionResult, SendTransactionArgs, FetchTransactionArgs, FetchTransactionResult, WaitForTransactionArgs, WaitForTransactionResult, WatchPendingTransactionsCallback } from '@wagmi/core'; export { ChainMismatchError, ChainNotConfiguredError, ChainProviderFn, ConfigChainsNotFound, Connector, ConnectorAlreadyConnectedError, ConnectorData, ConnectorEvents, ConnectorNotFoundError, PublicClient, Storage, SwitchChainNotSupportedError, Unit, WalletClient, WebSocketPublicClient, WindowProvider, configureChains, createStorage, deepEqual, deserialize, erc20ABI, erc4626ABI, erc721ABI, readContracts, serialize } from '@wagmi/core'; import * as React from 'react'; import * as abitype from 'abitype'; import { TypedData, Abi, Narrow } from 'abitype'; import { Never } from '@wagmi/core/internal'; import * as viem from 'viem'; import { ContractFunctionConfig, MulticallContracts, SendTransactionParameters, GetFunctionArgs } from 'viem'; export { Address } from 'viem'; export { Chain, mainnet, sepolia } from 'viem/chains'; type CreateConfigParameters = CreateConfigParameters$1 & { queryClient?: QueryClient; persister?: Persister | null; }; declare function createConfig({ queryClient, storage, persister, ...args }: CreateConfigParameters): Config$1 & { queryClient: QueryClient; }; type Config = Config$1 & { queryClient: QueryClient; }; declare const Context: React.Context | undefined>; type WagmiConfigProps = { /** React-decorated Client instance */ config: Config; }; declare function WagmiConfig({ children, config, }: React.PropsWithChildren>): React.FunctionComponentElement | undefined>>; declare function useConfig(): Config; 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; 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; type UseQueryResult = Pick, 'data' | 'error' | 'fetchStatus' | 'isError' | 'isFetched' | 'isFetchedAfterMount' | 'isFetching' | 'isLoading' | 'isRefetching' | 'isSuccess' | 'refetch'> & { isIdle: boolean; status: 'idle' | 'loading' | 'success' | 'error'; internal: Pick; }; 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; type UseChainIdArgs = { chainId?: number; }; declare function useChainId({ chainId }?: UseChainIdArgs): number; /** * Makes {@link TKeys} optional in {@link TType} while preserving type inference. */ type PartialBy = Partial> & Omit; type DeepPartial = Depth['length'] extends MaxDepth ? T : T extends object ? { [P in keyof T]?: DeepPartial; } : T; type QueryConfig = Pick, 'cacheTime' | 'enabled' | 'isDataEqual' | 'staleTime' | 'structuralSharing' | 'suspense' | 'onError' | 'onSettled' | 'onSuccess'> & { /** Scope the cache to a given context. */ scopeKey?: string; }; type QueryConfigWithSelect = Pick, 'cacheTime' | 'enabled' | 'isDataEqual' | 'select' | 'staleTime' | 'structuralSharing' | 'suspense' | 'onError' | 'onSettled' | 'onSuccess'> & { /** Scope the cache to a given context. */ scopeKey?: string; }; type InfiniteQueryConfig = Pick, 'cacheTime' | 'enabled' | 'getNextPageParam' | 'isDataEqual' | 'keepPreviousData' | 'select' | 'staleTime' | 'structuralSharing' | 'suspense' | 'onError' | 'onSettled' | 'onSuccess'> & { /** Scope the cache to a given context. */ scopeKey?: string; }; 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']; }; type UseBalanceArgs = Partial & { /** Subscribe to changes */ watch?: boolean; }; type UseBalanceConfig = QueryConfig; declare function useBalance({ address, cacheTime, chainId: chainId_, enabled, formatUnits, scopeKey, staleTime, suspense, token, watch, onError, onSettled, onSuccess, }?: UseBalanceArgs & UseBalanceConfig): UseQueryResult; type UseConnectArgs = Partial; 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.PublicClient> | 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: "error" | "success" | "loading" | "idle"; readonly variables: ConnectArgs | undefined; }; 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: "error" | "success" | "loading" | "idle"; }; declare function useNetwork(): _wagmi_core.GetNetworkResult; type UseSignMessageArgs = Partial; 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: "error" | "success" | "loading" | "idle"; variables: SignMessageArgs | undefined; }; type UseSignTypedDataArgs = Partial>> | SignTypedDataArgs; type UseSignTypedDataConfig = MutationConfig> & UseSignTypedDataArgs; declare function useSignTypedData({ domain, types, message, primaryType, onError, onMutate, onSettled, onSuccess, }?: UseSignTypedDataConfig): { data: `0x${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<`0x${string}`>; status: "error" | "success" | "loading" | "idle"; variables: SignTypedDataArgs | undefined; }; type UseSwitchNetworkArgs = Partial; type UseSwitchNetworkConfig = MutationConfig & { throwForSwitchChainNotSupported?: boolean; }; declare function useSwitchNetwork({ chainId, throwForSwitchChainNotSupported, onError, onMutate, onSettled, onSuccess, }?: UseSwitchNetworkArgs & UseSwitchNetworkConfig): { readonly chains: _wagmi_core.Chain[]; readonly data: SwitchNetworkResult | 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: "error" | "success" | "loading" | "idle"; readonly switchNetwork: ((chainId_?: SwitchNetworkArgs['chainId']) => void) | undefined; readonly switchNetworkAsync: ((chainId_?: SwitchNetworkArgs['chainId']) => Promise) | undefined; readonly variables: SwitchNetworkArgs | undefined; }; type UseContractEventConfig = PartialBy, 'abi' | 'address' | 'eventName'> & { listener: WatchContractEventCallback; }; declare function useContractEvent({ address, chainId, abi, listener, eventName, }?: UseContractEventConfig): (() => void) | undefined; type UseContractInfiniteReadsConfig> = Pick, 'allowFailure'> & { cacheKey: string; contracts(pageParam: TPageParam): Narrow ]>; } & InfiniteQueryConfig, Error, TSelectData> & ({ /** Block number to read against. */ blockNumber?: ReadContractsConfig['blockNumber']; blockTag?: never; watch?: never; } | { blockNumber?: never; /** Block tag to read against. */ blockTag?: ReadContractsConfig['blockTag']; watch?: never; } | { blockNumber?: never; blockTag?: never; /** Refresh on incoming blocks. */ watch?: boolean; }); declare function useContractInfiniteReads>({ allowFailure, blockNumber, blockTag, cacheKey, cacheTime, contracts, enabled: enabled_, getNextPageParam, isDataEqual, keepPreviousData, onError, onSettled, onSuccess, scopeKey, select, staleTime, structuralSharing, suspense, }: UseContractInfiniteReadsConfig): UseInfiniteQueryResult; declare function paginatedIndexesConfig>(fn: UseContractInfiniteReadsConfig['contracts'], { perPage, start, direction, }: { perPage: number; start: number; direction: 'increment' | 'decrement'; }): { contracts: UseContractInfiniteReadsConfig['contracts']; getNextPageParam: InfiniteQueryConfig['getNextPageParam']; }; type UseContractReadConfig> = PartialBy, 'abi' | 'address' | 'args' | 'blockNumber' | 'blockTag' | 'functionName'> & QueryConfigWithSelect, Error, TSelectData> & { /** If set to `true`, the cache will depend on the block number */ cacheOnBlock?: boolean; /** Set this to `true` to keep the previous data when fetching based on a new query key. Defaults to `false`. */ keepPreviousData?: boolean; } & ({ /** Block number to read against. */ blockNumber?: ReadContractConfig['blockNumber']; blockTag?: never; watch?: never; } | { blockNumber?: never; /** Block tag to read against. */ blockTag?: ReadContractConfig['blockTag']; watch?: never; } | { blockNumber?: never; blockTag?: never; /** Refresh on incoming blocks. */ watch?: boolean; }); declare function useContractRead>({ abi, address, account, args, blockNumber: blockNumberOverride, blockTag, cacheOnBlock, cacheTime, chainId: chainId_, enabled: enabled_, functionName, isDataEqual, keepPreviousData, onError, onSettled, onSuccess, scopeKey, select, staleTime, structuralSharing, suspense, watch, }?: UseContractReadConfig): UseQueryResult; type UseContractReadsConfig, Config = ReadContractsConfig> = { [K in keyof Config]?: K extends 'contracts' ? DeepPartial : Config[K]; } & QueryConfigWithSelect, Error, TSelectData> & { /** If set to `true`, the cache will depend on the block number */ cacheOnBlock?: boolean; /** Set this to `true` to keep the previous data when fetching based on a new query key. Defaults to `false`. */ keepPreviousData?: boolean; } & ({ /** Block number to read against. */ blockNumber?: ReadContractsConfig['blockNumber']; blockTag?: never; watch?: never; } | { blockNumber?: never; /** Block tag to read against. */ blockTag?: ReadContractsConfig['blockTag']; watch?: never; } | { blockNumber?: never; blockTag?: never; /** Refresh on incoming blocks. */ watch?: boolean; }); declare function useContractReads>({ allowFailure: allowFailure_, blockNumber: blockNumberOverride, blockTag, cacheOnBlock, cacheTime, contracts, enabled: enabled_, isDataEqual, keepPreviousData, onError, onSettled, onSuccess, scopeKey, select, staleTime, structuralSharing, suspense, watch, }?: UseContractReadsConfig): UseQueryResult; type UseContractWritePreparedArgs = Partial, 'request'>> & { abi?: never; accessList?: never; account?: never; address?: never; args?: never; chainId?: never; dataSuffix?: never; functionName?: never; gas?: never; gasPrice?: never; maxFeePerGas?: never; maxPriorityFeePerGas?: never; nonce?: never; value?: never; }; type UseContractWriteUnpreparedArgs = PartialBy, 'args'>, 'abi' | 'address' | 'functionName'> & Partial> & { request?: never; }; type UseContractWriteArgs = { mode?: TMode; } & (TMode extends 'prepared' ? UseContractWritePreparedArgs : UseContractWriteUnpreparedArgs); type UseContractWriteConfig = MutationConfig> & UseContractWriteArgs; /** * @description Hook for calling a contract nonpayable or payable function. * * It is highly recommended to pair this with the [`usePrepareContractWrite` hook](/docs/prepare-hooks/usePrepareContractWrite) * to [avoid UX pitfalls](https://wagmi.sh/react/prepare-hooks#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(config: UseContractWriteConfig): { data: WriteContractResult | undefined; error: Error | null; isError: boolean; isIdle: boolean; isLoading: boolean; isSuccess: boolean; reset: () => void; status: "error" | "success" | "loading" | "idle"; variables: UseContractWriteArgs | undefined; write: MutationFn; writeAsync: MutationFn>; }; type MutationFnArgs = Omit & { args?: WriteContractUnpreparedArgs extends { args: unknown; } ? WriteContractUnpreparedArgs['args'] : unknown; }; type MutationFn = TMode extends 'prepared' ? (() => TReturnType) | undefined : (config?: MutationFnArgs) => TReturnType; type UsePrepareContractWriteConfig = PartialBy, 'args'>, 'abi' | 'address' | 'functionName'> & Partial> & 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, cacheTime, dataSuffix, enabled, scopeKey, staleTime, suspense, onError, onSettled, onSuccess, ...config }?: UsePrepareContractWriteConfig): Pick<_tanstack_react_query.QueryObserverResult, Error>, "data" | "error" | "isError" | "isLoading" | "isSuccess" | "isFetched" | "isFetchedAfterMount" | "isFetching" | "isRefetching" | "refetch" | "fetchStatus"> & { isIdle: boolean; status: "error" | "success" | "loading" | "idle"; internal: Pick<_tanstack_react_query.QueryObserverResult, "isLoadingError" | "isRefetchError" | "dataUpdatedAt" | "errorUpdatedAt" | "failureCount" | "isPaused" | "isPlaceholderData" | "isPreviousData" | "isStale" | "remove">; } & { config: PrepareWriteContractResult; }; type UseTokenArgs = Partial; type UseTokenConfig = QueryConfig; declare function useToken({ address, chainId: chainId_, formatUnits, cacheTime, enabled, scopeKey, staleTime, // 24 hours suspense, onError, onSettled, onSuccess, }?: UseTokenArgs & UseTokenConfig): UseQueryResult; type UseEnsAddressArgs = Omit, 'name'> & { name?: FetchEnsAddressArgs['name'] | null; }; 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>; type UseEnsAvatarArgs = Omit, 'name'> & { name?: FetchEnsAvatarArgs['name'] | null; }; type UseEnsLookupConfig = QueryConfig; declare function useEnsAvatar({ cacheTime, chainId: chainId_, enabled, name, scopeKey, staleTime, // 24 hours suspense, onError, onSettled, onSuccess, }?: UseEnsAvatarArgs & UseEnsLookupConfig): UseQueryResult; type UseEnsNameArgs = Partial; type UseEnsNameConfig = QueryConfig; declare function useEnsName({ address, cacheTime, chainId: chainId_, enabled, scopeKey, staleTime, // 24 hours suspense, onError, onSettled, onSuccess, }?: UseEnsNameArgs & UseEnsNameConfig): UseQueryResult; type UseEnsResolverArgs = Omit, 'name'> & { name?: FetchEnsResolverArgs['name'] | null; }; type UseEnsResolverConfig = QueryConfig; declare function useEnsResolver({ chainId: chainId_, name, enabled, scopeKey, suspense, onError, onSettled, onSuccess, }?: UseEnsResolverArgs & UseEnsResolverConfig): UseQueryResult<`0x${string}`, Error>; type UseBlockNumberArgs = Partial & { /** Function fires when a new block is created */ onBlock?: (blockNumber: bigint) => void; /** Subscribe to changes */ watch?: boolean; }; type UseBlockNumberConfig = QueryConfig; declare function useBlockNumber({ cacheTime, chainId: chainId_, enabled, scopeKey, staleTime, suspense, watch, onBlock, onError, onSettled, onSuccess, }?: UseBlockNumberArgs & UseBlockNumberConfig): UseQueryResult; type UseFeeDataArgs = Partial & { /** Subscribe to changes */ watch?: boolean; }; type UseFeedDataConfig = QueryConfig; declare function useFeeData({ cacheTime, chainId: chainId_, enabled, formatUnits, scopeKey, staleTime, suspense, watch, onError, onSettled, onSuccess, }?: UseFeeDataArgs & UseFeedDataConfig): UseQueryResult; type UsePublicClientArgs = Partial; declare function usePublicClient({ chainId, }?: UsePublicClientArgs): TPublicClient; type UseWalletClientConfig = Omit, 'cacheTime' | 'staleTime' | 'enabled'> & GetWalletClientArgs; declare function useWalletClient({ chainId: chainId_, suspense, onError, onSettled, onSuccess, }?: UseWalletClientConfig): UseQueryResult; type UseWebSocketPublicClientArgs = Partial; declare function useWebSocketPublicClient({ chainId }?: UseWebSocketPublicClientArgs): _wagmi_core.GetWebSocketPublicClientResult; 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 { request } = usePrepareSendTransaction({ * to: 'moxey.eth', * value: parseEther('1'), * }) * const result = useSendTransaction(request) */ declare function usePrepareSendTransaction({ accessList, account, chainId, cacheTime, data, enabled, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, scopeKey, staleTime, suspense, to, value, onError, onSettled, onSuccess, }?: UsePrepareSendTransactionConfig): Pick<_tanstack_react_query.QueryObserverResult, "data" | "error" | "isError" | "isLoading" | "isSuccess" | "isFetched" | "isFetchedAfterMount" | "isFetching" | "isRefetching" | "refetch" | "fetchStatus"> & { isIdle: boolean; status: "error" | "success" | "loading" | "idle"; internal: Pick<_tanstack_react_query.QueryObserverResult, "isLoadingError" | "isRefetchError" | "dataUpdatedAt" | "errorUpdatedAt" | "failureCount" | "isPaused" | "isPlaceholderData" | "isPreviousData" | "isStale" | "remove">; } & { config: PrepareSendTransactionResult; }; type UseSendTransactionArgs = Omit & { mode?: TMode; to?: string; }; type UseSendTransactionMutationArgs = SendTransactionArgs; type UseSendTransactionConfig = MutationConfig; type SendTransactionFn = (overrideConfig?: UseSendTransactionMutationArgs) => void; type SendTransactionAsyncFn = (overrideConfig?: UseSendTransactionMutationArgs) => Promise; type MutateFnReturnValue = TMode extends 'prepared' ? TFn | undefined : TFn; /** * @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/react/prepare-hooks#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({ accessList, account, chainId, data: data_, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, mode, nonce, to, value, onError, onMutate, onSettled, onSuccess, }?: UseSendTransactionArgs & UseSendTransactionConfig): { data: SendTransactionResult | undefined; error: Error | null; isError: boolean; isIdle: boolean; isLoading: boolean; isSuccess: boolean; reset: () => void; sendTransaction: MutateFnReturnValue; sendTransactionAsync: MutateFnReturnValue; status: "error" | "success" | "loading" | "idle"; variables: UseSendTransactionArgs<"prepared" | undefined> | undefined; }; type UseTransactionArgs = Partial; 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 | viem.TransactionEIP2930 | viem.TransactionEIP1559, Error>; type UseWaitForTransactionArgs = Partial; type UseWaitForTransactionConfig = QueryConfig; declare function useWaitForTransaction({ chainId: chainId_, confirmations, hash, timeout, cacheTime, enabled, scopeKey, staleTime, suspense, onError, onReplaced, onSettled, onSuccess, }?: UseWaitForTransactionArgs & UseWaitForTransactionConfig): UseQueryResult; type UseWatchPendingTransactionsConfig = { /** The chain ID to listen on. */ chainId?: number; /** Subscribe to changes */ enabled?: boolean; /** Function fires when a pending transaction enters the mempool. */ listener: WatchPendingTransactionsCallback; }; declare function useWatchPendingTransactions({ chainId: chainId_, enabled, listener, }: UseWatchPendingTransactionsConfig): void; export { Config, Context, CreateConfigParameters, UseContractEventConfig, UseContractInfiniteReadsConfig, UseContractReadConfig, UseContractReadsConfig, UseContractWriteConfig, UsePrepareContractWriteConfig, WagmiConfig, WagmiConfigProps, createConfig, paginatedIndexesConfig, useAccount, useBalance, useBlockNumber, useChainId, useConfig, useConnect, useContractEvent, useContractInfiniteReads, useContractRead, useContractReads, useContractWrite, useDisconnect, useEnsAddress, useEnsAvatar, useEnsName, useEnsResolver, useFeeData, useInfiniteQuery, useMutation, useNetwork, usePrepareContractWrite, usePrepareSendTransaction, usePublicClient, useQuery, useQueryClient, useSendTransaction, useSignMessage, useSignTypedData, useSwitchNetwork, useToken, useTransaction, useWaitForTransaction, useWalletClient, useWatchPendingTransactions, useWebSocketPublicClient };