@wagmi/core 2.0.0-alpha.5 → 2.0.0-alpha.7
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/estimateFeesPerGas.js.map +1 -1
- package/dist/esm/actions/estimateGas.js.map +1 -1
- package/dist/esm/actions/getBalance.js.map +1 -1
- package/dist/esm/actions/getBlock.js.map +1 -1
- package/dist/esm/actions/getBlockNumber.js.map +1 -1
- package/dist/esm/actions/getEnsAddress.js.map +1 -1
- package/dist/esm/actions/getEnsAvatar.js.map +1 -1
- package/dist/esm/actions/getEnsName.js.map +1 -1
- package/dist/esm/actions/getEnsResolver.js.map +1 -1
- package/dist/esm/actions/getToken.js.map +1 -1
- package/dist/esm/actions/getTransaction.js.map +1 -1
- package/dist/esm/actions/multicall.js.map +1 -1
- package/dist/esm/actions/readContract.js.map +1 -1
- package/dist/esm/actions/readContracts.js.map +1 -1
- package/dist/esm/actions/sendTransaction.js +1 -3
- package/dist/esm/actions/sendTransaction.js.map +1 -1
- package/dist/esm/actions/signMessage.js.map +1 -1
- package/dist/esm/actions/signTypedData.js.map +1 -1
- package/dist/esm/actions/simulateContract.js.map +1 -1
- package/dist/esm/actions/waitForTransactionReceipt.js.map +1 -1
- package/dist/esm/actions/writeContract.js +2 -4
- package/dist/esm/actions/writeContract.js.map +1 -1
- package/dist/esm/connectors/injected.js +3 -5
- package/dist/esm/connectors/injected.js.map +1 -1
- package/dist/esm/exports/query.js +1 -0
- package/dist/esm/exports/query.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/actions/connect.d.ts +1 -1
- package/dist/types/actions/connect.d.ts.map +1 -1
- package/dist/types/actions/disconnect.d.ts +1 -1
- package/dist/types/actions/disconnect.d.ts.map +1 -1
- package/dist/types/actions/estimateFeesPerGas.d.ts +2 -2
- 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/getBalance.d.ts +2 -2
- package/dist/types/actions/getBalance.d.ts.map +1 -1
- package/dist/types/actions/getBlock.d.ts +2 -2
- 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/getConnectorClient.d.ts +1 -1
- 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/getToken.d.ts +2 -1
- package/dist/types/actions/getToken.d.ts.map +1 -1
- package/dist/types/actions/getTransaction.d.ts +2 -2
- package/dist/types/actions/getTransaction.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/multicall.d.ts +2 -1
- package/dist/types/actions/multicall.d.ts.map +1 -1
- package/dist/types/actions/readContract.d.ts +2 -2
- package/dist/types/actions/readContract.d.ts.map +1 -1
- package/dist/types/actions/readContracts.d.ts +3 -1
- package/dist/types/actions/readContracts.d.ts.map +1 -1
- package/dist/types/actions/reconnect.d.ts +1 -1
- 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 +2 -2
- package/dist/types/actions/simulateContract.d.ts.map +1 -1
- package/dist/types/actions/switchAccount.d.ts +1 -1
- package/dist/types/actions/switchAccount.d.ts.map +1 -1
- package/dist/types/actions/switchChain.d.ts +1 -1
- package/dist/types/actions/switchChain.d.ts.map +1 -1
- package/dist/types/actions/waitForTransactionReceipt.d.ts +3 -2
- package/dist/types/actions/waitForTransactionReceipt.d.ts.map +1 -1
- package/dist/types/actions/writeContract.d.ts +3 -2
- package/dist/types/actions/writeContract.d.ts.map +1 -1
- package/dist/types/connectors/injected.d.ts +4 -5
- package/dist/types/connectors/injected.d.ts.map +1 -1
- package/dist/types/exports/actions.d.ts +26 -26
- package/dist/types/exports/actions.d.ts.map +1 -1
- package/dist/types/exports/index.d.ts +26 -26
- package/dist/types/exports/index.d.ts.map +1 -1
- package/dist/types/exports/query.d.ts +1 -0
- package/dist/types/exports/query.d.ts.map +1 -1
- package/dist/types/query/connect.d.ts +3 -3
- package/dist/types/query/connect.d.ts.map +1 -1
- package/dist/types/query/disconnect.d.ts +3 -3
- package/dist/types/query/disconnect.d.ts.map +1 -1
- package/dist/types/query/reconnect.d.ts +3 -3
- package/dist/types/query/reconnect.d.ts.map +1 -1
- package/dist/types/query/sendTransaction.d.ts +3 -3
- package/dist/types/query/sendTransaction.d.ts.map +1 -1
- package/dist/types/query/signMessage.d.ts +3 -3
- package/dist/types/query/signMessage.d.ts.map +1 -1
- package/dist/types/query/signTypedData.d.ts +3 -3
- package/dist/types/query/signTypedData.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 +3 -3
- package/dist/types/query/switchChain.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/version.d.ts +1 -1
- package/package.json +6 -10
- package/src/actions/connect.ts +1 -1
- package/src/actions/disconnect.ts +1 -1
- package/src/actions/estimateFeesPerGas.ts +2 -1
- package/src/actions/estimateGas.ts +2 -1
- package/src/actions/getBalance.ts +2 -1
- package/src/actions/getBlock.ts +2 -1
- package/src/actions/getBlockNumber.ts +2 -1
- package/src/actions/getConnectorClient.ts +1 -1
- package/src/actions/getEnsAddress.ts +2 -1
- package/src/actions/getEnsAvatar.ts +2 -1
- package/src/actions/getEnsName.ts +2 -1
- package/src/actions/getEnsResolver.ts +2 -1
- package/src/actions/getToken.ts +2 -2
- package/src/actions/getTransaction.ts +2 -1
- package/src/actions/getWalletClient.ts +2 -2
- package/src/actions/multicall.ts +3 -0
- package/src/actions/readContract.ts +2 -1
- package/src/actions/readContracts.ts +3 -3
- package/src/actions/reconnect.ts +1 -1
- package/src/actions/sendTransaction.ts +5 -6
- package/src/actions/signMessage.ts +2 -1
- package/src/actions/signTypedData.ts +2 -1
- package/src/actions/simulateContract.ts +2 -1
- package/src/actions/switchAccount.ts +1 -1
- package/src/actions/switchChain.ts +1 -1
- package/src/actions/waitForTransactionReceipt.ts +6 -7
- package/src/actions/writeContract.ts +8 -7
- package/src/connectors/injected.ts +8 -13
- package/src/exports/actions.ts +26 -26
- package/src/exports/index.ts +26 -26
- package/src/exports/query.ts +1 -0
- package/src/query/connect.ts +4 -4
- package/src/query/disconnect.ts +4 -4
- package/src/query/estimateFeesPerGas.ts +2 -2
- package/src/query/estimateGas.ts +2 -2
- package/src/query/getBalance.ts +2 -2
- package/src/query/getBlock.ts +2 -2
- package/src/query/getBlockNumber.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/getToken.ts +2 -2
- package/src/query/getTransaction.ts +2 -2
- package/src/query/getWalletClient.ts +2 -2
- package/src/query/infiniteReadContracts.ts +2 -2
- package/src/query/readContract.ts +2 -2
- package/src/query/readContracts.ts +2 -2
- package/src/query/reconnect.ts +4 -4
- package/src/query/sendTransaction.ts +4 -4
- package/src/query/signMessage.ts +4 -4
- package/src/query/signTypedData.ts +4 -4
- package/src/query/simulateContract.ts +2 -2
- package/src/query/switchAccount.ts +4 -4
- package/src/query/switchChain.ts +4 -4
- package/src/query/waitForTransactionReceipt.ts +2 -2
- package/src/query/writeContract.ts +4 -4
- package/src/version.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type SwitchAccountErrorType, type SwitchAccountParameters, type SwitchAccountReturnType } from '../actions/switchAccount.js';
|
|
2
2
|
import { type Config } from '../createConfig.js';
|
|
3
3
|
import type { Evaluate } from '../types/utils.js';
|
|
4
4
|
import type { Mutate, MutateAsync } from './types.js';
|
|
@@ -10,6 +10,6 @@ export declare function switchAccountMutationOptions<config extends Config>(conf
|
|
|
10
10
|
};
|
|
11
11
|
export type SwitchAccountData<config extends Config> = Evaluate<SwitchAccountReturnType<config>>;
|
|
12
12
|
export type SwitchAccountVariables = Evaluate<SwitchAccountParameters>;
|
|
13
|
-
export type SwitchAccountMutate<config extends Config, context = unknown> = Mutate<SwitchAccountData<config>,
|
|
14
|
-
export type SwitchAccountMutateAsync<config extends Config, context = unknown> = MutateAsync<SwitchAccountData<config>,
|
|
13
|
+
export type SwitchAccountMutate<config extends Config, context = unknown> = Mutate<SwitchAccountData<config>, SwitchAccountErrorType, SwitchAccountVariables, context>;
|
|
14
|
+
export type SwitchAccountMutateAsync<config extends Config, context = unknown> = MutateAsync<SwitchAccountData<config>, SwitchAccountErrorType, SwitchAccountVariables, context>;
|
|
15
15
|
//# sourceMappingURL=switchAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switchAccount.d.ts","sourceRoot":"","sources":["../../../src/query/switchAccount.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"switchAccount.d.ts","sourceRoot":"","sources":["../../../src/query/switchAccount.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAE7B,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAErD,wBAAgB,4BAA4B,CAAC,MAAM,SAAS,MAAM,EAChE,MAAM,EAAE,MAAM;;;;;EAYf;AAED,MAAM,MAAM,iBAAiB,CAAC,MAAM,SAAS,MAAM,IAAI,QAAQ,CAC7D,uBAAuB,CAAC,MAAM,CAAC,CAChC,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC,uBAAuB,CAAC,CAAA;AAEtE,MAAM,MAAM,mBAAmB,CAC7B,MAAM,SAAS,MAAM,EACrB,OAAO,GAAG,OAAO,IACf,MAAM,CACR,iBAAiB,CAAC,MAAM,CAAC,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,OAAO,CACR,CAAA;AAED,MAAM,MAAM,wBAAwB,CAClC,MAAM,SAAS,MAAM,EACrB,OAAO,GAAG,OAAO,IACf,WAAW,CACb,iBAAiB,CAAC,MAAM,CAAC,EACzB,sBAAsB,EACtB,sBAAsB,EACtB,OAAO,CACR,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MutateOptions } from '@tanstack/query-core';
|
|
2
|
-
import { type
|
|
2
|
+
import { type SwitchChainErrorType, type SwitchChainParameters, type SwitchChainReturnType } from '../actions/switchChain.js';
|
|
3
3
|
import { type Config } from '../createConfig.js';
|
|
4
4
|
import type { Evaluate } from '../types/utils.js';
|
|
5
5
|
export declare function switchChainMutationOptions<config extends Config>(config: config): {
|
|
@@ -13,6 +13,6 @@ export declare function switchChainMutationOptions<config extends Config>(config
|
|
|
13
13
|
};
|
|
14
14
|
export type SwitchChainData<config extends Config, chainId extends config['chains'][number]['id']> = Evaluate<SwitchChainReturnType<config, chainId>>;
|
|
15
15
|
export type SwitchChainVariables<config extends Config, chainId extends config['chains'][number]['id']> = Evaluate<SwitchChainParameters<config, chainId>>;
|
|
16
|
-
export type SwitchChainMutate<config extends Config, context = unknown> = <chainId extends config['chains'][number]['id']>(variables: SwitchChainVariables<config, chainId>, options?: Evaluate<MutateOptions<SwitchChainData<config, chainId>,
|
|
17
|
-
export type SwitchChainMutateAsync<config extends Config, context = unknown> = <chainId extends config['chains'][number]['id']>(variables: SwitchChainVariables<config, chainId>, options?: Evaluate<MutateOptions<SwitchChainData<config, chainId>,
|
|
16
|
+
export type SwitchChainMutate<config extends Config, context = unknown> = <chainId extends config['chains'][number]['id']>(variables: SwitchChainVariables<config, chainId>, options?: Evaluate<MutateOptions<SwitchChainData<config, chainId>, SwitchChainErrorType, Evaluate<SwitchChainVariables<config, chainId>>, context>> | undefined) => void;
|
|
17
|
+
export type SwitchChainMutateAsync<config extends Config, context = unknown> = <chainId extends config['chains'][number]['id']>(variables: SwitchChainVariables<config, chainId>, options?: Evaluate<MutateOptions<SwitchChainData<config, chainId>, SwitchChainErrorType, Evaluate<SwitchChainVariables<config, chainId>>, context>> | undefined) => Promise<SwitchChainData<config, chainId>>;
|
|
18
18
|
//# sourceMappingURL=switchChain.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switchChain.d.ts","sourceRoot":"","sources":["../../../src/query/switchChain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAmB,MAAM,sBAAsB,CAAA;AAE1E,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"switchChain.d.ts","sourceRoot":"","sources":["../../../src/query/switchChain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAmB,MAAM,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C7E,OAAO,SAAS,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAE9C,SAAS,EAAE,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,EAChD,OAAO,CAAC,EACJ,QAAQ,CACN,aAAa,CACX,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,oBAAoB,EACpB,QAAQ,CAAC,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAC/C,OAAO,CACR,CACF,GACD,SAAS,KACV,OAAO,CAAC,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MutateOptions } from '@tanstack/query-core';
|
|
2
2
|
import type { Abi, ContractFunctionArgs, ContractFunctionName } from 'viem';
|
|
3
|
-
import { type
|
|
3
|
+
import { type WriteContractErrorType, type WriteContractParameters, type WriteContractReturnType } from '../actions/writeContract.js';
|
|
4
4
|
import { type Config } from '../createConfig.js';
|
|
5
5
|
import type { Evaluate } from '../types/utils.js';
|
|
6
6
|
export declare function writeContractMutationOptions<config extends Config>(config: config): {
|
|
@@ -59,6 +59,6 @@ export declare function writeContractMutationOptions<config extends Config>(conf
|
|
|
59
59
|
};
|
|
60
60
|
export type WriteContractData = Evaluate<WriteContractReturnType>;
|
|
61
61
|
export type WriteContractVariables<abi extends Abi | readonly unknown[], functionName extends ContractFunctionName<abi, 'nonpayable' | 'payable'>, args extends ContractFunctionArgs<abi, 'nonpayable' | 'payable', functionName>, config extends Config, chainId extends config['chains'][number]['id'], allFunctionNames = ContractFunctionName<abi, 'nonpayable' | 'payable'>> = WriteContractParameters<abi, functionName, args, config, chainId, allFunctionNames>;
|
|
62
|
-
export type WriteContractMutate<config extends Config, context = unknown> = <const abi extends Abi | readonly unknown[], functionName extends ContractFunctionName<abi, 'nonpayable' | 'payable'>, args extends ContractFunctionArgs<abi, 'nonpayable' | 'payable', functionName>, chainId extends config['chains'][number]['id']>(variables: WriteContractVariables<abi, functionName, args, config, chainId>, options?: MutateOptions<WriteContractData,
|
|
63
|
-
export type WriteContractMutateAsync<config extends Config, context = unknown> = <const abi extends Abi | readonly unknown[], functionName extends ContractFunctionName<abi, 'nonpayable' | 'payable'>, args extends ContractFunctionArgs<abi, 'nonpayable' | 'payable', functionName>, chainId extends config['chains'][number]['id']>(variables: WriteContractVariables<abi, functionName, args, config, chainId>, options?: MutateOptions<WriteContractData,
|
|
62
|
+
export type WriteContractMutate<config extends Config, context = unknown> = <const abi extends Abi | readonly unknown[], functionName extends ContractFunctionName<abi, 'nonpayable' | 'payable'>, args extends ContractFunctionArgs<abi, 'nonpayable' | 'payable', functionName>, chainId extends config['chains'][number]['id']>(variables: WriteContractVariables<abi, functionName, args, config, chainId>, options?: MutateOptions<WriteContractData, WriteContractErrorType, WriteContractVariables<abi, functionName, args, config, chainId, functionName>, context> | undefined) => void;
|
|
63
|
+
export type WriteContractMutateAsync<config extends Config, context = unknown> = <const abi extends Abi | readonly unknown[], functionName extends ContractFunctionName<abi, 'nonpayable' | 'payable'>, args extends ContractFunctionArgs<abi, 'nonpayable' | 'payable', functionName>, chainId extends config['chains'][number]['id']>(variables: WriteContractVariables<abi, functionName, args, config, chainId>, options?: MutateOptions<WriteContractData, WriteContractErrorType, WriteContractVariables<abi, functionName, args, config, chainId, functionName>, context> | undefined) => Promise<WriteContractData>;
|
|
64
64
|
//# sourceMappingURL=writeContract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeContract.d.ts","sourceRoot":"","sources":["../../../src/query/writeContract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAmB,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,GAAG,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,MAAM,CAAA;AAE3E,OAAO,EACL,KAAK,
|
|
1
|
+
{"version":3,"file":"writeContract.d.ts","sourceRoot":"","sources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,2 @@
|
|
|
1
|
-
export declare const version = "2.0.0-alpha.
|
|
1
|
+
export declare const version = "2.0.0-alpha.7";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wagmi/core",
|
|
3
3
|
"description": "VanillaJS library for Ethereum",
|
|
4
|
-
"version": "2.0.0-alpha.
|
|
4
|
+
"version": "2.0.0-alpha.7",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"@tanstack/query-core": ">5.0.0-beta.28",
|
|
68
|
-
"typescript": ">=5",
|
|
69
|
-
"viem": "2.0.0-alpha.
|
|
68
|
+
"typescript": ">=5.0.4",
|
|
69
|
+
"viem": "2.0.0-alpha.13"
|
|
70
70
|
},
|
|
71
71
|
"peerDependenciesMeta": {
|
|
72
72
|
"@tanstack/query-core": {
|
|
@@ -88,13 +88,9 @@
|
|
|
88
88
|
"awkweb.eth <t@wagmi.sh>",
|
|
89
89
|
"jxom.eth <j@wagmi.sh>"
|
|
90
90
|
],
|
|
91
|
-
"funding":
|
|
92
|
-
{
|
|
93
|
-
"type": "github",
|
|
94
|
-
"url": "https://github.com/sponsors/wagmi-dev"
|
|
95
|
-
}
|
|
96
|
-
],
|
|
91
|
+
"funding": "https://github.com/sponsors/wagmi-dev",
|
|
97
92
|
"keywords": [
|
|
93
|
+
"wagmi",
|
|
98
94
|
"eth",
|
|
99
95
|
"ethereum",
|
|
100
96
|
"dapps",
|
|
@@ -102,9 +98,9 @@
|
|
|
102
98
|
"web3"
|
|
103
99
|
],
|
|
104
100
|
"scripts": {
|
|
105
|
-
"clean": "rm -rf dist tsconfig.tsbuildinfo actions chains internal query",
|
|
106
101
|
"build": "pnpm run clean && pnpm run build:esm+types",
|
|
107
102
|
"build:esm+types": "tsc --project tsconfig.build.json --module es2020 --outDir ./dist/esm --declaration --declarationMap --declarationDir ./dist/types",
|
|
103
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo actions chains internal query",
|
|
108
104
|
"test:build": "publint --strict",
|
|
109
105
|
"typecheck": "tsc --noEmit"
|
|
110
106
|
}
|
package/src/actions/connect.ts
CHANGED
|
@@ -21,7 +21,7 @@ export type ConnectReturnType<config extends Config = Config> = {
|
|
|
21
21
|
| (number extends config['chains'][number]['id'] ? number : number & {})
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export type
|
|
24
|
+
export type ConnectErrorType =
|
|
25
25
|
| ConnectorAlreadyConnectedError
|
|
26
26
|
// connector.connect()
|
|
27
27
|
| UserRejectedRequestError
|
|
@@ -13,7 +13,7 @@ export type DisconnectParameters = ConnectorParameter
|
|
|
13
13
|
|
|
14
14
|
export type DisconnectReturnType = void
|
|
15
15
|
|
|
16
|
-
export type
|
|
16
|
+
export type DisconnectErrorType = Error
|
|
17
17
|
|
|
18
18
|
/** https://alpha.wagmi.sh/core/api/actions/disconnect */
|
|
19
19
|
export async function disconnect(
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
formatUnits,
|
|
7
7
|
} from 'viem'
|
|
8
8
|
import {
|
|
9
|
+
type EstimateFeesPerGasErrorType as viem_EstimateFeesPerGasErrorType,
|
|
9
10
|
type EstimateFeesPerGasParameters as viem_EstimateFeesPerGasParameters,
|
|
10
11
|
type EstimateFeesPerGasReturnType as viem_EstimateFeesPerGasReturnType,
|
|
11
12
|
estimateFeesPerGas as viem_estimateFeesPerGas,
|
|
@@ -42,7 +43,7 @@ export type EstimateFeesPerGasReturnType<
|
|
|
42
43
|
}
|
|
43
44
|
>
|
|
44
45
|
|
|
45
|
-
export type
|
|
46
|
+
export type EstimateFeesPerGasErrorType = viem_EstimateFeesPerGasErrorType
|
|
46
47
|
|
|
47
48
|
export async function estimateFeesPerGas<
|
|
48
49
|
config extends Config,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Account, Address, Chain } from 'viem'
|
|
2
2
|
import {
|
|
3
|
+
type EstimateGasErrorType as viem_EstimateGasErrorType,
|
|
3
4
|
type EstimateGasParameters as viem_EstimateGasParameters,
|
|
4
5
|
type EstimateGasReturnType as viem_EstimateGasReturnType,
|
|
5
6
|
estimateGas as viem_estimateGas,
|
|
@@ -31,7 +32,7 @@ export type EstimateGasParameters<
|
|
|
31
32
|
|
|
32
33
|
export type EstimateGasReturnType = viem_EstimateGasReturnType
|
|
33
34
|
|
|
34
|
-
export type
|
|
35
|
+
export type EstimateGasErrorType = viem_EstimateGasErrorType
|
|
35
36
|
|
|
36
37
|
/** https://alpha.wagmi.sh/core/api/actions/estimateGas */
|
|
37
38
|
export async function estimateGas<
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
trim,
|
|
8
8
|
} from 'viem'
|
|
9
9
|
import {
|
|
10
|
+
type GetBalanceErrorType as viem_GetBalanceErrorType,
|
|
10
11
|
type GetBalanceParameters as viem_GetBalanceParameters,
|
|
11
12
|
getBalance as viem_getBalance,
|
|
12
13
|
} from 'viem/actions'
|
|
@@ -34,7 +35,7 @@ export type GetBalanceReturnType = {
|
|
|
34
35
|
value: bigint
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
export type
|
|
38
|
+
export type GetBalanceErrorType = viem_GetBalanceErrorType
|
|
38
39
|
|
|
39
40
|
/** https://alpha.wagmi.sh/core/api/actions/getBalance */
|
|
40
41
|
export async function getBalance<config extends Config>(
|
package/src/actions/getBlock.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BlockTag, Chain } from 'viem'
|
|
2
2
|
import {
|
|
3
|
+
type GetBlockErrorType as viem_GetBlockErrorType,
|
|
3
4
|
type GetBlockParameters as viem_GetBlockParameters,
|
|
4
5
|
type GetBlockReturnType as viem_GetBlockReturnType,
|
|
5
6
|
getBlock as viem_getBlock,
|
|
@@ -38,7 +39,7 @@ export type GetBlockReturnType<
|
|
|
38
39
|
}[number]
|
|
39
40
|
>
|
|
40
41
|
|
|
41
|
-
export type
|
|
42
|
+
export type GetBlockErrorType = viem_GetBlockErrorType
|
|
42
43
|
|
|
43
44
|
/** https://alpha.wagmi.sh/core/actions/getBlock */
|
|
44
45
|
export function getBlock<
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
type GetBlockNumberErrorType as viem_GetBlockNumberErrorType,
|
|
2
3
|
type GetBlockNumberParameters as viem_GetBlockNumberParameters,
|
|
3
4
|
type GetBlockNumberReturnType as viem_GetBlockNumberReturnType,
|
|
4
5
|
getBlockNumber as viem_getBlockNumber,
|
|
@@ -15,7 +16,7 @@ export type GetBlockNumberParameters<
|
|
|
15
16
|
|
|
16
17
|
export type GetBlockNumberReturnType = viem_GetBlockNumberReturnType
|
|
17
18
|
|
|
18
|
-
export type
|
|
19
|
+
export type GetBlockNumberErrorType = viem_GetBlockNumberErrorType
|
|
19
20
|
|
|
20
21
|
/** https://alpha.wagmi.sh/core/api/actions/getBlockNumber */
|
|
21
22
|
export function getBlockNumber<
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
type GetEnsAddressErrorType as viem_GetEnsAddressErrorType,
|
|
2
3
|
type GetEnsAddressParameters as viem_GetEnsAddressParameters,
|
|
3
4
|
type GetEnsAddressReturnType as viem_GetEnsAddressReturnType,
|
|
4
5
|
getEnsAddress as viem_getEnsAddress,
|
|
@@ -14,7 +15,7 @@ export type GetEnsAddressParameters<config extends Config = Config> = Evaluate<
|
|
|
14
15
|
|
|
15
16
|
export type GetEnsAddressReturnType = viem_GetEnsAddressReturnType
|
|
16
17
|
|
|
17
|
-
export type
|
|
18
|
+
export type GetEnsAddressErrorType = viem_GetEnsAddressErrorType
|
|
18
19
|
|
|
19
20
|
/** https://alpha.wagmi.sh/core/api/actions/getEnsAddress */
|
|
20
21
|
export function getEnsAddress<config extends Config>(
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
type GetEnsAvatarErrorType as viem_GetEnsAvatarErrorType,
|
|
2
3
|
type GetEnsAvatarParameters as viem_GetEnsAvatarParameters,
|
|
3
4
|
type GetEnsAvatarReturnType as viem_GetEnsAvatarReturnType,
|
|
4
5
|
getEnsAvatar as viem_getEnsAvatar,
|
|
@@ -14,7 +15,7 @@ export type GetEnsAvatarParameters<config extends Config = Config> = Evaluate<
|
|
|
14
15
|
|
|
15
16
|
export type GetEnsAvatarReturnType = viem_GetEnsAvatarReturnType
|
|
16
17
|
|
|
17
|
-
export type
|
|
18
|
+
export type GetEnsAvatarErrorType = viem_GetEnsAvatarErrorType
|
|
18
19
|
|
|
19
20
|
/** https://alpha.wagmi.sh/core/api/actions/getEnsAvatar */
|
|
20
21
|
export function getEnsAvatar<config extends Config>(
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
type GetEnsNameErrorType as viem_GetEnsNameErrorType,
|
|
2
3
|
type GetEnsNameParameters as viem_GetEnsNameParameters,
|
|
3
4
|
type GetEnsNameReturnType as viem_GetEnsNameReturnType,
|
|
4
5
|
getEnsName as viem_getEnsName,
|
|
@@ -14,7 +15,7 @@ export type GetEnsNameParameters<config extends Config = Config> = Evaluate<
|
|
|
14
15
|
|
|
15
16
|
export type GetEnsNameReturnType = viem_GetEnsNameReturnType
|
|
16
17
|
|
|
17
|
-
export type
|
|
18
|
+
export type GetEnsNameErrorType = viem_GetEnsNameErrorType
|
|
18
19
|
|
|
19
20
|
/** https://alpha.wagmi.sh/core/api/actions/getEnsName */
|
|
20
21
|
export function getEnsName<config extends Config>(
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
type GetEnsResolverErrorType as viem_GetEnsResolverErrorType,
|
|
2
3
|
type GetEnsResolverParameters as viem_GetEnsResolverParameters,
|
|
3
4
|
type GetEnsResolverReturnType as viem_GetEnsResolverReturnType,
|
|
4
5
|
getEnsResolver as viem_getEnsResolver,
|
|
@@ -14,7 +15,7 @@ export type GetEnsResolverParameters<config extends Config = Config> = Evaluate<
|
|
|
14
15
|
|
|
15
16
|
export type GetEnsResolverReturnType = viem_GetEnsResolverReturnType
|
|
16
17
|
|
|
17
|
-
export type
|
|
18
|
+
export type GetEnsResolverErrorType = viem_GetEnsResolverErrorType
|
|
18
19
|
|
|
19
20
|
/** https://alpha.wagmi.sh/core/api/actions/getEnsResolver */
|
|
20
21
|
export function getEnsResolver<config extends Config>(
|
package/src/actions/getToken.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type { ChainIdParameter } from '../types/properties.js'
|
|
|
11
11
|
import type { Unit } from '../types/unit.js'
|
|
12
12
|
import type { Evaluate } from '../types/utils.js'
|
|
13
13
|
import { getUnit } from '../utils/getUnit.js'
|
|
14
|
-
import { readContracts } from './readContracts.js'
|
|
14
|
+
import { type ReadContractsErrorType, readContracts } from './readContracts.js'
|
|
15
15
|
|
|
16
16
|
export type GetTokenParameters<config extends Config = Config> = Evaluate<
|
|
17
17
|
ChainIdParameter<config> & {
|
|
@@ -31,7 +31,7 @@ export type GetTokenReturnType = {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export type
|
|
34
|
+
export type GetTokenErrorType = ReadContractsErrorType
|
|
35
35
|
|
|
36
36
|
export async function getToken<config extends Config>(
|
|
37
37
|
config: config,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Chain } from 'viem'
|
|
2
2
|
import {
|
|
3
|
+
type GetTransactionErrorType as viem_GetTransactionErrorType,
|
|
3
4
|
type GetTransactionParameters as viem_GetTransactionParameters,
|
|
4
5
|
type GetTransactionReturnType as viem_GetTransactionReturnType,
|
|
5
6
|
getTransaction as viem_getTransaction,
|
|
@@ -26,7 +27,7 @@ export type GetTransactionReturnType<
|
|
|
26
27
|
}[number]
|
|
27
28
|
>
|
|
28
29
|
|
|
29
|
-
export type
|
|
30
|
+
export type GetTransactionErrorType = viem_GetTransactionErrorType
|
|
30
31
|
|
|
31
32
|
/** https://alpha.wagmi.sh/core/api/actions/getTransaction */
|
|
32
33
|
export function getTransaction<
|
|
@@ -3,7 +3,7 @@ import { type Account, type WalletClient, walletActions } from 'viem'
|
|
|
3
3
|
import type { Config } from '../createConfig.js'
|
|
4
4
|
import type { Evaluate } from '../types/utils.js'
|
|
5
5
|
import {
|
|
6
|
-
type
|
|
6
|
+
type GetConnectorClientErrorType,
|
|
7
7
|
type GetConnectorClientParameters,
|
|
8
8
|
getConnectorClient,
|
|
9
9
|
} from './getConnectorClient.js'
|
|
@@ -24,7 +24,7 @@ export type GetWalletClientReturnType<
|
|
|
24
24
|
>
|
|
25
25
|
>
|
|
26
26
|
|
|
27
|
-
export type
|
|
27
|
+
export type GetWalletClientErrorType = GetConnectorClientErrorType
|
|
28
28
|
|
|
29
29
|
export async function getWalletClient<
|
|
30
30
|
config extends Config,
|
package/src/actions/multicall.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ContractFunctionParameters,
|
|
3
|
+
MulticallErrorType as viem_MulticallErrorType,
|
|
3
4
|
MulticallParameters as viem_MulticallParameters,
|
|
4
5
|
MulticallReturnType as viem_MulticallReturnType,
|
|
5
6
|
} from 'viem'
|
|
@@ -19,6 +20,8 @@ export type MulticallReturnType<
|
|
|
19
20
|
allowFailure extends boolean = true,
|
|
20
21
|
> = viem_MulticallReturnType<contracts, allowFailure>
|
|
21
22
|
|
|
23
|
+
export type MulticallErrorType = viem_MulticallErrorType
|
|
24
|
+
|
|
22
25
|
export async function multicall<
|
|
23
26
|
config extends Config,
|
|
24
27
|
const contracts extends readonly ContractFunctionParameters[],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Abi } from 'viem'
|
|
2
2
|
import type { ContractFunctionArgs, ContractFunctionName } from 'viem'
|
|
3
3
|
import {
|
|
4
|
+
type ReadContractErrorType as viem_ReadContractErrorType,
|
|
4
5
|
type ReadContractParameters as viem_ReadContractParameters,
|
|
5
6
|
type ReadContractReturnType as viem_ReadContractReturnType,
|
|
6
7
|
readContract as viem_readContract,
|
|
@@ -37,7 +38,7 @@ export type ReadContractReturnType<
|
|
|
37
38
|
> = ContractFunctionArgs<abi, 'pure' | 'view', functionName>,
|
|
38
39
|
> = viem_ReadContractReturnType<abi, functionName, args>
|
|
39
40
|
|
|
40
|
-
export type
|
|
41
|
+
export type ReadContractErrorType = viem_ReadContractErrorType
|
|
41
42
|
|
|
42
43
|
/** https://alpha.wagmi.sh/core/api/actions/readContract */
|
|
43
44
|
export function readContract<
|
|
@@ -7,8 +7,8 @@ import { ContractFunctionExecutionError } from 'viem'
|
|
|
7
7
|
|
|
8
8
|
import { type Config } from '../createConfig.js'
|
|
9
9
|
import { type ChainIdParameter } from '../types/properties.js'
|
|
10
|
-
import { multicall } from './multicall.js'
|
|
11
|
-
import { readContract } from './readContract.js'
|
|
10
|
+
import { type MulticallErrorType, multicall } from './multicall.js'
|
|
11
|
+
import { type ReadContractErrorType, readContract } from './readContract.js'
|
|
12
12
|
|
|
13
13
|
export type ReadContractsParameters<
|
|
14
14
|
contracts extends readonly unknown[] = readonly ContractFunctionParameters[],
|
|
@@ -25,7 +25,7 @@ export type ReadContractsReturnType<
|
|
|
25
25
|
allowFailure extends boolean = true,
|
|
26
26
|
> = viem_MulticallReturnType<contracts, allowFailure>
|
|
27
27
|
|
|
28
|
-
export type
|
|
28
|
+
export type ReadContractsErrorType = MulticallErrorType | ReadContractErrorType
|
|
29
29
|
|
|
30
30
|
export async function readContracts<
|
|
31
31
|
config extends Config,
|
package/src/actions/reconnect.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type {
|
|
|
2
2
|
Account,
|
|
3
3
|
Address,
|
|
4
4
|
Chain,
|
|
5
|
+
SendTransactionErrorType as viem_SendTransactionErrorType,
|
|
5
6
|
SendTransactionParameters as viem_SendTransactionParameters,
|
|
6
7
|
SendTransactionReturnType as viem_SendTransactionReturnType,
|
|
7
8
|
} from 'viem'
|
|
@@ -37,7 +38,7 @@ export type SendTransactionParameters<
|
|
|
37
38
|
|
|
38
39
|
export type SendTransactionReturnType = viem_SendTransactionReturnType
|
|
39
40
|
|
|
40
|
-
export type
|
|
41
|
+
export type SendTransactionErrorType = viem_SendTransactionErrorType
|
|
41
42
|
|
|
42
43
|
/** https://alpha.wagmi.sh/core/api/actions/sendTransaction */
|
|
43
44
|
export async function sendTransaction<
|
|
@@ -58,11 +59,9 @@ export async function sendTransaction<
|
|
|
58
59
|
assertActiveChain(config, { activeChainId: client.chain.id, chainId })
|
|
59
60
|
|
|
60
61
|
const hash = await viem_sendTransaction(client, {
|
|
61
|
-
...(rest as
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
chain: null,
|
|
65
|
-
} as viem_SendTransactionParameters)
|
|
62
|
+
...(rest as any),
|
|
63
|
+
chain: chainId ? { id: chainId } : null,
|
|
64
|
+
})
|
|
66
65
|
|
|
67
66
|
return hash
|
|
68
67
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Account } from 'viem'
|
|
2
2
|
import {
|
|
3
|
+
type SignMessageErrorType as viem_SignMessageErrorType,
|
|
3
4
|
type SignMessageParameters as viem_SignMessageParameters,
|
|
4
5
|
type SignMessageReturnType as viem_SignMessageReturnType,
|
|
5
6
|
signMessage as viem_signMessage,
|
|
@@ -16,7 +17,7 @@ export type SignMessageParameters = Evaluate<
|
|
|
16
17
|
|
|
17
18
|
export type SignMessageReturnType = viem_SignMessageReturnType
|
|
18
19
|
|
|
19
|
-
export type
|
|
20
|
+
export type SignMessageErrorType = viem_SignMessageErrorType
|
|
20
21
|
|
|
21
22
|
/** https://alpha.wagmi.sh/core/api/actions/signMessage */
|
|
22
23
|
export async function signMessage(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Account, TypedData } from 'viem'
|
|
2
2
|
import {
|
|
3
|
+
type SignMessageErrorType as viem_SignMessageErrorType,
|
|
3
4
|
type SignTypedDataParameters as viem_SignTypedDataParameters,
|
|
4
5
|
type SignTypedDataReturnType as viem_SignTypedDataReturnType,
|
|
5
6
|
signTypedData as viem_signTypedData,
|
|
@@ -22,7 +23,7 @@ export type SignTypedDataParameters<
|
|
|
22
23
|
|
|
23
24
|
export type SignTypedDataReturnType = viem_SignTypedDataReturnType
|
|
24
25
|
|
|
25
|
-
export type
|
|
26
|
+
export type SignTypedDataErrorType = viem_SignMessageErrorType
|
|
26
27
|
|
|
27
28
|
/** https://alpha.wagmi.sh/core/api/actions/signTypedData */
|
|
28
29
|
export async function signTypedData<
|
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
ContractFunctionName,
|
|
8
8
|
} from 'viem'
|
|
9
9
|
import {
|
|
10
|
+
type SimulateContractErrorType as viem_SimulateContractErrorType,
|
|
10
11
|
type SimulateContractParameters as viem_SimulateContractParameters,
|
|
11
12
|
type SimulateContractReturnType as viem_SimulateContractReturnType,
|
|
12
13
|
simulateContract as viem_simulateContract,
|
|
@@ -100,7 +101,7 @@ export type SimulateContractReturnType<
|
|
|
100
101
|
: never
|
|
101
102
|
}[number]
|
|
102
103
|
|
|
103
|
-
export type
|
|
104
|
+
export type SimulateContractErrorType = viem_SimulateContractErrorType
|
|
104
105
|
|
|
105
106
|
/** https://alpha.wagmi.sh/core/api/actions/simulateContract */
|
|
106
107
|
export async function simulateContract<
|
|
@@ -14,7 +14,7 @@ export type SwitchAccountReturnType<config extends Config = Config> = {
|
|
|
14
14
|
| (number extends config['chains'][number]['id'] ? number : number & {})
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export type
|
|
17
|
+
export type SwitchAccountErrorType = ConnectorNotConnectedError | Error
|
|
18
18
|
|
|
19
19
|
/** https://alpha.wagmi.sh/core/api/actions/switchAccount */
|
|
20
20
|
export async function switchAccount<config extends Config>(
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
CallParameters,
|
|
3
|
-
Chain,
|
|
4
|
-
WaitForTransactionReceiptParameters as viem_WaitForTransactionReceiptParameters,
|
|
5
|
-
WaitForTransactionReceiptReturnType as viem_WaitForTransactionReceiptReturnType,
|
|
6
|
-
} from 'viem'
|
|
1
|
+
import type { CallParameters, Chain } from 'viem'
|
|
7
2
|
import { hexToString } from 'viem'
|
|
8
3
|
import {
|
|
4
|
+
type WaitForTransactionReceiptErrorType as viem_WaitForTransactionReceiptErrorType,
|
|
5
|
+
type WaitForTransactionReceiptParameters as viem_WaitForTransactionReceiptParameters,
|
|
6
|
+
type WaitForTransactionReceiptReturnType as viem_WaitForTransactionReceiptReturnType,
|
|
9
7
|
call,
|
|
10
8
|
getTransaction,
|
|
11
9
|
waitForTransactionReceipt as viem_waitForTransactionReceipt,
|
|
@@ -34,7 +32,8 @@ export type WaitForTransactionReceiptReturnType<
|
|
|
34
32
|
}[number]
|
|
35
33
|
>
|
|
36
34
|
|
|
37
|
-
export type
|
|
35
|
+
export type WaitForTransactionReceiptErrorType =
|
|
36
|
+
viem_WaitForTransactionReceiptErrorType
|
|
38
37
|
|
|
39
38
|
export async function waitForTransactionReceipt<
|
|
40
39
|
config extends Config,
|
|
@@ -4,10 +4,13 @@ import type {
|
|
|
4
4
|
Chain,
|
|
5
5
|
ContractFunctionArgs,
|
|
6
6
|
ContractFunctionName,
|
|
7
|
-
WriteContractParameters as viem_WriteContractParameters,
|
|
8
|
-
WriteContractReturnType as viem_WriteContractReturnType,
|
|
9
7
|
} from 'viem'
|
|
10
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
type WriteContractErrorType as viem_WriteContractErrorType,
|
|
10
|
+
type WriteContractParameters as viem_WriteContractParameters,
|
|
11
|
+
type WriteContractReturnType as viem_WriteContractReturnType,
|
|
12
|
+
writeContract as viem_writeContract,
|
|
13
|
+
} from 'viem/actions'
|
|
11
14
|
|
|
12
15
|
import type { Config } from '../createConfig.js'
|
|
13
16
|
import type { SelectChains } from '../types/chain.js'
|
|
@@ -60,7 +63,7 @@ export type WriteContractParameters<
|
|
|
60
63
|
|
|
61
64
|
export type WriteContractReturnType = viem_WriteContractReturnType
|
|
62
65
|
|
|
63
|
-
export type
|
|
66
|
+
export type WriteContractErrorType = viem_WriteContractErrorType
|
|
64
67
|
|
|
65
68
|
/** https://alpha.wagmi.sh/core/api/actions/writeContract */
|
|
66
69
|
export async function writeContract<
|
|
@@ -100,9 +103,7 @@ export async function writeContract<
|
|
|
100
103
|
|
|
101
104
|
const hash = await viem_writeContract(client, {
|
|
102
105
|
...(request as any),
|
|
103
|
-
|
|
104
|
-
// already validated above with `assertActiveChain` and in `simulateContract`
|
|
105
|
-
chain: null,
|
|
106
|
+
chain: chainId ? { id: chainId } : null,
|
|
106
107
|
})
|
|
107
108
|
|
|
108
109
|
return hash
|