@getpara/react-sdk 2.0.0-alpha.3 → 2.0.0-dev.1
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/MoonPayEmbed-Q2HP2BFI.js.gz +0 -0
- package/dist/chunk-MMUBH76A.js.gz +0 -0
- package/dist/cli/cli.mjs +1 -6
- package/dist/index.js +3106 -2547
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +1 -1
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +1 -1
- package/dist/modal/components/ModalContent/ModalContent.d.ts +4 -0
- package/dist/modal/hooks/useCreateAccount.d.ts +4 -0
- package/dist/modal/index.d.ts +0 -1
- package/dist/modal/stores/index.d.ts +1 -0
- package/dist/modal/stores/modal/useModalStore.d.ts +12 -4
- package/dist/modal/stores/userInfo/actions.d.ts +3 -0
- package/dist/modal/stores/userInfo/useUserInfoStore.d.ts +19 -0
- package/dist/modal/types/commonTypes.d.ts +0 -47
- package/dist/provider/actions/checkIfUserExists.d.ts +4 -0
- package/dist/provider/actions/createUser.d.ts +4 -0
- package/dist/provider/actions/getAccount.d.ts +7 -16
- package/dist/provider/actions/index.d.ts +18 -18
- package/dist/provider/actions/initiateLogin.d.ts +4 -0
- package/dist/provider/actions/keepSessionAlive.d.ts +2 -0
- package/dist/provider/actions/logout.d.ts +5 -0
- package/dist/provider/actions/signMessage.d.ts +8 -0
- package/dist/provider/actions/signTransaction.d.ts +8 -0
- package/dist/provider/actions/waitForAccountCreation.d.ts +5 -0
- package/dist/provider/actions/waitForLoginAndSetup.d.ts +6 -0
- package/dist/provider/actions/waitForPasskeyAndCreateWallet.d.ts +2 -0
- package/dist/provider/hooks/mutations/index.d.ts +30 -21
- package/dist/provider/hooks/mutations/useCheckIfUserExists.d.ts +13 -0
- package/dist/provider/hooks/mutations/useCreateUser.d.ts +13 -0
- package/dist/provider/hooks/mutations/useInitiateLogin.d.ts +14 -0
- package/dist/provider/hooks/mutations/useKeepSessionAlive.d.ts +12 -0
- package/dist/provider/hooks/mutations/useLogout.d.ts +13 -0
- package/dist/provider/hooks/mutations/useSignMessage.d.ts +15 -0
- package/dist/provider/hooks/mutations/useSignTransaction.d.ts +15 -0
- package/dist/provider/hooks/mutations/useWaitForAccountCreation.d.ts +13 -0
- package/dist/provider/hooks/mutations/useWaitForLoginAndSetup.d.ts +14 -0
- package/dist/provider/hooks/mutations/useWaitForPasskeyAndCreateWallet.d.ts +13 -0
- package/dist/provider/hooks/queries/useAccount.d.ts +7 -1
- package/dist/provider/providers/AuthProvider.d.ts +2 -2
- package/dist/provider/providers/ExternalWalletProvider.d.ts +14 -8
- package/dist/provider/stores/types.d.ts +2 -1
- package/dist/provider/types/externalWalletProviders.d.ts +2 -2
- package/dist/provider/types/provider.d.ts +2 -1
- package/package.json +11 -11
- package/dist/modal/types/externalWallets.d.ts +0 -31
package/dist/index.js.br
CHANGED
|
Binary file
|
package/dist/index.js.gz
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const BiometricCreationStep: () => import("react/jsx-runtime").JSX.Element
|
|
1
|
+
export declare const BiometricCreationStep: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const BiometricLoginStep: () => import("react/jsx-runtime").JSX.Element
|
|
1
|
+
export declare const BiometricLoginStep: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ParaModalProps } from '../../types/modalProps.js';
|
|
2
|
+
import { useCreateAccount } from '../../hooks/useCreateAccount.js';
|
|
2
3
|
type ModalContentProps = Omit<ParaModalProps, 'para' | 'isOpen' | 'theme' | 'branding' | 'onModalStepChange' | 'onExpandModalChange'>;
|
|
4
|
+
export declare const ActionsContext: import("react").Context<{
|
|
5
|
+
createAccount: ReturnType<typeof useCreateAccount>;
|
|
6
|
+
}>;
|
|
3
7
|
export type ModalContentHandle = {
|
|
4
8
|
/**
|
|
5
9
|
* Trigger the modal close handler
|
package/dist/modal/index.d.ts
CHANGED
|
@@ -6,4 +6,3 @@ export * from './utils/openPopup.js';
|
|
|
6
6
|
export { ON_RAMP_PROVIDERS, ON_RAMP_ASSETS, NETWORKS, getAssetIcon, getAssetName, getNetworkIcon, getNetworkName, } from './constants/constants.js';
|
|
7
7
|
export { SaveRecoverySecret } from './components/RecoverySecretStep/RecoverySecretStep.js';
|
|
8
8
|
export * from './utils/validateOnRampConfig.js';
|
|
9
|
-
export * from './types/externalWallets.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ModalStep } from '../../utils/steps.js';
|
|
2
2
|
import { OnRampConfig as OnRampConfigBase, OnRampPurchase, WalletType } from '@getpara/web-sdk';
|
|
3
3
|
import { Tab as AddFundsTabType } from '../../components/AddFunds/AddFunds.js';
|
|
4
|
-
import { AuthStateLogin, AuthStateSignup, AuthState, AuthStateVerify } from '@getpara/core-sdk';
|
|
4
|
+
import { AuthStateLogin, AuthStateSignup, AuthMethod, AuthState, AuthStateVerify } from '@getpara/core-sdk';
|
|
5
5
|
import { TAuthLayout } from '../../types/modalProps.js';
|
|
6
6
|
import { MutableRefObject } from 'react';
|
|
7
|
-
import { Setup2faResponse } from '@getpara/user-management-client';
|
|
7
|
+
import { BiometricLocationHint, Setup2faResponse } from '@getpara/user-management-client';
|
|
8
8
|
type Flow = AuthStateSignup['stage'] | AuthStateLogin['stage'] | 'account';
|
|
9
9
|
type ActiveWallet = [string | undefined, WalletType | undefined];
|
|
10
10
|
export type OnRampConfig = OnRampConfigBase & {
|
|
@@ -16,11 +16,14 @@ export interface OnModalStepChangeValue {
|
|
|
16
16
|
canGoBack: boolean;
|
|
17
17
|
}
|
|
18
18
|
interface ModalState {
|
|
19
|
-
recoveryShare: string | null;
|
|
20
19
|
step: ModalStep;
|
|
21
20
|
stepDirection: 1 | -1;
|
|
22
21
|
flow: Flow | undefined;
|
|
23
22
|
authState: AuthState | undefined;
|
|
23
|
+
webAuthURLForLogin: string | undefined;
|
|
24
|
+
webAuthURLForCreate: string | undefined;
|
|
25
|
+
passwordUrlForLogin: string | undefined;
|
|
26
|
+
supportedAuthMethods: Set<AuthMethod>;
|
|
24
27
|
onModalStepChange?: (value: OnModalStepChangeValue) => void | undefined;
|
|
25
28
|
onRampConfig: OnRampConfig | undefined;
|
|
26
29
|
onRampPurchase: Partial<OnRampPurchase> | undefined;
|
|
@@ -33,6 +36,7 @@ interface ModalState {
|
|
|
33
36
|
activeWallet: ActiveWallet | undefined;
|
|
34
37
|
farcasterConnectUri: string | undefined;
|
|
35
38
|
twoFactorStatus: Setup2faResponse | undefined;
|
|
39
|
+
biometricLocationHints: BiometricLocationHint[] | undefined;
|
|
36
40
|
iFrameUrl: string | undefined;
|
|
37
41
|
isIFrameReady: boolean | undefined;
|
|
38
42
|
authLayout?: TAuthLayout[];
|
|
@@ -49,7 +53,6 @@ interface ModalState {
|
|
|
49
53
|
}
|
|
50
54
|
export interface ModalActions {
|
|
51
55
|
resetState: () => void;
|
|
52
|
-
setRecoveryShare: (recoveryShare: string | null) => void;
|
|
53
56
|
setStep: (step: ModalStep) => void;
|
|
54
57
|
decrementStep: () => void;
|
|
55
58
|
hasPreviousStep: () => boolean;
|
|
@@ -60,6 +63,10 @@ export interface ModalActions {
|
|
|
60
63
|
getLoginState: () => AuthStateLogin | undefined;
|
|
61
64
|
isLogin: () => boolean;
|
|
62
65
|
isAccount: () => boolean;
|
|
66
|
+
setSupportedAuthMethods: (authMethods: Set<AuthMethod>) => void;
|
|
67
|
+
setWebAuthURLForLogin: (url?: string) => void;
|
|
68
|
+
setWebAuthURLForCreate: (url?: string) => void;
|
|
69
|
+
setPasswordUrlForLogin: (url?: string) => void;
|
|
63
70
|
setOnModalStepChange: (fn?: (value: OnModalStepChangeValue) => void) => void;
|
|
64
71
|
setOnRampConfig: (_: OnRampConfig | undefined) => void;
|
|
65
72
|
setOnRampPurchase: (_: Partial<OnRampPurchase> | undefined) => void;
|
|
@@ -72,6 +79,7 @@ export interface ModalActions {
|
|
|
72
79
|
setStepDirection: (stepDirection: 1 | -1) => void;
|
|
73
80
|
setFarcasterConnectUri: (_: string | undefined) => void;
|
|
74
81
|
setTwoFactorStatus: (twoFactorStatus?: Setup2faResponse) => void;
|
|
82
|
+
setBiometricLocationHints: (_?: BiometricLocationHint[]) => void;
|
|
75
83
|
setIFrameUrl: (_?: string) => void;
|
|
76
84
|
setIsIFrameReady: (_?: boolean) => void;
|
|
77
85
|
setAuthLayout: (authLayout: TAuthLayout[]) => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PrimaryAuth } from '@getpara/user-management-client';
|
|
2
|
+
import { ModalAuthInfo } from '@getpara/react-common';
|
|
3
|
+
type SetAuthInfo = PrimaryAuth & Partial<Pick<ModalAuthInfo, 'pfpUrl' | 'displayName'>>;
|
|
4
|
+
type UserInfoState = {
|
|
5
|
+
auth: PrimaryAuth | 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,51 +1,4 @@
|
|
|
1
1
|
import { IconType } from '@getpara/react-components';
|
|
2
|
-
import { AuthStateLogin, AuthStateVerify, WalletType } from '@getpara/web-sdk';
|
|
3
|
-
export type WalletMetadata = {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
iconUrl: string;
|
|
7
|
-
installed?: boolean;
|
|
8
|
-
isExtension?: boolean;
|
|
9
|
-
isMobile?: boolean;
|
|
10
|
-
isWeb?: boolean;
|
|
11
|
-
downloadUrl?: string;
|
|
12
|
-
getQrUri?: () => Promise<string>;
|
|
13
|
-
downloadUrls?: {
|
|
14
|
-
android?: string;
|
|
15
|
-
ios?: string;
|
|
16
|
-
mobile?: string;
|
|
17
|
-
qrCode?: string;
|
|
18
|
-
chrome?: string;
|
|
19
|
-
edge?: string;
|
|
20
|
-
firefox?: string;
|
|
21
|
-
opera?: string;
|
|
22
|
-
safari?: string;
|
|
23
|
-
browserExtension?: string;
|
|
24
|
-
macos?: string;
|
|
25
|
-
windows?: string;
|
|
26
|
-
linux?: string;
|
|
27
|
-
desktop?: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export type CommonWallet = {
|
|
31
|
-
connect: () => Promise<{
|
|
32
|
-
address?: string;
|
|
33
|
-
bufferAddress?: string;
|
|
34
|
-
error?: string;
|
|
35
|
-
authState?: AuthStateVerify | AuthStateLogin;
|
|
36
|
-
}>;
|
|
37
|
-
connectMobile: (isManualWalletConnect?: boolean) => Promise<{
|
|
38
|
-
address?: string;
|
|
39
|
-
bufferAddress?: string;
|
|
40
|
-
error?: string;
|
|
41
|
-
authState?: AuthStateVerify | AuthStateLogin;
|
|
42
|
-
}>;
|
|
43
|
-
type: WalletType;
|
|
44
|
-
} & WalletMetadata;
|
|
45
|
-
export type CommonChain = {
|
|
46
|
-
id: string | number;
|
|
47
|
-
name: string;
|
|
48
|
-
};
|
|
49
2
|
export type Tab<T> = {
|
|
50
3
|
label: string;
|
|
51
4
|
value: T;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import ParaWeb from '@getpara/web-sdk';
|
|
2
|
+
import { Auth } from '@getpara/user-management-client';
|
|
3
|
+
export type CheckIfUserExistsArgs = Auth<'email'> | Auth<'phone'>;
|
|
4
|
+
export declare const checkIfUserExists: (para?: ParaWeb, args?: CheckIfUserExistsArgs) => Promise<boolean>;
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
import ParaWeb, {
|
|
2
|
-
type
|
|
1
|
+
import ParaWeb, { Wallet } from '@getpara/web-sdk';
|
|
2
|
+
type AccountType = {
|
|
3
|
+
isConnected: boolean;
|
|
3
4
|
email?: string;
|
|
4
|
-
phone?:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
externalWalletAddress?: string;
|
|
8
|
-
wallets: (typeof ParaWeb.prototype)['availableWallets'];
|
|
9
|
-
userId: string;
|
|
5
|
+
phone?: string;
|
|
6
|
+
wallets?: Pick<Wallet, 'id' | 'type' | 'name' | 'address' | 'isExternal'>[];
|
|
7
|
+
userId?: string;
|
|
10
8
|
};
|
|
11
|
-
export
|
|
12
|
-
isConnected: false;
|
|
13
|
-
} & {
|
|
14
|
-
[key in keyof AccountValue]?: undefined;
|
|
15
|
-
}) | ({
|
|
16
|
-
isConnected: true;
|
|
17
|
-
} & AccountValue);
|
|
18
|
-
export declare const getAccount: (para?: ParaWeb) => Promise<Account>;
|
|
9
|
+
export declare const getAccount: (para?: ParaWeb) => Promise<AccountType>;
|
|
19
10
|
export {};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
export declare const signUpOrLogIn: import("./utils.js").CoreAction<"
|
|
2
|
-
export declare const verifyNewAccount: import("./utils.js").CoreAction<"
|
|
3
|
-
export declare const waitForLogin: import("./utils.js").CoreAction<"
|
|
4
|
-
export declare const waitForSignup: import("./utils.js").CoreAction<"
|
|
5
|
-
export declare const waitForWalletCreation: import("./utils.js").CoreAction<"
|
|
6
|
-
export declare const verifyOAuth: import("./utils.js").CoreAction<"
|
|
7
|
-
export declare const verifyFarcaster: import("./utils.js").CoreAction<"
|
|
8
|
-
export declare const verifyTelegram: import("./utils.js").CoreAction<"
|
|
9
|
-
export declare const loginExternalWallet: import("./utils.js").CoreAction<"
|
|
10
|
-
export declare const verifyExternalWallet: import("./utils.js").CoreAction<"
|
|
11
|
-
export declare const setup2fa: import("./utils.js").CoreAction<"
|
|
12
|
-
export declare const enable2fa: import("./utils.js").CoreAction<"
|
|
13
|
-
export declare const verify2fa: import("./utils.js").CoreAction<"
|
|
1
|
+
export declare const signUpOrLogIn: import("./utils.js").CoreAction<"signUpOrLogInV2">;
|
|
2
|
+
export declare const verifyNewAccount: import("./utils.js").CoreAction<"verifyNewAccountV2">;
|
|
3
|
+
export declare const waitForLogin: import("./utils.js").CoreAction<"waitForLoginV2">;
|
|
4
|
+
export declare const waitForSignup: import("./utils.js").CoreAction<"waitForSignupV2">;
|
|
5
|
+
export declare const waitForWalletCreation: import("./utils.js").CoreAction<"waitForWalletCreationV2">;
|
|
6
|
+
export declare const verifyOAuth: import("./utils.js").CoreAction<"verifyOAuthV2">;
|
|
7
|
+
export declare const verifyFarcaster: import("./utils.js").CoreAction<"verifyFarcasterV2">;
|
|
8
|
+
export declare const verifyTelegram: import("./utils.js").CoreAction<"verifyTelegramV2">;
|
|
9
|
+
export declare const loginExternalWallet: import("./utils.js").CoreAction<"loginExternalWalletV2">;
|
|
10
|
+
export declare const verifyExternalWallet: import("./utils.js").CoreAction<"verifyExternalWalletV2">;
|
|
11
|
+
export declare const setup2fa: import("./utils.js").CoreAction<"setup2faV2">;
|
|
12
|
+
export declare const enable2fa: import("./utils.js").CoreAction<"enable2faV2">;
|
|
13
|
+
export declare const verify2fa: import("./utils.js").CoreAction<"verify2faV2">;
|
|
14
14
|
export declare const keepSessionAlive: import("./utils.js").CoreAction<"keepSessionAlive">;
|
|
15
15
|
export declare const logout: import("./utils.js").CoreAction<"logout">;
|
|
16
16
|
export declare const resendVerificationCode: import("./utils.js").CoreAction<"resendVerificationCode">;
|
|
17
17
|
export declare const createWallet: import("./utils.js").CoreAction<"createWallet">;
|
|
18
18
|
export declare const createWalletPerType: import("./utils.js").CoreAction<"createWalletPerType">;
|
|
19
|
-
export declare const createPregenWallet: import("./utils.js").CoreAction<"
|
|
20
|
-
export declare const createPregenWalletPerType: import("./utils.js").CoreAction<"
|
|
21
|
-
export declare const claimPregenWallets: import("./utils.js").CoreAction<"
|
|
22
|
-
export declare const hasPregenWallet: import("./utils.js").CoreAction<"
|
|
23
|
-
export declare const updatePregenWalletIdentifier: import("./utils.js").CoreAction<"
|
|
19
|
+
export declare const createPregenWallet: import("./utils.js").CoreAction<"createPregenWalletV2">;
|
|
20
|
+
export declare const createPregenWalletPerType: import("./utils.js").CoreAction<"createPregenWalletPerTypeV2">;
|
|
21
|
+
export declare const claimPregenWallets: import("./utils.js").CoreAction<"claimPregenWalletsV2">;
|
|
22
|
+
export declare const hasPregenWallet: import("./utils.js").CoreAction<"hasPregenWalletV2">;
|
|
23
|
+
export declare const updatePregenWalletIdentifier: import("./utils.js").CoreAction<"updatePregenWalletIdentifierV2">;
|
|
24
24
|
export declare const signMessage: import("./utils.js").CoreAction<"signMessage">;
|
|
25
25
|
export declare const signTransaction: import("./utils.js").CoreAction<"signTransaction">;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PrimaryAuth } from '@getpara/user-management-client';
|
|
2
|
+
import ParaWeb from '@getpara/web-sdk';
|
|
3
|
+
export type InitiateLoginArgs = PrimaryAuth;
|
|
4
|
+
export declare const initiateLogin: (para?: ParaWeb, args?: InitiateLoginArgs) => Promise<Set<import("@getpara/user-management-client").AuthMethod>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import ParaWeb from '@getpara/web-sdk';
|
|
2
|
+
export interface WaitForLoginAndSetupArgs {
|
|
3
|
+
popupWindow?: Window | null;
|
|
4
|
+
skipSessionRefresh?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const waitForLoginAndSetup: (para?: ParaWeb, args?: WaitForLoginAndSetupArgs) => Promise<import("@getpara/web-sdk").LoginResponse>;
|
|
@@ -1,25 +1,34 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
1
|
+
export { useWaitForLoginAndSetup } from './useWaitForLoginAndSetup.js';
|
|
2
|
+
export { useWaitForAccountCreation } from './useWaitForAccountCreation.js';
|
|
3
|
+
export { useWaitForPasskeyAndCreateWallet } from './useWaitForPasskeyAndCreateWallet.js';
|
|
4
|
+
export { useCreateUser } from './useCreateUser.js';
|
|
5
|
+
export { useCheckIfUserExists } from './useCheckIfUserExists.js';
|
|
6
|
+
export { useInitiateLogin } from './useInitiateLogin.js';
|
|
7
|
+
export { useKeepSessionAlive } from './useKeepSessionAlive.js';
|
|
8
|
+
export { useSignMessage } from './useSignMessage.js';
|
|
9
|
+
export { useSignTransaction } from './useSignTransaction.js';
|
|
10
|
+
export declare const useSignUpOrLogIn: () => import("../../types/utils.js").CoreMethodHook<"signUpOrLogInV2">;
|
|
11
|
+
export declare const useVerifyNewAccount: () => import("../../types/utils.js").CoreMethodHook<"verifyNewAccountV2">;
|
|
12
|
+
export declare const useWaitForLogin: () => import("../../types/utils.js").CoreMethodHook<"waitForLoginV2">;
|
|
13
|
+
export declare const useWaitForSignup: () => import("../../types/utils.js").CoreMethodHook<"waitForSignupV2">;
|
|
14
|
+
export declare const useWaitForWalletCreation: () => import("../../types/utils.js").CoreMethodHook<"waitForWalletCreationV2">;
|
|
15
|
+
export declare const useVerifyOAuth: () => import("../../types/utils.js").CoreMethodHook<"verifyOAuthV2">;
|
|
16
|
+
export declare const useVerifyFarcaster: () => import("../../types/utils.js").CoreMethodHook<"verifyFarcasterV2">;
|
|
17
|
+
export declare const useVerifyTelegram: () => import("../../types/utils.js").CoreMethodHook<"verifyTelegramV2">;
|
|
18
|
+
export declare const useLoginExternalWallet: () => import("../../types/utils.js").CoreMethodHook<"loginExternalWalletV2">;
|
|
19
|
+
export declare const useVerifyExternalWallet: () => import("../../types/utils.js").CoreMethodHook<"verifyExternalWalletV2">;
|
|
20
|
+
export declare const useSetup2fa: () => import("../../types/utils.js").CoreMethodHook<"setup2faV2">;
|
|
21
|
+
export declare const useEnable2fa: () => import("../../types/utils.js").CoreMethodHook<"enable2faV2">;
|
|
22
|
+
export declare const useVerify2fa: () => import("../../types/utils.js").CoreMethodHook<"verify2faV2">;
|
|
23
|
+
export declare const useKeepSessionAliveV2: () => import("../../types/utils.js").CoreMethodHook<"keepSessionAlive">;
|
|
15
24
|
export declare const useLogout: () => import("../../types/utils.js").CoreMethodHook<"logout">;
|
|
16
25
|
export declare const useResendVerificationCode: () => import("../../types/utils.js").CoreMethodHook<"resendVerificationCode">;
|
|
17
26
|
export declare const useCreateWallet: () => import("../../types/utils.js").CoreMethodHook<"createWallet">;
|
|
18
27
|
export declare const useCreateWalletPerType: () => import("../../types/utils.js").CoreMethodHook<"createWalletPerType">;
|
|
19
|
-
export declare const useCreatePregenWallet: () => import("../../types/utils.js").CoreMethodHook<"
|
|
20
|
-
export declare const useCreatePregenWalletPerType: () => import("../../types/utils.js").CoreMethodHook<"
|
|
21
|
-
export declare const useClaimPregenWallets: () => import("../../types/utils.js").CoreMethodHook<"
|
|
22
|
-
export declare const useHasPregenWallet: () => import("../../types/utils.js").CoreMethodHook<"
|
|
23
|
-
export declare const useUpdatePregenWalletIdentifier: () => import("../../types/utils.js").CoreMethodHook<"
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const
|
|
28
|
+
export declare const useCreatePregenWallet: () => import("../../types/utils.js").CoreMethodHook<"createPregenWalletV2">;
|
|
29
|
+
export declare const useCreatePregenWalletPerType: () => import("../../types/utils.js").CoreMethodHook<"createPregenWalletPerTypeV2">;
|
|
30
|
+
export declare const useClaimPregenWallets: () => import("../../types/utils.js").CoreMethodHook<"claimPregenWalletsV2">;
|
|
31
|
+
export declare const useHasPregenWallet: () => import("../../types/utils.js").CoreMethodHook<"hasPregenWalletV2">;
|
|
32
|
+
export declare const useUpdatePregenWalletIdentifier: () => import("../../types/utils.js").CoreMethodHook<"updatePregenWalletIdentifierV2">;
|
|
33
|
+
export declare const useSignMessageV2: () => import("../../types/utils.js").CoreMethodHook<"signMessage">;
|
|
34
|
+
export declare const useSignTransactionV2: () => import("../../types/utils.js").CoreMethodHook<"signTransaction">;
|
|
@@ -0,0 +1,13 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,13 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,14 @@
|
|
|
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, import("@getpara/user-management-client").PrimaryAuth, unknown>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UseMutateAsyncFunction, UseMutateFunction } from '@tanstack/react-query';
|
|
2
|
+
import { LogoutArgs } from '../../actions/logout.js';
|
|
3
|
+
import { Compute } from '../../types/utils.js';
|
|
4
|
+
import { UseMutationReturnType } from '../../types/query.js';
|
|
5
|
+
type UseLogoutReturnType<TData = void, TError = Error, TVariables = LogoutArgs | undefined, TContext = unknown> = Compute<UseMutationReturnType<TData, TError, TVariables, TContext> & {
|
|
6
|
+
logout: UseMutateFunction<TData, TError, TVariables, TContext>;
|
|
7
|
+
logoutAsync: UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* Hook for logging out a user
|
|
11
|
+
*/
|
|
12
|
+
export declare const useLogout: () => UseLogoutReturnType<void, Error, LogoutArgs | undefined, unknown>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UseMutateAsyncFunction, UseMutateFunction } from '@tanstack/react-query';
|
|
2
|
+
import { SignMessageArgs } from '../../actions/signMessage.js';
|
|
3
|
+
import { Compute } from '../../types/utils.js';
|
|
4
|
+
import { UseMutationReturnType } from '../../types/query.js';
|
|
5
|
+
import { FullSignatureRes } from '@getpara/web-sdk';
|
|
6
|
+
type SignMessageMutationArgs = Omit<SignMessageArgs, 'walletId'> & Partial<Pick<SignMessageArgs, 'walletId'>>;
|
|
7
|
+
type UseSignMessageReturnType<TData = FullSignatureRes, TError = Error, TVariables = SignMessageMutationArgs, TContext = unknown> = Compute<UseMutationReturnType<TData, TError, TVariables, TContext> & {
|
|
8
|
+
signMessage: UseMutateFunction<TData, TError, TVariables, TContext>;
|
|
9
|
+
signMessageAsync: UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Hook for signing a message
|
|
13
|
+
*/
|
|
14
|
+
export declare const useSignMessage: () => UseSignMessageReturnType<FullSignatureRes, Error, SignMessageMutationArgs, unknown>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UseMutateAsyncFunction, UseMutateFunction } from '@tanstack/react-query';
|
|
2
|
+
import { SignTransactionArgs } from '../../actions/signTransaction.js';
|
|
3
|
+
import { Compute } from '../../types/utils.js';
|
|
4
|
+
import { UseMutationReturnType } from '../../types/query.js';
|
|
5
|
+
import { FullSignatureRes } from '@getpara/web-sdk';
|
|
6
|
+
type SignTransactionMutationArgs = Omit<SignTransactionArgs, 'walletId'> & Partial<Pick<SignTransactionArgs, 'walletId'>>;
|
|
7
|
+
type UseSignTransactionReturnType<TData = FullSignatureRes, TError = Error, TVariables = SignTransactionMutationArgs, TContext = unknown> = Compute<UseMutationReturnType<TData, TError, TVariables, TContext> & {
|
|
8
|
+
signTransaction: UseMutateFunction<TData, TError, TVariables, TContext>;
|
|
9
|
+
signTransactionAsync: UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Hook for signing a transaction
|
|
13
|
+
*/
|
|
14
|
+
export declare const useSignTransaction: () => UseSignTransactionReturnType<FullSignatureRes, Error, SignTransactionMutationArgs, unknown>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UseMutateAsyncFunction, UseMutateFunction } from '@tanstack/react-query';
|
|
2
|
+
import { waitForAccountCreationArgs } from '../../actions/waitForAccountCreation.js';
|
|
3
|
+
import { UseMutationReturnType } from '../../types/query.js';
|
|
4
|
+
import { Compute } from '../../types/utils.js';
|
|
5
|
+
type UseWaitForAccountCreationReturnType<TData = boolean, TError = Error, TVariables = waitForAccountCreationArgs, TContext = unknown> = Compute<UseMutationReturnType<TData, TError, TVariables, TContext> & {
|
|
6
|
+
waitForAccountCreation: UseMutateFunction<TData, TError, TVariables, TContext>;
|
|
7
|
+
waitForAccountCreationAsync: UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* Hook for waiting for account creation
|
|
11
|
+
*/
|
|
12
|
+
export declare const useWaitForAccountCreation: () => UseWaitForAccountCreationReturnType<boolean, Error, waitForAccountCreationArgs, unknown>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UseMutateAsyncFunction, UseMutateFunction } from '@tanstack/react-query';
|
|
2
|
+
import { WaitForLoginAndSetupArgs } from '../../actions/waitForLoginAndSetup.js';
|
|
3
|
+
import { Compute } from '../../types/utils.js';
|
|
4
|
+
import { UseMutationReturnType } from '../../types/query.js';
|
|
5
|
+
import { LoginResponse } from '@getpara/web-sdk';
|
|
6
|
+
type UseWaitForLoginAndSetupReturnType<TData = LoginResponse, TError = Error, TVariables = WaitForLoginAndSetupArgs, TContext = unknown> = Compute<UseMutationReturnType<TData, TError, TVariables, TContext> & {
|
|
7
|
+
waitForLoginAndSetup: UseMutateFunction<TData, TError, TVariables, TContext>;
|
|
8
|
+
waitForLoginAndSetupAsync: UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* Hook for waiting for user login and account setup
|
|
12
|
+
*/
|
|
13
|
+
export declare const useWaitForLoginAndSetup: () => UseWaitForLoginAndSetupReturnType<LoginResponse, Error, WaitForLoginAndSetupArgs, unknown>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UseMutateAsyncFunction, UseMutateFunction } from '@tanstack/react-query';
|
|
2
|
+
import { UseMutationReturnType } from '../../types/query.js';
|
|
3
|
+
import { Compute } from '../../types/utils.js';
|
|
4
|
+
import { AccountSetupResponse } from '@getpara/web-sdk';
|
|
5
|
+
type UseWaitForPasskeyAndCreateWalletReturnType<TData = AccountSetupResponse, TError = Error, TVariables = void, TContext = unknown> = Compute<UseMutationReturnType<TData, TError, TVariables, TContext> & {
|
|
6
|
+
waitForPasskeyAndCreateWallet: UseMutateFunction<TData, TError, TVariables, TContext>;
|
|
7
|
+
waitForPasskeyAndCreateWalletAsync: UseMutateAsyncFunction<TData, TError, TVariables, TContext>;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* Hook for waiting for session setup and wallet creation
|
|
11
|
+
*/
|
|
12
|
+
export declare const useWaitForPasskeyAndCreateWallet: () => UseWaitForPasskeyAndCreateWalletReturnType<AccountSetupResponse, Error, void, unknown>;
|
|
13
|
+
export {};
|
|
@@ -2,4 +2,10 @@ export declare const ACCOUNT_BASE_KEY = "PARA_ACCOUNT";
|
|
|
2
2
|
/**
|
|
3
3
|
* Hook for retrieving a user account
|
|
4
4
|
*/
|
|
5
|
-
export declare const useAccount: () => import("@tanstack/react-query").UseQueryResult<
|
|
5
|
+
export declare const useAccount: () => import("@tanstack/react-query").UseQueryResult<{
|
|
6
|
+
isConnected: boolean;
|
|
7
|
+
email?: string;
|
|
8
|
+
phone?: string;
|
|
9
|
+
wallets?: Pick<import("@getpara/core-sdk").Wallet, "id" | "type" | "name" | "address" | "isExternal">[];
|
|
10
|
+
userId?: string;
|
|
11
|
+
}, Error>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { BiometricHints } from '@getpara/react-common';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
3
|
import { AuthMethod, CoreMethodParams, AuthState, AuthStateSignup, AuthStateLogin } from '@getpara/web-sdk';
|
|
4
|
-
import { ParaModalProps } from '../../modal
|
|
4
|
+
import { ParaModalProps } from '../../modal/types/modalProps.js';
|
|
5
5
|
import { TelegramAuthResponse, VerifiedAuth, VerifyExternalWalletParams } from '@getpara/user-management-client';
|
|
6
6
|
type Value = {
|
|
7
7
|
signUpOrLogIn: [(_: VerifiedAuth) => void, boolean];
|
|
8
8
|
verifyNewAccount: [(_: string) => void, boolean, Error | null];
|
|
9
|
-
verifyOAuth: (_: CoreMethodParams<'
|
|
9
|
+
verifyOAuth: (_: CoreMethodParams<'verifyOAuthV2'>['method']) => void;
|
|
10
10
|
verifyFarcaster: () => void;
|
|
11
11
|
verifyTelegram: (_: TelegramAuthResponse) => void;
|
|
12
12
|
verifyExternalWallet: (_: VerifyExternalWalletParams) => void;
|