@dynamic-labs/sdk-react-core 2.1.0-alpha.1 → 2.1.0-alpha.11
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 +92 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +13 -14
- package/src/index.cjs +8 -2
- package/src/index.d.ts +2 -1
- package/src/index.js +4 -1
- package/src/lib/Main.cjs +7 -0
- package/src/lib/Main.js +7 -0
- package/src/lib/components/Alert/Alert.cjs +2 -2
- package/src/lib/components/Alert/Alert.js +2 -2
- package/src/lib/components/Alert/Alert.types.d.ts +1 -0
- package/src/lib/components/EmailForm/EmailForm.cjs +1 -1
- package/src/lib/components/EmailForm/EmailForm.js +1 -1
- package/src/lib/components/PhoneNumberField/PhoneNumberField.cjs +1 -1
- package/src/lib/components/PhoneNumberField/PhoneNumberField.js +1 -1
- package/src/lib/components/Portal/Portal.cjs +2 -1
- package/src/lib/components/Portal/Portal.js +2 -1
- package/src/lib/components/RadioButton/RadioButton.cjs +14 -0
- package/src/lib/components/RadioButton/RadioButton.d.ts +5 -0
- package/src/lib/components/RadioButton/RadioButton.js +10 -0
- package/src/lib/components/RadioButton/index.d.ts +1 -0
- package/src/lib/components/Tooltip/Tooltip.cjs +2 -1
- package/src/lib/components/Tooltip/Tooltip.js +2 -1
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.d.ts +2 -1
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +1 -1
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.cjs +23 -7
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +5 -0
- package/src/lib/context/DynamicContext/DynamicContext.js +20 -4
- package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.cjs +2 -2
- package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.js +2 -2
- package/src/lib/context/DynamicContext/types/index.d.ts +0 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +5 -2
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.js +5 -2
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.cjs +2 -1
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.d.ts +1 -1
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.js +2 -1
- package/src/lib/context/ErrorBoundary/ErrorBoundary.cjs +64 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundary.d.ts +3 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundary.js +60 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryBase.cjs +40 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryBase.d.ts +14 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryBase.js +36 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryContext.cjs +24 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryContext.d.ts +5 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryContext.js +18 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryExclude.cjs +17 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryExclude.d.ts +4 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryExclude.js +13 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryInclude.cjs +17 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryInclude.d.ts +4 -0
- package/src/lib/context/ErrorBoundary/ErrorBoundaryInclude.js +13 -0
- package/src/lib/context/ErrorBoundary/index.d.ts +3 -0
- package/src/lib/context/ErrorBoundary/types.d.ts +13 -0
- package/src/lib/context/ViewContext/ViewContext.cjs +2 -2
- package/src/lib/context/ViewContext/ViewContext.js +2 -2
- package/src/lib/context/ViewContext/types/index.d.ts +7 -2
- package/src/lib/data/api/chains/balances.cjs +38 -0
- package/src/lib/data/api/chains/balances.d.ts +8 -0
- package/src/lib/data/api/chains/balances.js +34 -0
- package/src/lib/data/api/chains/index.d.ts +1 -0
- package/src/lib/data/api/user/user.cjs +16 -0
- package/src/lib/data/api/user/user.js +16 -1
- package/src/lib/data/api/wallets/wallets.cjs +26 -6
- package/src/lib/data/api/wallets/wallets.d.ts +4 -0
- package/src/lib/data/api/wallets/wallets.js +26 -7
- package/src/lib/events/dynamicEvents.d.ts +1 -1
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +6 -0
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +6 -0
- package/src/lib/locale/en/translation.cjs +45 -4
- package/src/lib/locale/en/translation.d.ts +44 -3
- package/src/lib/locale/en/translation.js +45 -4
- package/src/lib/shared/types/dynamicEventsCallbacks.d.ts +2 -1
- package/src/lib/shared/types/general.d.ts +1 -0
- package/src/lib/shared/utils/classes/storage/localStorage.cjs +2 -2
- package/src/lib/shared/utils/classes/storage/localStorage.js +2 -2
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/errors.cjs +2 -2
- package/src/lib/utils/constants/errors.d.ts +1 -0
- package/src/lib/utils/constants/errors.js +2 -2
- package/src/lib/utils/functions/addPasskeyIdentifierToWalletConnector/addPasskeyIdentifierToWalletConnector.cjs +14 -0
- package/src/lib/utils/functions/addPasskeyIdentifierToWalletConnector/addPasskeyIdentifierToWalletConnector.d.ts +3 -0
- package/src/lib/utils/functions/addPasskeyIdentifierToWalletConnector/addPasskeyIdentifierToWalletConnector.js +10 -0
- package/src/lib/utils/functions/addPasskeyIdentifierToWalletConnector/index.d.ts +1 -0
- package/src/lib/utils/functions/createUserProfile/createUserProfile.cjs +1 -2
- package/src/lib/utils/functions/createUserProfile/createUserProfile.js +1 -2
- package/src/lib/utils/functions/findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.cjs +3 -4
- package/src/lib/utils/functions/findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.d.ts +1 -1
- package/src/lib/utils/functions/findEmbeddedWalletFromVerifiedCredentials/findEmbeddedWalletFromVerifiedCredentials.js +4 -5
- package/src/lib/utils/functions/findTurnkeyWallet/findTurnkeyWallet.cjs +12 -9
- package/src/lib/utils/functions/findTurnkeyWallet/findTurnkeyWallet.d.ts +8 -2
- package/src/lib/utils/functions/findTurnkeyWallet/findTurnkeyWallet.js +13 -10
- package/src/lib/utils/functions/findTurnkeyWallet/index.d.ts +1 -1
- package/src/lib/utils/functions/getUserVerifiedCredentialType/getUserVerifiedCredentialType.cjs +5 -5
- package/src/lib/utils/functions/getUserVerifiedCredentialType/getUserVerifiedCredentialType.d.ts +3 -2
- package/src/lib/utils/functions/getUserVerifiedCredentialType/getUserVerifiedCredentialType.js +5 -5
- package/src/lib/utils/functions/hasEmbeddedWallet/hasEmbeddedWallet.cjs +7 -2
- package/src/lib/utils/functions/hasEmbeddedWallet/hasEmbeddedWallet.js +7 -2
- package/src/lib/utils/functions/index.d.ts +2 -1
- package/src/lib/utils/functions/serializeWalletConnectors/index.d.ts +1 -0
- package/src/lib/utils/functions/serializeWalletConnectors/serializeWalletConnectors.cjs +32 -0
- package/src/lib/utils/functions/serializeWalletConnectors/serializeWalletConnectors.d.ts +2 -0
- package/src/lib/utils/functions/serializeWalletConnectors/serializeWalletConnectors.js +28 -0
- package/src/lib/utils/hooks/index.d.ts +2 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +22 -17
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +22 -17
- package/src/lib/utils/hooks/useConfirmationModal/useConfirmationModal.cjs +2 -1
- package/src/lib/utils/hooks/useConfirmationModal/useConfirmationModal.js +2 -1
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +22 -18
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.d.ts +7 -2
- package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +22 -18
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +8 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +8 -0
- package/src/lib/utils/hooks/useDynamicScopes/useDynamicScopes.cjs +3 -3
- package/src/lib/utils/hooks/useDynamicScopes/useDynamicScopes.js +3 -3
- package/src/lib/utils/hooks/useElementById/useElementById.cjs +33 -18
- package/src/lib/utils/hooks/useElementById/useElementById.d.ts +3 -1
- package/src/lib/utils/hooks/useElementById/useElementById.js +33 -18
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +46 -11
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +23 -2
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +46 -11
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs +6 -6
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.d.ts +1 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js +6 -6
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useMPCEmbeddedWallet.cjs +13 -9
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useMPCEmbeddedWallet.d.ts +3 -2
- package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useMPCEmbeddedWallet.js +13 -9
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs +4 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.d.ts +2 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js +3 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.cjs +192 -50
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.d.ts +26 -8
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.js +197 -55
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.cjs +45 -18
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.d.ts +4 -1
- package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.js +45 -18
- package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs +2 -2
- package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js +2 -2
- package/src/lib/utils/hooks/useMergeUserAccounts/index.d.ts +1 -0
- package/src/lib/utils/hooks/useMergeUserAccounts/useMergeUserAccounts.cjs +99 -0
- package/src/lib/utils/hooks/useMergeUserAccounts/useMergeUserAccounts.d.ts +4 -0
- package/src/lib/utils/hooks/useMergeUserAccounts/useMergeUserAccounts.js +95 -0
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs +2 -1
- package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js +2 -1
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.cjs +13 -4
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.d.ts +10 -2
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.js +13 -4
- package/src/lib/utils/hooks/useSendDynamicProps/useSendDynamicProps.cjs +6 -13
- package/src/lib/utils/hooks/useSendDynamicProps/useSendDynamicProps.d.ts +1 -3
- package/src/lib/utils/hooks/useSendDynamicProps/useSendDynamicProps.js +6 -12
- package/src/lib/utils/hooks/useTokenBalances/index.d.ts +1 -0
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.cjs +141 -0
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.d.ts +12 -0
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.js +137 -0
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +5 -0
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +6 -1
- package/src/lib/utils/hooks/useWalletConnectorOptions/useWalletConnectorOptions.cjs +25 -2
- package/src/lib/utils/hooks/useWalletConnectorOptions/useWalletConnectorOptions.js +25 -2
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +2 -4
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +2 -1
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +2 -4
- package/src/lib/views/CollectUserDataView/UserDataFields/UserField/UserField.cjs +3 -3
- package/src/lib/views/CollectUserDataView/UserDataFields/UserField/UserField.js +3 -3
- package/src/lib/views/CollectUserDataView/useFields.cjs +1 -0
- package/src/lib/views/CollectUserDataView/useFields.d.ts +2 -0
- package/src/lib/views/CollectUserDataView/useFields.js +1 -0
- package/src/lib/views/EmailVerification/EmailVerification.cjs +38 -11
- package/src/lib/views/EmailVerification/EmailVerification.js +38 -11
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +1 -1
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +1 -1
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +6 -5
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +6 -5
- package/src/lib/views/MergeUserAccountsConflictsView/MergeUserAccountsConflictsView.cjs +126 -0
- package/src/lib/views/MergeUserAccountsConflictsView/MergeUserAccountsConflictsView.d.ts +6 -0
- package/src/lib/views/MergeUserAccountsConflictsView/MergeUserAccountsConflictsView.js +122 -0
- package/src/lib/views/MergeUserAccountsConflictsView/index.d.ts +1 -0
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +123 -0
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.d.ts +4 -0
- package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +119 -0
- package/src/lib/views/MergeUserAccountsView/index.d.ts +1 -0
- package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.cjs +3 -3
- package/src/lib/views/MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView.js +3 -3
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +2 -3
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +2 -3
- package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/EmbeddedAuthChoiceCards.cjs +2 -1
- package/src/lib/views/Passkey/EmbeddedAuthChoiceCards/EmbeddedAuthChoiceCards.js +2 -1
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +9 -9
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.d.ts +6 -1
- package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +9 -9
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +2 -1
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +2 -1
- package/src/lib/views/Passkey/utils/{createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.cjs → createEmbeddedWalletRequest/createEmbeddedWalletRequest.cjs} +18 -19
- package/src/lib/views/Passkey/utils/{createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.d.ts → createEmbeddedWalletRequest/createEmbeddedWalletRequest.d.ts} +7 -3
- package/src/lib/views/Passkey/utils/{createEmbeddedWalletWithPasskey/createEmbeddedWalletWithPasskey.js → createEmbeddedWalletRequest/createEmbeddedWalletRequest.js} +18 -19
- package/src/lib/views/Passkey/utils/createEmbeddedWalletRequest/index.d.ts +1 -0
- package/src/lib/views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.cjs +16 -0
- package/src/lib/views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.d.ts +2 -0
- package/src/lib/views/Passkey/utils/findPrimaryEmbeddedChain/findPrimaryEmbeddedChain.js +12 -0
- package/src/lib/views/Passkey/utils/findPrimaryEmbeddedChain/index.d.ts +1 -0
- package/src/lib/views/Passkey/utils/index.d.ts +1 -2
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +9 -9
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +9 -9
- package/src/lib/views/WalletList/WalletList.cjs +3 -6
- package/src/lib/views/WalletList/WalletList.js +3 -6
- package/src/lib/views/WalletLockedView/WalletLockedView.cjs +2 -8
- package/src/lib/views/WalletLockedView/WalletLockedView.js +2 -8
- package/src/lib/views/viewToComponentMap.cjs +4 -0
- package/src/lib/views/viewToComponentMap.d.ts +6 -2
- package/src/lib/views/viewToComponentMap.js +4 -0
- package/src/lib/widgets/DynamicWidget/components/PromptModal/PromptModal.cjs +2 -1
- package/src/lib/widgets/DynamicWidget/components/PromptModal/PromptModal.js +2 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchNameService/useFetchNameService.js +1 -1
- package/src/lib/utils/functions/isEmbeddedWalletPresent/index.d.ts +0 -1
- package/src/lib/utils/functions/isEmbeddedWalletPresent/isEmbeddedWalletPresent.cjs +0 -19
- package/src/lib/utils/functions/isEmbeddedWalletPresent/isEmbeddedWalletPresent.d.ts +0 -1
- package/src/lib/utils/functions/isEmbeddedWalletPresent/isEmbeddedWalletPresent.js +0 -15
- package/src/lib/views/Passkey/utils/createEmbeddedWalletWithPasskey/index.d.ts +0 -1
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.cjs +0 -65
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.d.ts +0 -16
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/createPregeneratedWallet.js +0 -61
- package/src/lib/views/Passkey/utils/createPregeneratedWallet/index.d.ts +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var ErrorBoundaryBase = require('./ErrorBoundaryBase.cjs');
|
|
7
|
+
|
|
8
|
+
class ErrorBoundaryExclude extends ErrorBoundaryBase.ErrorBoundaryBase {
|
|
9
|
+
render() {
|
|
10
|
+
const { children } = this.props;
|
|
11
|
+
return this.renderOrError(children, {
|
|
12
|
+
isDynamicSdkError: false,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.ErrorBoundaryExclude = ErrorBoundaryExclude;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { ErrorBoundaryBase } from './ErrorBoundaryBase.js';
|
|
3
|
+
|
|
4
|
+
class ErrorBoundaryExclude extends ErrorBoundaryBase {
|
|
5
|
+
render() {
|
|
6
|
+
const { children } = this.props;
|
|
7
|
+
return this.renderOrError(children, {
|
|
8
|
+
isDynamicSdkError: false,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { ErrorBoundaryExclude };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var ErrorBoundaryBase = require('./ErrorBoundaryBase.cjs');
|
|
7
|
+
|
|
8
|
+
class ErrorBoundaryInclude extends ErrorBoundaryBase.ErrorBoundaryBase {
|
|
9
|
+
render() {
|
|
10
|
+
const { children } = this.props;
|
|
11
|
+
return this.renderOrError(children, {
|
|
12
|
+
isDynamicSdkError: true,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.ErrorBoundaryInclude = ErrorBoundaryInclude;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { ErrorBoundaryBase } from './ErrorBoundaryBase.js';
|
|
3
|
+
|
|
4
|
+
class ErrorBoundaryInclude extends ErrorBoundaryBase {
|
|
5
|
+
render() {
|
|
6
|
+
const { children } = this.props;
|
|
7
|
+
return this.renderOrError(children, {
|
|
8
|
+
isDynamicSdkError: true,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { ErrorBoundaryInclude };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ErrorInfo, PropsWithChildren } from 'react';
|
|
2
|
+
export type ErrorBoundaryProps = PropsWithChildren<{
|
|
3
|
+
onError?: (error: Error, info: ErrorInfo) => void;
|
|
4
|
+
}>;
|
|
5
|
+
export type ErrorBoundaryState = {
|
|
6
|
+
hasError: boolean;
|
|
7
|
+
error: Error | null;
|
|
8
|
+
};
|
|
9
|
+
export type ErrorBoundaryContextType = {
|
|
10
|
+
hasError: boolean;
|
|
11
|
+
error: any;
|
|
12
|
+
isDynamicSdkError: boolean;
|
|
13
|
+
};
|
|
@@ -16,13 +16,13 @@ const ViewContextProvider = ({ children, initialView = { props: { isWalletConnec
|
|
|
16
16
|
const goToInitialView = React.useCallback(() => {
|
|
17
17
|
_setView(null);
|
|
18
18
|
}, []);
|
|
19
|
-
const setView = React.useCallback((type, props) => {
|
|
19
|
+
const setView = React.useCallback((type, props, events) => {
|
|
20
20
|
// we need to clear errors before proceeding to the next view
|
|
21
21
|
// but only if the next view is different from the current view
|
|
22
22
|
// this is to prevent the error from being cleared when the same view is re-rendered
|
|
23
23
|
if (view.type !== type)
|
|
24
24
|
clearError();
|
|
25
|
-
_setView({ props, type });
|
|
25
|
+
_setView({ events, props, type });
|
|
26
26
|
}, []);
|
|
27
27
|
useDynamicEvents.useInternalDynamicEvents('logout', () => goToInitialView());
|
|
28
28
|
const value = React.useMemo(() => ({
|
|
@@ -12,13 +12,13 @@ const ViewContextProvider = ({ children, initialView = { props: { isWalletConnec
|
|
|
12
12
|
const goToInitialView = useCallback(() => {
|
|
13
13
|
_setView(null);
|
|
14
14
|
}, []);
|
|
15
|
-
const setView = useCallback((type, props) => {
|
|
15
|
+
const setView = useCallback((type, props, events) => {
|
|
16
16
|
// we need to clear errors before proceeding to the next view
|
|
17
17
|
// but only if the next view is different from the current view
|
|
18
18
|
// this is to prevent the error from being cleared when the same view is re-rendered
|
|
19
19
|
if (view.type !== type)
|
|
20
20
|
clearError();
|
|
21
|
-
_setView({ props, type });
|
|
21
|
+
_setView({ events, props, type });
|
|
22
22
|
}, []);
|
|
23
23
|
useInternalDynamicEvents('logout', () => goToInitialView());
|
|
24
24
|
const value = useMemo(() => ({
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { viewToComponentMap } from '../../../views/viewToComponentMap';
|
|
3
|
-
export type ViewType = 'select-hardware-wallet' | 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-no-wallet' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-wallet-only' | 'login-with-email-verification' | 'login-with-sms-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'update-email' | 'verify-email' | 'verify-sms' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'multi-wallet-wallet-list' | 'wallet-sign' | 'wallet-used' | 'wallet-group' | 'select-wallet-in-wallet-group' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view' | 'wallet-locked-view' | 'social-wrong-account' | 'gate-blocked-wallet' | 'bridge-welcome' | 'bridge-summary' | 'bridge-next-wallet-connection' | 'account-exists' | 'merge-user-accounts-with-same-email' | 'mfa-choose-device' | 'mfa-secure-device' | 'wallet-cannot-be-transferred' | 'passkey-intro' | 'passkey-recovery-add-email' | 'passkey-recovery-start' | 'passkey-recovery-bundle' | 'passkey-recovery-complete' | 'passkey-new-domain-detected' | 'embedded-reveal-view' | 'embedded-reveal-account-view' | 'embedded-wallet-auth-choice' | 'rename-passkey' | 'wallet-redirect-view' | 'create-password-view' | 'wallet-claim-intro' | 'farcaster-connect-view';
|
|
3
|
+
export type ViewType = 'select-hardware-wallet' | 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-no-wallet' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-wallet-only' | 'login-with-email-verification' | 'login-with-sms-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'update-email' | 'verify-email' | 'verify-sms' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'multi-wallet-wallet-list' | 'wallet-sign' | 'wallet-used' | 'wallet-group' | 'select-wallet-in-wallet-group' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view' | 'wallet-locked-view' | 'social-wrong-account' | 'gate-blocked-wallet' | 'bridge-welcome' | 'bridge-summary' | 'bridge-next-wallet-connection' | 'account-exists' | 'merge-user-accounts' | 'merge-user-accounts-conflicts' | 'merge-user-accounts-with-same-email' | 'mfa-choose-device' | 'mfa-secure-device' | 'wallet-cannot-be-transferred' | 'passkey-intro' | 'passkey-recovery-add-email' | 'passkey-recovery-start' | 'passkey-recovery-bundle' | 'passkey-recovery-complete' | 'passkey-new-domain-detected' | 'embedded-reveal-view' | 'embedded-reveal-account-view' | 'embedded-wallet-auth-choice' | 'rename-passkey' | 'wallet-redirect-view' | 'create-password-view' | 'wallet-claim-intro' | 'farcaster-connect-view';
|
|
4
4
|
export type ViewMapConstraint = Record<ViewType, FC<any>>;
|
|
5
5
|
type ComponentProps<T extends FC<any>> = T extends FC<infer P> ? P : never;
|
|
6
6
|
export type ViewMap = typeof viewToComponentMap;
|
|
7
7
|
export type ViewState<T extends ViewType> = {
|
|
8
8
|
type: T;
|
|
9
9
|
props?: ComponentProps<ViewMap[T]>;
|
|
10
|
+
events?: ViewEvents;
|
|
10
11
|
};
|
|
11
|
-
export type
|
|
12
|
+
export type ViewEvents = {
|
|
13
|
+
onBackClick?: () => void;
|
|
14
|
+
onClose?: () => void;
|
|
15
|
+
};
|
|
16
|
+
export type SetView = <T extends ViewType>(view: T, props?: ViewState<T>['props'], events?: ViewEvents) => void;
|
|
12
17
|
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
|
+
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
8
|
+
var logger = require('../../../shared/logger.cjs');
|
|
9
|
+
require('@dynamic-labs/iconic');
|
|
10
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
11
|
+
require('react/jsx-runtime');
|
|
12
|
+
require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
|
+
require('react');
|
|
14
|
+
require('@dynamic-labs/wallet-book');
|
|
15
|
+
require('../../../utils/constants/colors.cjs');
|
|
16
|
+
require('../../../utils/constants/values.cjs');
|
|
17
|
+
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
18
|
+
require('@dynamic-labs/utils');
|
|
19
|
+
require('../../../shared/consts/index.cjs');
|
|
20
|
+
var api = require('../api.cjs');
|
|
21
|
+
|
|
22
|
+
const getAccountTokenBalances = (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ userJwt, environmentId, chainName = sdkApiCore.ChainEnum.Evm, networkId, accountAddress, }) {
|
|
23
|
+
try {
|
|
24
|
+
const data = yield api.sdkApi(userJwt).getAccountBalances({
|
|
25
|
+
accountAddress,
|
|
26
|
+
chainName: chainName,
|
|
27
|
+
environmentId,
|
|
28
|
+
networkId,
|
|
29
|
+
});
|
|
30
|
+
return data;
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
logger.logger.error(e);
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
exports.getAccountTokenBalances = getAccountTokenBalances;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChainEnum, TokenBalance } from '@dynamic-labs/sdk-api-core';
|
|
2
|
+
export declare const getAccountTokenBalances: ({ userJwt, environmentId, chainName, networkId, accountAddress, }: {
|
|
3
|
+
userJwt: string;
|
|
4
|
+
environmentId: string;
|
|
5
|
+
chainName: ChainEnum;
|
|
6
|
+
networkId: number;
|
|
7
|
+
accountAddress: string;
|
|
8
|
+
}) => Promise<TokenBalance[] | undefined>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
|
+
import { ChainEnum } from '@dynamic-labs/sdk-api-core';
|
|
4
|
+
import { logger } from '../../../shared/logger.js';
|
|
5
|
+
import '@dynamic-labs/iconic';
|
|
6
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
7
|
+
import 'react/jsx-runtime';
|
|
8
|
+
import '../../../context/ViewContext/ViewContext.js';
|
|
9
|
+
import 'react';
|
|
10
|
+
import '@dynamic-labs/wallet-book';
|
|
11
|
+
import '../../../utils/constants/colors.js';
|
|
12
|
+
import '../../../utils/constants/values.js';
|
|
13
|
+
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
14
|
+
import '@dynamic-labs/utils';
|
|
15
|
+
import '../../../shared/consts/index.js';
|
|
16
|
+
import { sdkApi } from '../api.js';
|
|
17
|
+
|
|
18
|
+
const getAccountTokenBalances = (_a) => __awaiter(void 0, [_a], void 0, function* ({ userJwt, environmentId, chainName = ChainEnum.Evm, networkId, accountAddress, }) {
|
|
19
|
+
try {
|
|
20
|
+
const data = yield sdkApi(userJwt).getAccountBalances({
|
|
21
|
+
accountAddress,
|
|
22
|
+
chainName: chainName,
|
|
23
|
+
environmentId,
|
|
24
|
+
networkId,
|
|
25
|
+
});
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
logger.error(e);
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export { getAccountTokenBalances };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './balances';
|
|
@@ -61,6 +61,21 @@ const mergeUserAccounts = (userJwt, environmentId) => _tslib.__awaiter(void 0, v
|
|
|
61
61
|
throw e;
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
|
+
const verifyMergeUsers = (userJwt, environmentId, mergeConflictResolutions) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
65
|
+
try {
|
|
66
|
+
const response = yield api.sdkApi(userJwt).verifyMergeUsers({
|
|
67
|
+
environmentId,
|
|
68
|
+
mergeUserConflictResolutions: {
|
|
69
|
+
mergeUserResolutions: mergeConflictResolutions,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
return response;
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
logger.logger.error(e);
|
|
76
|
+
throw e;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
64
79
|
const refreshUserJwt = (_a, userJwt_1) => _tslib.__awaiter(void 0, [_a, userJwt_1], void 0, function* ({ environmentId, }, userJwt) {
|
|
65
80
|
try {
|
|
66
81
|
const { jwt, minifiedJwt } = yield api.sdkApi(userJwt).refreshAuth({
|
|
@@ -76,3 +91,4 @@ const refreshUserJwt = (_a, userJwt_1) => _tslib.__awaiter(void 0, [_a, userJwt_
|
|
|
76
91
|
exports.mergeUserAccounts = mergeUserAccounts;
|
|
77
92
|
exports.refreshUserJwt = refreshUserJwt;
|
|
78
93
|
exports.updateUserProfileFields = updateUserProfileFields;
|
|
94
|
+
exports.verifyMergeUsers = verifyMergeUsers;
|
|
@@ -57,6 +57,21 @@ const mergeUserAccounts = (userJwt, environmentId) => __awaiter(void 0, void 0,
|
|
|
57
57
|
throw e;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
+
const verifyMergeUsers = (userJwt, environmentId, mergeConflictResolutions) => __awaiter(void 0, void 0, void 0, function* () {
|
|
61
|
+
try {
|
|
62
|
+
const response = yield sdkApi(userJwt).verifyMergeUsers({
|
|
63
|
+
environmentId,
|
|
64
|
+
mergeUserConflictResolutions: {
|
|
65
|
+
mergeUserResolutions: mergeConflictResolutions,
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
return response;
|
|
69
|
+
}
|
|
70
|
+
catch (e) {
|
|
71
|
+
logger.error(e);
|
|
72
|
+
throw e;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
60
75
|
const refreshUserJwt = (_a, userJwt_1) => __awaiter(void 0, [_a, userJwt_1], void 0, function* ({ environmentId, }, userJwt) {
|
|
61
76
|
try {
|
|
62
77
|
const { jwt, minifiedJwt } = yield sdkApi(userJwt).refreshAuth({
|
|
@@ -69,4 +84,4 @@ const refreshUserJwt = (_a, userJwt_1) => __awaiter(void 0, [_a, userJwt_1], voi
|
|
|
69
84
|
}
|
|
70
85
|
});
|
|
71
86
|
|
|
72
|
-
export { mergeUserAccounts, refreshUserJwt, updateUserProfileFields };
|
|
87
|
+
export { mergeUserAccounts, refreshUserJwt, updateUserProfileFields, verifyMergeUsers };
|
|
@@ -19,7 +19,22 @@ require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
|
19
19
|
require('../../../shared/consts/index.cjs');
|
|
20
20
|
var api = require('../api.cjs');
|
|
21
21
|
|
|
22
|
-
const
|
|
22
|
+
const storeSelectedWallet = (_a, userJwt_1) => _tslib.__awaiter(void 0, [_a, userJwt_1], void 0, function* ({ environmentId, walletId, }, userJwt) {
|
|
23
|
+
try {
|
|
24
|
+
const response = yield api.sdkApi(userJwt).selectUserWallet({
|
|
25
|
+
environmentId,
|
|
26
|
+
userWalletSelectionRequest: {
|
|
27
|
+
walletId,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
return response;
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
logger.logger.error('error storing selected wallet', e);
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const linkWallet = (environmentId_1, _b, userJwt_2) => _tslib.__awaiter(void 0, [environmentId_1, _b, userJwt_2], void 0, function* (environmentId, { messageToSign, network, signedMessage, publicWalletAddress, chain, walletName, walletProvider, additionalWalletAddresses, backup, password, passwordSource, }, userJwt) {
|
|
23
38
|
const verifyRequest = sdkApiCore.VerifyRequestFromJSON({
|
|
24
39
|
additionalWalletAddresses,
|
|
25
40
|
backup,
|
|
@@ -48,12 +63,16 @@ const linkWallet = (environmentId_1, _a, userJwt_1) => _tslib.__awaiter(void 0,
|
|
|
48
63
|
throw new utils.WalletUsedError(data.code);
|
|
49
64
|
}
|
|
50
65
|
if (data.code === 'merge_accounts_confirmation') {
|
|
51
|
-
throw new utils.MergeAccountsConfirmationError(
|
|
66
|
+
throw new utils.MergeAccountsConfirmationError({
|
|
67
|
+
code: data.code,
|
|
68
|
+
mergeConflicts: data.payload.mergeConflicts,
|
|
69
|
+
walletAddress: publicWalletAddress,
|
|
70
|
+
});
|
|
52
71
|
}
|
|
53
72
|
return undefined;
|
|
54
73
|
}
|
|
55
74
|
});
|
|
56
|
-
const unlinkWallet = (
|
|
75
|
+
const unlinkWallet = (_c, userJwt_3) => _tslib.__awaiter(void 0, [_c, userJwt_3], void 0, function* ({ environmentId, primaryWalletId, walletId, }, userJwt) {
|
|
57
76
|
try {
|
|
58
77
|
const response = yield api.sdkApi(userJwt).verifyUnlink({
|
|
59
78
|
environmentId,
|
|
@@ -68,7 +87,7 @@ const unlinkWallet = (_b, userJwt_2) => _tslib.__awaiter(void 0, [_b, userJwt_2]
|
|
|
68
87
|
return undefined;
|
|
69
88
|
}
|
|
70
89
|
});
|
|
71
|
-
const transferWallet = (environmentId_2,
|
|
90
|
+
const transferWallet = (environmentId_2, _d, userJwt_4) => _tslib.__awaiter(void 0, [environmentId_2, _d, userJwt_4], void 0, function* (environmentId, { network, messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, skipEmptyAccountCheck = false, }, userJwt) {
|
|
72
91
|
// We should find a better way to do this than force type casting
|
|
73
92
|
const verifyRequest = {
|
|
74
93
|
chain,
|
|
@@ -87,11 +106,11 @@ const transferWallet = (environmentId_2, _c, userJwt_3) => _tslib.__awaiter(void
|
|
|
87
106
|
});
|
|
88
107
|
return response;
|
|
89
108
|
}
|
|
90
|
-
catch (
|
|
109
|
+
catch (_e) {
|
|
91
110
|
return undefined;
|
|
92
111
|
}
|
|
93
112
|
});
|
|
94
|
-
const verifyWallet = (environmentId_3,
|
|
113
|
+
const verifyWallet = (environmentId_3, _f) => _tslib.__awaiter(void 0, [environmentId_3, _f], void 0, function* (environmentId, { messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, captchaToken, network, oauth, additionalWalletAddresses, }) {
|
|
95
114
|
const verifyRequest = sdkApiCore.VerifyRequestFromJSON({
|
|
96
115
|
additionalWalletAddresses,
|
|
97
116
|
captchaToken,
|
|
@@ -136,6 +155,7 @@ const verifyWallet = (environmentId_3, _e) => _tslib.__awaiter(void 0, [environm
|
|
|
136
155
|
});
|
|
137
156
|
|
|
138
157
|
exports.linkWallet = linkWallet;
|
|
158
|
+
exports.storeSelectedWallet = storeSelectedWallet;
|
|
139
159
|
exports.transferWallet = transferWallet;
|
|
140
160
|
exports.unlinkWallet = unlinkWallet;
|
|
141
161
|
exports.verifyWallet = verifyWallet;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { VerifyResponse } from '@dynamic-labs/sdk-api-core';
|
|
2
2
|
import { VerifyWallet } from '../../../shared/types';
|
|
3
|
+
export declare const storeSelectedWallet: ({ environmentId, walletId, }: {
|
|
4
|
+
environmentId: string;
|
|
5
|
+
walletId: string;
|
|
6
|
+
}, userJwt: string) => Promise<VerifyResponse | undefined>;
|
|
3
7
|
export declare const linkWallet: (environmentId: string, { messageToSign, network, signedMessage, publicWalletAddress, chain, walletName, walletProvider, additionalWalletAddresses, backup, password, passwordSource, }: VerifyWallet, userJwt: string) => Promise<VerifyResponse | undefined>;
|
|
4
8
|
export declare const unlinkWallet: ({ environmentId, primaryWalletId, walletId, }: {
|
|
5
9
|
environmentId: string;
|
|
@@ -15,7 +15,22 @@ import '../../../shared/utils/classes/storage/localStorage.js';
|
|
|
15
15
|
import '../../../shared/consts/index.js';
|
|
16
16
|
import { sdkApi } from '../api.js';
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const storeSelectedWallet = (_a, userJwt_1) => __awaiter(void 0, [_a, userJwt_1], void 0, function* ({ environmentId, walletId, }, userJwt) {
|
|
19
|
+
try {
|
|
20
|
+
const response = yield sdkApi(userJwt).selectUserWallet({
|
|
21
|
+
environmentId,
|
|
22
|
+
userWalletSelectionRequest: {
|
|
23
|
+
walletId,
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
return response;
|
|
27
|
+
}
|
|
28
|
+
catch (e) {
|
|
29
|
+
logger.error('error storing selected wallet', e);
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const linkWallet = (environmentId_1, _b, userJwt_2) => __awaiter(void 0, [environmentId_1, _b, userJwt_2], void 0, function* (environmentId, { messageToSign, network, signedMessage, publicWalletAddress, chain, walletName, walletProvider, additionalWalletAddresses, backup, password, passwordSource, }, userJwt) {
|
|
19
34
|
const verifyRequest = VerifyRequestFromJSON({
|
|
20
35
|
additionalWalletAddresses,
|
|
21
36
|
backup,
|
|
@@ -44,12 +59,16 @@ const linkWallet = (environmentId_1, _a, userJwt_1) => __awaiter(void 0, [enviro
|
|
|
44
59
|
throw new WalletUsedError(data.code);
|
|
45
60
|
}
|
|
46
61
|
if (data.code === 'merge_accounts_confirmation') {
|
|
47
|
-
throw new MergeAccountsConfirmationError(
|
|
62
|
+
throw new MergeAccountsConfirmationError({
|
|
63
|
+
code: data.code,
|
|
64
|
+
mergeConflicts: data.payload.mergeConflicts,
|
|
65
|
+
walletAddress: publicWalletAddress,
|
|
66
|
+
});
|
|
48
67
|
}
|
|
49
68
|
return undefined;
|
|
50
69
|
}
|
|
51
70
|
});
|
|
52
|
-
const unlinkWallet = (
|
|
71
|
+
const unlinkWallet = (_c, userJwt_3) => __awaiter(void 0, [_c, userJwt_3], void 0, function* ({ environmentId, primaryWalletId, walletId, }, userJwt) {
|
|
53
72
|
try {
|
|
54
73
|
const response = yield sdkApi(userJwt).verifyUnlink({
|
|
55
74
|
environmentId,
|
|
@@ -64,7 +83,7 @@ const unlinkWallet = (_b, userJwt_2) => __awaiter(void 0, [_b, userJwt_2], void
|
|
|
64
83
|
return undefined;
|
|
65
84
|
}
|
|
66
85
|
});
|
|
67
|
-
const transferWallet = (environmentId_2,
|
|
86
|
+
const transferWallet = (environmentId_2, _d, userJwt_4) => __awaiter(void 0, [environmentId_2, _d, userJwt_4], void 0, function* (environmentId, { network, messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, skipEmptyAccountCheck = false, }, userJwt) {
|
|
68
87
|
// We should find a better way to do this than force type casting
|
|
69
88
|
const verifyRequest = {
|
|
70
89
|
chain,
|
|
@@ -83,11 +102,11 @@ const transferWallet = (environmentId_2, _c, userJwt_3) => __awaiter(void 0, [en
|
|
|
83
102
|
});
|
|
84
103
|
return response;
|
|
85
104
|
}
|
|
86
|
-
catch (
|
|
105
|
+
catch (_e) {
|
|
87
106
|
return undefined;
|
|
88
107
|
}
|
|
89
108
|
});
|
|
90
|
-
const verifyWallet = (environmentId_3,
|
|
109
|
+
const verifyWallet = (environmentId_3, _f) => __awaiter(void 0, [environmentId_3, _f], void 0, function* (environmentId, { messageToSign, signedMessage, publicWalletAddress, chain, walletName, walletProvider, captchaToken, network, oauth, additionalWalletAddresses, }) {
|
|
91
110
|
const verifyRequest = VerifyRequestFromJSON({
|
|
92
111
|
additionalWalletAddresses,
|
|
93
112
|
captchaToken,
|
|
@@ -131,4 +150,4 @@ const verifyWallet = (environmentId_3, _e) => __awaiter(void 0, [environmentId_3
|
|
|
131
150
|
}
|
|
132
151
|
});
|
|
133
152
|
|
|
134
|
-
export { linkWallet, transferWallet, unlinkWallet, verifyWallet };
|
|
153
|
+
export { linkWallet, storeSelectedWallet, transferWallet, unlinkWallet, verifyWallet };
|
|
@@ -11,7 +11,7 @@ export type DynamicEvents = {
|
|
|
11
11
|
authFlowCancelled: () => void;
|
|
12
12
|
emailVerificationResult: (param: boolean, email: string) => void;
|
|
13
13
|
smsVerificationResult: (param: boolean, phone: PhoneData) => void;
|
|
14
|
-
embeddedWalletCreated: (wallet: Wallet, verifiedCredential: JwtVerifiedCredential | undefined) => void;
|
|
14
|
+
embeddedWalletCreated: (wallet: Wallet, verifiedCredential: JwtVerifiedCredential | undefined, authToken: string | undefined) => void;
|
|
15
15
|
embeddedWalletFailed: (error: unknown) => void;
|
|
16
16
|
passkeyRecoveryCompleted: (wallet: Wallet) => void;
|
|
17
17
|
passkeyRecoveryFailed: (error: unknown) => void;
|
|
@@ -92,6 +92,11 @@ const Header = ({ onClose: handleClose, heading, projectSettings, copykey, }) =>
|
|
|
92
92
|
const { setExistentAccountData } = AccountExistsContext.useAccountExistsContext();
|
|
93
93
|
const { setSocialProvider } = SocialRedirectContext.useSocialRedirectContext();
|
|
94
94
|
const handleBackClick = React.useCallback(() => {
|
|
95
|
+
var _a;
|
|
96
|
+
if ((_a = view.events) === null || _a === void 0 ? void 0 : _a.onBackClick) {
|
|
97
|
+
view.events.onBackClick();
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
95
100
|
if (view.type === 'farcaster-connect-view') {
|
|
96
101
|
setSocialProvider(undefined);
|
|
97
102
|
dynamicEvents.dynamicEvents.emit('farcasterConnectCancelled');
|
|
@@ -106,6 +111,7 @@ const Header = ({ onClose: handleClose, heading, projectSettings, copykey, }) =>
|
|
|
106
111
|
goToInitialView();
|
|
107
112
|
}, [
|
|
108
113
|
view.type,
|
|
114
|
+
view.events,
|
|
109
115
|
goToInitialView,
|
|
110
116
|
setExistentAccountData,
|
|
111
117
|
setError,
|
|
@@ -88,6 +88,11 @@ const Header = ({ onClose: handleClose, heading, projectSettings, copykey, }) =>
|
|
|
88
88
|
const { setExistentAccountData } = useAccountExistsContext();
|
|
89
89
|
const { setSocialProvider } = useSocialRedirectContext();
|
|
90
90
|
const handleBackClick = useCallback(() => {
|
|
91
|
+
var _a;
|
|
92
|
+
if ((_a = view.events) === null || _a === void 0 ? void 0 : _a.onBackClick) {
|
|
93
|
+
view.events.onBackClick();
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
91
96
|
if (view.type === 'farcaster-connect-view') {
|
|
92
97
|
setSocialProvider(undefined);
|
|
93
98
|
dynamicEvents.emit('farcasterConnectCancelled');
|
|
@@ -102,6 +107,7 @@ const Header = ({ onClose: handleClose, heading, projectSettings, copykey, }) =>
|
|
|
102
107
|
goToInitialView();
|
|
103
108
|
}, [
|
|
104
109
|
view.type,
|
|
110
|
+
view.events,
|
|
105
111
|
goToInitialView,
|
|
106
112
|
setExistentAccountData,
|
|
107
113
|
setError,
|
|
@@ -871,6 +871,48 @@ const translation = {
|
|
|
871
871
|
/**
|
|
872
872
|
* @description copy keys for merge user accounts view
|
|
873
873
|
* @default
|
|
874
|
+
* {
|
|
875
|
+
confirm_button: 'Merge accounts',
|
|
876
|
+
errors: {
|
|
877
|
+
merge_error: 'Something went wrong, please try again.',
|
|
878
|
+
},
|
|
879
|
+
same_wallet: {
|
|
880
|
+
content: 'Your wallet is currently used by 2 different accounts.',
|
|
881
|
+
title: 'Same wallet in use',
|
|
882
|
+
},
|
|
883
|
+
}
|
|
884
|
+
*/
|
|
885
|
+
dyn_merge_user_accounts: {
|
|
886
|
+
confirm_button: 'Merge accounts',
|
|
887
|
+
errors: {
|
|
888
|
+
merge_error: 'Something went wrong, please try again.',
|
|
889
|
+
},
|
|
890
|
+
same_wallet: {
|
|
891
|
+
content: 'Your wallet is currently used by 2 different accounts.',
|
|
892
|
+
title: 'Same wallet in use',
|
|
893
|
+
},
|
|
894
|
+
},
|
|
895
|
+
/**
|
|
896
|
+
* @description copy keys for merge user accounts conflicts view
|
|
897
|
+
* @default
|
|
898
|
+
* {
|
|
899
|
+
confirm_button: 'Confirm & Merge',
|
|
900
|
+
errors: {
|
|
901
|
+
merge_error: 'Something went wrong, please try again.',
|
|
902
|
+
},
|
|
903
|
+
title: 'Confirm your preferences',
|
|
904
|
+
}
|
|
905
|
+
*/
|
|
906
|
+
dyn_merge_user_accounts_conflicts: {
|
|
907
|
+
confirm_button: 'Confirm & Merge',
|
|
908
|
+
errors: {
|
|
909
|
+
merge_error: 'Something went wrong, please try again.',
|
|
910
|
+
},
|
|
911
|
+
title: 'Confirm your preferences',
|
|
912
|
+
},
|
|
913
|
+
/**
|
|
914
|
+
* @description copy keys for merge user accounts view when using email associated to a different account
|
|
915
|
+
* @default
|
|
874
916
|
* {
|
|
875
917
|
cancel_button: "No, I'll use a different email",
|
|
876
918
|
confirm_button: 'Yes, link to existing account',
|
|
@@ -880,10 +922,9 @@ const translation = {
|
|
|
880
922
|
existing_account: 'An account already exists that uses',
|
|
881
923
|
existing_account_trail: 'email.',
|
|
882
924
|
title: 'Would you like to link this wallet to this existing account?',
|
|
883
|
-
},
|
|
884
925
|
}
|
|
885
926
|
*/
|
|
886
|
-
|
|
927
|
+
dyn_merge_user_accounts_with_same_email: {
|
|
887
928
|
cancel_button: "No, I'll use a different email",
|
|
888
929
|
confirm_button: 'Yes, link to existing account',
|
|
889
930
|
errors: {
|
|
@@ -1110,7 +1151,7 @@ const translation = {
|
|
|
1110
1151
|
'Don’t get locked out if you delete your passkey or lose your device.',
|
|
1111
1152
|
input_label: 'Enter your email',
|
|
1112
1153
|
title: 'Add a recovery email',
|
|
1113
|
-
confirm_button: '
|
|
1154
|
+
confirm_button: 'Confirm with a passkey',
|
|
1114
1155
|
skip_button: 'Skip for now',
|
|
1115
1156
|
success_message: 'Recovery email added!',
|
|
1116
1157
|
},
|
|
@@ -1141,7 +1182,7 @@ const translation = {
|
|
|
1141
1182
|
description: 'Don’t get locked out if you delete your passkey or lose your device.',
|
|
1142
1183
|
input_label: 'Enter your email',
|
|
1143
1184
|
title: 'Add a recovery email',
|
|
1144
|
-
confirm_button: '
|
|
1185
|
+
confirm_button: 'Confirm with a passkey',
|
|
1145
1186
|
skip_button: 'Skip for now',
|
|
1146
1187
|
success_message: 'Recovery email added!',
|
|
1147
1188
|
},
|