@dynamic-labs/sdk-react-core 3.0.0-alpha.46 → 3.0.0-alpha.48
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 +34 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +13 -13
- package/src/index.cjs +2 -2
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/lib/components/OTPVerificationView/OTPVerificationView.cjs +2 -2
- package/src/lib/components/OTPVerificationView/OTPVerificationView.d.ts +1 -0
- package/src/lib/components/OTPVerificationView/OTPVerificationView.js +2 -2
- package/src/lib/components/PinField/PinField.cjs +2 -2
- package/src/lib/components/PinField/PinField.d.ts +1 -1
- package/src/lib/components/PinField/PinField.js +2 -2
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +1 -1
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +1 -1
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +3 -3
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +3 -3
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +3 -3
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +3 -3
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +1 -1
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.cjs +1 -2
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.d.ts +1 -1
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.js +1 -2
- package/src/lib/data/api/mfa/mfa.cjs +5 -1
- package/src/lib/data/api/mfa/mfa.d.ts +2 -1
- package/src/lib/data/api/mfa/mfa.js +6 -2
- package/src/lib/locale/en/translation.cjs +3 -1
- package/src/lib/locale/en/translation.d.ts +2 -0
- package/src/lib/locale/en/translation.js +3 -1
- package/src/lib/shared/utils/functions/hasPendingRequirements/hasPendingRequirements.cjs +10 -0
- package/src/lib/shared/utils/functions/hasPendingRequirements/hasPendingRequirements.d.ts +2 -0
- package/src/lib/shared/utils/functions/hasPendingRequirements/hasPendingRequirements.js +6 -0
- package/src/lib/shared/utils/functions/hasPendingRequirements/index.d.ts +1 -0
- package/src/lib/shared/utils/functions/index.d.ts +1 -0
- package/src/lib/store/hooks/useUser/useUser.cjs +2 -4
- package/src/lib/store/hooks/useUser/useUser.js +2 -4
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/isCookieEnabled/isCookieEnabled.cjs +8 -1
- package/src/lib/utils/functions/isCookieEnabled/isCookieEnabled.js +8 -1
- package/src/lib/utils/hooks/index.d.ts +1 -1
- package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.cjs +4 -1
- package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.js +4 -1
- package/src/lib/utils/hooks/useMfa/useMfa.cjs +2 -1
- package/src/lib/utils/hooks/useMfa/useMfa.d.ts +1 -1
- package/src/lib/utils/hooks/useMfa/useMfa.js +2 -1
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +7 -13
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +7 -13
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +2 -1
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +3 -2
- package/src/lib/utils/hooks/useWalletOptions/index.d.ts +1 -0
- package/src/lib/utils/hooks/{useSelectWalletOption/useSelectWalletOption.cjs → useWalletOptions/useWalletOptions.cjs} +31 -4
- package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.d.ts +9 -0
- package/src/lib/utils/hooks/{useSelectWalletOption/useSelectWalletOption.js → useWalletOptions/useWalletOptions.js} +32 -5
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +6 -5
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +6 -5
- package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +10 -3
- package/src/lib/views/MfaVerificationView/MfaVerificationView.js +11 -4
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.cjs +20 -6
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/ManageMfaWidgetView.js +21 -7
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/components/UserDeviceTile.cjs +3 -4
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/components/UserDeviceTile.d.ts +2 -1
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/components/UserDeviceTile.js +3 -4
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/components/utils/sort.cjs +2 -8
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/components/utils/sort.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/views/ManageMfaWidgetView/components/utils/sort.js +2 -8
- package/src/lib/utils/hooks/useSelectWalletOption/index.d.ts +0 -1
- package/src/lib/utils/hooks/useSelectWalletOption/useSelectWalletOption.d.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,38 @@
|
|
|
1
1
|
|
|
2
|
+
## [3.0.0-alpha.48](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.47...v3.0.0-alpha.48) (2024-08-21)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* collect user data to work when no wallet is selected ([#6670](https://github.com/dynamic-labs/DynamicAuth/issues/6670)) ([b86aae8](https://github.com/dynamic-labs/DynamicAuth/commit/b86aae8e7ceb35793f792941a34cabd19b9e65d4))
|
|
8
|
+
* disable cookie when running on native mobile ([#6668](https://github.com/dynamic-labs/DynamicAuth/issues/6668)) ([e52a3d9](https://github.com/dynamic-labs/DynamicAuth/commit/e52a3d94a9028e36525be2e80a9f0916efad4320))
|
|
9
|
+
* prevent external auth blocking pending user requirements views ([#6669](https://github.com/dynamic-labs/DynamicAuth/issues/6669)) ([848356c](https://github.com/dynamic-labs/DynamicAuth/commit/848356c57e730a8516c642da84274a236e026f40))
|
|
10
|
+
|
|
11
|
+
## [3.0.0-alpha.47](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.46...v3.0.0-alpha.47) (2024-08-21)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### ⚠ BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* rename useSelectWalletOption to useWalletOptions (#6616)
|
|
17
|
+
* stop exposing walletConnectorOptions from dynamic context (#6622)
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* add support for base.eth ens resolution ([#6655](https://github.com/dynamic-labs/DynamicAuth/issues/6655)) ([e2fb1c0](https://github.com/dynamic-labs/DynamicAuth/commit/e2fb1c0ca8410e85b7464d032abc6686bd46149f))
|
|
22
|
+
* expose wallet options from useWalletOptions hook ([#6624](https://github.com/dynamic-labs/DynamicAuth/issues/6624)) ([7287359](https://github.com/dynamic-labs/DynamicAuth/commit/7287359d1564564b87e82bf182edef8ef02c16f1))
|
|
23
|
+
* global wallet chain switching ([#6648](https://github.com/dynamic-labs/DynamicAuth/issues/6648)) ([10179fc](https://github.com/dynamic-labs/DynamicAuth/commit/10179fcddc747977c7dd250abd78bad0ec375f8f))
|
|
24
|
+
* implement Apple Sign-In for mobile ([#6632](https://github.com/dynamic-labs/DynamicAuth/issues/6632)) ([e68b088](https://github.com/dynamic-labs/DynamicAuth/commit/e68b088b1c13c1140b43a6d0c215383455a71a4a))
|
|
25
|
+
* surface mfa rate limit error ([#6658](https://github.com/dynamic-labs/DynamicAuth/issues/6658)) ([5fbcbc2](https://github.com/dynamic-labs/DynamicAuth/commit/5fbcbc2382ebcf2721a308d8e87bc8b2b5cb38cf))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* update bottom nav border radius ([#6651](https://github.com/dynamic-labs/DynamicAuth/issues/6651)) ([79212c2](https://github.com/dynamic-labs/DynamicAuth/commit/79212c26735eb06f31655e8b98a3d9c2c8371489))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
* rename useSelectWalletOption to useWalletOptions ([#6616](https://github.com/dynamic-labs/DynamicAuth/issues/6616)) ([3850dad](https://github.com/dynamic-labs/DynamicAuth/commit/3850dad47f847ace84aadc63a84c4e62f84f7df2))
|
|
34
|
+
* stop exposing walletConnectorOptions from dynamic context ([#6622](https://github.com/dynamic-labs/DynamicAuth/issues/6622)) ([b9da7db](https://github.com/dynamic-labs/DynamicAuth/commit/b9da7dbfc4020913ba3d95ec496811e9d8ee17b8))
|
|
35
|
+
|
|
2
36
|
## [3.0.0-alpha.46](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.45...v3.0.0-alpha.46) (2024-08-19)
|
|
3
37
|
|
|
4
38
|
|
package/package.cjs
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var version = "3.0.0-alpha.
|
|
6
|
+
var version = "3.0.0-alpha.48";
|
|
7
7
|
var dependencies = {
|
|
8
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
8
|
+
"@dynamic-labs/sdk-api-core": "0.0.519",
|
|
9
9
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
10
10
|
"country-list": "2.3.0",
|
|
11
11
|
formik: "2.2.9",
|
package/package.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
var version = "3.0.0-alpha.
|
|
2
|
+
var version = "3.0.0-alpha.48";
|
|
3
3
|
var dependencies = {
|
|
4
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
4
|
+
"@dynamic-labs/sdk-api-core": "0.0.519",
|
|
5
5
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
6
6
|
"country-list": "2.3.0",
|
|
7
7
|
formik: "2.2.9",
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.48",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
7
7
|
"directory": "packages/sdk-react-core"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
10
|
+
"@dynamic-labs/sdk-api-core": "0.0.519",
|
|
11
11
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
12
12
|
"country-list": "2.3.0",
|
|
13
13
|
"formik": "2.2.9",
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"react-i18next": "13.5.0",
|
|
18
18
|
"yup": "0.32.11",
|
|
19
19
|
"react-international-phone": "4.2.5",
|
|
20
|
-
"@dynamic-labs/iconic": "3.0.0-alpha.
|
|
21
|
-
"@dynamic-labs/logger": "3.0.0-alpha.
|
|
22
|
-
"@dynamic-labs/message-transport": "3.0.0-alpha.
|
|
23
|
-
"@dynamic-labs/multi-wallet": "3.0.0-alpha.
|
|
24
|
-
"@dynamic-labs/rpc-providers": "3.0.0-alpha.
|
|
25
|
-
"@dynamic-labs/store": "3.0.0-alpha.
|
|
26
|
-
"@dynamic-labs/types": "3.0.0-alpha.
|
|
27
|
-
"@dynamic-labs/utils": "3.0.0-alpha.
|
|
28
|
-
"@dynamic-labs/viem-utils": "3.0.0-alpha.
|
|
29
|
-
"@dynamic-labs/wallet-book": "3.0.0-alpha.
|
|
30
|
-
"@dynamic-labs/wallet-connector-core": "3.0.0-alpha.
|
|
20
|
+
"@dynamic-labs/iconic": "3.0.0-alpha.48",
|
|
21
|
+
"@dynamic-labs/logger": "3.0.0-alpha.48",
|
|
22
|
+
"@dynamic-labs/message-transport": "3.0.0-alpha.48",
|
|
23
|
+
"@dynamic-labs/multi-wallet": "3.0.0-alpha.48",
|
|
24
|
+
"@dynamic-labs/rpc-providers": "3.0.0-alpha.48",
|
|
25
|
+
"@dynamic-labs/store": "3.0.0-alpha.48",
|
|
26
|
+
"@dynamic-labs/types": "3.0.0-alpha.48",
|
|
27
|
+
"@dynamic-labs/utils": "3.0.0-alpha.48",
|
|
28
|
+
"@dynamic-labs/viem-utils": "3.0.0-alpha.48",
|
|
29
|
+
"@dynamic-labs/wallet-book": "3.0.0-alpha.48",
|
|
30
|
+
"@dynamic-labs/wallet-connector-core": "3.0.0-alpha.48",
|
|
31
31
|
"eventemitter3": "5.0.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
package/src/index.cjs
CHANGED
|
@@ -150,7 +150,7 @@ var useDynamicModals = require('./lib/utils/hooks/useDynamicModals/useDynamicMod
|
|
|
150
150
|
var useMfa = require('./lib/utils/hooks/useMfa/useMfa.cjs');
|
|
151
151
|
var useTokenBalances = require('./lib/utils/hooks/useTokenBalances/useTokenBalances.cjs');
|
|
152
152
|
var useRefreshUser = require('./lib/utils/hooks/useRefreshUser/useRefreshUser.cjs');
|
|
153
|
-
var
|
|
153
|
+
var useWalletOptions = require('./lib/utils/hooks/useWalletOptions/useWalletOptions.cjs');
|
|
154
154
|
var DynamicConnectButton = require('./lib/components/DynamicConnectButton/DynamicConnectButton.cjs');
|
|
155
155
|
require('./lib/components/InlineWidget/InlineWidget.cjs');
|
|
156
156
|
var IsBrowser = require('./lib/components/IsBrowser/IsBrowser.cjs');
|
|
@@ -267,6 +267,6 @@ exports.useDynamicModals = useDynamicModals.useDynamicModals;
|
|
|
267
267
|
exports.useMfa = useMfa.useMfa;
|
|
268
268
|
exports.useTokenBalances = useTokenBalances.useTokenBalances;
|
|
269
269
|
exports.useRefreshUser = useRefreshUser.useRefreshUser;
|
|
270
|
-
exports.
|
|
270
|
+
exports.useWalletOptions = useWalletOptions.useWalletOptions;
|
|
271
271
|
exports.DynamicConnectButton = DynamicConnectButton.DynamicConnectButton;
|
|
272
272
|
exports.IsBrowser = IsBrowser.IsBrowser;
|
package/src/index.d.ts
CHANGED
|
@@ -108,7 +108,7 @@ export { FilterAndSortWallets, FilterBridgeChainsName, FilterChain, FilterWallet
|
|
|
108
108
|
export {
|
|
109
109
|
/** @deprecated */
|
|
110
110
|
DynamicWidgetContextProvider, } from './lib/widgets/DynamicWidget/context';
|
|
111
|
-
export { useWalletItemActions, useAuthenticateConnectedUser, useSocialAccounts, useEmbeddedWallet, useEmbeddedWalletAuthenticator, usePasskeyRecovery, useEmbeddedReveal, useIsLoggedIn, useDynamicModals, useMfa, useTokenBalances, useSwitchWallet, useRpcProviders, useRefreshUser,
|
|
111
|
+
export { useWalletItemActions, useAuthenticateConnectedUser, useSocialAccounts, useEmbeddedWallet, useEmbeddedWalletAuthenticator, usePasskeyRecovery, useEmbeddedReveal, useIsLoggedIn, useDynamicModals, useMfa, useTokenBalances, useSwitchWallet, useRpcProviders, useRefreshUser, useWalletOptions, EmbeddedWalletVersion, } from './lib/utils/hooks';
|
|
112
112
|
export { useUserUpdateRequest, useWalletConnectorEvent, } from './lib/utils/hooks';
|
|
113
113
|
export { type VerifyOtp, useOtpVerificationRequest, } from './lib/utils/hooks/authenticationHooks/';
|
|
114
114
|
export type { UpdateUserFieldsArg } from './lib/utils/hooks/';
|
package/src/index.js
CHANGED
|
@@ -146,7 +146,7 @@ export { useDynamicModals } from './lib/utils/hooks/useDynamicModals/useDynamicM
|
|
|
146
146
|
export { useMfa } from './lib/utils/hooks/useMfa/useMfa.js';
|
|
147
147
|
export { useTokenBalances } from './lib/utils/hooks/useTokenBalances/useTokenBalances.js';
|
|
148
148
|
export { useRefreshUser } from './lib/utils/hooks/useRefreshUser/useRefreshUser.js';
|
|
149
|
-
export {
|
|
149
|
+
export { useWalletOptions } from './lib/utils/hooks/useWalletOptions/useWalletOptions.js';
|
|
150
150
|
export { DynamicConnectButton } from './lib/components/DynamicConnectButton/DynamicConnectButton.js';
|
|
151
151
|
import './lib/components/InlineWidget/InlineWidget.js';
|
|
152
152
|
export { IsBrowser } from './lib/components/IsBrowser/IsBrowser.js';
|
|
@@ -32,7 +32,7 @@ var PinField = require('../PinField/PinField.cjs');
|
|
|
32
32
|
var RetrySendVerificationCodeSection = require('../RetrySendVerificationCodeSection/RetrySendVerificationCodeSection.cjs');
|
|
33
33
|
var Typography = require('../Typography/Typography.cjs');
|
|
34
34
|
|
|
35
|
-
const OTPVerificationView = ({ onClickBack, onClickEditDestination, isLoading, displayedDestination, description, onPinComplete, isValid, error, retryHandler, onPinChange, successBannerTextKey, MainIcon, hideHeader, appendAboveOTPInput, appendToEnd, }) => {
|
|
35
|
+
const OTPVerificationView = ({ onClickBack, onClickEditDestination, isLoading, disabled, displayedDestination, description, onPinComplete, isValid, error, retryHandler, onPinChange, successBannerTextKey, MainIcon, hideHeader, appendAboveOTPInput, appendToEnd, }) => {
|
|
36
36
|
const { t } = reactI18next.useTranslation();
|
|
37
37
|
const backButton = onClickBack && (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }));
|
|
38
38
|
const titleCopyKey = React.useMemo(() => isValid
|
|
@@ -41,7 +41,7 @@ const OTPVerificationView = ({ onClickBack, onClickEditDestination, isLoading, d
|
|
|
41
41
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!hideHeader && (jsxRuntime.jsx(ModalHeader.ModalHeader, { alignContent: 'bottom', leading: onClickBack && backButton, children: jsxRuntime.jsx("div", { className: 'otp-verification-view__status-header', children: jsxRuntime.jsx(Typography.Typography, { weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title', copykey: titleCopyKey, children: t(titleCopyKey) }) }) })), successBannerTextKey && (jsxRuntime.jsx(ModalHeaderBanner.ModalHeaderBanner, { type: 'notice', messageKey: successBannerTextKey, disableTruncate: true })), jsxRuntime.jsx(ModalHeaderBanner.ModalHeaderBanner, { type: 'error', messageKey: error === null || error === void 0 ? void 0 : error.message }), jsxRuntime.jsxs("div", { className: classNames.classNames('otp-verification-view', {
|
|
42
42
|
'otp-verification-view--message': Boolean(successBannerTextKey || error),
|
|
43
43
|
}), children: [isValid && (jsxRuntime.jsx(IconWithStatus.IconWithStatus, { Icon: MainIcon, iconSize: 64, InnerIcon: check.ReactComponent })), !isValid && (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: MainIcon, iconSize: 96, isSpinning: isLoading, className: 'otp-verification-view__icon-with-spinner', treatAsFunctionComponent: true })), jsxRuntime.jsxs("div", { className: 'otp-verification-view__body', children: [isValid && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.hang_tight', children: t('dyn_otp_verification.hang_tight') })), !isValid &&
|
|
44
|
-
(description ? (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: description })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsxRuntime.jsxs("div", { className: 'otp-verification-view__destination-container', children: [displayedDestination && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: displayedDestination })), onClickEditDestination && (jsxRuntime.jsx(IconButton.IconButton, { onClick: onClickEditDestination, "data-testid": 'otp-verification-view__edit-button', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-tertiary', children: jsxRuntime.jsx(pencilAltIcon.ReactComponent, {}) }) }))] })] })))] }), appendAboveOTPInput, jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange }), retryHandler && (jsxRuntime.jsx(RetrySendVerificationCodeSection.RetrySendVerificationCodeSection, { className: 'otp-verification-view__retry-container', retryHandler: retryHandler })), appendToEnd] })] }));
|
|
44
|
+
(description ? (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: description })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsxRuntime.jsxs("div", { className: 'otp-verification-view__destination-container', children: [displayedDestination && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: displayedDestination })), onClickEditDestination && (jsxRuntime.jsx(IconButton.IconButton, { onClick: onClickEditDestination, "data-testid": 'otp-verification-view__edit-button', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-tertiary', children: jsxRuntime.jsx(pencilAltIcon.ReactComponent, {}) }) }))] })] })))] }), appendAboveOTPInput, jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange, disabled: disabled }), retryHandler && (jsxRuntime.jsx(RetrySendVerificationCodeSection.RetrySendVerificationCodeSection, { className: 'otp-verification-view__retry-container', retryHandler: retryHandler })), appendToEnd] })] }));
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
exports.OTPVerificationView = OTPVerificationView;
|
|
@@ -28,7 +28,7 @@ import { PinField } from '../PinField/PinField.js';
|
|
|
28
28
|
import { RetrySendVerificationCodeSection } from '../RetrySendVerificationCodeSection/RetrySendVerificationCodeSection.js';
|
|
29
29
|
import { Typography } from '../Typography/Typography.js';
|
|
30
30
|
|
|
31
|
-
const OTPVerificationView = ({ onClickBack, onClickEditDestination, isLoading, displayedDestination, description, onPinComplete, isValid, error, retryHandler, onPinChange, successBannerTextKey, MainIcon, hideHeader, appendAboveOTPInput, appendToEnd, }) => {
|
|
31
|
+
const OTPVerificationView = ({ onClickBack, onClickEditDestination, isLoading, disabled, displayedDestination, description, onPinComplete, isValid, error, retryHandler, onPinChange, successBannerTextKey, MainIcon, hideHeader, appendAboveOTPInput, appendToEnd, }) => {
|
|
32
32
|
const { t } = useTranslation();
|
|
33
33
|
const backButton = onClickBack && (jsx(IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsx(SvgArrowLeft, {}) }));
|
|
34
34
|
const titleCopyKey = useMemo(() => isValid
|
|
@@ -37,7 +37,7 @@ const OTPVerificationView = ({ onClickBack, onClickEditDestination, isLoading, d
|
|
|
37
37
|
return (jsxs(Fragment, { children: [!hideHeader && (jsx(ModalHeader, { alignContent: 'bottom', leading: onClickBack && backButton, children: jsx("div", { className: 'otp-verification-view__status-header', children: jsx(Typography, { weight: 'medium', variant: 'title', color: 'primary', className: 'otp-verification-view__title', copykey: titleCopyKey, children: t(titleCopyKey) }) }) })), successBannerTextKey && (jsx(ModalHeaderBanner, { type: 'notice', messageKey: successBannerTextKey, disableTruncate: true })), jsx(ModalHeaderBanner, { type: 'error', messageKey: error === null || error === void 0 ? void 0 : error.message }), jsxs("div", { className: classNames('otp-verification-view', {
|
|
38
38
|
'otp-verification-view--message': Boolean(successBannerTextKey || error),
|
|
39
39
|
}), children: [isValid && (jsx(IconWithStatus, { Icon: MainIcon, iconSize: 64, InnerIcon: SvgCheck })), !isValid && (jsx(IconWithSpinner, { Icon: MainIcon, iconSize: 96, isSpinning: isLoading, className: 'otp-verification-view__icon-with-spinner', treatAsFunctionComponent: true })), jsxs("div", { className: 'otp-verification-view__body', children: [isValid && (jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.hang_tight', children: t('dyn_otp_verification.hang_tight') })), !isValid &&
|
|
40
|
-
(description ? (jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: description })) : (jsxs(Fragment, { children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsxs("div", { className: 'otp-verification-view__destination-container', children: [displayedDestination && (jsx(Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: displayedDestination })), onClickEditDestination && (jsx(IconButton, { onClick: onClickEditDestination, "data-testid": 'otp-verification-view__edit-button', children: jsx(Icon, { color: 'text-tertiary', children: jsx(SvgPencilAltIcon, {}) }) }))] })] })))] }), appendAboveOTPInput, jsx(PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange }), retryHandler && (jsx(RetrySendVerificationCodeSection, { className: 'otp-verification-view__retry-container', retryHandler: retryHandler })), appendToEnd] })] }));
|
|
40
|
+
(description ? (jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: description })) : (jsxs(Fragment, { children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsxs("div", { className: 'otp-verification-view__destination-container', children: [displayedDestination && (jsx(Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: displayedDestination })), onClickEditDestination && (jsx(IconButton, { onClick: onClickEditDestination, "data-testid": 'otp-verification-view__edit-button', children: jsx(Icon, { color: 'text-tertiary', children: jsx(SvgPencilAltIcon, {}) }) }))] })] })))] }), appendAboveOTPInput, jsx(PinField, { initialValue: Array(6).join('.').split('.'), isLoading: isLoading, handleComplete: onPinComplete, isValidated: isValid, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: onPinChange, disabled: disabled }), retryHandler && (jsx(RetrySendVerificationCodeSection, { className: 'otp-verification-view__retry-container', retryHandler: retryHandler })), appendToEnd] })] }));
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
export { OTPVerificationView };
|
|
@@ -8,7 +8,7 @@ var React = require('react');
|
|
|
8
8
|
var PinInput = require('../PinInput/PinInput.cjs');
|
|
9
9
|
|
|
10
10
|
const isComplete = (values) => values.every((value) => value);
|
|
11
|
-
const PinField = ({ handleComplete, initialValue, inputMode, isLoading, isValidated, pattern, type = 'number', hasError, onChange, }) => {
|
|
11
|
+
const PinField = ({ handleComplete, initialValue, inputMode, isLoading, isValidated, pattern, type = 'number', hasError, onChange, disabled, }) => {
|
|
12
12
|
const [values, setValues] = React.useState(initialValue);
|
|
13
13
|
const handleOnChange = (values) => {
|
|
14
14
|
const value = values.join('');
|
|
@@ -18,7 +18,7 @@ const PinField = ({ handleComplete, initialValue, inputMode, isLoading, isValida
|
|
|
18
18
|
handleComplete(value);
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
return (jsxRuntime.jsx("div", { className: 'pin-field__container', children: values.map((value, index) => (jsxRuntime.jsx(PinInput.PinInput, { values: values, inputIndex: index, value: value, onChange: handleOnChange, disabled: isLoading, inputMode: inputMode, isValidated: isValidated, pattern: pattern, type: type, autoFocus: true, hasError: hasError }, `pin_input_${index}`))) }));
|
|
21
|
+
return (jsxRuntime.jsx("div", { className: 'pin-field__container', children: values.map((value, index) => (jsxRuntime.jsx(PinInput.PinInput, { values: values, inputIndex: index, value: value, onChange: handleOnChange, disabled: isLoading || disabled, inputMode: inputMode, isValidated: isValidated, pattern: pattern, type: type, autoFocus: true, hasError: hasError }, `pin_input_${index}`))) }));
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
exports.PinField = PinField;
|
|
@@ -8,5 +8,5 @@ type Props = {
|
|
|
8
8
|
isValidated: boolean;
|
|
9
9
|
onChange?: (value: string) => void;
|
|
10
10
|
} & Pick<React.InputHTMLAttributes<HTMLInputElement>, PinInputElementProperties>;
|
|
11
|
-
export declare const PinField: ({ handleComplete, initialValue, inputMode, isLoading, isValidated, pattern, type, hasError, onChange, }: Props) => JSX.Element;
|
|
11
|
+
export declare const PinField: ({ handleComplete, initialValue, inputMode, isLoading, isValidated, pattern, type, hasError, onChange, disabled, }: Props) => JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -4,7 +4,7 @@ import { useState } from 'react';
|
|
|
4
4
|
import { PinInput } from '../PinInput/PinInput.js';
|
|
5
5
|
|
|
6
6
|
const isComplete = (values) => values.every((value) => value);
|
|
7
|
-
const PinField = ({ handleComplete, initialValue, inputMode, isLoading, isValidated, pattern, type = 'number', hasError, onChange, }) => {
|
|
7
|
+
const PinField = ({ handleComplete, initialValue, inputMode, isLoading, isValidated, pattern, type = 'number', hasError, onChange, disabled, }) => {
|
|
8
8
|
const [values, setValues] = useState(initialValue);
|
|
9
9
|
const handleOnChange = (values) => {
|
|
10
10
|
const value = values.join('');
|
|
@@ -14,7 +14,7 @@ const PinField = ({ handleComplete, initialValue, inputMode, isLoading, isValida
|
|
|
14
14
|
handleComplete(value);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
return (jsx("div", { className: 'pin-field__container', children: values.map((value, index) => (jsx(PinInput, { values: values, inputIndex: index, value: value, onChange: handleOnChange, disabled: isLoading, inputMode: inputMode, isValidated: isValidated, pattern: pattern, type: type, autoFocus: true, hasError: hasError }, `pin_input_${index}`))) }));
|
|
17
|
+
return (jsx("div", { className: 'pin-field__container', children: values.map((value, index) => (jsx(PinInput, { values: values, inputIndex: index, value: value, onChange: handleOnChange, disabled: isLoading || disabled, inputMode: inputMode, isValidated: isValidated, pattern: pattern, type: type, autoFocus: true, hasError: hasError }, `pin_input_${index}`))) }));
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export { PinField };
|
|
@@ -176,7 +176,7 @@ const SendBalanceForm = ({ initialValues, onSubmit, decimals = 18, validateAddre
|
|
|
176
176
|
} }), jsxRuntime.jsx("div", { className: 'send-balance-form__amount-container__floating_value', ref: floatingValueRef, children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', weight: 'regular', color: 'secondary', children: currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol }) }), jsxRuntime.jsx("div", { className: 'send-balance-form__amount-container__balance', children: showFiat && !Number.isNaN(fiatValue) && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_mini', weight: 'bold', color: 'secondary', children: "$" }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_mini', weight: 'regular', color: 'secondary', children: fiatValue < 0 || !(currentToken === null || currentToken === void 0 ? void 0 : currentToken.price)
|
|
177
177
|
? '--'
|
|
178
178
|
: utils.getDisplayFiatPrice(fiatValue, currentToken) })] })) })] }), jsxRuntime.jsx(Typography.Typography, { className: 'send-balance-form__amount_available', variant: 'body_small', weight: 'regular', color: 'secondary', as: 'div', children: jsxRuntime.jsxs("div", { style: { display: 'flex', gap: '0.225rem' }, children: [jsxRuntime.jsx(Typography.Typography, { className: 'send-balance-form__amount_available__line', variant: 'body_small', weight: 'bold', color: 'primary', as: 'div', children: (_a = roundToNthDecimal.roundToNthDecimal(currentToken === null || currentToken === void 0 ? void 0 : currentToken.balance, 6)) !== null && _a !== void 0 ? _a : 0 }), `${currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol} Available`] }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'regular', color: 'secondary', children: "Recipient Address" }), jsxRuntime.jsx(formik.Field, { className: 'send-balance-form__field', placeholder: t('dyn_send_transaction.data.recipient.placeholder'), label: t('dyn_send_transaction.data.recipient.label'), id: 'recipient', name: 'recipient', as: Input.Input, error: errors['recipient'], copykey: 'dyn_send_transaction.data.recipient.label', message: touched['recipient'] &&
|
|
179
|
-
getDisplayErrorMessage(errors, t, 'recipient') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'sendBalanceFormSubmitButton', expanded: true, type: 'submit', buttonVariant: 'primary', buttonPadding: '
|
|
179
|
+
getDisplayErrorMessage(errors, t, 'recipient') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'sendBalanceFormSubmitButton', expanded: true, type: 'submit', buttonVariant: 'primary', buttonPadding: 'small', buttonClassName: 'send-balance-form__button', copykey: 'dyn_send_transaction.preview_transaction', children: t('dyn_send_transaction.preview_transaction') })] }));
|
|
180
180
|
} }));
|
|
181
181
|
};
|
|
182
182
|
|
|
@@ -172,7 +172,7 @@ const SendBalanceForm = ({ initialValues, onSubmit, decimals = 18, validateAddre
|
|
|
172
172
|
} }), jsx("div", { className: 'send-balance-form__amount-container__floating_value', ref: floatingValueRef, children: jsx(Typography, { variant: 'title', weight: 'regular', color: 'secondary', children: currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol }) }), jsx("div", { className: 'send-balance-form__amount-container__balance', children: showFiat && !Number.isNaN(fiatValue) && (jsxs(Fragment, { children: [jsx(Typography, { variant: 'body_mini', weight: 'bold', color: 'secondary', children: "$" }), jsx(Typography, { variant: 'body_mini', weight: 'regular', color: 'secondary', children: fiatValue < 0 || !(currentToken === null || currentToken === void 0 ? void 0 : currentToken.price)
|
|
173
173
|
? '--'
|
|
174
174
|
: getDisplayFiatPrice(fiatValue, currentToken) })] })) })] }), jsx(Typography, { className: 'send-balance-form__amount_available', variant: 'body_small', weight: 'regular', color: 'secondary', as: 'div', children: jsxs("div", { style: { display: 'flex', gap: '0.225rem' }, children: [jsx(Typography, { className: 'send-balance-form__amount_available__line', variant: 'body_small', weight: 'bold', color: 'primary', as: 'div', children: (_a = roundToNthDecimal(currentToken === null || currentToken === void 0 ? void 0 : currentToken.balance, 6)) !== null && _a !== void 0 ? _a : 0 }), `${currentToken === null || currentToken === void 0 ? void 0 : currentToken.symbol} Available`] }) }), jsx(Typography, { variant: 'body_small', weight: 'regular', color: 'secondary', children: "Recipient Address" }), jsx(Field, { className: 'send-balance-form__field', placeholder: t('dyn_send_transaction.data.recipient.placeholder'), label: t('dyn_send_transaction.data.recipient.label'), id: 'recipient', name: 'recipient', as: Input, error: errors['recipient'], copykey: 'dyn_send_transaction.data.recipient.label', message: touched['recipient'] &&
|
|
175
|
-
getDisplayErrorMessage(errors, t, 'recipient') }), jsx(TypographyButton, { dataTestId: 'sendBalanceFormSubmitButton', expanded: true, type: 'submit', buttonVariant: 'primary', buttonPadding: '
|
|
175
|
+
getDisplayErrorMessage(errors, t, 'recipient') }), jsx(TypographyButton, { dataTestId: 'sendBalanceFormSubmitButton', expanded: true, type: 'submit', buttonVariant: 'primary', buttonPadding: 'small', buttonClassName: 'send-balance-form__button', copykey: 'dyn_send_transaction.preview_transaction', children: t('dyn_send_transaction.preview_transaction') })] }));
|
|
176
176
|
} }));
|
|
177
177
|
};
|
|
178
178
|
|
|
@@ -13,7 +13,7 @@ require('../../shared/logger.cjs');
|
|
|
13
13
|
require('@dynamic-labs/iconic');
|
|
14
14
|
require('@dynamic-labs/wallet-connector-core');
|
|
15
15
|
require('../../context/ViewContext/ViewContext.cjs');
|
|
16
|
-
var
|
|
16
|
+
var arrowLeft = require('../../shared/assets/arrow-left.cjs');
|
|
17
17
|
var close = require('../../shared/assets/close.cjs');
|
|
18
18
|
require('@dynamic-labs/wallet-book');
|
|
19
19
|
require('../../utils/constants/colors.cjs');
|
|
@@ -104,7 +104,7 @@ const SendBalancePageLayout = ({ error, onClickClose, onClickBack, onSubmit, dis
|
|
|
104
104
|
const { t } = reactI18next.useTranslation();
|
|
105
105
|
const { primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
|
|
106
106
|
const closeButton = onClickClose && (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: onClickClose, "data-testid": 'close-button', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
|
|
107
|
-
const backButton = onClickBack && (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsxRuntime.jsx(
|
|
107
|
+
const backButton = onClickBack && (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }));
|
|
108
108
|
const { data: balance } = usePromise.usePromise(() => transaction.getBalance(), {
|
|
109
109
|
deps: [transaction],
|
|
110
110
|
});
|
|
@@ -143,7 +143,7 @@ const SendBalancePageLayout = ({ error, onClickClose, onClickBack, onSubmit, dis
|
|
|
143
143
|
? transaction.formatNonNativeToken(transaction.nonNativeValue, transaction.nonNativeDecimal)
|
|
144
144
|
: '';
|
|
145
145
|
};
|
|
146
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, trailing: closeButton, alignContent: 'bottom', children: jsxRuntime.jsx("div", { className: 'send-balance-page-layout__header-content', children: jsxRuntime.jsx(Typography.Typography, { variant: '
|
|
146
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, trailing: closeButton, alignContent: 'bottom', children: jsxRuntime.jsx("div", { className: 'send-balance-page-layout__header-content', children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_send_transaction.data.send', children: t('dyn_send_transaction.data.send') }) }) }), jsxRuntime.jsxs("div", { className: 'send-balance-page-layout__body', children: [jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}), children: error && (jsxRuntime.jsx("div", { className: 'send-balance-page-layout__error', children: jsxRuntime.jsx(Alert.Alert, { icon: 'error', variant: 'error', children: error }) })) }), jsxRuntime.jsx(SendBalanceForm.SendBalanceForm, { fiatValue: fiatValue, setFiatValue: setFiatValue, tokenBalances: tokenBalances, setCurrentToken: setCurrentToken, isLoading: isLoading, setNativePrice: setNativePrice, onSubmit: ({ amount, recipient }) => {
|
|
147
147
|
if (isNativeToken) {
|
|
148
148
|
transaction.value = transaction.parse(amount);
|
|
149
149
|
}
|
|
@@ -9,7 +9,7 @@ import '../../shared/logger.js';
|
|
|
9
9
|
import '@dynamic-labs/iconic';
|
|
10
10
|
import '@dynamic-labs/wallet-connector-core';
|
|
11
11
|
import '../../context/ViewContext/ViewContext.js';
|
|
12
|
-
import { ReactComponent as
|
|
12
|
+
import { ReactComponent as SvgArrowLeft } from '../../shared/assets/arrow-left.js';
|
|
13
13
|
import { ReactComponent as SvgClose } from '../../shared/assets/close.js';
|
|
14
14
|
import '@dynamic-labs/wallet-book';
|
|
15
15
|
import '../../utils/constants/colors.js';
|
|
@@ -100,7 +100,7 @@ const SendBalancePageLayout = ({ error, onClickClose, onClickBack, onSubmit, dis
|
|
|
100
100
|
const { t } = useTranslation();
|
|
101
101
|
const { primaryWallet } = useInternalDynamicContext();
|
|
102
102
|
const closeButton = onClickClose && (jsx(IconButton, { type: 'button', onClick: onClickClose, "data-testid": 'close-button', children: jsx(SvgClose, {}) }));
|
|
103
|
-
const backButton = onClickBack && (jsx(IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsx(
|
|
103
|
+
const backButton = onClickBack && (jsx(IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsx(SvgArrowLeft, {}) }));
|
|
104
104
|
const { data: balance } = usePromise(() => transaction.getBalance(), {
|
|
105
105
|
deps: [transaction],
|
|
106
106
|
});
|
|
@@ -139,7 +139,7 @@ const SendBalancePageLayout = ({ error, onClickClose, onClickBack, onSubmit, dis
|
|
|
139
139
|
? transaction.formatNonNativeToken(transaction.nonNativeValue, transaction.nonNativeDecimal)
|
|
140
140
|
: '';
|
|
141
141
|
};
|
|
142
|
-
return (jsxs(Fragment, { children: [jsx(ModalHeader, { leading: backButton, trailing: closeButton, alignContent: 'bottom', children: jsx("div", { className: 'send-balance-page-layout__header-content', children: jsx(Typography, { variant: '
|
|
142
|
+
return (jsxs(Fragment, { children: [jsx(ModalHeader, { leading: backButton, trailing: closeButton, alignContent: 'bottom', children: jsx("div", { className: 'send-balance-page-layout__header-content', children: jsx(Typography, { variant: 'title', color: 'primary', copykey: 'dyn_send_transaction.data.send', children: t('dyn_send_transaction.data.send') }) }) }), jsxs("div", { className: 'send-balance-page-layout__body', children: [jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, {}), children: error && (jsx("div", { className: 'send-balance-page-layout__error', children: jsx(Alert, { icon: 'error', variant: 'error', children: error }) })) }), jsx(SendBalanceForm, { fiatValue: fiatValue, setFiatValue: setFiatValue, tokenBalances: tokenBalances, setCurrentToken: setCurrentToken, isLoading: isLoading, setNativePrice: setNativePrice, onSubmit: ({ amount, recipient }) => {
|
|
143
143
|
if (isNativeToken) {
|
|
144
144
|
transaction.value = transaction.parse(amount);
|
|
145
145
|
}
|
package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs
CHANGED
|
@@ -12,7 +12,7 @@ require('@dynamic-labs/iconic');
|
|
|
12
12
|
require('@dynamic-labs/wallet-connector-core');
|
|
13
13
|
var ViewContext = require('../../context/ViewContext/ViewContext.cjs');
|
|
14
14
|
require('react');
|
|
15
|
-
var
|
|
15
|
+
var arrowLeft = require('../../shared/assets/arrow-left.cjs');
|
|
16
16
|
var close = require('../../shared/assets/close.cjs');
|
|
17
17
|
var send = require('../../shared/assets/send.cjs');
|
|
18
18
|
require('@dynamic-labs/wallet-book');
|
|
@@ -126,10 +126,10 @@ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBac
|
|
|
126
126
|
walletConnector,
|
|
127
127
|
}, { initPasskeyRecoveryProcess, shouldInitRecovery }, { setShowAuthFlow, setView });
|
|
128
128
|
const closeButton = onClickClose && (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: onClickClose, "data-testid": 'close', disabled: isLoading, children: jsxRuntime.jsx(close.ReactComponent, {}) }));
|
|
129
|
-
const backButton = onClickBack && (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsxRuntime.jsx(
|
|
129
|
+
const backButton = onClickBack && (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }));
|
|
130
130
|
const gasFiatValue = fiatUtils.getGasFiatValue(currentToken, transaction, nativePrice);
|
|
131
131
|
const totalGasFiatValue = fiatUtils.getTotalFiatCost(currentToken, transaction, nativePrice, transactionValue);
|
|
132
|
-
return hideModal ? null : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, leading: backButton, alignContent: 'bottom', children: jsxRuntime.jsx("div", { className: 'send-balance-page-layout__header-content', children: jsxRuntime.jsx(Typography.Typography, { variant: '
|
|
132
|
+
return hideModal ? null : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, leading: backButton, alignContent: 'bottom', children: jsxRuntime.jsx("div", { className: 'send-balance-page-layout__header-content', children: jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', copykey: 'dyn_send_transaction.data.confirmation_tx', children: t('dyn_send_transaction.data.confirmation_tx') }) }) }), jsxRuntime.jsx(PasskeyCreatedSuccessBanner.PasskeyCreatedSuccessBanner, {}), jsxRuntime.jsxs("div", { className: 'transaction-confirmation__body', children: [jsxRuntime.jsxs("div", { className: 'transaction-confirmation__content', children: [jsxRuntime.jsx(TransactionCard.TransactionCard, { transaction: transaction, currentToken: currentToken, currencySymbol: currencySymbol, chainName: chainName, valueRounded: (_a = utils.getValueRounded(Boolean(isNativeToken), transaction)) === null || _a === void 0 ? void 0 : _a.toString(), showFiat: showFiat, transactionValue: transactionValue, fiatValue: fiatValue, getDisplayFiatPrice: () => utils.getDisplayFiatPrice(fiatValue, currentToken), isGasSponsored: isGasSponsored, gasFiatValue: gasFiatValue || '0', totalGasFiatValue: totalGasFiatValue || '0', currency: currency, total: total, t: t, walletKey: walletKey }), jsxRuntime.jsx("div", { className: 'transaction-confirmation__rows', children: children })] }), jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}), children: alert && (jsxRuntime.jsx("div", { className: 'transaction-confirmation__warning', children: alert })) }), jsxRuntime.jsxs("div", { className: 'transaction-confirmation__actions', children: [(onClickBack || onClickClose) && (jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'primary', buttonPadding: 'small', onClick: onClickBack || onClickClose, expanded: true, disabled: isLoading, copykey: 'dyn_send_transaction.confirmation.cancel_button', children: t('dyn_send_transaction.confirmation.cancel_button') })), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'small', onClick: handleSubmitWithChecks, expanded: true, loading: isLoading, disabled: disableSendButton, copykey: 'dyn_send_transaction.confirmation.send', startSlot:
|
|
133
133
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
134
134
|
jsxRuntime.jsx(Icon.Icon, { size: 'small', color: 'text-secondary', children: jsxRuntime.jsx(send.ReactComponent, {}) }), dataTestId: 'transaction-confirmation-send', children: t('dyn_send_transaction.confirmation.send') })] }), displayPoweredByDynamicFooter && (jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'transaction-confirmation__footer' }))] })] }));
|
|
135
135
|
};
|
package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js
CHANGED
|
@@ -8,7 +8,7 @@ import '@dynamic-labs/iconic';
|
|
|
8
8
|
import '@dynamic-labs/wallet-connector-core';
|
|
9
9
|
import { useViewContext } from '../../context/ViewContext/ViewContext.js';
|
|
10
10
|
import 'react';
|
|
11
|
-
import { ReactComponent as
|
|
11
|
+
import { ReactComponent as SvgArrowLeft } from '../../shared/assets/arrow-left.js';
|
|
12
12
|
import { ReactComponent as SvgClose } from '../../shared/assets/close.js';
|
|
13
13
|
import { ReactComponent as SvgSend } from '../../shared/assets/send.js';
|
|
14
14
|
import '@dynamic-labs/wallet-book';
|
|
@@ -122,10 +122,10 @@ const TransactionConfirmationPageLayout = ({ onClickClose, isLoading, onClickBac
|
|
|
122
122
|
walletConnector,
|
|
123
123
|
}, { initPasskeyRecoveryProcess, shouldInitRecovery }, { setShowAuthFlow, setView });
|
|
124
124
|
const closeButton = onClickClose && (jsx(IconButton, { type: 'button', onClick: onClickClose, "data-testid": 'close', disabled: isLoading, children: jsx(SvgClose, {}) }));
|
|
125
|
-
const backButton = onClickBack && (jsx(IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsx(
|
|
125
|
+
const backButton = onClickBack && (jsx(IconButton, { type: 'button', onClick: onClickBack, "data-testid": 'back-button', children: jsx(SvgArrowLeft, {}) }));
|
|
126
126
|
const gasFiatValue = getGasFiatValue(currentToken, transaction, nativePrice);
|
|
127
127
|
const totalGasFiatValue = getTotalFiatCost(currentToken, transaction, nativePrice, transactionValue);
|
|
128
|
-
return hideModal ? null : (jsxs(Fragment, { children: [jsx(ModalHeader, { trailing: closeButton, leading: backButton, alignContent: 'bottom', children: jsx("div", { className: 'send-balance-page-layout__header-content', children: jsx(Typography, { variant: '
|
|
128
|
+
return hideModal ? null : (jsxs(Fragment, { children: [jsx(ModalHeader, { trailing: closeButton, leading: backButton, alignContent: 'bottom', children: jsx("div", { className: 'send-balance-page-layout__header-content', children: jsx(Typography, { variant: 'title', color: 'primary', copykey: 'dyn_send_transaction.data.confirmation_tx', children: t('dyn_send_transaction.data.confirmation_tx') }) }) }), jsx(PasskeyCreatedSuccessBanner, {}), jsxs("div", { className: 'transaction-confirmation__body', children: [jsxs("div", { className: 'transaction-confirmation__content', children: [jsx(TransactionCard, { transaction: transaction, currentToken: currentToken, currencySymbol: currencySymbol, chainName: chainName, valueRounded: (_a = getValueRounded(Boolean(isNativeToken), transaction)) === null || _a === void 0 ? void 0 : _a.toString(), showFiat: showFiat, transactionValue: transactionValue, fiatValue: fiatValue, getDisplayFiatPrice: () => getDisplayFiatPrice(fiatValue, currentToken), isGasSponsored: isGasSponsored, gasFiatValue: gasFiatValue || '0', totalGasFiatValue: totalGasFiatValue || '0', currency: currency, total: total, t: t, walletKey: walletKey }), jsx("div", { className: 'transaction-confirmation__rows', children: children })] }), jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, {}), children: alert && (jsx("div", { className: 'transaction-confirmation__warning', children: alert })) }), jsxs("div", { className: 'transaction-confirmation__actions', children: [(onClickBack || onClickClose) && (jsx(TypographyButton, { buttonVariant: 'primary', buttonPadding: 'small', onClick: onClickBack || onClickClose, expanded: true, disabled: isLoading, copykey: 'dyn_send_transaction.confirmation.cancel_button', children: t('dyn_send_transaction.confirmation.cancel_button') })), jsx(TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: 'small', onClick: handleSubmitWithChecks, expanded: true, loading: isLoading, disabled: disableSendButton, copykey: 'dyn_send_transaction.confirmation.send', startSlot:
|
|
129
129
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
130
130
|
jsx(Icon, { size: 'small', color: 'text-secondary', children: jsx(SvgSend, {}) }), dataTestId: 'transaction-confirmation-send', children: t('dyn_send_transaction.confirmation.send') })] }), displayPoweredByDynamicFooter && (jsx(PoweredByDynamic, { classNameRoot: 'transaction-confirmation__footer' }))] })] }));
|
|
131
131
|
};
|
|
@@ -108,7 +108,7 @@ const TransactionStatusLayout = ({ destinationAddress, transactionValue, network
|
|
|
108
108
|
const totalFiatCost = fiatUtils.getTotalFiatCost(currentToken, transaction, nativePrice, transactionValue);
|
|
109
109
|
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 &&
|
|
110
110
|
(currentToken === null || currentToken === void 0 ? void 0 : currentToken.price) &&
|
|
111
|
-
`($${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__actions', children: jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: '
|
|
111
|
+
`($${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__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' }))] })] }));
|
|
112
112
|
};
|
|
113
113
|
|
|
114
114
|
exports.TransactionStatusLayout = TransactionStatusLayout;
|
|
@@ -104,7 +104,7 @@ const TransactionStatusLayout = ({ destinationAddress, transactionValue, network
|
|
|
104
104
|
const totalFiatCost = getTotalFiatCost(currentToken, transaction, nativePrice, transactionValue);
|
|
105
105
|
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 &&
|
|
106
106
|
(currentToken === null || currentToken === void 0 ? void 0 : currentToken.price) &&
|
|
107
|
-
`($${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__actions', children: jsx(TypographyButton, { buttonVariant: 'brand-primary', buttonPadding: '
|
|
107
|
+
`($${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__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' }))] })] }));
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
export { TransactionStatusLayout };
|
package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs
CHANGED
|
@@ -117,7 +117,7 @@ const UserProfileSocialAccount = ({ provider, }) => {
|
|
|
117
117
|
}, startSlot:
|
|
118
118
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
119
119
|
jsxRuntime.jsx(Icon.Icon, { color: 'text-tertiary', size: 'small', children: isProviderLinked ? jsxRuntime.jsx(unlink.ReactComponent, {}) : jsxRuntime.jsx(add.ReactComponent, {}) }), children: isProviderLinked ? null : 'Connect' }));
|
|
120
|
-
return (jsxRuntime.jsxs("div", { className: 'user-profile-social-account', "data-testid": `social-account-${provider}`, children: [jsxRuntime.jsx("div", { className: 'user-profile-social-account__icon', children: isProviderLinked ? (jsxRuntime.jsx(ConnectedAccountAvatar.ConnectedAccountAvatar, { provider: provider, avatarUrl: connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.avatar })) : (jsxRuntime.jsx(iconic.SocialIcon, { name: provider, variant: iconThemeVariant })) }), jsxRuntime.jsx(
|
|
120
|
+
return (jsxRuntime.jsxs("div", { className: 'user-profile-social-account', "data-testid": `social-account-${provider}`, children: [jsxRuntime.jsx("div", { className: 'user-profile-social-account__icon', children: isProviderLinked ? (jsxRuntime.jsx(ConnectedAccountAvatar.ConnectedAccountAvatar, { provider: provider, avatarUrl: connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.avatar })) : (jsxRuntime.jsx(iconic.SocialIcon, { name: provider, variant: iconThemeVariant })) }), jsxRuntime.jsx(Typography.Typography, { weight: 'medium', variant: 'body_normal', color: 'primary', truncate: true, className: 'user-profile-social-account__label', children: (_a = connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.publicIdentifier) !== null && _a !== void 0 ? _a : providerLabel.providerLabel(getSocialSignInProviderForProviderEnum.getSocialSignInProviderForProviderEnum(provider)) }), !isActiveCredential ? renderButton() : null] }));
|
|
121
121
|
};
|
|
122
122
|
|
|
123
123
|
exports.UserProfileSocialAccount = UserProfileSocialAccount;
|
package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js
CHANGED
|
@@ -113,7 +113,7 @@ const UserProfileSocialAccount = ({ provider, }) => {
|
|
|
113
113
|
}, startSlot:
|
|
114
114
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
115
115
|
jsx(Icon, { color: 'text-tertiary', size: 'small', children: isProviderLinked ? jsx(SvgUnlink, {}) : jsx(SvgAdd, {}) }), children: isProviderLinked ? null : 'Connect' }));
|
|
116
|
-
return (jsxs("div", { className: 'user-profile-social-account', "data-testid": `social-account-${provider}`, children: [jsx("div", { className: 'user-profile-social-account__icon', children: isProviderLinked ? (jsx(ConnectedAccountAvatar, { provider: provider, avatarUrl: connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.avatar })) : (jsx(SocialIcon, { name: provider, variant: iconThemeVariant })) }), jsx(
|
|
116
|
+
return (jsxs("div", { className: 'user-profile-social-account', "data-testid": `social-account-${provider}`, children: [jsx("div", { className: 'user-profile-social-account__icon', children: isProviderLinked ? (jsx(ConnectedAccountAvatar, { provider: provider, avatarUrl: connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.avatar })) : (jsx(SocialIcon, { name: provider, variant: iconThemeVariant })) }), jsx(Typography, { weight: 'medium', variant: 'body_normal', color: 'primary', truncate: true, className: 'user-profile-social-account__label', children: (_a = connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.publicIdentifier) !== null && _a !== void 0 ? _a : providerLabel(getSocialSignInProviderForProviderEnum(provider)) }), !isActiveCredential ? renderButton() : null] }));
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
export { UserProfileSocialAccount };
|
|
@@ -13,7 +13,7 @@ const useDynamicContext = () => {
|
|
|
13
13
|
if (context === undefined) {
|
|
14
14
|
throw new Error('useDynamicContext must be used within a DynamicContextProvider');
|
|
15
15
|
}
|
|
16
|
-
const { accountSwitchState, authMode, authToken, awaitingSignatureState, getNameService, handleLogOut, handleUnlinkWallet, loadingNetwork, locale, loginWithEmail, multiWalletWidgetState, network, networkConfigurations, qrcodeUri, sdkHasLoaded, setLogInWithEmail, setMultiWalletWidgetState, setShowAuthFlow, setShowDynamicUserProfile, setShowQrcodeModal, shadowDOMEnabled, showAuthFlow, showQrcodeModal, user, userWithMissingInfo,
|
|
16
|
+
const { accountSwitchState, authMode, authToken, awaitingSignatureState, getNameService, handleLogOut, handleUnlinkWallet, loadingNetwork, locale, loginWithEmail, multiWalletWidgetState, network, networkConfigurations, qrcodeUri, sdkHasLoaded, setLogInWithEmail, setMultiWalletWidgetState, setShowAuthFlow, setShowDynamicUserProfile, setShowQrcodeModal, shadowDOMEnabled, showAuthFlow, showQrcodeModal, user, userWithMissingInfo, bridgeChains, bridgeChainsToConnect, primaryWallet, setShowBridgeWidget, sendWagmiSettings, showDynamicUserProfile, minAuthToken, selectedTabIndex, setSelectedTabIndex, } = context;
|
|
17
17
|
const { setAuthMode } = useOverrides.useOverrides(context);
|
|
18
18
|
return {
|
|
19
19
|
accountSwitchState,
|
|
@@ -57,7 +57,6 @@ const useDynamicContext = () => {
|
|
|
57
57
|
showQrcodeModal,
|
|
58
58
|
user,
|
|
59
59
|
userWithMissingInfo,
|
|
60
|
-
walletConnectorOptions,
|
|
61
60
|
};
|
|
62
61
|
};
|
|
63
62
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import { IDynamicContext } from '../types';
|
|
3
|
-
export type UseDynamicContext = Pick<IDynamicContext, 'accountSwitchState' | 'authMode' | 'authToken' | 'awaitingSignatureState' | 'getNameService' | 'handleLogOut' | 'handleUnlinkWallet' | 'loadingNetwork' | 'locale' | 'loginWithEmail' | 'multiWalletWidgetState' | 'network' | 'networkConfigurations' | 'primaryWallet' | 'qrcodeUri' | 'sdkHasLoaded' | 'setLogInWithEmail' | 'setMultiWalletWidgetState' | 'setShowDynamicUserProfile' | 'setShowQrcodeModal' | 'shadowDOMEnabled' | 'showAuthFlow' | 'showQrcodeModal' | 'user' | 'userWithMissingInfo' | '
|
|
3
|
+
export type UseDynamicContext = Pick<IDynamicContext, 'accountSwitchState' | 'authMode' | 'authToken' | 'awaitingSignatureState' | 'getNameService' | 'handleLogOut' | 'handleUnlinkWallet' | 'loadingNetwork' | 'locale' | 'loginWithEmail' | 'multiWalletWidgetState' | 'network' | 'networkConfigurations' | 'primaryWallet' | 'qrcodeUri' | 'sdkHasLoaded' | 'setLogInWithEmail' | 'setMultiWalletWidgetState' | 'setShowDynamicUserProfile' | 'setShowQrcodeModal' | 'shadowDOMEnabled' | 'showAuthFlow' | 'showQrcodeModal' | 'user' | 'userWithMissingInfo' | 'bridgeChains' | 'bridgeChainsToConnect' | 'setShowBridgeWidget' | 'sendWagmiSettings' | 'showDynamicUserProfile' | 'setAuthMode' | 'minAuthToken' | 'selectedTabIndex' | 'setSelectedTabIndex'> & {
|
|
4
4
|
setShowAuthFlow: Dispatch<SetStateAction<boolean>>;
|
|
5
5
|
};
|
|
6
6
|
export declare const useDynamicContext: () => UseDynamicContext;
|
|
@@ -9,7 +9,7 @@ const useDynamicContext = () => {
|
|
|
9
9
|
if (context === undefined) {
|
|
10
10
|
throw new Error('useDynamicContext must be used within a DynamicContextProvider');
|
|
11
11
|
}
|
|
12
|
-
const { accountSwitchState, authMode, authToken, awaitingSignatureState, getNameService, handleLogOut, handleUnlinkWallet, loadingNetwork, locale, loginWithEmail, multiWalletWidgetState, network, networkConfigurations, qrcodeUri, sdkHasLoaded, setLogInWithEmail, setMultiWalletWidgetState, setShowAuthFlow, setShowDynamicUserProfile, setShowQrcodeModal, shadowDOMEnabled, showAuthFlow, showQrcodeModal, user, userWithMissingInfo,
|
|
12
|
+
const { accountSwitchState, authMode, authToken, awaitingSignatureState, getNameService, handleLogOut, handleUnlinkWallet, loadingNetwork, locale, loginWithEmail, multiWalletWidgetState, network, networkConfigurations, qrcodeUri, sdkHasLoaded, setLogInWithEmail, setMultiWalletWidgetState, setShowAuthFlow, setShowDynamicUserProfile, setShowQrcodeModal, shadowDOMEnabled, showAuthFlow, showQrcodeModal, user, userWithMissingInfo, bridgeChains, bridgeChainsToConnect, primaryWallet, setShowBridgeWidget, sendWagmiSettings, showDynamicUserProfile, minAuthToken, selectedTabIndex, setSelectedTabIndex, } = context;
|
|
13
13
|
const { setAuthMode } = useOverrides(context);
|
|
14
14
|
return {
|
|
15
15
|
accountSwitchState,
|
|
@@ -53,7 +53,6 @@ const useDynamicContext = () => {
|
|
|
53
53
|
showQrcodeModal,
|
|
54
54
|
user,
|
|
55
55
|
userWithMissingInfo,
|
|
56
|
-
walletConnectorOptions,
|
|
57
56
|
};
|
|
58
57
|
};
|
|
59
58
|
|
|
@@ -61,11 +61,12 @@ const updateUserMfaDevice = (_c) => _tslib.__awaiter(void 0, [_c], void 0, funct
|
|
|
61
61
|
logger.logger.error(data.error);
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
|
-
const deleteMfaDevice = (_d) => _tslib.__awaiter(void 0, [_d], void 0, function* ({ environmentId, mfaDeviceId, }) {
|
|
64
|
+
const deleteMfaDevice = (_d) => _tslib.__awaiter(void 0, [_d], void 0, function* ({ environmentId, mfaDeviceId, mfaAuthToken, }) {
|
|
65
65
|
try {
|
|
66
66
|
yield api.sdkApi().deleteMfaDevice({
|
|
67
67
|
environmentId,
|
|
68
68
|
mfaDeviceId,
|
|
69
|
+
xMfaAuthToken: mfaAuthToken,
|
|
69
70
|
});
|
|
70
71
|
}
|
|
71
72
|
catch (e) {
|
|
@@ -121,6 +122,9 @@ const authMfaDevice = (_f) => _tslib.__awaiter(void 0, [_f], void 0, function* (
|
|
|
121
122
|
if (responseError.code === 'mfa_invalid_code') {
|
|
122
123
|
throw new utils.MfaInvalidOtpError();
|
|
123
124
|
}
|
|
125
|
+
if (responseError.code === 'mfa_rate_limited') {
|
|
126
|
+
throw new utils.MfaRateLimitedError();
|
|
127
|
+
}
|
|
124
128
|
}
|
|
125
129
|
throw error;
|
|
126
130
|
}
|
|
@@ -10,9 +10,10 @@ export declare const updateUserMfaDevice: ({ environmentId, mfaDeviceId, }: {
|
|
|
10
10
|
environmentId: string;
|
|
11
11
|
mfaDeviceId: string;
|
|
12
12
|
}) => Promise<void>;
|
|
13
|
-
export declare const deleteMfaDevice: ({ environmentId, mfaDeviceId, }: {
|
|
13
|
+
export declare const deleteMfaDevice: ({ environmentId, mfaDeviceId, mfaAuthToken, }: {
|
|
14
14
|
environmentId: string;
|
|
15
15
|
mfaDeviceId: string;
|
|
16
|
+
mfaAuthToken: string;
|
|
16
17
|
}) => Promise<void>;
|
|
17
18
|
export declare const verifyMfaDevice: ({ environmentId, type, code, }: {
|
|
18
19
|
environmentId: string;
|