@getpara/react-sdk-lite 2.0.0-alpha.33 → 2.0.0-alpha.35
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/modal/components/Account/AccountProfile.js +22 -4
- package/dist/modal/components/Account/AccountProfileLink.js +10 -5
- package/dist/modal/components/Account/AccountProfileLinkOptions.js +21 -13
- package/dist/modal/components/Account/AccountProfileUnlink.js +6 -4
- package/dist/modal/components/AddFunds/AddFundsAwaiting.d.ts +1 -1
- package/dist/modal/components/AddFunds/AddFundsAwaiting.js +3 -54
- package/dist/modal/components/AddFunds/AddFundsProvider.js +2 -6
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +2 -2
- package/dist/modal/components/ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js +6 -6
- package/dist/modal/components/ExternalWallets/ExternalWallets.js +5 -5
- package/dist/modal/components/OAuth/OAuth.js +3 -5
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +2 -2
- package/dist/modal/components/common.d.ts +7 -5
- package/dist/modal/components/common.js +5 -4
- package/dist/modal/constants/constants.js +1 -1
- package/dist/modal/constants/oAuthLogos.d.ts +2 -3
- package/dist/modal/constants/oAuthLogos.js +28 -28
- package/dist/modal/stores/modal/actions.js +2 -2
- package/dist/modal/stores/modal/useModalStore.d.ts +8 -2
- package/dist/modal/stores/modal/useModalStore.js +1 -1
- package/dist/provider/components/ExternalWalletWrapper.js +3 -26
- package/dist/provider/hooks/mutations/index.d.ts +28 -2
- package/dist/provider/hooks/mutations/index.js +57 -3
- package/dist/provider/hooks/mutations/useClaimPregenWallets.d.ts +40 -0
- package/dist/provider/hooks/mutations/useClaimPregenWallets.js +28 -0
- package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +33 -0
- package/dist/provider/hooks/mutations/useCreateGuestWallets.js +28 -0
- package/dist/provider/hooks/mutations/useCreatePregenWallet.d.ts +120 -0
- package/dist/provider/hooks/mutations/useCreatePregenWallet.js +28 -0
- package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.d.ts +42 -0
- package/dist/provider/hooks/mutations/useCreatePregenWalletPerType.js +28 -0
- package/dist/provider/hooks/mutations/useCreateWallet.d.ts +42 -0
- package/dist/provider/hooks/mutations/useCreateWallet.js +28 -0
- package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +54 -0
- package/dist/provider/hooks/mutations/useCreateWalletPerType.js +28 -0
- package/dist/provider/hooks/mutations/useEnable2fa.d.ts +39 -0
- package/dist/provider/hooks/mutations/useEnable2fa.js +28 -0
- package/dist/provider/hooks/mutations/useHasPregenWallet.d.ts +40 -0
- package/dist/provider/hooks/mutations/useHasPregenWallet.js +28 -0
- package/dist/provider/hooks/mutations/useIssueJwt.d.ts +48 -0
- package/dist/provider/hooks/mutations/useIssueJwt.js +28 -0
- package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +34 -0
- package/dist/provider/hooks/mutations/useKeepSessionAlive.js +28 -0
- package/dist/provider/hooks/mutations/useLinkAccount.d.ts +30 -1
- package/dist/provider/hooks/mutations/useLinkAccount.js +3 -1
- package/dist/provider/hooks/mutations/useLoginExternalWallet.d.ts +46 -0
- package/dist/provider/hooks/mutations/useLoginExternalWallet.js +28 -0
- package/dist/provider/hooks/mutations/useLogout.d.ts +39 -0
- package/dist/provider/hooks/mutations/useLogout.js +28 -0
- package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +40 -0
- package/dist/provider/hooks/mutations/useResendVerificationCode.js +28 -0
- package/dist/provider/hooks/mutations/useSetup2fa.d.ts +34 -0
- package/dist/provider/hooks/mutations/useSetup2fa.js +28 -0
- package/dist/provider/hooks/mutations/useSignMessage.d.ts +58 -0
- package/dist/provider/hooks/mutations/useSignMessage.js +28 -0
- package/dist/provider/hooks/mutations/useSignTransaction.d.ts +58 -0
- package/dist/provider/hooks/mutations/useSignTransaction.js +28 -0
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.d.ts +46 -0
- package/dist/provider/hooks/mutations/useSignUpOrLogIn.js +28 -0
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.d.ts +42 -0
- package/dist/provider/hooks/mutations/useUpdatePregenWalletIdentifier.js +28 -0
- package/dist/provider/hooks/mutations/useVerify2fa.d.ts +57 -0
- package/dist/provider/hooks/mutations/useVerify2fa.js +28 -0
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +93 -0
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.js +28 -0
- package/dist/provider/hooks/mutations/useVerifyFarcaster.d.ts +55 -0
- package/dist/provider/hooks/mutations/useVerifyFarcaster.js +28 -0
- package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +84 -0
- package/dist/provider/hooks/mutations/useVerifyNewAccount.js +28 -0
- package/dist/provider/hooks/mutations/useVerifyOAuth.d.ts +64 -0
- package/dist/provider/hooks/mutations/useVerifyOAuth.js +28 -0
- package/dist/provider/hooks/mutations/useVerifyTelegram.d.ts +46 -0
- package/dist/provider/hooks/mutations/useVerifyTelegram.js +28 -0
- package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +57 -0
- package/dist/provider/hooks/mutations/useWaitForLogin.js +28 -0
- package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +45 -0
- package/dist/provider/hooks/mutations/useWaitForSignup.js +28 -0
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +54 -0
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.js +28 -0
- package/dist/provider/hooks/mutations/utils.d.ts +2 -7
- package/dist/provider/hooks/mutations/utils.js +0 -24
- package/dist/provider/hooks/queries/index.d.ts +2 -1
- package/dist/provider/hooks/queries/index.js +4 -1
- package/dist/provider/hooks/queries/useAccountLinkInProgress.d.ts +6 -0
- package/dist/provider/hooks/queries/useAccountLinkInProgress.js +24 -0
- package/dist/provider/hooks/queries/useLinkedAccounts.d.ts +11 -0
- package/dist/provider/hooks/queries/useLinkedAccounts.js +24 -0
- package/dist/provider/providers/AccountLinkProvider.d.ts +4 -4
- package/dist/provider/providers/AccountLinkProvider.js +17 -13
- package/dist/provider/providers/AuthProvider.d.ts +0 -1
- package/dist/provider/providers/AuthProvider.js +18 -45
- package/dist/provider/providers/ExternalWalletProvider.d.ts +6 -5
- package/dist/provider/providers/ExternalWalletProvider.js +21 -26
- package/dist/provider/utils/externalWalletDefaults.d.ts +6 -0
- package/dist/provider/utils/externalWalletDefaults.js +33 -0
- package/dist/provider/utils/renameMutations.d.ts +9 -5
- package/dist/provider/utils/renameMutations.js +3 -5
- package/package.json +8 -8
- package/dist/provider/hooks/mutations/core.d.ts +0 -27
- package/dist/provider/hooks/mutations/core.js +0 -66
- package/dist/provider/hooks/queries/core.d.ts +0 -4
- package/dist/provider/hooks/queries/core.js +0 -16
- package/dist/provider/hooks/queries/utils.d.ts +0 -7
- package/dist/provider/hooks/queries/utils.js +0 -25
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { verifyExternalWallet } from "../../actions/index.js";
|
|
9
|
+
const VERIFY_EXTERNAL_WALLET_KEY = "VERIFY_EXTERNAL_WALLET";
|
|
10
|
+
const useVerifyExternalWallet = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [VERIFY_EXTERNAL_WALLET_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield verifyExternalWallet(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "verifyExternalWallet");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
VERIFY_EXTERNAL_WALLET_KEY,
|
|
27
|
+
useVerifyExternalWallet
|
|
28
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Compute } from '../../types/utils.js';
|
|
2
|
+
export declare const VERIFY_FARCASTER_KEY = "VERIFY_FARCASTER";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `verifyFarcaster` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `verifyFarcaster`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `verifyFarcasterAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { verifyFarcaster, verifyFarcasterAsync } = useVerifyFarcaster();
|
|
13
|
+
* verifyFarcaster({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await verifyFarcasterAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useVerifyFarcaster: () => {
|
|
18
|
+
status: "error" | "idle" | "pending" | "success";
|
|
19
|
+
data: Compute<import("@getpara/core-sdk/dist/types/types/methods.js").AuthStateSignupOrLogin> | undefined;
|
|
20
|
+
isSuccess: boolean;
|
|
21
|
+
variables: {
|
|
22
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
23
|
+
useShortUrls?: boolean | undefined;
|
|
24
|
+
onPoll?: (() => void) | undefined;
|
|
25
|
+
onCancel?: (() => void) | undefined;
|
|
26
|
+
isCanceled?: (() => boolean) | undefined;
|
|
27
|
+
onConnectUri?: ((uri: string) => void) | undefined;
|
|
28
|
+
} | undefined;
|
|
29
|
+
error: Error | null;
|
|
30
|
+
isError: boolean;
|
|
31
|
+
isIdle: boolean;
|
|
32
|
+
isPending: boolean;
|
|
33
|
+
reset: () => void;
|
|
34
|
+
context: unknown;
|
|
35
|
+
failureCount: number;
|
|
36
|
+
failureReason: Error | null;
|
|
37
|
+
isPaused: boolean;
|
|
38
|
+
submittedAt: number;
|
|
39
|
+
verifyFarcaster: import("@tanstack/react-query").UseMutateFunction<Compute<import("@getpara/core-sdk/dist/types/types/methods.js").AuthStateSignupOrLogin>, Error, {
|
|
40
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
41
|
+
useShortUrls?: boolean | undefined;
|
|
42
|
+
onPoll?: (() => void) | undefined;
|
|
43
|
+
onCancel?: (() => void) | undefined;
|
|
44
|
+
isCanceled?: (() => boolean) | undefined;
|
|
45
|
+
onConnectUri?: ((uri: string) => void) | undefined;
|
|
46
|
+
}, unknown>;
|
|
47
|
+
verifyFarcasterAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Compute<import("@getpara/core-sdk/dist/types/types/methods.js").AuthStateSignupOrLogin>, Error, {
|
|
48
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
49
|
+
useShortUrls?: boolean | undefined;
|
|
50
|
+
onPoll?: (() => void) | undefined;
|
|
51
|
+
onCancel?: (() => void) | undefined;
|
|
52
|
+
isCanceled?: (() => boolean) | undefined;
|
|
53
|
+
onConnectUri?: ((uri: string) => void) | undefined;
|
|
54
|
+
}, unknown>;
|
|
55
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { verifyFarcaster } from "../../actions/index.js";
|
|
9
|
+
const VERIFY_FARCASTER_KEY = "VERIFY_FARCASTER";
|
|
10
|
+
const useVerifyFarcaster = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [VERIFY_FARCASTER_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield verifyFarcaster(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "verifyFarcaster");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
VERIFY_FARCASTER_KEY,
|
|
27
|
+
useVerifyFarcaster
|
|
28
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export declare const VERIFY_NEW_ACCOUNT_KEY = "VERIFY_NEW_ACCOUNT";
|
|
2
|
+
/**
|
|
3
|
+
* React hook for the `verifyNewAccount` mutation.
|
|
4
|
+
*
|
|
5
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
6
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
7
|
+
* - `verifyNewAccount`: function to trigger the mutation (same as `mutate`)
|
|
8
|
+
* - `verifyNewAccountAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { verifyNewAccount, verifyNewAccountAsync } = useVerifyNewAccount();
|
|
12
|
+
* verifyNewAccount({ ...params });
|
|
13
|
+
* // or
|
|
14
|
+
* await verifyNewAccountAsync({ ...params });
|
|
15
|
+
*/
|
|
16
|
+
export declare const useVerifyNewAccount: () => {
|
|
17
|
+
status: "error" | "idle" | "pending" | "success";
|
|
18
|
+
data: {
|
|
19
|
+
username?: string | undefined;
|
|
20
|
+
displayName?: string | undefined;
|
|
21
|
+
pfpUrl?: string | undefined;
|
|
22
|
+
externalWallet?: import("@getpara/web-sdk").ExternalWalletInfo | undefined;
|
|
23
|
+
auth: import("@getpara/user-management-client").PrimaryAuth;
|
|
24
|
+
userId: string;
|
|
25
|
+
stage: "signup";
|
|
26
|
+
isPasskeySupported: boolean;
|
|
27
|
+
passkeyUrl?: string | undefined;
|
|
28
|
+
passwordUrl?: string | undefined;
|
|
29
|
+
passkeyId?: string | undefined;
|
|
30
|
+
passwordId?: string | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
isSuccess: boolean;
|
|
33
|
+
variables: {
|
|
34
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
35
|
+
useShortUrls?: boolean | undefined;
|
|
36
|
+
verificationCode: string;
|
|
37
|
+
} | undefined;
|
|
38
|
+
error: Error | null;
|
|
39
|
+
isError: boolean;
|
|
40
|
+
isIdle: boolean;
|
|
41
|
+
isPending: boolean;
|
|
42
|
+
reset: () => void;
|
|
43
|
+
context: unknown;
|
|
44
|
+
failureCount: number;
|
|
45
|
+
failureReason: Error | null;
|
|
46
|
+
isPaused: boolean;
|
|
47
|
+
submittedAt: number;
|
|
48
|
+
verifyNewAccount: import("@tanstack/react-query").UseMutateFunction<{
|
|
49
|
+
username?: string | undefined;
|
|
50
|
+
displayName?: string | undefined;
|
|
51
|
+
pfpUrl?: string | undefined;
|
|
52
|
+
externalWallet?: import("@getpara/web-sdk").ExternalWalletInfo | undefined;
|
|
53
|
+
auth: import("@getpara/user-management-client").PrimaryAuth;
|
|
54
|
+
userId: string;
|
|
55
|
+
stage: "signup";
|
|
56
|
+
isPasskeySupported: boolean;
|
|
57
|
+
passkeyUrl?: string | undefined;
|
|
58
|
+
passwordUrl?: string | undefined;
|
|
59
|
+
passkeyId?: string | undefined;
|
|
60
|
+
passwordId?: string | undefined;
|
|
61
|
+
}, Error, {
|
|
62
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
63
|
+
useShortUrls?: boolean | undefined;
|
|
64
|
+
verificationCode: string;
|
|
65
|
+
}, unknown>;
|
|
66
|
+
verifyNewAccountAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
67
|
+
username?: string | undefined;
|
|
68
|
+
displayName?: string | undefined;
|
|
69
|
+
pfpUrl?: string | undefined;
|
|
70
|
+
externalWallet?: import("@getpara/web-sdk").ExternalWalletInfo | undefined;
|
|
71
|
+
auth: import("@getpara/user-management-client").PrimaryAuth;
|
|
72
|
+
userId: string;
|
|
73
|
+
stage: "signup";
|
|
74
|
+
isPasskeySupported: boolean;
|
|
75
|
+
passkeyUrl?: string | undefined;
|
|
76
|
+
passwordUrl?: string | undefined;
|
|
77
|
+
passkeyId?: string | undefined;
|
|
78
|
+
passwordId?: string | undefined;
|
|
79
|
+
}, Error, {
|
|
80
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
81
|
+
useShortUrls?: boolean | undefined;
|
|
82
|
+
verificationCode: string;
|
|
83
|
+
}, unknown>;
|
|
84
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { verifyNewAccount } from "../../actions/index.js";
|
|
9
|
+
const VERIFY_NEW_ACCOUNT_KEY = "VERIFY_NEW_ACCOUNT";
|
|
10
|
+
const useVerifyNewAccount = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [VERIFY_NEW_ACCOUNT_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield verifyNewAccount(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "verifyNewAccount");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
VERIFY_NEW_ACCOUNT_KEY,
|
|
27
|
+
useVerifyNewAccount
|
|
28
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Compute } from '../../types/utils.js';
|
|
2
|
+
export declare const VERIFY_OAUTH_KEY = "VERIFY_OAUTH";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `verifyOAuth` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `verifyOAuth`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `verifyOAuthAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { verifyOAuth, verifyOAuthAsync } = useVerifyOAuth();
|
|
13
|
+
* verifyOAuth({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await verifyOAuthAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useVerifyOAuth: () => {
|
|
18
|
+
status: "error" | "idle" | "pending" | "success";
|
|
19
|
+
data: Compute<import("@getpara/core-sdk/dist/types/types/methods.js").AuthStateSignupOrLogin> | undefined;
|
|
20
|
+
isSuccess: boolean;
|
|
21
|
+
variables: {
|
|
22
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
23
|
+
useShortUrls?: boolean | undefined;
|
|
24
|
+
method: Exclude<import("@getpara/web-sdk").TOAuthMethod, "TELEGRAM" | "FARCASTER">;
|
|
25
|
+
appScheme?: string | undefined;
|
|
26
|
+
onPoll?: (() => void) | undefined;
|
|
27
|
+
onCancel?: (() => void) | undefined;
|
|
28
|
+
isCanceled?: (() => boolean) | undefined;
|
|
29
|
+
onOAuthUrl?: ((url: string) => void) | undefined;
|
|
30
|
+
onOAuthPopup?: ((popup: Window) => void) | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
error: Error | null;
|
|
33
|
+
isError: boolean;
|
|
34
|
+
isIdle: boolean;
|
|
35
|
+
isPending: boolean;
|
|
36
|
+
reset: () => void;
|
|
37
|
+
context: unknown;
|
|
38
|
+
failureCount: number;
|
|
39
|
+
failureReason: Error | null;
|
|
40
|
+
isPaused: boolean;
|
|
41
|
+
submittedAt: number;
|
|
42
|
+
verifyOAuth: import("@tanstack/react-query").UseMutateFunction<Compute<import("@getpara/core-sdk/dist/types/types/methods.js").AuthStateSignupOrLogin>, Error, {
|
|
43
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
44
|
+
useShortUrls?: boolean | undefined;
|
|
45
|
+
method: Exclude<import("@getpara/web-sdk").TOAuthMethod, "TELEGRAM" | "FARCASTER">;
|
|
46
|
+
appScheme?: string | undefined;
|
|
47
|
+
onPoll?: (() => void) | undefined;
|
|
48
|
+
onCancel?: (() => void) | undefined;
|
|
49
|
+
isCanceled?: (() => boolean) | undefined;
|
|
50
|
+
onOAuthUrl?: ((url: string) => void) | undefined;
|
|
51
|
+
onOAuthPopup?: ((popup: Window) => void) | undefined;
|
|
52
|
+
}, unknown>;
|
|
53
|
+
verifyOAuthAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Compute<import("@getpara/core-sdk/dist/types/types/methods.js").AuthStateSignupOrLogin>, Error, {
|
|
54
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
55
|
+
useShortUrls?: boolean | undefined;
|
|
56
|
+
method: Exclude<import("@getpara/web-sdk").TOAuthMethod, "TELEGRAM" | "FARCASTER">;
|
|
57
|
+
appScheme?: string | undefined;
|
|
58
|
+
onPoll?: (() => void) | undefined;
|
|
59
|
+
onCancel?: (() => void) | undefined;
|
|
60
|
+
isCanceled?: (() => boolean) | undefined;
|
|
61
|
+
onOAuthUrl?: ((url: string) => void) | undefined;
|
|
62
|
+
onOAuthPopup?: ((popup: Window) => void) | undefined;
|
|
63
|
+
}, unknown>;
|
|
64
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { verifyOAuth } from "../../actions/index.js";
|
|
9
|
+
const VERIFY_OAUTH_KEY = "VERIFY_OAUTH";
|
|
10
|
+
const useVerifyOAuth = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [VERIFY_OAUTH_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield verifyOAuth(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "verifyOAuth");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
VERIFY_OAUTH_KEY,
|
|
27
|
+
useVerifyOAuth
|
|
28
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Compute } from '../../types/utils.js';
|
|
2
|
+
export declare const VERIFY_TELEGRAM_KEY = "VERIFY_TELEGRAM";
|
|
3
|
+
/**
|
|
4
|
+
* React hook for the `verifyTelegram` mutation.
|
|
5
|
+
*
|
|
6
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
7
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
8
|
+
* - `verifyTelegram`: function to trigger the mutation (same as `mutate`)
|
|
9
|
+
* - `verifyTelegramAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const { verifyTelegram, verifyTelegramAsync } = useVerifyTelegram();
|
|
13
|
+
* verifyTelegram({ ...params });
|
|
14
|
+
* // or
|
|
15
|
+
* await verifyTelegramAsync({ ...params });
|
|
16
|
+
*/
|
|
17
|
+
export declare const useVerifyTelegram: () => {
|
|
18
|
+
status: "error" | "idle" | "pending" | "success";
|
|
19
|
+
data: Compute<import("@getpara/core-sdk/dist/types/types/methods.js").AuthStateSignupOrLogin> | undefined;
|
|
20
|
+
isSuccess: boolean;
|
|
21
|
+
variables: {
|
|
22
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
23
|
+
useShortUrls?: boolean | undefined;
|
|
24
|
+
telegramAuthResponse: import("@getpara/web-sdk").TelegramAuthResponse;
|
|
25
|
+
} | undefined;
|
|
26
|
+
error: Error | null;
|
|
27
|
+
isError: boolean;
|
|
28
|
+
isIdle: boolean;
|
|
29
|
+
isPending: boolean;
|
|
30
|
+
reset: () => void;
|
|
31
|
+
context: unknown;
|
|
32
|
+
failureCount: number;
|
|
33
|
+
failureReason: Error | null;
|
|
34
|
+
isPaused: boolean;
|
|
35
|
+
submittedAt: number;
|
|
36
|
+
verifyTelegram: import("@tanstack/react-query").UseMutateFunction<Compute<import("@getpara/core-sdk/dist/types/types/methods.js").AuthStateSignupOrLogin>, Error, {
|
|
37
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
38
|
+
useShortUrls?: boolean | undefined;
|
|
39
|
+
telegramAuthResponse: import("@getpara/web-sdk").TelegramAuthResponse;
|
|
40
|
+
}, unknown>;
|
|
41
|
+
verifyTelegramAsync: import("@tanstack/react-query").UseMutateAsyncFunction<Compute<import("@getpara/core-sdk/dist/types/types/methods.js").AuthStateSignupOrLogin>, Error, {
|
|
42
|
+
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
43
|
+
useShortUrls?: boolean | undefined;
|
|
44
|
+
telegramAuthResponse: import("@getpara/web-sdk").TelegramAuthResponse;
|
|
45
|
+
}, unknown>;
|
|
46
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { verifyTelegram } from "../../actions/index.js";
|
|
9
|
+
const VERIFY_TELEGRAM_KEY = "VERIFY_TELEGRAM";
|
|
10
|
+
const useVerifyTelegram = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [VERIFY_TELEGRAM_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield verifyTelegram(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "verifyTelegram");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
VERIFY_TELEGRAM_KEY,
|
|
27
|
+
useVerifyTelegram
|
|
28
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const WAIT_FOR_LOG_IN_KEY = "WAIT_FOR_LOG_IN";
|
|
2
|
+
/**
|
|
3
|
+
* React hook for the `waitForLogin` mutation.
|
|
4
|
+
*
|
|
5
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
6
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
7
|
+
* - `waitForLogin`: function to trigger the mutation (same as `mutate`)
|
|
8
|
+
* - `waitForLoginAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { waitForLogin, waitForLoginAsync } = useWaitForLogin();
|
|
12
|
+
* waitForLogin({ ...params });
|
|
13
|
+
* // or
|
|
14
|
+
* await waitForLoginAsync({ ...params });
|
|
15
|
+
*/
|
|
16
|
+
export declare const useWaitForLogin: () => {
|
|
17
|
+
status: "error" | "idle" | "pending" | "success";
|
|
18
|
+
data: {
|
|
19
|
+
needsWallet?: boolean | undefined;
|
|
20
|
+
partnerId?: string | undefined;
|
|
21
|
+
} | undefined;
|
|
22
|
+
isSuccess: boolean;
|
|
23
|
+
variables: {
|
|
24
|
+
onPoll?: (() => void) | undefined;
|
|
25
|
+
onCancel?: (() => void) | undefined;
|
|
26
|
+
skipSessionRefresh?: boolean | undefined;
|
|
27
|
+
isCanceled?: (() => boolean) | undefined;
|
|
28
|
+
} | undefined;
|
|
29
|
+
error: Error | null;
|
|
30
|
+
isError: boolean;
|
|
31
|
+
isIdle: boolean;
|
|
32
|
+
isPending: boolean;
|
|
33
|
+
reset: () => void;
|
|
34
|
+
context: unknown;
|
|
35
|
+
failureCount: number;
|
|
36
|
+
failureReason: Error | null;
|
|
37
|
+
isPaused: boolean;
|
|
38
|
+
submittedAt: number;
|
|
39
|
+
waitForLogin: import("@tanstack/react-query").UseMutateFunction<{
|
|
40
|
+
needsWallet?: boolean | undefined;
|
|
41
|
+
partnerId?: string | undefined;
|
|
42
|
+
}, Error, {
|
|
43
|
+
onPoll?: (() => void) | undefined;
|
|
44
|
+
onCancel?: (() => void) | undefined;
|
|
45
|
+
skipSessionRefresh?: boolean | undefined;
|
|
46
|
+
isCanceled?: (() => boolean) | undefined;
|
|
47
|
+
}, unknown>;
|
|
48
|
+
waitForLoginAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
49
|
+
needsWallet?: boolean | undefined;
|
|
50
|
+
partnerId?: string | undefined;
|
|
51
|
+
}, Error, {
|
|
52
|
+
onPoll?: (() => void) | undefined;
|
|
53
|
+
onCancel?: (() => void) | undefined;
|
|
54
|
+
skipSessionRefresh?: boolean | undefined;
|
|
55
|
+
isCanceled?: (() => boolean) | undefined;
|
|
56
|
+
}, unknown>;
|
|
57
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { waitForLogin } from "../../actions/index.js";
|
|
9
|
+
const WAIT_FOR_LOG_IN_KEY = "WAIT_FOR_LOG_IN";
|
|
10
|
+
const useWaitForLogin = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [WAIT_FOR_LOG_IN_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield waitForLogin(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "waitForLogin");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
WAIT_FOR_LOG_IN_KEY,
|
|
27
|
+
useWaitForLogin
|
|
28
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const WAIT_FOR_SIGN_UP_KEY = "WAIT_FOR_SIGN_UP";
|
|
2
|
+
/**
|
|
3
|
+
* React hook for the `waitForSignup` mutation.
|
|
4
|
+
*
|
|
5
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
6
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
7
|
+
* - `waitForSignup`: function to trigger the mutation (same as `mutate`)
|
|
8
|
+
* - `waitForSignupAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { waitForSignup, waitForSignupAsync } = useWaitForSignup();
|
|
12
|
+
* waitForSignup({ ...params });
|
|
13
|
+
* // or
|
|
14
|
+
* await waitForSignupAsync({ ...params });
|
|
15
|
+
*/
|
|
16
|
+
export declare const useWaitForSignup: () => {
|
|
17
|
+
status: "error" | "idle" | "pending" | "success";
|
|
18
|
+
data: true | undefined;
|
|
19
|
+
isSuccess: boolean;
|
|
20
|
+
variables: {
|
|
21
|
+
onPoll?: (() => void) | undefined;
|
|
22
|
+
onCancel?: (() => void) | undefined;
|
|
23
|
+
isCanceled?: (() => boolean) | undefined;
|
|
24
|
+
} | undefined;
|
|
25
|
+
error: Error | null;
|
|
26
|
+
isError: boolean;
|
|
27
|
+
isIdle: boolean;
|
|
28
|
+
isPending: boolean;
|
|
29
|
+
reset: () => void;
|
|
30
|
+
context: unknown;
|
|
31
|
+
failureCount: number;
|
|
32
|
+
failureReason: Error | null;
|
|
33
|
+
isPaused: boolean;
|
|
34
|
+
submittedAt: number;
|
|
35
|
+
waitForSignup: import("@tanstack/react-query").UseMutateFunction<true, Error, {
|
|
36
|
+
onPoll?: (() => void) | undefined;
|
|
37
|
+
onCancel?: (() => void) | undefined;
|
|
38
|
+
isCanceled?: (() => boolean) | undefined;
|
|
39
|
+
}, unknown>;
|
|
40
|
+
waitForSignupAsync: import("@tanstack/react-query").UseMutateAsyncFunction<true, Error, {
|
|
41
|
+
onPoll?: (() => void) | undefined;
|
|
42
|
+
onCancel?: (() => void) | undefined;
|
|
43
|
+
isCanceled?: (() => boolean) | undefined;
|
|
44
|
+
}, unknown>;
|
|
45
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { waitForSignup } from "../../actions/index.js";
|
|
9
|
+
const WAIT_FOR_SIGN_UP_KEY = "WAIT_FOR_SIGN_UP";
|
|
10
|
+
const useWaitForSignup = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [WAIT_FOR_SIGN_UP_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield waitForSignup(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "waitForSignup");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
WAIT_FOR_SIGN_UP_KEY,
|
|
27
|
+
useWaitForSignup
|
|
28
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare const WAIT_FOR_WALLET_CREATION_KEY = "WAIT_FOR_WALLET_CREATION";
|
|
2
|
+
/**
|
|
3
|
+
* React hook for the `waitForWalletCreation` mutation.
|
|
4
|
+
*
|
|
5
|
+
* Returns a mutation result object with all standard fields from `useMutation`, except:
|
|
6
|
+
* - `mutate` and `mutateAsync` are replaced by:
|
|
7
|
+
* - `waitForWalletCreation`: function to trigger the mutation (same as `mutate`)
|
|
8
|
+
* - `waitForWalletCreationAsync`: async function to trigger the mutation (same as `mutateAsync`)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const { waitForWalletCreation, waitForWalletCreationAsync } = useWaitForWalletCreation();
|
|
12
|
+
* waitForWalletCreation({ ...params });
|
|
13
|
+
* // or
|
|
14
|
+
* await waitForWalletCreationAsync({ ...params });
|
|
15
|
+
*/
|
|
16
|
+
export declare const useWaitForWalletCreation: () => {
|
|
17
|
+
status: "error" | "idle" | "pending" | "success";
|
|
18
|
+
data: {
|
|
19
|
+
walletIds: import("@getpara/web-sdk").CurrentWalletIds;
|
|
20
|
+
recoverySecret?: string | undefined;
|
|
21
|
+
} | undefined;
|
|
22
|
+
isSuccess: boolean;
|
|
23
|
+
variables: {
|
|
24
|
+
onPoll?: (() => void) | undefined;
|
|
25
|
+
onCancel?: (() => void) | undefined;
|
|
26
|
+
isCanceled?: (() => boolean) | undefined;
|
|
27
|
+
} | undefined;
|
|
28
|
+
error: Error | null;
|
|
29
|
+
isError: boolean;
|
|
30
|
+
isIdle: boolean;
|
|
31
|
+
isPending: boolean;
|
|
32
|
+
reset: () => void;
|
|
33
|
+
context: unknown;
|
|
34
|
+
failureCount: number;
|
|
35
|
+
failureReason: Error | null;
|
|
36
|
+
isPaused: boolean;
|
|
37
|
+
submittedAt: number;
|
|
38
|
+
waitForWalletCreation: import("@tanstack/react-query").UseMutateFunction<{
|
|
39
|
+
walletIds: import("@getpara/web-sdk").CurrentWalletIds;
|
|
40
|
+
recoverySecret?: string | undefined;
|
|
41
|
+
}, Error, {
|
|
42
|
+
onPoll?: (() => void) | undefined;
|
|
43
|
+
onCancel?: (() => void) | undefined;
|
|
44
|
+
isCanceled?: (() => boolean) | undefined;
|
|
45
|
+
}, unknown>;
|
|
46
|
+
waitForWalletCreationAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
47
|
+
walletIds: import("@getpara/web-sdk").CurrentWalletIds;
|
|
48
|
+
recoverySecret?: string | undefined;
|
|
49
|
+
}, Error, {
|
|
50
|
+
onPoll?: (() => void) | undefined;
|
|
51
|
+
onCancel?: (() => void) | undefined;
|
|
52
|
+
isCanceled?: (() => boolean) | undefined;
|
|
53
|
+
}, unknown>;
|
|
54
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
+
import { useMutation } from "@tanstack/react-query";
|
|
6
|
+
import { useClient } from "../utils/index.js";
|
|
7
|
+
import { renameMutations } from "../../utils/renameMutations.js";
|
|
8
|
+
import { waitForWalletCreation } from "../../actions/index.js";
|
|
9
|
+
const WAIT_FOR_WALLET_CREATION_KEY = "WAIT_FOR_WALLET_CREATION";
|
|
10
|
+
const useWaitForWalletCreation = () => {
|
|
11
|
+
const para = useClient();
|
|
12
|
+
const mutation = useMutation({
|
|
13
|
+
mutationKey: [WAIT_FOR_WALLET_CREATION_KEY],
|
|
14
|
+
mutationFn: (args) => __async(void 0, null, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const result = yield waitForWalletCreation(para, args);
|
|
17
|
+
return result;
|
|
18
|
+
} catch (error) {
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
return renameMutations(mutation, "waitForWalletCreation");
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
WAIT_FOR_WALLET_CREATION_KEY,
|
|
27
|
+
useWaitForWalletCreation
|
|
28
|
+
};
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { CoreMethodName,
|
|
2
|
-
import {
|
|
3
|
-
import { CoreAction } from '../../actions/utils.js';
|
|
4
|
-
export declare function generateCoreMutation<const method extends CoreMethodName & keyof CoreMethods>(method: method, action: CoreAction<method>, { delay, defaultParams, }?: {
|
|
5
|
-
delay?: number;
|
|
6
|
-
defaultParams?: CoreMethodParams<method>;
|
|
7
|
-
}): () => CoreMethodMutationHook<method>;
|
|
1
|
+
import { CoreMethodName, CoreMethods, InternalAction, InternalMethodName, InternalMethodParams, InternalMethods } from '@getpara/web-sdk';
|
|
2
|
+
import { CoreMethodMutationStateHook, InternalMethodMutationHook } from '../../types/utils.js';
|
|
8
3
|
export declare function generateInternalMutation<const method extends InternalMethodName & keyof InternalMethods>(method: method, action: InternalAction<method>, { delay, defaultParams, }?: {
|
|
9
4
|
delay?: number;
|
|
10
5
|
defaultParams?: InternalMethodParams<method>;
|