@wagmi/core 3.2.3 → 3.3.1
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/getBlobBaseFee.js +10 -0
- package/dist/esm/actions/getBlobBaseFee.js.map +1 -0
- package/dist/esm/actions/getContractEvents.js +10 -0
- package/dist/esm/actions/getContractEvents.js.map +1 -0
- package/dist/esm/actions/writeContractSync.js +31 -0
- package/dist/esm/actions/writeContractSync.js.map +1 -0
- package/dist/esm/connectors/mock.js +2 -0
- package/dist/esm/connectors/mock.js.map +1 -1
- package/dist/esm/exports/actions.js +2 -0
- package/dist/esm/exports/actions.js.map +1 -1
- package/dist/esm/exports/index.js +3 -0
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/exports/query.js +3 -0
- package/dist/esm/exports/query.js.map +1 -1
- package/dist/esm/query/connect.js +3 -2
- package/dist/esm/query/connect.js.map +1 -1
- package/dist/esm/query/deployContract.js +2 -1
- package/dist/esm/query/deployContract.js.map +1 -1
- package/dist/esm/query/disconnect.js +3 -2
- package/dist/esm/query/disconnect.js.map +1 -1
- package/dist/esm/query/getBlobBaseFee.js +17 -0
- package/dist/esm/query/getBlobBaseFee.js.map +1 -0
- package/dist/esm/query/getContractEvents.js +24 -0
- package/dist/esm/query/getContractEvents.js.map +1 -0
- package/dist/esm/query/readContracts.js +13 -2
- package/dist/esm/query/readContracts.js.map +1 -1
- package/dist/esm/query/reconnect.js +2 -1
- package/dist/esm/query/reconnect.js.map +1 -1
- package/dist/esm/query/sendCalls.js +2 -1
- package/dist/esm/query/sendCalls.js.map +1 -1
- package/dist/esm/query/sendCallsSync.js +2 -1
- package/dist/esm/query/sendCallsSync.js.map +1 -1
- package/dist/esm/query/sendTransaction.js +2 -1
- package/dist/esm/query/sendTransaction.js.map +1 -1
- package/dist/esm/query/sendTransactionSync.js +2 -1
- package/dist/esm/query/sendTransactionSync.js.map +1 -1
- package/dist/esm/query/showCallsStatus.js +2 -1
- package/dist/esm/query/showCallsStatus.js.map +1 -1
- package/dist/esm/query/signMessage.js +2 -1
- package/dist/esm/query/signMessage.js.map +1 -1
- package/dist/esm/query/signTypedData.js +2 -1
- package/dist/esm/query/signTypedData.js.map +1 -1
- package/dist/esm/query/switchChain.js +2 -1
- package/dist/esm/query/switchChain.js.map +1 -1
- package/dist/esm/query/switchConnection.js +2 -1
- package/dist/esm/query/switchConnection.js.map +1 -1
- package/dist/esm/query/verifyTypedData.js.map +1 -1
- package/dist/esm/query/watchAsset.js +2 -1
- package/dist/esm/query/watchAsset.js.map +1 -1
- package/dist/esm/query/writeContract.js +2 -1
- package/dist/esm/query/writeContract.js.map +1 -1
- package/dist/esm/query/writeContractSync.js +11 -0
- package/dist/esm/query/writeContractSync.js.map +1 -0
- package/dist/esm/tempo/Connectors.js +6 -2
- package/dist/esm/tempo/Connectors.js.map +1 -1
- package/dist/esm/tempo/KeyManager.js +4 -4
- package/dist/esm/tempo/KeyManager.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/actions/getBlobBaseFee.d.ts +10 -0
- package/dist/types/actions/getBlobBaseFee.d.ts.map +1 -0
- package/dist/types/actions/getContractEvents.d.ts +11 -0
- package/dist/types/actions/getContractEvents.d.ts.map +1 -0
- package/dist/types/actions/writeContractSync.d.ts +16 -0
- package/dist/types/actions/writeContractSync.d.ts.map +1 -0
- package/dist/types/connectors/mock.d.ts.map +1 -1
- package/dist/types/exports/actions.d.ts +2 -0
- package/dist/types/exports/actions.d.ts.map +1 -1
- package/dist/types/exports/index.d.ts +3 -0
- package/dist/types/exports/index.d.ts.map +1 -1
- package/dist/types/exports/query.d.ts +21 -14
- package/dist/types/exports/query.d.ts.map +1 -1
- package/dist/types/query/connect.d.ts +5 -5
- package/dist/types/query/connect.d.ts.map +1 -1
- package/dist/types/query/deployContract.d.ts +5 -5
- package/dist/types/query/deployContract.d.ts.map +1 -1
- package/dist/types/query/disconnect.d.ts +5 -4
- package/dist/types/query/disconnect.d.ts.map +1 -1
- package/dist/types/query/getBlobBaseFee.d.ts +16 -0
- package/dist/types/query/getBlobBaseFee.d.ts.map +1 -0
- package/dist/types/query/getContractEvents.d.ts +24 -0
- package/dist/types/query/getContractEvents.d.ts.map +1 -0
- package/dist/types/query/getEnsAddress.d.ts +1 -1
- package/dist/types/query/getEnsAvatar.d.ts +1 -1
- package/dist/types/query/getEnsName.d.ts +1 -1
- package/dist/types/query/getEnsText.d.ts +1 -1
- package/dist/types/query/readContracts.d.ts +1 -1
- package/dist/types/query/readContracts.d.ts.map +1 -1
- package/dist/types/query/reconnect.d.ts +5 -4
- package/dist/types/query/reconnect.d.ts.map +1 -1
- package/dist/types/query/sendCalls.d.ts +5 -10
- package/dist/types/query/sendCalls.d.ts.map +1 -1
- package/dist/types/query/sendCallsSync.d.ts +5 -18
- package/dist/types/query/sendCallsSync.d.ts.map +1 -1
- package/dist/types/query/sendTransaction.d.ts +5 -5
- package/dist/types/query/sendTransaction.d.ts.map +1 -1
- package/dist/types/query/sendTransactionSync.d.ts +5 -5
- package/dist/types/query/sendTransactionSync.d.ts.map +1 -1
- package/dist/types/query/showCallsStatus.d.ts +5 -5
- package/dist/types/query/showCallsStatus.d.ts.map +1 -1
- package/dist/types/query/signMessage.d.ts +5 -8
- package/dist/types/query/signMessage.d.ts.map +1 -1
- package/dist/types/query/signTypedData.d.ts +5 -223
- package/dist/types/query/signTypedData.d.ts.map +1 -1
- package/dist/types/query/switchChain.d.ts +5 -21
- package/dist/types/query/switchChain.d.ts.map +1 -1
- package/dist/types/query/switchConnection.d.ts +5 -6
- package/dist/types/query/switchConnection.d.ts.map +1 -1
- package/dist/types/query/verifyTypedData.d.ts.map +1 -1
- package/dist/types/query/watchAsset.d.ts +5 -13
- package/dist/types/query/watchAsset.d.ts.map +1 -1
- package/dist/types/query/writeContract.d.ts +5 -7
- package/dist/types/query/writeContract.d.ts.map +1 -1
- package/dist/types/query/writeContractSync.d.ts +14 -0
- package/dist/types/query/writeContractSync.d.ts.map +1 -0
- package/dist/types/tempo/Connectors.d.ts.map +1 -1
- package/dist/types/types/query.d.ts +4 -1
- package/dist/types/types/query.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/actions/getBlobBaseFee.ts +35 -0
- package/src/actions/getContractEvents.ts +68 -0
- package/src/actions/writeContractSync.ts +120 -0
- package/src/connectors/mock.ts +1 -0
- package/src/exports/actions.ts +14 -0
- package/src/exports/index.ts +21 -0
- package/src/exports/query.ts +64 -0
- package/src/query/connect.ts +24 -8
- package/src/query/deployContract.ts +20 -5
- package/src/query/disconnect.ts +20 -9
- package/src/query/getBlobBaseFee.ts +75 -0
- package/src/query/getContractEvents.ts +214 -0
- package/src/query/readContracts.ts +12 -2
- package/src/query/reconnect.ts +20 -7
- package/src/query/sendCalls.ts +22 -8
- package/src/query/sendCallsSync.ts +20 -5
- package/src/query/sendTransaction.ts +20 -5
- package/src/query/sendTransactionSync.ts +23 -5
- package/src/query/showCallsStatus.ts +19 -8
- package/src/query/signMessage.ts +20 -7
- package/src/query/signTypedData.ts +19 -8
- package/src/query/switchChain.ts +22 -8
- package/src/query/switchConnection.ts +20 -5
- package/src/query/verifyTypedData.ts +0 -1
- package/src/query/watchAsset.ts +20 -7
- package/src/query/writeContract.ts +26 -5
- package/src/query/writeContractSync.ts +130 -0
- package/src/tempo/Connectors.ts +6 -2
- package/src/tempo/KeyManager.ts +6 -4
- package/src/types/query.ts +15 -1
- package/src/version.ts +1 -1
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import type { MutateOptions } from '@tanstack/query-core';
|
|
1
|
+
import type { MutateOptions, MutationOptions } from '@tanstack/query-core';
|
|
2
2
|
import type { Abi, ContractFunctionArgs, ContractFunctionName } from 'viem';
|
|
3
3
|
import { type WriteContractErrorType, type WriteContractParameters, type WriteContractReturnType } from '../actions/writeContract.js';
|
|
4
4
|
import type { Config } from '../createConfig.js';
|
|
5
|
+
import type { MutationParameter } from '../types/query.js';
|
|
5
6
|
import type { Compute } from '../types/utils.js';
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} & import("../types/properties.js").ConnectorParameter>) => Promise<`0x${string}`>;
|
|
10
|
-
readonly mutationKey: readonly ["writeContract"];
|
|
11
|
-
};
|
|
7
|
+
export type WriteContractOptions<config extends Config, context = unknown> = MutationParameter<WriteContractData, WriteContractErrorType, WriteContractVariables<Abi, string, readonly unknown[], config, config['chains'][number]['id']>, context>;
|
|
8
|
+
export declare function writeContractMutationOptions<config extends Config, context>(config: config, options?: WriteContractOptions<config, context>): WriteContractMutationOptions<config>;
|
|
9
|
+
export type WriteContractMutationOptions<config extends Config> = MutationOptions<WriteContractData, WriteContractErrorType, WriteContractVariables<Abi, string, readonly unknown[], config, config['chains'][number]['id']>>;
|
|
12
10
|
export type WriteContractData = Compute<WriteContractReturnType>;
|
|
13
11
|
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>;
|
|
14
12
|
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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeContract.d.ts","sourceRoot":"","sources":["../../../src/query/writeContract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,
|
|
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MAAM,SAAS,MAAM,EACrB,OAAO,GAAG,OAAO,IACf,CACF,KAAK,CAAC,GAAG,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EAC1C,YAAY,SAAS,oBAAoB,CAAC,GAAG,EAAE,YAAY,GAAG,SAAS,CAAC,EACxE,IAAI,SAAS,oBAAoB,CAC/B,GAAG,EACH,YAAY,GAAG,SAAS,EACxB,YAAY,CACb,EACD,OAAO,SAAS,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAE9C,SAAS,EAAE,sBAAsB,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAC3E,OAAO,CAAC,EACJ,aAAa,CACX,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,CACpB,GAAG,EACH,YAAY,EACZ,IAAI,EACJ,MAAM,EACN,OAAO,EAEP,YAAY,CACb,EACD,OAAO,CACR,GACD,SAAS,KACV,OAAO,CAAC,iBAAiB,CAAC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MutateOptions, MutationOptions } from '@tanstack/query-core';
|
|
2
|
+
import type { Abi, ContractFunctionArgs, ContractFunctionName } from 'viem';
|
|
3
|
+
import { type WriteContractSyncErrorType, type WriteContractSyncParameters, type WriteContractSyncReturnType } from '../actions/writeContractSync.js';
|
|
4
|
+
import type { Config } from '../createConfig.js';
|
|
5
|
+
import type { MutationParameter } from '../types/query.js';
|
|
6
|
+
import type { Compute } from '../types/utils.js';
|
|
7
|
+
export type WriteContractSyncOptions<config extends Config, context = unknown> = MutationParameter<WriteContractSyncData, WriteContractSyncErrorType, WriteContractSyncVariables<Abi, string, readonly unknown[], config, config['chains'][number]['id']>, context>;
|
|
8
|
+
export declare function writeContractSyncMutationOptions<config extends Config, context>(config: config, options?: WriteContractSyncOptions<config, context>): WriteContractSyncMutationOptions<config>;
|
|
9
|
+
export type WriteContractSyncMutationOptions<config extends Config> = MutationOptions<WriteContractSyncData, WriteContractSyncErrorType, WriteContractSyncVariables<Abi, string, readonly unknown[], config, config['chains'][number]['id']>>;
|
|
10
|
+
export type WriteContractSyncData = Compute<WriteContractSyncReturnType>;
|
|
11
|
+
export type WriteContractSyncVariables<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']> = WriteContractSyncParameters<abi, functionName, args, config, chainId>;
|
|
12
|
+
export type WriteContractSyncMutate<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: WriteContractSyncVariables<abi, functionName, args, config, chainId>, options?: MutateOptions<WriteContractSyncData, WriteContractSyncErrorType, WriteContractSyncVariables<abi, functionName, args, config, chainId>, context> | undefined) => void;
|
|
13
|
+
export type WriteContractSyncMutateAsync<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: WriteContractSyncVariables<abi, functionName, args, config, chainId>, options?: MutateOptions<WriteContractSyncData, WriteContractSyncErrorType, WriteContractSyncVariables<abi, functionName, args, config, chainId>, context> | undefined) => Promise<WriteContractSyncData>;
|
|
14
|
+
//# sourceMappingURL=writeContractSync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeContractSync.d.ts","sourceRoot":"","sources":["../../../src/query/writeContractSync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,GAAG,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,M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,GAAG,SAAS,CAAA;SAAE,GAAG,SAAS,CAAA;QAC3D,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;QAC5B,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;QACpC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,OAAO,GAAG,SAAS,CAAA;KAC1D,GAAG,OAAO,CAAC;QACV,QAAQ,EAAE,SAAS,OAAO,CAAC,OAAO,EAAE,CAAA;QACpC,OAAO,EAAE,MAAM,CAAA;KAChB,CAAC;;;+BAIyB,OAAO,CAAC,OAAO;mCACX,OAAO,CAAC,OAAO;GA0IjD;yBA9Je,mBAAmB;;;AAgKnC,MAAM,CAAC,OAAO,WAAW,mBAAmB,CAAC;IAC3C,KAAY,UAAU,GAAG;QACvB,OAAO,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;KACnC,CAAA;CACF"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type * as Query from '@tanstack/query-core';
|
|
2
|
-
import type { RequiredBy, UnionLooseOmit } from './utils.js';
|
|
2
|
+
import type { Compute, LooseOmit, RequiredBy, UnionLooseOmit } from './utils.js';
|
|
3
|
+
export type MutationParameter<data = unknown, error = Error, variables = void, context = unknown> = {
|
|
4
|
+
mutation?: LooseOmit<Query.MutationOptions<data, error, Compute<variables>, context>, 'mutationFn' | 'mutationKey' | 'throwOnError'> | undefined;
|
|
5
|
+
};
|
|
3
6
|
export type QueryParameter<queryFnData = unknown, error = Query.DefaultError, data = queryFnData, queryKey extends Query.QueryKey = Query.QueryKey> = {
|
|
4
7
|
query?: UnionLooseOmit<QueryOptions<queryFnData, error, data, queryKey>, 'queryKey' | 'queryFn'> | undefined;
|
|
5
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/types/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,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D,SAAS,GAAG,WAAW,GAAG,gBAAgB,GAAG,cAAc,CAC5D,GAAG;IACF,OAAO,EAAE,OAAO,CACd,KAAK,CAAC,oBAAoB,CACxB,WAAW,EACX,KAAK,EACL,IAAI,EACJ,WAAW,EACX,QAAQ,CACT,CAAC,SAAS,CAAC,EACZ,OAAO,KAAK,CAAC,SAAS,GAAG,SAAS,CACnC,CAAA;CACF,CAAA"}
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "3.
|
|
1
|
+
export declare const version = "3.3.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type GetBlobBaseFeeErrorType as viem_GetBlobBaseFeeErrorType,
|
|
3
|
+
type GetBlobBaseFeeReturnType as viem_GetBlobBaseFeeReturnType,
|
|
4
|
+
getBlobBaseFee as viem_getBlobBaseFee,
|
|
5
|
+
} from 'viem/actions'
|
|
6
|
+
|
|
7
|
+
import type { Config } from '../createConfig.js'
|
|
8
|
+
import type { ChainIdParameter } from '../types/properties.js'
|
|
9
|
+
import type { Compute } from '../types/utils.js'
|
|
10
|
+
import { getAction } from '../utils/getAction.js'
|
|
11
|
+
|
|
12
|
+
export type GetBlobBaseFeeParameters<
|
|
13
|
+
config extends Config = Config,
|
|
14
|
+
chainId extends
|
|
15
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
16
|
+
> = Compute<ChainIdParameter<config, chainId>>
|
|
17
|
+
|
|
18
|
+
export type GetBlobBaseFeeReturnType = viem_GetBlobBaseFeeReturnType
|
|
19
|
+
|
|
20
|
+
export type GetBlobBaseFeeErrorType = viem_GetBlobBaseFeeErrorType
|
|
21
|
+
|
|
22
|
+
/** https://wagmi.sh/core/api/actions/getBlobBaseFee */
|
|
23
|
+
export function getBlobBaseFee<
|
|
24
|
+
config extends Config,
|
|
25
|
+
chainId extends
|
|
26
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
27
|
+
>(
|
|
28
|
+
config: config,
|
|
29
|
+
parameters: GetBlobBaseFeeParameters<config, chainId> = {},
|
|
30
|
+
): Promise<GetBlobBaseFeeReturnType> {
|
|
31
|
+
const { chainId } = parameters
|
|
32
|
+
const client = config.getClient({ chainId })
|
|
33
|
+
const action = getAction(client, viem_getBlobBaseFee, 'getBlobBaseFee')
|
|
34
|
+
return action({})
|
|
35
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Abi, BlockNumber, BlockTag, ContractEventName } from 'viem'
|
|
2
|
+
import {
|
|
3
|
+
type GetContractEventsErrorType as viem_GetContractEventsErrorType,
|
|
4
|
+
type GetContractEventsParameters as viem_GetContractEventsParameters,
|
|
5
|
+
type GetContractEventsReturnType as viem_GetContractEventsReturnType,
|
|
6
|
+
getContractEvents as viem_getContractEvents,
|
|
7
|
+
} from 'viem/actions'
|
|
8
|
+
import type { Config } from '../createConfig.js'
|
|
9
|
+
import type { ChainIdParameter } from '../types/properties.js'
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
|
+
import { getAction } from '../utils/getAction.js'
|
|
12
|
+
|
|
13
|
+
export type GetContractEventsParameters<
|
|
14
|
+
abi extends Abi | readonly unknown[] = Abi,
|
|
15
|
+
eventName extends ContractEventName<abi> | undefined =
|
|
16
|
+
| ContractEventName<abi>
|
|
17
|
+
| undefined,
|
|
18
|
+
strict extends boolean | undefined = undefined,
|
|
19
|
+
fromBlock extends BlockNumber | BlockTag | undefined = undefined,
|
|
20
|
+
toBlock extends BlockNumber | BlockTag | undefined = undefined,
|
|
21
|
+
config extends Config = Config,
|
|
22
|
+
chainId extends
|
|
23
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
24
|
+
> = Compute<
|
|
25
|
+
viem_GetContractEventsParameters<abi, eventName, strict, fromBlock, toBlock> &
|
|
26
|
+
ChainIdParameter<config, chainId>
|
|
27
|
+
>
|
|
28
|
+
|
|
29
|
+
export type GetContractEventsReturnType<
|
|
30
|
+
abi extends Abi | readonly unknown[] = Abi,
|
|
31
|
+
eventName extends ContractEventName<abi> | undefined =
|
|
32
|
+
| ContractEventName<abi>
|
|
33
|
+
| undefined,
|
|
34
|
+
strict extends boolean | undefined = undefined,
|
|
35
|
+
fromBlock extends BlockNumber | BlockTag | undefined = undefined,
|
|
36
|
+
toBlock extends BlockNumber | BlockTag | undefined = undefined,
|
|
37
|
+
> = viem_GetContractEventsReturnType<abi, eventName, strict, fromBlock, toBlock>
|
|
38
|
+
|
|
39
|
+
export type GetContractEventsErrorType = viem_GetContractEventsErrorType
|
|
40
|
+
|
|
41
|
+
/** https://wagmi.sh/core/actions/getContractEvents */
|
|
42
|
+
export async function getContractEvents<
|
|
43
|
+
config extends Config,
|
|
44
|
+
chainId extends config['chains'][number]['id'],
|
|
45
|
+
const abi extends Abi | readonly unknown[],
|
|
46
|
+
eventName extends ContractEventName<abi> | undefined,
|
|
47
|
+
strict extends boolean | undefined = undefined,
|
|
48
|
+
fromBlock extends BlockNumber | BlockTag | undefined = undefined,
|
|
49
|
+
toBlock extends BlockNumber | BlockTag | undefined = undefined,
|
|
50
|
+
>(
|
|
51
|
+
config: config,
|
|
52
|
+
parameters: GetContractEventsParameters<
|
|
53
|
+
abi,
|
|
54
|
+
eventName,
|
|
55
|
+
strict,
|
|
56
|
+
fromBlock,
|
|
57
|
+
toBlock,
|
|
58
|
+
config,
|
|
59
|
+
chainId
|
|
60
|
+
>,
|
|
61
|
+
): Promise<
|
|
62
|
+
GetContractEventsReturnType<abi, eventName, strict, fromBlock, toBlock>
|
|
63
|
+
> {
|
|
64
|
+
const { chainId, ...rest } = parameters
|
|
65
|
+
const client = config.getClient({ chainId })
|
|
66
|
+
const action = getAction(client, viem_getContractEvents, 'getContractEvents')
|
|
67
|
+
return action(rest)
|
|
68
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Abi,
|
|
3
|
+
Account,
|
|
4
|
+
Chain,
|
|
5
|
+
Client,
|
|
6
|
+
ContractFunctionArgs,
|
|
7
|
+
ContractFunctionName,
|
|
8
|
+
} from 'viem'
|
|
9
|
+
import {
|
|
10
|
+
type WriteContractSyncErrorType as viem_WriteContractSyncErrorType,
|
|
11
|
+
type WriteContractSyncParameters as viem_WriteContractSyncParameters,
|
|
12
|
+
type WriteContractSyncReturnType as viem_WriteContractSyncReturnType,
|
|
13
|
+
writeContractSync as viem_writeContractSync,
|
|
14
|
+
} from 'viem/actions'
|
|
15
|
+
|
|
16
|
+
import type { Config } from '../createConfig.js'
|
|
17
|
+
import type { BaseErrorType, ErrorType } from '../errors/base.js'
|
|
18
|
+
import type { SelectChains } from '../types/chain.js'
|
|
19
|
+
import type {
|
|
20
|
+
ChainIdParameter,
|
|
21
|
+
ConnectorParameter,
|
|
22
|
+
} from '../types/properties.js'
|
|
23
|
+
import type { Compute, UnionCompute } from '../types/utils.js'
|
|
24
|
+
import { getAction } from '../utils/getAction.js'
|
|
25
|
+
import {
|
|
26
|
+
type GetConnectorClientErrorType,
|
|
27
|
+
getConnectorClient,
|
|
28
|
+
} from './getConnectorClient.js'
|
|
29
|
+
|
|
30
|
+
export type WriteContractSyncParameters<
|
|
31
|
+
abi extends Abi | readonly unknown[] = Abi,
|
|
32
|
+
functionName extends ContractFunctionName<
|
|
33
|
+
abi,
|
|
34
|
+
'nonpayable' | 'payable'
|
|
35
|
+
> = ContractFunctionName<abi, 'nonpayable' | 'payable'>,
|
|
36
|
+
args extends ContractFunctionArgs<
|
|
37
|
+
abi,
|
|
38
|
+
'nonpayable' | 'payable',
|
|
39
|
+
functionName
|
|
40
|
+
> = ContractFunctionArgs<abi, 'nonpayable' | 'payable', functionName>,
|
|
41
|
+
config extends Config = Config,
|
|
42
|
+
chainId extends
|
|
43
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
44
|
+
///
|
|
45
|
+
chains extends readonly Chain[] = SelectChains<config, chainId>,
|
|
46
|
+
> = UnionCompute<
|
|
47
|
+
{
|
|
48
|
+
[key in keyof chains]: viem_WriteContractSyncParameters<
|
|
49
|
+
abi,
|
|
50
|
+
functionName,
|
|
51
|
+
args,
|
|
52
|
+
chains[key],
|
|
53
|
+
Account,
|
|
54
|
+
chains[key]
|
|
55
|
+
>
|
|
56
|
+
}[number] &
|
|
57
|
+
Compute<ChainIdParameter<config, chainId>> &
|
|
58
|
+
ConnectorParameter
|
|
59
|
+
>
|
|
60
|
+
|
|
61
|
+
export type WriteContractSyncReturnType = viem_WriteContractSyncReturnType
|
|
62
|
+
|
|
63
|
+
export type WriteContractSyncErrorType =
|
|
64
|
+
// getConnectorClient()
|
|
65
|
+
| GetConnectorClientErrorType
|
|
66
|
+
// base
|
|
67
|
+
| BaseErrorType
|
|
68
|
+
| ErrorType
|
|
69
|
+
// viem
|
|
70
|
+
| viem_WriteContractSyncErrorType
|
|
71
|
+
|
|
72
|
+
/** https://wagmi.sh/core/api/actions/writeContractSync */
|
|
73
|
+
export async function writeContractSync<
|
|
74
|
+
config extends Config,
|
|
75
|
+
const abi extends Abi | readonly unknown[],
|
|
76
|
+
functionName extends ContractFunctionName<abi, 'nonpayable' | 'payable'>,
|
|
77
|
+
args extends ContractFunctionArgs<
|
|
78
|
+
abi,
|
|
79
|
+
'nonpayable' | 'payable',
|
|
80
|
+
functionName
|
|
81
|
+
>,
|
|
82
|
+
chainId extends config['chains'][number]['id'],
|
|
83
|
+
>(
|
|
84
|
+
config: config,
|
|
85
|
+
parameters: WriteContractSyncParameters<
|
|
86
|
+
abi,
|
|
87
|
+
functionName,
|
|
88
|
+
args,
|
|
89
|
+
config,
|
|
90
|
+
chainId
|
|
91
|
+
>,
|
|
92
|
+
): Promise<WriteContractSyncReturnType> {
|
|
93
|
+
const { account, chainId, connector, ...request } = parameters
|
|
94
|
+
|
|
95
|
+
let client: Client
|
|
96
|
+
if (typeof account === 'object' && account?.type === 'local')
|
|
97
|
+
client = config.getClient({ chainId })
|
|
98
|
+
else
|
|
99
|
+
client = await getConnectorClient(config, {
|
|
100
|
+
account: account ?? undefined,
|
|
101
|
+
assertChainId: false,
|
|
102
|
+
chainId,
|
|
103
|
+
connector,
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
const chain = (() => {
|
|
107
|
+
if (!chainId || client.chain?.id === chainId) return client.chain
|
|
108
|
+
return { id: chainId }
|
|
109
|
+
})()
|
|
110
|
+
|
|
111
|
+
const action = getAction(client, viem_writeContractSync, 'writeContractSync')
|
|
112
|
+
const receipt = await action({
|
|
113
|
+
...(request as any),
|
|
114
|
+
...(account ? { account } : {}),
|
|
115
|
+
assertChainId: !!chainId,
|
|
116
|
+
chain,
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
return receipt
|
|
120
|
+
}
|
package/src/connectors/mock.ts
CHANGED
|
@@ -164,6 +164,7 @@ export function mock(parameters: MockParameters) {
|
|
|
164
164
|
const request: EIP1193RequestFn = async ({ method, params }) => {
|
|
165
165
|
// eth methods
|
|
166
166
|
if (method === 'eth_chainId') return numberToHex(connectedChainId)
|
|
167
|
+
if (method === 'eth_accounts') return parameters.accounts
|
|
167
168
|
if (method === 'eth_requestAccounts') return parameters.accounts
|
|
168
169
|
if (method === 'eth_signTypedData_v4')
|
|
169
170
|
if (features.signTypedDataError) {
|
package/src/exports/actions.ts
CHANGED
|
@@ -59,6 +59,13 @@ export {
|
|
|
59
59
|
getBalance,
|
|
60
60
|
} from '../actions/getBalance.js'
|
|
61
61
|
|
|
62
|
+
export {
|
|
63
|
+
type GetBlobBaseFeeErrorType,
|
|
64
|
+
type GetBlobBaseFeeParameters,
|
|
65
|
+
type GetBlobBaseFeeReturnType,
|
|
66
|
+
getBlobBaseFee,
|
|
67
|
+
} from '../actions/getBlobBaseFee.js'
|
|
68
|
+
|
|
62
69
|
export {
|
|
63
70
|
type GetBlockErrorType,
|
|
64
71
|
type GetBlockParameters,
|
|
@@ -141,6 +148,13 @@ export {
|
|
|
141
148
|
getConnectors,
|
|
142
149
|
} from '../actions/getConnectors.js'
|
|
143
150
|
|
|
151
|
+
export {
|
|
152
|
+
type GetContractEventsErrorType,
|
|
153
|
+
type GetContractEventsParameters,
|
|
154
|
+
type GetContractEventsReturnType,
|
|
155
|
+
getContractEvents,
|
|
156
|
+
} from '../actions/getContractEvents.js'
|
|
157
|
+
|
|
144
158
|
export {
|
|
145
159
|
type GetEnsAddressErrorType,
|
|
146
160
|
type GetEnsAddressParameters,
|
package/src/exports/index.ts
CHANGED
|
@@ -59,6 +59,13 @@ export {
|
|
|
59
59
|
getBalance,
|
|
60
60
|
} from '../actions/getBalance.js'
|
|
61
61
|
|
|
62
|
+
export {
|
|
63
|
+
type GetBlobBaseFeeErrorType,
|
|
64
|
+
type GetBlobBaseFeeParameters,
|
|
65
|
+
type GetBlobBaseFeeReturnType,
|
|
66
|
+
getBlobBaseFee,
|
|
67
|
+
} from '../actions/getBlobBaseFee.js'
|
|
68
|
+
|
|
62
69
|
export {
|
|
63
70
|
type GetBlockErrorType,
|
|
64
71
|
type GetBlockParameters,
|
|
@@ -143,6 +150,13 @@ export {
|
|
|
143
150
|
getConnectors,
|
|
144
151
|
} from '../actions/getConnectors.js'
|
|
145
152
|
|
|
153
|
+
export {
|
|
154
|
+
type GetContractEventsErrorType,
|
|
155
|
+
type GetContractEventsParameters,
|
|
156
|
+
type GetContractEventsReturnType,
|
|
157
|
+
getContractEvents,
|
|
158
|
+
} from '../actions/getContractEvents.js'
|
|
159
|
+
|
|
146
160
|
export {
|
|
147
161
|
type GetEnsAddressErrorType,
|
|
148
162
|
type GetEnsAddressParameters,
|
|
@@ -467,6 +481,13 @@ export {
|
|
|
467
481
|
writeContract,
|
|
468
482
|
} from '../actions/writeContract.js'
|
|
469
483
|
|
|
484
|
+
export {
|
|
485
|
+
type WriteContractSyncErrorType,
|
|
486
|
+
type WriteContractSyncParameters,
|
|
487
|
+
type WriteContractSyncReturnType,
|
|
488
|
+
writeContractSync,
|
|
489
|
+
} from '../actions/writeContractSync.js'
|
|
490
|
+
|
|
470
491
|
////////////////////////////////////////////////////////////////////////////////
|
|
471
492
|
// Connectors
|
|
472
493
|
////////////////////////////////////////////////////////////////////////////////
|
package/src/exports/query.ts
CHANGED
|
@@ -17,6 +17,8 @@ export {
|
|
|
17
17
|
type ConnectData,
|
|
18
18
|
type ConnectMutate,
|
|
19
19
|
type ConnectMutateAsync,
|
|
20
|
+
type ConnectMutationOptions,
|
|
21
|
+
type ConnectOptions,
|
|
20
22
|
type ConnectVariables,
|
|
21
23
|
connectMutationOptions,
|
|
22
24
|
} from '../query/connect.js'
|
|
@@ -25,6 +27,8 @@ export {
|
|
|
25
27
|
type DeployContractData,
|
|
26
28
|
type DeployContractMutate,
|
|
27
29
|
type DeployContractMutateAsync,
|
|
30
|
+
type DeployContractMutationOptions,
|
|
31
|
+
type DeployContractOptions,
|
|
28
32
|
type DeployContractVariables,
|
|
29
33
|
deployContractMutationOptions,
|
|
30
34
|
} from '../query/deployContract.js'
|
|
@@ -33,6 +37,8 @@ export {
|
|
|
33
37
|
type DisconnectData,
|
|
34
38
|
type DisconnectMutate,
|
|
35
39
|
type DisconnectMutateAsync,
|
|
40
|
+
type DisconnectMutationOptions,
|
|
41
|
+
type DisconnectOptions,
|
|
36
42
|
type DisconnectVariables,
|
|
37
43
|
disconnectMutationOptions,
|
|
38
44
|
} from '../query/disconnect.js'
|
|
@@ -77,6 +83,16 @@ export {
|
|
|
77
83
|
getBalanceQueryOptions,
|
|
78
84
|
} from '../query/getBalance.js'
|
|
79
85
|
|
|
86
|
+
export {
|
|
87
|
+
type GetBlobBaseFeeData,
|
|
88
|
+
type GetBlobBaseFeeOptions,
|
|
89
|
+
type GetBlobBaseFeeQueryFnData,
|
|
90
|
+
type GetBlobBaseFeeQueryKey,
|
|
91
|
+
type GetBlobBaseFeeQueryOptions,
|
|
92
|
+
getBlobBaseFeeQueryKey,
|
|
93
|
+
getBlobBaseFeeQueryOptions,
|
|
94
|
+
} from '../query/getBlobBaseFee.js'
|
|
95
|
+
|
|
80
96
|
export {
|
|
81
97
|
type GetBlockData,
|
|
82
98
|
type GetBlockOptions,
|
|
@@ -147,6 +163,16 @@ export {
|
|
|
147
163
|
getConnectorClientQueryOptions,
|
|
148
164
|
} from '../query/getConnectorClient.js'
|
|
149
165
|
|
|
166
|
+
export {
|
|
167
|
+
type GetContractEventsData,
|
|
168
|
+
type GetContractEventsOptions,
|
|
169
|
+
type GetContractEventsQueryFnData,
|
|
170
|
+
type GetContractEventsQueryKey,
|
|
171
|
+
type GetContractEventsQueryOptions,
|
|
172
|
+
getContractEventsQueryKey,
|
|
173
|
+
getContractEventsQueryOptions,
|
|
174
|
+
} from '../query/getContractEvents.js'
|
|
175
|
+
|
|
150
176
|
export {
|
|
151
177
|
type GetEnsAddressData,
|
|
152
178
|
type GetEnsAddressOptions,
|
|
@@ -330,6 +356,8 @@ export {
|
|
|
330
356
|
type ReconnectData,
|
|
331
357
|
type ReconnectMutate,
|
|
332
358
|
type ReconnectMutateAsync,
|
|
359
|
+
type ReconnectMutationOptions,
|
|
360
|
+
type ReconnectOptions,
|
|
333
361
|
type ReconnectVariables,
|
|
334
362
|
reconnectMutationOptions,
|
|
335
363
|
} from '../query/reconnect.js'
|
|
@@ -338,6 +366,8 @@ export {
|
|
|
338
366
|
type SendCallsData,
|
|
339
367
|
type SendCallsMutate,
|
|
340
368
|
type SendCallsMutateAsync,
|
|
369
|
+
type SendCallsMutationOptions,
|
|
370
|
+
type SendCallsOptions,
|
|
341
371
|
type SendCallsVariables,
|
|
342
372
|
sendCallsMutationOptions,
|
|
343
373
|
} from '../query/sendCalls.js'
|
|
@@ -346,6 +376,8 @@ export {
|
|
|
346
376
|
type SendCallsSyncData,
|
|
347
377
|
type SendCallsSyncMutate,
|
|
348
378
|
type SendCallsSyncMutateAsync,
|
|
379
|
+
type SendCallsSyncMutationOptions,
|
|
380
|
+
type SendCallsSyncOptions,
|
|
349
381
|
type SendCallsSyncVariables,
|
|
350
382
|
sendCallsSyncMutationOptions,
|
|
351
383
|
} from '../query/sendCallsSync.js'
|
|
@@ -354,6 +386,8 @@ export {
|
|
|
354
386
|
type SendTransactionData,
|
|
355
387
|
type SendTransactionMutate,
|
|
356
388
|
type SendTransactionMutateAsync,
|
|
389
|
+
type SendTransactionMutationOptions,
|
|
390
|
+
type SendTransactionOptions,
|
|
357
391
|
type SendTransactionVariables,
|
|
358
392
|
sendTransactionMutationOptions,
|
|
359
393
|
} from '../query/sendTransaction.js'
|
|
@@ -362,6 +396,8 @@ export {
|
|
|
362
396
|
type SendTransactionSyncData,
|
|
363
397
|
type SendTransactionSyncMutate,
|
|
364
398
|
type SendTransactionSyncMutateAsync,
|
|
399
|
+
type SendTransactionSyncMutationOptions,
|
|
400
|
+
type SendTransactionSyncOptions,
|
|
365
401
|
type SendTransactionSyncVariables,
|
|
366
402
|
sendTransactionSyncMutationOptions,
|
|
367
403
|
} from '../query/sendTransactionSync.js'
|
|
@@ -370,6 +406,8 @@ export {
|
|
|
370
406
|
type ShowCallsStatusData,
|
|
371
407
|
type ShowCallsStatusMutate,
|
|
372
408
|
type ShowCallsStatusMutateAsync,
|
|
409
|
+
type ShowCallsStatusMutationOptions,
|
|
410
|
+
type ShowCallsStatusOptions,
|
|
373
411
|
type ShowCallsStatusVariables,
|
|
374
412
|
showCallsStatusMutationOptions,
|
|
375
413
|
} from '../query/showCallsStatus.js'
|
|
@@ -378,6 +416,8 @@ export {
|
|
|
378
416
|
type SignMessageData,
|
|
379
417
|
type SignMessageMutate,
|
|
380
418
|
type SignMessageMutateAsync,
|
|
419
|
+
type SignMessageMutationOptions,
|
|
420
|
+
type SignMessageOptions,
|
|
381
421
|
type SignMessageVariables,
|
|
382
422
|
signMessageMutationOptions,
|
|
383
423
|
} from '../query/signMessage.js'
|
|
@@ -386,6 +426,8 @@ export {
|
|
|
386
426
|
type SignTypedDataData,
|
|
387
427
|
type SignTypedDataMutate,
|
|
388
428
|
type SignTypedDataMutateAsync,
|
|
429
|
+
type SignTypedDataMutationOptions,
|
|
430
|
+
type SignTypedDataOptions,
|
|
389
431
|
type SignTypedDataVariables,
|
|
390
432
|
signTypedDataMutationOptions,
|
|
391
433
|
} from '../query/signTypedData.js'
|
|
@@ -404,6 +446,8 @@ export {
|
|
|
404
446
|
type SwitchChainData,
|
|
405
447
|
type SwitchChainMutate,
|
|
406
448
|
type SwitchChainMutateAsync,
|
|
449
|
+
type SwitchChainMutationOptions,
|
|
450
|
+
type SwitchChainOptions,
|
|
407
451
|
type SwitchChainVariables,
|
|
408
452
|
switchChainMutationOptions,
|
|
409
453
|
} from '../query/switchChain.js'
|
|
@@ -418,6 +462,12 @@ export {
|
|
|
418
462
|
/** @deprecated use `SwitchConnectionMutateAsync` instead */
|
|
419
463
|
type SwitchConnectionMutateAsync as SwitchAccountMutateAsync,
|
|
420
464
|
type SwitchConnectionMutateAsync,
|
|
465
|
+
/** @deprecated use `SwitchConnectionMutationOptions` instead */
|
|
466
|
+
type SwitchConnectionMutationOptions as SwitchAccountMutationOptions,
|
|
467
|
+
type SwitchConnectionMutationOptions,
|
|
468
|
+
/** @deprecated use `SwitchConnectionOptions` instead */
|
|
469
|
+
type SwitchConnectionOptions as SwitchAccountOptions,
|
|
470
|
+
type SwitchConnectionOptions,
|
|
421
471
|
/** @deprecated use `SwitchConnectionVariables` instead */
|
|
422
472
|
type SwitchConnectionVariables as SwitchAccountVariables,
|
|
423
473
|
type SwitchConnectionVariables,
|
|
@@ -475,6 +525,8 @@ export {
|
|
|
475
525
|
type WatchAssetData,
|
|
476
526
|
type WatchAssetMutate,
|
|
477
527
|
type WatchAssetMutateAsync,
|
|
528
|
+
type WatchAssetMutationOptions,
|
|
529
|
+
type WatchAssetOptions,
|
|
478
530
|
type WatchAssetVariables,
|
|
479
531
|
watchAssetMutationOptions,
|
|
480
532
|
} from '../query/watchAsset.js'
|
|
@@ -483,6 +535,18 @@ export {
|
|
|
483
535
|
type WriteContractData,
|
|
484
536
|
type WriteContractMutate,
|
|
485
537
|
type WriteContractMutateAsync,
|
|
538
|
+
type WriteContractMutationOptions,
|
|
539
|
+
type WriteContractOptions,
|
|
486
540
|
type WriteContractVariables,
|
|
487
541
|
writeContractMutationOptions,
|
|
488
542
|
} from '../query/writeContract.js'
|
|
543
|
+
|
|
544
|
+
export {
|
|
545
|
+
type WriteContractSyncData,
|
|
546
|
+
type WriteContractSyncMutate,
|
|
547
|
+
type WriteContractSyncMutateAsync,
|
|
548
|
+
type WriteContractSyncMutationOptions,
|
|
549
|
+
type WriteContractSyncOptions,
|
|
550
|
+
type WriteContractSyncVariables,
|
|
551
|
+
writeContractSyncMutationOptions,
|
|
552
|
+
} from '../query/writeContractSync.js'
|
package/src/query/connect.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { MutateOptions, MutationOptions } from '@tanstack/query-core'
|
|
2
|
-
|
|
3
2
|
import {
|
|
4
3
|
type ConnectErrorType,
|
|
5
4
|
type ConnectParameters,
|
|
@@ -8,21 +7,38 @@ import {
|
|
|
8
7
|
} from '../actions/connect.js'
|
|
9
8
|
import type { CreateConnectorFn } from '../connectors/createConnector.js'
|
|
10
9
|
import type { Config, Connector } from '../createConfig.js'
|
|
10
|
+
import type { MutationParameter } from '../types/query.js'
|
|
11
11
|
import type { Compute } from '../types/utils.js'
|
|
12
12
|
|
|
13
|
-
export
|
|
13
|
+
export type ConnectOptions<
|
|
14
|
+
config extends Config,
|
|
15
|
+
context = unknown,
|
|
16
|
+
> = MutationParameter<
|
|
17
|
+
ConnectData<config, config['connectors'][number], boolean>,
|
|
18
|
+
ConnectErrorType,
|
|
19
|
+
ConnectVariables<config, config['connectors'][number], boolean>,
|
|
20
|
+
context
|
|
21
|
+
>
|
|
22
|
+
|
|
23
|
+
export function connectMutationOptions<config extends Config, context>(
|
|
24
|
+
config: config,
|
|
25
|
+
options: ConnectOptions<config, context> = {},
|
|
26
|
+
): ConnectMutationOptions<config> {
|
|
14
27
|
return {
|
|
15
|
-
|
|
28
|
+
...(options.mutation as any),
|
|
29
|
+
mutationFn: async (variables) => {
|
|
16
30
|
return connect(config, variables)
|
|
17
31
|
},
|
|
18
32
|
mutationKey: ['connect'],
|
|
19
|
-
}
|
|
20
|
-
ConnectData<config, Connector | CreateConnectorFn, boolean>,
|
|
21
|
-
ConnectErrorType,
|
|
22
|
-
ConnectVariables<config, Connector | CreateConnectorFn, boolean>
|
|
23
|
-
>
|
|
33
|
+
}
|
|
24
34
|
}
|
|
25
35
|
|
|
36
|
+
export type ConnectMutationOptions<config extends Config> = MutationOptions<
|
|
37
|
+
ConnectData<config, config['connectors'][number], boolean>,
|
|
38
|
+
ConnectErrorType,
|
|
39
|
+
ConnectVariables<config, config['connectors'][number], boolean>
|
|
40
|
+
>
|
|
41
|
+
|
|
26
42
|
export type ConnectData<
|
|
27
43
|
config extends Config,
|
|
28
44
|
connector extends Connector | CreateConnectorFn,
|