@dynamic-labs/sdk-react-core 2.1.0-alpha.12 → 2.1.0-alpha.13
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/CHANGELOG.md +7 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +1 -1
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +3 -1
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +3 -1
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +2 -2
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.d.ts +2 -1
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +2 -2
- package/src/lib/views/FarcasterQrCodeView/FarcasterQrCodeView.cjs +17 -75
- package/src/lib/views/FarcasterQrCodeView/FarcasterQrCodeView.js +17 -75
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.cjs +1 -0
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.1.0-alpha.13](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.12...v2.1.0-alpha.13) (2024-05-03)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* ensure Farcaster QR uses useSocialAuth hook ([#5550](https://github.com/dynamic-labs/DynamicAuth/issues/5550)) ([57fcd97](https://github.com/dynamic-labs/DynamicAuth/commit/57fcd97c44e3f52065dcf856acf7bca7b24fabc7))
|
|
8
|
+
|
|
2
9
|
## [2.1.0-alpha.12](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.11...v2.1.0-alpha.12) (2024-05-02)
|
|
3
10
|
|
|
4
11
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.13",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"react-i18next": "13.5.0",
|
|
18
18
|
"yup": "0.32.11",
|
|
19
19
|
"react-international-phone": "4.2.5",
|
|
20
|
-
"@dynamic-labs/iconic": "2.1.0-alpha.
|
|
21
|
-
"@dynamic-labs/logger": "2.1.0-alpha.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "2.1.0-alpha.
|
|
23
|
-
"@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.
|
|
24
|
-
"@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.
|
|
25
|
-
"@dynamic-labs/rpc-providers": "2.1.0-alpha.
|
|
26
|
-
"@dynamic-labs/types": "2.1.0-alpha.
|
|
27
|
-
"@dynamic-labs/utils": "2.1.0-alpha.
|
|
28
|
-
"@dynamic-labs/viem-utils": "2.1.0-alpha.
|
|
29
|
-
"@dynamic-labs/wallet-book": "2.1.0-alpha.
|
|
30
|
-
"@dynamic-labs/wallet-connector-core": "2.1.0-alpha.
|
|
20
|
+
"@dynamic-labs/iconic": "2.1.0-alpha.13",
|
|
21
|
+
"@dynamic-labs/logger": "2.1.0-alpha.13",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "2.1.0-alpha.13",
|
|
23
|
+
"@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.13",
|
|
24
|
+
"@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.13",
|
|
25
|
+
"@dynamic-labs/rpc-providers": "2.1.0-alpha.13",
|
|
26
|
+
"@dynamic-labs/types": "2.1.0-alpha.13",
|
|
27
|
+
"@dynamic-labs/utils": "2.1.0-alpha.13",
|
|
28
|
+
"@dynamic-labs/viem-utils": "2.1.0-alpha.13",
|
|
29
|
+
"@dynamic-labs/wallet-book": "2.1.0-alpha.13",
|
|
30
|
+
"@dynamic-labs/wallet-connector-core": "2.1.0-alpha.13",
|
|
31
31
|
"eventemitter3": "5.0.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs
CHANGED
|
@@ -81,8 +81,8 @@ require('qrcode');
|
|
|
81
81
|
require('../../../../views/WalletList/WalletList.cjs');
|
|
82
82
|
require('../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
83
83
|
require('@hcaptcha/react-hcaptcha');
|
|
84
|
-
require('../../../../views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.cjs');
|
|
85
84
|
require('@dynamic-labs/types');
|
|
85
|
+
require('../../../../views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.cjs');
|
|
86
86
|
|
|
87
87
|
const UserProfileSocialAccount = ({ provider, }) => {
|
|
88
88
|
var _a;
|
package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js
CHANGED
|
@@ -77,8 +77,8 @@ import 'qrcode';
|
|
|
77
77
|
import '../../../../views/WalletList/WalletList.js';
|
|
78
78
|
import '../../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
79
79
|
import '@hcaptcha/react-hcaptcha';
|
|
80
|
-
import '../../../../views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.js';
|
|
81
80
|
import '@dynamic-labs/types';
|
|
81
|
+
import '../../../../views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.js';
|
|
82
82
|
|
|
83
83
|
const UserProfileSocialAccount = ({ provider, }) => {
|
|
84
84
|
var _a;
|
|
@@ -12,7 +12,7 @@ require('../../../shared/logger.cjs');
|
|
|
12
12
|
require('@dynamic-labs/iconic');
|
|
13
13
|
require('@dynamic-labs/wallet-connector-core');
|
|
14
14
|
require('react/jsx-runtime');
|
|
15
|
-
require('../../../context/ViewContext/ViewContext.cjs');
|
|
15
|
+
var ViewContext = require('../../../context/ViewContext/ViewContext.cjs');
|
|
16
16
|
require('@dynamic-labs/wallet-book');
|
|
17
17
|
var localStorage$1 = require('../../constants/localStorage.cjs');
|
|
18
18
|
require('../../constants/colors.cjs');
|
|
@@ -87,9 +87,11 @@ const useSocialAccounts = ({ sessionTimeout } = {
|
|
|
87
87
|
}) => {
|
|
88
88
|
var _a;
|
|
89
89
|
const { environmentId, user, projectSettings, onboardingOnlyJwt } = useInternalDynamicContext.useInternalDynamicContext();
|
|
90
|
+
const { setView } = ViewContext.useViewContext();
|
|
90
91
|
const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback.useUpdateUserProfileByJWTCallback();
|
|
91
92
|
const { handleError, setError, setIsProcessing, checkValidProvider, error, isProcessing, connectSocialAccount, } = useSocialAuth.useSocialAuth({
|
|
92
93
|
authMode: 'link',
|
|
94
|
+
onFarcasterUrl: (url) => setView('farcaster-connect-view', { url }),
|
|
93
95
|
sessionTimeout,
|
|
94
96
|
});
|
|
95
97
|
const userJwt = (_a = getMinAuthToken.getMinAuthToken()) !== null && _a !== void 0 ? _a : onboardingOnlyJwt;
|
|
@@ -8,7 +8,7 @@ import '../../../shared/logger.js';
|
|
|
8
8
|
import '@dynamic-labs/iconic';
|
|
9
9
|
import '@dynamic-labs/wallet-connector-core';
|
|
10
10
|
import 'react/jsx-runtime';
|
|
11
|
-
import '../../../context/ViewContext/ViewContext.js';
|
|
11
|
+
import { useViewContext } from '../../../context/ViewContext/ViewContext.js';
|
|
12
12
|
import '@dynamic-labs/wallet-book';
|
|
13
13
|
import { PRIMARY_WALLET_ID } from '../../constants/localStorage.js';
|
|
14
14
|
import '../../constants/colors.js';
|
|
@@ -83,9 +83,11 @@ const useSocialAccounts = ({ sessionTimeout } = {
|
|
|
83
83
|
}) => {
|
|
84
84
|
var _a;
|
|
85
85
|
const { environmentId, user, projectSettings, onboardingOnlyJwt } = useInternalDynamicContext();
|
|
86
|
+
const { setView } = useViewContext();
|
|
86
87
|
const { updateUserProfileByJWT } = useUpdateUserProfileByJWTCallback();
|
|
87
88
|
const { handleError, setError, setIsProcessing, checkValidProvider, error, isProcessing, connectSocialAccount, } = useSocialAuth({
|
|
88
89
|
authMode: 'link',
|
|
90
|
+
onFarcasterUrl: (url) => setView('farcaster-connect-view', { url }),
|
|
89
91
|
sessionTimeout,
|
|
90
92
|
});
|
|
91
93
|
const userJwt = (_a = getMinAuthToken()) !== null && _a !== void 0 ? _a : onboardingOnlyJwt;
|
|
@@ -105,7 +105,7 @@ const socialProviders = [
|
|
|
105
105
|
const providersRequiringPkce = ['twitter', 'github'];
|
|
106
106
|
const providersWithoutWindowOpenerRefence = ['twitter'];
|
|
107
107
|
// Hook to handle common social auth logic (for social linking and social sign in)
|
|
108
|
-
const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
|
|
108
|
+
const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, onFarcasterUrl, }) => {
|
|
109
109
|
var _a;
|
|
110
110
|
const { environmentId, onboardingOnlyJwt, setOnboardingOnlyJwt, setCallback, setShowAuthFlow, projectSettings, consumeNonce, redirectUrl, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
111
111
|
const { handleVerifiedUserWithJWT } = useHandleVerifiedUser.useHandleVerifiedUser();
|
|
@@ -414,7 +414,7 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
|
|
|
414
414
|
}
|
|
415
415
|
else {
|
|
416
416
|
setShowAuthFlow(true);
|
|
417
|
-
|
|
417
|
+
onFarcasterUrl === null || onFarcasterUrl === void 0 ? void 0 : onFarcasterUrl(data.url);
|
|
418
418
|
}
|
|
419
419
|
const status = yield farcaster.watchStatus({
|
|
420
420
|
channelToken: data.channelToken,
|
|
@@ -7,8 +7,9 @@ type UseSocialAuthProps = {
|
|
|
7
7
|
authMode: SocialAuthMode;
|
|
8
8
|
onSettled?: () => void;
|
|
9
9
|
onError?: () => void;
|
|
10
|
+
onFarcasterUrl?: (url: string) => void;
|
|
10
11
|
};
|
|
11
|
-
export declare const useSocialAuth: ({ sessionTimeout, authMode, onSettled, onError, }: UseSocialAuthProps) => {
|
|
12
|
+
export declare const useSocialAuth: ({ sessionTimeout, authMode, onSettled, onError, onFarcasterUrl, }: UseSocialAuthProps) => {
|
|
12
13
|
readonly checkValidProvider: (provider: ProviderEnum) => boolean;
|
|
13
14
|
readonly connectSocialAccount: ({ provider, validator, captchaToken, }: {
|
|
14
15
|
provider: ProviderEnum;
|
|
@@ -101,7 +101,7 @@ const socialProviders = [
|
|
|
101
101
|
const providersRequiringPkce = ['twitter', 'github'];
|
|
102
102
|
const providersWithoutWindowOpenerRefence = ['twitter'];
|
|
103
103
|
// Hook to handle common social auth logic (for social linking and social sign in)
|
|
104
|
-
const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
|
|
104
|
+
const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, onFarcasterUrl, }) => {
|
|
105
105
|
var _a;
|
|
106
106
|
const { environmentId, onboardingOnlyJwt, setOnboardingOnlyJwt, setCallback, setShowAuthFlow, projectSettings, consumeNonce, redirectUrl, } = useInternalDynamicContext();
|
|
107
107
|
const { handleVerifiedUserWithJWT } = useHandleVerifiedUser();
|
|
@@ -410,7 +410,7 @@ const useSocialAuth = ({ sessionTimeout, authMode, onSettled, onError, }) => {
|
|
|
410
410
|
}
|
|
411
411
|
else {
|
|
412
412
|
setShowAuthFlow(true);
|
|
413
|
-
|
|
413
|
+
onFarcasterUrl === null || onFarcasterUrl === void 0 ? void 0 : onFarcasterUrl(data.url);
|
|
414
414
|
}
|
|
415
415
|
const status = yield watchStatus({
|
|
416
416
|
channelToken: data.channelToken,
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
7
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
-
require('react');
|
|
9
|
-
require('
|
|
10
|
-
require('
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
9
|
+
var ErrorContext = require('../../context/ErrorContext/ErrorContext.cjs');
|
|
10
|
+
var FarcasterConnectView = require('../FarcasterConnectView/FarcasterConnectView.cjs');
|
|
11
|
+
var useSocialAuth = require('../../utils/hooks/useSocialAuth/useSocialAuth.cjs');
|
|
11
12
|
require('../../shared/logger.cjs');
|
|
12
13
|
require('@dynamic-labs/iconic');
|
|
13
14
|
require('@dynamic-labs/wallet-connector-core');
|
|
@@ -16,88 +17,29 @@ require('@dynamic-labs/wallet-book');
|
|
|
16
17
|
require('../../utils/constants/colors.cjs');
|
|
17
18
|
require('../../utils/constants/values.cjs');
|
|
18
19
|
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
20
|
+
var useEffectOnce = require('../../shared/utils/hooks/useEffectOnce/useEffectOnce.cjs');
|
|
19
21
|
require('@dynamic-labs/utils');
|
|
20
22
|
require('../../shared/consts/index.cjs');
|
|
21
|
-
require('../../events/dynamicEvents.cjs');
|
|
22
|
-
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
23
|
-
var ErrorContext = require('../../context/ErrorContext/ErrorContext.cjs');
|
|
24
|
-
require('@dynamic-labs/multi-wallet');
|
|
25
|
-
require('react-international-phone');
|
|
26
|
-
require('viem');
|
|
27
|
-
require('viem/chains');
|
|
28
|
-
require('../../config/ApiEndpoint.cjs');
|
|
29
|
-
require('../../locale/locale.cjs');
|
|
30
|
-
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
31
|
-
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
32
|
-
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
33
|
-
require('../../context/VerificationContext/VerificationContext.cjs');
|
|
34
|
-
require('react-dom');
|
|
35
|
-
require('../../context/WalletContext/WalletContext.cjs');
|
|
36
|
-
var usePromise = require('../../utils/hooks/usePromise/usePromise.cjs');
|
|
37
|
-
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
38
|
-
require('@dynamic-labs/types');
|
|
39
|
-
var farcaster = require('../../utils/hooks/useSocialAuth/farcaster.cjs');
|
|
40
|
-
require('yup');
|
|
41
|
-
require('../../context/MockContext/MockContext.cjs');
|
|
42
|
-
require('react-i18next');
|
|
43
|
-
require('../../context/FieldsStateContext/FieldsStateContext.cjs');
|
|
44
|
-
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
45
|
-
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
46
|
-
require('@dynamic-labs/rpc-providers');
|
|
47
|
-
require('../../components/Alert/Alert.cjs');
|
|
48
|
-
require('../../components/ShadowDOM/ShadowDOM.cjs');
|
|
49
|
-
require('../../components/IconButton/IconButton.cjs');
|
|
50
|
-
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
51
|
-
require('../../components/Input/Input.cjs');
|
|
52
|
-
require('../../components/IsBrowser/IsBrowser.cjs');
|
|
53
|
-
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
54
|
-
require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
55
|
-
require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
56
|
-
require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
57
|
-
require('../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.cjs');
|
|
58
|
-
require('../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
59
|
-
require('../../components/Popper/Popper/Popper.cjs');
|
|
60
|
-
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
61
|
-
require('react-focus-lock');
|
|
62
|
-
require('qrcode');
|
|
63
|
-
require('formik');
|
|
64
|
-
require('../WalletList/WalletList.cjs');
|
|
65
|
-
var FarcasterConnectView = require('../FarcasterConnectView/FarcasterConnectView.cjs');
|
|
66
|
-
require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
67
|
-
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
68
|
-
require('@hcaptcha/react-hcaptcha');
|
|
69
|
-
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
70
|
-
require('../../context/FooterAnimationContext/index.cjs');
|
|
71
|
-
require('../LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.cjs');
|
|
72
|
-
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
73
|
-
require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
74
|
-
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
75
|
-
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
76
|
-
require('../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
77
|
-
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
78
|
-
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
79
23
|
|
|
80
24
|
/**
|
|
81
25
|
* This view is used to display the QR code for the farcaster connection.
|
|
82
26
|
* It is only used in the login view when Farcaster is the only available login method.
|
|
83
27
|
*/
|
|
84
28
|
const FarcasterQrCodeView = () => {
|
|
85
|
-
var _a;
|
|
86
|
-
const { consumeNonce, redirectUrl } = useInternalDynamicContext.useInternalDynamicContext();
|
|
87
29
|
const { setError } = ErrorContext.useErrorContext();
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
30
|
+
const [url, setUrl] = React.useState(undefined);
|
|
31
|
+
const { connectSocialAccount } = useSocialAuth.useSocialAuth({
|
|
32
|
+
authMode: 'signin',
|
|
33
|
+
onError: () => setError('Something went wrong'),
|
|
34
|
+
onFarcasterUrl: (url) => setUrl(url),
|
|
35
|
+
sessionTimeout: 10000,
|
|
36
|
+
});
|
|
37
|
+
useEffectOnce.useEffectOnce(() => {
|
|
38
|
+
connectSocialAccount({
|
|
39
|
+
provider: sdkApiCore.ProviderEnum.Farcaster,
|
|
96
40
|
});
|
|
97
|
-
}), {
|
|
98
|
-
onReject: () => setError('Something went wrong'),
|
|
99
41
|
});
|
|
100
|
-
return jsxRuntime.jsx(FarcasterConnectView.FarcasterConnectView, { url:
|
|
42
|
+
return jsxRuntime.jsx(FarcasterConnectView.FarcasterConnectView, { url: url !== null && url !== void 0 ? url : '' });
|
|
101
43
|
};
|
|
102
44
|
|
|
103
45
|
exports.FarcasterQrCodeView = FarcasterQrCodeView;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
3
2
|
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
import 'react';
|
|
5
|
-
import '
|
|
6
|
-
import '
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { ProviderEnum } from '@dynamic-labs/sdk-api-core';
|
|
5
|
+
import { useErrorContext } from '../../context/ErrorContext/ErrorContext.js';
|
|
6
|
+
import { FarcasterConnectView } from '../FarcasterConnectView/FarcasterConnectView.js';
|
|
7
|
+
import { useSocialAuth } from '../../utils/hooks/useSocialAuth/useSocialAuth.js';
|
|
7
8
|
import '../../shared/logger.js';
|
|
8
9
|
import '@dynamic-labs/iconic';
|
|
9
10
|
import '@dynamic-labs/wallet-connector-core';
|
|
@@ -12,88 +13,29 @@ import '@dynamic-labs/wallet-book';
|
|
|
12
13
|
import '../../utils/constants/colors.js';
|
|
13
14
|
import '../../utils/constants/values.js';
|
|
14
15
|
import '../../shared/utils/classes/storage/localStorage.js';
|
|
16
|
+
import { useEffectOnce } from '../../shared/utils/hooks/useEffectOnce/useEffectOnce.js';
|
|
15
17
|
import '@dynamic-labs/utils';
|
|
16
18
|
import '../../shared/consts/index.js';
|
|
17
|
-
import '../../events/dynamicEvents.js';
|
|
18
|
-
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
19
|
-
import { useErrorContext } from '../../context/ErrorContext/ErrorContext.js';
|
|
20
|
-
import '@dynamic-labs/multi-wallet';
|
|
21
|
-
import 'react-international-phone';
|
|
22
|
-
import 'viem';
|
|
23
|
-
import 'viem/chains';
|
|
24
|
-
import '../../config/ApiEndpoint.js';
|
|
25
|
-
import '../../locale/locale.js';
|
|
26
|
-
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
27
|
-
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
28
|
-
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
29
|
-
import '../../context/VerificationContext/VerificationContext.js';
|
|
30
|
-
import 'react-dom';
|
|
31
|
-
import '../../context/WalletContext/WalletContext.js';
|
|
32
|
-
import { usePromise } from '../../utils/hooks/usePromise/usePromise.js';
|
|
33
|
-
import '../../context/ThemeContext/ThemeContext.js';
|
|
34
|
-
import '@dynamic-labs/types';
|
|
35
|
-
import { connect } from '../../utils/hooks/useSocialAuth/farcaster.js';
|
|
36
|
-
import 'yup';
|
|
37
|
-
import '../../context/MockContext/MockContext.js';
|
|
38
|
-
import 'react-i18next';
|
|
39
|
-
import '../../context/FieldsStateContext/FieldsStateContext.js';
|
|
40
|
-
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
41
|
-
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
42
|
-
import '@dynamic-labs/rpc-providers';
|
|
43
|
-
import '../../components/Alert/Alert.js';
|
|
44
|
-
import '../../components/ShadowDOM/ShadowDOM.js';
|
|
45
|
-
import '../../components/IconButton/IconButton.js';
|
|
46
|
-
import '../../components/InlineWidget/InlineWidget.js';
|
|
47
|
-
import '../../components/Input/Input.js';
|
|
48
|
-
import '../../components/IsBrowser/IsBrowser.js';
|
|
49
|
-
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
50
|
-
import '../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
51
|
-
import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
52
|
-
import '../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
53
|
-
import '../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.js';
|
|
54
|
-
import '../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
55
|
-
import '../../components/Popper/Popper/Popper.js';
|
|
56
|
-
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
57
|
-
import 'react-focus-lock';
|
|
58
|
-
import 'qrcode';
|
|
59
|
-
import 'formik';
|
|
60
|
-
import '../WalletList/WalletList.js';
|
|
61
|
-
import { FarcasterConnectView } from '../FarcasterConnectView/FarcasterConnectView.js';
|
|
62
|
-
import '../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
63
|
-
import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
64
|
-
import '@hcaptcha/react-hcaptcha';
|
|
65
|
-
import '../../context/LoadingContext/LoadingContext.js';
|
|
66
|
-
import '../../context/FooterAnimationContext/index.js';
|
|
67
|
-
import '../LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.js';
|
|
68
|
-
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
69
|
-
import '../../context/PasskeyContext/PasskeyContext.js';
|
|
70
|
-
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
71
|
-
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
72
|
-
import '../TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
73
|
-
import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
74
|
-
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
75
19
|
|
|
76
20
|
/**
|
|
77
21
|
* This view is used to display the QR code for the farcaster connection.
|
|
78
22
|
* It is only used in the login view when Farcaster is the only available login method.
|
|
79
23
|
*/
|
|
80
24
|
const FarcasterQrCodeView = () => {
|
|
81
|
-
var _a;
|
|
82
|
-
const { consumeNonce, redirectUrl } = useInternalDynamicContext();
|
|
83
25
|
const { setError } = useErrorContext();
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
26
|
+
const [url, setUrl] = useState(undefined);
|
|
27
|
+
const { connectSocialAccount } = useSocialAuth({
|
|
28
|
+
authMode: 'signin',
|
|
29
|
+
onError: () => setError('Something went wrong'),
|
|
30
|
+
onFarcasterUrl: (url) => setUrl(url),
|
|
31
|
+
sessionTimeout: 10000,
|
|
32
|
+
});
|
|
33
|
+
useEffectOnce(() => {
|
|
34
|
+
connectSocialAccount({
|
|
35
|
+
provider: ProviderEnum.Farcaster,
|
|
92
36
|
});
|
|
93
|
-
}), {
|
|
94
|
-
onReject: () => setError('Something went wrong'),
|
|
95
37
|
});
|
|
96
|
-
return jsx(FarcasterConnectView, { url:
|
|
38
|
+
return jsx(FarcasterConnectView, { url: url !== null && url !== void 0 ? url : '' });
|
|
97
39
|
};
|
|
98
40
|
|
|
99
41
|
export { FarcasterQrCodeView };
|