@dynamic-labs/sdk-react-core 0.18.0-RC.7 → 0.18.0-RC.8
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 +23 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/index.cjs +2 -0
- package/src/index.js +1 -0
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +26 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.js +26 -1
- package/src/lib/components/NetworkPicker/components/Network/Network.cjs +3 -1
- package/src/lib/components/NetworkPicker/components/Network/Network.d.ts +2 -1
- package/src/lib/components/NetworkPicker/components/Network/Network.js +3 -1
- package/src/lib/components/NetworkPicker/components/NetworkAction/NetworkAction.cjs +6 -1
- package/src/lib/components/NetworkPicker/components/NetworkAction/NetworkAction.d.ts +2 -1
- package/src/lib/components/NetworkPicker/components/NetworkAction/NetworkAction.js +6 -1
- package/src/lib/components/TosAndPp/TosAndPp.cjs +1 -1
- package/src/lib/components/TosAndPp/TosAndPp.js +1 -1
- package/src/lib/components/Transition/transition.type.d.ts +3 -3
- package/src/lib/context/DynamicContext/DynamicContext.cjs +20 -4
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +4 -1
- package/src/lib/context/DynamicContext/DynamicContext.js +21 -5
- package/src/lib/context/ErrorContext/ErrorContext.cjs +6 -0
- package/src/lib/context/ErrorContext/ErrorContext.js +6 -0
- package/src/lib/shared/utils/hooks/index.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useMediaQuery/index.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useMediaQuery/useMediaQuery.cjs +31 -0
- package/src/lib/shared/utils/hooks/useMediaQuery/useMediaQuery.d.ts +1 -0
- package/src/lib/shared/utils/hooks/useMediaQuery/useMediaQuery.js +27 -0
- 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 +1 -1
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +2 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +2 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +3 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +3 -1
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.cjs +13 -0
- package/src/lib/utils/hooks/authenticationHooks/useSignConnectOnlyUser/useSignConnectOnlyUser.js +13 -0
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useColorSchemePreference/useColorSchemePreference.cjs +16 -18
- package/src/lib/utils/hooks/useColorSchemePreference/useColorSchemePreference.js +16 -18
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +20 -6
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +14 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +20 -6
- package/src/lib/utils/hooks/useCountdown/useCountdown.cjs +39 -0
- package/src/lib/utils/hooks/useCountdown/useCountdown.d.ts +11 -0
- package/src/lib/utils/hooks/useCountdown/useCountdown.js +35 -0
- package/src/lib/utils/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.cjs +10 -0
- package/src/lib/utils/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +6 -0
- package/src/lib/utils/hooks/useKeyboardEventListener/useKeyboardEventListener.cjs +6 -8
- package/src/lib/utils/hooks/useKeyboardEventListener/useKeyboardEventListener.js +7 -9
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.cjs +6 -28
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.d.ts +0 -1
- package/src/lib/utils/hooks/useRpcProviders/useRpcProviders.js +7 -29
- package/src/lib/utils/hooks/useTimeout/useTimeout.cjs +27 -0
- package/src/lib/utils/hooks/useTimeout/useTimeout.js +23 -0
- package/src/lib/utils/hooks/useTransition/useTransition.cjs +16 -24
- package/src/lib/utils/hooks/useTransition/useTransition.d.ts +3 -3
- package/src/lib/utils/hooks/useTransition/useTransition.js +17 -25
- package/src/lib/utils/hooks/useTransitionEvents/useTransitionEvents.cjs +11 -9
- package/src/lib/utils/hooks/useTransitionEvents/useTransitionEvents.js +11 -9
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +3 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +3 -1
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +1 -0
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +1 -0
- package/src/lib/utils/hooks/useWallets/useWallets.cjs +4 -1
- package/src/lib/utils/hooks/useWallets/useWallets.d.ts +2 -1
- package/src/lib/utils/hooks/useWallets/useWallets.js +4 -1
- package/src/lib/views/EmailUpdate/EmailUpdate.cjs +2 -1
- package/src/lib/views/EmailUpdate/EmailUpdate.js +2 -1
- package/src/lib/views/EmailVerification/EmailVerification.cjs +12 -21
- package/src/lib/views/EmailVerification/EmailVerification.js +13 -22
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.cjs +2 -1
- package/src/lib/views/LoginWithEmailView/components/LoginWithEmailForm/LoginWithEmailForm.js +2 -1
- package/src/lib/views/QrCodeView/QRCode.cjs +36 -4
- package/src/lib/views/QrCodeView/QRCode.js +37 -5
- package/src/lib/views/QrCodeView/QrCodeView.cjs +3 -6
- package/src/lib/views/QrCodeView/QrCodeView.js +3 -6
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs +15 -0
- package/src/lib/views/TransactionConfirmationView/helpers/transactionErrorMessage.js +15 -0
- package/src/lib/views/WalletList/data.cjs +2 -1
- package/src/lib/views/WalletList/data.js +2 -1
|
@@ -8,6 +8,41 @@ var QRCodeUtil = require('qrcode');
|
|
|
8
8
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
9
9
|
var IconWithSpinner = require('../../components/IconWithSpinner/IconWithSpinner.cjs');
|
|
10
10
|
var QrCodeContext = require('../../context/QrCodeContext/QrCodeContext.cjs');
|
|
11
|
+
require('@dynamic-labs/utils');
|
|
12
|
+
require('@dynamic-labs/sdk-api');
|
|
13
|
+
require('../../config/ApiEndpoint.cjs');
|
|
14
|
+
require('../../shared/logger.cjs');
|
|
15
|
+
require('@dynamic-labs/iconic');
|
|
16
|
+
require('../../context/ViewContext/ViewContext.cjs');
|
|
17
|
+
require('@dynamic-labs/wallet-book');
|
|
18
|
+
require('../../utils/constants/colors.cjs');
|
|
19
|
+
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
20
|
+
require('ethers');
|
|
21
|
+
require('../../shared/consts/index.cjs');
|
|
22
|
+
require('@dynamic-labs/multi-wallet');
|
|
23
|
+
require('@dynamic-labs/rpc-providers');
|
|
24
|
+
require('../../context/DynamicContext/DynamicContext.cjs');
|
|
25
|
+
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
26
|
+
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
27
|
+
require('react-dom');
|
|
28
|
+
require('../../components/ShadowDOM/ShadowDOM.cjs');
|
|
29
|
+
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
30
|
+
require('react-focus-lock');
|
|
31
|
+
require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
32
|
+
require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
33
|
+
require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
34
|
+
require('../../components/IconButton/IconButton.cjs');
|
|
35
|
+
require('../../components/Alert/Alert.cjs');
|
|
36
|
+
require('../../components/Popper/Popper/Popper.cjs');
|
|
37
|
+
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
38
|
+
require('formik');
|
|
39
|
+
require('yup');
|
|
40
|
+
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
41
|
+
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
42
|
+
require('../../context/MockContext/MockContext.cjs');
|
|
43
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
44
|
+
var usePromise = require('../../utils/hooks/usePromise/usePromise.cjs');
|
|
45
|
+
require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
11
46
|
|
|
12
47
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
48
|
|
|
@@ -22,7 +57,7 @@ const generateMatrix = (value, errorCorrectionLevel) => {
|
|
|
22
57
|
};
|
|
23
58
|
const QRCode = ({ ecl = 'M', Icon, logoMargin = 0, logoSize = 40, size = 250, value, accentColor, walletName = undefined, }) => {
|
|
24
59
|
const { showQrCodeImage } = QrCodeContext.useQrCodeContext();
|
|
25
|
-
const
|
|
60
|
+
const { data } = usePromise.usePromise(() => QRCodeUtil__default["default"].toDataURL(value));
|
|
26
61
|
const dots = React.useMemo(() => {
|
|
27
62
|
const dots = [];
|
|
28
63
|
const matrix = generateMatrix(value || 'QR Code value', ecl);
|
|
@@ -69,9 +104,6 @@ const QRCode = ({ ecl = 'M', Icon, logoMargin = 0, logoSize = 40, size = 250, va
|
|
|
69
104
|
walletsWithoutIndicator.includes(walletConnectorCore.normalizeWalletName(walletName))
|
|
70
105
|
? undefined
|
|
71
106
|
: 'walletConnect';
|
|
72
|
-
React.useEffect(() => {
|
|
73
|
-
QRCodeUtil__default["default"].toDataURL(value).then((val) => setData(val));
|
|
74
|
-
}, []);
|
|
75
107
|
return (jsxRuntime.jsx("div", Object.assign({ className: 'qrcode__container' }, { children: jsxRuntime.jsx("div", Object.assign({ className: 'qrcode' }, { children: showQrCodeImage ? (jsxRuntime.jsx("img", { src: data, alt: '' })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("svg", Object.assign({ height: '100%', width: '100%', viewBox: `0 0 ${size} ${size}`, "data-testid": 'qr-code' }, { children: [jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", Object.assign({ id: 'clip-logo' }, { children: jsxRuntime.jsx("rect", { height: logoSize, width: logoSize, x: logoPosition, y: logoPosition, rx: 7, ry: 7 }) })) }), jsxRuntime.jsx("rect", { fill: 'none', height: size, width: size }), dots] })), jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: Icon, iconSize: logoSize, isSpinning: true, className: 'qrcode__icon', indicator: indicator })] })) })) })));
|
|
76
108
|
};
|
|
77
109
|
|
|
@@ -1,9 +1,44 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
3
|
import QRCodeUtil from 'qrcode';
|
|
4
4
|
import { normalizeWalletName } from '@dynamic-labs/wallet-connector-core';
|
|
5
5
|
import { IconWithSpinner } from '../../components/IconWithSpinner/IconWithSpinner.js';
|
|
6
6
|
import { useQrCodeContext } from '../../context/QrCodeContext/QrCodeContext.js';
|
|
7
|
+
import '@dynamic-labs/utils';
|
|
8
|
+
import '@dynamic-labs/sdk-api';
|
|
9
|
+
import '../../config/ApiEndpoint.js';
|
|
10
|
+
import '../../shared/logger.js';
|
|
11
|
+
import '@dynamic-labs/iconic';
|
|
12
|
+
import '../../context/ViewContext/ViewContext.js';
|
|
13
|
+
import '@dynamic-labs/wallet-book';
|
|
14
|
+
import '../../utils/constants/colors.js';
|
|
15
|
+
import '../../shared/utils/classes/storage/localStorage.js';
|
|
16
|
+
import 'ethers';
|
|
17
|
+
import '../../shared/consts/index.js';
|
|
18
|
+
import '@dynamic-labs/multi-wallet';
|
|
19
|
+
import '@dynamic-labs/rpc-providers';
|
|
20
|
+
import '../../context/DynamicContext/DynamicContext.js';
|
|
21
|
+
import '../../context/ErrorContext/ErrorContext.js';
|
|
22
|
+
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
23
|
+
import 'react-dom';
|
|
24
|
+
import '../../components/ShadowDOM/ShadowDOM.js';
|
|
25
|
+
import '../../context/ThemeContext/ThemeContext.js';
|
|
26
|
+
import 'react-focus-lock';
|
|
27
|
+
import '../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
28
|
+
import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
29
|
+
import '../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
30
|
+
import '../../components/IconButton/IconButton.js';
|
|
31
|
+
import '../../components/Alert/Alert.js';
|
|
32
|
+
import '../../components/Popper/Popper/Popper.js';
|
|
33
|
+
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
34
|
+
import 'formik';
|
|
35
|
+
import 'yup';
|
|
36
|
+
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
37
|
+
import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
38
|
+
import '../../context/MockContext/MockContext.js';
|
|
39
|
+
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
40
|
+
import { usePromise } from '../../utils/hooks/usePromise/usePromise.js';
|
|
41
|
+
import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
7
42
|
|
|
8
43
|
const generateMatrix = (value, errorCorrectionLevel) => {
|
|
9
44
|
const arr = Array.prototype.slice.call(QRCodeUtil.create(value, { errorCorrectionLevel }).modules.data, 0);
|
|
@@ -14,7 +49,7 @@ const generateMatrix = (value, errorCorrectionLevel) => {
|
|
|
14
49
|
};
|
|
15
50
|
const QRCode = ({ ecl = 'M', Icon, logoMargin = 0, logoSize = 40, size = 250, value, accentColor, walletName = undefined, }) => {
|
|
16
51
|
const { showQrCodeImage } = useQrCodeContext();
|
|
17
|
-
const
|
|
52
|
+
const { data } = usePromise(() => QRCodeUtil.toDataURL(value));
|
|
18
53
|
const dots = useMemo(() => {
|
|
19
54
|
const dots = [];
|
|
20
55
|
const matrix = generateMatrix(value || 'QR Code value', ecl);
|
|
@@ -61,9 +96,6 @@ const QRCode = ({ ecl = 'M', Icon, logoMargin = 0, logoSize = 40, size = 250, va
|
|
|
61
96
|
walletsWithoutIndicator.includes(normalizeWalletName(walletName))
|
|
62
97
|
? undefined
|
|
63
98
|
: 'walletConnect';
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
QRCodeUtil.toDataURL(value).then((val) => setData(val));
|
|
66
|
-
}, []);
|
|
67
99
|
return (jsx("div", Object.assign({ className: 'qrcode__container' }, { children: jsx("div", Object.assign({ className: 'qrcode' }, { children: showQrCodeImage ? (jsx("img", { src: data, alt: '' })) : (jsxs(Fragment, { children: [jsxs("svg", Object.assign({ height: '100%', width: '100%', viewBox: `0 0 ${size} ${size}`, "data-testid": 'qr-code' }, { children: [jsx("defs", { children: jsx("clipPath", Object.assign({ id: 'clip-logo' }, { children: jsx("rect", { height: logoSize, width: logoSize, x: logoPosition, y: logoPosition, rx: 7, ry: 7 }) })) }), jsx("rect", { fill: 'none', height: size, width: size }), dots] })), jsx(IconWithSpinner, { Icon: Icon, iconSize: logoSize, isSpinning: true, className: 'qrcode__icon', indicator: indicator })] })) })) })));
|
|
68
100
|
};
|
|
69
101
|
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var React = require('react');
|
|
7
6
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
8
7
|
var ThemeContext = require('../../context/ThemeContext/ThemeContext.cjs');
|
|
9
8
|
var useInternalDynamicContext = require('../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
9
|
+
require('react');
|
|
10
10
|
require('@dynamic-labs/sdk-api');
|
|
11
11
|
require('../../shared/logger.cjs');
|
|
12
12
|
require('@dynamic-labs/iconic');
|
|
@@ -37,6 +37,7 @@ require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/Secondar
|
|
|
37
37
|
require('../../context/MockContext/MockContext.cjs');
|
|
38
38
|
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
39
39
|
require('../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.cjs');
|
|
40
|
+
var useTimeout = require('../../utils/hooks/useTimeout/useTimeout.cjs');
|
|
40
41
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
41
42
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
42
43
|
require('formik');
|
|
@@ -51,11 +52,7 @@ const QrCodeView = () => {
|
|
|
51
52
|
const { setShowQrCodeMessage } = QrCodeContext.useQrCodeContext();
|
|
52
53
|
const { qrcodeUri, desktopUri, selectedWalletConnector: walletConnector, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
53
54
|
const { walletBook: walletBook$1 } = walletBook.useWalletBookContext();
|
|
54
|
-
|
|
55
|
-
setTimeout(() => {
|
|
56
|
-
setShowQrCodeMessage(true);
|
|
57
|
-
}, 5000);
|
|
58
|
-
}, [setShowQrCodeMessage]);
|
|
55
|
+
useTimeout.useTimeout(() => setShowQrCodeMessage(true), 5000);
|
|
59
56
|
if (!walletConnector) {
|
|
60
57
|
return null;
|
|
61
58
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
2
|
import { useWalletBookContext, WalletIcon, getWalletPrimaryColor } from '@dynamic-labs/wallet-book';
|
|
4
3
|
import { useThemeContext } from '../../context/ThemeContext/ThemeContext.js';
|
|
5
4
|
import { useInternalDynamicContext } from '../../context/DynamicContext/useInternalDynamicContext.js';
|
|
5
|
+
import 'react';
|
|
6
6
|
import '@dynamic-labs/sdk-api';
|
|
7
7
|
import '../../shared/logger.js';
|
|
8
8
|
import '@dynamic-labs/iconic';
|
|
@@ -33,6 +33,7 @@ import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/Secondary
|
|
|
33
33
|
import '../../context/MockContext/MockContext.js';
|
|
34
34
|
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
35
35
|
import '../../utils/hooks/useUserUpdateRequest/useUserUpdateRequest.js';
|
|
36
|
+
import { useTimeout } from '../../utils/hooks/useTimeout/useTimeout.js';
|
|
36
37
|
import '../../components/Popper/Popper/Popper.js';
|
|
37
38
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
38
39
|
import 'formik';
|
|
@@ -47,11 +48,7 @@ const QrCodeView = () => {
|
|
|
47
48
|
const { setShowQrCodeMessage } = useQrCodeContext();
|
|
48
49
|
const { qrcodeUri, desktopUri, selectedWalletConnector: walletConnector, } = useInternalDynamicContext();
|
|
49
50
|
const { walletBook } = useWalletBookContext();
|
|
50
|
-
|
|
51
|
-
setTimeout(() => {
|
|
52
|
-
setShowQrCodeMessage(true);
|
|
53
|
-
}, 5000);
|
|
54
|
-
}, [setShowQrCodeMessage]);
|
|
51
|
+
useTimeout(() => setShowQrCodeMessage(true), 5000);
|
|
55
52
|
if (!walletConnector) {
|
|
56
53
|
return null;
|
|
57
54
|
}
|
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('@dynamic-labs/sdk-api');
|
|
6
|
+
var logger = require('../../../shared/logger.cjs');
|
|
7
|
+
require('@dynamic-labs/iconic');
|
|
8
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
9
|
+
require('react/jsx-runtime');
|
|
10
|
+
require('../../../context/ViewContext/ViewContext.cjs');
|
|
11
|
+
require('react');
|
|
12
|
+
require('@dynamic-labs/wallet-book');
|
|
13
|
+
require('@dynamic-labs/utils');
|
|
14
|
+
require('../../../utils/constants/colors.cjs');
|
|
15
|
+
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
16
|
+
require('ethers');
|
|
17
|
+
require('../../../shared/consts/index.cjs');
|
|
18
|
+
|
|
5
19
|
const errorCodesMapping = {
|
|
6
20
|
'-32603': 'Could not replace existing transaction',
|
|
7
21
|
INSUFFICIENT_FUNDS: 'Insufficient funds for this transaction.',
|
|
@@ -10,6 +24,7 @@ const errorReasonsMapping = {
|
|
|
10
24
|
'provided ENS name resolves to null': 'Invalid address. Please check that the entered address is correct.',
|
|
11
25
|
};
|
|
12
26
|
const transactionErrorMessage = (error) => {
|
|
27
|
+
logger.logger.debug('transaction error]:', error);
|
|
13
28
|
const { code } = error;
|
|
14
29
|
const defaultMessage = 'Something went wrong.';
|
|
15
30
|
if (!code)
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
import '@dynamic-labs/sdk-api';
|
|
2
|
+
import { logger } from '../../../shared/logger.js';
|
|
3
|
+
import '@dynamic-labs/iconic';
|
|
4
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
5
|
+
import 'react/jsx-runtime';
|
|
6
|
+
import '../../../context/ViewContext/ViewContext.js';
|
|
7
|
+
import 'react';
|
|
8
|
+
import '@dynamic-labs/wallet-book';
|
|
9
|
+
import '@dynamic-labs/utils';
|
|
10
|
+
import '../../../utils/constants/colors.js';
|
|
11
|
+
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
12
|
+
import 'ethers';
|
|
13
|
+
import '../../../shared/consts/index.js';
|
|
14
|
+
|
|
1
15
|
const errorCodesMapping = {
|
|
2
16
|
'-32603': 'Could not replace existing transaction',
|
|
3
17
|
INSUFFICIENT_FUNDS: 'Insufficient funds for this transaction.',
|
|
@@ -6,6 +20,7 @@ const errorReasonsMapping = {
|
|
|
6
20
|
'provided ENS name resolves to null': 'Invalid address. Please check that the entered address is correct.',
|
|
7
21
|
};
|
|
8
22
|
const transactionErrorMessage = (error) => {
|
|
23
|
+
logger.debug('transaction error]:', error);
|
|
9
24
|
const { code } = error;
|
|
10
25
|
const defaultMessage = 'Something went wrong.';
|
|
11
26
|
if (!code)
|
|
@@ -26,7 +26,8 @@ const createWallets = (props) => {
|
|
|
26
26
|
var _a, _b, _c, _d;
|
|
27
27
|
return multiWallet.getEnabledWallets({
|
|
28
28
|
enabledChains: getEnabledChains(props.settings.chains),
|
|
29
|
-
getSupportedWalletOpts: Object.assign(Object.assign({}, props.getSupportedWalletOpts), { chainRpcProviders: rpcProviders.ChainRpcProviders, isWalletConnectV2Enabled:
|
|
29
|
+
getSupportedWalletOpts: Object.assign(Object.assign({}, props.getSupportedWalletOpts), { chainRpcProviders: rpcProviders.ChainRpcProviders, isWalletConnectV2Enabled: !props.getSupportedWalletOpts.walletConnectV1Bridge &&
|
|
30
|
+
((_a = props.settings.sdk.walletConnect) === null || _a === void 0 ? void 0 : _a.v2Enabled) &&
|
|
30
31
|
((_b = props.settings.sdk.walletConnect) === null || _b === void 0 ? void 0 : _b.projectId)
|
|
31
32
|
? (_c = props.settings.sdk.walletConnect) === null || _c === void 0 ? void 0 : _c.v2Enabled
|
|
32
33
|
: false, walletConnectProjectId: (_d = props.settings.sdk.walletConnect) === null || _d === void 0 ? void 0 : _d.projectId }),
|
|
@@ -22,7 +22,8 @@ const createWallets = (props) => {
|
|
|
22
22
|
var _a, _b, _c, _d;
|
|
23
23
|
return getEnabledWallets({
|
|
24
24
|
enabledChains: getEnabledChains(props.settings.chains),
|
|
25
|
-
getSupportedWalletOpts: Object.assign(Object.assign({}, props.getSupportedWalletOpts), { chainRpcProviders: ChainRpcProviders, isWalletConnectV2Enabled:
|
|
25
|
+
getSupportedWalletOpts: Object.assign(Object.assign({}, props.getSupportedWalletOpts), { chainRpcProviders: ChainRpcProviders, isWalletConnectV2Enabled: !props.getSupportedWalletOpts.walletConnectV1Bridge &&
|
|
26
|
+
((_a = props.settings.sdk.walletConnect) === null || _a === void 0 ? void 0 : _a.v2Enabled) &&
|
|
26
27
|
((_b = props.settings.sdk.walletConnect) === null || _b === void 0 ? void 0 : _b.projectId)
|
|
27
28
|
? (_c = props.settings.sdk.walletConnect) === null || _c === void 0 ? void 0 : _c.v2Enabled
|
|
28
29
|
: false, walletConnectProjectId: (_d = props.settings.sdk.walletConnect) === null || _d === void 0 ? void 0 : _d.projectId }),
|