@dynamic-labs/sdk-react-core 4.15.0 → 4.17.0
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 +24 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +13 -13
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +1 -0
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +1 -0
- package/src/lib/context/PasskeyContext/PasskeyContext.cjs +18 -7
- package/src/lib/context/PasskeyContext/PasskeyContext.js +18 -7
- package/src/lib/data/api/email/email.cjs +4 -4
- package/src/lib/data/api/email/email.js +4 -4
- package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.cjs +2 -2
- package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.d.ts +1 -1
- package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.js +1 -1
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +2 -3
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +1 -2
- package/src/lib/utils/hooks/useTransferWallet/useTransferWallet.cjs +2 -3
- package/src/lib/utils/hooks/useTransferWallet/useTransferWallet.js +1 -2
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +1 -2
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +1 -2
- package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.cjs +1 -0
- package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.js +1 -0
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +5 -4
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +5 -4
- package/src/lib/utils/functions/getWalletProvider/getWalletProvider.cjs +0 -21
- package/src/lib/utils/functions/getWalletProvider/getWalletProvider.d.ts +0 -3
- package/src/lib/utils/functions/getWalletProvider/getWalletProvider.js +0 -17
- package/src/lib/utils/functions/getWalletProvider/index.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.17.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.16.0...v4.17.0) (2025-05-06)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add chain id option to create kernel client in react-native ([#8650](https://github.com/dynamic-labs/dynamic-auth/issues/8650)) ([1450bea](https://github.com/dynamic-labs/dynamic-auth/commit/1450bea6f979a82ed4880700aff14fa1ead9dc60))
|
|
8
|
+
* add sendCalls method to EthereumWallet ([#8634](https://github.com/dynamic-labs/dynamic-auth/issues/8634)) ([7c9aef9](https://github.com/dynamic-labs/dynamic-auth/commit/7c9aef95382b4823a40279bebfb084de32c25610))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* 7702 do not override existing old aa ([#8630](https://github.com/dynamic-labs/dynamic-auth/issues/8630)) ([a731d9e](https://github.com/dynamic-labs/dynamic-auth/commit/a731d9e77ecd9e1dec3a7704a63989b5f2741a57))
|
|
14
|
+
* improve error message when email login fails ([#8649](https://github.com/dynamic-labs/dynamic-auth/issues/8649)) ([e1c03ac](https://github.com/dynamic-labs/dynamic-auth/commit/e1c03ac6dc83386c63d63db59d31355bc4fe2959))
|
|
15
|
+
* improve react-native stability on android ([#8652](https://github.com/dynamic-labs/dynamic-auth/issues/8652)) ([1617546](https://github.com/dynamic-labs/dynamic-auth/commit/1617546e6053c2ab32f7d385336c47df185d077f))
|
|
16
|
+
|
|
17
|
+
## [4.16.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.15.0...v4.16.0) (2025-05-03)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* (GVTY-3020) add send balance to waas sui connector ([#8638](https://github.com/dynamic-labs/dynamic-auth/issues/8638)) ([97f0af0](https://github.com/dynamic-labs/dynamic-auth/commit/97f0af0504a0079ebf0958fde1f8edc34c035927))
|
|
23
|
+
* add isAtomicSupported and isPaymasterServiceSupported methods to EthereumWallet ([#8627](https://github.com/dynamic-labs/dynamic-auth/issues/8627)) ([df82b9e](https://github.com/dynamic-labs/dynamic-auth/commit/df82b9e86eafea9dd6c505227722450bc56d7c57))
|
|
24
|
+
* add solana mpc to global wallets ([#8605](https://github.com/dynamic-labs/dynamic-auth/issues/8605)) ([6261bf9](https://github.com/dynamic-labs/dynamic-auth/commit/6261bf9bec45b1d1afa13869cf5d10cda215783e))
|
|
25
|
+
|
|
2
26
|
## [4.15.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.14.0...v4.15.0) (2025-04-30)
|
|
3
27
|
|
|
4
28
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.17.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@dynamic-labs/sdk-api-core": "0.0.660",
|
|
6
6
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
@@ -14,24 +14,24 @@
|
|
|
14
14
|
"yup": "0.32.11",
|
|
15
15
|
"react-international-phone": "4.2.5",
|
|
16
16
|
"bs58": "5.0.0",
|
|
17
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
18
|
-
"@dynamic-labs/iconic": "4.
|
|
19
|
-
"@dynamic-labs/logger": "4.
|
|
20
|
-
"@dynamic-labs/multi-wallet": "4.
|
|
21
|
-
"@dynamic-labs/rpc-providers": "4.
|
|
22
|
-
"@dynamic-labs/store": "4.
|
|
23
|
-
"@dynamic-labs/types": "4.
|
|
24
|
-
"@dynamic-labs/utils": "4.
|
|
25
|
-
"@dynamic-labs/wallet-book": "4.
|
|
26
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
17
|
+
"@dynamic-labs/assert-package-version": "4.17.0",
|
|
18
|
+
"@dynamic-labs/iconic": "4.17.0",
|
|
19
|
+
"@dynamic-labs/logger": "4.17.0",
|
|
20
|
+
"@dynamic-labs/multi-wallet": "4.17.0",
|
|
21
|
+
"@dynamic-labs/rpc-providers": "4.17.0",
|
|
22
|
+
"@dynamic-labs/store": "4.17.0",
|
|
23
|
+
"@dynamic-labs/types": "4.17.0",
|
|
24
|
+
"@dynamic-labs/utils": "4.17.0",
|
|
25
|
+
"@dynamic-labs/wallet-book": "4.17.0",
|
|
26
|
+
"@dynamic-labs/wallet-connector-core": "4.17.0",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"semver": "7.5.4"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"react": "
|
|
34
|
-
"react-dom": "
|
|
33
|
+
"react": ">=18.0.0 <20.0.0",
|
|
34
|
+
"react-dom": ">=18.0.0 <20.0.0"
|
|
35
35
|
},
|
|
36
36
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
37
37
|
"author": "Dynamic Labs, Inc.",
|
|
@@ -125,6 +125,7 @@ const TransactionStatusLayout = ({ destinationAddress, transactionValue, network
|
|
|
125
125
|
const totalFiatCost = fiatUtils.getTotalFiatCost(currentToken, transaction, nativePrice, transactionValue);
|
|
126
126
|
return (jsxRuntime.jsxs("div", { className: 'transaction-status-layout', children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, alignContent: 'bottom', children: jsxRuntime.jsx(Icon.Icon, { size: 'large', className: 'transaction-status-layout__status-icon', children: jsxRuntime.jsx(checkBlue.ReactComponent, {}) }) }), jsxRuntime.jsxs("div", { className: 'transaction-status-layout__body', children: [jsxRuntime.jsxs("div", { className: 'transaction-status-layout__sent_to', children: [jsxRuntime.jsxs(Typography.Typography, { variant: 'body_small', color: 'secondary', className: 'transaction-status-layout__title', copykey: 'dyn_send_transaction.succeeded.title', children: [t('dyn_send_transaction.succeeded.title'), ' '] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'primary', className: 'transaction-status-layout__title', copykey: 'dyn_send_transaction.succeeded.title', children: shortenWalletAddress.shortenWalletAddress(destinationAddress, 3, 3) })] }), jsxRuntime.jsx("div", { className: 'transaction-status-layout__content', children: jsxRuntime.jsx("div", { className: 'transaction-status-layout__rows', children: jsxRuntime.jsxs(Typography.Typography, { variant: 'title', color: 'primary', className: 'transaction-status-layout__title', copykey: 'dyn_send_transaction.succeeded.title', children: [`${utils.getValueRounded(isNativeToken, transaction)} ${networkCurrency} `, showFiat &&
|
|
127
127
|
(currentToken === null || currentToken === void 0 ? void 0 : currentToken.price) &&
|
|
128
|
+
totalFiatCost !== undefined &&
|
|
128
129
|
`($${Number(totalFiatCost) <= 0.01 ? '<0.01' : totalFiatCost})`] }) }) }), jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}), children: jsxRuntime.jsx("div", { className: 'transaction-confirmation__warning', children: jsxRuntime.jsx(Alert.Alert, { variant: 'info', copykey: 'dyn_send_transaction.info_message.refresh_balance_time', children: t('dyn_send_transaction.info_message.refresh_balance_time') }) }) }), jsxRuntime.jsx("div", { className: 'transaction-status-layout__transaction-link-container', children: txLink && (jsxRuntime.jsx(Typography.Typography, { as: 'a', href: txLink, target: '_blank', rel: 'noreferrer', className: 'transaction-status-layout__transaction-link-container__transaction-link', variant: 'body_small', children: t('dyn_wallet_funding.success_txn_link') })) }), jsxRuntime.jsx("div", { className: 'transaction-status-layout__actions', children: jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'small', expanded: true, onClick: onDone, loading: false, copykey: 'dyn_send_transaction.succeeded.continue_button', dataTestId: 'transaction-done-continue', children: t('dyn_send_transaction.succeeded.continue_button') }) }), displayPoweredByDynamicFooter && (jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'transaction-status-layout__footer' }))] })] }));
|
|
129
130
|
};
|
|
130
131
|
|
|
@@ -121,6 +121,7 @@ const TransactionStatusLayout = ({ destinationAddress, transactionValue, network
|
|
|
121
121
|
const totalFiatCost = getTotalFiatCost(currentToken, transaction, nativePrice, transactionValue);
|
|
122
122
|
return (jsxs("div", { className: 'transaction-status-layout', children: [jsx(ModalHeader, { trailing: closeButton, alignContent: 'bottom', children: jsx(Icon, { size: 'large', className: 'transaction-status-layout__status-icon', children: jsx(SvgCheckBlue, {}) }) }), jsxs("div", { className: 'transaction-status-layout__body', children: [jsxs("div", { className: 'transaction-status-layout__sent_to', children: [jsxs(Typography, { variant: 'body_small', color: 'secondary', className: 'transaction-status-layout__title', copykey: 'dyn_send_transaction.succeeded.title', children: [t('dyn_send_transaction.succeeded.title'), ' '] }), jsx(Typography, { variant: 'body_small', color: 'primary', className: 'transaction-status-layout__title', copykey: 'dyn_send_transaction.succeeded.title', children: shortenWalletAddress(destinationAddress, 3, 3) })] }), jsx("div", { className: 'transaction-status-layout__content', children: jsx("div", { className: 'transaction-status-layout__rows', children: jsxs(Typography, { variant: 'title', color: 'primary', className: 'transaction-status-layout__title', copykey: 'dyn_send_transaction.succeeded.title', children: [`${getValueRounded(isNativeToken, transaction)} ${networkCurrency} `, showFiat &&
|
|
123
123
|
(currentToken === null || currentToken === void 0 ? void 0 : currentToken.price) &&
|
|
124
|
+
totalFiatCost !== undefined &&
|
|
124
125
|
`($${Number(totalFiatCost) <= 0.01 ? '<0.01' : totalFiatCost})`] }) }) }), jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, {}), children: jsx("div", { className: 'transaction-confirmation__warning', children: jsx(Alert, { variant: 'info', copykey: 'dyn_send_transaction.info_message.refresh_balance_time', children: t('dyn_send_transaction.info_message.refresh_balance_time') }) }) }), jsx("div", { className: 'transaction-status-layout__transaction-link-container', children: txLink && (jsx(Typography, { as: 'a', href: txLink, target: '_blank', rel: 'noreferrer', className: 'transaction-status-layout__transaction-link-container__transaction-link', variant: 'body_small', children: t('dyn_wallet_funding.success_txn_link') })) }), jsx("div", { className: 'transaction-status-layout__actions', children: jsx(TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'small', expanded: true, onClick: onDone, loading: false, copykey: 'dyn_send_transaction.succeeded.continue_button', dataTestId: 'transaction-done-continue', children: t('dyn_send_transaction.succeeded.continue_button') }) }), displayPoweredByDynamicFooter && (jsx(PoweredByDynamic, { classNameRoot: 'transaction-status-layout__footer' }))] })] }));
|
|
125
126
|
};
|
|
126
127
|
|
|
@@ -52,7 +52,7 @@ require('../SocialRedirectContext/SocialRedirectContext.cjs');
|
|
|
52
52
|
require('../LoadingContext/LoadingContext.cjs');
|
|
53
53
|
var useEmbeddedWallet = require('../../utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs');
|
|
54
54
|
require('../WalletContext/WalletContext.cjs');
|
|
55
|
-
require('../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
|
|
55
|
+
var constants = require('../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
|
|
56
56
|
require('yup');
|
|
57
57
|
require('../MockContext/MockContext.cjs');
|
|
58
58
|
require('../../views/CollectUserDataView/useFields.cjs');
|
|
@@ -103,7 +103,7 @@ require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
|
|
|
103
103
|
const PasskeyContext = React.createContext(undefined);
|
|
104
104
|
const PasskeyContextProviderWithBrowser = ({ children, }) => {
|
|
105
105
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
106
|
-
const { userHasEmbeddedWallet } = useEmbeddedWallet.useEmbeddedWallet();
|
|
106
|
+
const { userHasEmbeddedWallet, getWalletVersion } = useEmbeddedWallet.useEmbeddedWallet();
|
|
107
107
|
const { isSessionKeyCompatible, isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet.useIsTurnkeyWallet();
|
|
108
108
|
const { environmentId, projectSettings, user } = useInternalDynamicContext.useInternalDynamicContext();
|
|
109
109
|
// state for when passkey list needs to re-render
|
|
@@ -138,12 +138,23 @@ const PasskeyContextProviderWithBrowser = ({ children, }) => {
|
|
|
138
138
|
]);
|
|
139
139
|
// It fetches user passkeys if user has embedded wallet
|
|
140
140
|
const getUserPasskeysResult = usePromise.usePromise(() => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
const walletVersion = getWalletVersion();
|
|
142
|
+
const isV1Wallet = walletVersion === constants.EmbeddedWalletVersion.V1;
|
|
143
|
+
if (isV1Wallet) {
|
|
144
|
+
const data = yield embeddedWallets.getUserPasskeys({
|
|
145
|
+
environmentId: environmentId,
|
|
146
|
+
});
|
|
147
|
+
return data.passkeys;
|
|
148
|
+
}
|
|
149
|
+
return;
|
|
145
150
|
}), {
|
|
146
|
-
deps: [
|
|
151
|
+
deps: [
|
|
152
|
+
environmentId,
|
|
153
|
+
user,
|
|
154
|
+
userHasEmbeddedWallet(),
|
|
155
|
+
passkeyEdited,
|
|
156
|
+
getWalletVersion,
|
|
157
|
+
],
|
|
147
158
|
enabled: Boolean(environmentId && user && userHasEmbeddedWallet()),
|
|
148
159
|
});
|
|
149
160
|
// Returns true if user has passkeys for current origin
|
|
@@ -48,7 +48,7 @@ import '../SocialRedirectContext/SocialRedirectContext.js';
|
|
|
48
48
|
import '../LoadingContext/LoadingContext.js';
|
|
49
49
|
import { useEmbeddedWallet } from '../../utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js';
|
|
50
50
|
import '../WalletContext/WalletContext.js';
|
|
51
|
-
import '../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
|
|
51
|
+
import { EmbeddedWalletVersion } from '../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
|
|
52
52
|
import 'yup';
|
|
53
53
|
import '../MockContext/MockContext.js';
|
|
54
54
|
import '../../views/CollectUserDataView/useFields.js';
|
|
@@ -99,7 +99,7 @@ import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
|
|
|
99
99
|
const PasskeyContext = createContext(undefined);
|
|
100
100
|
const PasskeyContextProviderWithBrowser = ({ children, }) => {
|
|
101
101
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
102
|
-
const { userHasEmbeddedWallet } = useEmbeddedWallet();
|
|
102
|
+
const { userHasEmbeddedWallet, getWalletVersion } = useEmbeddedWallet();
|
|
103
103
|
const { isSessionKeyCompatible, isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet();
|
|
104
104
|
const { environmentId, projectSettings, user } = useInternalDynamicContext();
|
|
105
105
|
// state for when passkey list needs to re-render
|
|
@@ -134,12 +134,23 @@ const PasskeyContextProviderWithBrowser = ({ children, }) => {
|
|
|
134
134
|
]);
|
|
135
135
|
// It fetches user passkeys if user has embedded wallet
|
|
136
136
|
const getUserPasskeysResult = usePromise(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
const walletVersion = getWalletVersion();
|
|
138
|
+
const isV1Wallet = walletVersion === EmbeddedWalletVersion.V1;
|
|
139
|
+
if (isV1Wallet) {
|
|
140
|
+
const data = yield getUserPasskeys({
|
|
141
|
+
environmentId: environmentId,
|
|
142
|
+
});
|
|
143
|
+
return data.passkeys;
|
|
144
|
+
}
|
|
145
|
+
return;
|
|
141
146
|
}), {
|
|
142
|
-
deps: [
|
|
147
|
+
deps: [
|
|
148
|
+
environmentId,
|
|
149
|
+
user,
|
|
150
|
+
userHasEmbeddedWallet(),
|
|
151
|
+
passkeyEdited,
|
|
152
|
+
getWalletVersion,
|
|
153
|
+
],
|
|
143
154
|
enabled: Boolean(environmentId && user && userHasEmbeddedWallet()),
|
|
144
155
|
});
|
|
145
156
|
// Returns true if user has passkeys for current origin
|
|
@@ -22,7 +22,7 @@ const createEmailVerification = (_a) => _tslib.__awaiter(void 0, [_a], void 0, f
|
|
|
22
22
|
}
|
|
23
23
|
catch (e) {
|
|
24
24
|
const data = yield utils.logResponseError(e, 'Error creating email verification');
|
|
25
|
-
throw new utils$1.EmailVerificationError(data.code);
|
|
25
|
+
throw new utils$1.EmailVerificationError(data.error, data.code);
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
const signInWithEmailVerification = (_b) => _tslib.__awaiter(void 0, [_b], void 0, function* ({ verificationToken, verificationUUID, environmentId, captchaToken, sessionPublicKey, }) {
|
|
@@ -49,7 +49,7 @@ const signInWithEmailVerification = (_b) => _tslib.__awaiter(void 0, [_b], void
|
|
|
49
49
|
if (data.error.code === 'sandbox_maximum_threshold_reached') {
|
|
50
50
|
throw new utils$1.SandboxMaximumThresholdReachedError(data.error.message);
|
|
51
51
|
}
|
|
52
|
-
throw new utils$1.EmailVerificationError(data.code);
|
|
52
|
+
throw new utils$1.EmailVerificationError(data.error, data.code);
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
const retryEmailVerification = (_c) => _tslib.__awaiter(void 0, [_c], void 0, function* ({ email, environmentId, verificationUUID, }) {
|
|
@@ -65,7 +65,7 @@ const retryEmailVerification = (_c) => _tslib.__awaiter(void 0, [_c], void 0, fu
|
|
|
65
65
|
}
|
|
66
66
|
catch (e) {
|
|
67
67
|
const data = yield utils.logResponseError(e, 'Error retrying email verification');
|
|
68
|
-
throw new utils$1.EmailVerificationError(data.code);
|
|
68
|
+
throw new utils$1.EmailVerificationError(data.error, data.code);
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
const verifyEmail = (_d) => _tslib.__awaiter(void 0, [_d], void 0, function* ({ verificationToken, verificationUUID, environmentId, }) {
|
|
@@ -87,7 +87,7 @@ const verifyEmail = (_d) => _tslib.__awaiter(void 0, [_d], void 0, function* ({
|
|
|
87
87
|
if (data.error.code === 'sandbox_maximum_threshold_reached') {
|
|
88
88
|
throw new utils$1.SandboxMaximumThresholdReachedError(data.error.message);
|
|
89
89
|
}
|
|
90
|
-
throw new utils$1.EmailVerificationError(data.code);
|
|
90
|
+
throw new utils$1.EmailVerificationError(data.error, data.code);
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
|
|
@@ -18,7 +18,7 @@ const createEmailVerification = (_a) => __awaiter(void 0, [_a], void 0, function
|
|
|
18
18
|
}
|
|
19
19
|
catch (e) {
|
|
20
20
|
const data = yield logResponseError(e, 'Error creating email verification');
|
|
21
|
-
throw new EmailVerificationError(data.code);
|
|
21
|
+
throw new EmailVerificationError(data.error, data.code);
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
const signInWithEmailVerification = (_b) => __awaiter(void 0, [_b], void 0, function* ({ verificationToken, verificationUUID, environmentId, captchaToken, sessionPublicKey, }) {
|
|
@@ -45,7 +45,7 @@ const signInWithEmailVerification = (_b) => __awaiter(void 0, [_b], void 0, func
|
|
|
45
45
|
if (data.error.code === 'sandbox_maximum_threshold_reached') {
|
|
46
46
|
throw new SandboxMaximumThresholdReachedError(data.error.message);
|
|
47
47
|
}
|
|
48
|
-
throw new EmailVerificationError(data.code);
|
|
48
|
+
throw new EmailVerificationError(data.error, data.code);
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
const retryEmailVerification = (_c) => __awaiter(void 0, [_c], void 0, function* ({ email, environmentId, verificationUUID, }) {
|
|
@@ -61,7 +61,7 @@ const retryEmailVerification = (_c) => __awaiter(void 0, [_c], void 0, function*
|
|
|
61
61
|
}
|
|
62
62
|
catch (e) {
|
|
63
63
|
const data = yield logResponseError(e, 'Error retrying email verification');
|
|
64
|
-
throw new EmailVerificationError(data.code);
|
|
64
|
+
throw new EmailVerificationError(data.error, data.code);
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
const verifyEmail = (_d) => __awaiter(void 0, [_d], void 0, function* ({ verificationToken, verificationUUID, environmentId, }) {
|
|
@@ -83,7 +83,7 @@ const verifyEmail = (_d) => __awaiter(void 0, [_d], void 0, function* ({ verific
|
|
|
83
83
|
if (data.error.code === 'sandbox_maximum_threshold_reached') {
|
|
84
84
|
throw new SandboxMaximumThresholdReachedError(data.error.message);
|
|
85
85
|
}
|
|
86
|
-
throw new EmailVerificationError(data.code);
|
|
86
|
+
throw new EmailVerificationError(data.error, data.code);
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
7
|
-
var
|
|
7
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
8
8
|
|
|
9
9
|
const specialCareWallets = ['bloctoevm', 'perawallet', 'metamaskstarknet'];
|
|
10
10
|
const showPendingConnectView = (walletConnector, pushView) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
11
|
-
const walletProvider =
|
|
11
|
+
const walletProvider = walletConnectorCore.getWalletProvider(walletConnector);
|
|
12
12
|
// We don't want to show the pending connect view for qrCode and walletConnect
|
|
13
13
|
// They have their own view with qrCode so we don't need to show the pending connect view
|
|
14
14
|
if (walletProvider === 'walletConnect' || walletProvider === 'qrCode') {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type WalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
2
2
|
import { ViewType } from '../../../../context/ViewContext';
|
|
3
3
|
export declare const showPendingConnectView: (walletConnector: WalletConnector, pushView: (view: ViewType) => void) => Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
3
|
-
import { getWalletProvider } from '
|
|
3
|
+
import { getWalletProvider } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
|
|
5
5
|
const specialCareWallets = ['bloctoevm', 'perawallet', 'metamaskstarknet'];
|
|
6
6
|
const showPendingConnectView = (walletConnector, pushView) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -28,7 +28,6 @@ var getWalletUniqueId = require('../../functions/getWalletUniqueId/getWalletUniq
|
|
|
28
28
|
require('../../../store/state/user/user.cjs');
|
|
29
29
|
var session = require('../../../data/api/session/session.cjs');
|
|
30
30
|
require('../../../locale/locale.cjs');
|
|
31
|
-
var getWalletProvider = require('../../functions/getWalletProvider/getWalletProvider.cjs');
|
|
32
31
|
var isConnectOnly = require('../authenticationHooks/helpers/isConnectOnly.cjs');
|
|
33
32
|
var getWalletConnectorForWallet = require('../../functions/getWalletConnectorForWallet/getWalletConnectorForWallet.cjs');
|
|
34
33
|
var useDebounce = require('../useDebounce/useDebounce.cjs');
|
|
@@ -209,7 +208,7 @@ const useConnectWallet = ({ authMode, enableVisitTrackingOnConnectOnly, environm
|
|
|
209
208
|
environmentId,
|
|
210
209
|
publicWalletAddress: walletAddress,
|
|
211
210
|
walletName: walletConnector.key,
|
|
212
|
-
walletProvider:
|
|
211
|
+
walletProvider: walletConnectorCore.getWalletProvider(walletConnector),
|
|
213
212
|
});
|
|
214
213
|
}
|
|
215
214
|
// On connect and sign, we don't want to add this wallet to userWallets
|
|
@@ -234,7 +233,7 @@ const useConnectWallet = ({ authMode, enableVisitTrackingOnConnectOnly, environm
|
|
|
234
233
|
}
|
|
235
234
|
else {
|
|
236
235
|
applyConnectedWalletToStore({
|
|
237
|
-
provider:
|
|
236
|
+
provider: walletConnectorCore.getWalletProvider(walletConnector),
|
|
238
237
|
walletAddress: walletAddress,
|
|
239
238
|
walletChain,
|
|
240
239
|
walletConnectorKey: walletConnector.key,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { useState, useCallback, useEffect } from 'react';
|
|
4
4
|
import { CustomError, MissingPublicAddressError } from '@dynamic-labs/utils';
|
|
5
|
-
import { getWalletConnectorByKey, logger, isHardwareWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
5
|
+
import { getWalletConnectorByKey, logger, isHardwareWalletConnector, getWalletProvider } from '@dynamic-labs/wallet-connector-core';
|
|
6
6
|
import { HardwareWalletEnum } from '@dynamic-labs/sdk-api-core';
|
|
7
7
|
import { useInternalUserWallets } from '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
8
8
|
import '../../../config/ApiEndpoint.js';
|
|
@@ -24,7 +24,6 @@ import { getWalletUniqueId } from '../../functions/getWalletUniqueId/getWalletUn
|
|
|
24
24
|
import '../../../store/state/user/user.js';
|
|
25
25
|
import { createVisit } from '../../../data/api/session/session.js';
|
|
26
26
|
import '../../../locale/locale.js';
|
|
27
|
-
import { getWalletProvider } from '../../functions/getWalletProvider/getWalletProvider.js';
|
|
28
27
|
import { isConnectOnly } from '../authenticationHooks/helpers/isConnectOnly.js';
|
|
29
28
|
import { getWalletConnectorForWallet } from '../../functions/getWalletConnectorForWallet/getWalletConnectorForWallet.js';
|
|
30
29
|
import { useDebounce } from '../useDebounce/useDebounce.js';
|
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var _tslib = require('../../../../../_virtual/_tslib.cjs');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var utils = require('@dynamic-labs/utils');
|
|
9
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
9
10
|
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
10
11
|
require('../../../store/state/loadingAndLifecycle/loadingAndLifecycle.cjs');
|
|
11
12
|
require('@dynamic-labs/sdk-api-core');
|
|
12
13
|
require('../../../shared/logger.cjs');
|
|
13
14
|
require('@dynamic-labs/iconic');
|
|
14
|
-
require('@dynamic-labs/wallet-connector-core');
|
|
15
15
|
require('react/jsx-runtime');
|
|
16
16
|
require('../../../context/ViewContext/ViewContext.cjs');
|
|
17
17
|
require('@dynamic-labs/wallet-book');
|
|
@@ -34,7 +34,6 @@ require('../../../config/ApiEndpoint.cjs');
|
|
|
34
34
|
require('../../../store/state/user/user.cjs');
|
|
35
35
|
require('../../../locale/locale.cjs');
|
|
36
36
|
var wallets = require('../../../data/api/wallets/wallets.cjs');
|
|
37
|
-
var getWalletProvider = require('../../functions/getWalletProvider/getWalletProvider.cjs');
|
|
38
37
|
require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
39
38
|
require('../../../context/VerificationContext/VerificationContext.cjs');
|
|
40
39
|
require('../../../store/state/nonce/nonce.cjs');
|
|
@@ -127,7 +126,7 @@ const useTransferWallet = () => {
|
|
|
127
126
|
throw new utils.DynamicError(errors.USER_NOT_LOGGED_IN);
|
|
128
127
|
const { overrideSiweStatement, walletConnector } = props;
|
|
129
128
|
const args = Object.assign(Object.assign({}, props), { displaySiweStatement,
|
|
130
|
-
environmentId, siweStatement: overrideSiweStatement, walletProvider:
|
|
129
|
+
environmentId, siweStatement: overrideSiweStatement, walletProvider: walletConnectorCore.getWalletProvider(walletConnector) });
|
|
131
130
|
const verifyArgs = yield getVerifyArgs.getVerifyArgs(args);
|
|
132
131
|
const userProfile = yield wallets.transferWallet(environmentId, verifyArgs);
|
|
133
132
|
if (!userProfile) {
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import { DynamicError } from '@dynamic-labs/utils';
|
|
5
|
+
import { getWalletProvider } from '@dynamic-labs/wallet-connector-core';
|
|
5
6
|
import '../../../context/DynamicContext/DynamicContext.js';
|
|
6
7
|
import '../../../store/state/loadingAndLifecycle/loadingAndLifecycle.js';
|
|
7
8
|
import '@dynamic-labs/sdk-api-core';
|
|
8
9
|
import '../../../shared/logger.js';
|
|
9
10
|
import '@dynamic-labs/iconic';
|
|
10
|
-
import '@dynamic-labs/wallet-connector-core';
|
|
11
11
|
import 'react/jsx-runtime';
|
|
12
12
|
import '../../../context/ViewContext/ViewContext.js';
|
|
13
13
|
import '@dynamic-labs/wallet-book';
|
|
@@ -30,7 +30,6 @@ import '../../../config/ApiEndpoint.js';
|
|
|
30
30
|
import '../../../store/state/user/user.js';
|
|
31
31
|
import '../../../locale/locale.js';
|
|
32
32
|
import { transferWallet } from '../../../data/api/wallets/wallets.js';
|
|
33
|
-
import { getWalletProvider } from '../../functions/getWalletProvider/getWalletProvider.js';
|
|
34
33
|
import '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
35
34
|
import '../../../context/VerificationContext/VerificationContext.js';
|
|
36
35
|
import '../../../store/state/nonce/nonce.js';
|
|
@@ -37,7 +37,6 @@ require('../../../store/state/user/user.cjs');
|
|
|
37
37
|
require('../../../locale/locale.cjs');
|
|
38
38
|
var wallets = require('../../../data/api/wallets/wallets.cjs');
|
|
39
39
|
var getSiweStatement = require('../../functions/getSiweStatement/getSiweStatement.cjs');
|
|
40
|
-
var getWalletProvider = require('../../functions/getWalletProvider/getWalletProvider.cjs');
|
|
41
40
|
var connectedWalletsInfo = require('../../../store/state/connectedWalletsInfo/connectedWalletsInfo.cjs');
|
|
42
41
|
require('../../../context/VerificationContext/VerificationContext.cjs');
|
|
43
42
|
require('../../../store/state/nonce/nonce.cjs');
|
|
@@ -273,7 +272,7 @@ const useVerifyWallet = ({ displaySiweStatement, environmentId, projectSettings,
|
|
|
273
272
|
}
|
|
274
273
|
};
|
|
275
274
|
return (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ walletConnector, getAddressOpts, publicWalletAddress, captchaToken, oauth, signedMessageOverride, messageToSignOverride, }) {
|
|
276
|
-
const walletProvider =
|
|
275
|
+
const walletProvider = walletConnectorCore.getWalletProvider(walletConnector);
|
|
277
276
|
dynamicEvents.dynamicEvents.emit('authInit', {
|
|
278
277
|
address: publicWalletAddress,
|
|
279
278
|
connectorName: walletConnector.name,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
3
3
|
import { DynamicError, StorageService, EmbeddedWalletExistsError, WalletUsedError, MergeAccountsConfirmationError, ChainalysisError, GateBlockedError, SandboxMaximumThresholdReachedError, NoAccessError, AccountExistsError } from '@dynamic-labs/utils';
|
|
4
|
-
import { isSocialWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
4
|
+
import { getWalletProvider, isSocialWalletConnector } from '@dynamic-labs/wallet-connector-core';
|
|
5
5
|
import 'react';
|
|
6
6
|
import { dynamicEvents } from '../../../events/dynamicEvents.js';
|
|
7
7
|
import '../../../context/DynamicContext/DynamicContext.js';
|
|
@@ -33,7 +33,6 @@ import '../../../store/state/user/user.js';
|
|
|
33
33
|
import '../../../locale/locale.js';
|
|
34
34
|
import { verifyWallet, linkWallet } from '../../../data/api/wallets/wallets.js';
|
|
35
35
|
import { getSiweStatement } from '../../functions/getSiweStatement/getSiweStatement.js';
|
|
36
|
-
import { getWalletProvider } from '../../functions/getWalletProvider/getWalletProvider.js';
|
|
37
36
|
import { resetConnectedWalletsInfo } from '../../../store/state/connectedWalletsInfo/connectedWalletsInfo.js';
|
|
38
37
|
import '../../../context/VerificationContext/VerificationContext.js';
|
|
39
38
|
import '../../../store/state/nonce/nonce.js';
|
|
@@ -51,6 +51,7 @@ const initializeSmartWallet = (_a) => _tslib.__awaiter(void 0, [_a], void 0, fun
|
|
|
51
51
|
properties: account.walletProperties,
|
|
52
52
|
shouldSetEoaConnector: primaryWalletId === owner.id || primaryWalletId === account.id,
|
|
53
53
|
smartWalletAddress: account.address,
|
|
54
|
+
verifiedCredentials,
|
|
54
55
|
});
|
|
55
56
|
});
|
|
56
57
|
|
|
@@ -47,6 +47,7 @@ const initializeSmartWallet = (_a) => __awaiter(void 0, [_a], void 0, function*
|
|
|
47
47
|
properties: account.walletProperties,
|
|
48
48
|
shouldSetEoaConnector: primaryWalletId === owner.id || primaryWalletId === account.id,
|
|
49
49
|
smartWalletAddress: account.address,
|
|
50
|
+
verifiedCredentials,
|
|
50
51
|
});
|
|
51
52
|
});
|
|
52
53
|
|
|
@@ -103,19 +103,20 @@ const LoginEmailForm = ({ isLoading, onSubmit, onSubmitError, currentEmail, clas
|
|
|
103
103
|
const { projectSettings } = useInternalDynamicContext.useInternalDynamicContext();
|
|
104
104
|
const { view, pushView } = ViewContext.useViewContext();
|
|
105
105
|
const { setVerificationUUID, setDisplayedDestination } = VerificationContext.useVerification();
|
|
106
|
-
const {
|
|
106
|
+
const { setError } = ErrorContext.useErrorContext();
|
|
107
107
|
const [invalidEmail, setInvalidEmail] = React.useState(false);
|
|
108
108
|
const { connectWithEmail } = useEmailProvider.useEmailProvider();
|
|
109
109
|
const handleEmailSubmitError = React.useCallback((error) => {
|
|
110
|
-
if (error.message === 'Email is not valid'
|
|
110
|
+
if (error.message === 'Email is not valid' ||
|
|
111
|
+
error.message === 'Invalid Email Address') {
|
|
111
112
|
setInvalidEmail(true);
|
|
112
113
|
}
|
|
113
114
|
else {
|
|
114
|
-
|
|
115
|
+
setError(error.message);
|
|
115
116
|
}
|
|
116
117
|
logger.logger.debug(error);
|
|
117
118
|
onSubmitError === null || onSubmitError === void 0 ? void 0 : onSubmitError();
|
|
118
|
-
}, [
|
|
119
|
+
}, [setError, onSubmitError]);
|
|
119
120
|
/** Handles the user submit event */
|
|
120
121
|
const handleSubmit = React.useCallback((emailInput) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
121
122
|
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
@@ -99,19 +99,20 @@ const LoginEmailForm = ({ isLoading, onSubmit, onSubmitError, currentEmail, clas
|
|
|
99
99
|
const { projectSettings } = useInternalDynamicContext();
|
|
100
100
|
const { view, pushView } = useViewContext();
|
|
101
101
|
const { setVerificationUUID, setDisplayedDestination } = useVerification();
|
|
102
|
-
const {
|
|
102
|
+
const { setError } = useErrorContext();
|
|
103
103
|
const [invalidEmail, setInvalidEmail] = useState(false);
|
|
104
104
|
const { connectWithEmail } = useEmailProvider();
|
|
105
105
|
const handleEmailSubmitError = useCallback((error) => {
|
|
106
|
-
if (error.message === 'Email is not valid'
|
|
106
|
+
if (error.message === 'Email is not valid' ||
|
|
107
|
+
error.message === 'Invalid Email Address') {
|
|
107
108
|
setInvalidEmail(true);
|
|
108
109
|
}
|
|
109
110
|
else {
|
|
110
|
-
|
|
111
|
+
setError(error.message);
|
|
111
112
|
}
|
|
112
113
|
logger.debug(error);
|
|
113
114
|
onSubmitError === null || onSubmitError === void 0 ? void 0 : onSubmitError();
|
|
114
|
-
}, [
|
|
115
|
+
}, [setError, onSubmitError]);
|
|
115
116
|
/** Handles the user submit event */
|
|
116
117
|
const handleSubmit = useCallback((emailInput) => __awaiter(void 0, void 0, void 0, function* () {
|
|
117
118
|
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit();
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
var utils = require('@dynamic-labs/utils');
|
|
7
|
-
|
|
8
|
-
const getWalletProvider = (connector) => {
|
|
9
|
-
if (connector.isEmbeddedWallet) {
|
|
10
|
-
return 'embeddedWallet';
|
|
11
|
-
}
|
|
12
|
-
if (connector.canConnectViaCustodialService) {
|
|
13
|
-
return 'custodialService';
|
|
14
|
-
}
|
|
15
|
-
if (connector.isInstalledOnBrowser()) {
|
|
16
|
-
return 'browserExtension';
|
|
17
|
-
}
|
|
18
|
-
return utils.isMobile() ? 'deepLink' : 'qrCode';
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
exports.getWalletProvider = getWalletProvider;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import { isMobile } from '@dynamic-labs/utils';
|
|
3
|
-
|
|
4
|
-
const getWalletProvider = (connector) => {
|
|
5
|
-
if (connector.isEmbeddedWallet) {
|
|
6
|
-
return 'embeddedWallet';
|
|
7
|
-
}
|
|
8
|
-
if (connector.canConnectViaCustodialService) {
|
|
9
|
-
return 'custodialService';
|
|
10
|
-
}
|
|
11
|
-
if (connector.isInstalledOnBrowser()) {
|
|
12
|
-
return 'browserExtension';
|
|
13
|
-
}
|
|
14
|
-
return isMobile() ? 'deepLink' : 'qrCode';
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export { getWalletProvider };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './getWalletProvider';
|