@getpara/react-sdk-lite 2.0.0-alpha.34 → 2.0.0-alpha.36

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 (84) hide show
  1. package/dist/modal/components/Account/AccountProfileLink.js +1 -1
  2. package/dist/modal/components/OAuth/OAuth.js +3 -5
  3. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +2 -2
  4. package/dist/modal/constants/constants.js +1 -1
  5. package/dist/provider/components/ExternalWalletWrapper.js +3 -26
  6. package/dist/provider/hooks/mutations/index.d.ts +28 -2
  7. package/dist/provider/hooks/mutations/index.js +57 -3
  8. package/dist/provider/hooks/mutations/useClaimPregenWallets.d.ts +40 -0
  9. package/dist/provider/hooks/mutations/useClaimPregenWallets.js +28 -0
  10. package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +33 -0
  11. package/dist/provider/hooks/mutations/useCreateGuestWallets.js +28 -0
  12. package/dist/provider/hooks/mutations/useCreatePregenWallet.d.ts +120 -0
  13. package/dist/provider/hooks/mutations/useCreatePregenWallet.js +28 -0
  14. package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.d.ts +42 -0
  15. package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.js +28 -0
  16. package/dist/provider/hooks/mutations/useCreateWallet.d.ts +42 -0
  17. package/dist/provider/hooks/mutations/useCreateWallet.js +28 -0
  18. package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +54 -0
  19. package/dist/provider/hooks/mutations/useCreateWalletPerType.js +28 -0
  20. package/dist/provider/hooks/mutations/useEnable2fa.d.ts +39 -0
  21. package/dist/provider/hooks/mutations/useEnable2fa.js +28 -0
  22. package/dist/provider/hooks/mutations/useHasPregenWallet.d.ts +40 -0
  23. package/dist/provider/hooks/mutations/useHasPregenWallet.js +28 -0
  24. package/dist/provider/hooks/mutations/useIssueJwt.d.ts +48 -0
  25. package/dist/provider/hooks/mutations/useIssueJwt.js +28 -0
  26. package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +34 -0
  27. package/dist/provider/hooks/mutations/useKeepSessionAlive.js +28 -0
  28. package/dist/provider/hooks/mutations/useLoginExternalWallet.d.ts +46 -0
  29. package/dist/provider/hooks/mutations/useLoginExternalWallet.js +28 -0
  30. package/dist/provider/hooks/mutations/useLogout.d.ts +39 -0
  31. package/dist/provider/hooks/mutations/useLogout.js +28 -0
  32. package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +40 -0
  33. package/dist/provider/hooks/mutations/useResendVerificationCode.js +28 -0
  34. package/dist/provider/hooks/mutations/useSetup2fa.d.ts +34 -0
  35. package/dist/provider/hooks/mutations/useSetup2fa.js +28 -0
  36. package/dist/provider/hooks/mutations/useSignMessage.d.ts +58 -0
  37. package/dist/provider/hooks/mutations/useSignMessage.js +28 -0
  38. package/dist/provider/hooks/mutations/useSignTransaction.d.ts +58 -0
  39. package/dist/provider/hooks/mutations/useSignTransaction.js +28 -0
  40. package/dist/provider/hooks/mutations/useSignUpOrLogIn.d.ts +46 -0
  41. package/dist/provider/hooks/mutations/useSignUpOrLogIn.js +28 -0
  42. package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.d.ts +42 -0
  43. package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.js +28 -0
  44. package/dist/provider/hooks/mutations/useVerify2fa.d.ts +57 -0
  45. package/dist/provider/hooks/mutations/useVerify2fa.js +28 -0
  46. package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +93 -0
  47. package/dist/provider/hooks/mutations/useVerifyExternalWallet.js +28 -0
  48. package/dist/provider/hooks/mutations/useVerifyFarcaster.d.ts +55 -0
  49. package/dist/provider/hooks/mutations/useVerifyFarcaster.js +28 -0
  50. package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +84 -0
  51. package/dist/provider/hooks/mutations/useVerifyNewAccount.js +28 -0
  52. package/dist/provider/hooks/mutations/useVerifyOAuth.d.ts +64 -0
  53. package/dist/provider/hooks/mutations/useVerifyOAuth.js +28 -0
  54. package/dist/provider/hooks/mutations/useVerifyTelegram.d.ts +46 -0
  55. package/dist/provider/hooks/mutations/useVerifyTelegram.js +28 -0
  56. package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +57 -0
  57. package/dist/provider/hooks/mutations/useWaitForLogin.js +28 -0
  58. package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +45 -0
  59. package/dist/provider/hooks/mutations/useWaitForSignup.js +28 -0
  60. package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +54 -0
  61. package/dist/provider/hooks/mutations/useWaitForWalletCreation.js +28 -0
  62. package/dist/provider/hooks/mutations/utils.d.ts +2 -7
  63. package/dist/provider/hooks/mutations/utils.js +0 -24
  64. package/dist/provider/hooks/queries/index.d.ts +2 -1
  65. package/dist/provider/hooks/queries/index.js +4 -1
  66. package/dist/provider/hooks/queries/useAccountLinkInProgress.d.ts +6 -0
  67. package/dist/provider/hooks/queries/useAccountLinkInProgress.js +24 -0
  68. package/dist/provider/hooks/queries/useLinkedAccounts.d.ts +11 -0
  69. package/dist/provider/hooks/queries/useLinkedAccounts.js +24 -0
  70. package/dist/provider/providers/AccountLinkProvider.js +3 -8
  71. package/dist/provider/providers/AuthProvider.d.ts +0 -1
  72. package/dist/provider/providers/AuthProvider.js +18 -45
  73. package/dist/provider/providers/ExternalWalletProvider.js +2 -2
  74. package/dist/provider/utils/externalWalletDefaults.d.ts +6 -0
  75. package/dist/provider/utils/externalWalletDefaults.js +33 -0
  76. package/dist/provider/utils/renameMutations.d.ts +9 -5
  77. package/dist/provider/utils/renameMutations.js +3 -5
  78. package/package.json +8 -8
  79. package/dist/provider/hooks/mutations/core.d.ts +0 -27
  80. package/dist/provider/hooks/mutations/core.js +0 -66
  81. package/dist/provider/hooks/queries/core.d.ts +0 -4
  82. package/dist/provider/hooks/queries/core.js +0 -16
  83. package/dist/provider/hooks/queries/utils.d.ts +0 -7
  84. package/dist/provider/hooks/queries/utils.js +0 -25
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import {
3
+ __async
4
+ } from "../../../chunk-MMUBH76A.js";
5
+ import { useQuery } from "@tanstack/react-query";
6
+ import { useInternalClient } from "../utils/useInternalClient.js";
7
+ import { getLinkedAccounts } from "../../actions/index.js";
8
+ const LINKED_ACCOUNTS_BASE_KEY = "PARA_LINKED_ACCOUNTS";
9
+ const useLinkedAccounts = (params = { withMetadata: false }) => {
10
+ var _a;
11
+ const client = useInternalClient();
12
+ return useQuery({
13
+ enabled: !!(client == null ? void 0 : client.isReady),
14
+ queryKey: [LINKED_ACCOUNTS_BASE_KEY, (_a = client == null ? void 0 : client.userId) != null ? _a : null, params],
15
+ queryFn: () => __async(void 0, null, function* () {
16
+ var _a2;
17
+ return (_a2 = yield getLinkedAccounts(client, params)) != null ? _a2 : [];
18
+ })
19
+ });
20
+ };
21
+ export {
22
+ LINKED_ACCOUNTS_BASE_KEY,
23
+ useLinkedAccounts
24
+ };
@@ -12,7 +12,7 @@ import {
12
12
  LINKED_ACCOUNT_TYPES
13
13
  } from "@getpara/web-sdk";
