@getpara/react-sdk-lite 2.0.0-alpha.39 → 2.0.0-alpha.41
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/css/modal.css +14 -1
- package/dist/modal/ParaModal.js +29 -6
- package/dist/modal/components/Account/Account.d.ts +1 -5
- package/dist/modal/components/Account/Account.js +53 -71
- package/dist/modal/components/Account/AccountHeader.d.ts +3 -0
- package/dist/modal/components/Account/AccountHeader.js +64 -0
- package/dist/modal/components/Account/AccountProfile.d.ts +4 -1
- package/dist/modal/components/Account/AccountProfile.js +114 -27
- package/dist/modal/components/AddFunds/AddFunds.js +11 -6
- package/dist/modal/components/AddFunds/AddFundsAsset.js +5 -32
- package/dist/modal/components/AddFunds/AddFundsDone.js +1 -1
- package/dist/modal/components/AddFunds/AddFundsProvider.js +1 -1
- package/dist/modal/components/AddFunds/AddFundsReceive.js +8 -53
- package/dist/modal/components/AuthMainStep/AuthMainStep.js +3 -5
- package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +4 -3
- package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +4 -1
- package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +7 -5
- package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +4 -4
- package/dist/modal/components/Body/AnimatedHeightWrapper.d.ts +1 -0
- package/dist/modal/components/Body/AnimatedHeightWrapper.js +2 -2
- package/dist/modal/components/Body/Body.d.ts +3 -1
- package/dist/modal/components/Body/Body.js +40 -47
- package/dist/modal/components/ChainSwitch/ChainSwitch.js +13 -21
- package/dist/modal/components/Controls/{Selects.d.ts → ChainSelect.d.ts} +0 -1
- package/dist/modal/components/Controls/ChainSelect.js +88 -0
- package/dist/modal/components/Controls/Controls.js +10 -20
- package/dist/modal/components/ExternalWalletNetworkSelectStep/ExternalWalletNetworkSelectStep.js +1 -1
- package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +17 -12
- package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +1 -1
- package/dist/modal/components/Footer/Footer.js +26 -57
- package/dist/modal/components/Header/Header.js +46 -8
- package/dist/modal/components/Header/hooks/useStepTitle.d.ts +4 -0
- package/dist/modal/components/Header/hooks/useStepTitle.js +48 -15
- package/dist/modal/components/IFrameStep/IFrameStep.js +22 -10
- package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +16 -10
- package/dist/modal/components/ModalContent/ModalContent.d.ts +4 -3
- package/dist/modal/components/ModalContent/ModalContent.js +5 -1
- package/dist/modal/components/OAuth/FarcasterOAuthStep.js +1 -1
- package/dist/modal/components/OAuth/OAuth.js +1 -1
- package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +2 -2
- package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +3 -3
- package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +1 -1
- package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +1 -1
- package/dist/modal/components/Waiting/Waiting.js +1 -1
- package/dist/modal/components/WalletCard/WalletCard.d.ts +6 -3
- package/dist/modal/components/WalletCard/WalletCard.js +41 -15
- package/dist/modal/components/WalletSelect/WalletSelect.d.ts +11 -0
- package/dist/modal/components/WalletSelect/WalletSelect.js +153 -0
- package/dist/modal/components/common.d.ts +9 -4
- package/dist/modal/components/common.js +67 -13
- package/dist/modal/constants/constants.d.ts +7 -12
- package/dist/modal/constants/constants.js +7 -1
- package/dist/modal/constants/oAuthLogos.d.ts +2 -6
- package/dist/modal/constants/oAuthLogos.js +45 -43
- package/dist/modal/hooks/useGoBack.js +9 -0
- package/dist/modal/types/commonTypes.d.ts +9 -0
- package/dist/modal/utils/getWalletDisplayName.js +3 -6
- package/dist/modal/utils/icons.d.ts +5 -0
- package/dist/modal/utils/icons.js +17 -0
- package/dist/provider/ParaProvider.js +24 -129
- package/dist/provider/ParaProviderMin.d.ts +4 -0
- package/dist/provider/ParaProviderMin.js +140 -0
- package/dist/provider/components/CosmosWalletWrapper.d.ts +1 -1
- package/dist/provider/components/EvmWalletWrapper.d.ts +1 -1
- package/dist/provider/components/ExternalWalletWrapper.js +3 -36
- package/dist/provider/components/SolanaWalletWrapper.d.ts +1 -1
- package/dist/provider/hooks/mutations/useCreateWallet.d.ts +3 -3
- package/dist/provider/hooks/mutations/useCreateWallet.js +1 -1
- package/dist/provider/hooks/mutations/useCreateWalletPerType.d.ts +3 -3
- package/dist/provider/hooks/mutations/useCreateWalletPerType.js +1 -1
- package/dist/provider/hooks/mutations/useIssueJwt.d.ts +3 -3
- package/dist/provider/hooks/mutations/useIssueJwt.js +1 -1
- package/dist/provider/hooks/mutations/useResendVerificationCode.d.ts +6 -6
- package/dist/provider/hooks/mutations/useResendVerificationCode.js +1 -1
- package/dist/provider/hooks/mutations/useVerifyExternalWallet.d.ts +4 -42
- package/dist/provider/hooks/mutations/useVerifyFarcaster.d.ts +3 -3
- package/dist/provider/hooks/mutations/useVerifyFarcaster.js +1 -1
- package/dist/provider/hooks/mutations/useVerifyNewAccount.d.ts +6 -0
- package/dist/provider/hooks/mutations/useWaitForLogin.d.ts +3 -3
- package/dist/provider/hooks/mutations/useWaitForLogin.js +1 -1
- package/dist/provider/hooks/mutations/useWaitForSignup.d.ts +3 -3
- package/dist/provider/hooks/mutations/useWaitForSignup.js +1 -1
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.d.ts +3 -3
- package/dist/provider/hooks/mutations/useWaitForWalletCreation.js +1 -1
- package/dist/provider/index.d.ts +1 -0
- package/dist/provider/index.js +3 -1
- package/dist/provider/providers/AccountLinkProvider.js +8 -4
- package/dist/provider/providers/AuthProvider.js +28 -14
- package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +1 -1
- package/dist/provider/providers/CosmosExternalWalletProvider.js +3 -0
- package/dist/provider/providers/EvmExternalWalletProvider.d.ts +1 -1
- package/dist/provider/providers/EvmExternalWalletProvider.js +3 -0
- package/dist/provider/providers/ExternalWalletProvider.js +1 -1
- package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +1 -1
- package/dist/provider/providers/SolanaExternalWalletProvider.js +3 -0
- package/dist/provider/stores/slices/modal.js +16 -12
- package/dist/provider/utils/constants.d.ts +5 -0
- package/dist/provider/utils/constants.js +64 -1
- package/dist/public/PPMori-Regular.woff2 +0 -0
- package/dist/public/PPMori-SemiBold.woff2 +0 -0
- package/package.json +8 -8
- package/dist/modal/components/Controls/Selects.js +0 -173
- package/dist/provider/utils/externalWalletDefaults.d.ts +0 -6
- package/dist/provider/utils/externalWalletDefaults.js +0 -33
|
@@ -11,7 +11,7 @@ const useVerifyFarcaster = () => {
|
|
|
11
11
|
const para = useClient();
|
|
12
12
|
const mutation = useMutation({
|
|
13
13
|
mutationKey: [VERIFY_FARCASTER_KEY],
|
|
14
|
-
mutationFn: (
|
|
14
|
+
mutationFn: (..._0) => __async(void 0, [..._0], function* (args = {}) {
|
|
15
15
|
try {
|
|
16
16
|
const result = yield verifyFarcaster(para, args);
|
|
17
17
|
return result;
|
|
@@ -26,8 +26,10 @@ export declare const useVerifyNewAccount: () => {
|
|
|
26
26
|
isPasskeySupported: boolean;
|
|
27
27
|
passkeyUrl?: string | undefined;
|
|
28
28
|
passwordUrl?: string | undefined;
|
|
29
|
+
pinUrl?: string | undefined;
|
|
29
30
|
passkeyId?: string | undefined;
|
|
30
31
|
passwordId?: string | undefined;
|
|
32
|
+
pinId?: string | undefined;
|
|
31
33
|
} | undefined;
|
|
32
34
|
isSuccess: boolean;
|
|
33
35
|
variables: {
|
|
@@ -56,8 +58,10 @@ export declare const useVerifyNewAccount: () => {
|
|
|
56
58
|
isPasskeySupported: boolean;
|
|
57
59
|
passkeyUrl?: string | undefined;
|
|
58
60
|
passwordUrl?: string | undefined;
|
|
61
|
+
pinUrl?: string | undefined;
|
|
59
62
|
passkeyId?: string | undefined;
|
|
60
63
|
passwordId?: string | undefined;
|
|
64
|
+
pinId?: string | undefined;
|
|
61
65
|
}, Error, {
|
|
62
66
|
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
63
67
|
useShortUrls?: boolean | undefined;
|
|
@@ -74,8 +78,10 @@ export declare const useVerifyNewAccount: () => {
|
|
|
74
78
|
isPasskeySupported: boolean;
|
|
75
79
|
passkeyUrl?: string | undefined;
|
|
76
80
|
passwordUrl?: string | undefined;
|
|
81
|
+
pinUrl?: string | undefined;
|
|
77
82
|
passkeyId?: string | undefined;
|
|
78
83
|
passwordId?: string | undefined;
|
|
84
|
+
pinId?: string | undefined;
|
|
79
85
|
}, Error, {
|
|
80
86
|
portalTheme?: import("@getpara/web-sdk").Theme | undefined;
|
|
81
87
|
useShortUrls?: boolean | undefined;
|
|
@@ -20,7 +20,7 @@ export declare const useWaitForLogin: () => {
|
|
|
20
20
|
partnerId?: string | undefined;
|
|
21
21
|
} | undefined;
|
|
22
22
|
isSuccess: boolean;
|
|
23
|
-
variables: {
|
|
23
|
+
variables: void | {
|
|
24
24
|
onPoll?: (() => void) | undefined;
|
|
25
25
|
onCancel?: (() => void) | undefined;
|
|
26
26
|
skipSessionRefresh?: boolean | undefined;
|
|
@@ -39,7 +39,7 @@ export declare const useWaitForLogin: () => {
|
|
|
39
39
|
waitForLogin: import("@tanstack/react-query").UseMutateFunction<{
|
|
40
40
|
needsWallet?: boolean | undefined;
|
|
41
41
|
partnerId?: string | undefined;
|
|
42
|
-
}, Error, {
|
|
42
|
+
}, Error, void | {
|
|
43
43
|
onPoll?: (() => void) | undefined;
|
|
44
44
|
onCancel?: (() => void) | undefined;
|
|
45
45
|
skipSessionRefresh?: boolean | undefined;
|
|
@@ -48,7 +48,7 @@ export declare const useWaitForLogin: () => {
|
|
|
48
48
|
waitForLoginAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
49
49
|
needsWallet?: boolean | undefined;
|
|
50
50
|
partnerId?: string | undefined;
|
|
51
|
-
}, Error, {
|
|
51
|
+
}, Error, void | {
|
|
52
52
|
onPoll?: (() => void) | undefined;
|
|
53
53
|
onCancel?: (() => void) | undefined;
|
|
54
54
|
skipSessionRefresh?: boolean | undefined;
|
|
@@ -11,7 +11,7 @@ const useWaitForLogin = () => {
|
|
|
11
11
|
const para = useClient();
|
|
12
12
|
const mutation = useMutation({
|
|
13
13
|
mutationKey: [WAIT_FOR_LOG_IN_KEY],
|
|
14
|
-
mutationFn: (
|
|
14
|
+
mutationFn: (..._0) => __async(void 0, [..._0], function* (args = {}) {
|
|
15
15
|
try {
|
|
16
16
|
const result = yield waitForLogin(para, args);
|
|
17
17
|
return result;
|
|
@@ -17,7 +17,7 @@ export declare const useWaitForSignup: () => {
|
|
|
17
17
|
status: "error" | "idle" | "pending" | "success";
|
|
18
18
|
data: true | undefined;
|
|
19
19
|
isSuccess: boolean;
|
|
20
|
-
variables: {
|
|
20
|
+
variables: void | {
|
|
21
21
|
onPoll?: (() => void) | undefined;
|
|
22
22
|
onCancel?: (() => void) | undefined;
|
|
23
23
|
isCanceled?: (() => boolean) | undefined;
|
|
@@ -32,12 +32,12 @@ export declare const useWaitForSignup: () => {
|
|
|
32
32
|
failureReason: Error | null;
|
|
33
33
|
isPaused: boolean;
|
|
34
34
|
submittedAt: number;
|
|
35
|
-
waitForSignup: import("@tanstack/react-query").UseMutateFunction<true, Error, {
|
|
35
|
+
waitForSignup: import("@tanstack/react-query").UseMutateFunction<true, Error, void | {
|
|
36
36
|
onPoll?: (() => void) | undefined;
|
|
37
37
|
onCancel?: (() => void) | undefined;
|
|
38
38
|
isCanceled?: (() => boolean) | undefined;
|
|
39
39
|
}, unknown>;
|
|
40
|
-
waitForSignupAsync: import("@tanstack/react-query").UseMutateAsyncFunction<true, Error, {
|
|
40
|
+
waitForSignupAsync: import("@tanstack/react-query").UseMutateAsyncFunction<true, Error, void | {
|
|
41
41
|
onPoll?: (() => void) | undefined;
|
|
42
42
|
onCancel?: (() => void) | undefined;
|
|
43
43
|
isCanceled?: (() => boolean) | undefined;
|
|
@@ -11,7 +11,7 @@ const useWaitForSignup = () => {
|
|
|
11
11
|
const para = useClient();
|
|
12
12
|
const mutation = useMutation({
|
|
13
13
|
mutationKey: [WAIT_FOR_SIGN_UP_KEY],
|
|
14
|
-
mutationFn: (
|
|
14
|
+
mutationFn: (..._0) => __async(void 0, [..._0], function* (args = {}) {
|
|
15
15
|
try {
|
|
16
16
|
const result = yield waitForSignup(para, args);
|
|
17
17
|
return result;
|
|
@@ -20,7 +20,7 @@ export declare const useWaitForWalletCreation: () => {
|
|
|
20
20
|
recoverySecret?: string | undefined;
|
|
21
21
|
} | undefined;
|
|
22
22
|
isSuccess: boolean;
|
|
23
|
-
variables: {
|
|
23
|
+
variables: void | {
|
|
24
24
|
onPoll?: (() => void) | undefined;
|
|
25
25
|
onCancel?: (() => void) | undefined;
|
|
26
26
|
isCanceled?: (() => boolean) | undefined;
|
|
@@ -38,7 +38,7 @@ export declare const useWaitForWalletCreation: () => {
|
|
|
38
38
|
waitForWalletCreation: import("@tanstack/react-query").UseMutateFunction<{
|
|
39
39
|
walletIds: import("@getpara/web-sdk").CurrentWalletIds;
|
|
40
40
|
recoverySecret?: string | undefined;
|
|
41
|
-
}, Error, {
|
|
41
|
+
}, Error, void | {
|
|
42
42
|
onPoll?: (() => void) | undefined;
|
|
43
43
|
onCancel?: (() => void) | undefined;
|
|
44
44
|
isCanceled?: (() => boolean) | undefined;
|
|
@@ -46,7 +46,7 @@ export declare const useWaitForWalletCreation: () => {
|
|
|
46
46
|
waitForWalletCreationAsync: import("@tanstack/react-query").UseMutateAsyncFunction<{
|
|
47
47
|
walletIds: import("@getpara/web-sdk").CurrentWalletIds;
|
|
48
48
|
recoverySecret?: string | undefined;
|
|
49
|
-
}, Error, {
|
|
49
|
+
}, Error, void | {
|
|
50
50
|
onPoll?: (() => void) | undefined;
|
|
51
51
|
onCancel?: (() => void) | undefined;
|
|
52
52
|
isCanceled?: (() => boolean) | undefined;
|
|
@@ -11,7 +11,7 @@ const useWaitForWalletCreation = () => {
|
|
|
11
11
|
const para = useClient();
|
|
12
12
|
const mutation = useMutation({
|
|
13
13
|
mutationKey: [WAIT_FOR_WALLET_CREATION_KEY],
|
|
14
|
-
mutationFn: (
|
|
14
|
+
mutationFn: (..._0) => __async(void 0, [..._0], function* (args = {}) {
|
|
15
15
|
try {
|
|
16
16
|
const result = yield waitForWalletCreation(para, args);
|
|
17
17
|
return result;
|
package/dist/provider/index.d.ts
CHANGED
package/dist/provider/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../chunk-MMUBH76A.js";
|
|
3
3
|
import { ParaProvider } from "./ParaProvider.js";
|
|
4
|
+
import { ParaProviderMin } from "./ParaProviderMin.js";
|
|
4
5
|
export * from "./hooks/index.js";
|
|
5
6
|
export * from "./stores/getters.js";
|
|
6
7
|
export * from "./stores/setters.js";
|
|
7
8
|
export * from "./types/externalWalletProviders.js";
|
|
8
9
|
export * from "./types/provider.js";
|
|
9
10
|
export {
|
|
10
|
-
ParaProvider
|
|
11
|
+
ParaProvider,
|
|
12
|
+
ParaProviderMin
|
|
11
13
|
};
|
|
@@ -20,6 +20,7 @@ import { generateInternalMutation } from "../hooks/mutations/utils.js";
|
|
|
20
20
|
import { validateAuth } from "../../modal/utils/authInputHelpers.js";
|
|
21
21
|
import { EXTERNAL_WALLET_TYPES, extractAuthInfo } from "@getpara/user-management-client";
|
|
22
22
|
import { useStore } from "../stores/useStore.js";
|
|
23
|
+
import { LINKED_ACCOUNTS_BASE_KEY } from "../hooks/queries/useLinkedAccounts.js";
|
|
23
24
|
const AccountLinkContext = createContext({
|
|
24
25
|
isEnabled: false,
|
|
25
26
|
accountLinkInProgress: void 0,
|
|
@@ -66,10 +67,10 @@ const useVerifyFarcasterLink = generateInternalMutation("verifyFarcasterLink", a
|
|
|
66
67
|
const useVerifyTelegramLink = generateInternalMutation("verifyTelegramLink", actions.verifyTelegramLink);
|
|
67
68
|
const useVerifyExternalWalletLink = generateInternalMutation("verifyExternalWalletLink", actions.verifyExternalWalletLink);
|
|
68
69
|
const AccountLinkProvider = ({ children }) => {
|
|
69
|
-
var _a;
|
|
70
|
+
var _a, _b, _c;
|
|
70
71
|
const para = useInternalClient();
|
|
71
72
|
const queryClient = useQueryClient();
|
|
72
|
-
const
|
|
73
|
+
const account = useAccount();
|
|
73
74
|
const { data: coreAccountLinkInProgress } = useAccountLinkInProgress();
|
|
74
75
|
const {
|
|
75
76
|
wallet: connectedWallet,
|
|
@@ -87,6 +88,7 @@ const AccountLinkProvider = ({ children }) => {
|
|
|
87
88
|
const externalWalletError = useModalStore((state) => state.externalWalletError);
|
|
88
89
|
const accountLinkOptions = useModalStore((state) => state.accountLinkOptions) || [...LINKED_ACCOUNT_TYPES];
|
|
89
90
|
const setAccountLinkOptions = useModalStore((state) => state.setAccountLinkOptions);
|
|
91
|
+
const externalWalletsWithFullAuth = useStore((state) => state.externalWalletsWithFullAuth);
|
|
90
92
|
const goBack = useGoBack();
|
|
91
93
|
const { mutateAsync: mutateLinkAccountAsync, isPending: isLinkAccountPending } = useLinkAccount();
|
|
92
94
|
const { mutate: mutateUnlinkAccount, isPending: isUnlinkAccountPending } = useUnlinkAccount();
|
|
@@ -111,7 +113,8 @@ const AccountLinkProvider = ({ children }) => {
|
|
|
111
113
|
status: statusVerifyExternalWalletLink,
|
|
112
114
|
reset: resetVerifyExternalWalletLink
|
|
113
115
|
} = useVerifyExternalWalletLink();
|
|
114
|
-
const
|
|
116
|
+
const { embedded } = account;
|
|
117
|
+
const isEnabled = (embedded == null ? void 0 : embedded.isConnected) || !(embedded == null ? void 0 : embedded.isGuestMode) && (!((_a = para.authInfo) == null ? void 0 : _a.externalWallet) || includeWalletVerification || externalWalletsWithFullAuth.includes((_c = (_b = para.authInfo) == null ? void 0 : _b.externalWallet) == null ? void 0 : _c.providerId));
|
|
115
118
|
const [accountLinkInProgress, setAccountLinkInProgress] = useState(
|
|
116
119
|
coreAccountLinkInProgress || void 0
|
|
117
120
|
);
|
|
@@ -187,7 +190,7 @@ const AccountLinkProvider = ({ children }) => {
|
|
|
187
190
|
yield onAccountLinkVerified(updatedAccounts);
|
|
188
191
|
} catch (e) {
|
|
189
192
|
console.error(e);
|
|
190
|
-
setLinkAccountError(
|
|
193
|
+
setLinkAccountError(e.message);
|
|
191
194
|
} finally {
|
|
192
195
|
if (linkWallet.type === "EVM" || linkWallet.type === "SOLANA") {
|
|
193
196
|
yield disconnectBase(providerId, linkWallet.type);
|
|
@@ -314,6 +317,7 @@ const AccountLinkProvider = ({ children }) => {
|
|
|
314
317
|
}
|
|
315
318
|
};
|
|
316
319
|
const onAccountLinkVerified = (updatedAccounts) => {
|
|
320
|
+
queryClient.invalidateQueries({ queryKey: [LINKED_ACCOUNTS_BASE_KEY] });
|
|
317
321
|
queryClient.setQueryData(["getLinkedAccounts"], () => updatedAccounts);
|
|
318
322
|
setTimeout(() => {
|
|
319
323
|
setStep(ModalStep.ACCOUNT_PROFILE);
|
|
@@ -215,6 +215,16 @@ function AuthProvider({
|
|
|
215
215
|
setAuthStepRoute(ModalStep.PASSWORD_CREATION);
|
|
216
216
|
}
|
|
217
217
|
break;
|
|
218
|
+
case AuthMethod.PIN:
|
|
219
|
+
setupListener();
|
|
220
|
+
if (isIFrameReady) {
|
|
221
|
+
setStep(ModalStep.PASSWORD_CREATION);
|
|
222
|
+
} else {
|
|
223
|
+
setIFrameUrl(authState.pinUrl);
|
|
224
|
+
setIsIFrameReady(false);
|
|
225
|
+
setAuthStepRoute(ModalStep.PASSWORD_CREATION);
|
|
226
|
+
}
|
|
227
|
+
break;
|
|
218
228
|
}
|
|
219
229
|
},
|
|
220
230
|
[isIFrameReady]
|
|
@@ -224,7 +234,7 @@ function AuthProvider({
|
|
|
224
234
|
setStep(ModalStep.BIOMETRIC_LOGIN);
|
|
225
235
|
} else {
|
|
226
236
|
setupListener();
|
|
227
|
-
setIFrameUrl(authState.passwordUrl);
|
|
237
|
+
setIFrameUrl(authState.passwordUrl || authState.pinUrl);
|
|
228
238
|
setIsIFrameReady(false);
|
|
229
239
|
setStep(ModalStep.EMBEDDED_PASSWORD_LOGIN);
|
|
230
240
|
}
|
|
@@ -272,7 +282,7 @@ function AuthProvider({
|
|
|
272
282
|
};
|
|
273
283
|
const presentLoginUi = useCallback(
|
|
274
284
|
(method, authState) => {
|
|
275
|
-
const
|
|
285
|
+
const isPassword = method === AuthMethod.PASSWORD, isPIN = method === AuthMethod.PIN;
|
|
276
286
|
if (overrides.login) {
|
|
277
287
|
function loginOverride() {
|
|
278
288
|
return __async(this, null, function* () {
|
|
@@ -286,12 +296,12 @@ function AuthProvider({
|
|
|
286
296
|
return;
|
|
287
297
|
}
|
|
288
298
|
refs.popupWindow.current = openPopup({
|
|
289
|
-
url: isPassword ? authState.passwordUrl : authState.passkeyUrl,
|
|
290
|
-
target: isPassword ? "ParaPassword" : "ParaPasskey",
|
|
291
|
-
type: isPassword ? "LOGIN_PASSWORD" : "LOGIN_PASSKEY",
|
|
299
|
+
url: isPIN ? authState.pinUrl : isPassword ? authState.passwordUrl : authState.passkeyUrl,
|
|
300
|
+
target: isPIN ? "ParaPIN" : isPassword ? "ParaPassword" : "ParaPasskey",
|
|
301
|
+
type: isPIN ? "LOGIN_PASSWORD" : isPassword ? "LOGIN_PASSWORD" : "LOGIN_PASSKEY",
|
|
292
302
|
current: refs.popupWindow.current
|
|
293
303
|
});
|
|
294
|
-
setStep(isPassword ? ModalStep.AWAITING_PASSWORD_LOGIN : ModalStep.AWAITING_BIOMETRIC_LOGIN);
|
|
304
|
+
setStep(isPassword || isPIN ? ModalStep.AWAITING_PASSWORD_LOGIN : ModalStep.AWAITING_BIOMETRIC_LOGIN);
|
|
295
305
|
},
|
|
296
306
|
[loginState, biometricHints]
|
|
297
307
|
);
|
|
@@ -307,18 +317,22 @@ function AuthProvider({
|
|
|
307
317
|
}
|
|
308
318
|
break;
|
|
309
319
|
case "login":
|
|
310
|
-
|
|
320
|
+
if (authState.pinUrl && authState.signatureVerificationMessage) {
|
|
321
|
+
setStep(ModalStep.EXTERNAL_WALLET_VERIFICATION);
|
|
322
|
+
} else {
|
|
323
|
+
login(authState);
|
|
324
|
+
}
|
|
311
325
|
break;
|
|
312
326
|
case "signup":
|
|
313
327
|
{
|
|
314
|
-
const isPassword = !!authState.passwordUrl,
|
|
315
|
-
if (
|
|
316
|
-
setIFrameUrl(authState.passwordUrl);
|
|
328
|
+
const isPassword = !!authState.passwordUrl, isPIN = !!authState.pinUrl, isPasswordOrPIN = isPassword || isPIN, isPasswordOrPINOnly = isPasswordOrPIN && (!authState.passkeyUrl || (userAgent == null ? void 0 : userAgent.device.type) === "mobile" && !authState.isPasskeySupported);
|
|
329
|
+
if (isPasswordOrPIN) {
|
|
330
|
+
setIFrameUrl(authState.passwordUrl || authState.pinUrl);
|
|
317
331
|
setIsIFrameReady(false);
|
|
318
332
|
}
|
|
319
333
|
signup();
|
|
320
|
-
if (
|
|
321
|
-
presentSignupUi(AuthMethod.PASSWORD, authState);
|
|
334
|
+
if (isPasswordOrPINOnly) {
|
|
335
|
+
presentSignupUi(isPassword ? AuthMethod.PASSWORD : AuthMethod.PIN, authState);
|
|
322
336
|
} else {
|
|
323
337
|
setStep(ModalStep.BIOMETRIC_CREATION);
|
|
324
338
|
}
|
|
@@ -521,12 +535,12 @@ function AuthProvider({
|
|
|
521
535
|
]
|
|
522
536
|
);
|
|
523
537
|
useEffect(() => {
|
|
524
|
-
if (!!authStepRoute &&
|
|
538
|
+
if (!!authStepRoute && refs.currentStep.current !== authStepRoute) {
|
|
525
539
|
setTimeout(() => {
|
|
526
540
|
setStep(authStepRoute);
|
|
527
541
|
}, 200);
|
|
528
542
|
}
|
|
529
|
-
}, [authStepRoute
|
|
543
|
+
}, [authStepRoute]);
|
|
530
544
|
useEffect(() => {
|
|
531
545
|
refs.currentStep.current = currentStep;
|
|
532
546
|
}, [currentStep]);
|
|
@@ -2,6 +2,6 @@ import { PropsWithChildren } from 'react';
|
|
|
2
2
|
import { ExternalWalletProviderCommon, ParaCosmosProviderConfigNoWallets } from '../types/externalWalletProviders.js';
|
|
3
3
|
import { ParaCosmosProviderProps } from '@getpara/cosmos-wallet-connectors';
|
|
4
4
|
export declare function CosmosExternalWalletProvider({ children, isUsing, wallets: walletsFromProps, ...rest }: Omit<ParaCosmosProviderProps, 'config'> & {
|
|
5
|
-
config: ParaCosmosProviderConfigNoWallets;
|
|
5
|
+
config: ParaCosmosProviderConfigNoWallets | undefined;
|
|
6
6
|
} & PropsWithChildren & ExternalWalletProviderCommon): string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
7
7
|
export declare const MemoizedCosmosExternalWalletProvider: import("react").MemoExoticComponent<typeof CosmosExternalWalletProvider>;
|
|
@@ -52,6 +52,9 @@ function CosmosExternalWalletProvider(_a) {
|
|
|
52
52
|
if (isLoadingLib) {
|
|
53
53
|
return null;
|
|
54
54
|
}
|
|
55
|
+
if (!rest.config) {
|
|
56
|
+
return children;
|
|
57
|
+
}
|
|
55
58
|
if (CosmosProvider) {
|
|
56
59
|
return /* @__PURE__ */ jsx(CosmosProvider, __spreadProps(__spreadValues({}, rest), { config: __spreadProps(__spreadValues({}, rest == null ? void 0 : rest.config), { wallets: filteredWallets }), children }));
|
|
57
60
|
} else if (isUsing) {
|
|
@@ -3,5 +3,5 @@ import { ParaEvmProviderProps } from '@getpara/evm-wallet-connectors';
|
|
|
3
3
|
import { Chain, Transport } from 'viem';
|
|
4
4
|
import { ExternalWalletProviderCommon, ParaEvmProviderConfigNoWallets } from '../types/externalWalletProviders.js';
|
|
5
5
|
export declare function EvmExternalWalletProvider<const chains extends readonly [Chain, ...Chain[]], transports extends Record<chains[number]['id'], Transport>>({ children, isUsing, wallets: walletsFromProps, ...rest }: Omit<ParaEvmProviderProps<chains, transports>, 'config'> & {
|
|
6
|
-
config: ParaEvmProviderConfigNoWallets<chains, transports
|
|
6
|
+
config: ParaEvmProviderConfigNoWallets<chains, transports> | undefined;
|
|
7
7
|
} & PropsWithChildren & ExternalWalletProviderCommon): string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -62,6 +62,9 @@ function EvmExternalWalletProvider(_a) {
|
|
|
62
62
|
if (isLoadingLib) {
|
|
63
63
|
return null;
|
|
64
64
|
}
|
|
65
|
+
if (!rest.config) {
|
|
66
|
+
return children;
|
|
67
|
+
}
|
|
65
68
|
if (EvmProvider) {
|
|
66
69
|
return /* @__PURE__ */ jsx(EvmProvider, __spreadProps(__spreadValues({}, rest), { config: __spreadProps(__spreadValues({}, rest == null ? void 0 : rest.config), { wallets: filteredWallets }), children }));
|
|
67
70
|
} else if (isUsing) {
|
|
@@ -474,7 +474,7 @@ function ExternalWalletProvider({ children }) {
|
|
|
474
474
|
}
|
|
475
475
|
});
|
|
476
476
|
const disconnectExternalWallet = () => __async(this, null, function* () {
|
|
477
|
-
yield para.logout();
|
|
477
|
+
if (para.isExternalWalletAuth) yield para.logout();
|
|
478
478
|
yield evmDisconnect();
|
|
479
479
|
yield cosmosDisconnect();
|
|
480
480
|
setSelectedExternalWallet();
|
|
@@ -2,6 +2,6 @@ import { PropsWithChildren } from 'react';
|
|
|
2
2
|
import { ParaSolanaProviderProps } from '@getpara/solana-wallet-connectors';
|
|
3
3
|
import { ExternalWalletProviderCommon, ParaSolanaProviderConfigNoWallets } from '../types/externalWalletProviders.js';
|
|
4
4
|
export declare function SolanaExternalWalletProvider({ children, isUsing, wallets: walletsFromProps, ...rest }: Omit<ParaSolanaProviderProps, 'config'> & {
|
|
5
|
-
config: ParaSolanaProviderConfigNoWallets;
|
|
5
|
+
config: ParaSolanaProviderConfigNoWallets | undefined;
|
|
6
6
|
} & PropsWithChildren & ExternalWalletProviderCommon): string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
7
7
|
export declare const MemoizedSolanaExternalWalletProvider: import("react").MemoExoticComponent<typeof SolanaExternalWalletProvider>;
|
|
@@ -52,6 +52,9 @@ function SolanaExternalWalletProvider(_a) {
|
|
|
52
52
|
if (isLoadingLib) {
|
|
53
53
|
return null;
|
|
54
54
|
}
|
|
55
|
+
if (!rest.config) {
|
|
56
|
+
return children;
|
|
57
|
+
}
|
|
55
58
|
if (SolanaProvider) {
|
|
56
59
|
return /* @__PURE__ */ jsx(SolanaProvider, __spreadProps(__spreadValues({}, rest), { config: __spreadProps(__spreadValues({}, rest == null ? void 0 : rest.config), { wallets: filteredWallets }), children }));
|
|
57
60
|
} else if (isUsing) {
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import "../../../chunk-MMUBH76A.js";
|
|
3
3
|
import { createRef } from "react";
|
|
4
|
-
const createModalSlice = (set
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
const createModalSlice = (set) => ({
|
|
5
|
+
modalConfig: void 0,
|
|
6
|
+
setModalConfig: (modalConfig) => {
|
|
7
|
+
var _a, _b, _c;
|
|
8
|
+
return set({
|
|
9
|
+
modalConfig,
|
|
10
|
+
isDarkTheme: ((_a = modalConfig == null ? void 0 : modalConfig.theme) == null ? void 0 : _a.mode) === "dark",
|
|
11
|
+
oAuthLogoVariant: (_c = (_b = modalConfig == null ? void 0 : modalConfig.theme) == null ? void 0 : _b.oAuthLogoVariant) != null ? _c : "default"
|
|
12
|
+
});
|
|
13
|
+
},
|
|
14
|
+
isDarkTheme: false,
|
|
15
|
+
oAuthLogoVariant: "default",
|
|
16
|
+
isOpen: false,
|
|
17
|
+
setIsOpen: (isOpen) => set({ isOpen }),
|
|
18
|
+
openedToStep: createRef()
|
|
19
|
+
});
|
|
16
20
|
export {
|
|
17
21
|
createModalSlice
|
|
18
22
|
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { Chain, Transport } from 'viem';
|
|
2
|
+
import { ParaCosmosProviderConfigNoWallets, ParaEvmProviderConfigNoWallets, ParaSolanaProviderConfigNoWallets } from '../types/externalWalletProviders.js';
|
|
1
3
|
export declare const EXTERNAL_WALLET_PACKAGE_BY_TYPE: {
|
|
2
4
|
EVM: string;
|
|
3
5
|
COSMOS: string;
|
|
4
6
|
SOLANA: string;
|
|
5
7
|
};
|
|
8
|
+
export declare const EVM_CONFIG_DEFAULT: Omit<ParaEvmProviderConfigNoWallets<readonly [Chain, ...Chain[]], Record<[Chain, ...Chain[]][number]['id'], Transport>>, 'appName' | 'appDescription' | 'appUrl' | 'appIcon' | 'projectId'>;
|
|
9
|
+
export declare const COSMOS_CONFIG_DEFAULT: ParaCosmosProviderConfigNoWallets;
|
|
10
|
+
export declare const SOLANA_CONFIG_DEFAULT: Omit<ParaSolanaProviderConfigNoWallets, 'appIdentity'>;
|
|
@@ -5,6 +5,69 @@ const EXTERNAL_WALLET_PACKAGE_BY_TYPE = {
|
|
|
5
5
|
COSMOS: "Graz",
|
|
6
6
|
SOLANA: "@solana/wallet-adapter-react"
|
|
7
7
|
};
|
|
8
|
+
const EVM_CONFIG_DEFAULT = {
|
|
9
|
+
chains: [
|
|
10
|
+
{
|
|
11
|
+
id: 11155111,
|
|
12
|
+
name: "Sepolia",
|
|
13
|
+
nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
|
|
14
|
+
rpcUrls: { default: { http: ["https://rpc.sepolia.org"] } },
|
|
15
|
+
blockExplorers: {
|
|
16
|
+
default: {
|
|
17
|
+
name: "Etherscan",
|
|
18
|
+
url: "https://sepolia.etherscan.io",
|
|
19
|
+
apiUrl: "https://api-sepolia.etherscan.io/api"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
contracts: {
|
|
23
|
+
multicall3: { address: "0xca11bde05977b3631167028862be2a173976ca11", blockCreated: 751532 },
|
|
24
|
+
ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
|
|
25
|
+
ensUniversalResolver: { address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC", blockCreated: 5317080 }
|
|
26
|
+
},
|
|
27
|
+
testnet: true
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
};
|
|
31
|
+
const COSMOS_CONFIG_DEFAULT = {
|
|
32
|
+
chains: [
|
|
33
|
+
{
|
|
34
|
+
chainId: "theta-testnet-001",
|
|
35
|
+
currencies: [{ coinDenom: "atom", coinMinimalDenom: "uatom", coinDecimals: 6 }],
|
|
36
|
+
rest: "https://cosmoshubt.lava.build",
|
|
37
|
+
rpc: "https://cosmoshubt.tendermintrpc.lava.build:443",
|
|
38
|
+
bech32Config: {
|
|
39
|
+
bech32PrefixAccAddr: "cosmos",
|
|
40
|
+
bech32PrefixAccPub: "cosmospub",
|
|
41
|
+
bech32PrefixValAddr: "cosmosvaloper",
|
|
42
|
+
bech32PrefixValPub: "cosmosvaloperpub",
|
|
43
|
+
bech32PrefixConsAddr: "cosmosvalcons",
|
|
44
|
+
bech32PrefixConsPub: "cosmosvalconspub"
|
|
45
|
+
},
|
|
46
|
+
chainName: "cosmoshubtestnet",
|
|
47
|
+
feeCurrencies: [
|
|
48
|
+
{
|
|
49
|
+
coinDenom: "atom",
|
|
50
|
+
coinMinimalDenom: "uatom",
|
|
51
|
+
coinDecimals: 6,
|
|
52
|
+
coinGeckoId: "",
|
|
53
|
+
gasPriceStep: { low: 0.01, average: 0.025, high: 0.03 }
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
stakeCurrency: { coinDenom: "atom", coinMinimalDenom: "uatom", coinDecimals: 6 },
|
|
57
|
+
bip44: { coinType: 118 }
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
onSwitchChain: () => {
|
|
61
|
+
},
|
|
62
|
+
selectedChainId: "theta-testnet-001"
|
|
63
|
+
};
|
|
64
|
+
const SOLANA_CONFIG_DEFAULT = {
|
|
65
|
+
chain: "devnet",
|
|
66
|
+
endpoint: "https://api.devnet.solana.com"
|
|
67
|
+
};
|
|
8
68
|
export {
|
|
9
|
-
|
|
69
|
+
COSMOS_CONFIG_DEFAULT,
|
|
70
|
+
EVM_CONFIG_DEFAULT,
|
|
71
|
+
EXTERNAL_WALLET_PACKAGE_BY_TYPE,
|
|
72
|
+
SOLANA_CONFIG_DEFAULT
|
|
10
73
|
};
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/react-sdk-lite",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.41",
|
|
4
4
|
"bin": {
|
|
5
5
|
"setup-para": "dist/cli/cli.mjs"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@getpara/react-common": "2.0.0-alpha.
|
|
9
|
-
"@getpara/react-components": "2.0.0-alpha.
|
|
10
|
-
"@getpara/web-sdk": "2.0.0-alpha.
|
|
8
|
+
"@getpara/react-common": "2.0.0-alpha.41",
|
|
9
|
+
"@getpara/react-components": "2.0.0-alpha.41",
|
|
10
|
+
"@getpara/web-sdk": "2.0.0-alpha.41",
|
|
11
11
|
"date-fns": "^3.6.0",
|
|
12
12
|
"framer-motion": "^11.3.31",
|
|
13
13
|
"libphonenumber-js": "^1.11.7",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"zustand-sync-tabs": "^0.2.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@getpara/cosmos-wallet-connectors": "2.0.0-alpha.
|
|
20
|
-
"@getpara/evm-wallet-connectors": "2.0.0-alpha.
|
|
21
|
-
"@getpara/solana-wallet-connectors": "2.0.0-alpha.
|
|
19
|
+
"@getpara/cosmos-wallet-connectors": "2.0.0-alpha.41",
|
|
20
|
+
"@getpara/evm-wallet-connectors": "2.0.0-alpha.41",
|
|
21
|
+
"@getpara/solana-wallet-connectors": "2.0.0-alpha.41",
|
|
22
22
|
"@tanstack/react-query": "^5.74.0",
|
|
23
23
|
"@testing-library/dom": "^10.4.0",
|
|
24
24
|
"@testing-library/react": "^16.3.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"package.json",
|
|
39
39
|
"styles.css"
|
|
40
40
|
],
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "1d153152b648828e13bed611ad479d48247642d1",
|
|
42
42
|
"main": "dist/index.js",
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@tanstack/react-query": ">=5.0.0",
|