diff --git a/packages/cli/src/config.ts b/packages/cli/src/config.ts index 91a37a55bd..94c54d7c41 100644 --- a/packages/cli/src/config.ts +++ b/packages/cli/src/config.ts @@ -1,7 +1,7 @@ import type { Abi } from 'abitype' import type { Address } from 'viem' -import type { Evaluate, MaybeArray, MaybePromise } from './types.js' +import type { Compute, MaybeArray, MaybePromise } from './types.js' export type ContractConfig< chainId extends number = number, @@ -37,7 +37,7 @@ export type ContractConfig< name: string } -export type Contract = Evaluate< +export type Contract = Compute< ContractConfig & { /** Generated string content */ content: string diff --git a/packages/cli/src/plugins/actions.ts b/packages/cli/src/plugins/actions.ts index 23886bbece..01c804fd91 100644 --- a/packages/cli/src/plugins/actions.ts +++ b/packages/cli/src/plugins/actions.ts @@ -1,7 +1,7 @@ import { pascalCase } from 'change-case' import type { Contract, Plugin } from '../config.js' -import type { Evaluate, RequiredBy } from '../types.js' +import type { Compute, RequiredBy } from '../types.js' import { getAddressDocString } from '../utils/getAddressDocString.js' import { getIsPackageInstalled } from '../utils/packages.js' @@ -16,7 +16,7 @@ export type ActionsConfig = { overridePackageName?: '@wagmi/core' | 'wagmi' | undefined } -type ActionsResult = Evaluate> +type ActionsResult = Compute> export function actions(config: ActionsConfig = {}): ActionsResult { return { diff --git a/packages/cli/src/plugins/blockExplorer.ts b/packages/cli/src/plugins/blockExplorer.ts index d3b6f155b4..b305a52f4a 100644 --- a/packages/cli/src/plugins/blockExplorer.ts +++ b/packages/cli/src/plugins/blockExplorer.ts @@ -4,7 +4,7 @@ import { z } from 'zod' import type { ContractConfig } from '../config.js' import { fromZodError } from '../errors.js' -import type { Evaluate } from '../types.js' +import type { Compute } from '../types.js' import { fetch } from './fetch.js' export type BlockExplorerConfig = { @@ -25,7 +25,7 @@ export type BlockExplorerConfig = { /** * Contracts to fetch ABIs for. */ - contracts: Evaluate>[] + contracts: Compute>[] /** * Function to get address from contract config. */ diff --git a/packages/cli/src/plugins/etherscan.ts b/packages/cli/src/plugins/etherscan.ts index b77537aa83..ce96bc3c6b 100644 --- a/packages/cli/src/plugins/etherscan.ts +++ b/packages/cli/src/plugins/etherscan.ts @@ -1,5 +1,5 @@ import type { ContractConfig } from '../config.js' -import type { Evaluate } from '../types.js' +import type { Compute } from '../types.js' import { blockExplorer } from './blockExplorer.js' const apiUrls = { @@ -82,7 +82,7 @@ export type EtherscanConfig = { /** * Contracts to fetch ABIs for. */ - contracts: Evaluate, 'abi'>>[] + contracts: Compute, 'abi'>>[] } /** diff --git a/packages/cli/src/plugins/fetch.ts b/packages/cli/src/plugins/fetch.ts index 21eb197944..4389da369b 100644 --- a/packages/cli/src/plugins/fetch.ts +++ b/packages/cli/src/plugins/fetch.ts @@ -4,7 +4,7 @@ import { join } from 'pathe' import type { Abi } from 'abitype' import type { ContractConfig, Plugin } from '../config.js' -import type { Evaluate, RequiredBy } from '../types.js' +import type { Compute, RequiredBy } from '../types.js' export type FetchConfig = { /** @@ -16,12 +16,12 @@ export type FetchConfig = { /** * Contracts to fetch ABIs for. */ - contracts: Evaluate>[] + contracts: Compute>[] /** * Function for creating a cache key for contract. */ getCacheKey?: - | ((config: { contract: Evaluate> }) => string) + | ((config: { contract: Compute> }) => string) | undefined /** * Name of source. @@ -53,7 +53,7 @@ export type FetchConfig = { timeoutDuration?: number | undefined } -type FetchResult = Evaluate> +type FetchResult = Compute> /** Fetches and parses contract ABIs from network resource with `fetch`. */ export function fetch(config: FetchConfig): FetchResult { diff --git a/packages/cli/src/plugins/foundry.ts b/packages/cli/src/plugins/foundry.ts index f7d1c68f24..76cc2793b3 100644 --- a/packages/cli/src/plugins/foundry.ts +++ b/packages/cli/src/plugins/foundry.ts @@ -9,7 +9,7 @@ import { z } from 'zod' import type { ContractConfig, Plugin } from '../config.js' import * as logger from '../logger.js' -import type { Evaluate, RequiredBy } from '../types.js' +import type { Compute, RequiredBy } from '../types.js' const defaultExcludes = [ 'Base.sol/**', @@ -93,7 +93,7 @@ export type FoundryConfig = { project?: string | undefined } -type FoundryResult = Evaluate< +type FoundryResult = Compute< RequiredBy > diff --git a/packages/cli/src/plugins/hardhat.ts b/packages/cli/src/plugins/hardhat.ts index cb894d2f2e..0a1c5b8762 100644 --- a/packages/cli/src/plugins/hardhat.ts +++ b/packages/cli/src/plugins/hardhat.ts @@ -6,7 +6,7 @@ import pc from 'picocolors' import type { ContractConfig, Plugin } from '../config.js' import * as logger from '../logger.js' -import type { Evaluate, RequiredBy } from '../types.js' +import type { Compute, RequiredBy } from '../types.js' import { getIsPackageInstalled, getPackageManager } from '../utils/packages.js' const defaultExcludes = ['build-info/**', '*.dbg.json'] @@ -63,7 +63,7 @@ export type HardhatConfig = { sources?: string | undefined } -type HardhatResult = Evaluate< +type HardhatResult = Compute< RequiredBy > diff --git a/packages/cli/src/plugins/react.ts b/packages/cli/src/plugins/react.ts index 6bc229790f..b76ea006a5 100644 --- a/packages/cli/src/plugins/react.ts +++ b/packages/cli/src/plugins/react.ts @@ -1,7 +1,7 @@ import { pascalCase } from 'change-case' import type { Contract, Plugin } from '../config.js' -import type { Evaluate, RequiredBy } from '../types.js' +import type { Compute, RequiredBy } from '../types.js' import { getAddressDocString } from '../utils/getAddressDocString.js' export type ReactConfig = { @@ -14,7 +14,7 @@ export type ReactConfig = { }) => `use${string}`) } -type ReactResult = Evaluate> +type ReactResult = Compute> export function react(config: ReactConfig = {}): ReactResult { return { diff --git a/packages/cli/src/plugins/sourcify.ts b/packages/cli/src/plugins/sourcify.ts index e7adc0fe80..5f2c58e676 100644 --- a/packages/cli/src/plugins/sourcify.ts +++ b/packages/cli/src/plugins/sourcify.ts @@ -5,7 +5,7 @@ import { z } from 'zod' import type { ContractConfig } from '../config.js' import { fromZodError } from '../errors.js' -import type { Evaluate } from '../types.js' +import type { Compute } from '../types.js' import { fetch } from './fetch.js' export type SourcifyConfig = { @@ -26,7 +26,7 @@ export type SourcifyConfig = { /** * Contracts to fetch ABIs for. */ - contracts: Evaluate, 'abi'>>[] + contracts: Compute, 'abi'>>[] } const SourcifyResponse = z.object({ diff --git a/packages/cli/src/types.ts b/packages/cli/src/types.ts index 69e1cec9db..adb2889348 100644 --- a/packages/cli/src/types.ts +++ b/packages/cli/src/types.ts @@ -1,4 +1,4 @@ -export type Evaluate = { [key in keyof type]: type[key] } & unknown +export type Compute = { [key in keyof type]: type[key] } & unknown export type MaybeArray = T | T[] diff --git a/packages/connectors/src/coinbaseWallet.ts b/packages/connectors/src/coinbaseWallet.ts index 17719369a8..17eb033c31 100644 --- a/packages/connectors/src/coinbaseWallet.ts +++ b/packages/connectors/src/coinbaseWallet.ts @@ -8,7 +8,7 @@ import { type Connector, createConnector, } from '@wagmi/core' -import type { Evaluate, Mutable, Omit } from '@wagmi/core/internal' +import type { Compute, Mutable, Omit } from '@wagmi/core/internal' import type { CoinbaseWalletProvider as CBW_Provider, CoinbaseWalletSDK as CBW_SDK, @@ -27,14 +27,14 @@ type Version = '3' | '4' export type CoinbaseWalletParameters = version extends '4' - ? Evaluate< + ? Compute< { headlessMode?: false | undefined /** Coinbase Wallet SDK version */ version?: version | '3' | undefined } & Version4Parameters > - : Evaluate< + : Compute< { /** * @deprecated `headlessMode` will be removed in the next major version. Upgrade to `version: '4'`. diff --git a/packages/connectors/src/metaMask.ts b/packages/connectors/src/metaMask.ts index 7415d8aecc..bce6efb9d0 100644 --- a/packages/connectors/src/metaMask.ts +++ b/packages/connectors/src/metaMask.ts @@ -9,7 +9,7 @@ import { createConnector, } from '@wagmi/core' import type { - Evaluate, + Compute, ExactPartial, RemoveUndefined, } from '@wagmi/core/internal' @@ -28,7 +28,7 @@ import { withTimeout, } from 'viem' -export type MetaMaskParameters = Evaluate< +export type MetaMaskParameters = Compute< ExactPartial> > diff --git a/packages/connectors/src/safe.ts b/packages/connectors/src/safe.ts index e67b9a49c6..445458630c 100644 --- a/packages/connectors/src/safe.ts +++ b/packages/connectors/src/safe.ts @@ -5,10 +5,10 @@ import { ProviderNotFoundError, createConnector, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { getAddress, withTimeout } from 'viem' -export type SafeParameters = Evaluate< +export type SafeParameters = Compute< Opts & { /** * Connector automatically connects when used as Safe App. diff --git a/packages/connectors/src/walletConnect.ts b/packages/connectors/src/walletConnect.ts index ffe6a2fac8..4eed9b328c 100644 --- a/packages/connectors/src/walletConnect.ts +++ b/packages/connectors/src/walletConnect.ts @@ -4,7 +4,7 @@ import { ProviderNotFoundError, createConnector, } from '@wagmi/core' -import type { Evaluate, ExactPartial, Omit } from '@wagmi/core/internal' +import type { Compute, ExactPartial, Omit } from '@wagmi/core/internal' import type { EthereumProvider } from '@walletconnect/ethereum-provider' import { type AddEthereumChainParameter, @@ -25,7 +25,7 @@ type WalletConnectConnector = Connector & { type EthereumProviderOptions = Parameters<(typeof EthereumProvider)['init']>[0] -export type WalletConnectParameters = Evaluate< +export type WalletConnectParameters = Compute< { /** * If a new chain is added to a previously existing configured connector `chains`, this flag diff --git a/packages/core/src/actions/codegen/createReadContract.ts b/packages/core/src/actions/codegen/createReadContract.ts index 7c1a07c766..f7dbfbed45 100644 --- a/packages/core/src/actions/codegen/createReadContract.ts +++ b/packages/core/src/actions/codegen/createReadContract.ts @@ -6,7 +6,7 @@ import type { } from 'viem' import type { Config } from '../../createConfig.js' -import type { UnionEvaluate, UnionOmit } from '../../types/utils.js' +import type { UnionCompute, UnionStrictOmit } from '../../types/utils.js' import { getAccount } from '../getAccount.js' import { getChainId } from '../getChainId.js' import { @@ -50,8 +50,8 @@ export type CreateReadContractReturnType< args extends ContractFunctionArgs, >( config: config, - parameters: UnionEvaluate< - UnionOmit< + parameters: UnionCompute< + UnionStrictOmit< ReadContractParameters, omittedProperties > diff --git a/packages/core/src/actions/codegen/createSimulateContract.ts b/packages/core/src/actions/codegen/createSimulateContract.ts index 8a67bbec41..016384e245 100644 --- a/packages/core/src/actions/codegen/createSimulateContract.ts +++ b/packages/core/src/actions/codegen/createSimulateContract.ts @@ -14,7 +14,7 @@ import type { ChainIdParameter, ConnectorParameter, } from '../../types/properties.js' -import type { UnionEvaluate, UnionOmit } from '../../types/utils.js' +import type { UnionCompute, UnionStrictOmit } from '../../types/utils.js' import { getAccount } from '../getAccount.js' import { getChainId } from '../getChainId.js' import { @@ -55,8 +55,8 @@ export type CreateSimulateContractReturnType< >( config: config, parameters: { - [key in keyof chains]: UnionEvaluate< - UnionOmit< + [key in keyof chains]: UnionCompute< + UnionStrictOmit< viem_SimulateContractParameters< abi, name, diff --git a/packages/core/src/actions/codegen/createWatchContractEvent.ts b/packages/core/src/actions/codegen/createWatchContractEvent.ts index 05d2592c78..6a1b1a8604 100644 --- a/packages/core/src/actions/codegen/createWatchContractEvent.ts +++ b/packages/core/src/actions/codegen/createWatchContractEvent.ts @@ -1,7 +1,7 @@ import type { Abi, Address, ContractEventName } from 'viem' import type { Config } from '../../createConfig.js' -import type { UnionEvaluate, UnionOmit } from '../../types/utils.js' +import type { UnionCompute, UnionStrictOmit } from '../../types/utils.js' import { getAccount } from '../getAccount.js' import { getChainId } from '../getChainId.js' import { @@ -40,8 +40,8 @@ export type CreateWatchContractEventReturnType< config['chains'][number]['id'] = config['chains'][number]['id'], >( config: config, - parameters: UnionEvaluate< - UnionOmit< + parameters: UnionCompute< + UnionStrictOmit< WatchContractEventParameters, omittedProperties > diff --git a/packages/core/src/actions/codegen/createWriteContract.ts b/packages/core/src/actions/codegen/createWriteContract.ts index c29417a811..d886ad6a30 100644 --- a/packages/core/src/actions/codegen/createWriteContract.ts +++ b/packages/core/src/actions/codegen/createWriteContract.ts @@ -14,7 +14,11 @@ import type { ChainIdParameter, ConnectorParameter, } from '../../types/properties.js' -import type { Evaluate, UnionEvaluate, UnionOmit } from '../../types/utils.js' +import type { + Compute, + UnionCompute, + UnionStrictOmit, +} from '../../types/utils.js' import { getAccount } from '../getAccount.js' import { getChainId } from '../getChainId.js' import { @@ -59,9 +63,9 @@ export type CreateWriteContractReturnType< | (functionName extends undefined ? never : 'functionName'), >( config: config, - parameters: UnionEvaluate< + parameters: UnionCompute< { - [key in keyof chains]: UnionOmit< + [key in keyof chains]: UnionStrictOmit< viem_WriteContractParameters< abi, name, @@ -81,7 +85,7 @@ export type CreateWriteContractReturnType< | (chainId extends keyof address ? chainId : never) | undefined } - : Evaluate>) & + : Compute>) & ConnectorParameter & { __mode?: 'prepared' } >, ) => Promise diff --git a/packages/core/src/actions/connect.ts b/packages/core/src/actions/connect.ts index 223ab26909..9379951389 100644 --- a/packages/core/src/actions/connect.ts +++ b/packages/core/src/actions/connect.ts @@ -12,9 +12,9 @@ import { type ConnectorAlreadyConnectedErrorType, } from '../errors/config.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' -export type ConnectParameters = Evaluate< +export type ConnectParameters = Compute< ChainIdParameter & { connector: Connector | CreateConnectorFn } diff --git a/packages/core/src/actions/deployContract.ts b/packages/core/src/actions/deployContract.ts index c49591176a..a34f448bad 100644 --- a/packages/core/src/actions/deployContract.ts +++ b/packages/core/src/actions/deployContract.ts @@ -12,7 +12,7 @@ import type { ChainIdParameter, ConnectorParameter, } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' import { type GetConnectorClientErrorType, @@ -28,7 +28,7 @@ export type DeployContractParameters< allArgs = ContractConstructorArgs, chains extends readonly Chain[] = SelectChains, > = { - [key in keyof chains]: Evaluate< + [key in keyof chains]: Compute< Omit< viem_DeployContractParameters< abi, diff --git a/packages/core/src/actions/estimateFeesPerGas.ts b/packages/core/src/actions/estimateFeesPerGas.ts index 3808f294c8..66915f010a 100644 --- a/packages/core/src/actions/estimateFeesPerGas.ts +++ b/packages/core/src/actions/estimateFeesPerGas.ts @@ -15,15 +15,15 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' import type { Unit } from '../types/unit.js' -import type { Evaluate } from '../types/utils.js' -import type { UnionEvaluate, UnionLooseOmit } from '../types/utils.js' +import type { Compute } from '../types/utils.js' +import type { UnionCompute, UnionLooseOmit } from '../types/utils.js' import { getAction } from '../utils/getAction.js' import { getUnit } from '../utils/getUnit.js' export type EstimateFeesPerGasParameters< type extends FeeValuesType = FeeValuesType, config extends Config = Config, -> = UnionEvaluate< +> = UnionCompute< UnionLooseOmit< viem_EstimateFeesPerGasParameters, 'chain' @@ -36,10 +36,10 @@ export type EstimateFeesPerGasParameters< export type EstimateFeesPerGasReturnType< type extends FeeValuesType = FeeValuesType, -> = Evaluate< +> = Compute< viem_EstimateFeesPerGasReturnType & { /** @deprecated */ - formatted: UnionEvaluate< + formatted: UnionCompute< | (type extends 'legacy' ? FeeValuesLegacy : never) | (type extends 'eip1559' ? FeeValuesEIP1559 : never) > diff --git a/packages/core/src/actions/estimateGas.ts b/packages/core/src/actions/estimateGas.ts index 0cf282fdd7..c049fa42f8 100644 --- a/packages/core/src/actions/estimateGas.ts +++ b/packages/core/src/actions/estimateGas.ts @@ -13,7 +13,7 @@ import type { ChainIdParameter, ConnectorParameter, } from '../types/properties.js' -import type { UnionEvaluate, UnionLooseOmit } from '../types/utils.js' +import type { UnionCompute, UnionLooseOmit } from '../types/utils.js' import { getAction } from '../utils/getAction.js' import { type GetConnectorClientErrorType, @@ -28,7 +28,7 @@ export type EstimateGasParameters< /// chains extends readonly Chain[] = SelectChains, > = { - [key in keyof chains]: UnionEvaluate< + [key in keyof chains]: UnionCompute< UnionLooseOmit, 'chain'> & ChainIdParameter & ConnectorParameter diff --git a/packages/core/src/actions/estimateMaxPriorityFeePerGas.ts b/packages/core/src/actions/estimateMaxPriorityFeePerGas.ts index 41f47df1b6..06378d84fd 100644 --- a/packages/core/src/actions/estimateMaxPriorityFeePerGas.ts +++ b/packages/core/src/actions/estimateMaxPriorityFeePerGas.ts @@ -8,14 +8,14 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate, UnionLooseOmit } from '../types/utils.js' +import type { Compute, UnionLooseOmit } from '../types/utils.js' import { getAction } from '../utils/getAction.js' export type EstimateMaxPriorityFeePerGasParameters< config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = Evaluate< +> = Compute< UnionLooseOmit< viem_EstimateMaxPriorityFeePerGasParameters & ChainIdParameter, diff --git a/packages/core/src/actions/getBalance.ts b/packages/core/src/actions/getBalance.ts index 0592be05fe..63d079d25a 100644 --- a/packages/core/src/actions/getBalance.ts +++ b/packages/core/src/actions/getBalance.ts @@ -15,12 +15,12 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' import type { Unit } from '../types/unit.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' import { getUnit } from '../utils/getUnit.js' import { readContracts } from './readContracts.js' -export type GetBalanceParameters = Evaluate< +export type GetBalanceParameters = Compute< ChainIdParameter & viem_GetBalanceParameters & { /** @deprecated */ diff --git a/packages/core/src/actions/getBlock.ts b/packages/core/src/actions/getBlock.ts index 8d829eff36..babb52cd41 100644 --- a/packages/core/src/actions/getBlock.ts +++ b/packages/core/src/actions/getBlock.ts @@ -9,7 +9,7 @@ import { import type { Config } from '../createConfig.js' import type { SelectChains } from '../types/chain.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate, IsNarrowable } from '../types/utils.js' +import type { Compute, IsNarrowable } from '../types/utils.js' import { getAction } from '../utils/getAction.js' export type GetBlockParameters< @@ -18,7 +18,7 @@ export type GetBlockParameters< config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = Evaluate< +> = Compute< viem_GetBlockParameters & ChainIdParameter > @@ -31,7 +31,7 @@ export type GetBlockReturnType< config['chains'][number]['id'] = config['chains'][number]['id'], /// chains extends readonly Chain[] = SelectChains, -> = Evaluate< +> = Compute< { [key in keyof chains]: viem_GetBlockReturnType< IsNarrowable extends true ? chains[key] : undefined, diff --git a/packages/core/src/actions/getBlockNumber.ts b/packages/core/src/actions/getBlockNumber.ts index 7a5065a028..ecad7c0f67 100644 --- a/packages/core/src/actions/getBlockNumber.ts +++ b/packages/core/src/actions/getBlockNumber.ts @@ -7,14 +7,14 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' export type GetBlockNumberParameters< config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = Evaluate> +> = Compute> export type GetBlockNumberReturnType = viem_GetBlockNumberReturnType diff --git a/packages/core/src/actions/getBlockTransactionCount.ts b/packages/core/src/actions/getBlockTransactionCount.ts index 13c3cd1757..e30aca976a 100644 --- a/packages/core/src/actions/getBlockTransactionCount.ts +++ b/packages/core/src/actions/getBlockTransactionCount.ts @@ -7,14 +7,14 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { UnionEvaluate } from '../types/utils.js' +import type { UnionCompute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' export type GetBlockTransactionCountParameters< config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = UnionEvaluate< +> = UnionCompute< viem_GetBlockTransactionCountParameters & ChainIdParameter > diff --git a/packages/core/src/actions/getBytecode.ts b/packages/core/src/actions/getBytecode.ts index 843e2c808e..2ece822a86 100644 --- a/packages/core/src/actions/getBytecode.ts +++ b/packages/core/src/actions/getBytecode.ts @@ -7,10 +7,10 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' -export type GetBytecodeParameters = Evaluate< +export type GetBytecodeParameters = Compute< viem_GetBytecodeParameters & ChainIdParameter > diff --git a/packages/core/src/actions/getClient.ts b/packages/core/src/actions/getClient.ts index 3bc7d45729..82f1c6c171 100644 --- a/packages/core/src/actions/getClient.ts +++ b/packages/core/src/actions/getClient.ts @@ -2,7 +2,7 @@ import type { Client } from 'viem' import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate, IsNarrowable } from '../types/utils.js' +import type { Compute, IsNarrowable } from '../types/utils.js' export type GetClientParameters< config extends Config = Config, @@ -29,7 +29,7 @@ export type GetClientReturnType< : config['chains'][number]['id'] : config['chains'][number]['id'] | undefined, > = resolvedChainId extends config['chains'][number]['id'] - ? Evaluate< + ? Compute< Client< config['_internal']['transports'][resolvedChainId], Extract diff --git a/packages/core/src/actions/getConnections.ts b/packages/core/src/actions/getConnections.ts index 45fb53a4b3..72cdbc27d7 100644 --- a/packages/core/src/actions/getConnections.ts +++ b/packages/core/src/actions/getConnections.ts @@ -1,8 +1,8 @@ import type { Config, Connection } from '../createConfig.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { deepEqual } from '../utils/deepEqual.js' -export type GetConnectionsReturnType = Evaluate[] +export type GetConnectionsReturnType = Compute[] let previousConnections: Connection[] = [] diff --git a/packages/core/src/actions/getConnectorClient.ts b/packages/core/src/actions/getConnectorClient.ts index a2645ecc13..c613644d88 100644 --- a/packages/core/src/actions/getConnectorClient.ts +++ b/packages/core/src/actions/getConnectorClient.ts @@ -22,13 +22,13 @@ import type { ChainIdParameter, ConnectorParameter, } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' export type GetConnectorClientParameters< config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = Evaluate< +> = Compute< ChainIdParameter & ConnectorParameter & { account?: Address | Account | undefined @@ -39,7 +39,7 @@ export type GetConnectorClientReturnType< config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = Evaluate< +> = Compute< Client< config['_internal']['transports'][chainId], Extract, diff --git a/packages/core/src/actions/getEnsAddress.ts b/packages/core/src/actions/getEnsAddress.ts index ead84efe4d..5f882999be 100644 --- a/packages/core/src/actions/getEnsAddress.ts +++ b/packages/core/src/actions/getEnsAddress.ts @@ -7,10 +7,10 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' -export type GetEnsAddressParameters = Evaluate< +export type GetEnsAddressParameters = Compute< viem_GetEnsAddressParameters & ChainIdParameter > diff --git a/packages/core/src/actions/getEnsAvatar.ts b/packages/core/src/actions/getEnsAvatar.ts index a364971989..e6c3855d13 100644 --- a/packages/core/src/actions/getEnsAvatar.ts +++ b/packages/core/src/actions/getEnsAvatar.ts @@ -7,10 +7,10 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' -export type GetEnsAvatarParameters = Evaluate< +export type GetEnsAvatarParameters = Compute< viem_GetEnsAvatarParameters & ChainIdParameter > diff --git a/packages/core/src/actions/getEnsName.ts b/packages/core/src/actions/getEnsName.ts index a30c24df4b..e6ab338db4 100644 --- a/packages/core/src/actions/getEnsName.ts +++ b/packages/core/src/actions/getEnsName.ts @@ -7,10 +7,10 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' -export type GetEnsNameParameters = Evaluate< +export type GetEnsNameParameters = Compute< viem_GetEnsNameParameters & ChainIdParameter > diff --git a/packages/core/src/actions/getEnsResolver.ts b/packages/core/src/actions/getEnsResolver.ts index 0c00732fdd..ab59b7d76c 100644 --- a/packages/core/src/actions/getEnsResolver.ts +++ b/packages/core/src/actions/getEnsResolver.ts @@ -7,10 +7,10 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' -export type GetEnsResolverParameters = Evaluate< +export type GetEnsResolverParameters = Compute< viem_GetEnsResolverParameters & ChainIdParameter > diff --git a/packages/core/src/actions/getEnsText.ts b/packages/core/src/actions/getEnsText.ts index 2c3948977a..d786f72b78 100644 --- a/packages/core/src/actions/getEnsText.ts +++ b/packages/core/src/actions/getEnsText.ts @@ -7,10 +7,10 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' -export type GetEnsTextParameters = Evaluate< +export type GetEnsTextParameters = Compute< viem_GetEnsTextParameters & ChainIdParameter > diff --git a/packages/core/src/actions/getFeeHistory.ts b/packages/core/src/actions/getFeeHistory.ts index 02bf8ed16a..9588214139 100644 --- a/packages/core/src/actions/getFeeHistory.ts +++ b/packages/core/src/actions/getFeeHistory.ts @@ -7,14 +7,14 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' export type GetFeeHistoryParameters< config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = Evaluate> +> = Compute> export type GetFeeHistoryReturnType = viem_GetFeeHistoryReturnType diff --git a/packages/core/src/actions/getGasPrice.ts b/packages/core/src/actions/getGasPrice.ts index 59fedc2109..c6482c44a2 100644 --- a/packages/core/src/actions/getGasPrice.ts +++ b/packages/core/src/actions/getGasPrice.ts @@ -6,14 +6,14 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' export type GetGasPriceParameters< config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = Evaluate> +> = Compute> export type GetGasPriceReturnType = viem_GetGasPriceReturnType diff --git a/packages/core/src/actions/getProof.ts b/packages/core/src/actions/getProof.ts index d260817f1b..ee9ec218d3 100644 --- a/packages/core/src/actions/getProof.ts +++ b/packages/core/src/actions/getProof.ts @@ -7,10 +7,10 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' -export type GetProofParameters = Evaluate< +export type GetProofParameters = Compute< viem_GetProofParameters & ChainIdParameter > diff --git a/packages/core/src/actions/getPublicClient.ts b/packages/core/src/actions/getPublicClient.ts index 3d051e4517..1fbd53ed30 100644 --- a/packages/core/src/actions/getPublicClient.ts +++ b/packages/core/src/actions/getPublicClient.ts @@ -2,7 +2,7 @@ import { type Client, type PublicClient, publicActions } from 'viem' import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate, IsNarrowable } from '../types/utils.js' +import type { Compute, IsNarrowable } from '../types/utils.js' import { getClient } from './getClient.js' export type GetPublicClientParameters< @@ -29,7 +29,7 @@ export type GetPublicClientReturnType< : config['chains'][number]['id'] : config['chains'][number]['id'] | undefined, > = resolvedChainId extends config['chains'][number]['id'] - ? Evaluate< + ? Compute< PublicClient< config['_internal']['transports'][resolvedChainId], Extract diff --git a/packages/core/src/actions/getStorageAt.ts b/packages/core/src/actions/getStorageAt.ts index 1c29cfcfea..a07ec081b7 100644 --- a/packages/core/src/actions/getStorageAt.ts +++ b/packages/core/src/actions/getStorageAt.ts @@ -7,10 +7,10 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' -export type GetStorageAtParameters = Evaluate< +export type GetStorageAtParameters = Compute< viem_GetStorageAtParameters & ChainIdParameter > diff --git a/packages/core/src/actions/getToken.ts b/packages/core/src/actions/getToken.ts index c165e8baaf..480a742820 100644 --- a/packages/core/src/actions/getToken.ts +++ b/packages/core/src/actions/getToken.ts @@ -9,11 +9,11 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' import type { Unit } from '../types/unit.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getUnit } from '../utils/getUnit.js' import { type ReadContractsErrorType, readContracts } from './readContracts.js' -export type GetTokenParameters = Evaluate< +export type GetTokenParameters = Compute< ChainIdParameter & { address: Address formatUnits?: Unit | undefined diff --git a/packages/core/src/actions/getTransaction.ts b/packages/core/src/actions/getTransaction.ts index 4c73aa632f..0148282811 100644 --- a/packages/core/src/actions/getTransaction.ts +++ b/packages/core/src/actions/getTransaction.ts @@ -9,14 +9,14 @@ import { import type { Config } from '../createConfig.js' import type { SelectChains } from '../types/chain.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate, IsNarrowable } from '../types/utils.js' +import type { Compute, IsNarrowable } from '../types/utils.js' import { getAction } from '../utils/getAction.js' export type GetTransactionParameters< config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = Evaluate> +> = Compute> export type GetTransactionReturnType< config extends Config = Config, @@ -24,7 +24,7 @@ export type GetTransactionReturnType< config['chains'][number]['id'] = config['chains'][number]['id'], /// chains extends readonly Chain[] = SelectChains, -> = Evaluate< +> = Compute< { [key in keyof chains]: viem_GetTransactionReturnType< IsNarrowable extends true ? chains[key] : undefined diff --git a/packages/core/src/actions/getTransactionCount.ts b/packages/core/src/actions/getTransactionCount.ts index 873e400f87..6872e6ede6 100644 --- a/packages/core/src/actions/getTransactionCount.ts +++ b/packages/core/src/actions/getTransactionCount.ts @@ -7,11 +7,11 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' export type GetTransactionCountParameters = - Evaluate & viem_GetTransactionCountParameters> + Compute & viem_GetTransactionCountParameters> export type GetTransactionCountReturnType = viem_GetTransactionCountReturnType diff --git a/packages/core/src/actions/getTransactionReceipt.ts b/packages/core/src/actions/getTransactionReceipt.ts index d4eb1a6634..8c06e36ba6 100644 --- a/packages/core/src/actions/getTransactionReceipt.ts +++ b/packages/core/src/actions/getTransactionReceipt.ts @@ -9,14 +9,14 @@ import { import type { Config } from '../createConfig.js' import type { SelectChains } from '../types/chain.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate, IsNarrowable } from '../types/utils.js' +import type { Compute, IsNarrowable } from '../types/utils.js' import { getAction } from '../utils/getAction.js' export type GetTransactionReceiptParameters< config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = Evaluate< +> = Compute< viem_GetTransactionReceiptParameters & ChainIdParameter > @@ -26,7 +26,7 @@ export type GetTransactionReceiptReturnType< config['chains'][number]['id'] = config['chains'][number]['id'], /// chains extends readonly Chain[] = SelectChains, -> = Evaluate< +> = Compute< { [key in keyof chains]: viem_GetTransactionReceiptReturnType< IsNarrowable extends true ? chains[key] : undefined diff --git a/packages/core/src/actions/getWalletClient.ts b/packages/core/src/actions/getWalletClient.ts index 931c65ba35..1d31af1734 100644 --- a/packages/core/src/actions/getWalletClient.ts +++ b/packages/core/src/actions/getWalletClient.ts @@ -2,7 +2,7 @@ import { type Account, type WalletClient, walletActions } from 'viem' import type { Config } from '../createConfig.js' import type { BaseErrorType, ErrorType } from '../errors/base.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { type GetConnectorClientErrorType, type GetConnectorClientParameters, @@ -19,7 +19,7 @@ export type GetWalletClientReturnType< config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = Evaluate< +> = Compute< WalletClient< config['_internal']['transports'][chainId], Extract, diff --git a/packages/core/src/actions/prepareTransactionRequest.ts b/packages/core/src/actions/prepareTransactionRequest.ts index fd790f2491..36ed81f774 100644 --- a/packages/core/src/actions/prepareTransactionRequest.ts +++ b/packages/core/src/actions/prepareTransactionRequest.ts @@ -13,10 +13,10 @@ import type { Config } from '../createConfig.js' import type { SelectChains } from '../types/chain.js' import type { ChainIdParameter } from '../types/properties.js' import type { - Evaluate, + Compute, IsNarrowable, - UnionEvaluate, - UnionOmit, + UnionCompute, + UnionStrictOmit, } from '../types/utils.js' import { getAction } from '../utils/getAction.js' import { getAccount } from './getAccount.js' @@ -36,8 +36,8 @@ export type PrepareTransactionRequestParameters< /// chains extends readonly Chain[] = SelectChains, > = { - [key in keyof chains]: UnionEvaluate< - UnionOmit< + [key in keyof chains]: UnionCompute< + UnionStrictOmit< viem_PrepareTransactionRequestParameters< chains[key], Account, @@ -73,7 +73,7 @@ export type PrepareTransactionRequestReturnType< /// chains extends readonly Chain[] = SelectChains, > = { - [key in keyof chains]: Evaluate< + [key in keyof chains]: Compute< viem_PrepareTransactionRequestReturnType< IsNarrowable extends true ? chains[key] : undefined, Account, diff --git a/packages/core/src/actions/reconnect.ts b/packages/core/src/actions/reconnect.ts index 43e54f4222..2234c934d4 100644 --- a/packages/core/src/actions/reconnect.ts +++ b/packages/core/src/actions/reconnect.ts @@ -3,14 +3,14 @@ import type { Address } from 'viem' import type { CreateConnectorFn } from '../connectors/createConnector.js' import type { Config, Connection, Connector } from '../createConfig.js' import type { ErrorType } from '../errors/base.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' export type ReconnectParameters = { /** Connectors to attempt reconnect with */ connectors?: readonly (CreateConnectorFn | Connector)[] | undefined } -export type ReconnectReturnType = Evaluate[] +export type ReconnectReturnType = Compute[] export type ReconnectErrorType = ErrorType diff --git a/packages/core/src/actions/sendTransaction.ts b/packages/core/src/actions/sendTransaction.ts index da4b7e02dc..162071d8dc 100644 --- a/packages/core/src/actions/sendTransaction.ts +++ b/packages/core/src/actions/sendTransaction.ts @@ -19,7 +19,7 @@ import type { ChainIdParameter, ConnectorParameter, } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' import { getAccount } from './getAccount.js' import { @@ -34,7 +34,7 @@ export type SendTransactionParameters< /// chains extends readonly Chain[] = SelectChains, > = { - [key in keyof chains]: Evaluate< + [key in keyof chains]: Compute< Omit< viem_SendTransactionParameters, 'chain' | 'gas' diff --git a/packages/core/src/actions/signMessage.ts b/packages/core/src/actions/signMessage.ts index 2c4a6fa958..67f0c293a6 100644 --- a/packages/core/src/actions/signMessage.ts +++ b/packages/core/src/actions/signMessage.ts @@ -9,14 +9,14 @@ import { import type { Config } from '../createConfig.js' import type { BaseErrorType, ErrorType } from '../errors/base.js' import type { ConnectorParameter } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' import { type GetConnectorClientErrorType, getConnectorClient, } from './getConnectorClient.js' -export type SignMessageParameters = Evaluate< +export type SignMessageParameters = Compute< viem_SignMessageParameters & ConnectorParameter > diff --git a/packages/core/src/actions/signTypedData.ts b/packages/core/src/actions/signTypedData.ts index 41fcf5c762..22cea12662 100644 --- a/packages/core/src/actions/signTypedData.ts +++ b/packages/core/src/actions/signTypedData.ts @@ -9,7 +9,7 @@ import { import type { Config } from '../createConfig.js' import type { BaseErrorType, ErrorType } from '../errors/base.js' import type { ConnectorParameter } from '../types/properties.js' -import type { UnionEvaluate } from '../types/utils.js' +import type { UnionCompute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' import { type GetConnectorClientErrorType, @@ -21,7 +21,7 @@ export type SignTypedDataParameters< primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData, /// primaryTypes = typedData extends TypedData ? keyof typedData : string, -> = UnionEvaluate< +> = UnionCompute< viem_SignTypedDataParameters & ConnectorParameter > diff --git a/packages/core/src/actions/simulateContract.ts b/packages/core/src/actions/simulateContract.ts index f9058db998..6d9713ab18 100644 --- a/packages/core/src/actions/simulateContract.ts +++ b/packages/core/src/actions/simulateContract.ts @@ -21,10 +21,10 @@ import type { ConnectorParameter, } from '../types/properties.js' import type { - Evaluate, + Compute, PartialBy, - UnionEvaluate, - UnionOmit, + UnionCompute, + UnionStrictOmit, } from '../types/utils.js' import { getAction } from '../utils/getAction.js' import { @@ -50,8 +50,8 @@ export type SimulateContractParameters< /// chains extends readonly Chain[] = SelectChains, > = { - [key in keyof chains]: UnionEvaluate< - UnionOmit< + [key in keyof chains]: UnionCompute< + UnionStrictOmit< viem_SimulateContractParameters< abi, functionName, @@ -94,7 +94,7 @@ export type SimulateContractReturnType< chains[key] > & { chainId: chains[key]['id'] - request: Evaluate< + request: Compute< PartialBy< { __mode: 'prepared'; chainId: chainId; chain: chains[key] }, chainId extends config['chains'][number]['id'] ? never : 'chainId' diff --git a/packages/core/src/actions/switchChain.ts b/packages/core/src/actions/switchChain.ts index 6428da14b9..59f337d141 100644 --- a/packages/core/src/actions/switchChain.ts +++ b/packages/core/src/actions/switchChain.ts @@ -16,17 +16,17 @@ import { type SwitchChainNotSupportedErrorType, } from '../errors/connector.js' import type { ConnectorParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' export type SwitchChainParameters< config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = Evaluate< +> = Compute< ConnectorParameter & { chainId: chainId | config['chains'][number]['id'] addEthereumChainParameter?: - | Evaluate>> + | Compute>> | undefined } > diff --git a/packages/core/src/actions/verifyMessage.ts b/packages/core/src/actions/verifyMessage.ts index 4e40d31c44..851f8589fa 100644 --- a/packages/core/src/actions/verifyMessage.ts +++ b/packages/core/src/actions/verifyMessage.ts @@ -7,10 +7,10 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' -export type VerifyMessageParameters = Evaluate< +export type VerifyMessageParameters = Compute< viem_VerifyMessageParameters & ChainIdParameter > diff --git a/packages/core/src/actions/verifyTypedData.ts b/packages/core/src/actions/verifyTypedData.ts index fef5223e6a..4fac5463f5 100644 --- a/packages/core/src/actions/verifyTypedData.ts +++ b/packages/core/src/actions/verifyTypedData.ts @@ -8,14 +8,14 @@ import { import type { Config } from '../createConfig.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' export type VerifyTypedDataParameters< typedData extends TypedData | Record = TypedData, primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData, config extends Config = Config, -> = Evaluate< +> = Compute< viem_VerifyTypedDataParameters & ChainIdParameter > diff --git a/packages/core/src/actions/waitForTransactionReceipt.ts b/packages/core/src/actions/waitForTransactionReceipt.ts index 4c841d9409..4203fac7e7 100644 --- a/packages/core/src/actions/waitForTransactionReceipt.ts +++ b/packages/core/src/actions/waitForTransactionReceipt.ts @@ -12,14 +12,14 @@ import { import type { Config } from '../createConfig.js' import type { SelectChains } from '../types/chain.js' import type { ChainIdParameter } from '../types/properties.js' -import type { Evaluate, IsNarrowable } from '../types/utils.js' +import type { Compute, IsNarrowable } from '../types/utils.js' import { getAction } from '../utils/getAction.js' export type WaitForTransactionReceiptParameters< config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = Evaluate< +> = Compute< viem_WaitForTransactionReceiptParameters & ChainIdParameter > @@ -29,7 +29,7 @@ export type WaitForTransactionReceiptReturnType< config['chains'][number]['id'] = config['chains'][number]['id'], /// chains extends readonly Chain[] = SelectChains, -> = Evaluate< +> = Compute< { [key in keyof chains]: viem_WaitForTransactionReceiptReturnType< IsNarrowable extends true ? chains[key] : undefined diff --git a/packages/core/src/actions/watchBlockNumber.ts b/packages/core/src/actions/watchBlockNumber.ts index 3f19994992..712849080a 100644 --- a/packages/core/src/actions/watchBlockNumber.ts +++ b/packages/core/src/actions/watchBlockNumber.ts @@ -11,7 +11,7 @@ import type { ChainIdParameter, SyncConnectedChainParameter, } from '../types/properties.js' -import type { UnionEvaluate } from '../types/utils.js' +import type { UnionCompute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' export type WatchBlockNumberParameters< @@ -21,7 +21,7 @@ export type WatchBlockNumberParameters< /// chains extends readonly Chain[] = SelectChains, > = { - [key in keyof chains]: UnionEvaluate< + [key in keyof chains]: UnionCompute< viem_WatchBlockNumberParameters< config['_internal']['transports'][chains[key]['id']] extends infer transport extends Transport diff --git a/packages/core/src/actions/watchBlocks.ts b/packages/core/src/actions/watchBlocks.ts index 5da00f93a3..c6f3225dc9 100644 --- a/packages/core/src/actions/watchBlocks.ts +++ b/packages/core/src/actions/watchBlocks.ts @@ -11,7 +11,7 @@ import type { ChainIdParameter, SyncConnectedChainParameter, } from '../types/properties.js' -import type { IsNarrowable, UnionEvaluate } from '../types/utils.js' +import type { IsNarrowable, UnionCompute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' export type WatchBlocksParameters< @@ -23,7 +23,7 @@ export type WatchBlocksParameters< /// chains extends readonly Chain[] = SelectChains, > = { - [key in keyof chains]: UnionEvaluate< + [key in keyof chains]: UnionCompute< viem_WatchBlocksParameters< config['_internal']['transports'][chains[key]['id']] extends infer transport extends Transport diff --git a/packages/core/src/actions/watchContractEvent.ts b/packages/core/src/actions/watchContractEvent.ts index 66ff492bb0..ddc15741da 100644 --- a/packages/core/src/actions/watchContractEvent.ts +++ b/packages/core/src/actions/watchContractEvent.ts @@ -17,7 +17,7 @@ import type { ChainIdParameter, SyncConnectedChainParameter, } from '../types/properties.js' -import type { UnionEvaluate } from '../types/utils.js' +import type { UnionCompute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' export type WatchContractEventParameters< @@ -30,7 +30,7 @@ export type WatchContractEventParameters< /// chains extends readonly Chain[] = SelectChains, > = { - [key in keyof chains]: UnionEvaluate< + [key in keyof chains]: UnionCompute< viem_WatchContractEventParameters< abi, eventName, diff --git a/packages/core/src/actions/watchPendingTransactions.ts b/packages/core/src/actions/watchPendingTransactions.ts index 627b05c83b..29f0354501 100644 --- a/packages/core/src/actions/watchPendingTransactions.ts +++ b/packages/core/src/actions/watchPendingTransactions.ts @@ -11,7 +11,7 @@ import type { ChainIdParameter, SyncConnectedChainParameter, } from '../types/properties.js' -import type { UnionEvaluate } from '../types/utils.js' +import type { UnionCompute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' export type WatchPendingTransactionsParameters< @@ -21,7 +21,7 @@ export type WatchPendingTransactionsParameters< /// chains extends readonly Chain[] = SelectChains, > = { - [key in keyof chains]: UnionEvaluate< + [key in keyof chains]: UnionCompute< viem_WatchPendingTransactionsParameters< config['_internal']['transports'][chains[key]['id']] extends infer transport extends Transport diff --git a/packages/core/src/actions/writeContract.ts b/packages/core/src/actions/writeContract.ts index b074437ba0..99517f860e 100644 --- a/packages/core/src/actions/writeContract.ts +++ b/packages/core/src/actions/writeContract.ts @@ -20,7 +20,7 @@ import type { ChainIdParameter, ConnectorParameter, } from '../types/properties.js' -import type { Evaluate, UnionEvaluate } from '../types/utils.js' +import type { Compute, UnionCompute } from '../types/utils.js' import { getAction } from '../utils/getAction.js' import { getAccount } from './getAccount.js' import { @@ -49,9 +49,9 @@ export type WriteContractParameters< /// allFunctionNames = ContractFunctionName, chains extends readonly Chain[] = SelectChains, -> = UnionEvaluate< +> = UnionCompute< { - // TODO: Should use `UnionOmit<..., 'chain'>` on `viem_WriteContractParameters` result instead + // TODO: Should use `UnionStrictOmit<..., 'chain'>` on `viem_WriteContractParameters` result instead // temp workaround that doesn't affect runtime behavior for for https://github.com/wevm/wagmi/issues/3981 [key in keyof chains]: viem_WriteContractParameters< abi, @@ -63,7 +63,7 @@ export type WriteContractParameters< allFunctionNames > }[number] & - Evaluate> & + Compute> & ConnectorParameter & { __mode?: 'prepared' } > diff --git a/packages/core/src/connectors/createConnector.ts b/packages/core/src/connectors/createConnector.ts index 86b68c8556..c749f9a41f 100644 --- a/packages/core/src/connectors/createConnector.ts +++ b/packages/core/src/connectors/createConnector.ts @@ -9,7 +9,7 @@ import type { import type { Emitter } from '../createEmitter.js' import type { Storage } from '../createStorage.js' -import type { Evaluate, ExactPartial, Omit } from '../types/utils.js' +import type { Compute, ExactPartial, StrictOmit } from '../types/utils.js' export type ConnectorEventMap = { change: { @@ -29,8 +29,8 @@ export type CreateConnectorFn< > = (config: { chains: readonly [Chain, ...Chain[]] emitter: Emitter - storage?: Evaluate> | null | undefined -}) => Evaluate< + storage?: Compute> | null | undefined +}) => Compute< { readonly icon?: string | undefined readonly id: string @@ -58,9 +58,9 @@ export type CreateConnectorFn< ): Promise isAuthorized(): Promise switchChain?( - parameters: Evaluate<{ + parameters: Compute<{ addEthereumChainParameter?: - | ExactPartial> + | ExactPartial> | undefined chainId: number }>, diff --git a/packages/core/src/connectors/injected.ts b/packages/core/src/connectors/injected.ts index ab08033a22..d629b22074 100644 --- a/packages/core/src/connectors/injected.ts +++ b/packages/core/src/connectors/injected.ts @@ -17,7 +17,7 @@ import { import type { Connector } from '../createConfig.js' import { ChainNotConfiguredError } from '../errors/config.js' import { ProviderNotFoundError } from '../errors/connector.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import { createConnector } from './createConnector.js' export type InjectedParameters = { @@ -94,7 +94,7 @@ injected.type = 'injected' as const export function injected(parameters: InjectedParameters = {}) { const { shimDisconnect = true, unstable_shimAsyncInject } = parameters - function getTarget(): Evaluate { + function getTarget(): Compute { const target = parameters.target if (typeof target === 'function') { const result = target() @@ -582,7 +582,7 @@ type Target = { } /** @deprecated */ -type TargetId = Evaluate extends `is${infer name}` +type TargetId = Compute extends `is${infer name}` ? name extends `${infer char}${infer rest}` ? `${Lowercase}${rest}` : never @@ -630,7 +630,7 @@ type WalletProviderFlags = | 'isXDEFI' | 'isZerion' -type WalletProvider = Evaluate< +type WalletProvider = Compute< EIP1193Provider & { [key in WalletProviderFlags]?: true | undefined } & { diff --git a/packages/core/src/createConfig.ts b/packages/core/src/createConfig.ts index b79de0eefb..7cdd9058a6 100644 --- a/packages/core/src/createConfig.ts +++ b/packages/core/src/createConfig.ts @@ -23,7 +23,7 @@ import { type Emitter, type EventData, createEmitter } from './createEmitter.js' import { type Storage, createStorage, noopStorage } from './createStorage.js' import { ChainNotConfiguredError } from './errors/config.js' import type { - Evaluate, + Compute, ExactPartial, LooseOmit, OneOf, @@ -38,7 +38,7 @@ export type CreateConfigParameters< chains[number]['id'], Transport >, -> = Evaluate< +> = Compute< { chains: chains connectors?: CreateConnectorFn[] | undefined @@ -549,7 +549,7 @@ export type State< status: 'connected' | 'connecting' | 'disconnected' | 'reconnecting' } -export type PartializedState = Evaluate< +export type PartializedState = Compute< ExactPartial> > diff --git a/packages/core/src/createStorage.ts b/packages/core/src/createStorage.ts index 39a02dc76a..5667e8ee89 100644 --- a/packages/core/src/createStorage.ts +++ b/packages/core/src/createStorage.ts @@ -1,5 +1,5 @@ import type { PartializedState } from './createConfig.js' -import type { Evaluate } from './types/utils.js' +import type { Compute } from './types/utils.js' import { deserialize as deserialize_ } from './utils/deserialize.js' import { serialize as serialize_ } from './utils/serialize.js' @@ -44,13 +44,13 @@ export type CreateStorageParameters = { deserialize?: ((value: string) => T) | undefined key?: string | undefined serialize?: ((value: T) => string) | undefined - storage?: Evaluate | undefined + storage?: Compute | undefined } export function createStorage< itemMap extends Record = Record, storageItemMap extends StorageItemMap = StorageItemMap & itemMap, ->(parameters: CreateStorageParameters): Evaluate> { +>(parameters: CreateStorageParameters): Compute> { const { deserialize = deserialize_, key: prefix = 'wagmi', diff --git a/packages/core/src/errors/base.ts b/packages/core/src/errors/base.ts index 1d832f0864..8540c1da7b 100644 --- a/packages/core/src/errors/base.ts +++ b/packages/core/src/errors/base.ts @@ -1,9 +1,9 @@ -import type { Evaluate, OneOf } from '../types/utils.js' +import type { Compute, OneOf } from '../types/utils.js' import { getVersion } from '../utils/getVersion.js' export type ErrorType = Error & { name: name } -type BaseErrorOptions = Evaluate< +type BaseErrorOptions = Compute< OneOf<{ details?: string | undefined } | { cause: BaseError | Error }> & { docsPath?: string | undefined docsSlug?: string | undefined diff --git a/packages/core/src/experimental/actions/sendCalls.ts b/packages/core/src/experimental/actions/sendCalls.ts index 6184127002..8f4985e320 100644 --- a/packages/core/src/experimental/actions/sendCalls.ts +++ b/packages/core/src/experimental/actions/sendCalls.ts @@ -17,7 +17,7 @@ import type { ChainIdParameter, ConnectorParameter, } from '../../types/properties.js' -import type { Evaluate } from '../../types/utils.js' +import type { Compute } from '../../types/utils.js' export type SendCallsParameters< config extends Config = Config, @@ -26,7 +26,7 @@ export type SendCallsParameters< /// chains extends readonly Chain[] = SelectChains, > = { - [key in keyof chains]: Evaluate< + [key in keyof chains]: Compute< Omit, 'chain'> & ChainIdParameter & ConnectorParameter diff --git a/packages/core/src/experimental/actions/writeContracts.ts b/packages/core/src/experimental/actions/writeContracts.ts index 11b2fd61b9..06e6687592 100644 --- a/packages/core/src/experimental/actions/writeContracts.ts +++ b/packages/core/src/experimental/actions/writeContracts.ts @@ -17,7 +17,7 @@ import type { ChainIdParameter, ConnectorParameter, } from '../../types/properties.js' -import type { Evaluate } from '../../types/utils.js' +import type { Compute } from '../../types/utils.js' export type WriteContractsParameters< contracts extends readonly unknown[] = readonly ContractFunctionParameters[], @@ -27,7 +27,7 @@ export type WriteContractsParameters< /// chains extends readonly Chain[] = SelectChains, > = { - [key in keyof chains]: Evaluate< + [key in keyof chains]: Compute< Omit< viem_WriteContractsParameters< contracts, diff --git a/packages/core/src/experimental/query/getCallsStatus.ts b/packages/core/src/experimental/query/getCallsStatus.ts index 9a156b4f2f..e520701ad3 100644 --- a/packages/core/src/experimental/query/getCallsStatus.ts +++ b/packages/core/src/experimental/query/getCallsStatus.ts @@ -4,7 +4,7 @@ import type { Config } from '../../createConfig.js' import { ConnectorNotConnectedError } from '../../errors/config.js' import { filterQueryOptions } from '../../query/utils.js' import type { ScopeKeyParameter } from '../../types/properties.js' -import type { Evaluate } from '../../types/utils.js' +import type { Compute } from '../../types/utils.js' import { type GetCallsStatusErrorType, type GetCallsStatusParameters, @@ -12,7 +12,7 @@ import { getCallsStatus, } from '../actions/getCallsStatus.js' -export type GetCallsStatusOptions = Evaluate< +export type GetCallsStatusOptions = Compute< GetCallsStatusParameters & ScopeKeyParameter > diff --git a/packages/core/src/experimental/query/getCapabilities.ts b/packages/core/src/experimental/query/getCapabilities.ts index e89b025a01..4d21e780db 100644 --- a/packages/core/src/experimental/query/getCapabilities.ts +++ b/packages/core/src/experimental/query/getCapabilities.ts @@ -4,7 +4,7 @@ import type { Config } from '../../createConfig.js' import { ConnectorNotConnectedError } from '../../errors/config.js' import { filterQueryOptions } from '../../query/utils.js' import type { ScopeKeyParameter } from '../../types/properties.js' -import type { Evaluate, ExactPartial } from '../../types/utils.js' +import type { Compute, ExactPartial } from '../../types/utils.js' import { type GetCapabilitiesErrorType, type GetCapabilitiesParameters, @@ -12,7 +12,7 @@ import { getCapabilities, } from '../actions/getCapabilities.js' -export type GetCapabilitiesOptions = Evaluate< +export type GetCapabilitiesOptions = Compute< ExactPartial & ScopeKeyParameter > diff --git a/packages/core/src/experimental/query/sendCalls.ts b/packages/core/src/experimental/query/sendCalls.ts index 61caf37d80..a28b970943 100644 --- a/packages/core/src/experimental/query/sendCalls.ts +++ b/packages/core/src/experimental/query/sendCalls.ts @@ -1,7 +1,7 @@ import type { MutateOptions, MutationOptions } from '@tanstack/query-core' import type { Config } from '../../createConfig.js' -import type { Evaluate } from '../../types/utils.js' +import type { Compute } from '../../types/utils.js' import { type SendCallsErrorType, type SendCallsParameters, @@ -24,7 +24,7 @@ export function sendCallsMutationOptions( > } -export type SendCallsData = Evaluate +export type SendCallsData = Compute export type SendCallsVariables< config extends Config, @@ -36,11 +36,11 @@ export type SendCallsMutate = < >( variables: SendCallsVariables, options?: - | Evaluate< + | Compute< MutateOptions< SendCallsData, SendCallsErrorType, - Evaluate>, + Compute>, context > > @@ -52,11 +52,11 @@ export type SendCallsMutateAsync = < >( variables: SendCallsVariables, options?: - | Evaluate< + | Compute< MutateOptions< SendCallsData, SendCallsErrorType, - Evaluate>, + Compute>, context > > diff --git a/packages/core/src/experimental/query/showCallsStatus.ts b/packages/core/src/experimental/query/showCallsStatus.ts index 315422ee69..1d684e9523 100644 --- a/packages/core/src/experimental/query/showCallsStatus.ts +++ b/packages/core/src/experimental/query/showCallsStatus.ts @@ -1,7 +1,7 @@ import type { MutateOptions, MutationOptions } from '@tanstack/query-core' import type { Config } from '../../createConfig.js' -import type { Evaluate } from '../../types/utils.js' +import type { Compute } from '../../types/utils.js' import { type ShowCallsStatusErrorType, type ShowCallsStatusParameters, @@ -24,18 +24,18 @@ export function showCallsStatusMutationOptions( > } -export type ShowCallsStatusData = Evaluate +export type ShowCallsStatusData = Compute export type ShowCallsStatusVariables = ShowCallsStatusParameters export type ShowCallsStatusMutate = ( variables: ShowCallsStatusVariables, options?: - | Evaluate< + | Compute< MutateOptions< ShowCallsStatusData, ShowCallsStatusErrorType, - Evaluate, + Compute, context > > @@ -45,11 +45,11 @@ export type ShowCallsStatusMutate = ( export type ShowCallsStatusMutateAsync = ( variables: ShowCallsStatusVariables, options?: - | Evaluate< + | Compute< MutateOptions< ShowCallsStatusData, ShowCallsStatusErrorType, - Evaluate, + Compute, context > > diff --git a/packages/core/src/experimental/query/writeContracts.ts b/packages/core/src/experimental/query/writeContracts.ts index 36401d8589..192a842ca0 100644 --- a/packages/core/src/experimental/query/writeContracts.ts +++ b/packages/core/src/experimental/query/writeContracts.ts @@ -1,7 +1,7 @@ import type { MutateOptions, MutationOptions } from '@tanstack/query-core' import type { Config } from '../../createConfig.js' -import type { Evaluate } from '../../types/utils.js' +import type { Compute } from '../../types/utils.js' import { type WriteContractsErrorType, type WriteContractsParameters, @@ -25,7 +25,7 @@ export function writeContractsMutationOptions< > } -export type WriteContractsData = Evaluate +export type WriteContractsData = Compute export type WriteContractsVariables< contracts extends readonly unknown[], @@ -40,11 +40,11 @@ export type WriteContractsMutate< > = ( variables: WriteContractsVariables, options?: - | Evaluate< + | Compute< MutateOptions< WriteContractsData, WriteContractsErrorType, - Evaluate>, + Compute>, context > > @@ -58,11 +58,11 @@ export type WriteContractsMutateAsync< > = ( variables: WriteContractsVariables, options?: - | Evaluate< + | Compute< MutateOptions< WriteContractsData, WriteContractsErrorType, - Evaluate>, + Compute>, context > > diff --git a/packages/core/src/exports/internal.ts b/packages/core/src/exports/internal.ts index cf2b18c455..cd0c78935d 100644 --- a/packages/core/src/exports/internal.ts +++ b/packages/core/src/exports/internal.ts @@ -32,15 +32,15 @@ export { } from '../types/properties.js' export { - type Evaluate, + type Compute, type ExactPartial, type Mutable, - type Omit, + type StrictOmit as Omit, type OneOf, type RemoveUndefined, - type UnionEvaluate, - type UnionOmit, - type UnionPartial, + type UnionCompute, + type UnionStrictOmit, + type UnionExactPartial, } from '../types/utils.js' //////////////////////////////////////////////////////////////////////////////// diff --git a/packages/core/src/query/call.ts b/packages/core/src/query/call.ts index bc74d80b0f..2ca4491b86 100644 --- a/packages/core/src/query/call.ts +++ b/packages/core/src/query/call.ts @@ -8,10 +8,10 @@ import { } from '../actions/call.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' -export type CallOptions = Evaluate< +export type CallOptions = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/deployContract.ts b/packages/core/src/query/deployContract.ts index 6783105d6b..d4fac04531 100644 --- a/packages/core/src/query/deployContract.ts +++ b/packages/core/src/query/deployContract.ts @@ -8,7 +8,7 @@ import { deployContract, } from '../actions/deployContract.js' import type { Config } from '../createConfig.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' export function deployContractMutationOptions( config: config, @@ -25,7 +25,7 @@ export function deployContractMutationOptions( > } -export type DeployContractData = Evaluate +export type DeployContractData = Compute export type DeployContractVariables< abi extends Abi | readonly unknown[], @@ -41,11 +41,11 @@ export type DeployContractMutate = < >( variables: DeployContractVariables, options?: - | Evaluate< + | Compute< MutateOptions< DeployContractData, DeployContractErrorType, - Evaluate>, + Compute>, context > > @@ -61,11 +61,11 @@ export type DeployContractMutateAsync< >( variables: DeployContractVariables, options?: - | Evaluate< + | Compute< MutateOptions< DeployContractData, DeployContractErrorType, - Evaluate>, + Compute>, context > > diff --git a/packages/core/src/query/estimateFeesPerGas.ts b/packages/core/src/query/estimateFeesPerGas.ts index e1d8dec205..7cf2f607c8 100644 --- a/packages/core/src/query/estimateFeesPerGas.ts +++ b/packages/core/src/query/estimateFeesPerGas.ts @@ -9,13 +9,13 @@ import { } from '../actions/estimateFeesPerGas.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' export type EstimateFeesPerGasOptions< type extends FeeValuesType, config extends Config, -> = Evaluate< +> = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/estimateGas.ts b/packages/core/src/query/estimateGas.ts index b42d123b36..749002f92c 100644 --- a/packages/core/src/query/estimateGas.ts +++ b/packages/core/src/query/estimateGas.ts @@ -8,13 +8,14 @@ import { } from '../actions/estimateGas.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { UnionPartial } from '../types/utils.js' +import type { UnionExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' export type EstimateGasOptions< config extends Config, chainId extends config['chains'][number]['id'] | undefined, -> = UnionPartial> & ScopeKeyParameter +> = UnionExactPartial> & + ScopeKeyParameter export function estimateGasQueryOptions< config extends Config, diff --git a/packages/core/src/query/estimateMaxPriorityFeePerGas.ts b/packages/core/src/query/estimateMaxPriorityFeePerGas.ts index 854c7eabec..cb58e65a79 100644 --- a/packages/core/src/query/estimateMaxPriorityFeePerGas.ts +++ b/packages/core/src/query/estimateMaxPriorityFeePerGas.ts @@ -8,11 +8,11 @@ import { } from '../actions/estimateMaxPriorityFeePerGas.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' export type EstimateMaxPriorityFeePerGasOptions = - Evaluate< + Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/getBalance.ts b/packages/core/src/query/getBalance.ts index 96058970d3..e1dd287633 100644 --- a/packages/core/src/query/getBalance.ts +++ b/packages/core/src/query/getBalance.ts @@ -8,10 +8,10 @@ import { } from '../actions/getBalance.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, PartialBy } from '../types/utils.js' +import type { Compute, PartialBy } from '../types/utils.js' import { filterQueryOptions } from './utils.js' -export type GetBalanceOptions = Evaluate< +export type GetBalanceOptions = Compute< PartialBy, 'address'> & ScopeKeyParameter > @@ -38,7 +38,7 @@ export function getBalanceQueryOptions( > } -export type GetBalanceQueryFnData = Evaluate +export type GetBalanceQueryFnData = Compute export type GetBalanceData = GetBalanceQueryFnData diff --git a/packages/core/src/query/getBlock.ts b/packages/core/src/query/getBlock.ts index 9c66065c6f..f8f4db8417 100644 --- a/packages/core/src/query/getBlock.ts +++ b/packages/core/src/query/getBlock.ts @@ -9,7 +9,7 @@ import { } from '../actions/getBlock.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' export type GetBlockOptions< @@ -18,7 +18,7 @@ export type GetBlockOptions< config extends Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = Evaluate< +> = Compute< ExactPartial< GetBlockParameters > & diff --git a/packages/core/src/query/getBlockNumber.ts b/packages/core/src/query/getBlockNumber.ts index cbdfd3a4ee..9585068a92 100644 --- a/packages/core/src/query/getBlockNumber.ts +++ b/packages/core/src/query/getBlockNumber.ts @@ -8,13 +8,13 @@ import { } from '../actions/getBlockNumber.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' export type GetBlockNumberOptions< config extends Config, chainId extends config['chains'][number]['id'], -> = Evaluate< +> = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/getBlockTransactionCount.ts b/packages/core/src/query/getBlockTransactionCount.ts index 12e1f524ee..453e95e001 100644 --- a/packages/core/src/query/getBlockTransactionCount.ts +++ b/packages/core/src/query/getBlockTransactionCount.ts @@ -8,13 +8,13 @@ import { } from '../actions/getBlockTransactionCount.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { ExactPartial, UnionEvaluate } from '../types/utils.js' +import type { ExactPartial, UnionCompute } from '../types/utils.js' import { filterQueryOptions } from './utils.js' export type GetBlockTransactionCountOptions< config extends Config, chainId extends config['chains'][number]['id'], -> = UnionEvaluate< +> = UnionCompute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/getBytecode.ts b/packages/core/src/query/getBytecode.ts index 47c7a705ab..7000c50eaa 100644 --- a/packages/core/src/query/getBytecode.ts +++ b/packages/core/src/query/getBytecode.ts @@ -8,10 +8,10 @@ import { } from '../actions/getBytecode.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' -export type GetBytecodeOptions = Evaluate< +export type GetBytecodeOptions = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/getConnectorClient.ts b/packages/core/src/query/getConnectorClient.ts index 07ddecbb20..7bc65029f0 100644 --- a/packages/core/src/query/getConnectorClient.ts +++ b/packages/core/src/query/getConnectorClient.ts @@ -8,13 +8,13 @@ import { } from '../actions/getConnectorClient.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' export type GetConnectorClientOptions< config extends Config, chainId extends config['chains'][number]['id'], -> = Evaluate< +> = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/getEnsAddress.ts b/packages/core/src/query/getEnsAddress.ts index bd0927ca1a..7f18c9dd63 100644 --- a/packages/core/src/query/getEnsAddress.ts +++ b/packages/core/src/query/getEnsAddress.ts @@ -8,10 +8,10 @@ import { } from '../actions/getEnsAddress.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' -export type GetEnsAddressOptions = Evaluate< +export type GetEnsAddressOptions = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/getEnsAvatar.ts b/packages/core/src/query/getEnsAvatar.ts index a3252f9908..f399736e08 100644 --- a/packages/core/src/query/getEnsAvatar.ts +++ b/packages/core/src/query/getEnsAvatar.ts @@ -8,10 +8,10 @@ import { } from '../actions/getEnsAvatar.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' -export type GetEnsAvatarOptions = Evaluate< +export type GetEnsAvatarOptions = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/getEnsName.ts b/packages/core/src/query/getEnsName.ts index 73f4e7dacd..cff1534e07 100644 --- a/packages/core/src/query/getEnsName.ts +++ b/packages/core/src/query/getEnsName.ts @@ -8,10 +8,10 @@ import { } from '../actions/getEnsName.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' -export type GetEnsNameOptions = Evaluate< +export type GetEnsNameOptions = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/getEnsResolver.ts b/packages/core/src/query/getEnsResolver.ts index c6cdb59340..124499325d 100644 --- a/packages/core/src/query/getEnsResolver.ts +++ b/packages/core/src/query/getEnsResolver.ts @@ -8,10 +8,10 @@ import { } from '../actions/getEnsResolver.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' -export type GetEnsResolverOptions = Evaluate< +export type GetEnsResolverOptions = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/getEnsText.ts b/packages/core/src/query/getEnsText.ts index 4d96c6188c..2f1c464dea 100644 --- a/packages/core/src/query/getEnsText.ts +++ b/packages/core/src/query/getEnsText.ts @@ -8,10 +8,10 @@ import { } from '../actions/getEnsText.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' -export type GetEnsTextOptions = Evaluate< +export type GetEnsTextOptions = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/getFeeHistory.ts b/packages/core/src/query/getFeeHistory.ts index a1765a6f40..6eeef0d681 100644 --- a/packages/core/src/query/getFeeHistory.ts +++ b/packages/core/src/query/getFeeHistory.ts @@ -8,13 +8,13 @@ import { } from '../actions/getFeeHistory.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, PartialBy } from '../types/utils.js' +import type { Compute, PartialBy } from '../types/utils.js' import { filterQueryOptions } from './utils.js' export type GetFeeHistoryOptions< config extends Config, chainId extends config['chains'][number]['id'], -> = Evaluate< +> = Compute< PartialBy< GetFeeHistoryParameters, 'blockCount' | 'rewardPercentiles' diff --git a/packages/core/src/query/getGasPrice.ts b/packages/core/src/query/getGasPrice.ts index 122f3b7450..153d4a102d 100644 --- a/packages/core/src/query/getGasPrice.ts +++ b/packages/core/src/query/getGasPrice.ts @@ -8,13 +8,13 @@ import { } from '../actions/getGasPrice.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' export type GetGasPriceOptions< config extends Config, chainId extends config['chains'][number]['id'], -> = Evaluate< +> = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/getProof.ts b/packages/core/src/query/getProof.ts index e85de159b8..8da0b42b17 100644 --- a/packages/core/src/query/getProof.ts +++ b/packages/core/src/query/getProof.ts @@ -8,10 +8,10 @@ import { } from '../actions/getProof.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' -export type GetProofOptions = Evaluate< +export type GetProofOptions = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/getStorageAt.ts b/packages/core/src/query/getStorageAt.ts index 6e268de343..c2ed90c927 100644 --- a/packages/core/src/query/getStorageAt.ts +++ b/packages/core/src/query/getStorageAt.ts @@ -8,10 +8,10 @@ import { } from '../actions/getStorageAt.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' -export type GetStorageAtOptions = Evaluate< +export type GetStorageAtOptions = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/getToken.ts b/packages/core/src/query/getToken.ts index 5c822e7b14..8e4a2b866a 100644 --- a/packages/core/src/query/getToken.ts +++ b/packages/core/src/query/getToken.ts @@ -8,10 +8,10 @@ import { } from '../actions/getToken.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' -export type GetTokenOptions = Evaluate< +export type GetTokenOptions = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/getTransaction.ts b/packages/core/src/query/getTransaction.ts index 4a6e21b2f0..8564854774 100644 --- a/packages/core/src/query/getTransaction.ts +++ b/packages/core/src/query/getTransaction.ts @@ -8,13 +8,13 @@ import { } from '../actions/getTransaction.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' export type GetTransactionOptions< config extends Config, chainId extends config['chains'][number]['id'], -> = Evaluate< +> = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/getTransactionConfirmations.ts b/packages/core/src/query/getTransactionConfirmations.ts index 8b3d877605..5c34decf37 100644 --- a/packages/core/src/query/getTransactionConfirmations.ts +++ b/packages/core/src/query/getTransactionConfirmations.ts @@ -8,7 +8,7 @@ import { } from '../actions/getTransactionConfirmations.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { UnionPartial } from '../types/utils.js' +import type { UnionExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' export type GetTransactionConfirmationsOptions< @@ -16,7 +16,7 @@ export type GetTransactionConfirmationsOptions< chainId extends | config['chains'][number]['id'] | undefined = config['chains'][number]['id'], -> = UnionPartial> & +> = UnionExactPartial> & ScopeKeyParameter export function getTransactionConfirmationsQueryOptions< diff --git a/packages/core/src/query/getTransactionCount.ts b/packages/core/src/query/getTransactionCount.ts index ed5c5facc6..31fd2c1d8f 100644 --- a/packages/core/src/query/getTransactionCount.ts +++ b/packages/core/src/query/getTransactionCount.ts @@ -8,10 +8,10 @@ import { } from '../actions/getTransactionCount.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, PartialBy } from '../types/utils.js' +import type { Compute, PartialBy } from '../types/utils.js' import { filterQueryOptions } from './utils.js' -export type GetTransactionCountOptions = Evaluate< +export type GetTransactionCountOptions = Compute< PartialBy, 'address'> & ScopeKeyParameter > @@ -40,7 +40,7 @@ export function getTransactionCountQueryOptions( } export type GetTransactionCountQueryFnData = - Evaluate + Compute export type GetTransactionCountData = GetTransactionCountQueryFnData diff --git a/packages/core/src/query/getTransactionReceipt.ts b/packages/core/src/query/getTransactionReceipt.ts index 9edfb627cf..0d7d559d49 100644 --- a/packages/core/src/query/getTransactionReceipt.ts +++ b/packages/core/src/query/getTransactionReceipt.ts @@ -8,13 +8,13 @@ import { import type { GetTransactionReceiptReturnType } from '../actions/getTransactionReceipt.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' export type GetTransactionReceiptOptions< config extends Config, chainId extends config['chains'][number]['id'], -> = Evaluate< +> = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/getWalletClient.ts b/packages/core/src/query/getWalletClient.ts index 256fb36cee..3c64b39a07 100644 --- a/packages/core/src/query/getWalletClient.ts +++ b/packages/core/src/query/getWalletClient.ts @@ -8,13 +8,13 @@ import { } from '../actions/getWalletClient.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' export type GetWalletClientOptions< config extends Config, chainId extends config['chains'][number]['id'], -> = Evaluate< +> = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/infiniteReadContracts.ts b/packages/core/src/query/infiniteReadContracts.ts index bb16434eaa..28a8d3f52a 100644 --- a/packages/core/src/query/infiniteReadContracts.ts +++ b/packages/core/src/query/infiniteReadContracts.ts @@ -10,7 +10,7 @@ import type { ChainIdParameter, ScopeKeyParameter, } from '../types/properties.js' -import type { Omit } from '../types/utils.js' +import type { StrictOmit } from '../types/utils.js' import type { InfiniteQueryOptions } from './types.js' import { filterQueryOptions } from './utils.js' @@ -24,7 +24,7 @@ export type InfiniteReadContractsOptions< contracts( pageParam: pageParam, ): ReadContractsParameters['contracts'] -} & Omit< +} & StrictOmit< ReadContractsParameters, 'contracts' > & diff --git a/packages/core/src/query/prepareTransactionRequest.ts b/packages/core/src/query/prepareTransactionRequest.ts index 4d13b4f513..5ed4b419fa 100644 --- a/packages/core/src/query/prepareTransactionRequest.ts +++ b/packages/core/src/query/prepareTransactionRequest.ts @@ -11,7 +11,7 @@ import { import type { Config } from '../createConfig.js' import type { SelectChains } from '../types/chain.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { UnionPartial } from '../types/utils.js' +import type { UnionExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' export type PrepareTransactionRequestOptions< @@ -21,7 +21,7 @@ export type PrepareTransactionRequestOptions< SelectChains[0], SelectChains[0] >, -> = UnionPartial< +> = UnionExactPartial< PrepareTransactionRequestParameters > & ScopeKeyParameter diff --git a/packages/core/src/query/readContract.ts b/packages/core/src/query/readContract.ts index 66b42579bc..f315500fd8 100644 --- a/packages/core/src/query/readContract.ts +++ b/packages/core/src/query/readContract.ts @@ -9,7 +9,7 @@ import { } from '../actions/readContract.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { UnionPartial } from '../types/utils.js' +import type { UnionExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' export type ReadContractOptions< @@ -17,7 +17,7 @@ export type ReadContractOptions< functionName extends ContractFunctionName, args extends ContractFunctionArgs, config extends Config, -> = UnionPartial> & +> = UnionExactPartial> & ScopeKeyParameter export function readContractQueryOptions< diff --git a/packages/core/src/query/reconnect.ts b/packages/core/src/query/reconnect.ts index 9e73bb0548..13126cdd34 100644 --- a/packages/core/src/query/reconnect.ts +++ b/packages/core/src/query/reconnect.ts @@ -7,7 +7,7 @@ import { reconnect, } from '../actions/reconnect.js' import type { Config } from '../createConfig.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import type { Mutate, MutateAsync } from './types.js' export function reconnectMutationOptions(config: Config) { @@ -23,7 +23,7 @@ export function reconnectMutationOptions(config: Config) { > } -export type ReconnectData = Evaluate +export type ReconnectData = Compute export type ReconnectVariables = ReconnectParameters | undefined diff --git a/packages/core/src/query/sendTransaction.ts b/packages/core/src/query/sendTransaction.ts index 22d826bcaa..e6df10fef7 100644 --- a/packages/core/src/query/sendTransaction.ts +++ b/packages/core/src/query/sendTransaction.ts @@ -7,7 +7,7 @@ import { sendTransaction, } from '../actions/sendTransaction.js' import type { Config } from '../createConfig.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' export function sendTransactionMutationOptions( config: config, @@ -24,7 +24,7 @@ export function sendTransactionMutationOptions( > } -export type SendTransactionData = Evaluate +export type SendTransactionData = Compute export type SendTransactionVariables< config extends Config, @@ -36,11 +36,11 @@ export type SendTransactionMutate = < >( variables: SendTransactionVariables, options?: - | Evaluate< + | Compute< MutateOptions< SendTransactionData, SendTransactionErrorType, - Evaluate>, + Compute>, context > > @@ -53,11 +53,11 @@ export type SendTransactionMutateAsync< > = ( variables: SendTransactionVariables, options?: - | Evaluate< + | Compute< MutateOptions< SendTransactionData, SendTransactionErrorType, - Evaluate>, + Compute>, context > > diff --git a/packages/core/src/query/signMessage.ts b/packages/core/src/query/signMessage.ts index 3836072fdb..d2a4d8156a 100644 --- a/packages/core/src/query/signMessage.ts +++ b/packages/core/src/query/signMessage.ts @@ -7,7 +7,7 @@ import { signMessage, } from '../actions/signMessage.js' import type { Config } from '../createConfig.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import type { Mutate, MutateAsync } from './types.js' export function signMessageMutationOptions(config: Config) { @@ -25,7 +25,7 @@ export function signMessageMutationOptions(config: Config) { export type SignMessageData = SignMessageReturnType -export type SignMessageVariables = Evaluate +export type SignMessageVariables = Compute export type SignMessageMutate = Mutate< SignMessageData, diff --git a/packages/core/src/query/signTypedData.ts b/packages/core/src/query/signTypedData.ts index b671e75f0c..fe8eeb0268 100644 --- a/packages/core/src/query/signTypedData.ts +++ b/packages/core/src/query/signTypedData.ts @@ -8,7 +8,7 @@ import { signTypedData, } from '../actions/signTypedData.js' import type { Config } from '../createConfig.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' export function signTypedDataMutationOptions( config: config, @@ -25,7 +25,7 @@ export function signTypedDataMutationOptions( > } -export type SignTypedDataData = Evaluate +export type SignTypedDataData = Compute export type SignTypedDataVariables< typedData extends TypedData | Record = TypedData, diff --git a/packages/core/src/query/simulateContract.ts b/packages/core/src/query/simulateContract.ts index 533c04a703..c3970999d4 100644 --- a/packages/core/src/query/simulateContract.ts +++ b/packages/core/src/query/simulateContract.ts @@ -9,7 +9,7 @@ import { } from '../actions/simulateContract.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { UnionPartial } from '../types/utils.js' +import type { UnionExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' export type SimulateContractOptions< @@ -22,7 +22,7 @@ export type SimulateContractOptions< >, config extends Config, chainId extends config['chains'][number]['id'] | undefined, -> = UnionPartial< +> = UnionExactPartial< SimulateContractParameters > & ScopeKeyParameter diff --git a/packages/core/src/query/switchAccount.ts b/packages/core/src/query/switchAccount.ts index ba966c9e69..29a10b2ce8 100644 --- a/packages/core/src/query/switchAccount.ts +++ b/packages/core/src/query/switchAccount.ts @@ -7,7 +7,7 @@ import { switchAccount, } from '../actions/switchAccount.js' import type { Config } from '../createConfig.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' import type { Mutate, MutateAsync } from './types.js' export function switchAccountMutationOptions( @@ -25,11 +25,11 @@ export function switchAccountMutationOptions( > } -export type SwitchAccountData = Evaluate< +export type SwitchAccountData = Compute< SwitchAccountReturnType > -export type SwitchAccountVariables = Evaluate +export type SwitchAccountVariables = Compute export type SwitchAccountMutate< config extends Config, diff --git a/packages/core/src/query/switchChain.ts b/packages/core/src/query/switchChain.ts index bc38271401..1924ca8429 100644 --- a/packages/core/src/query/switchChain.ts +++ b/packages/core/src/query/switchChain.ts @@ -7,7 +7,7 @@ import { switchChain, } from '../actions/switchChain.js' import type { Config } from '../createConfig.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' export function switchChainMutationOptions( config: config, @@ -27,23 +27,23 @@ export function switchChainMutationOptions( export type SwitchChainData< config extends Config, chainId extends config['chains'][number]['id'], -> = Evaluate> +> = Compute> export type SwitchChainVariables< config extends Config, chainId extends config['chains'][number]['id'], -> = Evaluate> +> = Compute> export type SwitchChainMutate = < chainId extends config['chains'][number]['id'], >( variables: SwitchChainVariables, options?: - | Evaluate< + | Compute< MutateOptions< SwitchChainData, SwitchChainErrorType, - Evaluate>, + Compute>, context > > @@ -55,11 +55,11 @@ export type SwitchChainMutateAsync = < >( variables: SwitchChainVariables, options?: - | Evaluate< + | Compute< MutateOptions< SwitchChainData, SwitchChainErrorType, - Evaluate>, + Compute>, context > > diff --git a/packages/core/src/query/types.ts b/packages/core/src/query/types.ts index ff9e9b1e5d..6a279d52d5 100644 --- a/packages/core/src/query/types.ts +++ b/packages/core/src/query/types.ts @@ -6,7 +6,7 @@ import type { QueryKey, } from '@tanstack/query-core' -import type { Evaluate, Omit } from '../types/utils.js' +import type { Compute, StrictOmit } from '../types/utils.js' export type InfiniteQueryOptions< queryFnData = unknown, @@ -31,9 +31,9 @@ export type InfiniteQueryOptions< queryKey, pageParam >, -> = Evaluate< +> = Compute< // `queryFn` doesn't pass through `pageParam` correctly - Omit & { + StrictOmit & { queryFn?( context: QueryFunctionContext, ): options['queryFn'] extends (...args: any) => any @@ -54,7 +54,7 @@ export type Mutate< variables = void, context = unknown, > = ( - ...args: Parameters, context>> + ...args: Parameters, context>> ) => void export type MutateAsync< @@ -62,7 +62,7 @@ export type MutateAsync< error = unknown, variables = void, context = unknown, -> = MutateFn, context> +> = MutateFn, context> type MutateFn< data = unknown, @@ -73,12 +73,12 @@ type MutateFn< ? ( variables?: variables, options?: - | Evaluate> + | Compute> | undefined, ) => Promise : ( variables: variables, options?: - | Evaluate> + | Compute> | undefined, ) => Promise diff --git a/packages/core/src/query/verifyMessage.ts b/packages/core/src/query/verifyMessage.ts index f6b5c0a933..d827e64b2b 100644 --- a/packages/core/src/query/verifyMessage.ts +++ b/packages/core/src/query/verifyMessage.ts @@ -8,10 +8,10 @@ import { } from '../actions/verifyMessage.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' -export type VerifyMessageOptions = Evaluate< +export type VerifyMessageOptions = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/waitForTransactionReceipt.ts b/packages/core/src/query/waitForTransactionReceipt.ts index 736a583c75..3507dabeb8 100644 --- a/packages/core/src/query/waitForTransactionReceipt.ts +++ b/packages/core/src/query/waitForTransactionReceipt.ts @@ -8,13 +8,13 @@ import { } from '../actions/waitForTransactionReceipt.js' import type { Config } from '../createConfig.js' import type { ScopeKeyParameter } from '../types/properties.js' -import type { Evaluate, ExactPartial } from '../types/utils.js' +import type { Compute, ExactPartial } from '../types/utils.js' import { filterQueryOptions } from './utils.js' export type WaitForTransactionReceiptOptions< config extends Config, chainId extends config['chains'][number]['id'], -> = Evaluate< +> = Compute< ExactPartial> & ScopeKeyParameter > diff --git a/packages/core/src/query/writeContract.ts b/packages/core/src/query/writeContract.ts index b80c7e4bb6..0e368fe40b 100644 --- a/packages/core/src/query/writeContract.ts +++ b/packages/core/src/query/writeContract.ts @@ -8,7 +8,7 @@ import { writeContract, } from '../actions/writeContract.js' import type { Config } from '../createConfig.js' -import type { Evaluate } from '../types/utils.js' +import type { Compute } from '../types/utils.js' export function writeContractMutationOptions( config: config, @@ -31,7 +31,7 @@ export function writeContractMutationOptions( > } -export type WriteContractData = Evaluate +export type WriteContractData = Compute export type WriteContractVariables< abi extends Abi | readonly unknown[], diff --git a/packages/core/src/types/utils.test-d.ts b/packages/core/src/types/utils.test-d.ts index a46051bcf1..523f9f2e36 100644 --- a/packages/core/src/types/utils.test-d.ts +++ b/packages/core/src/types/utils.test-d.ts @@ -1,7 +1,7 @@ import { assertType, expectTypeOf, test } from 'vitest' import type { - Evaluate, + Compute, ExactPartial, IsNever, Mutable, @@ -32,7 +32,7 @@ test('OneOf', () => { }) test('PartialBy', () => { - type Result = Evaluate> + type Result = Compute> expectTypeOf().toEqualTypeOf<{ foo?: string | undefined bar: number diff --git a/packages/core/src/types/utils.ts b/packages/core/src/types/utils.ts index a264078c18..aecd58a142 100644 --- a/packages/core/src/types/utils.ts +++ b/packages/core/src/types/utils.ts @@ -1,6 +1,6 @@ /** Combines members of an intersection into a readable type. */ // https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg -export type Evaluate = { [key in keyof type]: type[key] } & unknown +export type Compute = { [key in keyof type]: type[key] } & unknown /** * Makes all properties of an object optional. @@ -36,7 +36,7 @@ export type IsNever = [type] extends [never] ? true : false export type IsUnknown = unknown extends type ? true : false /** Merges two object types into new type */ -export type Merge = Evaluate< +export type Merge = Compute< LooseOmit & obj2 > @@ -47,7 +47,7 @@ export type Mutable = { } /** Strict version of built-in Omit type */ -export type Omit = Pick< +export type StrictOmit = Pick< type, Exclude > @@ -58,7 +58,7 @@ export type OneOf< /// keys extends KeyofUnion = KeyofUnion, > = union extends infer Item - ? Evaluate]?: undefined }> + ? Compute]?: undefined }> : never type KeyofUnion = type extends type ? keyof type : never @@ -67,7 +67,7 @@ type KeyofUnion = type extends type ? keyof type : never export type PartialBy = ExactPartial< Pick > & - Omit + StrictOmit /* Removes `undefined` from object property */ export type RemoveUndefined = { @@ -77,7 +77,7 @@ export type RemoveUndefined = { /////////////////////////////////////////////////////////////////////////// // Loose types -/** Loose version of {@link Omit} */ +/** Loose version of {@link StrictOmit} */ export type LooseOmit = Pick< type, Exclude @@ -86,14 +86,16 @@ export type LooseOmit = Pick< /////////////////////////////////////////////////////////////////////////// // Union types -export type UnionEvaluate = type extends object ? Evaluate : type +export type UnionCompute = type extends object ? Compute : type export type UnionLooseOmit = type extends any ? LooseOmit : never -export type UnionOmit = type extends any - ? Omit +export type UnionStrictOmit = type extends any + ? StrictOmit : never -export type UnionPartial = type extends object ? ExactPartial : type +export type UnionExactPartial = type extends object + ? ExactPartial + : type diff --git a/packages/react/src/experimental/hooks/useCallsStatus.ts b/packages/react/src/experimental/hooks/useCallsStatus.ts index fdc4e266b7..c3858cdcfc 100644 --- a/packages/react/src/experimental/hooks/useCallsStatus.ts +++ b/packages/react/src/experimental/hooks/useCallsStatus.ts @@ -9,7 +9,7 @@ import { type GetCallsStatusQueryKey, getCallsStatusQueryOptions, } from '@wagmi/core/experimental' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { useConfig } from '../../hooks/useConfig.js' import type { ConfigParameter, QueryParameter } from '../../types/properties.js' @@ -18,7 +18,7 @@ import { type UseQueryReturnType, useQuery } from '../../utils/query.js' export type UseCallsStatusParameters< config extends Config = Config, selectData = GetCallsStatusData, -> = Evaluate< +> = Compute< GetCallsStatusOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/experimental/hooks/useCapabilities.ts b/packages/react/src/experimental/hooks/useCapabilities.ts index bc838e1e02..34398c4256 100644 --- a/packages/react/src/experimental/hooks/useCapabilities.ts +++ b/packages/react/src/experimental/hooks/useCapabilities.ts @@ -9,7 +9,7 @@ import { type GetCapabilitiesQueryKey, getCapabilitiesQueryOptions, } from '@wagmi/core/experimental' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { useAccount } from '../../hooks/useAccount.js' import { useConfig } from '../../hooks/useConfig.js' @@ -19,7 +19,7 @@ import { type UseQueryReturnType, useQuery } from '../../utils/query.js' export type UseCapabilitiesParameters< config extends Config = Config, selectData = GetCapabilitiesData, -> = Evaluate< +> = Compute< GetCapabilitiesOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/experimental/hooks/useSendCalls.ts b/packages/react/src/experimental/hooks/useSendCalls.ts index 1953aea3cd..7a4c776e7a 100644 --- a/packages/react/src/experimental/hooks/useSendCalls.ts +++ b/packages/react/src/experimental/hooks/useSendCalls.ts @@ -10,7 +10,7 @@ import { type SendCallsVariables, sendCallsMutationOptions, } from '@wagmi/core/experimental' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { useConfig } from '../../hooks/useConfig.js' import type { ConfigParameter } from '../../types/properties.js' @@ -22,7 +22,7 @@ import type { export type UseSendCallsParameters< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -38,7 +38,7 @@ export type UseSendCallsParameters< export type UseSendCallsReturnType< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< UseMutationReturnType< SendCallsData, SendCallsErrorType, diff --git a/packages/react/src/experimental/hooks/useShowCallsStatus.ts b/packages/react/src/experimental/hooks/useShowCallsStatus.ts index a71a05eaeb..439891584f 100644 --- a/packages/react/src/experimental/hooks/useShowCallsStatus.ts +++ b/packages/react/src/experimental/hooks/useShowCallsStatus.ts @@ -10,7 +10,7 @@ import { type ShowCallsStatusVariables, showCallsStatusMutationOptions, } from '@wagmi/core/experimental' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { useConfig } from '../../hooks/useConfig.js' import type { ConfigParameter } from '../../types/properties.js' @@ -22,7 +22,7 @@ import type { export type UseShowCallsStatusParameters< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -35,7 +35,7 @@ export type UseShowCallsStatusParameters< } > -export type UseShowCallsStatusReturnType = Evaluate< +export type UseShowCallsStatusReturnType = Compute< UseMutationReturnType< ShowCallsStatusData, ShowCallsStatusErrorType, diff --git a/packages/react/src/experimental/hooks/useWriteContracts.ts b/packages/react/src/experimental/hooks/useWriteContracts.ts index b0fe84c41c..8d0d32aefb 100644 --- a/packages/react/src/experimental/hooks/useWriteContracts.ts +++ b/packages/react/src/experimental/hooks/useWriteContracts.ts @@ -10,7 +10,7 @@ import { type WriteContractsVariables, writeContractsMutationOptions, } from '@wagmi/core/experimental' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import type { ContractFunctionParameters } from 'viem' import { useConfig } from '../../hooks/useConfig.js' @@ -24,7 +24,7 @@ export type UseWriteContractsParameters< contracts extends readonly unknown[] = readonly ContractFunctionParameters[], config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -45,7 +45,7 @@ export type UseWriteContractsReturnType< contracts extends readonly unknown[] = readonly ContractFunctionParameters[], config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< UseMutationReturnType< WriteContractsData, WriteContractsErrorType, diff --git a/packages/react/src/hooks/codegen/createUseReadContract.ts b/packages/react/src/hooks/codegen/createUseReadContract.ts index aef3db2c53..e1b2757fa7 100644 --- a/packages/react/src/hooks/codegen/createUseReadContract.ts +++ b/packages/react/src/hooks/codegen/createUseReadContract.ts @@ -6,9 +6,9 @@ import type { } from '@wagmi/core' import type { ScopeKeyParameter, - UnionEvaluate, - UnionOmit, - UnionPartial, + UnionCompute, + UnionStrictOmit, + UnionExactPartial, } from '@wagmi/core/internal' import type { ReadContractData, @@ -66,9 +66,9 @@ export type CreateUseReadContractReturnType< config extends Config = ResolvedRegister['config'], selectData = ReadContractData, >( - parameters?: UnionEvaluate< - UnionPartial< - UnionOmit< + parameters?: UnionCompute< + UnionExactPartial< + UnionStrictOmit< ReadContractParameters, omittedProperties > diff --git a/packages/react/src/hooks/codegen/createUseSimulateContract.ts b/packages/react/src/hooks/codegen/createUseSimulateContract.ts index 4a3194d40d..51758b995a 100644 --- a/packages/react/src/hooks/codegen/createUseSimulateContract.ts +++ b/packages/react/src/hooks/codegen/createUseSimulateContract.ts @@ -4,7 +4,7 @@ import type { SimulateContractErrorType, SimulateContractParameters, } from '@wagmi/core' -import type { ScopeKeyParameter, UnionPartial } from '@wagmi/core/internal' +import type { ScopeKeyParameter, UnionExactPartial } from '@wagmi/core/internal' import type { SimulateContractData, SimulateContractQueryFnData, @@ -66,7 +66,7 @@ export type CreateUseSimulateContractReturnType< | (chainId extends keyof address ? chainId : never) | undefined : chainId | number | undefined - } & UnionPartial< + } & UnionExactPartial< // TODO: Take `abi` and `address` from above and omit from below (currently breaks inference) SimulateContractParameters > & diff --git a/packages/react/src/hooks/codegen/createUseWatchContractEvent.ts b/packages/react/src/hooks/codegen/createUseWatchContractEvent.ts index cecb2b2d60..a7b68ea960 100644 --- a/packages/react/src/hooks/codegen/createUseWatchContractEvent.ts +++ b/packages/react/src/hooks/codegen/createUseWatchContractEvent.ts @@ -4,9 +4,9 @@ import type { WatchContractEventParameters, } from '@wagmi/core' import type { - UnionEvaluate, - UnionOmit, - UnionPartial, + UnionCompute, + UnionStrictOmit, + UnionExactPartial, } from '@wagmi/core/internal' import type { Abi, Address, ContractEventName } from 'viem' @@ -48,9 +48,9 @@ export type CreateUseWatchContractEventReturnType< chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], >( - parameters?: UnionEvaluate< - UnionPartial< - UnionOmit< + parameters?: UnionCompute< + UnionExactPartial< + UnionStrictOmit< WatchContractEventParameters, omittedProperties > diff --git a/packages/react/src/hooks/codegen/createUseWriteContract.ts b/packages/react/src/hooks/codegen/createUseWriteContract.ts index f7a57d2223..fa7eecd7c3 100644 --- a/packages/react/src/hooks/codegen/createUseWriteContract.ts +++ b/packages/react/src/hooks/codegen/createUseWriteContract.ts @@ -7,10 +7,10 @@ import type { import type { ChainIdParameter, ConnectorParameter, - Evaluate, + Compute, SelectChains, - UnionEvaluate, - UnionOmit, + UnionCompute, + UnionStrictOmit, } from '@wagmi/core/internal' import type { WriteContractData, @@ -59,7 +59,7 @@ export type CreateUseWriteContractReturnType< functionName extends ContractFunctionName | undefined, > = ( parameters?: UseWriteContractParameters, -) => Evaluate< +) => Compute< Omit< wagmi_UseWriteContractReturnType, 'writeContract' | 'writeContractAsync' @@ -267,9 +267,9 @@ type Variables< | 'abi' | (address extends undefined ? never : 'address') | (functionName extends undefined ? never : 'functionName'), -> = UnionEvaluate< +> = UnionCompute< { - [key in keyof chains]: UnionOmit< + [key in keyof chains]: UnionStrictOmit< viem_WriteContractParameters< abi, name, @@ -289,6 +289,6 @@ type Variables< | (chainId extends keyof address ? chainId : never) | undefined } - : Evaluate>) & + : Compute>) & ConnectorParameter & { __mode?: 'prepared' } > diff --git a/packages/react/src/hooks/useAccountEffect.ts b/packages/react/src/hooks/useAccountEffect.ts index 7de67af956..5c77585e35 100644 --- a/packages/react/src/hooks/useAccountEffect.ts +++ b/packages/react/src/hooks/useAccountEffect.ts @@ -1,16 +1,16 @@ 'use client' import { type GetAccountReturnType, watchAccount } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { useEffect } from 'react' import type { ConfigParameter } from '../types/properties.js' import { useConfig } from './useConfig.js' -export type UseAccountEffectParameters = Evaluate< +export type UseAccountEffectParameters = Compute< { onConnect?( - data: Evaluate< + data: Compute< Pick< Extract, 'address' | 'addresses' | 'chain' | 'chainId' | 'connector' diff --git a/packages/react/src/hooks/useBalance.ts b/packages/react/src/hooks/useBalance.ts index b181b593f8..93568089f7 100644 --- a/packages/react/src/hooks/useBalance.ts +++ b/packages/react/src/hooks/useBalance.ts @@ -1,7 +1,7 @@ 'use client' import type { Config, GetBalanceErrorType, ResolvedRegister } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetBalanceData, type GetBalanceOptions, @@ -18,7 +18,7 @@ import { useConfig } from './useConfig.js' export type UseBalanceParameters< config extends Config = Config, selectData = GetBalanceData, -> = Evaluate< +> = Compute< GetBalanceOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useBlock.ts b/packages/react/src/hooks/useBlock.ts index 253b311ba5..330a77aedc 100644 --- a/packages/react/src/hooks/useBlock.ts +++ b/packages/react/src/hooks/useBlock.ts @@ -2,7 +2,7 @@ import { useQueryClient } from '@tanstack/react-query' import type { Config, GetBlockErrorType, ResolvedRegister } from '@wagmi/core' -import type { Evaluate, UnionEvaluate, UnionOmit } from '@wagmi/core/internal' +import type { Compute, UnionCompute, UnionStrictOmit } from '@wagmi/core/internal' import { type GetBlockData, type GetBlockOptions, @@ -28,7 +28,7 @@ export type UseBlockParameters< chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], selectData = GetBlockData, -> = Evaluate< +> = Compute< GetBlockOptions & ConfigParameter & QueryParameter< @@ -39,8 +39,8 @@ export type UseBlockParameters< > & { watch?: | boolean - | UnionEvaluate< - UnionOmit< + | UnionCompute< + UnionStrictOmit< UseWatchBlocksParameters< includeTransactions, blockTag, diff --git a/packages/react/src/hooks/useBlockNumber.ts b/packages/react/src/hooks/useBlockNumber.ts index 934a2b92fa..0c09f9c89b 100644 --- a/packages/react/src/hooks/useBlockNumber.ts +++ b/packages/react/src/hooks/useBlockNumber.ts @@ -6,7 +6,7 @@ import type { GetBlockNumberErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate, UnionEvaluate, UnionOmit } from '@wagmi/core/internal' +import type { Compute, UnionCompute, UnionStrictOmit } from '@wagmi/core/internal' import { type GetBlockNumberData, type GetBlockNumberOptions, @@ -29,7 +29,7 @@ export type UseBlockNumberParameters< chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], selectData = GetBlockNumberData, -> = Evaluate< +> = Compute< GetBlockNumberOptions & ConfigParameter & QueryParameter< @@ -40,8 +40,8 @@ export type UseBlockNumberParameters< > & { watch?: | boolean - | UnionEvaluate< - UnionOmit< + | UnionCompute< + UnionStrictOmit< UseWatchBlockNumberParameters, 'chainId' | 'config' | 'onBlockNumber' | 'onError' > diff --git a/packages/react/src/hooks/useBlockTransactionCount.ts b/packages/react/src/hooks/useBlockTransactionCount.ts index 4e5781b64c..edbd6e8ddf 100644 --- a/packages/react/src/hooks/useBlockTransactionCount.ts +++ b/packages/react/src/hooks/useBlockTransactionCount.ts @@ -5,7 +5,7 @@ import type { GetBlockTransactionCountErrorType, ResolvedRegister, } from '@wagmi/core' -import type { UnionEvaluate } from '@wagmi/core/internal' +import type { UnionCompute } from '@wagmi/core/internal' import { type GetBlockTransactionCountData, type GetBlockTransactionCountOptions, @@ -24,7 +24,7 @@ export type UseBlockTransactionCountParameters< chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], selectData = GetBlockTransactionCountData, -> = UnionEvaluate< +> = UnionCompute< GetBlockTransactionCountOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useBytecode.ts b/packages/react/src/hooks/useBytecode.ts index fd87a0ecd3..3dd01d438a 100644 --- a/packages/react/src/hooks/useBytecode.ts +++ b/packages/react/src/hooks/useBytecode.ts @@ -5,7 +5,7 @@ import type { GetBytecodeErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetBytecodeData, type GetBytecodeOptions, @@ -21,7 +21,7 @@ import { useConfig } from './useConfig.js' export type UseBytecodeParameters< config extends Config = Config, selectData = GetBytecodeData, -> = Evaluate< +> = Compute< GetBytecodeOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useCall.ts b/packages/react/src/hooks/useCall.ts index d286238d9d..423e04fbff 100644 --- a/packages/react/src/hooks/useCall.ts +++ b/packages/react/src/hooks/useCall.ts @@ -1,7 +1,7 @@ 'use client' import type { CallErrorType, Config, ResolvedRegister } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type CallData, type CallOptions, @@ -18,7 +18,7 @@ import { useConfig } from './useConfig.js' export type UseCallParameters< config extends Config = Config, selectData = CallData, -> = Evaluate< +> = Compute< CallOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useClient.ts b/packages/react/src/hooks/useClient.ts index 41c0e2de90..abfee745b3 100644 --- a/packages/react/src/hooks/useClient.ts +++ b/packages/react/src/hooks/useClient.ts @@ -8,7 +8,7 @@ import { getClient, watchClient, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector.js' import type { ConfigParameter } from '../types/properties.js' @@ -19,7 +19,7 @@ export type UseClientParameters< chainId extends config['chains'][number]['id'] | number | undefined = | config['chains'][number]['id'] | undefined, -> = Evaluate & ConfigParameter> +> = Compute & ConfigParameter> export type UseClientReturnType< config extends Config = Config, diff --git a/packages/react/src/hooks/useConnect.ts b/packages/react/src/hooks/useConnect.ts index 7fb08d13ce..eec190c93c 100644 --- a/packages/react/src/hooks/useConnect.ts +++ b/packages/react/src/hooks/useConnect.ts @@ -2,7 +2,7 @@ import { useMutation } from '@tanstack/react-query' import type { Config, ConnectErrorType, ResolvedRegister } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type ConnectData, type ConnectMutate, @@ -23,7 +23,7 @@ import { type UseConnectorsReturnType, useConnectors } from './useConnectors.js' export type UseConnectParameters< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -39,7 +39,7 @@ export type UseConnectParameters< export type UseConnectReturnType< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< UseMutationReturnType< ConnectData, ConnectErrorType, @@ -48,7 +48,7 @@ export type UseConnectReturnType< > & { connect: ConnectMutate connectAsync: ConnectMutateAsync - connectors: Evaluate + connectors: Compute } > diff --git a/packages/react/src/hooks/useConnectorClient.ts b/packages/react/src/hooks/useConnectorClient.ts index 042deb4842..7481802938 100644 --- a/packages/react/src/hooks/useConnectorClient.ts +++ b/packages/react/src/hooks/useConnectorClient.ts @@ -6,7 +6,7 @@ import type { GetConnectorClientErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate, Omit } from '@wagmi/core/internal' +import type { Compute, Omit } from '@wagmi/core/internal' import { type GetConnectorClientData, type GetConnectorClientOptions, @@ -31,11 +31,11 @@ export type UseConnectorClientParameters< chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], selectData = GetConnectorClientData, -> = Evaluate< +> = Compute< GetConnectorClientOptions & ConfigParameter & { query?: - | Evaluate< + | Compute< Omit< UseQueryParameters< GetConnectorClientQueryFnData, diff --git a/packages/react/src/hooks/useDeployContract.ts b/packages/react/src/hooks/useDeployContract.ts index 2bbedfbd53..d37f3206d4 100644 --- a/packages/react/src/hooks/useDeployContract.ts +++ b/packages/react/src/hooks/useDeployContract.ts @@ -6,7 +6,7 @@ import type { DeployContractErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type DeployContractData, type DeployContractMutate, @@ -26,7 +26,7 @@ import { useConfig } from './useConfig.js' export type UseDeployContractParameters< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< ConfigParameter & { mutation?: | UseMutationParameters< diff --git a/packages/react/src/hooks/useDisconnect.ts b/packages/react/src/hooks/useDisconnect.ts index 7f72a34f85..b5bff5bfe3 100644 --- a/packages/react/src/hooks/useDisconnect.ts +++ b/packages/react/src/hooks/useDisconnect.ts @@ -2,7 +2,7 @@ import { useMutation } from '@tanstack/react-query' import type { Connector, DisconnectErrorType } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type DisconnectData, type DisconnectMutate, @@ -19,7 +19,7 @@ import type { import { useConfig } from './useConfig.js' import { useConnections } from './useConnections.js' -export type UseDisconnectParameters = Evaluate< +export type UseDisconnectParameters = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -32,7 +32,7 @@ export type UseDisconnectParameters = Evaluate< } > -export type UseDisconnectReturnType = Evaluate< +export type UseDisconnectReturnType = Compute< UseMutationReturnType< DisconnectData, DisconnectErrorType, diff --git a/packages/react/src/hooks/useEnsAddress.ts b/packages/react/src/hooks/useEnsAddress.ts index d5a6bad553..999e07d999 100644 --- a/packages/react/src/hooks/useEnsAddress.ts +++ b/packages/react/src/hooks/useEnsAddress.ts @@ -5,7 +5,7 @@ import type { GetEnsAddressErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetEnsAddressData, type GetEnsAddressOptions, @@ -22,7 +22,7 @@ import { useConfig } from './useConfig.js' export type UseEnsAddressParameters< config extends Config = Config, selectData = GetEnsAddressData, -> = Evaluate< +> = Compute< GetEnsAddressOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useEnsAvatar.ts b/packages/react/src/hooks/useEnsAvatar.ts index 8368d6b6e2..721653bf07 100644 --- a/packages/react/src/hooks/useEnsAvatar.ts +++ b/packages/react/src/hooks/useEnsAvatar.ts @@ -5,7 +5,7 @@ import type { GetEnsAvatarErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetEnsAvatarData, type GetEnsAvatarOptions, @@ -22,7 +22,7 @@ import { useConfig } from './useConfig.js' export type UseEnsAvatarParameters< config extends Config = Config, selectData = GetEnsAvatarData, -> = Evaluate< +> = Compute< GetEnsAvatarOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useEnsName.ts b/packages/react/src/hooks/useEnsName.ts index d8dd041e72..ddf88fed9d 100644 --- a/packages/react/src/hooks/useEnsName.ts +++ b/packages/react/src/hooks/useEnsName.ts @@ -1,7 +1,7 @@ 'use client' import type { Config, GetEnsNameErrorType, ResolvedRegister } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetEnsNameData, type GetEnsNameOptions, @@ -18,7 +18,7 @@ import { useConfig } from './useConfig.js' export type UseEnsNameParameters< config extends Config = Config, selectData = GetEnsNameData, -> = Evaluate< +> = Compute< GetEnsNameOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useEnsResolver.ts b/packages/react/src/hooks/useEnsResolver.ts index 4c3339fc57..e883debfa6 100644 --- a/packages/react/src/hooks/useEnsResolver.ts +++ b/packages/react/src/hooks/useEnsResolver.ts @@ -5,7 +5,7 @@ import type { GetEnsResolverErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetEnsResolverData, type GetEnsResolverOptions, @@ -22,7 +22,7 @@ import { useConfig } from './useConfig.js' export type UseEnsResolverParameters< config extends Config = Config, selectData = GetEnsResolverData, -> = Evaluate< +> = Compute< GetEnsResolverOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useEnsText.ts b/packages/react/src/hooks/useEnsText.ts index d2c1a1d878..2e65238c4f 100644 --- a/packages/react/src/hooks/useEnsText.ts +++ b/packages/react/src/hooks/useEnsText.ts @@ -1,7 +1,7 @@ 'use client' import type { Config, GetEnsTextErrorType, ResolvedRegister } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetEnsTextData, type GetEnsTextOptions, @@ -18,7 +18,7 @@ import { useConfig } from './useConfig.js' export type UseEnsTextParameters< config extends Config = Config, selectData = GetEnsTextData, -> = Evaluate< +> = Compute< GetEnsTextOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useEstimateFeesPerGas.ts b/packages/react/src/hooks/useEstimateFeesPerGas.ts index b59cfa93c9..59dc2aa910 100644 --- a/packages/react/src/hooks/useEstimateFeesPerGas.ts +++ b/packages/react/src/hooks/useEstimateFeesPerGas.ts @@ -5,7 +5,7 @@ import type { EstimateFeesPerGasErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type EstimateFeesPerGasData, type EstimateFeesPerGasOptions, @@ -24,7 +24,7 @@ export type UseEstimateFeesPerGasParameters< type extends FeeValuesType = FeeValuesType, config extends Config = Config, selectData = EstimateFeesPerGasData, -> = Evaluate< +> = Compute< EstimateFeesPerGasOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useEstimateMaxPriorityFeePerGas.ts b/packages/react/src/hooks/useEstimateMaxPriorityFeePerGas.ts index 57d52acddc..0f884dba75 100644 --- a/packages/react/src/hooks/useEstimateMaxPriorityFeePerGas.ts +++ b/packages/react/src/hooks/useEstimateMaxPriorityFeePerGas.ts @@ -5,7 +5,7 @@ import type { EstimateMaxPriorityFeePerGasErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type EstimateMaxPriorityFeePerGasData, type EstimateMaxPriorityFeePerGasOptions, @@ -22,7 +22,7 @@ import { useConfig } from './useConfig.js' export type UseEstimateMaxPriorityFeePerGasParameters< config extends Config = Config, selectData = EstimateMaxPriorityFeePerGasData, -> = Evaluate< +> = Compute< EstimateMaxPriorityFeePerGasOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useFeeHistory.ts b/packages/react/src/hooks/useFeeHistory.ts index 46df7679ee..0754757b31 100644 --- a/packages/react/src/hooks/useFeeHistory.ts +++ b/packages/react/src/hooks/useFeeHistory.ts @@ -5,7 +5,7 @@ import type { GetFeeHistoryErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetFeeHistoryData, type GetFeeHistoryOptions, @@ -24,7 +24,7 @@ export type UseFeeHistoryParameters< chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], selectData = GetFeeHistoryData, -> = Evaluate< +> = Compute< GetFeeHistoryOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useGasPrice.ts b/packages/react/src/hooks/useGasPrice.ts index e51edcbc3d..dc823dcf64 100644 --- a/packages/react/src/hooks/useGasPrice.ts +++ b/packages/react/src/hooks/useGasPrice.ts @@ -5,7 +5,7 @@ import type { GetGasPriceErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetGasPriceData, type GetGasPriceOptions, @@ -24,7 +24,7 @@ export type UseGasPriceParameters< chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], selectData = GetGasPriceData, -> = Evaluate< +> = Compute< GetGasPriceOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useProof.ts b/packages/react/src/hooks/useProof.ts index 626e8262f1..f473d509aa 100644 --- a/packages/react/src/hooks/useProof.ts +++ b/packages/react/src/hooks/useProof.ts @@ -1,7 +1,7 @@ 'use client' import type { Config, GetProofErrorType, ResolvedRegister } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetProofData, type GetProofOptions, @@ -18,7 +18,7 @@ import { useConfig } from './useConfig.js' export type UseProofParameters< config extends Config = Config, selectData = GetProofData, -> = Evaluate< +> = Compute< GetProofOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/usePublicClient.ts b/packages/react/src/hooks/usePublicClient.ts index fef2f5f596..5193f170b6 100644 --- a/packages/react/src/hooks/usePublicClient.ts +++ b/packages/react/src/hooks/usePublicClient.ts @@ -8,7 +8,7 @@ import { getPublicClient, watchPublicClient, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector.js' import type { ConfigParameter } from '../types/properties.js' @@ -19,7 +19,7 @@ export type UsePublicClientParameters< chainId extends config['chains'][number]['id'] | number | undefined = | config['chains'][number]['id'] | undefined, -> = Evaluate< +> = Compute< GetPublicClientParameters & ConfigParameter > diff --git a/packages/react/src/hooks/useReadContract.ts b/packages/react/src/hooks/useReadContract.ts index b5973beb17..f8ce947a6b 100644 --- a/packages/react/src/hooks/useReadContract.ts +++ b/packages/react/src/hooks/useReadContract.ts @@ -5,7 +5,7 @@ import type { ReadContractErrorType, ResolvedRegister, } from '@wagmi/core' -import type { UnionEvaluate } from '@wagmi/core/internal' +import type { UnionCompute } from '@wagmi/core/internal' import { type ReadContractData, type ReadContractOptions, @@ -34,7 +34,7 @@ export type UseReadContractParameters< > = ContractFunctionArgs, config extends Config = Config, selectData = ReadContractData, -> = UnionEvaluate< +> = UnionCompute< ReadContractOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useReadContracts.ts b/packages/react/src/hooks/useReadContracts.ts index 4504921939..7be786c4a8 100644 --- a/packages/react/src/hooks/useReadContracts.ts +++ b/packages/react/src/hooks/useReadContracts.ts @@ -5,7 +5,7 @@ import type { ReadContractsErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type ReadContractsData, type ReadContractsOptions, @@ -27,7 +27,7 @@ export type UseReadContractsParameters< allowFailure extends boolean = true, config extends Config = Config, selectData = ReadContractsData, -> = Evaluate< +> = Compute< ReadContractsOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useReconnect.ts b/packages/react/src/hooks/useReconnect.ts index fc30f528ad..23e6d365e4 100644 --- a/packages/react/src/hooks/useReconnect.ts +++ b/packages/react/src/hooks/useReconnect.ts @@ -2,7 +2,7 @@ import { useMutation } from '@tanstack/react-query' import type { Connector, ReconnectErrorType } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type ReconnectData, type ReconnectMutate, @@ -18,7 +18,7 @@ import type { } from '../utils/query.js' import { useConfig } from './useConfig.js' -export type UseReconnectParameters = Evaluate< +export type UseReconnectParameters = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -31,7 +31,7 @@ export type UseReconnectParameters = Evaluate< } > -export type UseReconnectReturnType = Evaluate< +export type UseReconnectReturnType = Compute< UseMutationReturnType< ReconnectData, ReconnectErrorType, diff --git a/packages/react/src/hooks/useSendTransaction.ts b/packages/react/src/hooks/useSendTransaction.ts index 1e61460144..8f57b1509c 100644 --- a/packages/react/src/hooks/useSendTransaction.ts +++ b/packages/react/src/hooks/useSendTransaction.ts @@ -6,7 +6,7 @@ import type { ResolvedRegister, SendTransactionErrorType, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type SendTransactionData, type SendTransactionMutate, @@ -25,7 +25,7 @@ import { useConfig } from './useConfig.js' export type UseSendTransactionParameters< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -41,7 +41,7 @@ export type UseSendTransactionParameters< export type UseSendTransactionReturnType< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< UseMutationReturnType< SendTransactionData, SendTransactionErrorType, diff --git a/packages/react/src/hooks/useSignMessage.ts b/packages/react/src/hooks/useSignMessage.ts index 802aad5fc1..0bea4bb65f 100644 --- a/packages/react/src/hooks/useSignMessage.ts +++ b/packages/react/src/hooks/useSignMessage.ts @@ -2,7 +2,7 @@ import { useMutation } from '@tanstack/react-query' import type { SignMessageErrorType } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type SignMessageData, type SignMessageMutate, @@ -18,7 +18,7 @@ import type { } from '../utils/query.js' import { useConfig } from './useConfig.js' -export type UseSignMessageParameters = Evaluate< +export type UseSignMessageParameters = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -31,7 +31,7 @@ export type UseSignMessageParameters = Evaluate< } > -export type UseSignMessageReturnType = Evaluate< +export type UseSignMessageReturnType = Compute< UseMutationReturnType< SignMessageData, SignMessageErrorType, diff --git a/packages/react/src/hooks/useSignTypedData.ts b/packages/react/src/hooks/useSignTypedData.ts index aaf21b4667..080cd04405 100644 --- a/packages/react/src/hooks/useSignTypedData.ts +++ b/packages/react/src/hooks/useSignTypedData.ts @@ -2,7 +2,7 @@ import { useMutation } from '@tanstack/react-query' import type { SignTypedDataErrorType } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type SignTypedDataData, type SignTypedDataMutate, @@ -18,7 +18,7 @@ import type { } from '../utils/query.js' import { useConfig } from './useConfig.js' -export type UseSignTypedDataParameters = Evaluate< +export type UseSignTypedDataParameters = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -31,7 +31,7 @@ export type UseSignTypedDataParameters = Evaluate< } > -export type UseSignTypedDataReturnType = Evaluate< +export type UseSignTypedDataReturnType = Compute< UseMutationReturnType< SignTypedDataData, SignTypedDataErrorType, diff --git a/packages/react/src/hooks/useStorageAt.ts b/packages/react/src/hooks/useStorageAt.ts index e93e730945..3a58376fd4 100644 --- a/packages/react/src/hooks/useStorageAt.ts +++ b/packages/react/src/hooks/useStorageAt.ts @@ -5,7 +5,7 @@ import type { GetStorageAtErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetStorageAtData, type GetStorageAtOptions, @@ -21,7 +21,7 @@ import { useConfig } from './useConfig.js' export type UseStorageAtParameters< config extends Config = Config, selectData = GetStorageAtData, -> = Evaluate< +> = Compute< GetStorageAtOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useSwitchAccount.ts b/packages/react/src/hooks/useSwitchAccount.ts index ae93aa3342..e9dc305545 100644 --- a/packages/react/src/hooks/useSwitchAccount.ts +++ b/packages/react/src/hooks/useSwitchAccount.ts @@ -7,7 +7,7 @@ import type { ResolvedRegister, SwitchAccountErrorType, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type SwitchAccountData, type SwitchAccountMutate, @@ -27,7 +27,7 @@ import { useConnections } from './useConnections.js' export type UseSwitchAccountParameters< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -43,7 +43,7 @@ export type UseSwitchAccountParameters< export type UseSwitchAccountReturnType< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< UseMutationReturnType< SwitchAccountData, SwitchAccountErrorType, diff --git a/packages/react/src/hooks/useSwitchChain.test-d.ts b/packages/react/src/hooks/useSwitchChain.test-d.ts index 28e17a5800..07098c7724 100644 --- a/packages/react/src/hooks/useSwitchChain.test-d.ts +++ b/packages/react/src/hooks/useSwitchChain.test-d.ts @@ -1,6 +1,6 @@ import type { Connector, SwitchChainErrorType } from '@wagmi/core' import type { Chain } from '@wagmi/core/chains' -import type { Evaluate, ExactPartial } from '@wagmi/core/internal' +import type { Compute, ExactPartial } from '@wagmi/core/internal' import { chain } from '@wagmi/test' import { expectTypeOf, test } from 'vitest' @@ -43,11 +43,11 @@ test('context', () => { chainId: number connector?: Connector | undefined }>() - expectTypeOf(data).toEqualTypeOf>() + expectTypeOf(data).toEqualTypeOf>() expectTypeOf(context).toEqualTypeOf() }, onSettled(data, error, variables, context) { - expectTypeOf(data).toEqualTypeOf | undefined>() + expectTypeOf(data).toEqualTypeOf | undefined>() expectTypeOf(error).toEqualTypeOf() expectTypeOf(variables).toEqualTypeOf<{ addEthereumChainParameter?: @@ -62,7 +62,7 @@ test('context', () => { }) expectTypeOf(chains).toEqualTypeOf() - expectTypeOf(data).toEqualTypeOf | undefined>() + expectTypeOf(data).toEqualTypeOf | undefined>() expectTypeOf(error).toEqualTypeOf() expectTypeOf(variables).toEqualTypeOf< | { @@ -98,11 +98,11 @@ test('context', () => { chainId: number connector?: Connector | undefined }>() - expectTypeOf(data).toEqualTypeOf>() + expectTypeOf(data).toEqualTypeOf>() expectTypeOf(context).toEqualTypeOf() }, onSettled(data, error, variables, context) { - expectTypeOf(data).toEqualTypeOf | undefined>() + expectTypeOf(data).toEqualTypeOf | undefined>() expectTypeOf(error).toEqualTypeOf() expectTypeOf(variables).toEqualTypeOf<{ addEthereumChainParameter?: diff --git a/packages/react/src/hooks/useSwitchChain.ts b/packages/react/src/hooks/useSwitchChain.ts index 7351073632..97ecf4ce9e 100644 --- a/packages/react/src/hooks/useSwitchChain.ts +++ b/packages/react/src/hooks/useSwitchChain.ts @@ -6,7 +6,7 @@ import type { ResolvedRegister, SwitchChainErrorType, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type SwitchChainData, type SwitchChainMutate, @@ -26,7 +26,7 @@ import { useConfig } from './useConfig.js' export type UseSwitchChainParameters< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -42,7 +42,7 @@ export type UseSwitchChainParameters< export type UseSwitchChainReturnType< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< UseMutationReturnType< SwitchChainData, SwitchChainErrorType, diff --git a/packages/react/src/hooks/useToken.ts b/packages/react/src/hooks/useToken.ts index 43e21817df..1d43912f72 100644 --- a/packages/react/src/hooks/useToken.ts +++ b/packages/react/src/hooks/useToken.ts @@ -1,7 +1,7 @@ 'use client' import type { Config, GetTokenErrorType, ResolvedRegister } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetTokenData, type GetTokenOptions, @@ -18,7 +18,7 @@ import { useConfig } from './useConfig.js' export type UseTokenParameters< config extends Config = Config, selectData = GetTokenData, -> = Evaluate< +> = Compute< GetTokenOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useTransaction.ts b/packages/react/src/hooks/useTransaction.ts index 84719f9f48..6cc920e873 100644 --- a/packages/react/src/hooks/useTransaction.ts +++ b/packages/react/src/hooks/useTransaction.ts @@ -5,7 +5,7 @@ import type { GetTransactionErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetTransactionData, type GetTransactionOptions, @@ -24,7 +24,7 @@ export type UseTransactionParameters< chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], selectData = GetTransactionData, -> = Evaluate< +> = Compute< GetTransactionOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useTransactionCount.ts b/packages/react/src/hooks/useTransactionCount.ts index adeef75170..341536aea7 100644 --- a/packages/react/src/hooks/useTransactionCount.ts +++ b/packages/react/src/hooks/useTransactionCount.ts @@ -5,7 +5,7 @@ import type { GetTransactionCountErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import type { GetTransactionCountQueryFnData } from '@wagmi/core/query' import { type GetTransactionCountData, @@ -22,7 +22,7 @@ import { useConfig } from './useConfig.js' export type UseTransactionCountParameters< config extends Config = Config, selectData = GetTransactionCountData, -> = Evaluate< +> = Compute< GetTransactionCountOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useTransactionReceipt.ts b/packages/react/src/hooks/useTransactionReceipt.ts index 2816def0d1..f29ab6204e 100644 --- a/packages/react/src/hooks/useTransactionReceipt.ts +++ b/packages/react/src/hooks/useTransactionReceipt.ts @@ -5,7 +5,7 @@ import type { GetTransactionReceiptErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetTransactionReceiptData, type GetTransactionReceiptOptions, @@ -23,7 +23,7 @@ export type UseTransactionReceiptParameters< chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], selectData = GetTransactionReceiptData, -> = Evaluate< +> = Compute< GetTransactionReceiptOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useVerifyMessage.ts b/packages/react/src/hooks/useVerifyMessage.ts index 1551dd78f8..ae8bb6df21 100644 --- a/packages/react/src/hooks/useVerifyMessage.ts +++ b/packages/react/src/hooks/useVerifyMessage.ts @@ -5,7 +5,7 @@ import type { ResolvedRegister, VerifyMessageErrorType, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type VerifyMessageData, type VerifyMessageOptions, @@ -21,7 +21,7 @@ import { useConfig } from './useConfig.js' export type UseVerifyMessageParameters< config extends Config = Config, selectData = VerifyMessageData, -> = Evaluate< +> = Compute< VerifyMessageOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useWaitForTransactionReceipt.ts b/packages/react/src/hooks/useWaitForTransactionReceipt.ts index 1177a1a76b..c07d1639bc 100644 --- a/packages/react/src/hooks/useWaitForTransactionReceipt.ts +++ b/packages/react/src/hooks/useWaitForTransactionReceipt.ts @@ -5,7 +5,7 @@ import type { ResolvedRegister, WaitForTransactionReceiptErrorType, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type WaitForTransactionReceiptData, type WaitForTransactionReceiptOptions, @@ -24,7 +24,7 @@ export type UseWaitForTransactionReceiptParameters< chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], selectData = WaitForTransactionReceiptData, -> = Evaluate< +> = Compute< WaitForTransactionReceiptOptions & ConfigParameter & QueryParameter< diff --git a/packages/react/src/hooks/useWalletClient.ts b/packages/react/src/hooks/useWalletClient.ts index 1011be11d8..a045eee5d3 100644 --- a/packages/react/src/hooks/useWalletClient.ts +++ b/packages/react/src/hooks/useWalletClient.ts @@ -9,7 +9,7 @@ import type { GetWalletClientErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate, Omit } from '@wagmi/core/internal' +import type { Compute, Omit } from '@wagmi/core/internal' import { type GetWalletClientData, type GetWalletClientOptions, @@ -34,11 +34,11 @@ export type UseWalletClientParameters< chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], selectData = GetWalletClientData, -> = Evaluate< +> = Compute< GetWalletClientOptions & ConfigParameter & { query?: - | Evaluate< + | Compute< Omit< UseQueryParameters< GetWalletClientQueryFnData, diff --git a/packages/react/src/hooks/useWatchBlockNumber.ts b/packages/react/src/hooks/useWatchBlockNumber.ts index 5f011bf746..33ddac48a6 100644 --- a/packages/react/src/hooks/useWatchBlockNumber.ts +++ b/packages/react/src/hooks/useWatchBlockNumber.ts @@ -6,7 +6,7 @@ import { type WatchBlockNumberParameters, watchBlockNumber, } from '@wagmi/core' -import type { UnionEvaluate, UnionPartial } from '@wagmi/core/internal' +import type { UnionCompute, UnionExactPartial } from '@wagmi/core/internal' import { useEffect } from 'react' import type { ConfigParameter, EnabledParameter } from '../types/properties.js' @@ -17,8 +17,8 @@ export type UseWatchBlockNumberParameters< config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = UnionEvaluate< - UnionPartial> & +> = UnionCompute< + UnionExactPartial> & ConfigParameter & EnabledParameter > diff --git a/packages/react/src/hooks/useWatchBlocks.ts b/packages/react/src/hooks/useWatchBlocks.ts index c86f9c7de6..466929c841 100644 --- a/packages/react/src/hooks/useWatchBlocks.ts +++ b/packages/react/src/hooks/useWatchBlocks.ts @@ -6,7 +6,7 @@ import { type WatchBlocksParameters, watchBlocks, } from '@wagmi/core' -import type { UnionEvaluate, UnionPartial } from '@wagmi/core/internal' +import type { UnionCompute, UnionExactPartial } from '@wagmi/core/internal' import { useEffect } from 'react' import type { BlockTag } from 'viem' @@ -20,8 +20,8 @@ export type UseWatchBlocksParameters< config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = UnionEvaluate< - UnionPartial< +> = UnionCompute< + UnionExactPartial< WatchBlocksParameters > & ConfigParameter & diff --git a/packages/react/src/hooks/useWatchContractEvent.ts b/packages/react/src/hooks/useWatchContractEvent.ts index f2c77b28a6..01e14e23af 100644 --- a/packages/react/src/hooks/useWatchContractEvent.ts +++ b/packages/react/src/hooks/useWatchContractEvent.ts @@ -6,7 +6,7 @@ import { type WatchContractEventParameters, watchContractEvent, } from '@wagmi/core' -import type { UnionEvaluate, UnionPartial } from '@wagmi/core/internal' +import type { UnionCompute, UnionExactPartial } from '@wagmi/core/internal' import { useEffect } from 'react' import type { Abi, ContractEventName } from 'viem' @@ -21,8 +21,8 @@ export type UseWatchContractEventParameters< config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = UnionEvaluate< - UnionPartial< +> = UnionCompute< + UnionExactPartial< WatchContractEventParameters > & ConfigParameter & diff --git a/packages/react/src/hooks/useWatchPendingTransactions.ts b/packages/react/src/hooks/useWatchPendingTransactions.ts index 05f1d45ee6..7461ffcfb4 100644 --- a/packages/react/src/hooks/useWatchPendingTransactions.ts +++ b/packages/react/src/hooks/useWatchPendingTransactions.ts @@ -6,7 +6,7 @@ import { type WatchPendingTransactionsParameters, watchPendingTransactions, } from '@wagmi/core' -import type { UnionEvaluate, UnionPartial } from '@wagmi/core/internal' +import type { UnionCompute, UnionExactPartial } from '@wagmi/core/internal' import { useEffect } from 'react' import type { ConfigParameter, EnabledParameter } from '../types/properties.js' @@ -17,8 +17,8 @@ export type UseWatchPendingTransactionsParameters< config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], -> = UnionEvaluate< - UnionPartial> & +> = UnionCompute< + UnionExactPartial> & ConfigParameter & EnabledParameter > diff --git a/packages/react/src/utils/query.ts b/packages/react/src/utils/query.ts index 03cbf4d2f5..3aafb16123 100644 --- a/packages/react/src/utils/query.ts +++ b/packages/react/src/utils/query.ts @@ -12,10 +12,10 @@ import { useMutation, } from '@tanstack/react-query' import type { - Evaluate, + Compute, ExactPartial, Omit, - UnionOmit, + UnionStrictOmit, } from '@wagmi/core/internal' import { hashFn } from '@wagmi/core/query' @@ -24,9 +24,9 @@ export type UseMutationParameters< error = Error, variables = void, context = unknown, -> = Evaluate< +> = Compute< Omit< - UseMutationOptions, context>, + UseMutationOptions, context>, 'mutationFn' | 'mutationKey' | 'throwOnError' > > @@ -36,8 +36,8 @@ export type UseMutationReturnType< error = Error, variables = void, context = unknown, -> = Evaluate< - UnionOmit< +> = Compute< + UnionStrictOmit< UseMutationResult, 'mutate' | 'mutateAsync' > @@ -52,7 +52,7 @@ export type UseQueryParameters< error = DefaultError, data = queryFnData, queryKey extends QueryKey = QueryKey, -> = Evaluate< +> = Compute< ExactPartial< Omit, 'initialData'> > & { @@ -63,7 +63,7 @@ export type UseQueryParameters< } > -export type UseQueryReturnType = Evaluate< +export type UseQueryReturnType = Compute< UseQueryResult & { queryKey: QueryKey } @@ -94,7 +94,7 @@ export type UseInfiniteQueryParameters< queryData = queryFnData, queryKey extends QueryKey = QueryKey, pageParam = unknown, -> = Evaluate< +> = Compute< Omit< UseInfiniteQueryOptions< queryFnData, diff --git a/packages/test/src/chains.ts b/packages/test/src/chains.ts index b9f08d3b5a..a79cea6a0b 100644 --- a/packages/test/src/chains.ts +++ b/packages/test/src/chains.ts @@ -1,4 +1,4 @@ -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type Chain as viem_Chain, mainnet as viem_mainnet, @@ -9,7 +9,7 @@ import { getRpcUrls } from './utils.js' type Fork = { blockNumber: bigint; url: string } -export type Chain = Evaluate< +export type Chain = Compute< viem_Chain & { fork: Fork port: number diff --git a/packages/vue/src/composables/useAccountEffect.ts b/packages/vue/src/composables/useAccountEffect.ts index 3da9d47be2..021624cea8 100644 --- a/packages/vue/src/composables/useAccountEffect.ts +++ b/packages/vue/src/composables/useAccountEffect.ts @@ -1,5 +1,5 @@ import { type GetAccountReturnType, watchAccount } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { watchEffect } from 'vue' import type { ConfigParameter } from '../types/properties.js' @@ -7,11 +7,11 @@ import type { DeepMaybeRef } from '../types/ref.js' import { deepUnref } from '../utils/cloneDeep.js' import { useConfig } from './useConfig.js' -export type UseAccountEffectParameters = Evaluate< +export type UseAccountEffectParameters = Compute< DeepMaybeRef< { onConnect?( - data: Evaluate< + data: Compute< Pick< Extract, 'address' | 'addresses' | 'chain' | 'chainId' | 'connector' diff --git a/packages/vue/src/composables/useBalance.ts b/packages/vue/src/composables/useBalance.ts index 5a2b449309..1fdcdc9450 100644 --- a/packages/vue/src/composables/useBalance.ts +++ b/packages/vue/src/composables/useBalance.ts @@ -1,5 +1,5 @@ import type { Config, GetBalanceErrorType, ResolvedRegister } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetBalanceData, type GetBalanceOptions, @@ -19,7 +19,7 @@ import { useConfig } from './useConfig.js' export type UseBalanceParameters< config extends Config = Config, selectData = GetBalanceData, -> = Evaluate< +> = Compute< DeepMaybeRef< GetBalanceOptions & ConfigParameter & diff --git a/packages/vue/src/composables/useBlockNumber.ts b/packages/vue/src/composables/useBlockNumber.ts index 6bed988cdd..29daf92c99 100644 --- a/packages/vue/src/composables/useBlockNumber.ts +++ b/packages/vue/src/composables/useBlockNumber.ts @@ -4,7 +4,7 @@ import type { GetBlockNumberErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate, UnionEvaluate, UnionOmit } from '@wagmi/core/internal' +import type { Compute, UnionCompute, UnionStrictOmit } from '@wagmi/core/internal' import { type GetBlockNumberData, type GetBlockNumberOptions, @@ -30,7 +30,7 @@ export type UseBlockNumberParameters< chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], selectData = GetBlockNumberData, -> = Evaluate< +> = Compute< DeepMaybeRef< GetBlockNumberOptions & ConfigParameter & @@ -42,8 +42,8 @@ export type UseBlockNumberParameters< > & { watch?: | boolean - | UnionEvaluate< - UnionOmit< + | UnionCompute< + UnionStrictOmit< DeepUnwrapRef>, 'chainId' | 'config' | 'onBlockNumber' | 'onError' > diff --git a/packages/vue/src/composables/useClient.ts b/packages/vue/src/composables/useClient.ts index 8e8b3bb48a..e29b38826b 100644 --- a/packages/vue/src/composables/useClient.ts +++ b/packages/vue/src/composables/useClient.ts @@ -6,7 +6,7 @@ import { getClient, watchClient, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type Ref, computed, @@ -26,7 +26,7 @@ export type UseClientParameters< chainId extends config['chains'][number]['id'] | number | undefined = | config['chains'][number]['id'] | undefined, -> = Evaluate< +> = Compute< DeepMaybeRef & ConfigParameter> > diff --git a/packages/vue/src/composables/useConnect.ts b/packages/vue/src/composables/useConnect.ts index 781d32e3d4..4851f3b580 100644 --- a/packages/vue/src/composables/useConnect.ts +++ b/packages/vue/src/composables/useConnect.ts @@ -5,7 +5,7 @@ import type { GetConnectorsReturnType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type ConnectData, type ConnectMutate, @@ -26,7 +26,7 @@ import { useConnectors } from './useConnectors.js' export type UseConnectParameters< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -42,7 +42,7 @@ export type UseConnectParameters< export type UseConnectReturnType< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< UseMutationReturnType< ConnectData, ConnectErrorType, @@ -51,7 +51,7 @@ export type UseConnectReturnType< > & { connect: ConnectMutate connectAsync: ConnectMutateAsync - connectors: Evaluate + connectors: Compute } > diff --git a/packages/vue/src/composables/useConnectorClient.ts b/packages/vue/src/composables/useConnectorClient.ts index 1a3eabfdaf..b49431c8e6 100644 --- a/packages/vue/src/composables/useConnectorClient.ts +++ b/packages/vue/src/composables/useConnectorClient.ts @@ -5,7 +5,7 @@ import type { GetConnectorClientErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate, Omit } from '@wagmi/core/internal' +import type { Compute, Omit } from '@wagmi/core/internal' import { type GetConnectorClientData, type GetConnectorClientOptions, @@ -32,12 +32,12 @@ export type UseConnectorClientParameters< chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], selectData = GetConnectorClientData, -> = Evaluate< +> = Compute< DeepMaybeRef< GetConnectorClientOptions & ConfigParameter & { query?: - | Evaluate< + | Compute< Omit< DeepUnwrapRef< UseQueryParameters< diff --git a/packages/vue/src/composables/useDisconnect.ts b/packages/vue/src/composables/useDisconnect.ts index 41b893a8be..540e588124 100644 --- a/packages/vue/src/composables/useDisconnect.ts +++ b/packages/vue/src/composables/useDisconnect.ts @@ -1,6 +1,6 @@ import { useMutation } from '@tanstack/vue-query' import type { Connector, DisconnectErrorType } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type DisconnectData, type DisconnectMutate, @@ -18,7 +18,7 @@ import type { import { useConfig } from './useConfig.js' import { useConnections } from './useConnections.js' -export type UseDisconnectParameters = Evaluate< +export type UseDisconnectParameters = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -31,7 +31,7 @@ export type UseDisconnectParameters = Evaluate< } > -export type UseDisconnectReturnType = Evaluate< +export type UseDisconnectReturnType = Compute< UseMutationReturnType< DisconnectData, DisconnectErrorType, diff --git a/packages/vue/src/composables/useEnsAddress.ts b/packages/vue/src/composables/useEnsAddress.ts index 79c2990756..ecb27ac143 100644 --- a/packages/vue/src/composables/useEnsAddress.ts +++ b/packages/vue/src/composables/useEnsAddress.ts @@ -3,7 +3,7 @@ import type { GetEnsAddressErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetEnsAddressData, type GetEnsAddressOptions, @@ -23,7 +23,7 @@ import { useConfig } from './useConfig.js' export type UseEnsAddressParameters< config extends Config = Config, selectData = GetEnsAddressData, -> = Evaluate< +> = Compute< DeepMaybeRef< GetEnsAddressOptions & ConfigParameter & diff --git a/packages/vue/src/composables/useEnsAvatar.ts b/packages/vue/src/composables/useEnsAvatar.ts index e2bd9bcef0..ff328ad87c 100644 --- a/packages/vue/src/composables/useEnsAvatar.ts +++ b/packages/vue/src/composables/useEnsAvatar.ts @@ -3,7 +3,7 @@ import type { GetEnsAvatarErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetEnsAvatarData, type GetEnsAvatarOptions, @@ -23,7 +23,7 @@ import { useConfig } from './useConfig.js' export type UseEnsAvatarParameters< config extends Config = Config, selectData = GetEnsAvatarData, -> = Evaluate< +> = Compute< DeepMaybeRef< GetEnsAvatarOptions & ConfigParameter & diff --git a/packages/vue/src/composables/useEnsName.ts b/packages/vue/src/composables/useEnsName.ts index a9feb22958..ba251aa5a3 100644 --- a/packages/vue/src/composables/useEnsName.ts +++ b/packages/vue/src/composables/useEnsName.ts @@ -1,5 +1,5 @@ import type { Config, GetEnsNameErrorType, ResolvedRegister } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetEnsNameData, type GetEnsNameOptions, @@ -19,7 +19,7 @@ import { useConfig } from './useConfig.js' export type UseEnsNameParameters< config extends Config = Config, selectData = GetEnsNameData, -> = Evaluate< +> = Compute< DeepMaybeRef< GetEnsNameOptions & ConfigParameter & diff --git a/packages/vue/src/composables/useReadContract.ts b/packages/vue/src/composables/useReadContract.ts index c3f80eb57a..a064a220a1 100644 --- a/packages/vue/src/composables/useReadContract.ts +++ b/packages/vue/src/composables/useReadContract.ts @@ -3,7 +3,7 @@ import type { ReadContractErrorType, ResolvedRegister, } from '@wagmi/core' -import type { UnionEvaluate } from '@wagmi/core/internal' +import type { UnionCompute } from '@wagmi/core/internal' import { type ReadContractData, type ReadContractOptions, @@ -35,7 +35,7 @@ export type UseReadContractParameters< > = ContractFunctionArgs, config extends Config = Config, selectData = ReadContractData, -> = UnionEvaluate< +> = UnionCompute< DeepMaybeRef< ReadContractOptions & ConfigParameter & diff --git a/packages/vue/src/composables/useReconnect.ts b/packages/vue/src/composables/useReconnect.ts index b7d3a4ce29..cfab97d858 100644 --- a/packages/vue/src/composables/useReconnect.ts +++ b/packages/vue/src/composables/useReconnect.ts @@ -1,6 +1,6 @@ import { useMutation } from '@tanstack/vue-query' import type { Connector, ReconnectErrorType } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type ReconnectData, type ReconnectMutate, @@ -16,7 +16,7 @@ import type { } from '../utils/query.js' import { useConfig } from './useConfig.js' -export type UseReconnectParameters = Evaluate< +export type UseReconnectParameters = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -29,7 +29,7 @@ export type UseReconnectParameters = Evaluate< } > -export type UseReconnectReturnType = Evaluate< +export type UseReconnectReturnType = Compute< UseMutationReturnType< ReconnectData, ReconnectErrorType, diff --git a/packages/vue/src/composables/useSendTransaction.ts b/packages/vue/src/composables/useSendTransaction.ts index 5f0cc19031..d5bc718337 100644 --- a/packages/vue/src/composables/useSendTransaction.ts +++ b/packages/vue/src/composables/useSendTransaction.ts @@ -4,7 +4,7 @@ import type { ResolvedRegister, SendTransactionErrorType, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type SendTransactionData, type SendTransactionMutate, @@ -23,7 +23,7 @@ import { useConfig } from './useConfig.js' export type UseSendTransactionParameters< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -39,7 +39,7 @@ export type UseSendTransactionParameters< export type UseSendTransactionReturnType< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< UseMutationReturnType< SendTransactionData, SendTransactionErrorType, diff --git a/packages/vue/src/composables/useSignMessage.ts b/packages/vue/src/composables/useSignMessage.ts index 009a0a4637..2f7222b6a4 100644 --- a/packages/vue/src/composables/useSignMessage.ts +++ b/packages/vue/src/composables/useSignMessage.ts @@ -1,5 +1,5 @@ import type { SignMessageErrorType } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type SignMessageData, type SignMessageMutate, @@ -16,7 +16,7 @@ import { } from '../utils/query.js' import { useConfig } from './useConfig.js' -export type UseSignMessageParameters = Evaluate< +export type UseSignMessageParameters = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -29,7 +29,7 @@ export type UseSignMessageParameters = Evaluate< } > -export type UseSignMessageReturnType = Evaluate< +export type UseSignMessageReturnType = Compute< UseMutationReturnType< SignMessageData, SignMessageErrorType, diff --git a/packages/vue/src/composables/useSignTypedData.ts b/packages/vue/src/composables/useSignTypedData.ts index 9b2a69f1cd..f0bdbf6c64 100644 --- a/packages/vue/src/composables/useSignTypedData.ts +++ b/packages/vue/src/composables/useSignTypedData.ts @@ -1,5 +1,5 @@ import type { SignTypedDataErrorType } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type SignTypedDataData, type SignTypedDataMutate, @@ -16,7 +16,7 @@ import { } from '../utils/query.js' import { useConfig } from './useConfig.js' -export type UseSignTypedDataParameters = Evaluate< +export type UseSignTypedDataParameters = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -29,7 +29,7 @@ export type UseSignTypedDataParameters = Evaluate< } > -export type UseSignTypedDataReturnType = Evaluate< +export type UseSignTypedDataReturnType = Compute< UseMutationReturnType< SignTypedDataData, SignTypedDataErrorType, diff --git a/packages/vue/src/composables/useSwitchAccount.ts b/packages/vue/src/composables/useSwitchAccount.ts index 2503212fcd..0c8f76a486 100644 --- a/packages/vue/src/composables/useSwitchAccount.ts +++ b/packages/vue/src/composables/useSwitchAccount.ts @@ -5,7 +5,7 @@ import type { ResolvedRegister, SwitchAccountErrorType, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type SwitchAccountData, type SwitchAccountMutate, @@ -26,7 +26,7 @@ import { useConnections } from './useConnections.js' export type UseSwitchAccountParameters< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -42,7 +42,7 @@ export type UseSwitchAccountParameters< export type UseSwitchAccountReturnType< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< UseMutationReturnType< SwitchAccountData, SwitchAccountErrorType, diff --git a/packages/vue/src/composables/useSwitchChain.test-d.ts b/packages/vue/src/composables/useSwitchChain.test-d.ts index a16e74130e..e770460946 100644 --- a/packages/vue/src/composables/useSwitchChain.test-d.ts +++ b/packages/vue/src/composables/useSwitchChain.test-d.ts @@ -1,6 +1,6 @@ import type { Connector, SwitchChainErrorType } from '@wagmi/core' import type { Chain } from '@wagmi/core/chains' -import type { Evaluate, ExactPartial } from '@wagmi/core/internal' +import type { Compute, ExactPartial } from '@wagmi/core/internal' import { chain } from '@wagmi/test' import { expectTypeOf, test } from 'vitest' @@ -43,11 +43,11 @@ test('context', () => { chainId: number connector?: Connector | undefined }>() - expectTypeOf(data).toEqualTypeOf>() + expectTypeOf(data).toEqualTypeOf>() expectTypeOf(context).toEqualTypeOf() }, onSettled(data, error, variables, context) { - expectTypeOf(data).toEqualTypeOf | undefined>() + expectTypeOf(data).toEqualTypeOf | undefined>() expectTypeOf(error).toEqualTypeOf() expectTypeOf(variables).toEqualTypeOf<{ addEthereumChainParameter?: @@ -62,7 +62,7 @@ test('context', () => { }) expectTypeOf(chains.value).toEqualTypeOf() - expectTypeOf(data.value).toEqualTypeOf | undefined>() + expectTypeOf(data.value).toEqualTypeOf | undefined>() expectTypeOf(error.value).toEqualTypeOf() expectTypeOf(variables.value).toEqualTypeOf< | { @@ -98,11 +98,11 @@ test('context', () => { chainId: number connector?: Connector | undefined }>() - expectTypeOf(data).toEqualTypeOf>() + expectTypeOf(data).toEqualTypeOf>() expectTypeOf(context).toEqualTypeOf() }, onSettled(data, error, variables, context) { - expectTypeOf(data).toEqualTypeOf | undefined>() + expectTypeOf(data).toEqualTypeOf | undefined>() expectTypeOf(error).toEqualTypeOf() expectTypeOf(variables).toEqualTypeOf<{ addEthereumChainParameter?: diff --git a/packages/vue/src/composables/useSwitchChain.ts b/packages/vue/src/composables/useSwitchChain.ts index c47d702b6b..8ff43c0fa9 100644 --- a/packages/vue/src/composables/useSwitchChain.ts +++ b/packages/vue/src/composables/useSwitchChain.ts @@ -4,7 +4,7 @@ import type { ResolvedRegister, SwitchChainErrorType, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type SwitchChainData, type SwitchChainMutate, @@ -25,7 +25,7 @@ import { useConfig } from './useConfig.js' export type UseSwitchChainParameters< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< ConfigParameter & { mutation?: | UseMutationParameters< @@ -41,7 +41,7 @@ export type UseSwitchChainParameters< export type UseSwitchChainReturnType< config extends Config = Config, context = unknown, -> = Evaluate< +> = Compute< UseMutationReturnType< SwitchChainData, SwitchChainErrorType, diff --git a/packages/vue/src/composables/useTransaction.ts b/packages/vue/src/composables/useTransaction.ts index 7bb22d792d..eea49e68c1 100644 --- a/packages/vue/src/composables/useTransaction.ts +++ b/packages/vue/src/composables/useTransaction.ts @@ -3,7 +3,7 @@ import type { GetTransactionErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetTransactionData, type GetTransactionOptions, @@ -25,7 +25,7 @@ export type UseTransactionParameters< chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], selectData = GetTransactionData, -> = Evaluate< +> = Compute< DeepMaybeRef< GetTransactionOptions & ConfigParameter & diff --git a/packages/vue/src/composables/useTransactionReceipt.ts b/packages/vue/src/composables/useTransactionReceipt.ts index 939f420a30..cba5c232ae 100644 --- a/packages/vue/src/composables/useTransactionReceipt.ts +++ b/packages/vue/src/composables/useTransactionReceipt.ts @@ -3,7 +3,7 @@ import type { GetTransactionReceiptErrorType, ResolvedRegister, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type GetTransactionReceiptData, type GetTransactionReceiptOptions, @@ -25,7 +25,7 @@ export type UseTransactionReceiptParameters< chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], selectData = GetTransactionReceiptData, -> = Evaluate< +> = Compute< DeepMaybeRef< GetTransactionReceiptOptions & ConfigParameter & diff --git a/packages/vue/src/composables/useWaitForTransactionReceipt.ts b/packages/vue/src/composables/useWaitForTransactionReceipt.ts index 58ec835ea6..6aea7d8e06 100644 --- a/packages/vue/src/composables/useWaitForTransactionReceipt.ts +++ b/packages/vue/src/composables/useWaitForTransactionReceipt.ts @@ -3,7 +3,7 @@ import type { ResolvedRegister, WaitForTransactionReceiptErrorType, } from '@wagmi/core' -import type { Evaluate } from '@wagmi/core/internal' +import type { Compute } from '@wagmi/core/internal' import { type WaitForTransactionReceiptData, type WaitForTransactionReceiptOptions, @@ -25,7 +25,7 @@ export type UseWaitForTransactionReceiptParameters< chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], selectData = WaitForTransactionReceiptData, -> = Evaluate< +> = Compute< DeepMaybeRef< WaitForTransactionReceiptOptions & ConfigParameter & diff --git a/packages/vue/src/composables/useWatchBlockNumber.ts b/packages/vue/src/composables/useWatchBlockNumber.ts index 4d6ff68cd0..96dd437ec1 100644 --- a/packages/vue/src/composables/useWatchBlockNumber.ts +++ b/packages/vue/src/composables/useWatchBlockNumber.ts @@ -4,7 +4,7 @@ import { type WatchBlockNumberParameters, watchBlockNumber, } from '@wagmi/core' -import type { UnionEvaluate, UnionPartial } from '@wagmi/core/internal' +import type { UnionCompute, UnionExactPartial } from '@wagmi/core/internal' import { computed, watchEffect } from 'vue' import type { ConfigParameter, EnabledParameter } from '../types/properties.js' @@ -18,8 +18,8 @@ export type UseWatchBlockNumberParameters< chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], > = DeepMaybeRef< - UnionEvaluate< - UnionPartial> & + UnionCompute< + UnionExactPartial> & ConfigParameter & EnabledParameter > diff --git a/packages/vue/src/utils/query.ts b/packages/vue/src/utils/query.ts index 1182a0fcd0..0ea82af9b7 100644 --- a/packages/vue/src/utils/query.ts +++ b/packages/vue/src/utils/query.ts @@ -9,10 +9,10 @@ import { useMutation, } from '@tanstack/vue-query' import type { - Evaluate, + Compute, ExactPartial, Omit, - UnionOmit, + UnionStrictOmit, } from '@wagmi/core/internal' import { hashFn } from '@wagmi/core/query' import { type MaybeRef, computed, unref } from 'vue' @@ -24,11 +24,11 @@ export type UseMutationParameters< error = Error, variables = void, context = unknown, -> = Evaluate< +> = Compute< DeepMaybeRef< Omit< DeepUnwrapRef< - MutationObserverOptions, context> + MutationObserverOptions, context> >, 'mutationFn' | 'mutationKey' | 'throwOnError' > @@ -40,8 +40,8 @@ export type UseMutationReturnType< error = Error, variables = void, context = unknown, -> = Evaluate< - UnionOmit< +> = Compute< + UnionStrictOmit< tanstack_UseMutationReturnType, 'mutate' | 'mutateAsync' > @@ -56,7 +56,7 @@ export type UseQueryParameters< error = DefaultError, data = queryFnData, queryKey extends QueryKey = QueryKey, -> = Evaluate< +> = Compute< DeepMaybeRef< ExactPartial< Omit< @@ -76,7 +76,7 @@ export type UseQueryParameters< > > -export type UseQueryReturnType = Evaluate< +export type UseQueryReturnType = Compute< tanstack_UseQueryReturnType & { queryKey: QueryKey } @@ -110,7 +110,7 @@ export function useQuery( // queryData = queryFnData, // queryKey extends QueryKey = QueryKey, // pageParam = unknown, -// > = Evaluate< +// > = Compute< // Omit< // UseInfiniteQueryOptions< // queryFnData,