@dynamic-labs/sdk-react-core 4.0.0-alpha.10 → 4.0.0-alpha.12
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 +25 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +12 -12
- package/src/lib/Main.cjs +1 -1
- package/src/lib/Main.js +1 -1
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +6 -6
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +7 -7
- package/src/lib/components/TransactionCard/TransactionCard.cjs +77 -5
- package/src/lib/components/TransactionCard/TransactionCard.js +78 -6
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +1 -1
- package/src/lib/components/UserProfile/UserProfile.cjs +1 -1
- package/src/lib/components/UserProfile/UserProfile.js +1 -1
- package/src/lib/components/UserProfileForm/UserProfileForm.cjs +1 -1
- package/src/lib/components/UserProfileForm/UserProfileForm.js +1 -1
- package/src/lib/components/WalletConnectorEvents/WalletConnectorEvents.cjs +127 -0
- package/src/lib/components/WalletConnectorEvents/WalletConnectorEvents.d.ts +1 -0
- package/src/lib/components/WalletConnectorEvents/WalletConnectorEvents.js +123 -0
- package/src/lib/components/WalletConnectorEvents/index.d.ts +1 -0
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +14 -11
- package/src/lib/context/DynamicContext/DynamicContext.js +6 -3
- package/src/lib/context/DynamicContext/hooks/useRegisterStorageService/useRegisterStorageService.cjs +8 -4
- package/src/lib/context/DynamicContext/hooks/useRegisterStorageService/useRegisterStorageService.js +9 -5
- package/src/lib/context/MockContext/MockContext.cjs +1 -1
- package/src/lib/context/MockContext/MockContext.js +1 -1
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.cjs +1 -3
- package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.js +1 -3
- package/src/lib/data/api/oauth/oauth.cjs +19 -10
- package/src/lib/data/api/oauth/oauth.js +19 -10
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +1 -1
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +1 -1
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.cjs +1 -1
- package/src/lib/layout/DynamicAuthLayout/HelpContent/HelpHeader/HelpHeader.js +1 -1
- package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.cjs +1 -1
- package/src/lib/layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.js +1 -1
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.cjs +1 -1
- package/src/lib/layouts/BridgeWelcomeLayout/BridgeWelcomeLayout.js +1 -1
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.cjs +1 -1
- package/src/lib/layouts/ConnectedWalletsListLayout/ConnectedWalletsListLayout.js +1 -1
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.cjs +1 -1
- package/src/lib/modals/SendBalanceModal/SendBalanceModal.js +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +1 -1
- package/src/lib/store/internalImplementation/utils/syncLegacyStorage/syncLegacyStorage.cjs +1 -1
- package/src/lib/store/internalImplementation/utils/syncLegacyStorage/syncLegacyStorage.js +1 -1
- package/src/lib/utils/functions/getExpiresAt/getExpiresAt.d.ts +1 -1
- package/src/lib/utils/functions/networksAndChains/networksAndChains.cjs +15 -22
- package/src/lib/utils/functions/networksAndChains/networksAndChains.d.ts +2 -5
- package/src/lib/utils/functions/networksAndChains/networksAndChains.js +15 -20
- package/src/lib/utils/hooks/index.d.ts +1 -1
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +2 -2
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +2 -2
- package/src/lib/utils/hooks/useCreateWalletConnectorOptions/index.d.ts +1 -0
- package/src/lib/utils/hooks/{useWalletConnectorOptions/useWalletConnectorOptions.cjs → useCreateWalletConnectorOptions/useCreateWalletConnectorOptions.cjs} +2 -2
- package/src/lib/utils/hooks/{useWalletConnectorOptions/useWalletConnectorOptions.d.ts → useCreateWalletConnectorOptions/useCreateWalletConnectorOptions.d.ts} +1 -1
- package/src/lib/utils/hooks/{useWalletConnectorOptions/useWalletConnectorOptions.js → useCreateWalletConnectorOptions/useCreateWalletConnectorOptions.js} +2 -2
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.cjs +33 -30
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.js +33 -30
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.cjs +23 -11
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.js +23 -11
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +4 -7
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.d.ts +1 -4
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +4 -7
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +4 -4
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.d.ts +1 -2
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +4 -4
- package/src/lib/utils/hooks/useTelegramLogin/useTelegramLogin.cjs +1 -3
- package/src/lib/utils/hooks/useTelegramLogin/useTelegramLogin.js +1 -3
- package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.cjs +1 -1
- package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.js +1 -1
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +1 -1
- package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +1 -1
- package/src/lib/views/CreatePasswordView/CreatePasswordStep/CreatePasswordStep.cjs +1 -1
- package/src/lib/views/CreatePasswordView/CreatePasswordStep/CreatePasswordStep.js +1 -1
- package/src/lib/views/CreatePasswordView/SavePasswordStep/SavePasswordStep.cjs +1 -1
- package/src/lib/views/CreatePasswordView/SavePasswordStep/SavePasswordStep.js +1 -1
- package/src/lib/views/EmailVerification/EmailVerification.cjs +3 -1
- package/src/lib/views/EmailVerification/EmailVerification.js +3 -1
- package/src/lib/views/EnterPasswordView/EnterPasswordView.cjs +1 -1
- package/src/lib/views/EnterPasswordView/EnterPasswordView.js +1 -1
- package/src/lib/views/FarcasterQrCodeView/FarcasterQrCodeView.cjs +0 -1
- package/src/lib/views/FarcasterQrCodeView/FarcasterQrCodeView.js +0 -1
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.cjs +0 -1
- package/src/lib/views/LoginView/sections/SocialSignInSection/DynamicSocialSignIn/DynamicSocialSignIn.js +0 -1
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSimpleSignIn/WalletSimpleSignIn.cjs +2 -1
- package/src/lib/views/LoginView/sections/WalletSignInSection/WalletSimpleSignIn/WalletSimpleSignIn.js +2 -1
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.cjs +1 -1
- package/src/lib/views/MfaChooseDeviceView/MfaChooseDeviceView.js +1 -1
- package/src/lib/views/Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.js +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +1 -1
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +1 -1
- package/src/lib/views/Passkey/RenamePasskeyView/RenamePasskeyView.cjs +1 -1
- package/src/lib/views/Passkey/RenamePasskeyView/RenamePasskeyView.js +1 -1
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +2 -3
- package/src/lib/views/SendBalanceView/SendBalanceView.js +3 -4
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +7 -4
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +7 -4
- package/src/lib/views/UserFieldEditorView/UserFieldEditorView.cjs +1 -1
- package/src/lib/views/UserFieldEditorView/UserFieldEditorView.js +1 -1
- package/src/lib/views/WalletList/WalletList.cjs +2 -2
- package/src/lib/views/WalletList/WalletList.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWalletCardBody/DynamicBridgeWalletCardBody.js +1 -1
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.cjs +1 -1
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveBitcoinWalletAddresses/ActiveBitcoinWalletAddresses.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/UnknownWalletInformation/UnknownWalletInformation.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/UnknownWalletInformation/UnknownWalletInformation.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/EditProfileView/EditProfileView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.js +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +1 -1
- package/src/lib/utils/hooks/useWalletConnectorOptions/index.d.ts +0 -1
- /package/src/lib/utils/hooks/{useWalletConnectorOptions → useCreateWalletConnectorOptions}/utils/errors/ConnectorSetupError.cjs +0 -0
- /package/src/lib/utils/hooks/{useWalletConnectorOptions → useCreateWalletConnectorOptions}/utils/errors/ConnectorSetupError.d.ts +0 -0
- /package/src/lib/utils/hooks/{useWalletConnectorOptions → useCreateWalletConnectorOptions}/utils/errors/ConnectorSetupError.js +0 -0
- /package/src/lib/utils/hooks/{useWalletConnectorOptions → useCreateWalletConnectorOptions}/utils/errors/index.d.ts +0 -0
- /package/src/lib/utils/hooks/{useWalletConnectorOptions → useCreateWalletConnectorOptions}/utils/index.d.ts +0 -0
- /package/src/lib/utils/hooks/{useWalletConnectorOptions → useCreateWalletConnectorOptions}/utils/verifyMagicIsSetup/index.d.ts +0 -0
- /package/src/lib/utils/hooks/{useWalletConnectorOptions → useCreateWalletConnectorOptions}/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs +0 -0
- /package/src/lib/utils/hooks/{useWalletConnectorOptions → useCreateWalletConnectorOptions}/utils/verifyMagicIsSetup/verifyMagicIsSetup.d.ts +0 -0
- /package/src/lib/utils/hooks/{useWalletConnectorOptions → useCreateWalletConnectorOptions}/utils/verifyMagicIsSetup/verifyMagicIsSetup.js +0 -0
- /package/src/lib/utils/hooks/{useWalletConnectorOptions → useCreateWalletConnectorOptions}/utils/verifyRequiredConnectorsAreSetup/index.d.ts +0 -0
- /package/src/lib/utils/hooks/{useWalletConnectorOptions → useCreateWalletConnectorOptions}/utils/verifyRequiredConnectorsAreSetup/verifyRequiredConnectorsAreSetup.cjs +0 -0
- /package/src/lib/utils/hooks/{useWalletConnectorOptions → useCreateWalletConnectorOptions}/utils/verifyRequiredConnectorsAreSetup/verifyRequiredConnectorsAreSetup.d.ts +0 -0
- /package/src/lib/utils/hooks/{useWalletConnectorOptions → useCreateWalletConnectorOptions}/utils/verifyRequiredConnectorsAreSetup/verifyRequiredConnectorsAreSetup.js +0 -0
- /package/src/lib/utils/hooks/{useWalletConnectorOptions → useCreateWalletConnectorOptions}/utils/verifyZeroDevIsSetup/index.d.ts +0 -0
- /package/src/lib/utils/hooks/{useWalletConnectorOptions → useCreateWalletConnectorOptions}/utils/verifyZeroDevIsSetup/verifyZeroDevIsSetup.cjs +0 -0
- /package/src/lib/utils/hooks/{useWalletConnectorOptions → useCreateWalletConnectorOptions}/utils/verifyZeroDevIsSetup/verifyZeroDevIsSetup.d.ts +0 -0
- /package/src/lib/utils/hooks/{useWalletConnectorOptions → useCreateWalletConnectorOptions}/utils/verifyZeroDevIsSetup/verifyZeroDevIsSetup.js +0 -0
|
@@ -85,15 +85,12 @@ import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
85
85
|
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
86
86
|
|
|
87
87
|
// Hook exposed to customers and used internally to handle social account linking
|
|
88
|
-
const useSocialAccounts = (
|
|
89
|
-
sessionTimeout: 20000,
|
|
90
|
-
}) => {
|
|
88
|
+
const useSocialAccounts = () => {
|
|
91
89
|
var _a;
|
|
92
90
|
const { environmentId, user, projectSettings } = useInternalDynamicContext();
|
|
93
91
|
const { setView } = useViewContext();
|
|
94
92
|
const { handleError, setError, setIsProcessing, checkValidProvider, error, isProcessing, connectSocialAccount, } = useSocialAuth({
|
|
95
93
|
onFarcasterUrl: (url) => setView('farcaster-connect-view', { url }),
|
|
96
|
-
sessionTimeout,
|
|
97
94
|
});
|
|
98
95
|
const verifiedOAuthCredentialsMap = useMemo(() => {
|
|
99
96
|
var _a, _b;
|
|
@@ -133,7 +130,7 @@ const useSocialAccounts = ({ sessionTimeout } = {
|
|
|
133
130
|
});
|
|
134
131
|
}), [checkValidOAuthLinking, connectSocialAccount]);
|
|
135
132
|
const unlinkSocialAccount = useCallback((provider) => __awaiter(void 0, void 0, void 0, function* () {
|
|
136
|
-
var _b;
|
|
133
|
+
var _b, _c;
|
|
137
134
|
setError(undefined);
|
|
138
135
|
setIsProcessing(true);
|
|
139
136
|
if (!checkValidProvider(provider, 'unlink')) {
|
|
@@ -145,11 +142,11 @@ const useSocialAccounts = ({ sessionTimeout } = {
|
|
|
145
142
|
return;
|
|
146
143
|
}
|
|
147
144
|
try {
|
|
148
|
-
const primaryWalletId = StorageService.getItem(PRIMARY_WALLET_ID);
|
|
145
|
+
const primaryWalletId = (_b = StorageService.getItem(PRIMARY_WALLET_ID)) !== null && _b !== void 0 ? _b : undefined;
|
|
149
146
|
const response = yield unlinkOAuth({
|
|
150
147
|
environmentId,
|
|
151
148
|
primaryWalletId,
|
|
152
|
-
verifiedCrentialId: (
|
|
149
|
+
verifiedCrentialId: (_c = verifiedCredential.id) !== null && _c !== void 0 ? _c : '',
|
|
153
150
|
});
|
|
154
151
|
if (!response) {
|
|
155
152
|
handleError(provider, SocialOAuthErrorCode.UNLINK_ERROR, `Failed to unlink social account: ${provider} | ${verifiedCredential.id}`, { raiseAuthFailure: false });
|
|
@@ -109,7 +109,7 @@ const socialProviders = [
|
|
|
109
109
|
// so we should only add provider that support pkce to this list
|
|
110
110
|
const providersRequiringPkce = ['twitter', 'github'];
|
|
111
111
|
// Hook to handle common social auth logic (for social linking and social sign in)
|
|
112
|
-
const useSocialAuth = ({
|
|
112
|
+
const useSocialAuth = ({ onSettled, onError, onFarcasterUrl, }) => {
|
|
113
113
|
const { environmentId, setShowAuthFlow, socialSettings, projectSettings, consumeNonce, redirectUrl: defaultRedirectUrl, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
114
114
|
/**
|
|
115
115
|
* Represents if the SDK will use a popup or redirect for social auth
|
|
@@ -397,7 +397,6 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
397
397
|
onSettled,
|
|
398
398
|
provider,
|
|
399
399
|
redirectUrl: redirectUrl !== null && redirectUrl !== void 0 ? redirectUrl : defaultRedirectUrl,
|
|
400
|
-
sessionTimeout,
|
|
401
400
|
setIsProcessing,
|
|
402
401
|
state,
|
|
403
402
|
strategy,
|
|
@@ -411,6 +410,7 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
411
410
|
telegramAuthToken,
|
|
412
411
|
verifier,
|
|
413
412
|
});
|
|
413
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
414
414
|
}
|
|
415
415
|
catch (error) {
|
|
416
416
|
if (utils.Oauth2Service.isGetOauthCodeError(error)) {
|
|
@@ -419,7 +419,8 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
419
419
|
});
|
|
420
420
|
return;
|
|
421
421
|
}
|
|
422
|
-
|
|
422
|
+
// Log message individually so the Expo console can display it (it fails to display objects)
|
|
423
|
+
logger.logger.error('Social connection failed with unexpected error:', error.message, error);
|
|
423
424
|
onFailed(provider, { error }, { raiseAuthFailure: authMode === 'signin' });
|
|
424
425
|
}
|
|
425
426
|
}), [
|
|
@@ -433,7 +434,6 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
433
434
|
onFailed,
|
|
434
435
|
onSettled,
|
|
435
436
|
projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers,
|
|
436
|
-
sessionTimeout,
|
|
437
437
|
strategy,
|
|
438
438
|
]);
|
|
439
439
|
return React.useMemo(() => ({
|
|
@@ -3,7 +3,6 @@ import { ProviderEnum } from '@dynamic-labs/sdk-api-core';
|
|
|
3
3
|
import { SocialOAuthError, SocialOAuthErrorCode } from '@dynamic-labs/types';
|
|
4
4
|
export type SocialAuthMode = 'link' | 'signin' | 'unlink';
|
|
5
5
|
type UseSocialAuthProps = {
|
|
6
|
-
sessionTimeout: number;
|
|
7
6
|
onSettled?: () => void;
|
|
8
7
|
onError?: () => void;
|
|
9
8
|
onFarcasterUrl?: (url: string) => void;
|
|
@@ -16,7 +15,7 @@ export type ConnectSocialAccountProps = {
|
|
|
16
15
|
redirectUrl?: string;
|
|
17
16
|
telegramAuthToken?: string;
|
|
18
17
|
};
|
|
19
|
-
export declare const useSocialAuth: ({
|
|
18
|
+
export declare const useSocialAuth: ({ onSettled, onError, onFarcasterUrl, }: UseSocialAuthProps) => {
|
|
20
19
|
readonly checkValidProvider: (provider: ProviderEnum, authMode: SocialAuthMode) => boolean;
|
|
21
20
|
readonly completeConnection: ({ authMode, provider, state, authCode, captchaToken, verifier, telegramAuthToken, forceCreateUser, }: {
|
|
22
21
|
authMode: SocialAuthMode;
|
|
@@ -105,7 +105,7 @@ const socialProviders = [
|
|
|
105
105
|
// so we should only add provider that support pkce to this list
|
|
106
106
|
const providersRequiringPkce = ['twitter', 'github'];
|
|
107
107
|
// Hook to handle common social auth logic (for social linking and social sign in)
|
|
108
|
-
const useSocialAuth = ({
|
|
108
|
+
const useSocialAuth = ({ onSettled, onError, onFarcasterUrl, }) => {
|
|
109
109
|
const { environmentId, setShowAuthFlow, socialSettings, projectSettings, consumeNonce, redirectUrl: defaultRedirectUrl, } = useInternalDynamicContext();
|
|
110
110
|
/**
|
|
111
111
|
* Represents if the SDK will use a popup or redirect for social auth
|
|
@@ -393,7 +393,6 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
393
393
|
onSettled,
|
|
394
394
|
provider,
|
|
395
395
|
redirectUrl: redirectUrl !== null && redirectUrl !== void 0 ? redirectUrl : defaultRedirectUrl,
|
|
396
|
-
sessionTimeout,
|
|
397
396
|
setIsProcessing,
|
|
398
397
|
state,
|
|
399
398
|
strategy,
|
|
@@ -407,6 +406,7 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
407
406
|
telegramAuthToken,
|
|
408
407
|
verifier,
|
|
409
408
|
});
|
|
409
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
410
410
|
}
|
|
411
411
|
catch (error) {
|
|
412
412
|
if (Oauth2Service.isGetOauthCodeError(error)) {
|
|
@@ -415,7 +415,8 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
415
415
|
});
|
|
416
416
|
return;
|
|
417
417
|
}
|
|
418
|
-
|
|
418
|
+
// Log message individually so the Expo console can display it (it fails to display objects)
|
|
419
|
+
logger.error('Social connection failed with unexpected error:', error.message, error);
|
|
419
420
|
onFailed(provider, { error }, { raiseAuthFailure: authMode === 'signin' });
|
|
420
421
|
}
|
|
421
422
|
}), [
|
|
@@ -429,7 +430,6 @@ const useSocialAuth = ({ sessionTimeout, onSettled, onError, onFarcasterUrl, })
|
|
|
429
430
|
onFailed,
|
|
430
431
|
onSettled,
|
|
431
432
|
projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers,
|
|
432
|
-
sessionTimeout,
|
|
433
433
|
strategy,
|
|
434
434
|
]);
|
|
435
435
|
return useMemo(() => ({
|
|
@@ -88,9 +88,7 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useDyna
|
|
|
88
88
|
const useTelegramLogin = () => {
|
|
89
89
|
const { sdkHasLoaded, user, projectSettings, environmentId } = useInternalDynamicContext.useInternalDynamicContext();
|
|
90
90
|
const providers = (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) || [];
|
|
91
|
-
const { completeConnection } = useSocialAuth.useSocialAuth({
|
|
92
|
-
sessionTimeout: 20000,
|
|
93
|
-
});
|
|
91
|
+
const { completeConnection } = useSocialAuth.useSocialAuth({});
|
|
94
92
|
const getTelegramAuthToken = () => {
|
|
95
93
|
var _a, _b;
|
|
96
94
|
const telegramAuthToken = (_b = (_a = getInitialUrl.getInitialUrl()) === null || _a === void 0 ? void 0 : _a.searchParams.get('telegramAuthToken')) !== null && _b !== void 0 ? _b : undefined;
|
|
@@ -84,9 +84,7 @@ import { useInternalDynamicContext } from '../../../context/DynamicContext/useDy
|
|
|
84
84
|
const useTelegramLogin = () => {
|
|
85
85
|
const { sdkHasLoaded, user, projectSettings, environmentId } = useInternalDynamicContext();
|
|
86
86
|
const providers = (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.providers) || [];
|
|
87
|
-
const { completeConnection } = useSocialAuth({
|
|
88
|
-
sessionTimeout: 20000,
|
|
89
|
-
});
|
|
87
|
+
const { completeConnection } = useSocialAuth({});
|
|
90
88
|
const getTelegramAuthToken = () => {
|
|
91
89
|
var _a, _b;
|
|
92
90
|
const telegramAuthToken = (_b = (_a = getInitialUrl()) === null || _a === void 0 ? void 0 : _a.searchParams.get('telegramAuthToken')) !== null && _b !== void 0 ? _b : undefined;
|
|
@@ -70,8 +70,8 @@ var IconButton = require('../../components/IconButton/IconButton.cjs');
|
|
|
70
70
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
71
71
|
var TypographyButton = require('../../components/TypographyButton/TypographyButton.cjs');
|
|
72
72
|
require('formik');
|
|
73
|
-
require('../../store/state/sendBalances.cjs');
|
|
74
73
|
var ModalHeader = require('../../components/ModalHeader/ModalHeader.cjs');
|
|
74
|
+
require('../../store/state/sendBalances.cjs');
|
|
75
75
|
require('../../components/Input/Input.cjs');
|
|
76
76
|
require('../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
77
77
|
require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
@@ -66,8 +66,8 @@ import { IconButton } from '../../components/IconButton/IconButton.js';
|
|
|
66
66
|
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
67
67
|
import { TypographyButton } from '../../components/TypographyButton/TypographyButton.js';
|
|
68
68
|
import 'formik';
|
|
69
|
-
import '../../store/state/sendBalances.js';
|
|
70
69
|
import { ModalHeader } from '../../components/ModalHeader/ModalHeader.js';
|
|
70
|
+
import '../../store/state/sendBalances.js';
|
|
71
71
|
import '../../components/Input/Input.js';
|
|
72
72
|
import '../TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
73
73
|
import '../../context/PasskeyContext/PasskeyContext.js';
|
|
@@ -68,8 +68,8 @@ require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
|
68
68
|
require('../useFields.cjs');
|
|
69
69
|
var TypographyButton = require('../../../components/TypographyButton/TypographyButton.cjs');
|
|
70
70
|
var UserDataFields = require('../UserDataFields/UserDataFields.cjs');
|
|
71
|
-
require('../../../store/state/sendBalances.cjs');
|
|
72
71
|
require('yup');
|
|
72
|
+
require('../../../store/state/sendBalances.cjs');
|
|
73
73
|
require('../../../components/Input/Input.cjs');
|
|
74
74
|
require('../../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
75
75
|
require('../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
@@ -64,8 +64,8 @@ import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
|
64
64
|
import '../useFields.js';
|
|
65
65
|
import { TypographyButton } from '../../../components/TypographyButton/TypographyButton.js';
|
|
66
66
|
import { UserDataFields } from '../UserDataFields/UserDataFields.js';
|
|
67
|
-
import '../../../store/state/sendBalances.js';
|
|
68
67
|
import 'yup';
|
|
68
|
+
import '../../../store/state/sendBalances.js';
|
|
69
69
|
import '../../../components/Input/Input.js';
|
|
70
70
|
import '../../TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
71
71
|
import '../../../context/PasskeyContext/PasskeyContext.js';
|
|
@@ -72,8 +72,8 @@ require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
|
72
72
|
var ErrorContainer = require('../../../components/ErrorContainer/ErrorContainer.cjs');
|
|
73
73
|
var TypographyButton = require('../../../components/TypographyButton/TypographyButton.cjs');
|
|
74
74
|
require('formik');
|
|
75
|
-
require('../../../store/state/sendBalances.cjs');
|
|
76
75
|
var ModalHeader = require('../../../components/ModalHeader/ModalHeader.cjs');
|
|
76
|
+
require('../../../store/state/sendBalances.cjs');
|
|
77
77
|
var Input = require('../../../components/Input/Input.cjs');
|
|
78
78
|
require('../../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
79
79
|
require('../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
@@ -68,8 +68,8 @@ import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
|
68
68
|
import { ErrorContainer } from '../../../components/ErrorContainer/ErrorContainer.js';
|
|
69
69
|
import { TypographyButton } from '../../../components/TypographyButton/TypographyButton.js';
|
|
70
70
|
import 'formik';
|
|
71
|
-
import '../../../store/state/sendBalances.js';
|
|
72
71
|
import { ModalHeader } from '../../../components/ModalHeader/ModalHeader.js';
|
|
72
|
+
import '../../../store/state/sendBalances.js';
|
|
73
73
|
import { Input } from '../../../components/Input/Input.js';
|
|
74
74
|
import '../../TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
75
75
|
import '../../../context/PasskeyContext/PasskeyContext.js';
|
|
@@ -73,8 +73,8 @@ require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
|
73
73
|
var ErrorContainer = require('../../../components/ErrorContainer/ErrorContainer.cjs');
|
|
74
74
|
var TypographyButton = require('../../../components/TypographyButton/TypographyButton.cjs');
|
|
75
75
|
require('formik');
|
|
76
|
-
require('../../../store/state/sendBalances.cjs');
|
|
77
76
|
var ModalHeader = require('../../../components/ModalHeader/ModalHeader.cjs');
|
|
77
|
+
require('../../../store/state/sendBalances.cjs');
|
|
78
78
|
var Input = require('../../../components/Input/Input.cjs');
|
|
79
79
|
require('../../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
80
80
|
require('../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
@@ -69,8 +69,8 @@ import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
|
69
69
|
import { ErrorContainer } from '../../../components/ErrorContainer/ErrorContainer.js';
|
|
70
70
|
import { TypographyButton } from '../../../components/TypographyButton/TypographyButton.js';
|
|
71
71
|
import 'formik';
|
|
72
|
-
import '../../../store/state/sendBalances.js';
|
|
73
72
|
import { ModalHeader } from '../../../components/ModalHeader/ModalHeader.js';
|
|
73
|
+
import '../../../store/state/sendBalances.js';
|
|
74
74
|
import { Input } from '../../../components/Input/Input.js';
|
|
75
75
|
import '../../TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
76
76
|
import '../../../context/PasskeyContext/PasskeyContext.js';
|
|
@@ -45,6 +45,7 @@ require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
|
45
45
|
require('../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
46
46
|
var useOtpVerificationRequest = require('../../utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.cjs');
|
|
47
47
|
require('react-dom');
|
|
48
|
+
var findPrimaryEmbeddedChain = require('../Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs');
|
|
48
49
|
require('../../context/WalletContext/WalletContext.cjs');
|
|
49
50
|
var useIsTurnkeyWallet = require('../../utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs');
|
|
50
51
|
var usePasskeyRecovery = require('../../utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs');
|
|
@@ -185,11 +186,12 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
185
186
|
(!((_j = (_h = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _h === void 0 ? void 0 : _h.embeddedWallets) === null || _j === void 0 ? void 0 : _j.forceAuthenticatorAtSignup) ||
|
|
186
187
|
isSessionKeyCompatible));
|
|
187
188
|
if (isUsingPregeneratedWallets) {
|
|
189
|
+
const primaryChain = findPrimaryEmbeddedChain.findPrimaryEmbeddedChain(projectSettings);
|
|
188
190
|
// Pregenerated wallet was created during an
|
|
189
191
|
// additional email validation step as part of onboarding
|
|
190
192
|
// cannot rely on newUser JWT field here due to session being counted twice
|
|
191
193
|
// when authentication happens followed by a separate email kyc step
|
|
192
|
-
const embeddedWalletVerifiedCredential = findEmbeddedWalletFromVerifiedCredentials.findEmbeddedWalletFromVerifiedCredentials(createUserProfile.createUserProfileFromSdkUser(updateUserProfileResponse.user));
|
|
194
|
+
const embeddedWalletVerifiedCredential = findEmbeddedWalletFromVerifiedCredentials.findEmbeddedWalletFromVerifiedCredentials(createUserProfile.createUserProfileFromSdkUser(updateUserProfileResponse.user), [primaryChain]);
|
|
193
195
|
if (!embeddedWalletVerifiedCredential) {
|
|
194
196
|
throw new Error('Could not find an embedded wallet');
|
|
195
197
|
}
|
|
@@ -41,6 +41,7 @@ import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
|
41
41
|
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
42
42
|
import { useOtpVerificationRequest } from '../../utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.js';
|
|
43
43
|
import 'react-dom';
|
|
44
|
+
import { findPrimaryEmbeddedChain } from '../Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js';
|
|
44
45
|
import '../../context/WalletContext/WalletContext.js';
|
|
45
46
|
import { useIsTurnkeyWallet } from '../../utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js';
|
|
46
47
|
import { usePasskeyRecovery } from '../../utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js';
|
|
@@ -181,11 +182,12 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
|
|
|
181
182
|
(!((_j = (_h = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _h === void 0 ? void 0 : _h.embeddedWallets) === null || _j === void 0 ? void 0 : _j.forceAuthenticatorAtSignup) ||
|
|
182
183
|
isSessionKeyCompatible));
|
|
183
184
|
if (isUsingPregeneratedWallets) {
|
|
185
|
+
const primaryChain = findPrimaryEmbeddedChain(projectSettings);
|
|
184
186
|
// Pregenerated wallet was created during an
|
|
185
187
|
// additional email validation step as part of onboarding
|
|
186
188
|
// cannot rely on newUser JWT field here due to session being counted twice
|
|
187
189
|
// when authentication happens followed by a separate email kyc step
|
|
188
|
-
const embeddedWalletVerifiedCredential = findEmbeddedWalletFromVerifiedCredentials(createUserProfileFromSdkUser(updateUserProfileResponse.user));
|
|
190
|
+
const embeddedWalletVerifiedCredential = findEmbeddedWalletFromVerifiedCredentials(createUserProfileFromSdkUser(updateUserProfileResponse.user), [primaryChain]);
|
|
189
191
|
if (!embeddedWalletVerifiedCredential) {
|
|
190
192
|
throw new Error('Could not find an embedded wallet');
|
|
191
193
|
}
|
|
@@ -70,8 +70,8 @@ require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
|
70
70
|
var ErrorContainer = require('../../components/ErrorContainer/ErrorContainer.cjs');
|
|
71
71
|
var TypographyButton = require('../../components/TypographyButton/TypographyButton.cjs');
|
|
72
72
|
require('formik');
|
|
73
|
-
require('../../store/state/sendBalances.cjs');
|
|
74
73
|
var ModalHeader = require('../../components/ModalHeader/ModalHeader.cjs');
|
|
74
|
+
require('../../store/state/sendBalances.cjs');
|
|
75
75
|
var Input = require('../../components/Input/Input.cjs');
|
|
76
76
|
require('../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
77
77
|
require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
@@ -66,8 +66,8 @@ import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
|
66
66
|
import { ErrorContainer } from '../../components/ErrorContainer/ErrorContainer.js';
|
|
67
67
|
import { TypographyButton } from '../../components/TypographyButton/TypographyButton.js';
|
|
68
68
|
import 'formik';
|
|
69
|
-
import '../../store/state/sendBalances.js';
|
|
70
69
|
import { ModalHeader } from '../../components/ModalHeader/ModalHeader.js';
|
|
70
|
+
import '../../store/state/sendBalances.js';
|
|
71
71
|
import { Input } from '../../components/Input/Input.js';
|
|
72
72
|
import '../TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
73
73
|
import '../../context/PasskeyContext/PasskeyContext.js';
|
|
@@ -31,7 +31,6 @@ const FarcasterQrCodeView = () => {
|
|
|
31
31
|
const { connectSocialAccount } = useSocialAuth.useSocialAuth({
|
|
32
32
|
onError: () => setError('Something went wrong'),
|
|
33
33
|
onFarcasterUrl: (url) => setUrl(url),
|
|
34
|
-
sessionTimeout: 20000,
|
|
35
34
|
});
|
|
36
35
|
useEffectOnce.useEffectOnce(() => {
|
|
37
36
|
connectSocialAccount({
|
|
@@ -27,7 +27,6 @@ const FarcasterQrCodeView = () => {
|
|
|
27
27
|
const { connectSocialAccount } = useSocialAuth({
|
|
28
28
|
onError: () => setError('Something went wrong'),
|
|
29
29
|
onFarcasterUrl: (url) => setUrl(url),
|
|
30
|
-
sessionTimeout: 20000,
|
|
31
30
|
});
|
|
32
31
|
useEffectOnce(() => {
|
|
33
32
|
connectSocialAccount({
|
|
@@ -88,6 +88,7 @@ require('../../../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs')
|
|
|
88
88
|
var useInternalDynamicContext = require('../../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
89
89
|
|
|
90
90
|
const WalletSimpleSignIn = ({ previewWalletsNumber, disabled = false, onshowAllWallets, }) => {
|
|
91
|
+
var _a;
|
|
91
92
|
const { t } = reactI18next.useTranslation();
|
|
92
93
|
const { walletConnectorOptions, projectSettings, walletsFilter, authMode, multiWallet, recommendedWallets, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
93
94
|
const userWallets = UserWalletsContext.useUserWallets();
|
|
@@ -97,7 +98,7 @@ const WalletSimpleSignIn = ({ previewWalletsNumber, disabled = false, onshowAllW
|
|
|
97
98
|
groupWallets: true,
|
|
98
99
|
inputList: walletConnectorOptions,
|
|
99
100
|
isWalletConnectList: false,
|
|
100
|
-
lastUsedWalletKey: utils.StorageService.getItem(localStorage.LAST_USED_WALLET),
|
|
101
|
+
lastUsedWalletKey: (_a = utils.StorageService.getItem(localStorage.LAST_USED_WALLET)) !== null && _a !== void 0 ? _a : undefined,
|
|
101
102
|
loginWithEmail: true,
|
|
102
103
|
multiWallet,
|
|
103
104
|
numberOfWalletsToShow: previewWalletsNumber,
|
|
@@ -84,6 +84,7 @@ import '../../../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
84
84
|
import { useInternalDynamicContext } from '../../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
85
85
|
|
|
86
86
|
const WalletSimpleSignIn = ({ previewWalletsNumber, disabled = false, onshowAllWallets, }) => {
|
|
87
|
+
var _a;
|
|
87
88
|
const { t } = useTranslation();
|
|
88
89
|
const { walletConnectorOptions, projectSettings, walletsFilter, authMode, multiWallet, recommendedWallets, } = useInternalDynamicContext();
|
|
89
90
|
const userWallets = useUserWallets();
|
|
@@ -93,7 +94,7 @@ const WalletSimpleSignIn = ({ previewWalletsNumber, disabled = false, onshowAllW
|
|
|
93
94
|
groupWallets: true,
|
|
94
95
|
inputList: walletConnectorOptions,
|
|
95
96
|
isWalletConnectList: false,
|
|
96
|
-
lastUsedWalletKey: StorageService.getItem(LAST_USED_WALLET),
|
|
97
|
+
lastUsedWalletKey: (_a = StorageService.getItem(LAST_USED_WALLET)) !== null && _a !== void 0 ? _a : undefined,
|
|
97
98
|
loginWithEmail: true,
|
|
98
99
|
multiWallet,
|
|
99
100
|
numberOfWalletsToShow: previewWalletsNumber,
|
|
@@ -68,8 +68,8 @@ require('../../components/IconButton/IconButton.cjs');
|
|
|
68
68
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
69
69
|
var Button = require('../../components/Button/Button.cjs');
|
|
70
70
|
require('formik');
|
|
71
|
-
require('../../store/state/sendBalances.cjs');
|
|
72
71
|
var ModalHeader = require('../../components/ModalHeader/ModalHeader.cjs');
|
|
72
|
+
require('../../store/state/sendBalances.cjs');
|
|
73
73
|
require('../../components/Input/Input.cjs');
|
|
74
74
|
require('../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
75
75
|
require('../../context/PasskeyContext/PasskeyContext.cjs');
|
|
@@ -64,8 +64,8 @@ import '../../components/IconButton/IconButton.js';
|
|
|
64
64
|
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
65
65
|
import { Button } from '../../components/Button/Button.js';
|
|
66
66
|
import 'formik';
|
|
67
|
-
import '../../store/state/sendBalances.js';
|
|
68
67
|
import { ModalHeader } from '../../components/ModalHeader/ModalHeader.js';
|
|
68
|
+
import '../../store/state/sendBalances.js';
|
|
69
69
|
import '../../components/Input/Input.js';
|
|
70
70
|
import '../TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
71
71
|
import '../../context/PasskeyContext/PasskeyContext.js';
|
|
@@ -67,8 +67,8 @@ require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
|
67
67
|
require('../../../components/IconButton/IconButton.cjs');
|
|
68
68
|
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
69
69
|
require('formik');
|
|
70
|
-
require('../../../store/state/sendBalances.cjs');
|
|
71
70
|
var ModalHeader = require('../../../components/ModalHeader/ModalHeader.cjs');
|
|
71
|
+
require('../../../store/state/sendBalances.cjs');
|
|
72
72
|
require('../../../components/Input/Input.cjs');
|
|
73
73
|
require('../../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
74
74
|
require('../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
@@ -63,8 +63,8 @@ import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
|
63
63
|
import '../../../components/IconButton/IconButton.js';
|
|
64
64
|
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
65
65
|
import 'formik';
|
|
66
|
-
import '../../../store/state/sendBalances.js';
|
|
67
66
|
import { ModalHeader } from '../../../components/ModalHeader/ModalHeader.js';
|
|
67
|
+
import '../../../store/state/sendBalances.js';
|
|
68
68
|
import '../../../components/Input/Input.js';
|
|
69
69
|
import '../../TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
70
70
|
import '../../../context/PasskeyContext/PasskeyContext.js';
|
|
@@ -75,8 +75,8 @@ require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
|
75
75
|
var ErrorContainer = require('../../../../components/ErrorContainer/ErrorContainer.cjs');
|
|
76
76
|
var TypographyButton = require('../../../../components/TypographyButton/TypographyButton.cjs');
|
|
77
77
|
require('formik');
|
|
78
|
-
require('../../../../store/state/sendBalances.cjs');
|
|
79
78
|
var ModalHeader = require('../../../../components/ModalHeader/ModalHeader.cjs');
|
|
79
|
+
require('../../../../store/state/sendBalances.cjs');
|
|
80
80
|
require('../../../../components/Input/Input.cjs');
|
|
81
81
|
require('../../../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
82
82
|
require('../../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
@@ -71,8 +71,8 @@ import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
|
71
71
|
import { ErrorContainer } from '../../../../components/ErrorContainer/ErrorContainer.js';
|
|
72
72
|
import { TypographyButton } from '../../../../components/TypographyButton/TypographyButton.js';
|
|
73
73
|
import 'formik';
|
|
74
|
-
import '../../../../store/state/sendBalances.js';
|
|
75
74
|
import { ModalHeader } from '../../../../components/ModalHeader/ModalHeader.js';
|
|
75
|
+
import '../../../../store/state/sendBalances.js';
|
|
76
76
|
import '../../../../components/Input/Input.js';
|
|
77
77
|
import '../../../TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
78
78
|
import '../../../../context/PasskeyContext/PasskeyContext.js';
|
|
@@ -69,8 +69,8 @@ require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
|
69
69
|
var IconButton = require('../../../components/IconButton/IconButton.cjs');
|
|
70
70
|
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
71
71
|
var TypographyButton = require('../../../components/TypographyButton/TypographyButton.cjs');
|
|
72
|
-
require('../../../store/state/sendBalances.cjs');
|
|
73
72
|
var ModalHeader = require('../../../components/ModalHeader/ModalHeader.cjs');
|
|
73
|
+
require('../../../store/state/sendBalances.cjs');
|
|
74
74
|
var Input = require('../../../components/Input/Input.cjs');
|
|
75
75
|
require('../../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
76
76
|
var PasskeyContext = require('../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
@@ -65,8 +65,8 @@ import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
|
65
65
|
import { IconButton } from '../../../components/IconButton/IconButton.js';
|
|
66
66
|
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
67
67
|
import { TypographyButton } from '../../../components/TypographyButton/TypographyButton.js';
|
|
68
|
-
import '../../../store/state/sendBalances.js';
|
|
69
68
|
import { ModalHeader } from '../../../components/ModalHeader/ModalHeader.js';
|
|
69
|
+
import '../../../store/state/sendBalances.js';
|
|
70
70
|
import { Input } from '../../../components/Input/Input.js';
|
|
71
71
|
import '../../TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
72
72
|
import { usePasskeyContext } from '../../../context/PasskeyContext/PasskeyContext.js';
|
|
@@ -112,7 +112,6 @@ const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBa
|
|
|
112
112
|
const { showFiat } = useInternalDynamicContext.useInternalDynamicContext();
|
|
113
113
|
const walletConnector = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
|
|
114
114
|
const { chain } = useFetchChain.useFetchChain(walletConnector);
|
|
115
|
-
const { chainName } = sendBalances.useSendBalanceState();
|
|
116
115
|
const { tokenBalances: unorderedTokenBalances, isLoading } = useTokenBalances.useTokenBalances({
|
|
117
116
|
chainName: (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.connectedChain) === 'SOL'
|
|
118
117
|
? sdkApiCore.ChainEnum.Sol
|
|
@@ -193,7 +192,7 @@ const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBa
|
|
|
193
192
|
}
|
|
194
193
|
});
|
|
195
194
|
const networkCurrency = (currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol) || networkData.nativeCurrency.symbol;
|
|
196
|
-
const currencyIcon = chain && (jsxRuntime.jsx(ChainIcon.ChainIcon, { chain: chain, chainName:
|
|
195
|
+
const currencyIcon = (chain === null || chain === void 0 ? void 0 : chain.name) && (jsxRuntime.jsx(ChainIcon.ChainIcon, { chain: chain, chainName: chain.name }));
|
|
197
196
|
const buildFormStage = () => (jsxRuntime.jsx(SendBalancePageLayout.SendBalancePageLayout, { transaction: transaction, onClickBack: onClickBack, networkName: networkData.vanityName || networkData.name, networkIcon: currencyIcon, networkCurrencyDecimals: networkData.nativeCurrency.symbol === 'SOL'
|
|
198
197
|
? 9
|
|
199
198
|
: networkData.nativeCurrency.decimals, walletAddress: shortenWalletAddress.shortenWalletAddress(currentToken === null || currentToken === void 0 ? void 0 : currentToken.address, 3, 3), walletKey: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.key, onClickClose: onClickClose, displayPoweredByDynamicFooter: displayPoweredByDynamicFooter, onSubmit: () => setStage('confirmation'), tokenBalances: tokenBalances !== null && tokenBalances !== void 0 ? tokenBalances : (currentToken && [currentToken]), currentToken: currentToken, setCurrentToken: setCurrentToken, isLoading: isLoading, isNativeToken: isNativeToken }));
|
|
@@ -209,7 +208,7 @@ const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBa
|
|
|
209
208
|
}), currentToken: currentToken, isNativeToken: isNativeToken, transactionValue: getTransactionValue(transaction, isNativeToken) }));
|
|
210
209
|
const buildSuccessState = () => {
|
|
211
210
|
var _a;
|
|
212
|
-
return (jsxRuntime.jsx(TransactionStatusLayout.TransactionStatusLayout, { transactionValue: getTransactionValue(transaction, isNativeToken), destinationAddress: (_a = transaction.to) !== null && _a !== void 0 ? _a : '', networkCurrency: networkCurrency, networkName:
|
|
211
|
+
return (jsxRuntime.jsx(TransactionStatusLayout.TransactionStatusLayout, { transactionValue: getTransactionValue(transaction, isNativeToken), destinationAddress: (_a = transaction.to) !== null && _a !== void 0 ? _a : '', networkCurrency: networkCurrency, networkName: networkData.name || '', NetworkIcon: currencyIcon, onClickClose: onClickClose, onDone: () => onDone === null || onDone === void 0 ? void 0 : onDone(), displayPoweredByDynamicFooter: displayPoweredByDynamicFooter, transaction: transaction, currentToken: currentToken, isNativeToken: isNativeToken }));
|
|
213
212
|
};
|
|
214
213
|
const getCurrentView = () => {
|
|
215
214
|
switch (stage) {
|
|
@@ -76,7 +76,7 @@ import '@hcaptcha/react-hcaptcha';
|
|
|
76
76
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
77
77
|
import '../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
78
78
|
import '../../context/PasskeyContext/PasskeyContext.js';
|
|
79
|
-
import {
|
|
79
|
+
import { setSendBalanceVariable, resetSendBalanceState } from '../../store/state/sendBalances.js';
|
|
80
80
|
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
81
81
|
import { TransactionConfirmationView } from '../TransactionConfirmationView/TransactionConfirmationView.js';
|
|
82
82
|
import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
@@ -108,7 +108,6 @@ const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBa
|
|
|
108
108
|
const { showFiat } = useInternalDynamicContext();
|
|
109
109
|
const walletConnector = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector;
|
|
110
110
|
const { chain } = useFetchChain(walletConnector);
|
|
111
|
-
const { chainName } = useSendBalanceState();
|
|
112
111
|
const { tokenBalances: unorderedTokenBalances, isLoading } = useTokenBalances({
|
|
113
112
|
chainName: (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.connectedChain) === 'SOL'
|
|
114
113
|
? ChainEnum.Sol
|
|
@@ -189,7 +188,7 @@ const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBa
|
|
|
189
188
|
}
|
|
190
189
|
});
|
|
191
190
|
const networkCurrency = (currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol) || networkData.nativeCurrency.symbol;
|
|
192
|
-
const currencyIcon = chain && (jsx(ChainIcon, { chain: chain, chainName:
|
|
191
|
+
const currencyIcon = (chain === null || chain === void 0 ? void 0 : chain.name) && (jsx(ChainIcon, { chain: chain, chainName: chain.name }));
|
|
193
192
|
const buildFormStage = () => (jsx(SendBalancePageLayout, { transaction: transaction, onClickBack: onClickBack, networkName: networkData.vanityName || networkData.name, networkIcon: currencyIcon, networkCurrencyDecimals: networkData.nativeCurrency.symbol === 'SOL'
|
|
194
193
|
? 9
|
|
195
194
|
: networkData.nativeCurrency.decimals, walletAddress: shortenWalletAddress(currentToken === null || currentToken === void 0 ? void 0 : currentToken.address, 3, 3), walletKey: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.key, onClickClose: onClickClose, displayPoweredByDynamicFooter: displayPoweredByDynamicFooter, onSubmit: () => setStage('confirmation'), tokenBalances: tokenBalances !== null && tokenBalances !== void 0 ? tokenBalances : (currentToken && [currentToken]), currentToken: currentToken, setCurrentToken: setCurrentToken, isLoading: isLoading, isNativeToken: isNativeToken }));
|
|
@@ -205,7 +204,7 @@ const SendBalanceView = ({ initialRecipientAddress = '', initialValue, onClickBa
|
|
|
205
204
|
}), currentToken: currentToken, isNativeToken: isNativeToken, transactionValue: getTransactionValue(transaction, isNativeToken) }));
|
|
206
205
|
const buildSuccessState = () => {
|
|
207
206
|
var _a;
|
|
208
|
-
return (jsx(TransactionStatusLayout, { transactionValue: getTransactionValue(transaction, isNativeToken), destinationAddress: (_a = transaction.to) !== null && _a !== void 0 ? _a : '', networkCurrency: networkCurrency, networkName:
|
|
207
|
+
return (jsx(TransactionStatusLayout, { transactionValue: getTransactionValue(transaction, isNativeToken), destinationAddress: (_a = transaction.to) !== null && _a !== void 0 ? _a : '', networkCurrency: networkCurrency, networkName: networkData.name || '', NetworkIcon: currencyIcon, onClickClose: onClickClose, onDone: () => onDone === null || onDone === void 0 ? void 0 : onDone(), displayPoweredByDynamicFooter: displayPoweredByDynamicFooter, transaction: transaction, currentToken: currentToken, isNativeToken: isNativeToken }));
|
|
209
208
|
};
|
|
210
209
|
const getCurrentView = () => {
|
|
211
210
|
switch (stage) {
|