wagmi 1.4.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/context.js +16 -0
- package/dist/esm/context.js.map +1 -0
- package/dist/esm/errors/base.js +20 -0
- package/dist/esm/errors/base.js.map +1 -0
- package/dist/esm/errors/context.js +13 -0
- package/dist/esm/errors/context.js.map +1 -0
- package/dist/esm/exports/actions.js +4 -0
- package/dist/esm/exports/actions.js.map +1 -0
- package/dist/esm/exports/chains.js +4 -0
- package/dist/esm/exports/chains.js.map +1 -0
- package/dist/esm/exports/connectors.js +4 -0
- package/dist/esm/exports/connectors.js.map +1 -0
- package/dist/esm/exports/index.js +63 -0
- package/dist/esm/exports/index.js.map +1 -0
- package/dist/esm/exports/query.js +4 -0
- package/dist/esm/exports/query.js.map +1 -0
- package/dist/esm/hooks/useAccount.js +10 -0
- package/dist/esm/hooks/useAccount.js.map +1 -0
- package/dist/esm/hooks/useAccountEffect.js +29 -0
- package/dist/esm/hooks/useAccountEffect.js.map +1 -0
- package/dist/esm/hooks/useBalance.js +19 -0
- package/dist/esm/hooks/useBalance.js.map +1 -0
- package/dist/esm/hooks/useBlockNumber.js +37 -0
- package/dist/esm/hooks/useBlockNumber.js.map +1 -0
- package/dist/esm/hooks/useChainId.js +10 -0
- package/dist/esm/hooks/useChainId.js.map +1 -0
- package/dist/esm/hooks/useClient.js +10 -0
- package/dist/esm/hooks/useClient.js.map +1 -0
- package/dist/esm/hooks/useConfig.js +13 -0
- package/dist/esm/hooks/useConfig.js.map +1 -0
- package/dist/esm/hooks/useConnect.js +22 -0
- package/dist/esm/hooks/useConnect.js.map +1 -0
- package/dist/esm/hooks/useConnections.js +10 -0
- package/dist/esm/hooks/useConnections.js.map +1 -0
- package/dist/esm/hooks/useConnectorClient.js +40 -0
- package/dist/esm/hooks/useConnectorClient.js.map +1 -0
- package/dist/esm/hooks/useContractRead.js +26 -0
- package/dist/esm/hooks/useContractRead.js.map +1 -0
- package/dist/esm/hooks/useContractReads.js +38 -0
- package/dist/esm/hooks/useContractReads.js.map +1 -0
- package/dist/esm/hooks/useContractSimulate.js +24 -0
- package/dist/esm/hooks/useContractSimulate.js.map +1 -0
- package/dist/esm/hooks/useContractWrite.js +20 -0
- package/dist/esm/hooks/useContractWrite.js.map +1 -0
- package/dist/esm/hooks/useDisconnect.js +23 -0
- package/dist/esm/hooks/useDisconnect.js.map +1 -0
- package/dist/esm/hooks/useEnsAddress.js +19 -0
- package/dist/esm/hooks/useEnsAddress.js.map +1 -0
- package/dist/esm/hooks/useEnsAvatar.js +19 -0
- package/dist/esm/hooks/useEnsAvatar.js.map +1 -0
- package/dist/esm/hooks/useEnsName.js +19 -0
- package/dist/esm/hooks/useEnsName.js.map +1 -0
- package/dist/esm/hooks/useEnsResolver.js +19 -0
- package/dist/esm/hooks/useEnsResolver.js.map +1 -0
- package/dist/esm/hooks/useEstimateFeesPerGas.js +19 -0
- package/dist/esm/hooks/useEstimateFeesPerGas.js.map +1 -0
- package/dist/esm/hooks/useEstimateGas.js +25 -0
- package/dist/esm/hooks/useEstimateGas.js.map +1 -0
- package/dist/esm/hooks/usePublicClient.js +10 -0
- package/dist/esm/hooks/usePublicClient.js.map +1 -0
- package/dist/esm/hooks/useReconnect.js +22 -0
- package/dist/esm/hooks/useReconnect.js.map +1 -0
- package/dist/esm/hooks/useSendTransaction.js +20 -0
- package/dist/esm/hooks/useSendTransaction.js.map +1 -0
- package/dist/esm/hooks/useSignMessage.js +21 -0
- package/dist/esm/hooks/useSignMessage.js.map +1 -0
- package/dist/esm/hooks/useSignTypedData.js +20 -0
- package/dist/esm/hooks/useSignTypedData.js.map +1 -0
- package/dist/esm/hooks/useSwitchAccount.js +22 -0
- package/dist/esm/hooks/useSwitchAccount.js.map +1 -0
- package/dist/esm/hooks/useSwitchChain.js +21 -0
- package/dist/esm/hooks/useSwitchChain.js.map +1 -0
- package/dist/esm/hooks/useSyncExternalStoreWithTracked.js +40 -0
- package/dist/esm/hooks/useSyncExternalStoreWithTracked.js.map +1 -0
- package/dist/esm/hooks/useToken.js +19 -0
- package/dist/esm/hooks/useToken.js.map +1 -0
- package/dist/esm/hooks/useTransaction.js +19 -0
- package/dist/esm/hooks/useTransaction.js.map +1 -0
- package/dist/esm/hooks/useWaitForTransactionReceipt.js +19 -0
- package/dist/esm/hooks/useWaitForTransactionReceipt.js.map +1 -0
- package/dist/esm/hooks/useWalletClient.js +42 -0
- package/dist/esm/hooks/useWalletClient.js.map +1 -0
- package/dist/esm/hooks/useWatchBlockNumber.js +25 -0
- package/dist/esm/hooks/useWatchBlockNumber.js.map +1 -0
- package/dist/esm/hooks/useWatchContractEvent.js +25 -0
- package/dist/esm/hooks/useWatchContractEvent.js.map +1 -0
- package/dist/esm/hooks/useWatchPendingTransactions.js +25 -0
- package/dist/esm/hooks/useWatchPendingTransactions.js.map +1 -0
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -0
- package/dist/esm/types/properties.js +2 -0
- package/dist/esm/types/properties.js.map +1 -0
- package/dist/esm/utils/getVersion.js +3 -0
- package/dist/esm/utils/getVersion.js.map +1 -0
- package/dist/esm/utils/query.js +21 -0
- package/dist/esm/utils/query.js.map +1 -0
- package/dist/esm/version.js +2 -0
- package/dist/esm/version.js.map +1 -0
- package/dist/types/context.d.ts +11 -0
- package/dist/types/context.d.ts.map +1 -0
- package/dist/types/errors/base.d.ts +7 -0
- package/dist/types/errors/base.d.ts.map +1 -0
- package/dist/types/errors/context.d.ts +6 -0
- package/dist/types/errors/context.d.ts.map +1 -0
- package/dist/types/exports/actions.d.ts +2 -0
- package/dist/types/exports/actions.d.ts.map +1 -0
- package/dist/types/exports/chains.d.ts +2 -0
- package/dist/types/exports/chains.d.ts.map +1 -0
- package/dist/types/exports/connectors.d.ts +2 -0
- package/dist/types/exports/connectors.d.ts.map +1 -0
- package/dist/types/exports/index.d.ts +46 -0
- package/dist/types/exports/index.d.ts.map +1 -0
- package/dist/types/exports/query.d.ts +2 -0
- package/dist/types/exports/query.d.ts.map +1 -0
- package/dist/types/hooks/useAccount.d.ts +7 -0
- package/dist/types/hooks/useAccount.d.ts.map +1 -0
- package/dist/types/hooks/useAccountEffect.d.ts +14 -0
- package/dist/types/hooks/useAccountEffect.d.ts.map +1 -0
- package/dist/types/hooks/useBalance.d.ts +13 -0
- package/dist/types/hooks/useBalance.d.ts.map +1 -0
- package/dist/types/hooks/useBlockNumber.d.ts +14 -0
- package/dist/types/hooks/useBlockNumber.d.ts.map +1 -0
- package/dist/types/hooks/useChainId.d.ts +7 -0
- package/dist/types/hooks/useChainId.d.ts.map +1 -0
- package/dist/types/hooks/useClient.d.ts +8 -0
- package/dist/types/hooks/useClient.d.ts.map +1 -0
- package/dist/types/hooks/useConfig.d.ts +7 -0
- package/dist/types/hooks/useConfig.d.ts.map +1 -0
- package/dist/types/hooks/useConnect.d.ts +16 -0
- package/dist/types/hooks/useConnect.d.ts.map +1 -0
- package/dist/types/hooks/useConnections.d.ts +7 -0
- package/dist/types/hooks/useConnections.d.ts.map +1 -0
- package/dist/types/hooks/useConnectorClient.d.ts +12 -0
- package/dist/types/hooks/useConnectorClient.d.ts.map +1 -0
- package/dist/types/hooks/useContractRead.d.ts +13 -0
- package/dist/types/hooks/useContractRead.d.ts.map +1 -0
- package/dist/types/hooks/useContractReads.d.ts +13 -0
- package/dist/types/hooks/useContractReads.d.ts.map +1 -0
- package/dist/types/hooks/useContractSimulate.d.ts +12 -0
- package/dist/types/hooks/useContractSimulate.d.ts.map +1 -0
- package/dist/types/hooks/useContractWrite.d.ts +15 -0
- package/dist/types/hooks/useContractWrite.d.ts.map +1 -0
- package/dist/types/hooks/useDisconnect.d.ts +16 -0
- package/dist/types/hooks/useDisconnect.d.ts.map +1 -0
- package/dist/types/hooks/useEnsAddress.d.ts +12 -0
- package/dist/types/hooks/useEnsAddress.d.ts.map +1 -0
- package/dist/types/hooks/useEnsAvatar.d.ts +12 -0
- package/dist/types/hooks/useEnsAvatar.d.ts.map +1 -0
- package/dist/types/hooks/useEnsName.d.ts +12 -0
- package/dist/types/hooks/useEnsName.d.ts.map +1 -0
- package/dist/types/hooks/useEnsResolver.d.ts +12 -0
- package/dist/types/hooks/useEnsResolver.d.ts.map +1 -0
- package/dist/types/hooks/useEstimateFeesPerGas.d.ts +13 -0
- package/dist/types/hooks/useEstimateFeesPerGas.d.ts.map +1 -0
- package/dist/types/hooks/useEstimateGas.d.ts +11 -0
- package/dist/types/hooks/useEstimateGas.d.ts.map +1 -0
- package/dist/types/hooks/usePublicClient.d.ts +8 -0
- package/dist/types/hooks/usePublicClient.d.ts.map +1 -0
- package/dist/types/hooks/useReconnect.d.ts +16 -0
- package/dist/types/hooks/useReconnect.d.ts.map +1 -0
- package/dist/types/hooks/useSendTransaction.d.ts +15 -0
- package/dist/types/hooks/useSendTransaction.d.ts.map +1 -0
- package/dist/types/hooks/useSignMessage.d.ts +15 -0
- package/dist/types/hooks/useSignMessage.d.ts.map +1 -0
- package/dist/types/hooks/useSignTypedData.d.ts +15 -0
- package/dist/types/hooks/useSignTypedData.d.ts.map +1 -0
- package/dist/types/hooks/useSwitchAccount.d.ts +16 -0
- package/dist/types/hooks/useSwitchAccount.d.ts.map +1 -0
- package/dist/types/hooks/useSwitchChain.d.ts +16 -0
- package/dist/types/hooks/useSwitchChain.d.ts.map +1 -0
- package/dist/types/hooks/useSyncExternalStoreWithTracked.d.ts +2 -0
- package/dist/types/hooks/useSyncExternalStoreWithTracked.d.ts.map +1 -0
- package/dist/types/hooks/useToken.d.ts +12 -0
- package/dist/types/hooks/useToken.d.ts.map +1 -0
- package/dist/types/hooks/useTransaction.d.ts +12 -0
- package/dist/types/hooks/useTransaction.d.ts.map +1 -0
- package/dist/types/hooks/useWaitForTransactionReceipt.d.ts +12 -0
- package/dist/types/hooks/useWaitForTransactionReceipt.d.ts.map +1 -0
- package/dist/types/hooks/useWalletClient.d.ts +12 -0
- package/dist/types/hooks/useWalletClient.d.ts.map +1 -0
- package/dist/types/hooks/useWatchBlockNumber.d.ts +8 -0
- package/dist/types/hooks/useWatchBlockNumber.d.ts.map +1 -0
- package/dist/types/hooks/useWatchContractEvent.d.ts +9 -0
- package/dist/types/hooks/useWatchContractEvent.d.ts.map +1 -0
- package/dist/types/hooks/useWatchPendingTransactions.d.ts +8 -0
- package/dist/types/hooks/useWatchPendingTransactions.d.ts.map +1 -0
- package/dist/types/types/properties.d.ts +8 -0
- package/dist/types/types/properties.d.ts.map +1 -0
- package/dist/types/utils/getVersion.d.ts +2 -0
- package/dist/types/utils/getVersion.d.ts.map +1 -0
- package/dist/types/utils/query.d.ts +15 -0
- package/dist/types/utils/query.d.ts.map +1 -0
- package/dist/types/version.d.ts +2 -0
- package/dist/types/version.d.ts.map +1 -0
- package/package.json +65 -103
- package/src/context.ts +27 -0
- package/src/errors/base.ts +13 -0
- package/src/errors/context.ts +8 -0
- package/src/exports/actions.ts +4 -0
- package/src/exports/chains.ts +4 -0
- package/src/exports/connectors.ts +4 -0
- package/src/exports/index.ts +284 -0
- package/src/exports/query.ts +4 -0
- package/src/hooks/useAccount.ts +27 -0
- package/src/hooks/useAccountEffect.ts +55 -0
- package/src/hooks/useBalance.ts +65 -0
- package/src/hooks/useBlockNumber.ts +97 -0
- package/src/hooks/useChainId.ts +31 -0
- package/src/hooks/useClient.ts +43 -0
- package/src/hooks/useConfig.ts +22 -0
- package/src/hooks/useConnect.ts +80 -0
- package/src/hooks/useConnections.ts +27 -0
- package/src/hooks/useConnectorClient.ts +95 -0
- package/src/hooks/useContractRead.ts +107 -0
- package/src/hooks/useContractReads.ts +98 -0
- package/src/hooks/useContractSimulate.ts +117 -0
- package/src/hooks/useContractWrite.ts +83 -0
- package/src/hooks/useDisconnect.ts +68 -0
- package/src/hooks/useEnsAddress.ts +61 -0
- package/src/hooks/useEnsAvatar.ts +59 -0
- package/src/hooks/useEnsName.ts +61 -0
- package/src/hooks/useEnsResolver.ts +61 -0
- package/src/hooks/useEstimateFeesPerGas.ts +69 -0
- package/src/hooks/useEstimateGas.ts +72 -0
- package/src/hooks/usePublicClient.ts +45 -0
- package/src/hooks/useReconnect.ts +67 -0
- package/src/hooks/useSendTransaction.ts +79 -0
- package/src/hooks/useSignMessage.ts +65 -0
- package/src/hooks/useSignTypedData.ts +66 -0
- package/src/hooks/useSwitchAccount.ts +82 -0
- package/src/hooks/useSwitchChain.ts +77 -0
- package/src/hooks/useSyncExternalStoreWithTracked.ts +67 -0
- package/src/hooks/useToken.ts +63 -0
- package/src/hooks/useTransaction.ts +68 -0
- package/src/hooks/useWaitForTransactionReceipt.ts +74 -0
- package/src/hooks/useWalletClient.ts +96 -0
- package/src/hooks/useWatchBlockNumber.ts +49 -0
- package/src/hooks/useWatchContractEvent.ts +64 -0
- package/src/hooks/useWatchPendingTransactions.ts +52 -0
- package/src/types/properties.ts +9 -0
- package/src/utils/getVersion.ts +3 -0
- package/src/utils/query.ts +102 -0
- package/src/version.ts +1 -0
- package/README.md +0 -30
- package/actions/package.json +0 -4
- package/chains/package.json +0 -4
- package/connectors/coinbaseWallet/package.json +0 -4
- package/connectors/injected/package.json +0 -4
- package/connectors/ledger/package.json +0 -4
- package/connectors/metaMask/package.json +0 -4
- package/connectors/mock/package.json +0 -4
- package/connectors/package.json +0 -4
- package/connectors/safe/package.json +0 -4
- package/connectors/walletConnect/package.json +0 -4
- package/connectors/walletConnectLegacy/package.json +0 -4
- package/dist/actions.d.ts +0 -1
- package/dist/actions.js +0 -85
- package/dist/chains.d.ts +0 -2
- package/dist/chains.js +0 -4
- package/dist/connectors/coinbaseWallet.d.ts +0 -1
- package/dist/connectors/coinbaseWallet.js +0 -7
- package/dist/connectors/index.d.ts +0 -1
- package/dist/connectors/index.js +0 -7
- package/dist/connectors/injected.d.ts +0 -1
- package/dist/connectors/injected.js +0 -7
- package/dist/connectors/ledger.d.ts +0 -1
- package/dist/connectors/ledger.js +0 -7
- package/dist/connectors/metaMask.d.ts +0 -1
- package/dist/connectors/metaMask.js +0 -7
- package/dist/connectors/mock.d.ts +0 -1
- package/dist/connectors/mock.js +0 -7
- package/dist/connectors/safe.d.ts +0 -1
- package/dist/connectors/safe.js +0 -7
- package/dist/connectors/walletConnect.d.ts +0 -1
- package/dist/connectors/walletConnect.js +0 -7
- package/dist/connectors/walletConnectLegacy.d.ts +0 -1
- package/dist/connectors/walletConnectLegacy.js +0 -7
- package/dist/index.d.ts +0 -958
- package/dist/index.js +0 -2564
- package/dist/providers/alchemy.d.ts +0 -1
- package/dist/providers/alchemy.js +0 -7
- package/dist/providers/infura.d.ts +0 -1
- package/dist/providers/infura.js +0 -7
- package/dist/providers/jsonRpc.d.ts +0 -1
- package/dist/providers/jsonRpc.js +0 -7
- package/dist/providers/public.d.ts +0 -1
- package/dist/providers/public.js +0 -7
- package/dist/window.d.ts +0 -76
- package/dist/window.js +0 -1
- package/providers/alchemy/package.json +0 -4
- package/providers/infura/package.json +0 -4
- package/providers/jsonRpc/package.json +0 -4
- package/providers/public/package.json +0 -4
- package/window/package.json +0 -4
package/dist/index.d.ts
DELETED
|
@@ -1,958 +0,0 @@
|
|
|
1
|
-
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
|
-
import { QueryClient, QueryKey, UseInfiniteQueryOptions, QueryFunction, InfiniteQueryObserverResult, UseMutationOptions, UseMutationResult, MutationFunction, MutationKey, UseQueryOptions, QueryObserverResult } from '@tanstack/react-query';
|
|
3
|
-
import { Persister } from '@tanstack/react-query-persist-client';
|
|
4
|
-
import * as _wagmi_core from '@wagmi/core';
|
|
5
|
-
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';
|
|
6
|
-
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';
|
|
7
|
-
import * as React from 'react';
|
|
8
|
-
import * as abitype from 'abitype';
|
|
9
|
-
import { TypedData, Abi, Narrow } from 'abitype';
|
|
10
|
-
import { Never } from '@wagmi/core/internal';
|
|
11
|
-
import * as viem from 'viem';
|
|
12
|
-
import { ContractFunctionConfig, MulticallContracts, SendTransactionParameters, GetFunctionArgs } from 'viem';
|
|
13
|
-
export { Address } from 'viem';
|
|
14
|
-
export { Chain, mainnet, sepolia } from 'viem/chains';
|
|
15
|
-
|
|
16
|
-
type CreateConfigParameters<TPublicClient extends PublicClient = PublicClient, TWebSocketPublicClient extends WebSocketPublicClient = WebSocketPublicClient> = CreateConfigParameters$1<TPublicClient, TWebSocketPublicClient> & {
|
|
17
|
-
queryClient?: QueryClient;
|
|
18
|
-
persister?: Persister | null;
|
|
19
|
-
};
|
|
20
|
-
declare function createConfig<TPublicClient extends PublicClient, TWebSocketPublicClient extends WebSocketPublicClient>({ queryClient, storage, persister, ...args }: CreateConfigParameters<TPublicClient, TWebSocketPublicClient>): Config$1<TPublicClient, TWebSocketPublicClient> & {
|
|
21
|
-
queryClient: QueryClient;
|
|
22
|
-
};
|
|
23
|
-
type Config<TPublicClient extends PublicClient = PublicClient, TWebSocketPublicClient extends WebSocketPublicClient = WebSocketPublicClient> = Config$1<TPublicClient, TWebSocketPublicClient> & {
|
|
24
|
-
queryClient: QueryClient;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
declare const Context: React.Context<Config<PublicClient, WebSocketPublicClient> | undefined>;
|
|
28
|
-
type WagmiConfigProps<TPublicClient extends PublicClient = PublicClient, TWebSocketPublicClient extends WebSocketPublicClient = WebSocketPublicClient> = {
|
|
29
|
-
/** React-decorated Client instance */
|
|
30
|
-
config: Config<TPublicClient, TWebSocketPublicClient>;
|
|
31
|
-
};
|
|
32
|
-
declare function WagmiConfig<TPublicClient extends PublicClient, TWebSocketPublicClient extends WebSocketPublicClient>({ children, config, }: React.PropsWithChildren<WagmiConfigProps<TPublicClient, TWebSocketPublicClient>>): React.FunctionComponentElement<React.ProviderProps<Config<PublicClient, WebSocketPublicClient> | undefined>>;
|
|
33
|
-
declare function useConfig<TPublicClient extends PublicClient, TWebSocketPublicClient extends WebSocketPublicClient = WebSocketPublicClient>(): Config<TPublicClient, TWebSocketPublicClient>;
|
|
34
|
-
|
|
35
|
-
type UseAccountConfig = {
|
|
36
|
-
/** Function to invoke when connected */
|
|
37
|
-
onConnect?({ address, connector, isReconnected, }: {
|
|
38
|
-
address?: GetAccountResult['address'];
|
|
39
|
-
connector?: GetAccountResult['connector'];
|
|
40
|
-
isReconnected: boolean;
|
|
41
|
-
}): void;
|
|
42
|
-
/** Function to invoke when disconnected */
|
|
43
|
-
onDisconnect?(): void;
|
|
44
|
-
};
|
|
45
|
-
declare function useAccount({ onConnect, onDisconnect }?: UseAccountConfig): GetAccountResult<PublicClient>;
|
|
46
|
-
|
|
47
|
-
type UseInfiniteQueryResult<TData, TError> = Pick<InfiniteQueryObserverResult<TData, TError>, 'data' | 'error' | 'fetchNextPage' | 'fetchStatus' | 'hasNextPage' | 'isError' | 'isFetched' | 'isFetchedAfterMount' | 'isFetching' | 'isFetchingNextPage' | 'isLoading' | 'isRefetching' | 'isSuccess' | 'refetch'> & {
|
|
48
|
-
isIdle: boolean;
|
|
49
|
-
status: 'idle' | 'loading' | 'success' | 'error';
|
|
50
|
-
internal: Pick<InfiniteQueryObserverResult, 'dataUpdatedAt' | 'errorUpdatedAt' | 'failureCount' | 'isLoadingError' | 'isPaused' | 'isPlaceholderData' | 'isPreviousData' | 'isRefetchError' | 'isStale' | 'remove'>;
|
|
51
|
-
};
|
|
52
|
-
declare function useInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(options: UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>): UseInfiniteQueryResult<TData, TError>;
|
|
53
|
-
declare function useInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: Omit<UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>, 'queryKey'>): UseInfiniteQueryResult<TData, TError>;
|
|
54
|
-
declare function useInfiniteQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, queryFn: QueryFunction<TQueryFnData, TQueryKey>, options?: Omit<UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>, 'queryKey' | 'queryFn'>): UseInfiniteQueryResult<TData, TError>;
|
|
55
|
-
|
|
56
|
-
declare function useMutation<TData = unknown, TError = unknown, TVariables = void, TContext = unknown>(options: UseMutationOptions<TData, TError, TVariables, TContext>): UseMutationResult<TData, TError, TVariables, TContext>;
|
|
57
|
-
declare function useMutation<TData = unknown, TError = unknown, TVariables = void, TContext = unknown>(mutationFn: MutationFunction<TData, TVariables>, options?: Omit<UseMutationOptions<TData, TError, TVariables, TContext>, 'mutationFn'>): UseMutationResult<TData, TError, TVariables, TContext>;
|
|
58
|
-
declare function useMutation<TData = unknown, TError = unknown, TVariables = void, TContext = unknown>(mutationKey: MutationKey, options?: Omit<UseMutationOptions<TData, TError, TVariables, TContext>, 'mutationKey'>): UseMutationResult<TData, TError, TVariables, TContext>;
|
|
59
|
-
declare function useMutation<TData = unknown, TError = unknown, TVariables = void, TContext = unknown>(mutationKey: MutationKey, mutationFn?: MutationFunction<TData, TVariables>, options?: Omit<UseMutationOptions<TData, TError, TVariables, TContext>, 'mutationKey' | 'mutationFn'>): UseMutationResult<TData, TError, TVariables, TContext>;
|
|
60
|
-
|
|
61
|
-
type UseQueryResult<TData, TError> = Pick<QueryObserverResult<TData, TError>, 'data' | 'error' | 'fetchStatus' | 'isError' | 'isFetched' | 'isFetchedAfterMount' | 'isFetching' | 'isLoading' | 'isRefetching' | 'isSuccess' | 'refetch'> & {
|
|
62
|
-
isIdle: boolean;
|
|
63
|
-
status: 'idle' | 'loading' | 'success' | 'error';
|
|
64
|
-
internal: Pick<QueryObserverResult, 'dataUpdatedAt' | 'errorUpdatedAt' | 'failureCount' | 'isLoadingError' | 'isPaused' | 'isPlaceholderData' | 'isPreviousData' | 'isRefetchError' | 'isStale' | 'remove'>;
|
|
65
|
-
};
|
|
66
|
-
type DefinedUseQueryResult<TData = unknown, TError = unknown> = Omit<UseQueryResult<TData, TError>, 'data'> & {
|
|
67
|
-
data: TData;
|
|
68
|
-
};
|
|
69
|
-
declare function useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryKey' | 'initialData'> & {
|
|
70
|
-
initialData?: () => undefined;
|
|
71
|
-
}): UseQueryResult<TData, TError>;
|
|
72
|
-
declare function useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryKey' | 'initialData'> & {
|
|
73
|
-
initialData: TQueryFnData | (() => TQueryFnData);
|
|
74
|
-
}): DefinedUseQueryResult<TData, TError>;
|
|
75
|
-
declare function useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, queryFn: QueryFunction<TQueryFnData, TQueryKey>, options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryKey' | 'queryFn' | 'initialData'> & {
|
|
76
|
-
initialData?: () => undefined;
|
|
77
|
-
}): UseQueryResult<TData, TError>;
|
|
78
|
-
declare function useQuery<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>(queryKey: TQueryKey, queryFn: QueryFunction<TQueryFnData, TQueryKey>, options?: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, 'queryKey' | 'queryFn' | 'initialData'> & {
|
|
79
|
-
initialData: TQueryFnData | (() => TQueryFnData);
|
|
80
|
-
}): DefinedUseQueryResult<TData, TError>;
|
|
81
|
-
|
|
82
|
-
declare const useQueryClient: () => _tanstack_react_query.QueryClient;
|
|
83
|
-
|
|
84
|
-
type UseChainIdArgs = {
|
|
85
|
-
chainId?: number;
|
|
86
|
-
};
|
|
87
|
-
declare function useChainId({ chainId }?: UseChainIdArgs): number;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Makes {@link TKeys} optional in {@link TType} while preserving type inference.
|
|
91
|
-
*/
|
|
92
|
-
type PartialBy<TType, TKeys extends keyof TType> = Partial<Pick<TType, TKeys>> & Omit<TType, TKeys>;
|
|
93
|
-
type DeepPartial<T, MaxDepth extends number, Depth extends readonly number[] = []> = Depth['length'] extends MaxDepth ? T : T extends object ? {
|
|
94
|
-
[P in keyof T]?: DeepPartial<T[P], MaxDepth, [...Depth, 1]>;
|
|
95
|
-
} : T;
|
|
96
|
-
type QueryConfig<TData, TError, TSelectData = TData> = Pick<UseQueryOptions<TData, TError, TSelectData>, 'cacheTime' | 'enabled' | 'isDataEqual' | 'staleTime' | 'structuralSharing' | 'suspense' | 'onError' | 'onSettled' | 'onSuccess'> & {
|
|
97
|
-
/** Scope the cache to a given context. */
|
|
98
|
-
scopeKey?: string;
|
|
99
|
-
};
|
|
100
|
-
type QueryConfigWithSelect<TData, TError, TSelectData = TData> = Pick<UseQueryOptions<TData, TError, TSelectData>, 'cacheTime' | 'enabled' | 'isDataEqual' | 'select' | 'staleTime' | 'structuralSharing' | 'suspense' | 'onError' | 'onSettled' | 'onSuccess'> & {
|
|
101
|
-
/** Scope the cache to a given context. */
|
|
102
|
-
scopeKey?: string;
|
|
103
|
-
};
|
|
104
|
-
type InfiniteQueryConfig<TData, TError, TSelectData = TData> = Pick<UseInfiniteQueryOptions<TData, TError, TSelectData>, 'cacheTime' | 'enabled' | 'getNextPageParam' | 'isDataEqual' | 'keepPreviousData' | 'select' | 'staleTime' | 'structuralSharing' | 'suspense' | 'onError' | 'onSettled' | 'onSuccess'> & {
|
|
105
|
-
/** Scope the cache to a given context. */
|
|
106
|
-
scopeKey?: string;
|
|
107
|
-
};
|
|
108
|
-
type MutationConfig<Data, Error, Variables = void> = {
|
|
109
|
-
/** Function fires if mutation encounters error */
|
|
110
|
-
onError?: UseMutationOptions<Data, Error, Variables>['onError'];
|
|
111
|
-
/**
|
|
112
|
-
* Function fires before mutation function and is passed same variables mutation function would receive.
|
|
113
|
-
* Value returned from this function will be passed to both onError and onSettled functions in event of a mutation failure.
|
|
114
|
-
*/
|
|
115
|
-
onMutate?: UseMutationOptions<Data, Error, Variables>['onMutate'];
|
|
116
|
-
/** Function fires when mutation is either successfully fetched or encounters error */
|
|
117
|
-
onSettled?: UseMutationOptions<Data, Error, Variables>['onSettled'];
|
|
118
|
-
/** Function fires when mutation is successful and will be passed the mutation's result */
|
|
119
|
-
onSuccess?: UseMutationOptions<Data, Error, Variables>['onSuccess'];
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
type UseBalanceArgs = Partial<FetchBalanceArgs> & {
|
|
123
|
-
/** Subscribe to changes */
|
|
124
|
-
watch?: boolean;
|
|
125
|
-
};
|
|
126
|
-
type UseBalanceConfig = QueryConfig<FetchBalanceResult, Error>;
|
|
127
|
-
declare function useBalance({ address, cacheTime, chainId: chainId_, enabled, formatUnits, scopeKey, staleTime, suspense, token, watch, onError, onSettled, onSuccess, }?: UseBalanceArgs & UseBalanceConfig): UseQueryResult<FetchBalanceResult, Error>;
|
|
128
|
-
|
|
129
|
-
type UseConnectArgs = Partial<ConnectArgs>;
|
|
130
|
-
type UseConnectConfig = MutationConfig<ConnectResult, Error, ConnectArgs>;
|
|
131
|
-
declare function useConnect({ chainId, connector, onError, onMutate, onSettled, onSuccess, }?: UseConnectArgs & UseConnectConfig): {
|
|
132
|
-
readonly connect: (args?: Partial<ConnectArgs>) => void;
|
|
133
|
-
readonly connectAsync: (args?: Partial<ConnectArgs>) => Promise<ConnectResult<_wagmi_core.PublicClient>>;
|
|
134
|
-
readonly connectors: _wagmi_core.Connector<any, any>[];
|
|
135
|
-
readonly data: ConnectResult<_wagmi_core.PublicClient> | undefined;
|
|
136
|
-
readonly error: Error | null;
|
|
137
|
-
readonly isError: boolean;
|
|
138
|
-
readonly isIdle: boolean;
|
|
139
|
-
readonly isLoading: boolean;
|
|
140
|
-
readonly isSuccess: boolean;
|
|
141
|
-
readonly pendingConnector: _wagmi_core.Connector<any, any> | undefined;
|
|
142
|
-
readonly reset: () => void;
|
|
143
|
-
readonly status: "error" | "success" | "loading" | "idle";
|
|
144
|
-
readonly variables: ConnectArgs | undefined;
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
type UseDisconnectConfig = {
|
|
148
|
-
/** Function to invoke when an error is thrown while connecting. */
|
|
149
|
-
onError?: (error: Error, context: unknown) => void | Promise<unknown>;
|
|
150
|
-
/**
|
|
151
|
-
* Function fires before mutation function and is passed same variables mutation function would receive.
|
|
152
|
-
* Value returned from this function will be passed to both onError and onSettled functions in event of a mutation failure.
|
|
153
|
-
*/
|
|
154
|
-
onMutate?: () => unknown;
|
|
155
|
-
/** Function to invoke when connect is settled (either successfully connected, or an error has thrown). */
|
|
156
|
-
onSettled?: (error: Error | null, context: unknown) => void | Promise<unknown>;
|
|
157
|
-
/** Function fires when mutation is successful and will be passed the mutation's result */
|
|
158
|
-
onSuccess?: (context: unknown) => void | Promise<unknown>;
|
|
159
|
-
};
|
|
160
|
-
declare function useDisconnect({ onError, onMutate, onSettled, onSuccess, }?: UseDisconnectConfig): {
|
|
161
|
-
readonly disconnect: _tanstack_react_query.UseMutateFunction<void, Error, void, unknown>;
|
|
162
|
-
readonly disconnectAsync: _tanstack_react_query.UseMutateAsyncFunction<void, Error, void, unknown>;
|
|
163
|
-
readonly error: Error | null;
|
|
164
|
-
readonly isError: boolean;
|
|
165
|
-
readonly isIdle: boolean;
|
|
166
|
-
readonly isLoading: boolean;
|
|
167
|
-
readonly isSuccess: boolean;
|
|
168
|
-
readonly reset: () => void;
|
|
169
|
-
readonly status: "error" | "success" | "loading" | "idle";
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
declare function useNetwork(): _wagmi_core.GetNetworkResult;
|
|
173
|
-
|
|
174
|
-
type UseSignMessageArgs = Partial<SignMessageArgs>;
|
|
175
|
-
type UseSignMessageConfig = MutationConfig<SignMessageResult, Error, SignMessageArgs>;
|
|
176
|
-
declare function useSignMessage({ message, onError, onMutate, onSettled, onSuccess, }?: UseSignMessageArgs & UseSignMessageConfig): {
|
|
177
|
-
data: `0x${string}` | undefined;
|
|
178
|
-
error: Error | null;
|
|
179
|
-
isError: boolean;
|
|
180
|
-
isIdle: boolean;
|
|
181
|
-
isLoading: boolean;
|
|
182
|
-
isSuccess: boolean;
|
|
183
|
-
reset: () => void;
|
|
184
|
-
signMessage: (args?: SignMessageArgs) => void;
|
|
185
|
-
signMessageAsync: (args?: SignMessageArgs) => Promise<`0x${string}`>;
|
|
186
|
-
status: "error" | "success" | "loading" | "idle";
|
|
187
|
-
variables: SignMessageArgs | undefined;
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
type UseSignTypedDataArgs<TTypedData extends TypedData | {
|
|
191
|
-
[key: string]: unknown;
|
|
192
|
-
} = TypedData, TPrimaryType extends string = string> = Partial<Never<SignTypedDataArgs<TTypedData, TPrimaryType>>> | SignTypedDataArgs<TTypedData, TPrimaryType>;
|
|
193
|
-
type UseSignTypedDataConfig<TTypedData extends TypedData | {
|
|
194
|
-
[key: string]: unknown;
|
|
195
|
-
} = TypedData, TPrimaryType extends string = string> = MutationConfig<SignTypedDataResult, Error, SignTypedDataArgs<TTypedData>> & UseSignTypedDataArgs<TTypedData, TPrimaryType>;
|
|
196
|
-
declare function useSignTypedData<TTypedData extends TypedData, TPrimaryType extends string>({ domain, types, message, primaryType, onError, onMutate, onSettled, onSuccess, }?: UseSignTypedDataConfig<TTypedData, TPrimaryType>): {
|
|
197
|
-
data: `0x${string}` | undefined;
|
|
198
|
-
error: Error | null;
|
|
199
|
-
isError: boolean;
|
|
200
|
-
isIdle: boolean;
|
|
201
|
-
isLoading: boolean;
|
|
202
|
-
isSuccess: boolean;
|
|
203
|
-
reset: () => void;
|
|
204
|
-
signTypedData: <TTypedDataMutate extends {
|
|
205
|
-
[x: string]: readonly abitype.TypedDataParameter[];
|
|
206
|
-
[x: `string[${string}]`]: undefined;
|
|
207
|
-
[x: `function[${string}]`]: undefined;
|
|
208
|
-
[x: `address[${string}]`]: undefined;
|
|
209
|
-
[x: `bool[${string}]`]: undefined;
|
|
210
|
-
[x: `bytes[${string}]`]: undefined;
|
|
211
|
-
[x: `bytes16[${string}]`]: undefined;
|
|
212
|
-
[x: `bytes5[${string}]`]: undefined;
|
|
213
|
-
[x: `bytes1[${string}]`]: undefined;
|
|
214
|
-
[x: `bytes18[${string}]`]: undefined;
|
|
215
|
-
[x: `bytes2[${string}]`]: undefined;
|
|
216
|
-
[x: `bytes10[${string}]`]: undefined;
|
|
217
|
-
[x: `bytes3[${string}]`]: undefined;
|
|
218
|
-
[x: `bytes4[${string}]`]: undefined;
|
|
219
|
-
[x: `bytes6[${string}]`]: undefined;
|
|
220
|
-
[x: `bytes7[${string}]`]: undefined;
|
|
221
|
-
[x: `bytes8[${string}]`]: undefined;
|
|
222
|
-
[x: `bytes9[${string}]`]: undefined;
|
|
223
|
-
[x: `bytes11[${string}]`]: undefined;
|
|
224
|
-
[x: `bytes12[${string}]`]: undefined;
|
|
225
|
-
[x: `bytes13[${string}]`]: undefined;
|
|
226
|
-
[x: `bytes14[${string}]`]: undefined;
|
|
227
|
-
[x: `bytes15[${string}]`]: undefined;
|
|
228
|
-
[x: `bytes17[${string}]`]: undefined;
|
|
229
|
-
[x: `bytes19[${string}]`]: undefined;
|
|
230
|
-
[x: `bytes20[${string}]`]: undefined;
|
|
231
|
-
[x: `bytes21[${string}]`]: undefined;
|
|
232
|
-
[x: `bytes22[${string}]`]: undefined;
|
|
233
|
-
[x: `bytes23[${string}]`]: undefined;
|
|
234
|
-
[x: `bytes24[${string}]`]: undefined;
|
|
235
|
-
[x: `bytes25[${string}]`]: undefined;
|
|
236
|
-
[x: `bytes26[${string}]`]: undefined;
|
|
237
|
-
[x: `bytes27[${string}]`]: undefined;
|
|
238
|
-
[x: `bytes28[${string}]`]: undefined;
|
|
239
|
-
[x: `bytes29[${string}]`]: undefined;
|
|
240
|
-
[x: `bytes30[${string}]`]: undefined;
|
|
241
|
-
[x: `bytes31[${string}]`]: undefined;
|
|
242
|
-
[x: `bytes32[${string}]`]: undefined;
|
|
243
|
-
[x: `int[${string}]`]: undefined;
|
|
244
|
-
[x: `int16[${string}]`]: undefined;
|
|
245
|
-
[x: `int8[${string}]`]: undefined;
|
|
246
|
-
[x: `int24[${string}]`]: undefined;
|
|
247
|
-
[x: `int32[${string}]`]: undefined;
|
|
248
|
-
[x: `int40[${string}]`]: undefined;
|
|
249
|
-
[x: `int48[${string}]`]: undefined;
|
|
250
|
-
[x: `int56[${string}]`]: undefined;
|
|
251
|
-
[x: `int64[${string}]`]: undefined;
|
|
252
|
-
[x: `int72[${string}]`]: undefined;
|
|
253
|
-
[x: `int80[${string}]`]: undefined;
|
|
254
|
-
[x: `int88[${string}]`]: undefined;
|
|
255
|
-
[x: `int96[${string}]`]: undefined;
|
|
256
|
-
[x: `int104[${string}]`]: undefined;
|
|
257
|
-
[x: `int112[${string}]`]: undefined;
|
|
258
|
-
[x: `int120[${string}]`]: undefined;
|
|
259
|
-
[x: `int128[${string}]`]: undefined;
|
|
260
|
-
[x: `int136[${string}]`]: undefined;
|
|
261
|
-
[x: `int144[${string}]`]: undefined;
|
|
262
|
-
[x: `int152[${string}]`]: undefined;
|
|
263
|
-
[x: `int160[${string}]`]: undefined;
|
|
264
|
-
[x: `int168[${string}]`]: undefined;
|
|
265
|
-
[x: `int176[${string}]`]: undefined;
|
|
266
|
-
[x: `int184[${string}]`]: undefined;
|
|
267
|
-
[x: `int192[${string}]`]: undefined;
|
|
268
|
-
[x: `int200[${string}]`]: undefined;
|
|
269
|
-
[x: `int208[${string}]`]: undefined;
|
|
270
|
-
[x: `int216[${string}]`]: undefined;
|
|
271
|
-
[x: `int224[${string}]`]: undefined;
|
|
272
|
-
[x: `int232[${string}]`]: undefined;
|
|
273
|
-
[x: `int240[${string}]`]: undefined;
|
|
274
|
-
[x: `int248[${string}]`]: undefined;
|
|
275
|
-
[x: `int256[${string}]`]: undefined;
|
|
276
|
-
[x: `uint[${string}]`]: undefined;
|
|
277
|
-
[x: `uint16[${string}]`]: undefined;
|
|
278
|
-
[x: `uint8[${string}]`]: undefined;
|
|
279
|
-
[x: `uint24[${string}]`]: undefined;
|
|
280
|
-
[x: `uint32[${string}]`]: undefined;
|
|
281
|
-
[x: `uint40[${string}]`]: undefined;
|
|
282
|
-
[x: `uint48[${string}]`]: undefined;
|
|
283
|
-
[x: `uint56[${string}]`]: undefined;
|
|
284
|
-
[x: `uint64[${string}]`]: undefined;
|
|
285
|
-
[x: `uint72[${string}]`]: undefined;
|
|
286
|
-
[x: `uint80[${string}]`]: undefined;
|
|
287
|
-
[x: `uint88[${string}]`]: undefined;
|
|
288
|
-
[x: `uint96[${string}]`]: undefined;
|
|
289
|
-
[x: `uint104[${string}]`]: undefined;
|
|
290
|
-
[x: `uint112[${string}]`]: undefined;
|
|
291
|
-
[x: `uint120[${string}]`]: undefined;
|
|
292
|
-
[x: `uint128[${string}]`]: undefined;
|
|
293
|
-
[x: `uint136[${string}]`]: undefined;
|
|
294
|
-
[x: `uint144[${string}]`]: undefined;
|
|
295
|
-
[x: `uint152[${string}]`]: undefined;
|
|
296
|
-
[x: `uint160[${string}]`]: undefined;
|
|
297
|
-
[x: `uint168[${string}]`]: undefined;
|
|
298
|
-
[x: `uint176[${string}]`]: undefined;
|
|
299
|
-
[x: `uint184[${string}]`]: undefined;
|
|
300
|
-
[x: `uint192[${string}]`]: undefined;
|
|
301
|
-
[x: `uint200[${string}]`]: undefined;
|
|
302
|
-
[x: `uint208[${string}]`]: undefined;
|
|
303
|
-
[x: `uint216[${string}]`]: undefined;
|
|
304
|
-
[x: `uint224[${string}]`]: undefined;
|
|
305
|
-
[x: `uint232[${string}]`]: undefined;
|
|
306
|
-
[x: `uint240[${string}]`]: undefined;
|
|
307
|
-
[x: `uint248[${string}]`]: undefined;
|
|
308
|
-
[x: `uint256[${string}]`]: undefined;
|
|
309
|
-
string?: undefined;
|
|
310
|
-
address?: undefined;
|
|
311
|
-
bool?: undefined;
|
|
312
|
-
bytes?: undefined;
|
|
313
|
-
bytes16?: undefined;
|
|
314
|
-
bytes5?: undefined;
|
|
315
|
-
bytes1?: undefined;
|
|
316
|
-
bytes18?: undefined;
|
|
317
|
-
bytes2?: undefined;
|
|
318
|
-
bytes10?: undefined;
|
|
319
|
-
bytes3?: undefined;
|
|
320
|
-
bytes4?: undefined;
|
|
321
|
-
bytes6?: undefined;
|
|
322
|
-
bytes7?: undefined;
|
|
323
|
-
bytes8?: undefined;
|
|
324
|
-
bytes9?: undefined;
|
|
325
|
-
bytes11?: undefined;
|
|
326
|
-
bytes12?: undefined;
|
|
327
|
-
bytes13?: undefined;
|
|
328
|
-
bytes14?: undefined;
|
|
329
|
-
bytes15?: undefined;
|
|
330
|
-
bytes17?: undefined;
|
|
331
|
-
bytes19?: undefined;
|
|
332
|
-
bytes20?: undefined;
|
|
333
|
-
bytes21?: undefined;
|
|
334
|
-
bytes22?: undefined;
|
|
335
|
-
bytes23?: undefined;
|
|
336
|
-
bytes24?: undefined;
|
|
337
|
-
bytes25?: undefined;
|
|
338
|
-
bytes26?: undefined;
|
|
339
|
-
bytes27?: undefined;
|
|
340
|
-
bytes28?: undefined;
|
|
341
|
-
bytes29?: undefined;
|
|
342
|
-
bytes30?: undefined;
|
|
343
|
-
bytes31?: undefined;
|
|
344
|
-
bytes32?: undefined;
|
|
345
|
-
int16?: undefined;
|
|
346
|
-
int8?: undefined;
|
|
347
|
-
int24?: undefined;
|
|
348
|
-
int32?: undefined;
|
|
349
|
-
int40?: undefined;
|
|
350
|
-
int48?: undefined;
|
|
351
|
-
int56?: undefined;
|
|
352
|
-
int64?: undefined;
|
|
353
|
-
int72?: undefined;
|
|
354
|
-
int80?: undefined;
|
|
355
|
-
int88?: undefined;
|
|
356
|
-
int96?: undefined;
|
|
357
|
-
int104?: undefined;
|
|
358
|
-
int112?: undefined;
|
|
359
|
-
int120?: undefined;
|
|
360
|
-
int128?: undefined;
|
|
361
|
-
int136?: undefined;
|
|
362
|
-
int144?: undefined;
|
|
363
|
-
int152?: undefined;
|
|
364
|
-
int160?: undefined;
|
|
365
|
-
int168?: undefined;
|
|
366
|
-
int176?: undefined;
|
|
367
|
-
int184?: undefined;
|
|
368
|
-
int192?: undefined;
|
|
369
|
-
int200?: undefined;
|
|
370
|
-
int208?: undefined;
|
|
371
|
-
int216?: undefined;
|
|
372
|
-
int224?: undefined;
|
|
373
|
-
int232?: undefined;
|
|
374
|
-
int240?: undefined;
|
|
375
|
-
int248?: undefined;
|
|
376
|
-
int256?: undefined;
|
|
377
|
-
uint16?: undefined;
|
|
378
|
-
uint8?: undefined;
|
|
379
|
-
uint24?: undefined;
|
|
380
|
-
uint32?: undefined;
|
|
381
|
-
uint40?: undefined;
|
|
382
|
-
uint48?: undefined;
|
|
383
|
-
uint56?: undefined;
|
|
384
|
-
uint64?: undefined;
|
|
385
|
-
uint72?: undefined;
|
|
386
|
-
uint80?: undefined;
|
|
387
|
-
uint88?: undefined;
|
|
388
|
-
uint96?: undefined;
|
|
389
|
-
uint104?: undefined;
|
|
390
|
-
uint112?: undefined;
|
|
391
|
-
uint120?: undefined;
|
|
392
|
-
uint128?: undefined;
|
|
393
|
-
uint136?: undefined;
|
|
394
|
-
uint144?: undefined;
|
|
395
|
-
uint152?: undefined;
|
|
396
|
-
uint160?: undefined;
|
|
397
|
-
uint168?: undefined;
|
|
398
|
-
uint176?: undefined;
|
|
399
|
-
uint184?: undefined;
|
|
400
|
-
uint192?: undefined;
|
|
401
|
-
uint200?: undefined;
|
|
402
|
-
uint208?: undefined;
|
|
403
|
-
uint216?: undefined;
|
|
404
|
-
uint224?: undefined;
|
|
405
|
-
uint232?: undefined;
|
|
406
|
-
uint240?: undefined;
|
|
407
|
-
uint248?: undefined;
|
|
408
|
-
uint256?: undefined;
|
|
409
|
-
} = TTypedData>(args?: UseSignTypedDataArgs<TTypedDataMutate, string> | undefined) => void;
|
|
410
|
-
signTypedDataAsync: <TTypedDataMutate_1 extends {
|
|
411
|
-
[x: string]: readonly abitype.TypedDataParameter[];
|
|
412
|
-
[x: `string[${string}]`]: undefined;
|
|
413
|
-
[x: `function[${string}]`]: undefined;
|
|
414
|
-
[x: `address[${string}]`]: undefined;
|
|
415
|
-
[x: `bool[${string}]`]: undefined;
|
|
416
|
-
[x: `bytes[${string}]`]: undefined;
|
|
417
|
-
[x: `bytes16[${string}]`]: undefined;
|
|
418
|
-
[x: `bytes5[${string}]`]: undefined;
|
|
419
|
-
[x: `bytes1[${string}]`]: undefined;
|
|
420
|
-
[x: `bytes18[${string}]`]: undefined;
|
|
421
|
-
[x: `bytes2[${string}]`]: undefined;
|
|
422
|
-
[x: `bytes10[${string}]`]: undefined;
|
|
423
|
-
[x: `bytes3[${string}]`]: undefined;
|
|
424
|
-
[x: `bytes4[${string}]`]: undefined;
|
|
425
|
-
[x: `bytes6[${string}]`]: undefined;
|
|
426
|
-
[x: `bytes7[${string}]`]: undefined;
|
|
427
|
-
[x: `bytes8[${string}]`]: undefined;
|
|
428
|
-
[x: `bytes9[${string}]`]: undefined;
|
|
429
|
-
[x: `bytes11[${string}]`]: undefined;
|
|
430
|
-
[x: `bytes12[${string}]`]: undefined;
|
|
431
|
-
[x: `bytes13[${string}]`]: undefined;
|
|
432
|
-
[x: `bytes14[${string}]`]: undefined;
|
|
433
|
-
[x: `bytes15[${string}]`]: undefined;
|
|
434
|
-
[x: `bytes17[${string}]`]: undefined;
|
|
435
|
-
[x: `bytes19[${string}]`]: undefined;
|
|
436
|
-
[x: `bytes20[${string}]`]: undefined;
|
|
437
|
-
[x: `bytes21[${string}]`]: undefined;
|
|
438
|
-
[x: `bytes22[${string}]`]: undefined;
|
|
439
|
-
[x: `bytes23[${string}]`]: undefined;
|
|
440
|
-
[x: `bytes24[${string}]`]: undefined;
|
|
441
|
-
[x: `bytes25[${string}]`]: undefined;
|
|
442
|
-
[x: `bytes26[${string}]`]: undefined;
|
|
443
|
-
[x: `bytes27[${string}]`]: undefined;
|
|
444
|
-
[x: `bytes28[${string}]`]: undefined;
|
|
445
|
-
[x: `bytes29[${string}]`]: undefined;
|
|
446
|
-
[x: `bytes30[${string}]`]: undefined;
|
|
447
|
-
[x: `bytes31[${string}]`]: undefined;
|
|
448
|
-
[x: `bytes32[${string}]`]: undefined;
|
|
449
|
-
[x: `int[${string}]`]: undefined;
|
|
450
|
-
[x: `int16[${string}]`]: undefined;
|
|
451
|
-
[x: `int8[${string}]`]: undefined;
|
|
452
|
-
[x: `int24[${string}]`]: undefined;
|
|
453
|
-
[x: `int32[${string}]`]: undefined;
|
|
454
|
-
[x: `int40[${string}]`]: undefined;
|
|
455
|
-
[x: `int48[${string}]`]: undefined;
|
|
456
|
-
[x: `int56[${string}]`]: undefined;
|
|
457
|
-
[x: `int64[${string}]`]: undefined;
|
|
458
|
-
[x: `int72[${string}]`]: undefined;
|
|
459
|
-
[x: `int80[${string}]`]: undefined;
|
|
460
|
-
[x: `int88[${string}]`]: undefined;
|
|
461
|
-
[x: `int96[${string}]`]: undefined;
|
|
462
|
-
[x: `int104[${string}]`]: undefined;
|
|
463
|
-
[x: `int112[${string}]`]: undefined;
|
|
464
|
-
[x: `int120[${string}]`]: undefined;
|
|
465
|
-
[x: `int128[${string}]`]: undefined;
|
|
466
|
-
[x: `int136[${string}]`]: undefined;
|
|
467
|
-
[x: `int144[${string}]`]: undefined;
|
|
468
|
-
[x: `int152[${string}]`]: undefined;
|
|
469
|
-
[x: `int160[${string}]`]: undefined;
|
|
470
|
-
[x: `int168[${string}]`]: undefined;
|
|
471
|
-
[x: `int176[${string}]`]: undefined;
|
|
472
|
-
[x: `int184[${string}]`]: undefined;
|
|
473
|
-
[x: `int192[${string}]`]: undefined;
|
|
474
|
-
[x: `int200[${string}]`]: undefined;
|
|
475
|
-
[x: `int208[${string}]`]: undefined;
|
|
476
|
-
[x: `int216[${string}]`]: undefined;
|
|
477
|
-
[x: `int224[${string}]`]: undefined;
|
|
478
|
-
[x: `int232[${string}]`]: undefined;
|
|
479
|
-
[x: `int240[${string}]`]: undefined;
|
|
480
|
-
[x: `int248[${string}]`]: undefined;
|
|
481
|
-
[x: `int256[${string}]`]: undefined;
|
|
482
|
-
[x: `uint[${string}]`]: undefined;
|
|
483
|
-
[x: `uint16[${string}]`]: undefined;
|
|
484
|
-
[x: `uint8[${string}]`]: undefined;
|
|
485
|
-
[x: `uint24[${string}]`]: undefined;
|
|
486
|
-
[x: `uint32[${string}]`]: undefined;
|
|
487
|
-
[x: `uint40[${string}]`]: undefined;
|
|
488
|
-
[x: `uint48[${string}]`]: undefined;
|
|
489
|
-
[x: `uint56[${string}]`]: undefined;
|
|
490
|
-
[x: `uint64[${string}]`]: undefined;
|
|
491
|
-
[x: `uint72[${string}]`]: undefined;
|
|
492
|
-
[x: `uint80[${string}]`]: undefined;
|
|
493
|
-
[x: `uint88[${string}]`]: undefined;
|
|
494
|
-
[x: `uint96[${string}]`]: undefined;
|
|
495
|
-
[x: `uint104[${string}]`]: undefined;
|
|
496
|
-
[x: `uint112[${string}]`]: undefined;
|
|
497
|
-
[x: `uint120[${string}]`]: undefined;
|
|
498
|
-
[x: `uint128[${string}]`]: undefined;
|
|
499
|
-
[x: `uint136[${string}]`]: undefined;
|
|
500
|
-
[x: `uint144[${string}]`]: undefined;
|
|
501
|
-
[x: `uint152[${string}]`]: undefined;
|
|
502
|
-
[x: `uint160[${string}]`]: undefined;
|
|
503
|
-
[x: `uint168[${string}]`]: undefined;
|
|
504
|
-
[x: `uint176[${string}]`]: undefined;
|
|
505
|
-
[x: `uint184[${string}]`]: undefined;
|
|
506
|
-
[x: `uint192[${string}]`]: undefined;
|
|
507
|
-
[x: `uint200[${string}]`]: undefined;
|
|
508
|
-
[x: `uint208[${string}]`]: undefined;
|
|
509
|
-
[x: `uint216[${string}]`]: undefined;
|
|
510
|
-
[x: `uint224[${string}]`]: undefined;
|
|
511
|
-
[x: `uint232[${string}]`]: undefined;
|
|
512
|
-
[x: `uint240[${string}]`]: undefined;
|
|
513
|
-
[x: `uint248[${string}]`]: undefined;
|
|
514
|
-
[x: `uint256[${string}]`]: undefined;
|
|
515
|
-
string?: undefined;
|
|
516
|
-
address?: undefined;
|
|
517
|
-
bool?: undefined;
|
|
518
|
-
bytes?: undefined;
|
|
519
|
-
bytes16?: undefined;
|
|
520
|
-
bytes5?: undefined;
|
|
521
|
-
bytes1?: undefined;
|
|
522
|
-
bytes18?: undefined;
|
|
523
|
-
bytes2?: undefined;
|
|
524
|
-
bytes10?: undefined;
|
|
525
|
-
bytes3?: undefined;
|
|
526
|
-
bytes4?: undefined;
|
|
527
|
-
bytes6?: undefined;
|
|
528
|
-
bytes7?: undefined;
|
|
529
|
-
bytes8?: undefined;
|
|
530
|
-
bytes9?: undefined;
|
|
531
|
-
bytes11?: undefined;
|
|
532
|
-
bytes12?: undefined;
|
|
533
|
-
bytes13?: undefined;
|
|
534
|
-
bytes14?: undefined;
|
|
535
|
-
bytes15?: undefined;
|
|
536
|
-
bytes17?: undefined;
|
|
537
|
-
bytes19?: undefined;
|
|
538
|
-
bytes20?: undefined;
|
|
539
|
-
bytes21?: undefined;
|
|
540
|
-
bytes22?: undefined;
|
|
541
|
-
bytes23?: undefined;
|
|
542
|
-
bytes24?: undefined;
|
|
543
|
-
bytes25?: undefined;
|
|
544
|
-
bytes26?: undefined;
|
|
545
|
-
bytes27?: undefined;
|
|
546
|
-
bytes28?: undefined;
|
|
547
|
-
bytes29?: undefined;
|
|
548
|
-
bytes30?: undefined;
|
|
549
|
-
bytes31?: undefined;
|
|
550
|
-
bytes32?: undefined;
|
|
551
|
-
int16?: undefined;
|
|
552
|
-
int8?: undefined;
|
|
553
|
-
int24?: undefined;
|
|
554
|
-
int32?: undefined;
|
|
555
|
-
int40?: undefined;
|
|
556
|
-
int48?: undefined;
|
|
557
|
-
int56?: undefined;
|
|
558
|
-
int64?: undefined;
|
|
559
|
-
int72?: undefined;
|
|
560
|
-
int80?: undefined;
|
|
561
|
-
int88?: undefined;
|
|
562
|
-
int96?: undefined;
|
|
563
|
-
int104?: undefined;
|
|
564
|
-
int112?: undefined;
|
|
565
|
-
int120?: undefined;
|
|
566
|
-
int128?: undefined;
|
|
567
|
-
int136?: undefined;
|
|
568
|
-
int144?: undefined;
|
|
569
|
-
int152?: undefined;
|
|
570
|
-
int160?: undefined;
|
|
571
|
-
int168?: undefined;
|
|
572
|
-
int176?: undefined;
|
|
573
|
-
int184?: undefined;
|
|
574
|
-
int192?: undefined;
|
|
575
|
-
int200?: undefined;
|
|
576
|
-
int208?: undefined;
|
|
577
|
-
int216?: undefined;
|
|
578
|
-
int224?: undefined;
|
|
579
|
-
int232?: undefined;
|
|
580
|
-
int240?: undefined;
|
|
581
|
-
int248?: undefined;
|
|
582
|
-
int256?: undefined;
|
|
583
|
-
uint16?: undefined;
|
|
584
|
-
uint8?: undefined;
|
|
585
|
-
uint24?: undefined;
|
|
586
|
-
uint32?: undefined;
|
|
587
|
-
uint40?: undefined;
|
|
588
|
-
uint48?: undefined;
|
|
589
|
-
uint56?: undefined;
|
|
590
|
-
uint64?: undefined;
|
|
591
|
-
uint72?: undefined;
|
|
592
|
-
uint80?: undefined;
|
|
593
|
-
uint88?: undefined;
|
|
594
|
-
uint96?: undefined;
|
|
595
|
-
uint104?: undefined;
|
|
596
|
-
uint112?: undefined;
|
|
597
|
-
uint120?: undefined;
|
|
598
|
-
uint128?: undefined;
|
|
599
|
-
uint136?: undefined;
|
|
600
|
-
uint144?: undefined;
|
|
601
|
-
uint152?: undefined;
|
|
602
|
-
uint160?: undefined;
|
|
603
|
-
uint168?: undefined;
|
|
604
|
-
uint176?: undefined;
|
|
605
|
-
uint184?: undefined;
|
|
606
|
-
uint192?: undefined;
|
|
607
|
-
uint200?: undefined;
|
|
608
|
-
uint208?: undefined;
|
|
609
|
-
uint216?: undefined;
|
|
610
|
-
uint224?: undefined;
|
|
611
|
-
uint232?: undefined;
|
|
612
|
-
uint240?: undefined;
|
|
613
|
-
uint248?: undefined;
|
|
614
|
-
uint256?: undefined;
|
|
615
|
-
} = TTypedData>(args?: UseSignTypedDataArgs<TTypedDataMutate_1, string> | undefined) => Promise<`0x${string}`>;
|
|
616
|
-
status: "error" | "success" | "loading" | "idle";
|
|
617
|
-
variables: SignTypedDataArgs<TTypedData> | undefined;
|
|
618
|
-
};
|
|
619
|
-
|
|
620
|
-
type UseSwitchNetworkArgs = Partial<SwitchNetworkArgs>;
|
|
621
|
-
type UseSwitchNetworkConfig = MutationConfig<SwitchNetworkResult, Error, SwitchNetworkArgs> & {
|
|
622
|
-
throwForSwitchChainNotSupported?: boolean;
|
|
623
|
-
};
|
|
624
|
-
declare function useSwitchNetwork({ chainId, throwForSwitchChainNotSupported, onError, onMutate, onSettled, onSuccess, }?: UseSwitchNetworkArgs & UseSwitchNetworkConfig): {
|
|
625
|
-
readonly chains: _wagmi_core.Chain[];
|
|
626
|
-
readonly data: SwitchNetworkResult | undefined;
|
|
627
|
-
readonly error: Error | null;
|
|
628
|
-
readonly isError: boolean;
|
|
629
|
-
readonly isIdle: boolean;
|
|
630
|
-
readonly isLoading: boolean;
|
|
631
|
-
readonly isSuccess: boolean;
|
|
632
|
-
readonly pendingChainId: number | undefined;
|
|
633
|
-
readonly reset: () => void;
|
|
634
|
-
readonly status: "error" | "success" | "loading" | "idle";
|
|
635
|
-
readonly switchNetwork: ((chainId_?: SwitchNetworkArgs['chainId']) => void) | undefined;
|
|
636
|
-
readonly switchNetworkAsync: ((chainId_?: SwitchNetworkArgs['chainId']) => Promise<SwitchNetworkResult>) | undefined;
|
|
637
|
-
readonly variables: SwitchNetworkArgs | undefined;
|
|
638
|
-
};
|
|
639
|
-
|
|
640
|
-
type UseContractEventConfig<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string = string> = PartialBy<WatchContractEventConfig<TAbi, TEventName>, 'abi' | 'address' | 'eventName'> & {
|
|
641
|
-
listener: WatchContractEventCallback<TAbi, TEventName>;
|
|
642
|
-
};
|
|
643
|
-
declare function useContractEvent<TAbi extends Abi | readonly unknown[], TEventName extends string>({ address, chainId, abi, listener, eventName, }?: UseContractEventConfig<TAbi, TEventName>): (() => void) | undefined;
|
|
644
|
-
|
|
645
|
-
type UseContractInfiniteReadsConfig<TContracts extends ContractFunctionConfig[] = ContractFunctionConfig[], TAllowFailure extends boolean = true, TPageParam = unknown, TSelectData = ReadContractsResult<TContracts, TAllowFailure>> = Pick<ReadContractsConfig<TContracts, TAllowFailure>, 'allowFailure'> & {
|
|
646
|
-
cacheKey: string;
|
|
647
|
-
contracts(pageParam: TPageParam): Narrow<readonly [
|
|
648
|
-
...MulticallContracts<TContracts, {
|
|
649
|
-
/** Chain id to use for Public Client. */
|
|
650
|
-
chainId?: number;
|
|
651
|
-
}>
|
|
652
|
-
]>;
|
|
653
|
-
} & InfiniteQueryConfig<ReadContractsResult<TContracts, TAllowFailure>, Error, TSelectData> & ({
|
|
654
|
-
/** Block number to read against. */
|
|
655
|
-
blockNumber?: ReadContractsConfig<TContracts>['blockNumber'];
|
|
656
|
-
blockTag?: never;
|
|
657
|
-
watch?: never;
|
|
658
|
-
} | {
|
|
659
|
-
blockNumber?: never;
|
|
660
|
-
/** Block tag to read against. */
|
|
661
|
-
blockTag?: ReadContractsConfig<TContracts>['blockTag'];
|
|
662
|
-
watch?: never;
|
|
663
|
-
} | {
|
|
664
|
-
blockNumber?: never;
|
|
665
|
-
blockTag?: never;
|
|
666
|
-
/** Refresh on incoming blocks. */
|
|
667
|
-
watch?: boolean;
|
|
668
|
-
});
|
|
669
|
-
declare function useContractInfiniteReads<TContracts extends ContractFunctionConfig[], TAllowFailure extends boolean = true, TPageParam = any, TSelectData = ReadContractsResult<TContracts, TAllowFailure>>({ allowFailure, blockNumber, blockTag, cacheKey, cacheTime, contracts, enabled: enabled_, getNextPageParam, isDataEqual, keepPreviousData, onError, onSettled, onSuccess, scopeKey, select, staleTime, structuralSharing, suspense, }: UseContractInfiniteReadsConfig<TContracts, TAllowFailure, TPageParam, TSelectData>): UseInfiniteQueryResult<TSelectData, Error>;
|
|
670
|
-
declare function paginatedIndexesConfig<TContracts extends ContractFunctionConfig[], TSelectData = ReadContractsResult<TContracts>>(fn: UseContractInfiniteReadsConfig<TContracts>['contracts'], { perPage, start, direction, }: {
|
|
671
|
-
perPage: number;
|
|
672
|
-
start: number;
|
|
673
|
-
direction: 'increment' | 'decrement';
|
|
674
|
-
}): {
|
|
675
|
-
contracts: UseContractInfiniteReadsConfig<TContracts>['contracts'];
|
|
676
|
-
getNextPageParam: InfiniteQueryConfig<unknown[], Error, TSelectData>['getNextPageParam'];
|
|
677
|
-
};
|
|
678
|
-
|
|
679
|
-
type UseContractReadConfig<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string, TSelectData = ReadContractResult<TAbi, TFunctionName>> = PartialBy<ReadContractConfig<TAbi, TFunctionName>, 'abi' | 'address' | 'args' | 'blockNumber' | 'blockTag' | 'functionName'> & QueryConfigWithSelect<ReadContractResult<TAbi, TFunctionName>, Error, TSelectData> & {
|
|
680
|
-
/** If set to `true`, the cache will depend on the block number */
|
|
681
|
-
cacheOnBlock?: boolean;
|
|
682
|
-
/** Set this to `true` to keep the previous data when fetching based on a new query key. Defaults to `false`. */
|
|
683
|
-
keepPreviousData?: boolean;
|
|
684
|
-
} & ({
|
|
685
|
-
/** Block number to read against. */
|
|
686
|
-
blockNumber?: ReadContractConfig['blockNumber'];
|
|
687
|
-
blockTag?: never;
|
|
688
|
-
watch?: never;
|
|
689
|
-
} | {
|
|
690
|
-
blockNumber?: never;
|
|
691
|
-
/** Block tag to read against. */
|
|
692
|
-
blockTag?: ReadContractConfig['blockTag'];
|
|
693
|
-
watch?: never;
|
|
694
|
-
} | {
|
|
695
|
-
blockNumber?: never;
|
|
696
|
-
blockTag?: never;
|
|
697
|
-
/** Refresh on incoming blocks. */
|
|
698
|
-
watch?: boolean;
|
|
699
|
-
});
|
|
700
|
-
declare function useContractRead<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TSelectData = ReadContractResult<TAbi, TFunctionName>>({ 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<TAbi, TFunctionName, TSelectData>): UseQueryResult<TSelectData, Error>;
|
|
701
|
-
|
|
702
|
-
type UseContractReadsConfig<TContracts extends ContractFunctionConfig[], TAllowFailure extends boolean = true, TSelectData = ReadContractsResult<TContracts, TAllowFailure>, Config = ReadContractsConfig<TContracts, TAllowFailure>> = {
|
|
703
|
-
[K in keyof Config]?: K extends 'contracts' ? DeepPartial<Config[K], 2> : Config[K];
|
|
704
|
-
} & QueryConfigWithSelect<ReadContractsResult<TContracts, TAllowFailure>, Error, TSelectData> & {
|
|
705
|
-
/** If set to `true`, the cache will depend on the block number */
|
|
706
|
-
cacheOnBlock?: boolean;
|
|
707
|
-
/** Set this to `true` to keep the previous data when fetching based on a new query key. Defaults to `false`. */
|
|
708
|
-
keepPreviousData?: boolean;
|
|
709
|
-
} & ({
|
|
710
|
-
/** Block number to read against. */
|
|
711
|
-
blockNumber?: ReadContractsConfig<TContracts>['blockNumber'];
|
|
712
|
-
blockTag?: never;
|
|
713
|
-
watch?: never;
|
|
714
|
-
} | {
|
|
715
|
-
blockNumber?: never;
|
|
716
|
-
/** Block tag to read against. */
|
|
717
|
-
blockTag?: ReadContractsConfig<TContracts>['blockTag'];
|
|
718
|
-
watch?: never;
|
|
719
|
-
} | {
|
|
720
|
-
blockNumber?: never;
|
|
721
|
-
blockTag?: never;
|
|
722
|
-
/** Refresh on incoming blocks. */
|
|
723
|
-
watch?: boolean;
|
|
724
|
-
});
|
|
725
|
-
declare function useContractReads<TContracts extends ContractFunctionConfig[], TAllowFailure extends boolean = true, TSelectData = ReadContractsResult<TContracts, TAllowFailure>>({ allowFailure: allowFailure_, blockNumber: blockNumberOverride, blockTag, cacheOnBlock, cacheTime, contracts, enabled: enabled_, isDataEqual, keepPreviousData, onError, onSettled, onSuccess, scopeKey, select, staleTime, structuralSharing, suspense, watch, }?: UseContractReadsConfig<TContracts, TAllowFailure, TSelectData>): UseQueryResult<TSelectData, Error>;
|
|
726
|
-
|
|
727
|
-
type UseContractWritePreparedArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = Partial<Pick<PrepareWriteContractResult<TAbi, TFunctionName>, 'request'>> & {
|
|
728
|
-
abi?: never;
|
|
729
|
-
accessList?: never;
|
|
730
|
-
account?: never;
|
|
731
|
-
address?: never;
|
|
732
|
-
args?: never;
|
|
733
|
-
chainId?: never;
|
|
734
|
-
functionName?: never;
|
|
735
|
-
gas?: never;
|
|
736
|
-
gasPrice?: never;
|
|
737
|
-
maxFeePerGas?: never;
|
|
738
|
-
maxPriorityFeePerGas?: never;
|
|
739
|
-
nonce?: never;
|
|
740
|
-
value?: never;
|
|
741
|
-
};
|
|
742
|
-
type UseContractWriteUnpreparedArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = PartialBy<Omit<WriteContractUnpreparedArgs<TAbi, TFunctionName>, 'args'>, 'abi' | 'address' | 'functionName'> & Partial<GetFunctionArgs<TAbi, TFunctionName>> & {
|
|
743
|
-
request?: never;
|
|
744
|
-
};
|
|
745
|
-
type UseContractWriteArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string, TMode extends WriteContractMode = undefined> = {
|
|
746
|
-
mode?: TMode;
|
|
747
|
-
} & (TMode extends 'prepared' ? UseContractWritePreparedArgs<TAbi, TFunctionName> : UseContractWriteUnpreparedArgs<TAbi, TFunctionName>);
|
|
748
|
-
type UseContractWriteConfig<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string, TMode extends WriteContractMode = undefined> = MutationConfig<WriteContractResult, Error, UseContractWriteArgs<TAbi, TFunctionName, TMode>> & UseContractWriteArgs<TAbi, TFunctionName, TMode>;
|
|
749
|
-
/**
|
|
750
|
-
* @description Hook for calling a contract nonpayable or payable function.
|
|
751
|
-
*
|
|
752
|
-
* It is highly recommended to pair this with the [`usePrepareContractWrite` hook](/docs/prepare-hooks/usePrepareContractWrite)
|
|
753
|
-
* to [avoid UX pitfalls](https://wagmi.sh/react/prepare-hooks#ux-pitfalls-without-prepare-hooks).
|
|
754
|
-
*
|
|
755
|
-
* @example
|
|
756
|
-
* import { useContractWrite, usePrepareContractWrite } from 'wagmi'
|
|
757
|
-
*
|
|
758
|
-
* const { config } = usePrepareContractWrite({
|
|
759
|
-
* address: '0xecb504d39723b0be0e3a9aa33d646642d1051ee1',
|
|
760
|
-
* abi: wagmigotchiABI,
|
|
761
|
-
* functionName: 'feed',
|
|
762
|
-
* })
|
|
763
|
-
* const { data, isLoading, isSuccess, write } = useContractWrite(config)
|
|
764
|
-
*
|
|
765
|
-
*/
|
|
766
|
-
declare function useContractWrite<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TMode extends WriteContractMode = undefined>(config: UseContractWriteConfig<TAbi, TFunctionName, TMode>): {
|
|
767
|
-
data: WriteContractResult | undefined;
|
|
768
|
-
error: Error | null;
|
|
769
|
-
isError: boolean;
|
|
770
|
-
isIdle: boolean;
|
|
771
|
-
isLoading: boolean;
|
|
772
|
-
isSuccess: boolean;
|
|
773
|
-
reset: () => void;
|
|
774
|
-
status: "error" | "success" | "loading" | "idle";
|
|
775
|
-
variables: UseContractWriteArgs<Abi, string, undefined> | undefined;
|
|
776
|
-
write: MutationFn<TMode, TAbi, TFunctionName, void>;
|
|
777
|
-
writeAsync: MutationFn<TMode, TAbi, TFunctionName, Promise<WriteContractResult>>;
|
|
778
|
-
};
|
|
779
|
-
type MutationFnArgs<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = Omit<SendTransactionParameters, 'account' | 'chain'> & {
|
|
780
|
-
args?: WriteContractUnpreparedArgs<TAbi, TFunctionName> extends {
|
|
781
|
-
args: unknown;
|
|
782
|
-
} ? WriteContractUnpreparedArgs<TAbi, TFunctionName>['args'] : unknown;
|
|
783
|
-
};
|
|
784
|
-
type MutationFn<TMode extends WriteContractMode, TAbi extends Abi | readonly unknown[], TFunctionName extends string, TReturnType> = TMode extends 'prepared' ? (() => TReturnType) | undefined : (config?: MutationFnArgs<TAbi, TFunctionName>) => TReturnType;
|
|
785
|
-
|
|
786
|
-
type UsePrepareContractWriteConfig<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string, TChainId extends number = number, TWalletClient extends WalletClient = WalletClient> = PartialBy<Omit<PrepareWriteContractConfig<TAbi, TFunctionName, TChainId, TWalletClient>, 'args'>, 'abi' | 'address' | 'functionName'> & Partial<GetFunctionArgs<TAbi, TFunctionName>> & QueryConfig<PrepareWriteContractResult<TAbi, TFunctionName, TChainId>, Error>;
|
|
787
|
-
/**
|
|
788
|
-
* @description Hook for preparing a contract write to be sent via [`useContractWrite`](/docs/hooks/useContractWrite).
|
|
789
|
-
*
|
|
790
|
-
* Eagerly fetches the parameters required for sending a contract write transaction such as the gas estimate.
|
|
791
|
-
*
|
|
792
|
-
* @example
|
|
793
|
-
* import { useContractWrite, usePrepareContractWrite } from 'wagmi'
|
|
794
|
-
*
|
|
795
|
-
* const { config } = usePrepareContractWrite({
|
|
796
|
-
* address: '0xecb504d39723b0be0e3a9aa33d646642d1051ee1',
|
|
797
|
-
* abi: wagmigotchiABI,
|
|
798
|
-
* functionName: 'feed',
|
|
799
|
-
* })
|
|
800
|
-
* const { data, isLoading, isSuccess, write } = useContractWrite(config)
|
|
801
|
-
*
|
|
802
|
-
*/
|
|
803
|
-
declare function usePrepareContractWrite<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TChainId extends number>({ address, abi, functionName, chainId, args, cacheTime, enabled, scopeKey, staleTime, suspense, onError, onSettled, onSuccess, ...config }?: UsePrepareContractWriteConfig<TAbi, TFunctionName, TChainId>): Pick<_tanstack_react_query.QueryObserverResult<PrepareWriteContractResult<TAbi, TFunctionName, TChainId>, Error>, "data" | "error" | "isError" | "isLoading" | "isSuccess" | "isFetched" | "isFetchedAfterMount" | "isFetching" | "isRefetching" | "refetch" | "fetchStatus"> & {
|
|
804
|
-
isIdle: boolean;
|
|
805
|
-
status: "error" | "success" | "loading" | "idle";
|
|
806
|
-
internal: Pick<_tanstack_react_query.QueryObserverResult, "isLoadingError" | "isRefetchError" | "dataUpdatedAt" | "errorUpdatedAt" | "failureCount" | "isPaused" | "isPlaceholderData" | "isPreviousData" | "isStale" | "remove">;
|
|
807
|
-
} & {
|
|
808
|
-
config: PrepareWriteContractResult<TAbi, TFunctionName, TChainId>;
|
|
809
|
-
};
|
|
810
|
-
|
|
811
|
-
type UseTokenArgs = Partial<FetchTokenArgs>;
|
|
812
|
-
type UseTokenConfig = QueryConfig<FetchTokenResult, Error>;
|
|
813
|
-
declare function useToken({ address, chainId: chainId_, formatUnits, cacheTime, enabled, scopeKey, staleTime, // 24 hours
|
|
814
|
-
suspense, onError, onSettled, onSuccess, }?: UseTokenArgs & UseTokenConfig): UseQueryResult<FetchTokenResult, Error>;
|
|
815
|
-
|
|
816
|
-
type UseEnsAddressArgs = Omit<Partial<FetchEnsAddressArgs>, 'name'> & {
|
|
817
|
-
name?: FetchEnsAddressArgs['name'] | null;
|
|
818
|
-
};
|
|
819
|
-
type UseEnsAddressConfig = QueryConfig<FetchEnsAddressResult, Error>;
|
|
820
|
-
declare function useEnsAddress({ cacheTime, chainId: chainId_, enabled, name, scopeKey, staleTime, // 24 hours
|
|
821
|
-
suspense, onError, onSettled, onSuccess, }?: UseEnsAddressArgs & UseEnsAddressConfig): UseQueryResult<`0x${string}` | null, Error>;
|
|
822
|
-
|
|
823
|
-
type UseEnsAvatarArgs = Omit<Partial<FetchEnsAvatarArgs>, 'name'> & {
|
|
824
|
-
name?: FetchEnsAvatarArgs['name'] | null;
|
|
825
|
-
};
|
|
826
|
-
type UseEnsLookupConfig = QueryConfig<FetchEnsAvatarResult, Error>;
|
|
827
|
-
declare function useEnsAvatar({ cacheTime, chainId: chainId_, enabled, name, scopeKey, staleTime, // 24 hours
|
|
828
|
-
suspense, onError, onSettled, onSuccess, }?: UseEnsAvatarArgs & UseEnsLookupConfig): UseQueryResult<string | null, Error>;
|
|
829
|
-
|
|
830
|
-
type UseEnsNameArgs = Partial<FetchEnsNameArgs>;
|
|
831
|
-
type UseEnsNameConfig = QueryConfig<FetchEnsNameResult, Error>;
|
|
832
|
-
declare function useEnsName({ address, cacheTime, chainId: chainId_, enabled, scopeKey, staleTime, // 24 hours
|
|
833
|
-
suspense, onError, onSettled, onSuccess, }?: UseEnsNameArgs & UseEnsNameConfig): UseQueryResult<string | null, Error>;
|
|
834
|
-
|
|
835
|
-
type UseEnsResolverArgs = Omit<Partial<FetchEnsResolverArgs>, 'name'> & {
|
|
836
|
-
name?: FetchEnsResolverArgs['name'] | null;
|
|
837
|
-
};
|
|
838
|
-
type UseEnsResolverConfig = QueryConfig<FetchEnsResolverResult, Error>;
|
|
839
|
-
declare function useEnsResolver({ chainId: chainId_, name, enabled, scopeKey, suspense, onError, onSettled, onSuccess, }?: UseEnsResolverArgs & UseEnsResolverConfig): UseQueryResult<`0x${string}`, Error>;
|
|
840
|
-
|
|
841
|
-
type UseBlockNumberArgs = Partial<FetchBlockNumberArgs> & {
|
|
842
|
-
/** Function fires when a new block is created */
|
|
843
|
-
onBlock?: (blockNumber: bigint) => void;
|
|
844
|
-
/** Subscribe to changes */
|
|
845
|
-
watch?: boolean;
|
|
846
|
-
};
|
|
847
|
-
type UseBlockNumberConfig = QueryConfig<FetchBlockNumberResult, Error>;
|
|
848
|
-
declare function useBlockNumber({ cacheTime, chainId: chainId_, enabled, scopeKey, staleTime, suspense, watch, onBlock, onError, onSettled, onSuccess, }?: UseBlockNumberArgs & UseBlockNumberConfig): UseQueryResult<bigint, Error>;
|
|
849
|
-
|
|
850
|
-
type UseFeeDataArgs = Partial<FetchFeeDataArgs> & {
|
|
851
|
-
/** Subscribe to changes */
|
|
852
|
-
watch?: boolean;
|
|
853
|
-
};
|
|
854
|
-
type UseFeedDataConfig = QueryConfig<FetchFeeDataResult, Error>;
|
|
855
|
-
declare function useFeeData({ cacheTime, chainId: chainId_, enabled, formatUnits, scopeKey, staleTime, suspense, watch, onError, onSettled, onSuccess, }?: UseFeeDataArgs & UseFeedDataConfig): UseQueryResult<FetchFeeDataResult, Error>;
|
|
856
|
-
|
|
857
|
-
type UsePublicClientArgs = Partial<GetPublicClientArgs>;
|
|
858
|
-
declare function usePublicClient<TPublicClient extends PublicClient>({ chainId, }?: UsePublicClientArgs): TPublicClient;
|
|
859
|
-
|
|
860
|
-
type UseWalletClientConfig = Omit<QueryConfig<GetWalletClientResult, Error>, 'cacheTime' | 'staleTime' | 'enabled'> & GetWalletClientArgs;
|
|
861
|
-
declare function useWalletClient({ chainId: chainId_, suspense, onError, onSettled, onSuccess, }?: UseWalletClientConfig): UseQueryResult<GetWalletClientResult, Error>;
|
|
862
|
-
|
|
863
|
-
type UseWebSocketPublicClientArgs = Partial<GetWebSocketPublicClientArgs>;
|
|
864
|
-
declare function useWebSocketPublicClient<TWebSocketPublicClient extends WebSocketPublicClient>({ chainId }?: UseWebSocketPublicClientArgs): _wagmi_core.GetWebSocketPublicClientResult<TWebSocketPublicClient>;
|
|
865
|
-
|
|
866
|
-
type UsePrepareSendTransactionConfig = Partial<PrepareSendTransactionArgs> & QueryConfig<PrepareSendTransactionResult, Error>;
|
|
867
|
-
/**
|
|
868
|
-
* @description Hook for preparing a transaction to be sent via [`useSendTransaction`](/docs/hooks/useSendTransaction).
|
|
869
|
-
*
|
|
870
|
-
* Eagerly fetches the parameters required for sending a transaction such as the gas estimate and resolving an ENS address (if required).
|
|
871
|
-
*
|
|
872
|
-
* @example
|
|
873
|
-
* import { useSendTransaction, usePrepareSendTransaction } from 'wagmi'
|
|
874
|
-
*
|
|
875
|
-
* const { request } = usePrepareSendTransaction({
|
|
876
|
-
* to: 'moxey.eth',
|
|
877
|
-
* value: parseEther('1'),
|
|
878
|
-
* })
|
|
879
|
-
* const result = useSendTransaction(request)
|
|
880
|
-
*/
|
|
881
|
-
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<PrepareSendTransactionResult, Error>, "data" | "error" | "isError" | "isLoading" | "isSuccess" | "isFetched" | "isFetchedAfterMount" | "isFetching" | "isRefetching" | "refetch" | "fetchStatus"> & {
|
|
882
|
-
isIdle: boolean;
|
|
883
|
-
status: "error" | "success" | "loading" | "idle";
|
|
884
|
-
internal: Pick<_tanstack_react_query.QueryObserverResult, "isLoadingError" | "isRefetchError" | "dataUpdatedAt" | "errorUpdatedAt" | "failureCount" | "isPaused" | "isPlaceholderData" | "isPreviousData" | "isStale" | "remove">;
|
|
885
|
-
} & {
|
|
886
|
-
config: PrepareSendTransactionResult;
|
|
887
|
-
};
|
|
888
|
-
|
|
889
|
-
type UseSendTransactionArgs<TMode extends 'prepared' | undefined = 'prepared' | undefined> = Omit<SendTransactionArgs, 'to'> & {
|
|
890
|
-
mode?: TMode;
|
|
891
|
-
to?: string;
|
|
892
|
-
};
|
|
893
|
-
type UseSendTransactionMutationArgs = SendTransactionArgs;
|
|
894
|
-
type UseSendTransactionConfig = MutationConfig<SendTransactionResult, Error, UseSendTransactionArgs>;
|
|
895
|
-
type SendTransactionFn = (overrideConfig?: UseSendTransactionMutationArgs) => void;
|
|
896
|
-
type SendTransactionAsyncFn = (overrideConfig?: UseSendTransactionMutationArgs) => Promise<SendTransactionResult>;
|
|
897
|
-
type MutateFnReturnValue<TMode, TFn> = TMode extends 'prepared' ? TFn | undefined : TFn;
|
|
898
|
-
/**
|
|
899
|
-
* @description Hook for sending a transaction.
|
|
900
|
-
*
|
|
901
|
-
* It is recommended to pair this with the [`usePrepareSendTransaction` hook](/docs/prepare-hooks/usePrepareSendTransaction)
|
|
902
|
-
* to [avoid UX pitfalls](https://wagmi.sh/react/prepare-hooks#ux-pitfalls-without-prepare-hooks).
|
|
903
|
-
*
|
|
904
|
-
* @example
|
|
905
|
-
* import { useSendTransaction, usePrepareSendTransaction } from 'wagmi'
|
|
906
|
-
*
|
|
907
|
-
* const config = usePrepareSendTransaction({
|
|
908
|
-
* request: {
|
|
909
|
-
* to: 'moxey.eth',
|
|
910
|
-
* value: parseEther('1'),
|
|
911
|
-
* }
|
|
912
|
-
* })
|
|
913
|
-
* const result = useSendTransaction(config)
|
|
914
|
-
*/
|
|
915
|
-
declare function useSendTransaction<TMode extends 'prepared' | undefined = undefined>({ accessList, account, chainId, data: data_, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, mode, nonce, to, value, onError, onMutate, onSettled, onSuccess, }?: UseSendTransactionArgs<TMode> & UseSendTransactionConfig): {
|
|
916
|
-
data: SendTransactionResult | undefined;
|
|
917
|
-
error: Error | null;
|
|
918
|
-
isError: boolean;
|
|
919
|
-
isIdle: boolean;
|
|
920
|
-
isLoading: boolean;
|
|
921
|
-
isSuccess: boolean;
|
|
922
|
-
reset: () => void;
|
|
923
|
-
sendTransaction: MutateFnReturnValue<TMode, SendTransactionFn>;
|
|
924
|
-
sendTransactionAsync: MutateFnReturnValue<TMode, SendTransactionAsyncFn>;
|
|
925
|
-
status: "error" | "success" | "loading" | "idle";
|
|
926
|
-
variables: UseSendTransactionArgs<"prepared" | undefined> | undefined;
|
|
927
|
-
};
|
|
928
|
-
|
|
929
|
-
type UseTransactionArgs = Partial<FetchTransactionArgs>;
|
|
930
|
-
type UseTransactionConfig = QueryConfig<FetchTransactionResult, Error>;
|
|
931
|
-
/**
|
|
932
|
-
* @description Fetches transaction for hash
|
|
933
|
-
*
|
|
934
|
-
* @example
|
|
935
|
-
* import { useTransaction } from 'wagmi'
|
|
936
|
-
*
|
|
937
|
-
* const result = useTransaction({
|
|
938
|
-
* chainId: 1,
|
|
939
|
-
* hash: '0x...',
|
|
940
|
-
* })
|
|
941
|
-
*/
|
|
942
|
-
declare function useTransaction({ cacheTime, chainId: chainId_, enabled, hash, scopeKey, staleTime, suspense, onError, onSettled, onSuccess, }?: UseTransactionArgs & UseTransactionConfig): UseQueryResult<viem.TransactionLegacy<bigint, number, "legacy"> | viem.TransactionEIP2930<bigint, number, "eip2930"> | viem.TransactionEIP1559<bigint, number, "eip1559">, Error>;
|
|
943
|
-
|
|
944
|
-
type UseWaitForTransactionArgs = Partial<WaitForTransactionArgs>;
|
|
945
|
-
type UseWaitForTransactionConfig = QueryConfig<WaitForTransactionResult, Error>;
|
|
946
|
-
declare function useWaitForTransaction({ chainId: chainId_, confirmations, hash, timeout, cacheTime, enabled, scopeKey, staleTime, suspense, onError, onReplaced, onSettled, onSuccess, }?: UseWaitForTransactionArgs & UseWaitForTransactionConfig): UseQueryResult<viem.TransactionReceipt, Error>;
|
|
947
|
-
|
|
948
|
-
type UseWatchPendingTransactionsConfig = {
|
|
949
|
-
/** The chain ID to listen on. */
|
|
950
|
-
chainId?: number;
|
|
951
|
-
/** Subscribe to changes */
|
|
952
|
-
enabled?: boolean;
|
|
953
|
-
/** Function fires when a pending transaction enters the mempool. */
|
|
954
|
-
listener: WatchPendingTransactionsCallback;
|
|
955
|
-
};
|
|
956
|
-
declare function useWatchPendingTransactions({ chainId: chainId_, enabled, listener, }: UseWatchPendingTransactionsConfig): void;
|
|
957
|
-
|
|
958
|
-
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 };
|