@dynamic-labs/sdk-react-core 2.0.0-alpha.26 → 2.0.0-alpha.28
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 +16 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +13 -13
- package/src/lib/components/CopyButton/CopyButton.cjs +7 -2
- package/src/lib/components/CopyButton/CopyButton.d.ts +4 -2
- package/src/lib/components/CopyButton/CopyButton.js +7 -2
- package/src/lib/components/QrCodeWrapper/QrCodeContainer/QrCodeContainer.cjs +19 -10
- package/src/lib/components/QrCodeWrapper/QrCodeContainer/QrCodeContainer.js +19 -10
- package/src/lib/context/DynamicContext/DynamicContext.cjs +2 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +3 -2
- package/src/lib/context/DynamicContext/helpers/helpers.cjs +7 -0
- package/src/lib/context/DynamicContext/helpers/helpers.d.ts +2 -0
- package/src/lib/context/DynamicContext/helpers/helpers.js +7 -1
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +11 -2
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +11 -2
- package/src/lib/locale/en/translation.cjs +7 -4
- package/src/lib/locale/en/translation.d.ts +5 -2
- package/src/lib/locale/en/translation.js +7 -4
- package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.types.d.ts +0 -15
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.cjs +1 -0
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.js +1 -0
- package/src/lib/shared/consts/index.cjs +1 -1
- package/src/lib/shared/consts/index.js +1 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.cjs +0 -1
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +0 -1
- package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.cjs +2 -2
- package/src/lib/utils/hooks/authenticationHooks/helpers/showPendingConnectView.js +2 -2
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.cjs +3 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.js +3 -0
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs +1 -0
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.js +1 -0
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js +1 -1
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _tslib = require('../../../../../../_virtual/_tslib.cjs');
|
|
6
6
|
var getWalletProvider = require('../../../functions/getWalletProvider/getWalletProvider.cjs');
|
|
7
7
|
|
|
8
|
-
const specialCareWallets = ['
|
|
8
|
+
const specialCareWallets = ['bloctoevm', 'perawallet'];
|
|
9
9
|
const showPendingConnectView = (walletConnector, setView) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
10
10
|
const walletProvider = getWalletProvider.getWalletProvider(walletConnector);
|
|
11
11
|
// We don't want to show the pending connect view for qrCode and walletConnect
|
|
@@ -15,7 +15,7 @@ const showPendingConnectView = (walletConnector, setView) => _tslib.__awaiter(vo
|
|
|
15
15
|
}
|
|
16
16
|
specialCareWallets.forEach((wallet) => {
|
|
17
17
|
if (walletConnector.key === wallet) {
|
|
18
|
-
//
|
|
18
|
+
// bloctoevm and some other wallets works different as Justin mentioned in this commit:
|
|
19
19
|
// https://github.com/dynamic-labs/DynamicAuth/commit/57233d3620611bc91439f3d4587b8516f8d16f99
|
|
20
20
|
// It needs to show the connect view before getting connected accounts
|
|
21
21
|
setView('pending-connect');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
2
2
|
import { getWalletProvider } from '../../../functions/getWalletProvider/getWalletProvider.js';
|
|
3
3
|
|
|
4
|
-
const specialCareWallets = ['
|
|
4
|
+
const specialCareWallets = ['bloctoevm', 'perawallet'];
|
|
5
5
|
const showPendingConnectView = (walletConnector, setView) => __awaiter(void 0, void 0, void 0, function* () {
|
|
6
6
|
const walletProvider = getWalletProvider(walletConnector);
|
|
7
7
|
// We don't want to show the pending connect view for qrCode and walletConnect
|
|
@@ -11,7 +11,7 @@ const showPendingConnectView = (walletConnector, setView) => __awaiter(void 0, v
|
|
|
11
11
|
}
|
|
12
12
|
specialCareWallets.forEach((wallet) => {
|
|
13
13
|
if (walletConnector.key === wallet) {
|
|
14
|
-
//
|
|
14
|
+
// bloctoevm and some other wallets works different as Justin mentioned in this commit:
|
|
15
15
|
// https://github.com/dynamic-labs/DynamicAuth/commit/57233d3620611bc91439f3d4587b8516f8d16f99
|
|
16
16
|
// It needs to show the connect view before getting connected accounts
|
|
17
17
|
setView('pending-connect');
|
|
@@ -114,6 +114,9 @@ const useSubmitPhoneNumber = ({ onSubmit, onSubmitError, country, phone, setInva
|
|
|
114
114
|
setView(view.type);
|
|
115
115
|
if (error instanceof utils.SmsVerificationError) {
|
|
116
116
|
let message = t('dyn_login.helper.phone_number_form.invalid_phone');
|
|
117
|
+
if (error.code === 'too_many_sms_verification_attempts') {
|
|
118
|
+
message = t('dyn_login.helper.phone_number_form.too_many_sms_verification_attempts');
|
|
119
|
+
}
|
|
117
120
|
// Use the code from error message if a translation for it exists
|
|
118
121
|
if (error.code &&
|
|
119
122
|
error.code in translation.translation.dyn_login.helper.phone_number_form)
|
|
@@ -110,6 +110,9 @@ const useSubmitPhoneNumber = ({ onSubmit, onSubmitError, country, phone, setInva
|
|
|
110
110
|
setView(view.type);
|
|
111
111
|
if (error instanceof SmsVerificationError) {
|
|
112
112
|
let message = t('dyn_login.helper.phone_number_form.invalid_phone');
|
|
113
|
+
if (error.code === 'too_many_sms_verification_attempts') {
|
|
114
|
+
message = t('dyn_login.helper.phone_number_form.too_many_sms_verification_attempts');
|
|
115
|
+
}
|
|
113
116
|
// Use the code from error message if a translation for it exists
|
|
114
117
|
if (error.code &&
|
|
115
118
|
error.code in translation.dyn_login.helper.phone_number_form)
|
|
@@ -23,6 +23,7 @@ const errorCodesMapping = {
|
|
|
23
23
|
0: 'The operation either timed out or was not allowed.',
|
|
24
24
|
16: 'Invalid Passkey signature. Select the passkey for this account and device.',
|
|
25
25
|
3: 'You reached the limit of passkeys for this account.',
|
|
26
|
+
5: 'Invalid Passkey signature.',
|
|
26
27
|
INSUFFICIENT_FUNDS: 'Insufficient funds for this transaction.',
|
|
27
28
|
[magicRpcError.toString()]: 'A network error has occurred. Please try again later',
|
|
28
29
|
};
|
|
@@ -19,6 +19,7 @@ const errorCodesMapping = {
|
|
|
19
19
|
0: 'The operation either timed out or was not allowed.',
|
|
20
20
|
16: 'Invalid Passkey signature. Select the passkey for this account and device.',
|
|
21
21
|
3: 'You reached the limit of passkeys for this account.',
|
|
22
|
+
5: 'Invalid Passkey signature.',
|
|
22
23
|
INSUFFICIENT_FUNDS: 'Insufficient funds for this transaction.',
|
|
23
24
|
[magicRpcError.toString()]: 'A network error has occurred. Please try again later',
|
|
24
25
|
};
|
|
@@ -84,7 +84,7 @@ const NoQrNotInstalledModalView = () => {
|
|
|
84
84
|
if (!selectedWalletConnector) {
|
|
85
85
|
return null;
|
|
86
86
|
}
|
|
87
|
-
const walletName = walletBook.getWalletBookWallet(walletBook$1, selectedWalletConnector.key).name;
|
|
87
|
+
const walletName = walletBook.getWalletBookWallet(walletBook$1, selectedWalletConnector.key, selectedWalletConnector.walletFallback).name;
|
|
88
88
|
const walletLinks = walletBook.getWalletLinks(walletBook$1, selectedWalletConnector.key);
|
|
89
89
|
const { currentDesktopUrl, userBrowser } = parseWalletLinks.parseWalletLinks(walletLinks);
|
|
90
90
|
const downloadLinks = userBrowser && currentDesktopUrl ? (jsxRuntime.jsx(WalletHelpLink.WalletHelpLink, { name: userBrowser, link: currentDesktopUrl, Icon: getBrowserIcon.getBrowserIcon(userBrowser) }, userBrowser)) : (Object.entries(walletLinks)
|
package/src/lib/widgets/DynamicWidget/prompts/NoQrNotInstalledModalView/NoQrNotInstalledModalView.js
CHANGED
|
@@ -80,7 +80,7 @@ const NoQrNotInstalledModalView = () => {
|
|
|
80
80
|
if (!selectedWalletConnector) {
|
|
81
81
|
return null;
|
|
82
82
|
}
|
|
83
|
-
const walletName = getWalletBookWallet(walletBook, selectedWalletConnector.key).name;
|
|
83
|
+
const walletName = getWalletBookWallet(walletBook, selectedWalletConnector.key, selectedWalletConnector.walletFallback).name;
|
|
84
84
|
const walletLinks = getWalletLinks(walletBook, selectedWalletConnector.key);
|
|
85
85
|
const { currentDesktopUrl, userBrowser } = parseWalletLinks(walletLinks);
|
|
86
86
|
const downloadLinks = userBrowser && currentDesktopUrl ? (jsx(WalletHelpLink, { name: userBrowser, link: currentDesktopUrl, Icon: getBrowserIcon(userBrowser) }, userBrowser)) : (Object.entries(walletLinks)
|