@getpara/react-sdk 1.12.0 → 2.0.0-alpha.5
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/cli/cli.mjs +35 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -0
- package/dist/modal/ParaModal.js +211 -313
- package/dist/modal/components/Account/Account.js +66 -12
- package/dist/modal/components/AddFunds/AddFunds.js +5 -6
- package/dist/modal/components/AddFunds/AddFundsAsset.js +15 -13
- package/dist/modal/components/AddFunds/AddFundsAwaiting.js +16 -10
- package/dist/modal/components/AddFunds/AddFundsContext.d.ts +2 -2
- package/dist/modal/components/AddFunds/AddFundsContext.js +20 -14
- package/dist/modal/components/AddFunds/AddFundsDone.js +10 -4
- package/dist/modal/components/AddFunds/AddFundsProvider.js +11 -7
- package/dist/modal/components/AddFunds/AddFundsReceive.js +17 -13
- package/dist/modal/components/AddFunds/AddFundsSettings.js +10 -6
- package/dist/modal/components/AddFunds/common.d.ts +1 -1
- package/dist/modal/components/AuthInput/AuthInput.d.ts +1 -1
- package/dist/modal/components/AuthInput/AuthInput.js +70 -91
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +4 -4
- package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +4 -4
- package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +4 -3
- package/dist/modal/components/AuthMainStep/AuthMainStep.js +20 -7
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +4 -3
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +54 -10
- package/dist/modal/components/AuthOptions/AuthOptions.d.ts +4 -3
- package/dist/modal/components/AuthOptions/AuthOptions.js +42 -8
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +5 -1
- package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +9 -4
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +1 -3
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +25 -17
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +1 -1
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +34 -72
- package/dist/modal/components/Body/Body.d.ts +4 -3
- package/dist/modal/components/Body/Body.js +27 -10
- package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +1 -1
- package/dist/modal/components/ChainSwitch/ChainSwitch.js +5 -4
- package/dist/modal/components/Controls/Controls.js +5 -2
- package/dist/modal/components/Controls/Selects.d.ts +1 -1
- package/dist/modal/components/Controls/Selects.js +30 -25
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +1 -1
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +10 -6
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +7 -69
- package/dist/modal/components/ExternalWallets/ExternalWallets.js +7 -6
- package/dist/modal/components/Footer/Footer.d.ts +1 -1
- package/dist/modal/components/Footer/Footer.js +6 -4
- package/dist/modal/components/Header/hooks/useStepTitle.js +7 -3
- package/dist/modal/components/Hero/Hero.js +5 -5
- package/dist/modal/components/IFrameStep/IFrameStep.js +8 -4
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +7 -4
- package/dist/modal/components/ModalContent/ModalContent.js +14 -243
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +3 -57
- package/dist/modal/components/OAuth/OAuth.d.ts +2 -2
- package/dist/modal/components/OAuth/OAuth.js +11 -85
- package/dist/modal/components/OAuth/TelegramOAuthStep.js +11 -60
- package/dist/modal/components/OnRampComponents/AddingFunds.js +1 -1
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +10 -4
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +23 -32
- package/dist/modal/components/StripeComponents/StripeComponents.js +1 -1
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +5 -2
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +44 -60
- package/dist/modal/components/WalletCard/WalletCard.d.ts +5 -5
- package/dist/modal/components/WalletCard/WalletCard.js +8 -7
- package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +33 -12
- package/dist/modal/components/common.d.ts +5 -5
- package/dist/modal/components/common.js +10 -4
- package/dist/modal/constants/constants.d.ts +1 -1
- package/dist/modal/constants/oAuthLogos.d.ts +3 -3
- package/dist/modal/hooks/useGoBack.js +6 -5
- package/dist/modal/index.d.ts +0 -3
- package/dist/modal/index.js +1 -5
- package/dist/modal/stores/index.d.ts +0 -2
- package/dist/modal/stores/index.js +0 -2
- package/dist/modal/stores/modal/actions.js +69 -16
- package/dist/modal/stores/modal/useModalStore.d.ts +26 -22
- package/dist/modal/stores/modal/useModalStore.js +9 -13
- package/dist/modal/types/commonTypes.d.ts +0 -52
- package/dist/modal/types/modalProps.d.ts +8 -32
- package/dist/modal/utils/authInputHelpers.d.ts +7 -0
- package/dist/modal/utils/authInputHelpers.js +38 -0
- package/dist/modal/utils/authLayoutHelpers.d.ts +2 -2
- package/dist/modal/{components/AuthInput → utils}/countryCodes.js +6 -3
- package/dist/modal/utils/getTileButtonFlex.d.ts +1 -1
- package/dist/modal/utils/isPasskeySupported.d.ts +1 -0
- package/dist/modal/utils/isPasskeySupported.js +15 -0
- package/dist/modal/utils/openPopup.d.ts +2 -2
- package/dist/modal/utils/openPopup.js +2 -2
- package/dist/modal/utils/steps.d.ts +6 -0
- package/dist/modal/utils/steps.js +15 -0
- package/dist/provider/ParaProvider.d.ts +3 -1
- package/dist/provider/ParaProvider.js +69 -8
- package/dist/provider/actions/getAccount.d.ts +26 -8
- package/dist/provider/actions/getAccount.js +42 -14
- package/dist/provider/actions/getWallet.d.ts +3 -3
- package/dist/provider/actions/index.d.ts +27 -0
- package/dist/provider/actions/index.js +59 -0
- package/dist/provider/actions/utils.d.ts +3 -0
- package/dist/provider/actions/utils.js +15 -0
- package/dist/provider/components/CosmosWalletWrapper.d.ts +11 -0
- package/dist/provider/components/CosmosWalletWrapper.js +34 -0
- package/dist/provider/components/EvmWalletWrapper.d.ts +12 -0
- package/dist/provider/components/EvmWalletWrapper.js +34 -0
- package/dist/provider/components/ExternalWalletWrapper.d.ts +8 -0
- package/dist/provider/components/ExternalWalletWrapper.js +139 -0
- package/dist/provider/components/SolanaWalletWrapper.d.ts +9 -0
- package/dist/provider/components/SolanaWalletWrapper.js +36 -0
- package/dist/provider/external/getParaCosmosConnector.d.ts +7 -0
- package/dist/provider/external/getParaCosmosConnector.js +22 -0
- package/dist/provider/external/getParaEvmConnector.d.ts +7 -0
- package/dist/provider/external/getParaEvmConnector.js +22 -0
- package/dist/provider/external/getParaSolanaConnector.d.ts +7 -0
- package/dist/provider/external/getParaSolanaConnector.js +22 -0
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +12 -0
- package/dist/provider/external/stubs/CosmosExternalWalletContextStub.js +18 -0
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +3 -0
- package/dist/provider/external/stubs/EvmExternalWalletContextStub.js +21 -0
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +8 -0
- package/dist/provider/external/stubs/SolanaExternalWalletContextStub.js +14 -0
- package/dist/provider/hooks/mutations/index.d.ts +26 -11
- package/dist/provider/hooks/mutations/index.js +52 -17
- package/dist/provider/hooks/mutations/utils.d.ts +4 -0
- package/dist/provider/hooks/mutations/utils.js +22 -0
- package/dist/provider/hooks/queries/useAccount.d.ts +1 -7
- package/dist/provider/hooks/queries/useWallet.d.ts +1 -1
- package/dist/provider/hooks/queries/useWalletBalance.d.ts +1 -2
- package/dist/provider/hooks/queries/useWalletBalance.js +40 -11
- package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +5 -5
- package/dist/provider/hooks/utils/useEventListeners.d.ts +1 -1
- package/dist/provider/hooks/utils/useEventListeners.js +98 -56
- package/dist/provider/hooks/utils/useWalletState.d.ts +5 -4
- package/dist/provider/hooks/utils/useWalletState.js +24 -9
- package/dist/provider/index.d.ts +1 -0
- package/dist/provider/index.js +1 -0
- package/dist/provider/providers/AuthProvider.d.ts +35 -0
- package/dist/provider/providers/AuthProvider.js +498 -0
- package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +7 -0
- package/dist/provider/providers/CosmosExternalWalletProvider.js +66 -0
- package/dist/provider/providers/EvmExternalWalletProvider.d.ts +7 -0
- package/dist/provider/providers/EvmExternalWalletProvider.js +74 -0
- package/dist/provider/providers/ExternalWalletProvider.d.ts +76 -0
- package/dist/{modal/providers/ExternalWalletContext.js → provider/providers/ExternalWalletProvider.js} +146 -112
- package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +7 -0
- package/dist/provider/providers/SolanaExternalWalletProvider.js +66 -0
- package/dist/provider/stores/getters.d.ts +3 -3
- package/dist/provider/stores/setters.d.ts +1 -0
- package/dist/provider/stores/setters.js +7 -0
- package/dist/provider/stores/slices/config.d.ts +3 -0
- package/dist/provider/stores/slices/config.js +9 -0
- package/dist/provider/stores/slices/externalWallets.d.ts +3 -0
- package/dist/provider/stores/slices/externalWallets.js +40 -0
- package/dist/provider/stores/slices/index.d.ts +1 -0
- package/dist/provider/stores/slices/index.js +1 -0
- package/dist/provider/stores/slices/modal.js +11 -4
- package/dist/provider/stores/types.d.ts +50 -4
- package/dist/provider/stores/useStore.js +4 -3
- package/dist/provider/types/externalWalletProviders.d.ts +12 -0
- package/dist/provider/types/externalWalletProviders.js +1 -0
- package/dist/provider/types/provider.d.ts +126 -17
- package/dist/provider/types/utils.d.ts +16 -0
- package/dist/provider/utils/constants.js +3 -4
- package/dist/provider/utils/paraConfigTypeGuards.d.ts +7 -0
- package/dist/provider/utils/paraConfigTypeGuards.js +13 -0
- package/dist/provider/utils/renameMutations.d.ts +3 -0
- package/dist/provider/utils/renameMutations.js +5 -3
- package/package.json +20 -8
- package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.d.ts +0 -8
- package/dist/modal/components/ExternalWalletsWrapper/ExternalWalletsWrapper.js +0 -124
- package/dist/modal/hooks/useActiveWallet.d.ts +0 -1
- package/dist/modal/hooks/useActiveWallet.js +0 -15
- package/dist/modal/hooks/useCreateAccount.d.ts +0 -6
- package/dist/modal/hooks/useCreateAccount.js +0 -77
- package/dist/modal/hooks/useEmbeddedExternalConnection.d.ts +0 -1
- package/dist/modal/hooks/useEmbeddedExternalConnection.js +0 -54
- package/dist/modal/hooks/useSetLoginURLs.d.ts +0 -8
- package/dist/modal/hooks/useSetLoginURLs.js +0 -49
- package/dist/modal/hooks/useWalletBalance.d.ts +0 -4
- package/dist/modal/hooks/useWalletBalance.js +0 -49
- package/dist/modal/providers/CosmosExternalWalletContextStub.d.ts +0 -42
- package/dist/modal/providers/CosmosExternalWalletContextStub.js +0 -38
- package/dist/modal/providers/EvmExternalWalletContextStub.d.ts +0 -46
- package/dist/modal/providers/EvmExternalWalletContextStub.js +0 -55
- package/dist/modal/providers/ExternalWalletContext.d.ts +0 -92
- package/dist/modal/providers/SolanaExternalWalletContextStub.d.ts +0 -32
- package/dist/modal/providers/SolanaExternalWalletContextStub.js +0 -32
- package/dist/modal/stores/externalWalletProvider/actions.d.ts +0 -3
- package/dist/modal/stores/externalWalletProvider/actions.js +0 -10
- package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.d.ts +0 -22
- package/dist/modal/stores/externalWalletProvider/useExternalWalletProviderStore.js +0 -21
- package/dist/modal/stores/theme/actions.d.ts +0 -3
- package/dist/modal/stores/theme/actions.js +0 -28
- package/dist/modal/stores/theme/useThemeStore.d.ts +0 -20
- package/dist/modal/stores/theme/useThemeStore.js +0 -21
- package/dist/modal/stores/userInfo/actions.d.ts +0 -3
- package/dist/modal/stores/userInfo/actions.js +0 -30
- package/dist/modal/stores/userInfo/useUserInfoStore.d.ts +0 -19
- package/dist/modal/stores/userInfo/useUserInfoStore.js +0 -17
- package/dist/provider/actions/checkIfUserExists.d.ts +0 -9
- package/dist/provider/actions/checkIfUserExists.js +0 -21
- package/dist/provider/actions/createGuestWallets.d.ts +0 -2
- package/dist/provider/actions/createGuestWallets.js +0 -13
- package/dist/provider/actions/createUser.d.ts +0 -12
- package/dist/provider/actions/createUser.js +0 -26
- package/dist/provider/actions/getWalletBalance.d.ts +0 -2
- package/dist/provider/actions/getWalletBalance.js +0 -14
- package/dist/provider/actions/initiateLogin.d.ts +0 -4
- package/dist/provider/actions/initiateLogin.js +0 -20
- package/dist/provider/actions/keepSessionAlive.d.ts +0 -2
- package/dist/provider/actions/keepSessionAlive.js +0 -20
- package/dist/provider/actions/logout.d.ts +0 -2
- package/dist/provider/actions/logout.js +0 -17
- package/dist/provider/actions/signMessage.d.ts +0 -8
- package/dist/provider/actions/signMessage.js +0 -20
- package/dist/provider/actions/signTransaction.d.ts +0 -8
- package/dist/provider/actions/signTransaction.js +0 -20
- package/dist/provider/actions/waitForAccountCreation.d.ts +0 -2
- package/dist/provider/actions/waitForAccountCreation.js +0 -21
- package/dist/provider/actions/waitForLoginAndSetup.d.ts +0 -6
- package/dist/provider/actions/waitForLoginAndSetup.js +0 -24
- package/dist/provider/actions/waitForPasskeyAndCreateWallet.d.ts +0 -2
- package/dist/provider/actions/waitForPasskeyAndCreateWallet.js +0 -21
- package/dist/provider/hooks/mutations/useCheckIfUserExists.d.ts +0 -13
- package/dist/provider/hooks/mutations/useCheckIfUserExists.js +0 -23
- package/dist/provider/hooks/mutations/useCreateGuestWallets.d.ts +0 -15
- package/dist/provider/hooks/mutations/useCreateGuestWallets.js +0 -23
- package/dist/provider/hooks/mutations/useCreateUser.d.ts +0 -13
- package/dist/provider/hooks/mutations/useCreateUser.js +0 -20
- package/dist/provider/hooks/mutations/useInitiateLogin.d.ts +0 -14
- package/dist/provider/hooks/mutations/useInitiateLogin.js +0 -23
- package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +0 -12
- package/dist/provider/hooks/mutations/useKeepSessionAlive.js +0 -20
- package/dist/provider/hooks/mutations/useLogout.d.ts +0 -12
- package/dist/provider/hooks/mutations/useLogout.js +0 -30
- package/dist/provider/hooks/mutations/useSignMessage.d.ts +0 -15
- package/dist/provider/hooks/mutations/useSignMessage.js +0 -39
- package/dist/provider/hooks/mutations/useSignTransaction.d.ts +0 -14
- package/dist/provider/hooks/mutations/useSignTransaction.js +0 -39
- package/dist/provider/hooks/mutations/useWaitForAccountCreation.d.ts +0 -12
- package/dist/provider/hooks/mutations/useWaitForAccountCreation.js +0 -30
- package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.d.ts +0 -14
- package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.js +0 -30
- package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.d.ts +0 -13
- package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.js +0 -30
- /package/dist/modal/{components/AuthInput → utils}/countryCodes.d.ts +0 -0
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import "../../../chunk-MMUBH76A.js";
|
|
3
|
-
const getActions = (set, get) => ({
|
|
4
|
-
updateState: (state) => {
|
|
5
|
-
set(state);
|
|
6
|
-
},
|
|
7
|
-
getLogo: () => {
|
|
8
|
-
var _a;
|
|
9
|
-
return (_a = get().logo) != null ? _a : void 0;
|
|
10
|
-
},
|
|
11
|
-
setAuthLayout: (authLayout) => {
|
|
12
|
-
const types = [];
|
|
13
|
-
const uniqueLayouts = [];
|
|
14
|
-
authLayout.map((layout) => {
|
|
15
|
-
const type = layout.split(":")[0];
|
|
16
|
-
if (!types.includes(type)) {
|
|
17
|
-
uniqueLayouts.push(layout);
|
|
18
|
-
types.push(type);
|
|
19
|
-
} else {
|
|
20
|
-
console.warn(`${layout} is a duplicate ${type} layout type. Please remove the duplicate type from your config.`);
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
set({ authLayout: uniqueLayouts });
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
export {
|
|
27
|
-
getActions
|
|
28
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ParaModalTheme, OAuthLogoVariantType, TAuthLayout } from '../../types/modalProps.js';
|
|
2
|
-
interface ThemeState {
|
|
3
|
-
isDark?: boolean;
|
|
4
|
-
logo?: string;
|
|
5
|
-
appName?: string;
|
|
6
|
-
bareModal?: boolean;
|
|
7
|
-
embeddedModal?: boolean;
|
|
8
|
-
oAuthLogoVariant?: OAuthLogoVariantType;
|
|
9
|
-
authLayout?: TAuthLayout[];
|
|
10
|
-
theme?: ParaModalTheme;
|
|
11
|
-
hideWallets?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export interface ThemeActions {
|
|
14
|
-
updateState: (state: Partial<ThemeState>) => void;
|
|
15
|
-
getLogo: () => string | undefined;
|
|
16
|
-
setAuthLayout: (authLayout: TAuthLayout[]) => void;
|
|
17
|
-
}
|
|
18
|
-
export type ThemeStore = ThemeState & ThemeActions;
|
|
19
|
-
export declare const useThemeStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ThemeStore>>;
|
|
20
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__spreadValues
|
|
4
|
-
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
-
import { create } from "zustand";
|
|
6
|
-
import { getActions } from "./actions.js";
|
|
7
|
-
import { AuthLayout } from "../../types/modalProps.js";
|
|
8
|
-
const DEFAULT_THEME = {
|
|
9
|
-
isDark: false,
|
|
10
|
-
logo: void 0,
|
|
11
|
-
appName: void 0,
|
|
12
|
-
bareModal: false,
|
|
13
|
-
embeddedModal: false,
|
|
14
|
-
oAuthLogoVariant: void 0,
|
|
15
|
-
authLayout: [AuthLayout.AUTH_FULL, AuthLayout.EXTERNAL_FULL],
|
|
16
|
-
hideWallets: false
|
|
17
|
-
};
|
|
18
|
-
const useThemeStore = create((set, get) => __spreadValues(__spreadValues({}, DEFAULT_THEME), getActions(set, get)));
|
|
19
|
-
export {
|
|
20
|
-
useThemeStore
|
|
21
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__objRest,
|
|
4
|
-
__spreadProps,
|
|
5
|
-
__spreadValues
|
|
6
|
-
} from "../../../chunk-MMUBH76A.js";
|
|
7
|
-
import { DEFAULT_USER_INFO_STATE } from "./useUserInfoStore.js";
|
|
8
|
-
import { extractAuthInfo } from "@getpara/user-management-client";
|
|
9
|
-
const getActions = (set, get) => ({
|
|
10
|
-
resetState: () => {
|
|
11
|
-
set(DEFAULT_USER_INFO_STATE);
|
|
12
|
-
},
|
|
13
|
-
setAuthInfo: (_a) => {
|
|
14
|
-
var _b = _a, { pfpUrl, displayName } = _b, auth = __objRest(_b, ["pfpUrl", "displayName"]);
|
|
15
|
-
set({ auth, pfpUrl: pfpUrl || null, displayName: displayName || null });
|
|
16
|
-
},
|
|
17
|
-
getAuthInfo: () => {
|
|
18
|
-
try {
|
|
19
|
-
return get().auth ? __spreadProps(__spreadValues({}, extractAuthInfo(get().auth, { isRequired: true })), { pfpUrl: get().pfpUrl, displayName: get().displayName }) : null;
|
|
20
|
-
} catch (e) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
setRecoveryShare: (recoveryShare) => {
|
|
25
|
-
set({ recoveryShare });
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
export {
|
|
29
|
-
getActions
|
|
30
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Auth } from '@getpara/user-management-client';
|
|
2
|
-
import { ModalAuthInfo } from '@getpara/react-common';
|
|
3
|
-
type SetAuthInfo = Auth & Partial<Pick<ModalAuthInfo, 'pfpUrl' | 'displayName'>>;
|
|
4
|
-
type UserInfoState = {
|
|
5
|
-
auth: Auth | null;
|
|
6
|
-
pfpUrl: string | null;
|
|
7
|
-
displayName: string | null;
|
|
8
|
-
recoveryShare: string | null;
|
|
9
|
-
};
|
|
10
|
-
export interface UserInfoActions {
|
|
11
|
-
resetState: () => void;
|
|
12
|
-
setAuthInfo: (auth: SetAuthInfo) => void;
|
|
13
|
-
getAuthInfo: () => ModalAuthInfo | null;
|
|
14
|
-
setRecoveryShare: (recoveryShare: string | null) => void;
|
|
15
|
-
}
|
|
16
|
-
export type UserInfoStore = UserInfoState & UserInfoActions;
|
|
17
|
-
export declare const DEFAULT_USER_INFO_STATE: UserInfoState;
|
|
18
|
-
export declare const useUserInfoStore: import("zustand").UseBoundStore<import("zustand").StoreApi<UserInfoStore>>;
|
|
19
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__spreadValues
|
|
4
|
-
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
-
import { create } from "zustand";
|
|
6
|
-
import { getActions } from "./actions.js";
|
|
7
|
-
const DEFAULT_USER_INFO_STATE = {
|
|
8
|
-
auth: null,
|
|
9
|
-
recoveryShare: null,
|
|
10
|
-
pfpUrl: null,
|
|
11
|
-
displayName: null
|
|
12
|
-
};
|
|
13
|
-
const useUserInfoStore = create((set, get) => __spreadValues(__spreadValues({}, DEFAULT_USER_INFO_STATE), getActions(set, get)));
|
|
14
|
-
export {
|
|
15
|
-
DEFAULT_USER_INFO_STATE,
|
|
16
|
-
useUserInfoStore
|
|
17
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CountryCallingCode } from 'libphonenumber-js';
|
|
2
|
-
import { CreateUserType } from './createUser.js';
|
|
3
|
-
import ParaWeb from '@getpara/web-sdk';
|
|
4
|
-
export interface CheckIfUserExistsArgs {
|
|
5
|
-
type: CreateUserType;
|
|
6
|
-
identifier: string;
|
|
7
|
-
countryCode?: CountryCallingCode;
|
|
8
|
-
}
|
|
9
|
-
export declare const checkIfUserExists: (para?: ParaWeb, args?: CheckIfUserExistsArgs) => Promise<boolean>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
import { CreateUserType } from "./createUser.js";
|
|
6
|
-
const checkIfUserExists = (para, args) => __async(void 0, null, function* () {
|
|
7
|
-
if (!para) {
|
|
8
|
-
throw new Error("no para instance");
|
|
9
|
-
}
|
|
10
|
-
if (!args) {
|
|
11
|
-
throw new Error("no valid args passed to checkIfUserExists");
|
|
12
|
-
}
|
|
13
|
-
try {
|
|
14
|
-
return yield args.type === CreateUserType.EMAIL ? para.checkIfUserExists({ email: args.identifier }) : para.checkIfUserExistsByPhone({ phone: args.identifier, countryCode: args.countryCode });
|
|
15
|
-
} catch (e) {
|
|
16
|
-
throw new Error(e);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
export {
|
|
20
|
-
checkIfUserExists
|
|
21
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
const createGuestWallets = (para, args) => __async(void 0, null, function* () {
|
|
6
|
-
if (!para) {
|
|
7
|
-
throw new Error("no para instance");
|
|
8
|
-
}
|
|
9
|
-
return yield para.createGuestWallets(args);
|
|
10
|
-
});
|
|
11
|
-
export {
|
|
12
|
-
createGuestWallets
|
|
13
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import ParaWeb from '@getpara/web-sdk';
|
|
2
|
-
import { CountryCallingCode } from 'libphonenumber-js';
|
|
3
|
-
export declare enum CreateUserType {
|
|
4
|
-
EMAIL = "EMAIL",
|
|
5
|
-
PHONE = "PHONE"
|
|
6
|
-
}
|
|
7
|
-
export interface CreateUserArgs {
|
|
8
|
-
type: CreateUserType;
|
|
9
|
-
identifier: string;
|
|
10
|
-
countryCode?: CountryCallingCode;
|
|
11
|
-
}
|
|
12
|
-
export declare const createUser: (para?: ParaWeb, args?: CreateUserArgs) => Promise<void>;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
var CreateUserType = /* @__PURE__ */ ((CreateUserType2) => {
|
|
6
|
-
CreateUserType2["EMAIL"] = "EMAIL";
|
|
7
|
-
CreateUserType2["PHONE"] = "PHONE";
|
|
8
|
-
return CreateUserType2;
|
|
9
|
-
})(CreateUserType || {});
|
|
10
|
-
const createUser = (para, args) => __async(void 0, null, function* () {
|
|
11
|
-
if (!para) {
|
|
12
|
-
throw new Error("no para instance");
|
|
13
|
-
}
|
|
14
|
-
if (!args) {
|
|
15
|
-
throw new Error("no valid args passed to createUser");
|
|
16
|
-
}
|
|
17
|
-
try {
|
|
18
|
-
yield args.type === "EMAIL" /* EMAIL */ ? para.createUser({ email: args.identifier }) : para.createUserByPhone({ phone: args.identifier, countryCode: args.countryCode });
|
|
19
|
-
} catch (e) {
|
|
20
|
-
throw new Error(e);
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
export {
|
|
24
|
-
CreateUserType,
|
|
25
|
-
createUser
|
|
26
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
const getWalletBalance = (para, args) => __async(void 0, null, function* () {
|
|
6
|
-
const isLoggedIn = yield para == null ? void 0 : para.isFullyLoggedIn();
|
|
7
|
-
if (!para || !isLoggedIn) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
return para.getWalletBalance(args);
|
|
11
|
-
});
|
|
12
|
-
export {
|
|
13
|
-
getWalletBalance
|
|
14
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Auth } from '@getpara/user-management-client';
|
|
2
|
-
import ParaWeb from '@getpara/web-sdk';
|
|
3
|
-
export type InitiateLoginArgs = Auth;
|
|
4
|
-
export declare const initiateLogin: (para?: ParaWeb, args?: Auth) => Promise<Set<import("@getpara/user-management-client").AuthMethod>>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
const initiateLogin = (para, args) => __async(void 0, null, function* () {
|
|
6
|
-
if (!para) {
|
|
7
|
-
throw new Error("no para instance");
|
|
8
|
-
}
|
|
9
|
-
if (!args) {
|
|
10
|
-
throw new Error("no valid args passed to initiateLogin");
|
|
11
|
-
}
|
|
12
|
-
try {
|
|
13
|
-
return yield para.initiateUserLoginV2(args);
|
|
14
|
-
} catch (e) {
|
|
15
|
-
throw new Error(e);
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
export {
|
|
19
|
-
initiateLogin
|
|
20
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
const keepSessionAlive = (para) => __async(void 0, null, function* () {
|
|
6
|
-
if (!para) {
|
|
7
|
-
throw new Error("no para instance");
|
|
8
|
-
}
|
|
9
|
-
try {
|
|
10
|
-
const resp = yield para.keepSessionAlive();
|
|
11
|
-
if (!resp) {
|
|
12
|
-
throw new Error("session expired");
|
|
13
|
-
}
|
|
14
|
-
} catch (e) {
|
|
15
|
-
throw new Error(e);
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
export {
|
|
19
|
-
keepSessionAlive
|
|
20
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
const logout = (para) => __async(void 0, null, function* () {
|
|
6
|
-
if (!para) {
|
|
7
|
-
throw new Error("no para instance");
|
|
8
|
-
}
|
|
9
|
-
try {
|
|
10
|
-
yield para.logout();
|
|
11
|
-
} catch (e) {
|
|
12
|
-
throw new Error(e);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
export {
|
|
16
|
-
logout
|
|
17
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import ParaWeb from '@getpara/web-sdk';
|
|
2
|
-
export interface SignMessageArgs {
|
|
3
|
-
walletId: string;
|
|
4
|
-
messageBase64: string;
|
|
5
|
-
timeoutMs?: number;
|
|
6
|
-
cosmosSignDocBase64?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const signMessage: (para?: ParaWeb, args?: SignMessageArgs) => Promise<import("@getpara/web-sdk").FullSignatureRes>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
const signMessage = (para, args) => __async(void 0, null, function* () {
|
|
6
|
-
if (!para) {
|
|
7
|
-
throw new Error("no para instance");
|
|
8
|
-
}
|
|
9
|
-
if (!args) {
|
|
10
|
-
throw new Error("no valid args passed to signMessage");
|
|
11
|
-
}
|
|
12
|
-
try {
|
|
13
|
-
return yield para.signMessage(args);
|
|
14
|
-
} catch (e) {
|
|
15
|
-
throw new Error(e);
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
export {
|
|
19
|
-
signMessage
|
|
20
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import ParaWeb from '@getpara/web-sdk';
|
|
2
|
-
export interface SignTransactionArgs {
|
|
3
|
-
walletId: string;
|
|
4
|
-
rlpEncodedTxBase64: string;
|
|
5
|
-
chainId: string;
|
|
6
|
-
timeoutMs?: number;
|
|
7
|
-
}
|
|
8
|
-
export declare const signTransaction: (para?: ParaWeb, args?: SignTransactionArgs) => Promise<import("@getpara/web-sdk").FullSignatureRes>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
const signTransaction = (para, args) => __async(void 0, null, function* () {
|
|
6
|
-
if (!para) {
|
|
7
|
-
throw new Error("no para instance");
|
|
8
|
-
}
|
|
9
|
-
if (!args) {
|
|
10
|
-
throw new Error("no valid args passed to signTransaction");
|
|
11
|
-
}
|
|
12
|
-
try {
|
|
13
|
-
return yield para.signTransaction(args);
|
|
14
|
-
} catch (e) {
|
|
15
|
-
throw new Error(e);
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
export {
|
|
19
|
-
signTransaction
|
|
20
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
const waitForAccountCreation = (para) => __async(void 0, null, function* () {
|
|
6
|
-
if (!para) {
|
|
7
|
-
throw new Error("no para instance");
|
|
8
|
-
}
|
|
9
|
-
try {
|
|
10
|
-
const isComplete = yield para.waitForAccountCreation();
|
|
11
|
-
if (!isComplete) {
|
|
12
|
-
throw new Error("error during waitForAccountCreation");
|
|
13
|
-
}
|
|
14
|
-
return isComplete;
|
|
15
|
-
} catch (e) {
|
|
16
|
-
throw new Error(e);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
export {
|
|
20
|
-
waitForAccountCreation
|
|
21
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import ParaWeb from '@getpara/web-sdk';
|
|
2
|
-
export interface WaitForLoginAndSetupArgs {
|
|
3
|
-
loginWindow?: Window;
|
|
4
|
-
skipSessionRefresh?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare const waitForLoginAndSetup: (para?: ParaWeb, args?: WaitForLoginAndSetupArgs) => Promise<import("@getpara/web-sdk").LoginResponse>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
const waitForLoginAndSetup = (para, args) => __async(void 0, null, function* () {
|
|
6
|
-
if (!para) {
|
|
7
|
-
throw new Error("no para instance");
|
|
8
|
-
}
|
|
9
|
-
if (!args) {
|
|
10
|
-
throw new Error("no valid args passed to waitForLoginAndSetup");
|
|
11
|
-
}
|
|
12
|
-
try {
|
|
13
|
-
const resp = yield para.waitForLoginAndSetup(args);
|
|
14
|
-
if (resp.isError) {
|
|
15
|
-
throw new Error("error during waitForLoginAndSetup");
|
|
16
|
-
}
|
|
17
|
-
return resp;
|
|
18
|
-
} catch (e) {
|
|
19
|
-
throw new Error(e);
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
export {
|
|
23
|
-
waitForLoginAndSetup
|
|
24
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../chunk-MMUBH76A.js";
|
|
5
|
-
const waitForPasskeyAndCreateWallet = (para) => __async(void 0, null, function* () {
|
|
6
|
-
if (!para) {
|
|
7
|
-
throw new Error("no para instance");
|
|
8
|
-
}
|
|
9
|
-
try {
|
|
10
|
-
const resp = yield para.waitForPasskeyAndCreateWallet();
|
|
11
|
-
if (!resp) {
|
|
12
|
-
throw new Error("error during waitForAccountCreation");
|
|
13
|
-
}
|
|
14
|
-
return resp;
|
|
15
|
-
} catch (e) {
|
|
16
|
-
throw new Error(e);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
export {
|
|
20
|
-
waitForPasskeyAndCreateWallet
|
|
21
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { UseMutateAsyncFunction, UseMutateFunction } from '@tanstack/react-query';
|
|
2
|
-
import { CheckIfUserExistsArgs } from '../../actions/checkIfUserExists.js';
|
|
3
|
-
import { Compute } from '../../types/utils.js';
|
|
4
|
-
import { UseMutationReturnType } from '../../types/query.js';
|
|
5
|
-
type UseCheckIfUserExistsReturnType<TData = boolean, TError = Error, TVariables = CheckIfUserExistsArgs, TContext = unknown> = Compute<UseMutationReturnType<TData, TError, TVariables, TContext> & {
|
|
6
|
-
checkIfUserExists: UseMutateFunction<TData, TError, TVariables, TContext>;
|
|
7
|
-
checkIfUserExistsAsync: UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
|
|
8
|
-
}>;
|
|
9
|
-
/**
|
|
10
|
-
* Hook for checking is a user exists
|
|
11
|
-
*/
|
|
12
|
-
export declare const useCheckIfUserExists: () => UseCheckIfUserExistsReturnType<boolean, Error, CheckIfUserExistsArgs, unknown>;
|
|
13
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
-
import { useMutation } from "@tanstack/react-query";
|
|
6
|
-
import { useClient } from "../index.js";
|
|
7
|
-
import { checkIfUserExists } from "../../actions/checkIfUserExists.js";
|
|
8
|
-
import { renameMutations } from "../../utils/renameMutations.js";
|
|
9
|
-
const useCheckIfUserExists = () => {
|
|
10
|
-
const client = useClient();
|
|
11
|
-
const mutation = useMutation({
|
|
12
|
-
mutationFn: (args) => __async(void 0, null, function* () {
|
|
13
|
-
return yield checkIfUserExists(client, args);
|
|
14
|
-
})
|
|
15
|
-
});
|
|
16
|
-
return renameMutations(
|
|
17
|
-
mutation,
|
|
18
|
-
"checkIfUserExists"
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
useCheckIfUserExists
|
|
23
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { UseMutateAsyncFunction, UseMutateFunction } from '@tanstack/react-query';
|
|
2
|
-
import { createGuestWallets } from '../../actions/createGuestWallets.js';
|
|
3
|
-
import { Compute } from '../../types/utils.js';
|
|
4
|
-
import { UseMutationReturnType } from '../../types/query.js';
|
|
5
|
-
import { CreateGuestWalletsParams } from '@getpara/web-sdk';
|
|
6
|
-
type Data = Awaited<ReturnType<typeof createGuestWallets>>;
|
|
7
|
-
type UseCreateGuestWalletsReturnType<TData = Data, TError = Error, TVariables = CreateGuestWalletsParams, TContext = unknown> = Compute<UseMutationReturnType<TData, TError, TVariables, TContext> & {
|
|
8
|
-
createGuestWallets: UseMutateFunction<TData, TError, TVariables, TContext>;
|
|
9
|
-
createGuestWalletsAsync: UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
|
|
10
|
-
}>;
|
|
11
|
-
/**
|
|
12
|
-
* Hook for creating guest mode wallets
|
|
13
|
-
*/
|
|
14
|
-
export declare const useCreateGuestWallets: () => UseCreateGuestWalletsReturnType<import("@getpara/web-sdk").Wallet[], Error, CreateGuestWalletsParams, unknown>;
|
|
15
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
-
import { useMutation } from "@tanstack/react-query";
|
|
6
|
-
import { useClient } from "../index.js";
|
|
7
|
-
import { createGuestWallets } from "../../actions/createGuestWallets.js";
|
|
8
|
-
import { renameMutations } from "../../utils/renameMutations.js";
|
|
9
|
-
const useCreateGuestWallets = () => {
|
|
10
|
-
const client = useClient();
|
|
11
|
-
const mutation = useMutation({
|
|
12
|
-
mutationFn: (args) => __async(void 0, null, function* () {
|
|
13
|
-
return yield createGuestWallets(client, args);
|
|
14
|
-
})
|
|
15
|
-
});
|
|
16
|
-
return renameMutations(
|
|
17
|
-
mutation,
|
|
18
|
-
"createGuestWallets"
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
useCreateGuestWallets
|
|
23
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { UseMutateAsyncFunction, UseMutateFunction } from '@tanstack/react-query';
|
|
2
|
-
import { CreateUserArgs } from '../../actions/createUser.js';
|
|
3
|
-
import { Compute } from '../../types/utils.js';
|
|
4
|
-
import { UseMutationReturnType } from '../../types/query.js';
|
|
5
|
-
type UseCreateUserReturnType<TData = void, TError = Error, TVariables = CreateUserArgs, TContext = unknown> = Compute<UseMutationReturnType<TData, TError, TVariables, TContext> & {
|
|
6
|
-
createUser: UseMutateFunction<TData, TError, TVariables, TContext>;
|
|
7
|
-
createUserAsync: UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
|
|
8
|
-
}>;
|
|
9
|
-
/**
|
|
10
|
-
* Hook for creating a new user
|
|
11
|
-
*/
|
|
12
|
-
export declare const useCreateUser: () => UseCreateUserReturnType<void, Error, CreateUserArgs, unknown>;
|
|
13
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
-
import { useMutation } from "@tanstack/react-query";
|
|
6
|
-
import { useClient } from "../index.js";
|
|
7
|
-
import { createUser } from "../../actions/createUser.js";
|
|
8
|
-
import { renameMutations } from "../../utils/renameMutations.js";
|
|
9
|
-
const useCreateUser = () => {
|
|
10
|
-
const client = useClient();
|
|
11
|
-
const mutation = useMutation({
|
|
12
|
-
mutationFn: (args) => __async(void 0, null, function* () {
|
|
13
|
-
return yield createUser(client, args);
|
|
14
|
-
})
|
|
15
|
-
});
|
|
16
|
-
return renameMutations(mutation, "createUser");
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
useCreateUser
|
|
20
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { UseMutateAsyncFunction, UseMutateFunction } from '@tanstack/react-query';
|
|
2
|
-
import { InitiateLoginArgs } from '../../actions/initiateLogin.js';
|
|
3
|
-
import { Compute } from '../../types/utils.js';
|
|
4
|
-
import { UseMutationReturnType } from '../../types/query.js';
|
|
5
|
-
import { AuthMethod } from '@getpara/web-sdk';
|
|
6
|
-
type UseInitiateLoginReturnType<TData = Set<AuthMethod>, TError = Error, TVariables = InitiateLoginArgs, TContext = unknown> = Compute<UseMutationReturnType<TData, TError, TVariables, TContext> & {
|
|
7
|
-
initiateLogin: UseMutateFunction<TData, TError, TVariables, TContext>;
|
|
8
|
-
initiateLoginAsync: UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
|
|
9
|
-
}>;
|
|
10
|
-
/**
|
|
11
|
-
* Hook for initiating a user login
|
|
12
|
-
*/
|
|
13
|
-
export declare const useInitiateLogin: () => UseInitiateLoginReturnType<Set<AuthMethod>, Error, InitiateLoginArgs, unknown>;
|
|
14
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
__async
|
|
4
|
-
} from "../../../chunk-MMUBH76A.js";
|
|
5
|
-
import { useMutation } from "@tanstack/react-query";
|
|
6
|
-
import { useClient } from "../index.js";
|
|
7
|
-
import { initiateLogin } from "../../actions/initiateLogin.js";
|
|
8
|
-
import { renameMutations } from "../../utils/renameMutations.js";
|
|
9
|
-
const useInitiateLogin = () => {
|
|
10
|
-
const client = useClient();
|
|
11
|
-
const mutation = useMutation({
|
|
12
|
-
mutationFn: (args) => __async(void 0, null, function* () {
|
|
13
|
-
return yield initiateLogin(client, args);
|
|
14
|
-
})
|
|
15
|
-
});
|
|
16
|
-
return renameMutations(
|
|
17
|
-
mutation,
|
|
18
|
-
"initiateLogin"
|
|
19
|
-
);
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
useInitiateLogin
|
|
23
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { UseMutateAsyncFunction, UseMutateFunction } from '@tanstack/react-query';
|
|
2
|
-
import { Compute } from '../../types/utils.js';
|
|
3
|
-
import { UseMutationReturnType } from '../../types/query.js';
|
|
4
|
-
type UseKeepSessionAliveReturnType<TData = void, TError = Error, TVariables = void, TContext = unknown> = Compute<UseMutationReturnType<TData, TError, TVariables, TContext> & {
|
|
5
|
-
keepSessionAlive: UseMutateFunction<TData, TError, TVariables, TContext>;
|
|
6
|
-
keepSessionAliveAsync: UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
|
|
7
|
-
}>;
|
|
8
|
-
/**
|
|
9
|
-
* Hook for keeping a session alive
|
|
10
|
-
*/
|
|
11
|
-
export declare const useKeepSessionAlive: () => UseKeepSessionAliveReturnType<void, Error, void, unknown>;
|
|
12
|
-
export {};
|