@getpara/react-core 2.19.0

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.
Files changed (143) hide show
  1. package/dist/index.d.ts +37 -0
  2. package/dist/index.js +73 -0
  3. package/dist/mutations.d.ts +29 -0
  4. package/dist/mutations.js +60 -0
  5. package/dist/package.json +4 -0
  6. package/dist/provider/ParaProviderCore.d.ts +85 -0
  7. package/dist/provider/ParaProviderCore.js +124 -0
  8. package/dist/provider/actions/getEmbeddedAccount.d.ts +28 -0
  9. package/dist/provider/actions/getEmbeddedAccount.js +82 -0
  10. package/dist/provider/actions/getWallet.js +34 -0
  11. package/dist/provider/actions/index.d.ts +38 -0
  12. package/dist/provider/actions/index.js +75 -0
  13. package/dist/provider/actions/utils.d.ts +4 -0
  14. package/dist/provider/actions/utils.js +32 -0
  15. package/dist/provider/hooks/aa/alchemy.d.ts +22 -0
  16. package/dist/provider/hooks/aa/alchemy.js +47 -0
  17. package/dist/provider/hooks/aa/biconomy.d.ts +22 -0
  18. package/dist/provider/hooks/aa/biconomy.js +47 -0
  19. package/dist/provider/hooks/aa/cdp.d.ts +21 -0
  20. package/dist/provider/hooks/aa/cdp.js +47 -0
  21. package/dist/provider/hooks/aa/createSmartAccountHook.d.ts +18 -0
  22. package/dist/provider/hooks/aa/createSmartAccountHook.js +96 -0
  23. package/dist/provider/hooks/aa/gelato.d.ts +21 -0
  24. package/dist/provider/hooks/aa/gelato.js +47 -0
  25. package/dist/provider/hooks/aa/index.d.ts +12 -0
  26. package/dist/provider/hooks/aa/index.js +48 -0
  27. package/dist/provider/hooks/aa/pimlico.d.ts +22 -0
  28. package/dist/provider/hooks/aa/pimlico.js +47 -0
  29. package/dist/provider/hooks/aa/porto.d.ts +22 -0
  30. package/dist/provider/hooks/aa/porto.js +47 -0
  31. package/dist/provider/hooks/aa/rhinestone.d.ts +22 -0
  32. package/dist/provider/hooks/aa/rhinestone.js +47 -0
  33. package/dist/provider/hooks/aa/safe.d.ts +22 -0
  34. package/dist/provider/hooks/aa/safe.js +47 -0
  35. package/dist/provider/hooks/aa/thirdweb.d.ts +18 -0
  36. package/dist/provider/hooks/aa/thirdweb.js +47 -0
  37. package/dist/provider/hooks/aa/types.d.ts +34 -0
  38. package/dist/provider/hooks/aa/types.js +0 -0
  39. package/dist/provider/hooks/aa/zerodev.d.ts +22 -0
  40. package/dist/provider/hooks/aa/zerodev.js +47 -0
  41. package/dist/provider/hooks/index.d.ts +4 -0
  42. package/dist/provider/hooks/index.js +4 -0
  43. package/dist/provider/hooks/mutations/index.d.ts +30 -0
  44. package/dist/provider/hooks/mutations/index.js +92 -0
  45. package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.d.ts +34 -0
  46. package/dist/provider/hooks/mutations/useAuthenticateWithEmailOrPhone.js +39 -0
  47. package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.d.ts +34 -0
  48. package/dist/provider/hooks/mutations/useAuthenticateWithOAuth.js +39 -0
  49. package/dist/provider/hooks/mutations/useClaimPregenWallets.d.ts +34 -0
  50. package/dist/provider/hooks/mutations/useClaimPregenWallets.js +42 -0
  51. package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +34 -0
  52. package/dist/provider/hooks/mutations/useCreateGuestWallets.js +42 -0
  53. package/dist/provider/hooks/mutations/useCreatePregenWallet.d.ts +34 -0
  54. package/dist/provider/hooks/mutations/useCreatePregenWallet.js +42 -0
  55. package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.d.ts +34 -0
  56. package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.js +39 -0
  57. package/dist/provider/hooks/mutations/useCreateWallet.d.ts +34 -0
  58. package/dist/provider/hooks/mutations/useCreateWallet.js +42 -0
  59. package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +34 -0
  60. package/dist/provider/hooks/mutations/useCreateWalletPerType.js +39 -0
  61. package/dist/provider/hooks/mutations/useEnable2fa.d.ts +34 -0
  62. package/dist/provider/hooks/mutations/useEnable2fa.js +39 -0
  63. package/dist/provider/hooks/mutations/useExportPrivateKey.d.ts +39 -0
  64. package/dist/provider/hooks/mutations/useExportPrivateKey.js +63 -0
  65. package/dist/provider/hooks/mutations/useHasPregenWallet.d.ts +34 -0
  66. package/dist/provider/hooks/mutations/useHasPregenWallet.js +39 -0
  67. package/dist/provider/hooks/mutations/useIssueJwt.d.ts +34 -0
  68. package/dist/provider/hooks/mutations/useIssueJwt.js +39 -0
  69. package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +33 -0
  70. package/dist/provider/hooks/mutations/useKeepSessionAlive.js +39 -0
  71. package/dist/provider/hooks/mutations/useLoginExternalWallet.d.ts +34 -0
  72. package/dist/provider/hooks/mutations/useLoginExternalWallet.js +42 -0
  73. package/dist/provider/hooks/mutations/useLogout.d.ts +34 -0
  74. package/dist/provider/hooks/mutations/useLogout.js +39 -0
  75. package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +34 -0
  76. package/dist/provider/hooks/mutations/useResendVerificationCode.js +42 -0
  77. package/dist/provider/hooks/mutations/useSetup2fa.d.ts +34 -0
  78. package/dist/provider/hooks/mutations/useSetup2fa.js +39 -0
  79. package/dist/provider/hooks/mutations/useSignMessage.d.ts +34 -0
  80. package/dist/provider/hooks/mutations/useSignMessage.js +39 -0
  81. package/dist/provider/hooks/mutations/useSignTransaction.d.ts +34 -0
  82. package/dist/provider/hooks/mutations/useSignTransaction.js +42 -0
  83. package/dist/provider/hooks/mutations/useSignUpOrLogIn.d.ts +34 -0
  84. package/dist/provider/hooks/mutations/useSignUpOrLogIn.js +42 -0
  85. package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.d.ts +34 -0
  86. package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.js +42 -0
  87. package/dist/provider/hooks/mutations/useVerify2fa.d.ts +34 -0
  88. package/dist/provider/hooks/mutations/useVerify2fa.js +39 -0
  89. package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +34 -0
  90. package/dist/provider/hooks/mutations/useVerifyExternalWallet.js +42 -0
  91. package/dist/provider/hooks/mutations/useVerifyFarcaster.js +43 -0
  92. package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +34 -0
  93. package/dist/provider/hooks/mutations/useVerifyNewAccount.js +42 -0
  94. package/dist/provider/hooks/mutations/useVerifyOAuth.js +40 -0
  95. package/dist/provider/hooks/mutations/useVerifyTelegram.js +40 -0
  96. package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +34 -0
  97. package/dist/provider/hooks/mutations/useWaitForLogin.js +42 -0
  98. package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +34 -0
  99. package/dist/provider/hooks/mutations/useWaitForSignup.js +39 -0
  100. package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +34 -0
  101. package/dist/provider/hooks/mutations/useWaitForWalletCreation.js +39 -0
  102. package/dist/provider/hooks/queries/createAccountHook.d.ts +49 -0
  103. package/dist/provider/hooks/queries/createAccountHook.js +132 -0
  104. package/dist/provider/hooks/queries/index.d.ts +5 -0
  105. package/dist/provider/hooks/queries/index.js +20 -0
  106. package/dist/provider/hooks/queries/useAccount.d.ts +65 -0
  107. package/dist/provider/hooks/queries/useAccount.js +65 -0
  108. package/dist/provider/hooks/queries/useIsFullyLoggedIn.d.ts +7 -0
  109. package/dist/provider/hooks/queries/useIsFullyLoggedIn.js +49 -0
  110. package/dist/provider/hooks/queries/useParaStatus.d.ts +15 -0
  111. package/dist/provider/hooks/queries/useParaStatus.js +32 -0
  112. package/dist/provider/hooks/queries/useWallet.js +43 -0
  113. package/dist/provider/hooks/utils/index.d.ts +2 -0
  114. package/dist/provider/hooks/utils/index.js +6 -0
  115. package/dist/provider/hooks/utils/useClient.d.ts +7 -0
  116. package/dist/provider/hooks/utils/useClient.js +8 -0
  117. package/dist/provider/hooks/utils/useCoreWalletState.d.ts +17 -0
  118. package/dist/provider/hooks/utils/useCoreWalletState.js +47 -0
  119. package/dist/provider/index.d.ts +5 -0
  120. package/dist/provider/index.js +11 -0
  121. package/dist/provider/stores/CoreStoreContext.d.ts +13 -0
  122. package/dist/provider/stores/CoreStoreContext.js +14 -0
  123. package/dist/provider/stores/createCoreStore.d.ts +26 -0
  124. package/dist/provider/stores/createCoreStore.js +61 -0
  125. package/dist/provider/stores/index.d.ts +4 -0
  126. package/dist/provider/stores/index.js +9 -0
  127. package/dist/provider/stores/slices/client.d.ts +3 -0
  128. package/dist/provider/stores/slices/client.js +7 -0
  129. package/dist/provider/stores/slices/config.d.ts +3 -0
  130. package/dist/provider/stores/slices/config.js +9 -0
  131. package/dist/provider/stores/slices/index.d.ts +4 -0
  132. package/dist/provider/stores/slices/index.js +10 -0
  133. package/dist/provider/stores/slices/paraState.d.ts +3 -0
  134. package/dist/provider/stores/slices/paraState.js +7 -0
  135. package/dist/provider/stores/slices/wallet.d.ts +3 -0
  136. package/dist/provider/stores/slices/wallet.js +11 -0
  137. package/dist/provider/stores/types.d.ts +28 -0
  138. package/dist/provider/stores/types.js +0 -0
  139. package/dist/provider/utils/renameMutations.d.ts +11 -0
  140. package/dist/provider/utils/renameMutations.js +39 -0
  141. package/dist/queries.d.ts +2 -0
  142. package/dist/queries.js +6 -0
  143. package/package.json +73 -0
