@cometh/connect-react-hooks 0.0.12-dev.3 → 0.1.0-dev.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/index.cjs +227 -335
- package/dist/index.d.cts +28 -211
- package/dist/index.d.ts +28 -211
- package/dist/index.js +216 -324
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
import { Address, Transport, Chain, Hash, Hex, Abi, ContractFunctionName, ContractFunctionArgs, Account, DeriveChain, ContractFunctionParameters, GetChainParameter, GetValue, FormattedTransactionRequest, UnionOmit, SignableMessage } from 'viem';
|
2
|
-
import { createSafeSmartAccountParameters, ComethSmartAccountClient,
|
3
|
-
import {
|
2
|
+
import { createSafeSmartAccountParameters, ComethSmartAccountClient, ComethSafeSmartAccount, EnrichedOwner, Signer, webAuthnOptions, QRCodeOptions, SetUpRecoveryModuleParams, IsRecoveryActiveParams, IsRecoveryActiveReturnType, RecoveryParamsResponse, GetRecoveryRequestParams, CancelRecoveryRequestParams } from '@cometh/connect-sdk-4337';
|
3
|
+
import { z, A, O, aO, a8, az, b } from './hydration-ClXcjjG9.js';
|
4
4
|
import React, { ReactNode } from 'react';
|
5
|
-
import { ENTRYPOINT_ADDRESS_V07_TYPE, EntryPoint } from 'permissionless/types/entrypoint';
|
6
5
|
import { GetAccountParameter } from 'viem/_types/types/account';
|
7
6
|
import { Prettify } from 'viem/chains';
|
8
7
|
import { UnionEvaluate } from 'viem/types/utils';
|
9
8
|
import { UseQueryParameters } from 'wagmi/query';
|
9
|
+
import { EstimateUserOperationGasParameters, EstimateUserOperationGasReturnType } from 'viem/account-abstraction';
|
10
10
|
|
11
11
|
type ConnectParameters = {
|
12
12
|
address?: Address;
|
@@ -19,13 +19,13 @@ declare const useConnect: () => {
|
|
19
19
|
error: Error | null;
|
20
20
|
};
|
21
21
|
|
22
|
-
interface UseBaseQueryOptions<TQueryFnData = unknown, TError =
|
22
|
+
interface UseBaseQueryOptions<TQueryFnData = unknown, TError = z, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends A = A> extends a8<TQueryFnData, TError, TData, TQueryData, TQueryKey> {
|
23
23
|
}
|
24
|
-
interface UseQueryOptions<TQueryFnData = unknown, TError =
|
24
|
+
interface UseQueryOptions<TQueryFnData = unknown, TError = z, TData = TQueryFnData, TQueryKey extends A = A> extends O<UseBaseQueryOptions<TQueryFnData, TError, TData, TQueryFnData, TQueryKey>, 'suspense'> {
|
25
25
|
}
|
26
|
-
type UseBaseQueryResult<TData = unknown, TError =
|
27
|
-
type UseQueryResult<TData = unknown, TError =
|
28
|
-
interface UseMutationOptions<TData = unknown, TError =
|
26
|
+
type UseBaseQueryResult<TData = unknown, TError = z> = az<TData, TError>;
|
27
|
+
type UseQueryResult<TData = unknown, TError = z> = UseBaseQueryResult<TData, TError>;
|
28
|
+
interface UseMutationOptions<TData = unknown, TError = z, TVariables = void, TContext = unknown> extends O<aO<TData, TError, TVariables, TContext>, '_defaulted'> {
|
29
29
|
}
|
30
30
|
|
31
31
|
type NetworkParams = {
|
@@ -37,8 +37,8 @@ type NetworkParams = {
|
|
37
37
|
type OmitConfig<T> = Omit<T, "chain" | "paymasterUrl" | "bundlerUrl" | "rpcUrl"> & {
|
38
38
|
networksConfig: NetworkParams[];
|
39
39
|
};
|
40
|
-
type ConnectConfig = OmitConfig<createSafeSmartAccountParameters
|
41
|
-
type ContextComethSmartAccountClient = ComethSmartAccountClient<
|
40
|
+
type ConnectConfig = OmitConfig<createSafeSmartAccountParameters>;
|
41
|
+
type ContextComethSmartAccountClient = ComethSmartAccountClient<Transport, Chain, ComethSafeSmartAccount>;
|
42
42
|
declare const ConnectProvider: <TConfig extends ConnectConfig, TQueryClient extends b | undefined>({ children, config, queryClient, }: {
|
43
43
|
children: ReactNode;
|
44
44
|
config: TConfig;
|
@@ -76,7 +76,7 @@ type QueryResultType = {
|
|
76
76
|
* @property {Transaction | Transaction[]} transactions - A single transaction or an array of transactions to send.
|
77
77
|
*/
|
78
78
|
type UseSendTransactionProps = {
|
79
|
-
|
79
|
+
calls: Transaction | Transaction[];
|
80
80
|
};
|
81
81
|
/**
|
82
82
|
* Type for the sendTransaction function.
|
@@ -114,11 +114,9 @@ type UseSendTransactionReturn = QueryResultType & {
|
|
114
114
|
* const handleSendTransaction = () => {
|
115
115
|
* if (recipient) {
|
116
116
|
* sendTransaction({
|
117
|
-
* transactions: {
|
118
117
|
* to: recipient,
|
119
118
|
* value: parseEther(amount),
|
120
119
|
* data: "0x",
|
121
|
-
* }
|
122
120
|
* });
|
123
121
|
* }
|
124
122
|
* };
|
@@ -127,7 +125,7 @@ type UseSendTransactionReturn = QueryResultType & {
|
|
127
125
|
* if (recipient) {
|
128
126
|
* try {
|
129
127
|
* const hash = await sendTransactionAsync({
|
130
|
-
*
|
128
|
+
* calls: [
|
131
129
|
* {
|
132
130
|
* to: recipient,
|
133
131
|
* value: parseEther(amount),
|
@@ -260,126 +258,6 @@ type WriteContractParameters<abi extends Abi | readonly unknown[] = Abi, functio
|
|
260
258
|
}> & UnionEvaluate<UnionOmit<FormattedTransactionRequest<derivedChain>, "data" | "from" | "to" | "value">>;
|
261
259
|
declare const useWriteContract: (mutationProps?: MutationOptionsWithoutMutationFn) => UseWriteContractReturn;
|
262
260
|
|
263
|
-
/**
|
264
|
-
* Props for the useSendTransactionWithSessionKey hook.
|
265
|
-
* @property {Transaction | Transaction[]} transactions - A single transaction or an array of transactions to send using a session key.
|
266
|
-
*/
|
267
|
-
type UseSendTransactionWithSessionKeyProps = {
|
268
|
-
transactions: Transaction | Transaction[];
|
269
|
-
};
|
270
|
-
/**
|
271
|
-
* Type for the sendTransaction function.
|
272
|
-
* This function doesn't return a promise, suitable for fire-and-forget usage.
|
273
|
-
*/
|
274
|
-
type SendTransactionWithSessionKeyMutate = (variables: UseSendTransactionWithSessionKeyProps) => void;
|
275
|
-
/**
|
276
|
-
* Type for the sendTransactionAsync function.
|
277
|
-
* This function returns a promise that resolves to the transaction hash.
|
278
|
-
*/
|
279
|
-
type SendTransactionWithSessionKeyMutateAsync = (variables: UseSendTransactionWithSessionKeyProps) => Promise<Hash>;
|
280
|
-
type UseSendTransactionWithSessionKeyReturn = QueryResultType & {
|
281
|
-
sendTransaction: SendTransactionWithSessionKeyMutate;
|
282
|
-
sendTransactionAsync: SendTransactionWithSessionKeyMutateAsync;
|
283
|
-
};
|
284
|
-
/**
|
285
|
-
* A custom hook for sending transactions through a smart account using a session key.
|
286
|
-
*
|
287
|
-
* This hook provides functionality to send either a single transaction or multiple transactions
|
288
|
-
* in batch using a session key. It uses the smart account client to process and send these transactions.
|
289
|
-
*
|
290
|
-
* @param mutationProps Optional mutation properties from @tanstack/react-query
|
291
|
-
*
|
292
|
-
* @returns An object containing:
|
293
|
-
* - All properties from the mutation object (`isPending`, `isError`, `error`, `isSuccess`, `data`, etc.)
|
294
|
-
* - `sendTransaction`: A function to trigger the transaction sending with session key without waiting for the result.
|
295
|
-
* - `sendTransactionAsync`: A function to trigger the transaction sending with session key and wait for the result.
|
296
|
-
*
|
297
|
-
* @throws {Error} If no smart account is found when trying to send a transaction.
|
298
|
-
*/
|
299
|
-
declare const useSendTransactionWithSessionKey: (mutationProps?: MutationOptionsWithoutMutationFn) => UseSendTransactionWithSessionKeyReturn;
|
300
|
-
|
301
|
-
/**
|
302
|
-
* @description A custom hook for writing to smart contracts through a smart account using a session key.
|
303
|
-
*
|
304
|
-
* This hook provides functionality to write to a smart contract by encoding the function call
|
305
|
-
* and sending it as a transaction using a session key. It uses the smart account client to process and send these transactions.
|
306
|
-
*
|
307
|
-
* @param mutationProps Optional mutation properties from @tanstack/react-query
|
308
|
-
*
|
309
|
-
* @example
|
310
|
-
* ```tsx
|
311
|
-
* import { useWriteContractWithSessionKey } from "@/hooks/useWriteContractWithSessionKey";
|
312
|
-
* import { useState } from "react";
|
313
|
-
* import { parseEther, Address } from "viem";
|
314
|
-
* import { abi } from './contractABI';
|
315
|
-
*
|
316
|
-
* export const SessionKeyContractWriter = () => {
|
317
|
-
* const { writeContractWithSessionKey, isLoading, isError, error, isSuccess, data } = useWriteContractWithSessionKey();
|
318
|
-
* const [recipient, setRecipient] = useState<Address>();
|
319
|
-
* const [amount, setAmount] = useState<string>("0");
|
320
|
-
*
|
321
|
-
* const handleWriteContract = async () => {
|
322
|
-
* if (recipient) {
|
323
|
-
* try {
|
324
|
-
* const hash = await writeContractWithSessionKey({
|
325
|
-
* abi,
|
326
|
-
* address: '0xYourContractAddress',
|
327
|
-
* functionName: 'transfer',
|
328
|
-
* args: [recipient, parseEther(amount)],
|
329
|
-
* });
|
330
|
-
* console.log("Contract write successful with session key! Hash:", hash);
|
331
|
-
* } catch (error) {
|
332
|
-
* console.error("Error writing to contract with session key:", error);
|
333
|
-
* }
|
334
|
-
* }
|
335
|
-
* };
|
336
|
-
*
|
337
|
-
* return (
|
338
|
-
* <div>
|
339
|
-
* <input
|
340
|
-
* placeholder="Recipient address"
|
341
|
-
* onChange={(e) => setRecipient(e.target.value as Address)}
|
342
|
-
* />
|
343
|
-
* <input
|
344
|
-
* type="number"
|
345
|
-
* placeholder="Amount in ETH"
|
346
|
-
* onChange={(e) => setAmount(e.target.value)}
|
347
|
-
* />
|
348
|
-
* <button onClick={handleWriteContract} disabled={isLoading}>
|
349
|
-
* Write to Contract with Session Key
|
350
|
-
* </button>
|
351
|
-
* {isError && <p>Error: {error.message}</p>}
|
352
|
-
* {isSuccess && <p>Contract write successful! Hash: {data}</p>}
|
353
|
-
* </div>
|
354
|
-
* );
|
355
|
-
* };
|
356
|
-
* ```
|
357
|
-
*
|
358
|
-
* @returns An object containing:
|
359
|
-
* - All properties from the mutation object (`isLoading`, `isError`, `error`, `isSuccess`, `data`, etc.)
|
360
|
-
* - `writeContract`: A function to trigger the contract write with session key, which returns a promise
|
361
|
-
* that resolves to the transaction hash.
|
362
|
-
*/
|
363
|
-
/**
|
364
|
-
* Type for the writeContractWithSessionKey function.
|
365
|
-
* This function doesn't return a promise, suitable for fire-and-forget usage.
|
366
|
-
*/
|
367
|
-
type WriteContractWithSessionKeyMutate = (variables: WriteContractWithSessionKeyParameters) => void;
|
368
|
-
/**
|
369
|
-
* Type for the writeContractWithSessionKeyAsync function.
|
370
|
-
* This function returns a promise that resolves to the transaction hash.
|
371
|
-
*/
|
372
|
-
type WriteContractWithSessionKeyMutateAsync = (variables: WriteContractWithSessionKeyParameters) => Promise<Hash>;
|
373
|
-
type UseWriteContractWithSessionKeyReturn = QueryResultType & {
|
374
|
-
writeContractWithSessionKey: WriteContractWithSessionKeyMutate;
|
375
|
-
writeContractWithSessionKeyAsync: WriteContractWithSessionKeyMutateAsync;
|
376
|
-
};
|
377
|
-
type WriteContractWithSessionKeyParameters<abi extends Abi | readonly unknown[] = Abi, functionName extends ContractFunctionName<abi, "nonpayable" | "payable"> = ContractFunctionName<abi, "nonpayable" | "payable">, args extends ContractFunctionArgs<abi, "nonpayable" | "payable", functionName> = ContractFunctionArgs<abi, "nonpayable" | "payable", functionName>, chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined, chainOverride extends Chain | undefined = Chain | undefined, derivedChain extends Chain | undefined = DeriveChain<chain, chainOverride>> = ContractFunctionParameters<abi, "nonpayable" | "payable", functionName, args> & GetChainParameter<chain, chainOverride> & Prettify<GetAccountParameter<account> & GetValue<abi, functionName, FormattedTransactionRequest<derivedChain>["value"]> & {
|
378
|
-
/** Data to append to the end of the calldata. Useful for adding a ["domain" tag](https://opensea.notion.site/opensea/Seaport-Order-Attributions-ec2d69bf455041a5baa490941aad307f). */
|
379
|
-
dataSuffix?: Hex;
|
380
|
-
}> & UnionEvaluate<UnionOmit<FormattedTransactionRequest<derivedChain>, "data" | "from" | "to" | "value">>;
|
381
|
-
declare const useWriteContractWithSessionKey: (mutationProps?: MutationOptionsWithoutMutationFn) => UseWriteContractWithSessionKeyReturn;
|
382
|
-
|
383
261
|
declare const useDisconnect: () => {
|
384
262
|
disconnect: () => void;
|
385
263
|
disconnectAsync: () => Promise<void>;
|
@@ -430,41 +308,6 @@ declare const useGetOwners: (queryProps?: Omit<UseQueryOptions<readonly Address[
|
|
430
308
|
*/
|
431
309
|
declare const useGetEnrichedOwners: (queryProps?: Omit<UseQueryOptions<EnrichedOwner[], Error>, "queryKey" | "queryFn">) => UseQueryResult<EnrichedOwner[], Error>;
|
432
310
|
|
433
|
-
type AddSessionKeyParameters = AddSessionKeyParams;
|
434
|
-
type RevokeSessionKeyParameters = {
|
435
|
-
sessionKey: Address;
|
436
|
-
};
|
437
|
-
type AddWhitelistDestinationParameters = {
|
438
|
-
sessionKey: Address;
|
439
|
-
destination: Address;
|
440
|
-
};
|
441
|
-
type RemoveWhitelistDestinationParameters = {
|
442
|
-
sessionKey: Address;
|
443
|
-
destination: Address;
|
444
|
-
};
|
445
|
-
type UseAddSessionKeyReturn = QueryResultType & {
|
446
|
-
addSessionKey: (params: AddSessionKeyParameters) => void;
|
447
|
-
addSessionKeyAsync: (params: AddSessionKeyParameters) => Promise<Hash>;
|
448
|
-
};
|
449
|
-
type UseRevokeSessionKeyReturn = QueryResultType & {
|
450
|
-
revokeSessionKey: (params: RevokeSessionKeyParameters) => void;
|
451
|
-
revokeSessionKeyAsync: (params: RevokeSessionKeyParameters) => Promise<Hash>;
|
452
|
-
};
|
453
|
-
type UseAddWhitelistDestinationReturn = QueryResultType & {
|
454
|
-
addWhitelistDestination: (params: AddWhitelistDestinationParameters) => void;
|
455
|
-
addWhitelistDestinationAsync: (params: AddWhitelistDestinationParameters) => Promise<Hash>;
|
456
|
-
};
|
457
|
-
type UseRemoveWhitelistDestinationReturn = QueryResultType & {
|
458
|
-
removeWhitelistDestination: (params: RemoveWhitelistDestinationParameters) => void;
|
459
|
-
removeWhitelistDestinationAsync: (params: RemoveWhitelistDestinationParameters) => Promise<Hash>;
|
460
|
-
};
|
461
|
-
declare const useAddSessionKey: (mutationProps?: Omit<UseMutationOptions<Hash, Error, AddSessionKeyParameters>, "mutationFn">) => UseAddSessionKeyReturn;
|
462
|
-
declare const useRevokeSessionKey: (mutationProps?: Omit<UseMutationOptions<Hash, Error, RevokeSessionKeyParameters>, "mutationFn">) => UseRevokeSessionKeyReturn;
|
463
|
-
declare const useAddWhitelistDestination: (mutationProps?: Omit<UseMutationOptions<Hash, Error, AddWhitelistDestinationParameters>, "mutationFn">) => UseAddWhitelistDestinationReturn;
|
464
|
-
declare const useRemoveWhitelistDestination: (mutationProps?: Omit<UseMutationOptions<Hash, Error, RemoveWhitelistDestinationParameters>, "mutationFn">) => UseRemoveWhitelistDestinationReturn;
|
465
|
-
declare const useGetSessionFromAddress: (sessionKey: Address, queryProps?: Omit<UseQueryOptions<Session, Error>, "queryKey" | "queryFn">) => UseQueryResult<Session, Error>;
|
466
|
-
declare const useIsAddressWhitelistDestination: (sessionKey: Address, targetAddress: Address, queryProps?: Omit<UseQueryOptions<boolean, Error>, "queryKey" | "queryFn">) => UseQueryResult<boolean, Error>;
|
467
|
-
|
468
311
|
/**
|
469
312
|
* Props for the useValidateAddDevice hook.
|
470
313
|
* @property {Signer} signer - The signer to be added as a new device.
|
@@ -689,7 +532,7 @@ type UseSignMessageReturn = QueryResultType & {
|
|
689
532
|
};
|
690
533
|
declare function useSignMessage(): UseSignMessageReturn;
|
691
534
|
|
692
|
-
type UseSetUpRecoveryModuleProps = SetUpRecoveryModuleParams
|
535
|
+
type UseSetUpRecoveryModuleProps = SetUpRecoveryModuleParams;
|
693
536
|
type SetUpRecoveryModuleMutate = (variables: UseSetUpRecoveryModuleProps) => void;
|
694
537
|
type SetUpRecoveryModuleMutateAsync = (variables: UseSetUpRecoveryModuleProps) => Promise<Hex>;
|
695
538
|
type UseSetUpRecoveryModuleReturn = QueryResultType & {
|
@@ -724,7 +567,7 @@ type UseSetUpRecoveryModuleReturn = QueryResultType & {
|
|
724
567
|
* try {
|
725
568
|
* const result = await setUpRecoveryModuleAsync({
|
726
569
|
* passKeyName: 'myPassKey',
|
727
|
-
*
|
570
|
+
* publicClient,
|
728
571
|
* // other necessary parameters
|
729
572
|
* });
|
730
573
|
* console.log('Recovery module set up successfully:', result);
|
@@ -771,7 +614,7 @@ type UseIsRecoveryActiveReturn = {
|
|
771
614
|
* and retrieve the guardian address for the smart account's recovery setup.
|
772
615
|
*
|
773
616
|
* @param {UseIsRecoveryActiveProps} props - The properties for the hook.
|
774
|
-
* @param {string} [props.
|
617
|
+
* @param {string} [props.publicClient] - Optional client for the blockchain network.
|
775
618
|
*
|
776
619
|
* @example
|
777
620
|
* ```tsx
|
@@ -779,7 +622,7 @@ type UseIsRecoveryActiveReturn = {
|
|
779
622
|
*
|
780
623
|
* export const RecoveryStatus = () => {
|
781
624
|
* const { data, isLoading, isError, error } = useIsRecoveryActive({
|
782
|
-
*
|
625
|
+
* publicClient,
|
783
626
|
* });
|
784
627
|
*
|
785
628
|
* if (isLoading) return <p>Loading recovery status...</p>;
|
@@ -816,7 +659,7 @@ type UseGetRecoveryRequestReturn = {
|
|
816
659
|
* and retrieve the details of the recovery request if one exists.
|
817
660
|
*
|
818
661
|
* @param {UseGetRecoveryRequestProps} props - The properties for the hook.
|
819
|
-
* @param {string} [props.
|
662
|
+
* @param {string} [props.publicClient] - Optional client for the blockchain network.
|
820
663
|
* @param {UseQueryOptions} [queryOptions] - Optional configuration for the React Query hook.
|
821
664
|
*
|
822
665
|
* @example
|
@@ -825,7 +668,7 @@ type UseGetRecoveryRequestReturn = {
|
|
825
668
|
*
|
826
669
|
* export const RecoveryRequestStatus = () => {
|
827
670
|
* const { data, isLoading, isError, error } = useGetRecoveryRequest({
|
828
|
-
*
|
671
|
+
* publicClient
|
829
672
|
* });
|
830
673
|
*
|
831
674
|
* if (isLoading) return <p>Loading recovery request status...</p>;
|
@@ -856,9 +699,9 @@ type UseGetRecoveryRequestReturn = {
|
|
856
699
|
*/
|
857
700
|
declare function useGetRecoveryRequest(props?: UseGetRecoveryRequestProps, queryOptions?: Omit<UseQueryOptions<RecoveryParamsResponse | undefined, Error>, "queryKey" | "queryFn">): UseGetRecoveryRequestReturn;
|
858
701
|
|
859
|
-
type UseCancelRecoveryRequestProps
|
860
|
-
type CancelRecoveryRequestMutate = (variables: UseCancelRecoveryRequestProps
|
861
|
-
type CancelRecoveryRequestMutateAsync = (variables: UseCancelRecoveryRequestProps
|
702
|
+
type UseCancelRecoveryRequestProps = CancelRecoveryRequestParams;
|
703
|
+
type CancelRecoveryRequestMutate = (variables: UseCancelRecoveryRequestProps) => void;
|
704
|
+
type CancelRecoveryRequestMutateAsync = (variables: UseCancelRecoveryRequestProps) => Promise<Hex>;
|
862
705
|
type UseCancelRecoveryRequestReturn = QueryResultType & {
|
863
706
|
cancelRecoveryRequest: CancelRecoveryRequestMutate;
|
864
707
|
cancelRecoveryRequestAsync: CancelRecoveryRequestMutateAsync;
|
@@ -890,7 +733,7 @@ type UseCancelRecoveryRequestReturn = QueryResultType & {
|
|
890
733
|
* const handleCancel = async () => {
|
891
734
|
* try {
|
892
735
|
* const result = await cancelRecoveryRequestAsync({
|
893
|
-
*
|
736
|
+
* publicClient,
|
894
737
|
* // other necessary parameters
|
895
738
|
* });
|
896
739
|
* console.log('Recovery request canceled successfully:', result);
|
@@ -934,23 +777,16 @@ declare const useSwitchChain: () => {
|
|
934
777
|
error: Error | null;
|
935
778
|
};
|
936
779
|
|
937
|
-
/**
|
938
|
-
* Props for the useGetTransactionCost hook.
|
939
|
-
* @property {Transaction | Transaction[]} transactions - A single transaction or an array of transactions to get cost for.
|
940
|
-
*/
|
941
|
-
type UseGetTransactionCostProps = {
|
942
|
-
transactions: Transaction | Transaction[];
|
943
|
-
};
|
944
780
|
/**
|
945
781
|
* Type for the getTransactionCost function.
|
946
782
|
* This function doesn't return a promise, suitable for fire-and-forget usage.
|
947
783
|
*/
|
948
|
-
type UseGetTransactionCostMutate = (variables:
|
784
|
+
type UseGetTransactionCostMutate = (variables: EstimateUserOperationGasParameters) => void;
|
949
785
|
/**
|
950
786
|
* Type for the getTransactionCostAsync function.
|
951
787
|
* This function returns a promise that resolves to the transaction cost in wei.
|
952
788
|
*/
|
953
|
-
type UseGetTransactionCostMutateAsync = (variables:
|
789
|
+
type UseGetTransactionCostMutateAsync = (variables: EstimateUserOperationGasParameters) => Promise<{
|
954
790
|
totalGasCost: bigint;
|
955
791
|
}>;
|
956
792
|
type UseGetTransactionCostReturn = {
|
@@ -1034,37 +870,18 @@ type UseGetTransactionCostReturn = {
|
|
1034
870
|
*/
|
1035
871
|
declare const useGetTransactionCost: (mutationProps?: MutationOptionsWithoutMutationFn) => UseGetTransactionCostReturn;
|
1036
872
|
|
1037
|
-
/**
|
1038
|
-
* Props for the useEstimateGas hook.
|
1039
|
-
* @property {Transaction | Transaction[]} transactions - A single transaction or an array of transactions to estimate gas for.
|
1040
|
-
*/
|
1041
|
-
type UseEstimateGasProps = {
|
1042
|
-
transactions: Transaction | Transaction[];
|
1043
|
-
};
|
1044
|
-
/**
|
1045
|
-
* Gas estimation result type
|
1046
|
-
*/
|
1047
|
-
type GasEstimationResult = {
|
1048
|
-
callGasLimit: bigint;
|
1049
|
-
verificationGasLimit: bigint;
|
1050
|
-
preVerificationGas: bigint;
|
1051
|
-
maxFeePerGas: bigint;
|
1052
|
-
maxPriorityFeePerGas: bigint;
|
1053
|
-
paymasterVerificationGasLimit?: bigint;
|
1054
|
-
paymasterPostOpGasLimit?: bigint;
|
1055
|
-
};
|
1056
873
|
/**
|
1057
874
|
* Type for the estimateGas function.
|
1058
875
|
* This function doesn't return a promise, suitable for fire-and-forget usage.
|
1059
876
|
*/
|
1060
|
-
type EstimateGasMutate = (variables:
|
877
|
+
type EstimateGasMutate = (variables: EstimateUserOperationGasParameters) => void;
|
1061
878
|
/**
|
1062
879
|
* Type for the estimateGasAsync function.
|
1063
880
|
* This function returns a promise that resolves to the detailed gas estimation.
|
1064
881
|
*/
|
1065
|
-
type EstimateGasMutateAsync = (variables:
|
882
|
+
type EstimateGasMutateAsync = (variables: EstimateUserOperationGasParameters) => Promise<EstimateUserOperationGasReturnType>;
|
1066
883
|
type UseEstimateGasReturn = {
|
1067
|
-
data?:
|
884
|
+
data?: EstimateUserOperationGasReturnType;
|
1068
885
|
error: unknown;
|
1069
886
|
isPending: boolean;
|
1070
887
|
isSuccess: boolean;
|
@@ -1156,4 +973,4 @@ type UseEstimateGasReturn = {
|
|
1156
973
|
*/
|
1157
974
|
declare const useEstimateGas: (mutationProps?: MutationOptionsWithoutMutationFn) => UseEstimateGasReturn;
|
1158
975
|
|
1159
|
-
export { ConnectProvider, type SendTransactionMutate, type SendTransactionMutateAsync, type
|
976
|
+
export { ConnectProvider, type SendTransactionMutate, type SendTransactionMutateAsync, type UseAddOwnerReturn, type UseRemoveOwnerReturn, type UseRetrieveAccountAddressFromPasskeyOptions, type VerifyMessageMutate, type VerifyMessageMutateAsync, type WriteContractMutate, type WriteContractMutateAsync, useAccount, useAddOwner, useCancelRecoveryRequest, useConnect, useCreateNewSigner, useDisconnect, useEstimateGas, useGenerateQRCodeUrl, useGetEnrichedOwners, useGetGasPrice, useGetOwners, useGetRecoveryRequest, useGetTransactionCost, useIsRecoveryActive, useRemoveOwner, useRetrieveAccountAddressFromPasskeyId, useRetrieveAccountAddressFromPasskeys, useSendTransaction, useSerializeUrlWithSignerPayload, useSetUpRecovery, useSignMessage, useSwitchChain, useValidateAddDevice, useVerifyMessage, useWriteContract };
|