@wagmi/core 2.11.7 → 2.11.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/actions/codegen/createWriteContract.js.map +1 -1
- package/dist/esm/connectors/injected.js +7 -0
- package/dist/esm/connectors/injected.js.map +1 -1
- package/dist/esm/query/estimateGas.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/actions/codegen/createReadContract.d.ts +2 -2
- package/dist/types/actions/codegen/createReadContract.d.ts.map +1 -1
- package/dist/types/actions/codegen/createSimulateContract.d.ts +2 -2
- package/dist/types/actions/codegen/createSimulateContract.d.ts.map +1 -1
- package/dist/types/actions/codegen/createWatchContractEvent.d.ts +2 -2
- package/dist/types/actions/codegen/createWatchContractEvent.d.ts.map +1 -1
- package/dist/types/actions/codegen/createWriteContract.d.ts +4 -4
- package/dist/types/actions/codegen/createWriteContract.d.ts.map +1 -1
- package/dist/types/actions/connect.d.ts +2 -2
- package/dist/types/actions/connect.d.ts.map +1 -1
- package/dist/types/actions/deployContract.d.ts +2 -2
- package/dist/types/actions/deployContract.d.ts.map +1 -1
- package/dist/types/actions/estimateFeesPerGas.d.ts +5 -5
- package/dist/types/actions/estimateFeesPerGas.d.ts.map +1 -1
- package/dist/types/actions/estimateGas.d.ts +2 -2
- package/dist/types/actions/estimateGas.d.ts.map +1 -1
- package/dist/types/actions/estimateMaxPriorityFeePerGas.d.ts +2 -2
- package/dist/types/actions/estimateMaxPriorityFeePerGas.d.ts.map +1 -1
- package/dist/types/actions/getBalance.d.ts +2 -2
- package/dist/types/actions/getBalance.d.ts.map +1 -1
- package/dist/types/actions/getBlock.d.ts +3 -3
- package/dist/types/actions/getBlock.d.ts.map +1 -1
- package/dist/types/actions/getBlockNumber.d.ts +2 -2
- package/dist/types/actions/getBlockNumber.d.ts.map +1 -1
- package/dist/types/actions/getBlockTransactionCount.d.ts +2 -2
- package/dist/types/actions/getBlockTransactionCount.d.ts.map +1 -1
- package/dist/types/actions/getBytecode.d.ts +2 -2
- package/dist/types/actions/getBytecode.d.ts.map +1 -1
- package/dist/types/actions/getClient.d.ts +2 -2
- package/dist/types/actions/getClient.d.ts.map +1 -1
- package/dist/types/actions/getConnections.d.ts +2 -2
- package/dist/types/actions/getConnections.d.ts.map +1 -1
- package/dist/types/actions/getConnectorClient.d.ts +3 -3
- package/dist/types/actions/getConnectorClient.d.ts.map +1 -1
- package/dist/types/actions/getEnsAddress.d.ts +2 -2
- package/dist/types/actions/getEnsAddress.d.ts.map +1 -1
- package/dist/types/actions/getEnsAvatar.d.ts +2 -2
- package/dist/types/actions/getEnsAvatar.d.ts.map +1 -1
- package/dist/types/actions/getEnsName.d.ts +2 -2
- package/dist/types/actions/getEnsName.d.ts.map +1 -1
- package/dist/types/actions/getEnsResolver.d.ts +2 -2
- package/dist/types/actions/getEnsResolver.d.ts.map +1 -1
- package/dist/types/actions/getEnsText.d.ts +2 -2
- package/dist/types/actions/getEnsText.d.ts.map +1 -1
- package/dist/types/actions/getFeeHistory.d.ts +2 -2
- package/dist/types/actions/getFeeHistory.d.ts.map +1 -1
- package/dist/types/actions/getGasPrice.d.ts +2 -2
- package/dist/types/actions/getGasPrice.d.ts.map +1 -1
- package/dist/types/actions/getProof.d.ts +2 -2
- package/dist/types/actions/getProof.d.ts.map +1 -1
- package/dist/types/actions/getPublicClient.d.ts +2 -2
- package/dist/types/actions/getPublicClient.d.ts.map +1 -1
- package/dist/types/actions/getStorageAt.d.ts +2 -2
- package/dist/types/actions/getStorageAt.d.ts.map +1 -1
- package/dist/types/actions/getToken.d.ts +2 -2
- package/dist/types/actions/getToken.d.ts.map +1 -1
- package/dist/types/actions/getTransaction.d.ts +3 -3
- package/dist/types/actions/getTransaction.d.ts.map +1 -1
- package/dist/types/actions/getTransactionCount.d.ts +2 -2
- package/dist/types/actions/getTransactionCount.d.ts.map +1 -1
- package/dist/types/actions/getTransactionReceipt.d.ts +3 -3
- package/dist/types/actions/getTransactionReceipt.d.ts.map +1 -1
- package/dist/types/actions/getWalletClient.d.ts +2 -2
- package/dist/types/actions/getWalletClient.d.ts.map +1 -1
- package/dist/types/actions/prepareTransactionRequest.d.ts +3 -3
- package/dist/types/actions/prepareTransactionRequest.d.ts.map +1 -1
- package/dist/types/actions/reconnect.d.ts +2 -2
- package/dist/types/actions/reconnect.d.ts.map +1 -1
- package/dist/types/actions/sendTransaction.d.ts +2 -2
- package/dist/types/actions/sendTransaction.d.ts.map +1 -1
- package/dist/types/actions/signMessage.d.ts +2 -2
- package/dist/types/actions/signMessage.d.ts.map +1 -1
- package/dist/types/actions/signTypedData.d.ts +2 -2
- package/dist/types/actions/signTypedData.d.ts.map +1 -1
- package/dist/types/actions/simulateContract.d.ts +3 -3
- package/dist/types/actions/simulateContract.d.ts.map +1 -1
- package/dist/types/actions/switchChain.d.ts +3 -3
- package/dist/types/actions/switchChain.d.ts.map +1 -1
- package/dist/types/actions/verifyMessage.d.ts +2 -2
- package/dist/types/actions/verifyMessage.d.ts.map +1 -1
- package/dist/types/actions/verifyTypedData.d.ts +2 -2
- package/dist/types/actions/verifyTypedData.d.ts.map +1 -1
- package/dist/types/actions/waitForTransactionReceipt.d.ts +3 -3
- package/dist/types/actions/waitForTransactionReceipt.d.ts.map +1 -1
- package/dist/types/actions/watchBlockNumber.d.ts +2 -2
- package/dist/types/actions/watchBlockNumber.d.ts.map +1 -1
- package/dist/types/actions/watchBlocks.d.ts +2 -2
- package/dist/types/actions/watchBlocks.d.ts.map +1 -1
- package/dist/types/actions/watchContractEvent.d.ts +2 -2
- package/dist/types/actions/watchContractEvent.d.ts.map +1 -1
- package/dist/types/actions/watchPendingTransactions.d.ts +2 -2
- package/dist/types/actions/watchPendingTransactions.d.ts.map +1 -1
- package/dist/types/actions/writeContract.d.ts +3 -3
- package/dist/types/actions/writeContract.d.ts.map +1 -1
- package/dist/types/connectors/createConnector.d.ts +5 -5
- package/dist/types/connectors/createConnector.d.ts.map +1 -1
- package/dist/types/connectors/injected.d.ts +3 -3
- package/dist/types/connectors/injected.d.ts.map +1 -1
- package/dist/types/createConfig.d.ts +3 -3
- package/dist/types/createConfig.d.ts.map +1 -1
- package/dist/types/createStorage.d.ts +3 -3
- package/dist/types/createStorage.d.ts.map +1 -1
- package/dist/types/errors/base.d.ts +2 -2
- package/dist/types/errors/base.d.ts.map +1 -1
- package/dist/types/experimental/actions/sendCalls.d.ts +2 -2
- package/dist/types/experimental/actions/sendCalls.d.ts.map +1 -1
- package/dist/types/experimental/actions/writeContracts.d.ts +2 -2
- package/dist/types/experimental/actions/writeContracts.d.ts.map +1 -1
- package/dist/types/experimental/query/getCallsStatus.d.ts +2 -2
- package/dist/types/experimental/query/getCallsStatus.d.ts.map +1 -1
- package/dist/types/experimental/query/getCapabilities.d.ts +2 -2
- package/dist/types/experimental/query/getCapabilities.d.ts.map +1 -1
- package/dist/types/experimental/query/sendCalls.d.ts +4 -4
- package/dist/types/experimental/query/sendCalls.d.ts.map +1 -1
- package/dist/types/experimental/query/showCallsStatus.d.ts +4 -4
- package/dist/types/experimental/query/showCallsStatus.d.ts.map +1 -1
- package/dist/types/experimental/query/writeContracts.d.ts +4 -4
- package/dist/types/experimental/query/writeContracts.d.ts.map +1 -1
- package/dist/types/exports/internal.d.ts +1 -1
- package/dist/types/exports/internal.d.ts.map +1 -1
- package/dist/types/query/call.d.ts +2 -2
- package/dist/types/query/call.d.ts.map +1 -1
- package/dist/types/query/deployContract.d.ts +4 -4
- package/dist/types/query/deployContract.d.ts.map +1 -1
- package/dist/types/query/estimateFeesPerGas.d.ts +2 -2
- package/dist/types/query/estimateFeesPerGas.d.ts.map +1 -1
- package/dist/types/query/estimateGas.d.ts +2 -2
- package/dist/types/query/estimateGas.d.ts.map +1 -1
- package/dist/types/query/estimateMaxPriorityFeePerGas.d.ts +2 -2
- package/dist/types/query/estimateMaxPriorityFeePerGas.d.ts.map +1 -1
- package/dist/types/query/getBalance.d.ts +3 -3
- package/dist/types/query/getBalance.d.ts.map +1 -1
- package/dist/types/query/getBlock.d.ts +2 -2
- package/dist/types/query/getBlock.d.ts.map +1 -1
- package/dist/types/query/getBlockNumber.d.ts +2 -2
- package/dist/types/query/getBlockNumber.d.ts.map +1 -1
- package/dist/types/query/getBlockTransactionCount.d.ts +2 -2
- package/dist/types/query/getBlockTransactionCount.d.ts.map +1 -1
- package/dist/types/query/getBytecode.d.ts +2 -2
- package/dist/types/query/getBytecode.d.ts.map +1 -1
- package/dist/types/query/getConnectorClient.d.ts +2 -2
- package/dist/types/query/getConnectorClient.d.ts.map +1 -1
- package/dist/types/query/getEnsAddress.d.ts +2 -2
- package/dist/types/query/getEnsAddress.d.ts.map +1 -1
- package/dist/types/query/getEnsAvatar.d.ts +2 -2
- package/dist/types/query/getEnsAvatar.d.ts.map +1 -1
- package/dist/types/query/getEnsName.d.ts +2 -2
- package/dist/types/query/getEnsName.d.ts.map +1 -1
- package/dist/types/query/getEnsResolver.d.ts +2 -2
- package/dist/types/query/getEnsResolver.d.ts.map +1 -1
- package/dist/types/query/getEnsText.d.ts +2 -2
- package/dist/types/query/getEnsText.d.ts.map +1 -1
- package/dist/types/query/getFeeHistory.d.ts +2 -2
- package/dist/types/query/getFeeHistory.d.ts.map +1 -1
- package/dist/types/query/getGasPrice.d.ts +2 -2
- package/dist/types/query/getGasPrice.d.ts.map +1 -1
- package/dist/types/query/getProof.d.ts +2 -2
- package/dist/types/query/getProof.d.ts.map +1 -1
- package/dist/types/query/getStorageAt.d.ts +2 -2
- package/dist/types/query/getStorageAt.d.ts.map +1 -1
- package/dist/types/query/getToken.d.ts +2 -2
- package/dist/types/query/getToken.d.ts.map +1 -1
- package/dist/types/query/getTransaction.d.ts +2 -2
- package/dist/types/query/getTransaction.d.ts.map +1 -1
- package/dist/types/query/getTransactionConfirmations.d.ts +2 -2
- package/dist/types/query/getTransactionConfirmations.d.ts.map +1 -1
- package/dist/types/query/getTransactionCount.d.ts +3 -3
- package/dist/types/query/getTransactionCount.d.ts.map +1 -1
- package/dist/types/query/getTransactionReceipt.d.ts +2 -2
- package/dist/types/query/getTransactionReceipt.d.ts.map +1 -1
- package/dist/types/query/getWalletClient.d.ts +2 -2
- package/dist/types/query/getWalletClient.d.ts.map +1 -1
- package/dist/types/query/infiniteReadContracts.d.ts +2 -2
- package/dist/types/query/infiniteReadContracts.d.ts.map +1 -1
- package/dist/types/query/prepareTransactionRequest.d.ts +2 -2
- package/dist/types/query/prepareTransactionRequest.d.ts.map +1 -1
- package/dist/types/query/readContract.d.ts +6 -6
- package/dist/types/query/readContract.d.ts.map +1 -1
- package/dist/types/query/reconnect.d.ts +2 -2
- package/dist/types/query/reconnect.d.ts.map +1 -1
- package/dist/types/query/sendTransaction.d.ts +4 -4
- package/dist/types/query/sendTransaction.d.ts.map +1 -1
- package/dist/types/query/signMessage.d.ts +2 -2
- package/dist/types/query/signMessage.d.ts.map +1 -1
- package/dist/types/query/signTypedData.d.ts +2 -2
- package/dist/types/query/signTypedData.d.ts.map +1 -1
- package/dist/types/query/simulateContract.d.ts +2 -2
- package/dist/types/query/simulateContract.d.ts.map +1 -1
- package/dist/types/query/switchAccount.d.ts +3 -3
- package/dist/types/query/switchAccount.d.ts.map +1 -1
- package/dist/types/query/switchChain.d.ts +6 -6
- package/dist/types/query/switchChain.d.ts.map +1 -1
- package/dist/types/query/types.d.ts +5 -5
- package/dist/types/query/types.d.ts.map +1 -1
- package/dist/types/query/verifyMessage.d.ts +2 -2
- package/dist/types/query/verifyMessage.d.ts.map +1 -1
- package/dist/types/query/waitForTransactionReceipt.d.ts +2 -2
- package/dist/types/query/waitForTransactionReceipt.d.ts.map +1 -1
- package/dist/types/query/writeContract.d.ts +3 -3
- package/dist/types/query/writeContract.d.ts.map +1 -1
- package/dist/types/types/utils.d.ts +9 -9
- package/dist/types/types/utils.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/actions/codegen/createReadContract.ts +3 -3
- package/src/actions/codegen/createSimulateContract.ts +3 -3
- package/src/actions/codegen/createWatchContractEvent.ts +3 -3
- package/src/actions/codegen/createWriteContract.ts +8 -4
- package/src/actions/connect.ts +2 -2
- package/src/actions/deployContract.ts +2 -2
- package/src/actions/estimateFeesPerGas.ts +5 -5
- package/src/actions/estimateGas.ts +2 -2
- package/src/actions/estimateMaxPriorityFeePerGas.ts +2 -2
- package/src/actions/getBalance.ts +2 -2
- package/src/actions/getBlock.ts +3 -3
- package/src/actions/getBlockNumber.ts +2 -2
- package/src/actions/getBlockTransactionCount.ts +2 -2
- package/src/actions/getBytecode.ts +2 -2
- package/src/actions/getClient.ts +2 -2
- package/src/actions/getConnections.ts +2 -2
- package/src/actions/getConnectorClient.ts +3 -3
- package/src/actions/getEnsAddress.ts +2 -2
- package/src/actions/getEnsAvatar.ts +2 -2
- package/src/actions/getEnsName.ts +2 -2
- package/src/actions/getEnsResolver.ts +2 -2
- package/src/actions/getEnsText.ts +2 -2
- package/src/actions/getFeeHistory.ts +2 -2
- package/src/actions/getGasPrice.ts +2 -2
- package/src/actions/getProof.ts +2 -2
- package/src/actions/getPublicClient.ts +2 -2
- package/src/actions/getStorageAt.ts +2 -2
- package/src/actions/getToken.ts +2 -2
- package/src/actions/getTransaction.ts +3 -3
- package/src/actions/getTransactionCount.ts +2 -2
- package/src/actions/getTransactionReceipt.ts +3 -3
- package/src/actions/getWalletClient.ts +2 -2
- package/src/actions/prepareTransactionRequest.ts +6 -6
- package/src/actions/reconnect.ts +2 -2
- package/src/actions/sendTransaction.ts +2 -2
- package/src/actions/signMessage.ts +2 -2
- package/src/actions/signTypedData.ts +2 -2
- package/src/actions/simulateContract.ts +6 -6
- package/src/actions/switchChain.ts +3 -3
- package/src/actions/verifyMessage.ts +2 -2
- package/src/actions/verifyTypedData.ts +2 -2
- package/src/actions/waitForTransactionReceipt.ts +3 -3
- package/src/actions/watchBlockNumber.ts +2 -2
- package/src/actions/watchBlocks.ts +2 -2
- package/src/actions/watchContractEvent.ts +2 -2
- package/src/actions/watchPendingTransactions.ts +2 -2
- package/src/actions/writeContract.ts +4 -4
- package/src/connectors/createConnector.ts +5 -5
- package/src/connectors/injected.ts +11 -4
- package/src/createConfig.ts +3 -3
- package/src/createStorage.ts +3 -3
- package/src/errors/base.ts +2 -2
- package/src/experimental/actions/sendCalls.ts +2 -2
- package/src/experimental/actions/writeContracts.ts +2 -2
- package/src/experimental/query/getCallsStatus.ts +2 -2
- package/src/experimental/query/getCapabilities.ts +2 -2
- package/src/experimental/query/sendCalls.ts +6 -6
- package/src/experimental/query/showCallsStatus.ts +6 -6
- package/src/experimental/query/writeContracts.ts +6 -6
- package/src/exports/internal.ts +5 -5
- package/src/query/call.ts +2 -2
- package/src/query/deployContract.ts +6 -6
- package/src/query/estimateFeesPerGas.ts +2 -2
- package/src/query/estimateGas.ts +3 -2
- package/src/query/estimateMaxPriorityFeePerGas.ts +2 -2
- package/src/query/getBalance.ts +3 -3
- package/src/query/getBlock.ts +2 -2
- package/src/query/getBlockNumber.ts +2 -2
- package/src/query/getBlockTransactionCount.ts +2 -2
- package/src/query/getBytecode.ts +2 -2
- package/src/query/getConnectorClient.ts +2 -2
- package/src/query/getEnsAddress.ts +2 -2
- package/src/query/getEnsAvatar.ts +2 -2
- package/src/query/getEnsName.ts +2 -2
- package/src/query/getEnsResolver.ts +2 -2
- package/src/query/getEnsText.ts +2 -2
- package/src/query/getFeeHistory.ts +2 -2
- package/src/query/getGasPrice.ts +2 -2
- package/src/query/getProof.ts +2 -2
- package/src/query/getStorageAt.ts +2 -2
- package/src/query/getToken.ts +2 -2
- package/src/query/getTransaction.ts +2 -2
- package/src/query/getTransactionConfirmations.ts +2 -2
- package/src/query/getTransactionCount.ts +3 -3
- package/src/query/getTransactionReceipt.ts +2 -2
- package/src/query/getWalletClient.ts +2 -2
- package/src/query/infiniteReadContracts.ts +2 -2
- package/src/query/prepareTransactionRequest.ts +2 -2
- package/src/query/readContract.ts +2 -2
- package/src/query/reconnect.ts +2 -2
- package/src/query/sendTransaction.ts +6 -6
- package/src/query/signMessage.ts +2 -2
- package/src/query/signTypedData.ts +2 -2
- package/src/query/simulateContract.ts +2 -2
- package/src/query/switchAccount.ts +3 -3
- package/src/query/switchChain.ts +7 -7
- package/src/query/types.ts +7 -7
- package/src/query/verifyMessage.ts +2 -2
- package/src/query/waitForTransactionReceipt.ts +2 -2
- package/src/query/writeContract.ts +2 -2
- package/src/types/utils.ts +12 -10
- package/src/version.ts +1 -1
package/src/query/switchChain.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
switchChain,
|
|
8
8
|
} from '../actions/switchChain.js'
|
|
9
9
|
import type { Config } from '../createConfig.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
11
|
|
|
12
12
|
export function switchChainMutationOptions<config extends Config>(
|
|
13
13
|
config: config,
|
|
@@ -27,23 +27,23 @@ export function switchChainMutationOptions<config extends Config>(
|
|
|
27
27
|
export type SwitchChainData<
|
|
28
28
|
config extends Config,
|
|
29
29
|
chainId extends config['chains'][number]['id'],
|
|
30
|
-
> =
|
|
30
|
+
> = Compute<SwitchChainReturnType<config, chainId>>
|
|
31
31
|
|
|
32
32
|
export type SwitchChainVariables<
|
|
33
33
|
config extends Config,
|
|
34
34
|
chainId extends config['chains'][number]['id'],
|
|
35
|
-
> =
|
|
35
|
+
> = Compute<SwitchChainParameters<config, chainId>>
|
|
36
36
|
|
|
37
37
|
export type SwitchChainMutate<config extends Config, context = unknown> = <
|
|
38
38
|
chainId extends config['chains'][number]['id'],
|
|
39
39
|
>(
|
|
40
40
|
variables: SwitchChainVariables<config, chainId>,
|
|
41
41
|
options?:
|
|
42
|
-
|
|
|
42
|
+
| Compute<
|
|
43
43
|
MutateOptions<
|
|
44
44
|
SwitchChainData<config, chainId>,
|
|
45
45
|
SwitchChainErrorType,
|
|
46
|
-
|
|
46
|
+
Compute<SwitchChainVariables<config, chainId>>,
|
|
47
47
|
context
|
|
48
48
|
>
|
|
49
49
|
>
|
|
@@ -55,11 +55,11 @@ export type SwitchChainMutateAsync<config extends Config, context = unknown> = <
|
|
|
55
55
|
>(
|
|
56
56
|
variables: SwitchChainVariables<config, chainId>,
|
|
57
57
|
options?:
|
|
58
|
-
|
|
|
58
|
+
| Compute<
|
|
59
59
|
MutateOptions<
|
|
60
60
|
SwitchChainData<config, chainId>,
|
|
61
61
|
SwitchChainErrorType,
|
|
62
|
-
|
|
62
|
+
Compute<SwitchChainVariables<config, chainId>>,
|
|
63
63
|
context
|
|
64
64
|
>
|
|
65
65
|
>
|
package/src/query/types.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
QueryKey,
|
|
7
7
|
} from '@tanstack/query-core'
|
|
8
8
|
|
|
9
|
-
import type {
|
|
9
|
+
import type { Compute, StrictOmit } from '../types/utils.js'
|
|
10
10
|
|
|
11
11
|
export type InfiniteQueryOptions<
|
|
12
12
|
queryFnData = unknown,
|
|
@@ -31,9 +31,9 @@ export type InfiniteQueryOptions<
|
|
|
31
31
|
queryKey,
|
|
32
32
|
pageParam
|
|
33
33
|
>,
|
|
34
|
-
> =
|
|
34
|
+
> = Compute<
|
|
35
35
|
// `queryFn` doesn't pass through `pageParam` correctly
|
|
36
|
-
|
|
36
|
+
StrictOmit<options, 'queryFn'> & {
|
|
37
37
|
queryFn?(
|
|
38
38
|
context: QueryFunctionContext<queryKey, pageParam>,
|
|
39
39
|
): options['queryFn'] extends (...args: any) => any
|
|
@@ -54,7 +54,7 @@ export type Mutate<
|
|
|
54
54
|
variables = void,
|
|
55
55
|
context = unknown,
|
|
56
56
|
> = (
|
|
57
|
-
...args: Parameters<MutateFn<data, error,
|
|
57
|
+
...args: Parameters<MutateFn<data, error, Compute<variables>, context>>
|
|
58
58
|
) => void
|
|
59
59
|
|
|
60
60
|
export type MutateAsync<
|
|
@@ -62,7 +62,7 @@ export type MutateAsync<
|
|
|
62
62
|
error = unknown,
|
|
63
63
|
variables = void,
|
|
64
64
|
context = unknown,
|
|
65
|
-
> = MutateFn<data, error,
|
|
65
|
+
> = MutateFn<data, error, Compute<variables>, context>
|
|
66
66
|
|
|
67
67
|
type MutateFn<
|
|
68
68
|
data = unknown,
|
|
@@ -73,12 +73,12 @@ type MutateFn<
|
|
|
73
73
|
? (
|
|
74
74
|
variables?: variables,
|
|
75
75
|
options?:
|
|
76
|
-
|
|
|
76
|
+
| Compute<MutateOptions<data, error, variables, context>>
|
|
77
77
|
| undefined,
|
|
78
78
|
) => Promise<data>
|
|
79
79
|
: (
|
|
80
80
|
variables: variables,
|
|
81
81
|
options?:
|
|
82
|
-
|
|
|
82
|
+
| Compute<MutateOptions<data, error, variables, context>>
|
|
83
83
|
| undefined,
|
|
84
84
|
) => Promise<data>
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
} from '../actions/verifyMessage.js'
|
|
9
9
|
import type { Config } from '../createConfig.js'
|
|
10
10
|
import type { ScopeKeyParameter } from '../types/properties.js'
|
|
11
|
-
import type {
|
|
11
|
+
import type { Compute, ExactPartial } from '../types/utils.js'
|
|
12
12
|
import { filterQueryOptions } from './utils.js'
|
|
13
13
|
|
|
14
|
-
export type VerifyMessageOptions<config extends Config> =
|
|
14
|
+
export type VerifyMessageOptions<config extends Config> = Compute<
|
|
15
15
|
ExactPartial<VerifyMessageParameters<config>> & ScopeKeyParameter
|
|
16
16
|
>
|
|
17
17
|
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
} from '../actions/waitForTransactionReceipt.js'
|
|
9
9
|
import type { Config } from '../createConfig.js'
|
|
10
10
|
import type { ScopeKeyParameter } from '../types/properties.js'
|
|
11
|
-
import type {
|
|
11
|
+
import type { Compute, ExactPartial } from '../types/utils.js'
|
|
12
12
|
import { filterQueryOptions } from './utils.js'
|
|
13
13
|
|
|
14
14
|
export type WaitForTransactionReceiptOptions<
|
|
15
15
|
config extends Config,
|
|
16
16
|
chainId extends config['chains'][number]['id'],
|
|
17
|
-
> =
|
|
17
|
+
> = Compute<
|
|
18
18
|
ExactPartial<WaitForTransactionReceiptParameters<config, chainId>> &
|
|
19
19
|
ScopeKeyParameter
|
|
20
20
|
>
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
writeContract,
|
|
9
9
|
} from '../actions/writeContract.js'
|
|
10
10
|
import type { Config } from '../createConfig.js'
|
|
11
|
-
import type {
|
|
11
|
+
import type { Compute } from '../types/utils.js'
|
|
12
12
|
|
|
13
13
|
export function writeContractMutationOptions<config extends Config>(
|
|
14
14
|
config: config,
|
|
@@ -31,7 +31,7 @@ export function writeContractMutationOptions<config extends Config>(
|
|
|
31
31
|
>
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export type WriteContractData =
|
|
34
|
+
export type WriteContractData = Compute<WriteContractReturnType>
|
|
35
35
|
|
|
36
36
|
export type WriteContractVariables<
|
|
37
37
|
abi extends Abi | readonly unknown[],
|
package/src/types/utils.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Combines members of an intersection into a readable type. */
|
|
2
2
|
// https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg
|
|
3
|
-
export type
|
|
3
|
+
export type Compute<type> = { [key in keyof type]: type[key] } & unknown
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Makes all properties of an object optional.
|
|
@@ -36,7 +36,7 @@ export type IsNever<type> = [type] extends [never] ? true : false
|
|
|
36
36
|
export type IsUnknown<type> = unknown extends type ? true : false
|
|
37
37
|
|
|
38
38
|
/** Merges two object types into new type */
|
|
39
|
-
export type Merge<obj1, obj2> =
|
|
39
|
+
export type Merge<obj1, obj2> = Compute<
|
|
40
40
|
LooseOmit<obj1, keyof obj2 extends infer key extends string ? key : never> &
|
|
41
41
|
obj2
|
|
42
42
|
>
|
|
@@ -47,7 +47,7 @@ export type Mutable<type extends object> = {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
/** Strict version of built-in Omit type */
|
|
50
|
-
export type
|
|
50
|
+
export type StrictOmit<type, keys extends keyof type> = Pick<
|
|
51
51
|
type,
|
|
52
52
|
Exclude<keyof type, keys>
|
|
53
53
|
>
|
|
@@ -58,7 +58,7 @@ export type OneOf<
|
|
|
58
58
|
///
|
|
59
59
|
keys extends KeyofUnion<union> = KeyofUnion<union>,
|
|
60
60
|
> = union extends infer Item
|
|
61
|
-
?
|
|
61
|
+
? Compute<Item & { [K in Exclude<keys, keyof Item>]?: undefined }>
|
|
62
62
|
: never
|
|
63
63
|
type KeyofUnion<type> = type extends type ? keyof type : never
|
|
64
64
|
|
|
@@ -67,7 +67,7 @@ type KeyofUnion<type> = type extends type ? keyof type : never
|
|
|
67
67
|
export type PartialBy<type, key extends keyof type> = ExactPartial<
|
|
68
68
|
Pick<type, key>
|
|
69
69
|
> &
|
|
70
|
-
|
|
70
|
+
StrictOmit<type, key>
|
|
71
71
|
|
|
72
72
|
/* Removes `undefined` from object property */
|
|
73
73
|
export type RemoveUndefined<type> = {
|
|
@@ -77,7 +77,7 @@ export type RemoveUndefined<type> = {
|
|
|
77
77
|
///////////////////////////////////////////////////////////////////////////
|
|
78
78
|
// Loose types
|
|
79
79
|
|
|
80
|
-
/** Loose version of {@link
|
|
80
|
+
/** Loose version of {@link StrictOmit} */
|
|
81
81
|
export type LooseOmit<type, keys extends string> = Pick<
|
|
82
82
|
type,
|
|
83
83
|
Exclude<keyof type, keys>
|
|
@@ -86,14 +86,16 @@ export type LooseOmit<type, keys extends string> = Pick<
|
|
|
86
86
|
///////////////////////////////////////////////////////////////////////////
|
|
87
87
|
// Union types
|
|
88
88
|
|
|
89
|
-
export type
|
|
89
|
+
export type UnionCompute<type> = type extends object ? Compute<type> : type
|
|
90
90
|
|
|
91
91
|
export type UnionLooseOmit<type, keys extends string> = type extends any
|
|
92
92
|
? LooseOmit<type, keys>
|
|
93
93
|
: never
|
|
94
94
|
|
|
95
|
-
export type
|
|
96
|
-
?
|
|
95
|
+
export type UnionStrictOmit<type, keys extends keyof type> = type extends any
|
|
96
|
+
? StrictOmit<type, keys>
|
|
97
97
|
: never
|
|
98
98
|
|
|
99
|
-
export type
|
|
99
|
+
export type UnionExactPartial<type> = type extends object
|
|
100
|
+
? ExactPartial<type>
|
|
101
|
+
: type
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.11.
|
|
1
|
+
export const version = '2.11.8'
|