14
14
  import { useModalStore } from "../../modal/stores/index.js";
15
- import { ModalStep, openPopup } from "../../modal/index.js";
15
+ import { ModalStep } from "../../modal/index.js";
16
16
  import { useGoBack } from "../../modal/hooks/useGoBack.js";
17
17
  import { useExternalWallets } from "./ExternalWalletProvider.js";
18
18
  import { useInternalClient } from "../hooks/utils/useInternalClient.js";
@@ -259,13 +259,8 @@ const AccountLinkProvider = ({ children }) => {
259
259
  var _a2;
260
260
  return !!((_a2 = refs.popupWindow.current) == null ? void 0 : _a2.closed);
261
261
  },
262
- onOAuthUrl: (oAuthUrl) => {
263
- refs.popupWindow.current = openPopup({
264
- url: oAuthUrl,
265
- target: `${method}AuthPopup`,
266
- type: "OAUTH",
267
- current: refs.popupWindow.current
268
- });
262
+ onOAuthPopup: (oAuthPopup) => {
263
+ refs.popupWindow.current = oAuthPopup;
269
264
  }
270
265
  },
271
266
  {
@@ -22,7 +22,6 @@ type Value = {
22
22
  isCreateGuestWalletsPending: boolean;
23
23
  logout: () => void;
24
24
  biometricHints?: BiometricHints;
25
- isOAuthReady?: boolean;
26
25
  };
27
26
  type Props = PropsWithChildren<{
28
27
  is2faEnabled?: boolean;
@@ -6,7 +6,7 @@ import {
6
6
  } from "../../chunk-MMUBH76A.js";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  import { useUserAgent } from "@getpara/react-common";
9
- import { createContext, useCallback, useContext, useEffect, useMemo, useState } from "react";
9
+ import { createContext, useCallback, useContext, useEffect, useMemo } from "react";
10
10
  import { useModalStore } from "../../modal/stores/index.js";
11
11
  import { ModalStep } from "../../modal/utils/steps.js";
12
12
  import {
@@ -20,8 +20,7 @@ import {
20
20
  useVerifyTelegram,
21
21
  useSetup2fa,
22
22
  useLogout,
23
- useCreateGuestWallets,
24
- useAccount
23
+ useCreateGuestWallets
25
24
  } from "../index.js";
26
25
  import { DEFAULTS } from "../../modal/constants/defaults.js";
27
26
  import { openPopup } from "../../modal/utils/openPopup.js";
@@ -97,39 +96,22 @@ function AuthProvider({
97
96
  const authStepRoute = useModalStore((state) => state.authStepRoute);
98
97
  const isIFrameReady = useModalStore((state) => state.isIFrameReady);
99
98
  const goBack = useGoBack();
100
- const { isConnected } = useAccount();
101
- const { mutate: mutateSignUpOrLogIn, isPending: isSignUpOrLogInPending } = useSignUpOrLogIn();
99
+ const { signUpOrLogIn: mutateSignUpOrLogIn, isPending: isSignUpOrLogInPending } = useSignUpOrLogIn();
102
100
  const {
103
- mutate: mutateVerifyNewAccount,
101
+ verifyNewAccount: mutateVerifyNewAccount,
104
102
  status: verifyNewAccountStatus,
105
103
  error: verifyNewAccountError
106
104
  } = useVerifyNewAccount();
107
- const { mutate: mutateVerifyOAuth } = useVerifyOAuth();
108
- const { mutate: mutateVerifyFarcaster } = useVerifyFarcaster();
109
- const { mutate: mutateVerifyTelegram, status: verifyTelegramStatus } = useVerifyTelegram();
110
- const { mutate: mutateWaitForLogin } = useWaitForLogin();
111
- const { mutate: mutateWaitForSignup } = useWaitForSignup();
112
- const { mutateAsync: mutateAsyncWaitForWalletCreation } = useWaitForWalletCreation();
113
- const { mutate: mutateSetup2fa, isPending: isSetup2faPending } = useSetup2fa();
114
- const { mutate: mutateCreateGuestWallets, isPending: isCreateGuestWalletsPending } = useCreateGuestWallets();
115
- const { mutate: mutateLogout } = useLogout();
105
+ const { verifyOAuth: mutateVerifyOAuth } = useVerifyOAuth();
106
+ const { verifyFarcaster: mutateVerifyFarcaster } = useVerifyFarcaster();
107
+ const { verifyTelegram: mutateVerifyTelegram, status: verifyTelegramStatus } = useVerifyTelegram();
108
+ const { waitForLogin: mutateWaitForLogin } = useWaitForLogin();
109
+ const { waitForSignup: mutateWaitForSignup } = useWaitForSignup();
110
+ const { waitForWalletCreationAsync: mutateAsyncWaitForWalletCreation } = useWaitForWalletCreation();
111
+ const { setup2fa: mutateSetup2fa, isPending: isSetup2faPending } = useSetup2fa();
112
+ const { createGuestWallets: mutateCreateGuestWallets, isPending: isCreateGuestWalletsPending } = useCreateGuestWallets();
113
+ const { logout: mutateLogout } = useLogout();
116
114
  const { data: biometricHints } = useFormattedBiometricHints();
117
- const [sessionLookupId, setSessionLookupId] = useState(void 0);
118
- useEffect(() => {
119
- const setupOAuthSessionLookupId = () => __async(this, null, function* () {
120
- if (!para || isConnected) {
121
- return;
122
- }
123
- const authStepsWithOAuth = [ModalStep.AUTH_MAIN, ModalStep.AUTH_MORE];
124
- if (authStepsWithOAuth.includes(currentStep) && !sessionLookupId) {
125
- setSessionLookupId(yield para.prepareLogin());
126
- return;
127
- } else if (!authStepsWithOAuth.includes(currentStep) && sessionLookupId) {
128
- setSessionLookupId(void 0);
129
- }
130
- });
131
- setupOAuthSessionLookupId();
132
- }, [isConnected, currentStep]);
133
115
  const goBackIfPopupClosedOnSteps = (steps) => {
134
116
  var _a;
135
117
  if (((_a = refs.popupWindow.current) == null ? void 0 : _a.closed) && (!refs.currentStep.current || steps.includes(refs.currentStep.current))) {
@@ -358,20 +340,13 @@ function AuthProvider({
358
340
  );
359
341
  });
360
342
  const verifyOAuth = (method) => __async(this, null, function* () {
361
- if (!sessionLookupId) {
362
- return;
363
- }
364
343
  setStep(ModalStep.AWAITING_OAUTH);
365
- const oAuthUrl = para.getOAuthUrlSync({ method, sessionLookupId });
366
- refs.popupWindow.current = openPopup({
367
- url: oAuthUrl,
368
- target: `${method}AuthPopup`,
369
- type: "OAUTH",
370
- current: refs.popupWindow.current
371
- });
372
344
  mutateVerifyOAuth(
373
345
  {
374
346
  method,
347
+ onOAuthPopup: (oAuthPopup) => {
348
+ refs.popupWindow.current = oAuthPopup;
349
+ },
375
350
  isCanceled: () => {
376
351
  var _a;
377
352
  return ((_a = refs.popupWindow.current) == null ? void 0 : _a.closed) || cancelIfExitedSteps([ModalStep.AWAITING_OAUTH]);
@@ -519,8 +494,7 @@ function AuthProvider({
519
494
  createGuestWallets,
520
495
  isCreateGuestWalletsPending,
521
496
  logout,
522
- biometricHints: biometricHints || void 0,
523
- isOAuthReady: !!sessionLookupId
497
+ biometricHints: biometricHints || void 0
524
498
  }),
525
499
  [
526
500
  presentSignupUi,
@@ -540,8 +514,7 @@ function AuthProvider({
540
514
  createGuestWallets,
541
515
  isCreateGuestWalletsPending,
542
516
  logout,
543
- biometricHints,
544
- sessionLookupId
517
+ biometricHints
545
518
  ]
546
519
  );
547
520
  useEffect(() => {
@@ -110,7 +110,7 @@ function ExternalWalletProvider({ children }) {
110
110
  const para = useInternalClient();
111
111
  const { setSelectedWallet } = useWalletState();
112
112
  const { onNewAuthState } = useAuthActions();
113
- const { mutateAsync: verifyExternalWallet } = useVerifyExternalWallet();
113
+ const { verifyExternalWalletAsync } = useVerifyExternalWallet();
114
114
  const [qrUri, setQrUri] = useState();
115
115
  const [chainIdSwitchingTo, setChainIdSwitchingTo] = useState();
116
116
  const [isSigningMessage, setIsSigningMessage] = useState(false);
@@ -300,7 +300,7 @@ function ExternalWalletProvider({ children }) {
300
300
  return;
301
301
  }
302
302
  try {
303
- const d = yield verifyExternalWallet(verifyExternalWalletParams);
303
+ const d = yield verifyExternalWalletAsync(verifyExternalWalletParams);
304
304
  if (wallet2 && (externalWalletsWithFullAuth == null ? void 0 : externalWalletsWithFullAuth.includes((_a = wallet2.name) == null ? void 0 : _a.toUpperCase()))) {
305
305
  yield onNewAuthState(d);
306
306
  } else {
@@ -0,0 +1,6 @@
1
+ import { Chain, Transport } from 'viem';
2
+ import { ParaEvmProviderConfigNoWallets } from '../types/externalWalletProviders.js';
3
+ export declare const getEVMExternalWalletConfigDefault: ({ appName, projectId, }: {
4
+ appName: string;
5
+ projectId?: string;
6
+ }) => ParaEvmProviderConfigNoWallets<readonly [Chain, ...Chain[]], Record<[Chain, ...Chain[]][number]["id"], Transport>>;
@@ -0,0 +1,33 @@
1
+ "use client";
2
+ import "../../chunk-MMUBH76A.js";
3
+ const getEVMExternalWalletConfigDefault = ({
4
+ appName,
5
+ projectId
6
+ }) => ({
7
+ appName,
8
+ chains: [
9
+ {
10
+ id: 11155111,
11
+ name: "Sepolia",
12
+ nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
13
+ rpcUrls: { default: { http: ["https://rpc.sepolia.org"] } },
14
+ blockExplorers: {
15
+ default: {
16
+ name: "Etherscan",
17
+ url: "https://sepolia.etherscan.io",
18
+ apiUrl: "https://api-sepolia.etherscan.io/api"
19
+ }
20
+ },
21
+ contracts: {
22
+ multicall3: { address: "0xca11bde05977b3631167028862be2a173976ca11", blockCreated: 751532 },
23
+ ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
24
+ ensUniversalResolver: { address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC", blockCreated: 5317080 }
25
+ },
26
+ testnet: true
27
+ }
28
+ ],
29
+ projectId: projectId != null ? projectId : ""
30
+ });
31
+ export {
32
+ getEVMExternalWalletConfigDefault
33
+ };
@@ -1,5 +1,9 @@
1
- import { CoreMethodName, CoreMethodParams, CoreMethodResponse, CoreMethods } from '@getpara/web-sdk';
2
- import { DefaultError, UseMutationResult } from '@tanstack/react-query';
3
- import { CoreMethodMutationHook } from '../types/utils.js';
4
- export declare function renameMutations<TResp = unknown, TData = unknown, TError = DefaultError, TVariables = void, TContext = unknown>(mutationObj: UseMutationResult<TData, TError, TVariables, TContext>, name: string): TResp;
5
- export declare function renameCoreMutations<method extends CoreMethodName & keyof CoreMethods>(mutationObj: UseMutationResult<CoreMethodResponse<method>, Error, CoreMethodParams<method> | undefined, unknown>, name: method): CoreMethodMutationHook<method>;
1
+ import { DefaultError, UseMutateAsyncFunction, UseMutateFunction, UseMutationResult } from '@tanstack/react-query';
2
+ import { Compute } from '../types/utils.js';
3
+ type RenamedMutationResult<TData, TError, TVariables, TContext, TName extends string> = Omit<UseMutationResult<TData, TError, TVariables, TContext>, 'mutate' | 'mutateAsync'> & {
4
+ [K in TName]: UseMutateFunction<TData, TError, TVariables, TContext>;
5
+ } & {
6
+ [K in `${TName}Async`]: UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
7
+ };
8
+ export declare function renameMutations<TData = unknown, TError = DefaultError, TVariables = void, TContext = unknown, TName extends string = string>(mutationObj: UseMutationResult<TData, TError, TVariables, TContext>, name: TName): Compute<RenamedMutationResult<TData, TError, TVariables, TContext, TName>>;
9
+ export {};
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import {
3
+ __objRest,
3
4
  __spreadValues
4
5
  } from "../../chunk-MMUBH76A.js";
5
6
  function renameMutations(mutationObj, name) {
@@ -7,12 +8,9 @@ function renameMutations(mutationObj, name) {
7
8
  [name]: mutationObj.mutate,
8
9
  [`${name}Async`]: mutationObj.mutateAsync
9
10
  };
10
- return __spreadValues(__spreadValues({}, newMutations), mutationObj);
11
- }
12
- function renameCoreMutations(mutationObj, name) {
13
- return renameMutations(mutationObj, name);
11
+ const _a = mutationObj, { mutate: _, mutateAsync: __ } = _a, rest = __objRest(_a, ["mutate", "mutateAsync"]);
12
+ return __spreadValues(__spreadValues({}, newMutations), rest);
14
13
  }
15
14
  export {
16
- renameCoreMutations,
17
15
  renameMutations
18
16
  };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@getpara/react-sdk-lite",
3
- "version": "2.0.0-alpha.34",
3
+ "version": "2.0.0-alpha.36",
4
4
  "bin": {
5
5
  "setup-para": "dist/cli/cli.mjs"
6
6
  },
7
7
  "dependencies": {
8
- "@getpara/react-common": "2.0.0-alpha.34",
9
- "@getpara/react-components": "2.0.0-alpha.34",
10
- "@getpara/web-sdk": "2.0.0-alpha.34",
8
+ "@getpara/react-common": "2.0.0-alpha.36",
9
+ "@getpara/react-components": "2.0.0-alpha.36",
10
+ "@getpara/web-sdk": "2.0.0-alpha.36",
11
11
  "date-fns": "^3.6.0",
12
12
  "framer-motion": "^11.3.31",
13
13
  "libphonenumber-js": "^1.11.7",
@@ -16,9 +16,9 @@
16
16
  "zustand-sync-tabs": "^0.2.2"
17
17
  },
18
18
  "devDependencies": {
19
- "@getpara/cosmos-wallet-connectors": "2.0.0-alpha.34",
20
- "@getpara/evm-wallet-connectors": "2.0.0-alpha.34",
21
- "@getpara/solana-wallet-connectors": "2.0.0-alpha.34",
19
+ "@getpara/cosmos-wallet-connectors": "2.0.0-alpha.36",
20
+ "@getpara/evm-wallet-connectors": "2.0.0-alpha.36",
21
+ "@getpara/solana-wallet-connectors": "2.0.0-alpha.36",
22
22
  "@tanstack/react-query": "^5.74.0",
23
23
  "@testing-library/dom": "^10.4.0",
24
24
  "@testing-library/react": "^16.3.0",
@@ -38,7 +38,7 @@
38
38
  "package.json",
39
39
  "styles.css"
40
40
  ],
41
- "gitHead": "cff5cb1fa7284a850e688b20a6596d435315a475",
41
+ "gitHead": "2f05b64622b5813679e11282e5ed5c78c9a00e6c",
42
42
  "main": "dist/index.js",
43
43
  "peerDependencies": {
44
44
  "@tanstack/react-query": ">=5.0.0",
@@ -1,27 +0,0 @@
1
- export declare const useSignUpOrLogIn: () => import("../../types/utils.js").CoreMethodMutationHook<"signUpOrLogIn">;
2
- export declare const useVerifyNewAccount: () => import("../../types/utils.js").CoreMethodMutationHook<"verifyNewAccount">;
3
- export declare const useWaitForLogin: () => import("../../types/utils.js").CoreMethodMutationHook<"waitForLogin">;
4
- export declare const useWaitForSignup: () => import("../../types/utils.js").CoreMethodMutationHook<"waitForSignup">;
5
- export declare const useWaitForWalletCreation: () => import("../../types/utils.js").CoreMethodMutationHook<"waitForWalletCreation">;
6
- export declare const useVerifyOAuth: () => import("../../types/utils.js").CoreMethodMutationHook<"verifyOAuth">;
7
- export declare const useVerifyFarcaster: () => import("../../types/utils.js").CoreMethodMutationHook<"verifyFarcaster">;
8
- export declare const useVerifyTelegram: () => import("../../types/utils.js").CoreMethodMutationHook<"verifyTelegram">;
9
- export declare const useLoginExternalWallet: () => import("../../types/utils.js").CoreMethodMutationHook<"loginExternalWallet">;
10
- export declare const useVerifyExternalWallet: () => import("../../types/utils.js").CoreMethodMutationHook<"verifyExternalWallet">;
11
- export declare const useSetup2fa: () => import("../../types/utils.js").CoreMethodMutationHook<"setup2fa">;
12
- export declare const useEnable2fa: () => import("../../types/utils.js").CoreMethodMutationHook<"enable2fa">;
13
- export declare const useVerify2fa: () => import("../../types/utils.js").CoreMethodMutationHook<"verify2fa">;
14
- export declare const useKeepSessionAlive: () => import("../../types/utils.js").CoreMethodMutationHook<"keepSessionAlive">;
15
- export declare const useLogout: () => import("../../types/utils.js").CoreMethodMutationHook<"logout">;
16
- export declare const useResendVerificationCode: () => import("../../types/utils.js").CoreMethodMutationHook<"resendVerificationCode">;
17
- export declare const useCreateWallet: () => import("../../types/utils.js").CoreMethodMutationHook<"createWallet">;
18
- export declare const useCreateWalletPerType: () => import("../../types/utils.js").CoreMethodMutationHook<"createWalletPerType">;
19
- export declare const useCreatePregenWallet: () => import("../../types/utils.js").CoreMethodMutationHook<"createPregenWallet">;
20
- export declare const useCreatePregenWalletPerType: () => import("../../types/utils.js").CoreMethodMutationHook<"createPregenWalletPerType">;
21
- export declare const useClaimPregenWallets: () => import("../../types/utils.js").CoreMethodMutationHook<"claimPregenWallets">;
22
- export declare const useHasPregenWallet: () => import("../../types/utils.js").CoreMethodMutationHook<"hasPregenWallet">;
23
- export declare const useUpdatePregenWalletIdentifier: () => import("../../types/utils.js").CoreMethodMutationHook<"updatePregenWalletIdentifier">;
24
- export declare const useCreateGuestWallets: () => import("../../types/utils.js").CoreMethodMutationHook<"createGuestWallets">;
25
- export declare const useSignMessage: () => import("../../types/utils.js").CoreMethodMutationHook<"signMessage">;
26
- export declare const useSignTransaction: () => import("../../types/utils.js").CoreMethodMutationHook<"signTransaction">;
27
- export declare const useIssueJwt: () => import("../../types/utils.js").CoreMethodMutationHook<"issueJwt">;
@@ -1,66 +0,0 @@
1
- "use client";
2
- import "../../../chunk-MMUBH76A.js";
3
- import * as actions from "../../actions/index.js";
4
- import { generateCoreMutation } from "./utils.js";
5
- const useSignUpOrLogIn = generateCoreMutation("signUpOrLogIn", actions.signUpOrLogIn);
6
- const useVerifyNewAccount = generateCoreMutation("verifyNewAccount", actions.verifyNewAccount);
7
- const useWaitForLogin = generateCoreMutation("waitForLogin", actions.waitForLogin);
8
- const useWaitForSignup = generateCoreMutation("waitForSignup", actions.waitForSignup);
9
- const useWaitForWalletCreation = generateCoreMutation("waitForWalletCreation", actions.waitForWalletCreation);
10
- const useVerifyOAuth = generateCoreMutation("verifyOAuth", actions.verifyOAuth);
11
- const useVerifyFarcaster = generateCoreMutation("verifyFarcaster", actions.verifyFarcaster);
12
- const useVerifyTelegram = generateCoreMutation("verifyTelegram", actions.verifyTelegram);
13
- const useLoginExternalWallet = generateCoreMutation("loginExternalWallet", actions.loginExternalWallet);
14
- const useVerifyExternalWallet = generateCoreMutation("verifyExternalWallet", actions.verifyExternalWallet);
15
- const useSetup2fa = generateCoreMutation("setup2fa", actions.setup2fa);
16
- const useEnable2fa = generateCoreMutation("enable2fa", actions.enable2fa);
17
- const useVerify2fa = generateCoreMutation("verify2fa", actions.verify2fa);
18
- const useKeepSessionAlive = generateCoreMutation("keepSessionAlive", actions.keepSessionAlive);
19
- const useLogout = generateCoreMutation("logout", actions.logout);
20
- const useResendVerificationCode = generateCoreMutation("resendVerificationCode", actions.resendVerificationCode);
21
- const useCreateWallet = generateCoreMutation("createWallet", actions.createWallet);
22
- const useCreateWalletPerType = generateCoreMutation("createWalletPerType", actions.createWalletPerType);
23
- const useCreatePregenWallet = generateCoreMutation("createPregenWallet", actions.createPregenWallet);
24
- const useCreatePregenWalletPerType = generateCoreMutation(
25
- "createPregenWalletPerType",
26
- actions.createPregenWalletPerType
27
- );
28
- const useClaimPregenWallets = generateCoreMutation("claimPregenWallets", actions.claimPregenWallets);
29
- const useHasPregenWallet = generateCoreMutation("hasPregenWallet", actions.hasPregenWallet);
30
- const useUpdatePregenWalletIdentifier = generateCoreMutation(
31
- "updatePregenWalletIdentifier",
32
- actions.updatePregenWalletIdentifier
33
- );
34
- const useCreateGuestWallets = generateCoreMutation("createGuestWallets", actions.createGuestWallets);
35
- const useSignMessage = generateCoreMutation("signMessage", actions.signMessage);
36
- const useSignTransaction = generateCoreMutation("signTransaction", actions.signTransaction);
37
- const useIssueJwt = generateCoreMutation("issueJwt", actions.issueJwt);
38
- export {
39
- useClaimPregenWallets,
40
- useCreateGuestWallets,
41
- useCreatePregenWallet,
42
- useCreatePregenWalletPerType,
43
- useCreateWallet,
44
- useCreateWalletPerType,
45
- useEnable2fa,
46
- useHasPregenWallet,
47
- useIssueJwt,
48
- useKeepSessionAlive,
49
- useLoginExternalWallet,
50
- useLogout,
51
- useResendVerificationCode,
52
- useSetup2fa,
53
- useSignMessage,
54
- useSignTransaction,
55
- useSignUpOrLogIn,
56
- useUpdatePregenWalletIdentifier,
57
- useVerify2fa,
58
- useVerifyExternalWallet,
59
- useVerifyFarcaster,
60
- useVerifyNewAccount,
61
- useVerifyOAuth,
62
- useVerifyTelegram,
63
- useWaitForLogin,
64
- useWaitForSignup,
65
- useWaitForWalletCreation
66
- };
@@ -1,4 +0,0 @@
1
- export declare const useLinkedAccounts: (params?: {
2
- withMetadata?: boolean;
3
- } | undefined) => import("../../types/utils.js").CoreMethodQueryHook<"getLinkedAccounts">;
4
- export declare const useAccountLinkInProgress: (params?: undefined) => import("../../types/utils.js").CoreMethodQueryHook<"accountLinkInProgress">;
@@ -1,16 +0,0 @@
1
- "use client";
2
- import "../../../chunk-MMUBH76A.js";
3
- import * as actions from "../../actions/index.js";
4
- import { generateCoreQueryHook } from "./utils.js";
5
- const useLinkedAccounts = generateCoreQueryHook("getLinkedAccounts", actions.getLinkedAccounts, {
6
- defaultParams: { withMetadata: false }
7
- });
8
- const useAccountLinkInProgress = generateCoreQueryHook(
9
- "accountLinkInProgress",
10
- actions.accountLinkInProgress,
11
- { isGetter: true }
12
- );
13
- export {
14
- useAccountLinkInProgress,
15
- useLinkedAccounts
16
- };
@@ -1,7 +0,0 @@
1
- import { CoreMethodName, CoreMethodParams, CoreMethods } from '@getpara/web-sdk';
2
- import { CoreMethodQueryHook } from '../../types/utils.js';
3
- import { CoreAction } from '../../actions/utils.js';
4
- export declare function generateCoreQueryHook<const method extends CoreMethodName & keyof CoreMethods>(method: method, action: CoreAction<method>, { isGetter, defaultParams }?: {
5
- isGetter?: boolean;
6
- defaultParams?: CoreMethodParams<method>;
7
- }): (params?: CoreMethodParams<method>) => CoreMethodQueryHook<method>;
@@ -1,25 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../../chunk-MMUBH76A.js";
5
- import { useClient } from "../utils/index.js";
6
- import { useQuery } from "@tanstack/react-query";
7
- function generateCoreQueryHook(method, action, { isGetter = false, defaultParams } = {}) {
8
- return (params = defaultParams) => {
9
- var _a;
10
- const para = useClient();
11
- return useQuery({
12
- queryKey: [method, params != null ? params : null, isGetter ? (_a = para == null ? void 0 : para[method]) != null ? _a : null : null],
13
- queryFn: (_0) => __async(this, [_0], function* ({ queryKey: [_, params2] }) {
14
- if (!para) {
15
- return null;
16
- }
17
- const result = params2 ? yield action(para, params2) : defaultParams ? yield action(para, defaultParams) : yield action(para);
18
- return result != null ? result : null;
19
- })
20
- });
21
- };
22
- }
23
- export {
24
- generateCoreQueryHook
25
- };