@@ -0,0 +1,34 @@
1
+ import type { HasPregenWalletParams } from '@getpara/core-sdk';
2
+ export declare const HAS_PREGEN_WALLET_KEY = "HAS_PREGEN_WALLET";
3
+ /**
4
+ * React hook for the `hasPregenWallet` mutation.
5
+ *
6
+ * Returns a mutation result object with all standard fields from `useMutation`, except:
7
+ * - `mutate` and `mutateAsync` are replaced by:
8
+ * - `hasPregenWallet`: function to trigger the mutation (same as `mutate`)
9
+ * - `hasPregenWalletAsync`: async function to trigger the mutation (same as `mutateAsync`)
10
+ *
11
+ * @example
12
+ * const { hasPregenWallet, hasPregenWalletAsync } = useHasPregenWallet();
13
+ * hasPregenWallet({ ...params });
14
+ * // or
15
+ * await hasPregenWalletAsync({ ...params });
16
+ */
17
+ export declare const useHasPregenWallet: () => {
18
+ error: Error;
19
+ isSuccess: boolean;
20
+ data: boolean;
21
+ variables: HasPregenWalletParams;
22
+ isError: boolean;
23
+ isIdle: boolean;
24
+ isPending: boolean;
25
+ status: "error" | "idle" | "pending" | "success";
26
+ reset: () => void;
27
+ context: unknown;
28
+ failureCount: number;
29
+ failureReason: Error;
30
+ isPaused: boolean;
31
+ submittedAt: number;
32
+ hasPregenWallet: import("@tanstack/react-query").UseMutateFunction<boolean, Error, HasPregenWalletParams, unknown>;
33
+ hasPregenWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<boolean, Error, HasPregenWalletParams, unknown>;
34
+ };
@@ -0,0 +1,39 @@
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+ import { useMutation } from "@tanstack/react-query";
22
+ import { useClient } from "../utils/index.js";
23
+ import { renameMutations } from "../../utils/renameMutations.js";
24
+ import { hasPregenWallet } from "../../actions/index.js";
25
+ const HAS_PREGEN_WALLET_KEY = "HAS_PREGEN_WALLET";
26
+ const useHasPregenWallet = () => {
27
+ const para = useClient();
28
+ const mutation = useMutation({
29
+ mutationKey: [HAS_PREGEN_WALLET_KEY],
30
+ mutationFn: (args) => __async(void 0, null, function* () {
31
+ return hasPregenWallet(para, args);
32
+ })
33
+ });
34
+ return renameMutations(mutation, "hasPregenWallet");
35
+ };
36
+ export {
37
+ HAS_PREGEN_WALLET_KEY,
38
+ useHasPregenWallet
39
+ };
@@ -0,0 +1,34 @@
1
+ import type { IssueJwtParams, IssueJwtResponse } from '@getpara/core-sdk';
2
+ export declare const ISSUE_JWT_KEY = "ISSUE_JWT";
3
+ /**
4
+ * React hook for the `issueJwt` mutation.
5
+ *
6
+ * Returns a mutation result object with all standard fields from `useMutation`, except:
7
+ * - `mutate` and `mutateAsync` are replaced by:
8
+ * - `issueJwt`: function to trigger the mutation (same as `mutate`)
9
+ * - `issueJwtAsync`: async function to trigger the mutation (same as `mutateAsync`)
10
+ *
11
+ * @example
12
+ * const { issueJwt, issueJwtAsync } = useIssueJwt();
13
+ * issueJwt({ ...params });
14
+ * // or
15
+ * await issueJwtAsync({ ...params });
16
+ */
17
+ export declare const useIssueJwt: () => {
18
+ error: Error;
19
+ isSuccess: boolean;
20
+ data: IssueJwtResponse;
21
+ variables: void | IssueJwtParams;
22
+ isError: boolean;
23
+ isIdle: boolean;
24
+ isPending: boolean;
25
+ status: "error" | "idle" | "pending" | "success";
26
+ reset: () => void;
27
+ context: unknown;
28
+ failureCount: number;
29
+ failureReason: Error;
30
+ isPaused: boolean;
31
+ submittedAt: number;
32
+ issueJwt: import("@tanstack/react-query").UseMutateFunction<IssueJwtResponse, Error, void | IssueJwtParams, unknown>;
33
+ issueJwtAsync: import("@tanstack/react-query").UseMutateAsyncFunction<IssueJwtResponse, Error, void | IssueJwtParams, unknown>;
34
+ };
@@ -0,0 +1,39 @@
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+ import { useMutation } from "@tanstack/react-query";
22
+ import { useClient } from "../utils/index.js";
23
+ import { renameMutations } from "../../utils/renameMutations.js";
24
+ import { issueJwt } from "../../actions/index.js";
25
+ const ISSUE_JWT_KEY = "ISSUE_JWT";
26
+ const useIssueJwt = () => {
27
+ const para = useClient();
28
+ const mutation = useMutation({
29
+ mutationKey: [ISSUE_JWT_KEY],
30
+ mutationFn: (..._0) => __async(void 0, [..._0], function* (args = {}) {
31
+ return issueJwt(para, args);
32
+ })
33
+ });
34
+ return renameMutations(mutation, "issueJwt");
35
+ };
36
+ export {
37
+ ISSUE_JWT_KEY,
38
+ useIssueJwt
39
+ };
@@ -0,0 +1,33 @@
1
+ export declare const KEEP_SESSION_ALIVE_KEY = "KEEP_SESSION_ALIVE";
2
+ /**
3
+ * React hook for the `keepSessionAlive` mutation.
4
+ *
5
+ * Returns a mutation result object with all standard fields from `useMutation`, except:
6
+ * - `mutate` and `mutateAsync` are replaced by:
7
+ * - `keepSessionAlive`: function to trigger the mutation (same as `mutate`)
8
+ * - `keepSessionAliveAsync`: async function to trigger the mutation (same as `mutateAsync`)
9
+ *
10
+ * @example
11
+ * const { keepSessionAlive, keepSessionAliveAsync } = useKeepSessionAlive();
12
+ * keepSessionAlive();
13
+ * // or
14
+ * await keepSessionAliveAsync();
15
+ */
16
+ export declare const useKeepSessionAlive: () => {
17
+ error: Error;
18
+ isSuccess: boolean;
19
+ data: boolean;
20
+ variables: void;
21
+ isError: boolean;
22
+ isIdle: boolean;
23
+ isPending: boolean;
24
+ status: "error" | "idle" | "pending" | "success";
25
+ reset: () => void;
26
+ context: unknown;
27
+ failureCount: number;
28
+ failureReason: Error;
29
+ isPaused: boolean;
30
+ submittedAt: number;
31
+ keepSessionAlive: import("@tanstack/react-query").UseMutateFunction<boolean, Error, void, unknown>;
32
+ keepSessionAliveAsync: import("@tanstack/react-query").UseMutateAsyncFunction<boolean, Error, void, unknown>;
33
+ };
@@ -0,0 +1,39 @@
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+ import { useMutation } from "@tanstack/react-query";
22
+ import { useClient } from "../utils/index.js";
23
+ import { renameMutations } from "../../utils/renameMutations.js";
24
+ import { keepSessionAlive } from "../../actions/index.js";
25
+ const KEEP_SESSION_ALIVE_KEY = "KEEP_SESSION_ALIVE";
26
+ const useKeepSessionAlive = () => {
27
+ const para = useClient();
28
+ const mutation = useMutation({
29
+ mutationKey: [KEEP_SESSION_ALIVE_KEY],
30
+ mutationFn: () => __async(void 0, null, function* () {
31
+ return keepSessionAlive(para);
32
+ })
33
+ });
34
+ return renameMutations(mutation, "keepSessionAlive");
35
+ };
36
+ export {
37
+ KEEP_SESSION_ALIVE_KEY,
38
+ useKeepSessionAlive
39
+ };
@@ -0,0 +1,34 @@
1
+ import type { LoginExternalWalletParams, LoginExternalWalletResponse } from '@getpara/core-sdk';
2
+ export declare const LOGIN_EXTERNAL_WALLET_KEY = "LOGIN_EXTERNAL_WALLET";
3
+ /**
4
+ * React hook for the `loginExternalWallet` mutation.
5
+ *
6
+ * Returns a mutation result object with all standard fields from `useMutation`, except:
7
+ * - `mutate` and `mutateAsync` are replaced by:
8
+ * - `loginExternalWallet`: function to trigger the mutation (same as `mutate`)
9
+ * - `loginExternalWalletAsync`: async function to trigger the mutation (same as `mutateAsync`)
10
+ *
11
+ * @example
12
+ * const { loginExternalWallet, loginExternalWalletAsync } = useLoginExternalWallet();
13
+ * loginExternalWallet({ ...params });
14
+ * // or
15
+ * await loginExternalWalletAsync({ ...params });
16
+ */
17
+ export declare const useLoginExternalWallet: () => {
18
+ error: Error;
19
+ isSuccess: boolean;
20
+ data: LoginExternalWalletResponse;
21
+ variables: LoginExternalWalletParams;
22
+ isError: boolean;
23
+ isIdle: boolean;
24
+ isPending: boolean;
25
+ status: "error" | "idle" | "pending" | "success";
26
+ reset: () => void;
27
+ context: unknown;
28
+ failureCount: number;
29
+ failureReason: Error;
30
+ isPaused: boolean;
31
+ submittedAt: number;
32
+ loginExternalWallet: import("@tanstack/react-query").UseMutateFunction<LoginExternalWalletResponse, Error, LoginExternalWalletParams, unknown>;
33
+ loginExternalWalletAsync: import("@tanstack/react-query").UseMutateAsyncFunction<LoginExternalWalletResponse, Error, LoginExternalWalletParams, unknown>;
34
+ };
@@ -0,0 +1,42 @@
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+ import { useMutation } from "@tanstack/react-query";
22
+ import { useClient } from "../utils/index.js";
23
+ import { renameMutations } from "../../utils/renameMutations.js";
24
+ import { loginExternalWallet } from "../../actions/index.js";
25
+ const LOGIN_EXTERNAL_WALLET_KEY = "LOGIN_EXTERNAL_WALLET";
26
+ const useLoginExternalWallet = () => {
27
+ const para = useClient();
28
+ const mutation = useMutation({
29
+ mutationKey: [LOGIN_EXTERNAL_WALLET_KEY],
30
+ mutationFn: (args) => __async(void 0, null, function* () {
31
+ return loginExternalWallet(para, args);
32
+ })
33
+ });
34
+ return renameMutations(
35
+ mutation,
36
+ "loginExternalWallet"
37
+ );
38
+ };
39
+ export {
40
+ LOGIN_EXTERNAL_WALLET_KEY,
41
+ useLoginExternalWallet
42
+ };
@@ -0,0 +1,34 @@
1
+ import type { LogoutParams } from '@getpara/core-sdk';
2
+ export declare const LOGOUT_KEY = "LOGOUT";
3
+ /**
4
+ * React hook for the `logout` mutation.
5
+ *
6
+ * Returns a mutation result object with all standard fields from `useMutation`, except:
7
+ * - `mutate` and `mutateAsync` are replaced by:
8
+ * - `logout`: function to trigger the mutation (same as `mutate`)
9
+ * - `logoutAsync`: async function to trigger the mutation (same as `mutateAsync`)
10
+ *
11
+ * @example
12
+ * const { logout, logoutAsync } = useLogout();
13
+ * logout({ ...params });
14
+ * // or
15
+ * await logoutAsync({ ...params });
16
+ */
17
+ export declare const useLogout: () => {
18
+ error: Error;
19
+ isSuccess: boolean;
20
+ data: void;
21
+ variables: void | LogoutParams;
22
+ isError: boolean;
23
+ isIdle: boolean;
24
+ isPending: boolean;
25
+ status: "error" | "idle" | "pending" | "success";
26
+ reset: () => void;
27
+ context: unknown;
28
+ failureCount: number;
29
+ failureReason: Error;
30
+ isPaused: boolean;
31
+ submittedAt: number;
32
+ logout: import("@tanstack/react-query").UseMutateFunction<void, Error, void | LogoutParams, unknown>;
33
+ logoutAsync: import("@tanstack/react-query").UseMutateAsyncFunction<void, Error, void | LogoutParams, unknown>;
34
+ };
@@ -0,0 +1,39 @@
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+ import { useMutation } from "@tanstack/react-query";
22
+ import { useClient } from "../utils/index.js";
23
+ import { renameMutations } from "../../utils/renameMutations.js";
24
+ import { logout } from "../../actions/index.js";
25
+ const LOGOUT_KEY = "LOGOUT";
26
+ const useLogout = () => {
27
+ const para = useClient();
28
+ const mutation = useMutation({
29
+ mutationKey: [LOGOUT_KEY],
30
+ mutationFn: (..._0) => __async(void 0, [..._0], function* (args = {}) {
31
+ return logout(para, args);
32
+ })
33
+ });
34
+ return renameMutations(mutation, "logout");
35
+ };
36
+ export {
37
+ LOGOUT_KEY,
38
+ useLogout
39
+ };
@@ -0,0 +1,34 @@
1
+ import type { ResendVerificationCodeParams } from '@getpara/core-sdk';
2
+ export declare const RESEND_VERIFICATION_CODE_KEY = "RESEND_VERIFICATION_CODE";
3
+ /**
4
+ * React hook for the `resendVerificationCode` mutation.
5
+ *
6
+ * Returns a mutation result object with all standard fields from `useMutation`, except:
7
+ * - `mutate` and `mutateAsync` are replaced by:
8
+ * - `resendVerificationCode`: function to trigger the mutation (same as `mutate`)
9
+ * - `resendVerificationCodeAsync`: async function to trigger the mutation (same as `mutateAsync`)
10
+ *
11
+ * @example
12
+ * const { resendVerificationCode, resendVerificationCodeAsync } = useResendVerificationCode();
13
+ * resendVerificationCode({ ...params });
14
+ * // or
15
+ * await resendVerificationCodeAsync({ ...params });
16
+ */
17
+ export declare const useResendVerificationCode: () => {
18
+ error: Error;
19
+ isSuccess: boolean;
20
+ data: void;
21
+ variables: void | ResendVerificationCodeParams;
22
+ isError: boolean;
23
+ isIdle: boolean;
24
+ isPending: boolean;
25
+ status: "error" | "idle" | "pending" | "success";
26
+ reset: () => void;
27
+ context: unknown;
28
+ failureCount: number;
29
+ failureReason: Error;
30
+ isPaused: boolean;
31
+ submittedAt: number;
32
+ resendVerificationCode: import("@tanstack/react-query").UseMutateFunction<void, Error, void | ResendVerificationCodeParams, unknown>;
33
+ resendVerificationCodeAsync: import("@tanstack/react-query").UseMutateAsyncFunction<void, Error, void | ResendVerificationCodeParams, unknown>;
34
+ };
@@ -0,0 +1,42 @@
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+ import { useMutation } from "@tanstack/react-query";
22
+ import { useClient } from "../utils/index.js";
23
+ import { renameMutations } from "../../utils/renameMutations.js";
24
+ import { resendVerificationCode } from "../../actions/index.js";
25
+ const RESEND_VERIFICATION_CODE_KEY = "RESEND_VERIFICATION_CODE";
26
+ const useResendVerificationCode = () => {
27
+ const para = useClient();
28
+ const mutation = useMutation({
29
+ mutationKey: [RESEND_VERIFICATION_CODE_KEY],
30
+ mutationFn: (..._0) => __async(void 0, [..._0], function* (args = {}) {
31
+ return resendVerificationCode(para, args);
32
+ })
33
+ });
34
+ return renameMutations(
35
+ mutation,
36
+ "resendVerificationCode"
37
+ );
38
+ };
39
+ export {
40
+ RESEND_VERIFICATION_CODE_KEY,
41
+ useResendVerificationCode
42
+ };
@@ -0,0 +1,34 @@
1
+ import type { Setup2faResponse } from '@getpara/core-sdk';
2
+ export declare const SETUP_2FA_KEY = "SETUP_2FA";
3
+ /**
4
+ * React hook for the `setup2fa` mutation.
5
+ *
6
+ * Returns a mutation result object with all standard fields from `useMutation`, except:
7
+ * - `mutate` and `mutateAsync` are replaced by:
8
+ * - `setup2fa`: function to trigger the mutation (same as `mutate`)
9
+ * - `setup2faAsync`: async function to trigger the mutation (same as `mutateAsync`)
10
+ *
11
+ * @example
12
+ * const { setup2fa, setup2faAsync } = useSetup2fa();
13
+ * setup2fa();
14
+ * // or
15
+ * await setup2faAsync();
16
+ */
17
+ export declare const useSetup2fa: () => {
18
+ error: Error;
19
+ isSuccess: boolean;
20
+ data: Setup2faResponse;
21
+ variables: void;
22
+ isError: boolean;
23
+ isIdle: boolean;
24
+ isPending: boolean;
25
+ status: "error" | "idle" | "pending" | "success";
26
+ reset: () => void;
27
+ context: unknown;
28
+ failureCount: number;
29
+ failureReason: Error;
30
+ isPaused: boolean;
31
+ submittedAt: number;
32
+ setup2fa: import("@tanstack/react-query").UseMutateFunction<Setup2faResponse, Error, void, unknown>;
33
+ setup2faAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Setup2faResponse, Error, void, unknown>;
34
+ };
@@ -0,0 +1,39 @@
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+ import { useMutation } from "@tanstack/react-query";
22
+ import { useClient } from "../utils/index.js";
23
+ import { renameMutations } from "../../utils/renameMutations.js";
24
+ import { setup2fa } from "../../actions/index.js";
25
+ const SETUP_2FA_KEY = "SETUP_2FA";
26
+ const useSetup2fa = () => {
27
+ const para = useClient();
28
+ const mutation = useMutation({
29
+ mutationKey: [SETUP_2FA_KEY],
30
+ mutationFn: () => __async(void 0, null, function* () {
31
+ return setup2fa(para);
32
+ })
33
+ });
34
+ return renameMutations(mutation, "setup2fa");
35
+ };
36
+ export {
37
+ SETUP_2FA_KEY,
38
+ useSetup2fa
39
+ };
@@ -0,0 +1,34 @@
1
+ import type { SignMessageParams, FullSignatureRes } from '@getpara/core-sdk';
2
+ export declare const SIGN_MESSAGE_KEY = "SIGN_MESSAGE";
3
+ /**
4
+ * React hook for the `signMessage` mutation.
5
+ *
6
+ * Returns a mutation result object with all standard fields from `useMutation`, except:
7
+ * - `mutate` and `mutateAsync` are replaced by:
8
+ * - `signMessage`: function to trigger the mutation (same as `mutate`)
9
+ * - `signMessageAsync`: async function to trigger the mutation (same as `mutateAsync`)
10
+ *
11
+ * @example
12
+ * const { signMessage, signMessageAsync } = useSignMessage();
13
+ * signMessage({ ...params });
14
+ * // or
15
+ * await signMessageAsync({ ...params });
16
+ */
17
+ export declare const useSignMessage: () => {
18
+ error: Error;
19
+ isSuccess: boolean;
20
+ data: FullSignatureRes;
21
+ variables: SignMessageParams;
22
+ isError: boolean;
23
+ isIdle: boolean;
24
+ isPending: boolean;
25
+ status: "error" | "idle" | "pending" | "success";
26
+ reset: () => void;
27
+ context: unknown;
28
+ failureCount: number;
29
+ failureReason: Error;
30
+ isPaused: boolean;
31
+ submittedAt: number;
32
+ signMessage: import("@tanstack/react-query").UseMutateFunction<FullSignatureRes, Error, SignMessageParams, unknown>;
33
+ signMessageAsync: import("@tanstack/react-query").UseMutateAsyncFunction<FullSignatureRes, Error, SignMessageParams, unknown>;
34
+ };
@@ -0,0 +1,39 @@
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
21
+ import { useMutation } from "@tanstack/react-query";
22
+ import { useClient } from "../utils/index.js";
23
+ import { renameMutations } from "../../utils/renameMutations.js";
24
+ import { signMessage } from "../../actions/index.js";
25
+ const SIGN_MESSAGE_KEY = "SIGN_MESSAGE";
26
+ const useSignMessage = () => {
27
+ const para = useClient();
28
+ const mutation = useMutation({
29
+ mutationKey: [SIGN_MESSAGE_KEY],
30
+ mutationFn: (args) => __async(void 0, null, function* () {
31
+ return signMessage(para, args);
32
+ })
33
+ });
34
+ return renameMutations(mutation, "signMessage");
35
+ };
36
+ export {
37
+ SIGN_MESSAGE_KEY,
38
+ useSignMessage
39
+ };
@@ -0,0 +1,34 @@
1
+ import type { SignTransactionParams, FullSignatureRes } from '@getpara/core-sdk';
2
+ export declare const SIGN_TRANSACTION_KEY = "SIGN_TRANSACTION";
3
+ /**
4
+ * React hook for the `signTransaction` mutation.
5
+ *
6
+ * Returns a mutation result object with all standard fields from `useMutation`, except:
7
+ * - `mutate` and `mutateAsync` are replaced by:
8
+ * - `signTransaction`: function to trigger the mutation (same as `mutate`)
9
+ * - `signTransactionAsync`: async function to trigger the mutation (same as `mutateAsync`)
10
+ *
11
+ * @example
12
+ * const { signTransaction, signTransactionAsync } = useSignTransaction();
13
+ * signTransaction({ ...params });
14
+ * // or
15
+ * await signTransactionAsync({ ...params });
16
+ */
17
+ export declare const useSignTransaction: () => {
18
+ error: Error;
19
+ isSuccess: boolean;
20
+ data: FullSignatureRes;
21
+ variables: SignTransactionParams;
22
+ isError: boolean;
23
+ isIdle: boolean;
24
+ isPending: boolean;
25
+ status: "error" | "idle" | "pending" | "success";
26
+ reset: () => void;
27
+ context: unknown;
28
+ failureCount: number;
29
+ failureReason: Error;
30
+ isPaused: boolean;
31
+ submittedAt: number;
32
+ signTransaction: import("@tanstack/react-query").UseMutateFunction<FullSignatureRes, Error, SignTransactionParams, unknown>;
33
+ signTransactionAsync: import("@tanstack/react-query").UseMutateAsyncFunction<FullSignatureRes, Error, SignTransactionParams, unknown>;
34
+ };