@cometh/connect-react-hooks 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.cjs +38 -4
- package/dist/index.d.cts +116 -1628
- package/dist/index.d.ts +116 -1628
- package/dist/index.js +37 -3
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
@@ -1875,7 +1875,7 @@ var useCreateNewSigner = (apiKey, baseUrl) => {
|
|
1875
1875
|
(params = {}) => {
|
1876
1876
|
setIsPending(true);
|
1877
1877
|
setError(null);
|
1878
|
-
_connectsdk4337.createNewSigner.call(void 0, apiKey, baseUrl, params).then((signer) => {
|
1878
|
+
_connectsdk4337.createNewSigner.call(void 0, { apiKey, baseUrl, params }).then((signer) => {
|
1879
1879
|
_optionalChain([queryClient, 'optionalAccess', _65 => _65.invalidateQueries, 'call', _66 => _66({ queryKey: ["signer"] })]);
|
1880
1880
|
return signer;
|
1881
1881
|
}).catch((e) => {
|
@@ -1892,7 +1892,11 @@ var useCreateNewSigner = (apiKey, baseUrl) => {
|
|
1892
1892
|
setIsPending(true);
|
1893
1893
|
setError(null);
|
1894
1894
|
try {
|
1895
|
-
const signer = await _connectsdk4337.createNewSigner.call(void 0,
|
1895
|
+
const signer = await _connectsdk4337.createNewSigner.call(void 0, {
|
1896
|
+
apiKey,
|
1897
|
+
baseUrl,
|
1898
|
+
params
|
1899
|
+
});
|
1896
1900
|
_optionalChain([queryClient, 'optionalAccess', _67 => _67.invalidateQueries, 'call', _68 => _68({ queryKey: ["signer"] })]);
|
1897
1901
|
return signer;
|
1898
1902
|
} catch (e) {
|
@@ -1903,7 +1907,7 @@ var useCreateNewSigner = (apiKey, baseUrl) => {
|
|
1903
1907
|
setIsPending(false);
|
1904
1908
|
}
|
1905
1909
|
},
|
1906
|
-
[apiKey,
|
1910
|
+
[apiKey, queryClient]
|
1907
1911
|
);
|
1908
1912
|
return {
|
1909
1913
|
createSigner,
|
@@ -2108,6 +2112,36 @@ function useGetRecoveryRequest(props = {}, queryOptions) {
|
|
2108
2112
|
};
|
2109
2113
|
}
|
2110
2114
|
|
2115
|
+
// src/hooks/recovery/useCancelRecoveryRequest.ts
|
2116
|
+
function useCancelRecoveryRequest() {
|
2117
|
+
const { smartAccountClient, queryClient } = useSmartAccount();
|
2118
|
+
const { mutate, mutateAsync, ...result } = useMutation(
|
2119
|
+
{
|
2120
|
+
mutationFn: async (variables) => {
|
2121
|
+
if (!smartAccountClient) {
|
2122
|
+
throw new Error("No smart account found");
|
2123
|
+
}
|
2124
|
+
return smartAccountClient.cancelRecoveryRequest({
|
2125
|
+
rpcUrl: variables.rpcUrl,
|
2126
|
+
// biome-ignore lint/suspicious/noExplicitAny: TODO: remove any
|
2127
|
+
middleware: variables.middleware
|
2128
|
+
});
|
2129
|
+
}
|
2130
|
+
},
|
2131
|
+
queryClient
|
2132
|
+
);
|
2133
|
+
return {
|
2134
|
+
cancelRecoveryRequest: mutate,
|
2135
|
+
cancelRecoveryRequestAsync: mutateAsync,
|
2136
|
+
isPending: result.isPending,
|
2137
|
+
isError: result.isError,
|
2138
|
+
error: result.error,
|
2139
|
+
isSuccess: result.isSuccess,
|
2140
|
+
data: result.data
|
2141
|
+
};
|
2142
|
+
}
|
2143
|
+
|
2144
|
+
|
2111
2145
|
|
2112
2146
|
|
2113
2147
|
|
@@ -2138,4 +2172,4 @@ function useGetRecoveryRequest(props = {}, queryOptions) {
|
|
2138
2172
|
|
2139
2173
|
|
2140
2174
|
|
2141
|
-
exports.ConnectProvider = ConnectProvider; exports.useAccount = useAccount; exports.useAddOwner = useAddOwner; exports.useAddSessionKey = useAddSessionKey; exports.useAddWhitelistDestination = useAddWhitelistDestination; exports.useConnect = useConnect; exports.useCreateNewSigner = useCreateNewSigner; exports.useDisconnect = useDisconnect; exports.useGenerateQRCodeUrl = useGenerateQRCodeUrl; exports.useGetEnrichedOwners = useGetEnrichedOwners; exports.useGetGasPrice = useGetGasPrice; exports.useGetOwners = useGetOwners; exports.useGetRecoveryRequest = useGetRecoveryRequest; exports.useGetSessionFromAddress = useGetSessionFromAddress; exports.useIsAddressWhitelistDestination = useIsAddressWhitelistDestination; exports.useIsRecoveryActive = useIsRecoveryActive; exports.useRemoveOwner = useRemoveOwner; exports.useRemoveWhitelistDestination = useRemoveWhitelistDestination; exports.useRetrieveAccountAddressFromPasskeyId = useRetrieveAccountAddressFromPasskeyId; exports.useRetrieveAccountAddressFromPasskeys = useRetrieveAccountAddressFromPasskeys; exports.useRevokeSessionKey = useRevokeSessionKey; exports.useSendTransaction = useSendTransaction; exports.useSendTransactionWithSessionKey = useSendTransactionWithSessionKey; exports.useSerializeUrlWithSignerPayload = useSerializeUrlWithSignerPayload; exports.useSetUpRecovery = useSetUpRecovery; exports.useSignMessage = useSignMessage; exports.useValidateAddDevice = useValidateAddDevice; exports.useVerifyMessage = useVerifyMessage; exports.useWriteContract = useWriteContract; exports.useWriteContractWithSessionKey = useWriteContractWithSessionKey;
|
2175
|
+
exports.ConnectProvider = ConnectProvider; exports.useAccount = useAccount; exports.useAddOwner = useAddOwner; exports.useAddSessionKey = useAddSessionKey; exports.useAddWhitelistDestination = useAddWhitelistDestination; exports.useCancelRecoveryRequest = useCancelRecoveryRequest; exports.useConnect = useConnect; exports.useCreateNewSigner = useCreateNewSigner; exports.useDisconnect = useDisconnect; exports.useGenerateQRCodeUrl = useGenerateQRCodeUrl; exports.useGetEnrichedOwners = useGetEnrichedOwners; exports.useGetGasPrice = useGetGasPrice; exports.useGetOwners = useGetOwners; exports.useGetRecoveryRequest = useGetRecoveryRequest; exports.useGetSessionFromAddress = useGetSessionFromAddress; exports.useIsAddressWhitelistDestination = useIsAddressWhitelistDestination; exports.useIsRecoveryActive = useIsRecoveryActive; exports.useRemoveOwner = useRemoveOwner; exports.useRemoveWhitelistDestination = useRemoveWhitelistDestination; exports.useRetrieveAccountAddressFromPasskeyId = useRetrieveAccountAddressFromPasskeyId; exports.useRetrieveAccountAddressFromPasskeys = useRetrieveAccountAddressFromPasskeys; exports.useRevokeSessionKey = useRevokeSessionKey; exports.useSendTransaction = useSendTransaction; exports.useSendTransactionWithSessionKey = useSendTransactionWithSessionKey; exports.useSerializeUrlWithSignerPayload = useSerializeUrlWithSignerPayload; exports.useSetUpRecovery = useSetUpRecovery; exports.useSignMessage = useSignMessage; exports.useValidateAddDevice = useValidateAddDevice; exports.useVerifyMessage = useVerifyMessage; exports.useWriteContract = useWriteContract; exports.useWriteContractWithSessionKey = useWriteContractWithSessionKey;
|