@dynamic-labs/sdk-react-core 4.6.2 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +12 -12
- package/src/lib/Main.cjs +1 -1
- package/src/lib/Main.js +1 -1
- package/src/lib/components/BaseButton/BaseButton.cjs +20 -0
- package/src/lib/components/BaseButton/BaseButton.d.ts +21 -0
- package/src/lib/components/BaseButton/BaseButton.js +16 -0
- package/src/lib/components/BaseButton/index.d.ts +1 -0
- package/src/lib/components/Button/Button.cjs +5 -1
- package/src/lib/components/Button/Button.d.ts +6 -7
- package/src/lib/components/Button/Button.js +5 -1
- package/src/lib/components/NetworkPicker/components/NetworkSwitchControl/NetworkSwitchControl.cjs +2 -2
- package/src/lib/components/NetworkPicker/components/NetworkSwitchControl/NetworkSwitchControl.js +2 -2
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +1 -0
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +2 -1
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.cjs +2 -2
- package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.js +2 -2
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +2 -2
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +2 -2
- package/src/lib/locale/en/translation.cjs +10 -0
- package/src/lib/locale/en/translation.d.ts +10 -0
- package/src/lib/locale/en/translation.js +10 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/localStorage.cjs +2 -0
- package/src/lib/utils/constants/localStorage.d.ts +1 -0
- package/src/lib/utils/constants/localStorage.js +2 -1
- package/src/lib/utils/functions/generateMessages/index.cjs +1 -1
- package/src/lib/utils/functions/generateMessages/index.js +1 -1
- package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.cjs +2 -2
- package/src/lib/utils/functions/getVerifyArgs/getVerifyArgs.js +2 -2
- package/src/lib/utils/functions/index.d.ts +0 -1
- package/src/lib/utils/functions/isSupportedNetwork/isSupportedNetwork.cjs +1 -3
- package/src/lib/utils/functions/isSupportedNetwork/isSupportedNetwork.d.ts +2 -1
- package/src/lib/utils/functions/isSupportedNetwork/isSupportedNetwork.js +1 -3
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +1 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +4 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.d.ts +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +4 -1
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +1 -1
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +1 -1
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +4 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +4 -0
- package/src/lib/utils/hooks/useNetworkDataFromWallet/useNetworkDataFromWallet.cjs +4 -96
- package/src/lib/utils/hooks/useNetworkDataFromWallet/useNetworkDataFromWallet.js +4 -96
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.cjs +32 -19
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.d.ts +2 -2
- package/src/lib/utils/hooks/useTokenBalances/useTokenBalances.js +31 -18
- package/src/lib/utils/hooks/useTransactionSimulation/classes/useSVMTransactionSimulation.cjs +1 -1
- package/src/lib/utils/hooks/useTransactionSimulation/classes/useSVMTransactionSimulation.js +1 -1
- package/src/lib/utils/hooks/useWalletConnectorNetwork/useWalletConnectorNetwork.cjs +2 -2
- package/src/lib/utils/hooks/useWalletConnectorNetwork/useWalletConnectorNetwork.js +2 -2
- package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.cjs +12 -16
- package/src/lib/utils/hooks/useWalletConnectors/utils/smartWallet/smartWallet.js +13 -17
- package/src/lib/utils/types/ButtonAriaProps.d.ts +5 -0
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +3 -1
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +3 -1
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +2 -2
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +2 -2
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +1 -1
- package/src/lib/views/SendBalanceView/SendBalanceView.js +1 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +1 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +1 -1
- package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.cjs +130 -0
- package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.d.ts +3 -0
- package/src/lib/views/UserDeleteAccountView/UserDeleteAccountView.js +125 -0
- package/src/lib/views/UserDeleteAccountView/index.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.cjs +2 -0
- package/src/lib/views/viewToComponentMap.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.cjs +20 -8
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletAddress/ActiveWalletAddress.js +21 -9
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.js +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.cjs +6 -16
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js +6 -16
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.cjs +13 -4
- package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.js +13 -4
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +18 -6
- package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +19 -7
- package/src/lib/shared/assets/gear.cjs +0 -54
- package/src/lib/shared/assets/gear.js +0 -30
- package/src/lib/utils/functions/getWalletConnectorNetworks/getWalletConnectorNetworks.cjs +0 -13
- package/src/lib/utils/functions/getWalletConnectorNetworks/getWalletConnectorNetworks.d.ts +0 -3
- package/src/lib/utils/functions/getWalletConnectorNetworks/getWalletConnectorNetworks.js +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.7.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.6.3...v4.7.0) (2025-02-20)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* 7702 support ([14ee3cd](https://github.com/dynamic-labs/dynamic-auth/commit/14ee3cd3513ac8b3e8e866cc2026b042c706b7e6))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* fallback to empty array when token balances is called with an invalid chain ID ([#8108](https://github.com/dynamic-labs/dynamic-auth/issues/8108)) ([7d14ded](https://github.com/dynamic-labs/dynamic-auth/commit/7d14ded6afa0de604901bbc8bc13620d03dc2e8c))
|
|
13
|
+
* improve global connectivity sign typed data reliability ([#8103](https://github.com/dynamic-labs/dynamic-auth/issues/8103)) ([8b0d2dd](https://github.com/dynamic-labs/dynamic-auth/commit/8b0d2ddbeb62a11732a9d59bc6cd4b72d82b9855))
|
|
14
|
+
* **QNTM-2902:** ensure react updates icons ([#8105](https://github.com/dynamic-labs/dynamic-auth/issues/8105)) ([1182c4c](https://github.com/dynamic-labs/dynamic-auth/commit/1182c4cc103c599e6bbff89af9b1312fb96b6d05))
|
|
15
|
+
|
|
16
|
+
### [4.6.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.6.2...v4.6.3) (2025-02-14)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* optimize zerodev connector initialization ([dff1b4d](https://github.com/dynamic-labs/dynamic-auth/commit/dff1b4d410ab06c45635e0114823cbba4b8c1905))
|
|
22
|
+
|
|
2
23
|
### [4.6.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.6.1...v4.6.2) (2025-02-14)
|
|
3
24
|
|
|
4
25
|
|
package/package.cjs
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
|
-
var version = "4.
|
|
6
|
+
var version = "4.7.0";
|
|
7
7
|
var dependencies = {
|
|
8
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
8
|
+
"@dynamic-labs/sdk-api-core": "0.0.628",
|
|
9
9
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
10
10
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
11
11
|
"country-list": "2.3.0",
|
package/package.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
|
-
var version = "4.
|
|
2
|
+
var version = "4.7.0";
|
|
3
3
|
var dependencies = {
|
|
4
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
4
|
+
"@dynamic-labs/sdk-api-core": "0.0.628",
|
|
5
5
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
6
6
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
7
7
|
"country-list": "2.3.0",
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
5
|
+
"@dynamic-labs/sdk-api-core": "0.0.628",
|
|
6
6
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
7
7
|
"@thumbmarkjs/thumbmarkjs": "0.16.0",
|
|
8
8
|
"country-list": "2.3.0",
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
"yup": "0.32.11",
|
|
15
15
|
"react-international-phone": "4.2.5",
|
|
16
16
|
"bs58": "5.0.0",
|
|
17
|
-
"@dynamic-labs/assert-package-version": "4.
|
|
18
|
-
"@dynamic-labs/iconic": "4.
|
|
19
|
-
"@dynamic-labs/logger": "4.
|
|
20
|
-
"@dynamic-labs/multi-wallet": "4.
|
|
21
|
-
"@dynamic-labs/rpc-providers": "4.
|
|
22
|
-
"@dynamic-labs/store": "4.
|
|
23
|
-
"@dynamic-labs/types": "4.
|
|
24
|
-
"@dynamic-labs/utils": "4.
|
|
25
|
-
"@dynamic-labs/wallet-book": "4.
|
|
26
|
-
"@dynamic-labs/wallet-connector-core": "4.
|
|
17
|
+
"@dynamic-labs/assert-package-version": "4.7.0",
|
|
18
|
+
"@dynamic-labs/iconic": "4.7.0",
|
|
19
|
+
"@dynamic-labs/logger": "4.7.0",
|
|
20
|
+
"@dynamic-labs/multi-wallet": "4.7.0",
|
|
21
|
+
"@dynamic-labs/rpc-providers": "4.7.0",
|
|
22
|
+
"@dynamic-labs/store": "4.7.0",
|
|
23
|
+
"@dynamic-labs/types": "4.7.0",
|
|
24
|
+
"@dynamic-labs/utils": "4.7.0",
|
|
25
|
+
"@dynamic-labs/wallet-book": "4.7.0",
|
|
26
|
+
"@dynamic-labs/wallet-connector-core": "4.7.0",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
package/src/lib/Main.cjs
CHANGED
|
@@ -153,7 +153,7 @@ const Main = () => {
|
|
|
153
153
|
}
|
|
154
154
|
// Validate the network
|
|
155
155
|
if (!isSupportedNetwork.isSupportedNetwork({
|
|
156
|
-
network: yield walletByConnectorKey.connector.getNetwork(),
|
|
156
|
+
network: yield walletByConnectorKey.connector.getNetwork(true),
|
|
157
157
|
walletConnector: walletByConnectorKey.connector,
|
|
158
158
|
})) {
|
|
159
159
|
disconnectWallet(walletByConnectorKey.id);
|
package/src/lib/Main.js
CHANGED
|
@@ -149,7 +149,7 @@ const Main = () => {
|
|
|
149
149
|
}
|
|
150
150
|
// Validate the network
|
|
151
151
|
if (!isSupportedNetwork({
|
|
152
|
-
network: yield walletByConnectorKey.connector.getNetwork(),
|
|
152
|
+
network: yield walletByConnectorKey.connector.getNetwork(true),
|
|
153
153
|
walletConnector: walletByConnectorKey.connector,
|
|
154
154
|
})) {
|
|
155
155
|
disconnectWallet(walletByConnectorKey.id);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Headless Button component for other buttons to extend.
|
|
10
|
+
*
|
|
11
|
+
* This component handles button basics such as:
|
|
12
|
+
* - Accessibility props
|
|
13
|
+
* - Refs
|
|
14
|
+
* - Test IDs
|
|
15
|
+
* - Click events
|
|
16
|
+
* - Disabled state
|
|
17
|
+
*/
|
|
18
|
+
const BaseButton = ({ children, className, dataTestId, disabled, onClick, type, style, ariaLabel, ariaExpanded, ariaControls, buttonRef, }) => (jsxRuntime.jsx("button", { type: type, className: className, ref: buttonRef, onClick: onClick, disabled: disabled, "data-testid": dataTestId, style: style, "aria-label": ariaLabel, "aria-expanded": ariaExpanded, "aria-controls": ariaControls, children: children }));
|
|
19
|
+
|
|
20
|
+
exports.BaseButton = BaseButton;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, FC, MouseEventHandler, PropsWithChildren, Ref } from 'react';
|
|
2
|
+
import { ButtonAriaProps } from '../../utils/types/ButtonAriaProps';
|
|
3
|
+
import { ClassStyleProps } from '../../utils/types/ClassStyleProps';
|
|
4
|
+
export type BaseButtonProps = ClassStyleProps & ButtonAriaProps & PropsWithChildren & {
|
|
5
|
+
dataTestId?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
onClick?: MouseEventHandler<HTMLButtonElement> | (() => Promise<void>);
|
|
8
|
+
buttonRef?: Ref<HTMLButtonElement>;
|
|
9
|
+
type?: ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Headless Button component for other buttons to extend.
|
|
13
|
+
*
|
|
14
|
+
* This component handles button basics such as:
|
|
15
|
+
* - Accessibility props
|
|
16
|
+
* - Refs
|
|
17
|
+
* - Test IDs
|
|
18
|
+
* - Click events
|
|
19
|
+
* - Disabled state
|
|
20
|
+
*/
|
|
21
|
+
export declare const BaseButton: FC<BaseButtonProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Headless Button component for other buttons to extend.
|
|
6
|
+
*
|
|
7
|
+
* This component handles button basics such as:
|
|
8
|
+
* - Accessibility props
|
|
9
|
+
* - Refs
|
|
10
|
+
* - Test IDs
|
|
11
|
+
* - Click events
|
|
12
|
+
* - Disabled state
|
|
13
|
+
*/
|
|
14
|
+
const BaseButton = ({ children, className, dataTestId, disabled, onClick, type, style, ariaLabel, ariaExpanded, ariaControls, buttonRef, }) => (jsx("button", { type: type, className: className, ref: buttonRef, onClick: onClick, disabled: disabled, "data-testid": dataTestId, style: style, "aria-label": ariaLabel, "aria-expanded": ariaExpanded, "aria-controls": ariaControls, children: children }));
|
|
15
|
+
|
|
16
|
+
export { BaseButton };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './BaseButton';
|
|
@@ -8,8 +8,12 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
10
10
|
var spinner = require('../Spinner/spinner.cjs');
|
|
11
|
+
var BaseButton = require('../BaseButton/BaseButton.cjs');
|
|
11
12
|
|
|
12
13
|
const defaultButtonVariant = 'primary';
|
|
14
|
+
/**
|
|
15
|
+
* A Button component with options for different variants, padding, and more.
|
|
16
|
+
*/
|
|
13
17
|
const Button = ({ buttonClassName = '', className, style, buttonPadding = 'medium', buttonVariant = defaultButtonVariant, buttonRef, children, feedback, expanded, dataTestId, disabled = false, showInternalLoading = true, loading = false, onClick, type, startSlot, endSlot, }) => {
|
|
14
18
|
const [internalButtonLoading, setInternalButtonLoading] = React.useState(false);
|
|
15
19
|
const [isFeedbackVisible, setIsFeedbackVisible] = React.useState(false);
|
|
@@ -41,7 +45,7 @@ const Button = ({ buttonClassName = '', className, style, buttonPadding = 'mediu
|
|
|
41
45
|
});
|
|
42
46
|
const buttonContent = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [startSlot && jsxRuntime.jsx("div", { className: 'button__start-slot', children: startSlot }), (feedback || children) &&
|
|
43
47
|
(isFeedbackVisible && feedback ? feedback : children), endSlot && jsxRuntime.jsx("div", { className: 'button__end-slot', children: endSlot })] }));
|
|
44
|
-
return (jsxRuntime.jsxs(
|
|
48
|
+
return (jsxRuntime.jsxs(BaseButton.BaseButton, { type: type, buttonRef: buttonRef, onClick: handleClick, className: buttonEffectiveClassName, disabled: disabled || internalButtonLoading || loading, dataTestId: dataTestId, style: style, ariaExpanded: expanded, children: [(internalButtonLoading || loading) && (jsxRuntime.jsx("div", { className: 'button__spinner-container', "data-testid": 'button__spinner', children: jsxRuntime.jsx(spinner.Spinner, { className: 'button__spinner' }) })), buttonContent] }));
|
|
45
49
|
};
|
|
46
50
|
|
|
47
51
|
exports.Button = Button;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { FC, MouseEventHandler, ReactNode } from 'react';
|
|
2
|
+
import { BaseButtonProps } from '../BaseButton';
|
|
3
3
|
type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'brand-primary' | 'card';
|
|
4
4
|
type ButtonPadding = 'small' | 'medium' | 'large' | 'none' | 'default' | 'login-screen-height';
|
|
5
5
|
export declare const defaultButtonVariant: ButtonVariant;
|
|
6
|
-
export type ButtonProps =
|
|
6
|
+
export type ButtonProps = BaseButtonProps & {
|
|
7
7
|
buttonClassName?: string;
|
|
8
8
|
buttonPadding?: ButtonPadding;
|
|
9
9
|
buttonVariant?: ButtonVariant;
|
|
10
|
-
buttonRef?: LegacyRef<HTMLButtonElement>;
|
|
11
|
-
dataTestId?: string;
|
|
12
|
-
disabled?: boolean;
|
|
13
10
|
endSlot?: JSX.Element;
|
|
14
11
|
expanded?: boolean;
|
|
15
12
|
feedback?: ReactNode;
|
|
@@ -17,7 +14,9 @@ export type ButtonProps = ClassStyleProps & PropsWithChildren & {
|
|
|
17
14
|
loading?: boolean;
|
|
18
15
|
startSlot?: JSX.Element;
|
|
19
16
|
onClick?: MouseEventHandler<HTMLButtonElement> | (() => Promise<void>);
|
|
20
|
-
type?: ButtonHTMLAttributes<HTMLButtonElement>['type'];
|
|
21
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* A Button component with options for different variants, padding, and more.
|
|
20
|
+
*/
|
|
22
21
|
export declare const Button: FC<ButtonProps>;
|
|
23
22
|
export {};
|
|
@@ -4,8 +4,12 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useState } from 'react';
|
|
5
5
|
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
6
6
|
import { Spinner } from '../Spinner/spinner.js';
|
|
7
|
+
import { BaseButton } from '../BaseButton/BaseButton.js';
|
|
7
8
|
|
|
8
9
|
const defaultButtonVariant = 'primary';
|
|
10
|
+
/**
|
|
11
|
+
* A Button component with options for different variants, padding, and more.
|
|
12
|
+
*/
|
|
9
13
|
const Button = ({ buttonClassName = '', className, style, buttonPadding = 'medium', buttonVariant = defaultButtonVariant, buttonRef, children, feedback, expanded, dataTestId, disabled = false, showInternalLoading = true, loading = false, onClick, type, startSlot, endSlot, }) => {
|
|
10
14
|
const [internalButtonLoading, setInternalButtonLoading] = useState(false);
|
|
11
15
|
const [isFeedbackVisible, setIsFeedbackVisible] = useState(false);
|
|
@@ -37,7 +41,7 @@ const Button = ({ buttonClassName = '', className, style, buttonPadding = 'mediu
|
|
|
37
41
|
});
|
|
38
42
|
const buttonContent = (jsxs(Fragment, { children: [startSlot && jsx("div", { className: 'button__start-slot', children: startSlot }), (feedback || children) &&
|
|
39
43
|
(isFeedbackVisible && feedback ? feedback : children), endSlot && jsx("div", { className: 'button__end-slot', children: endSlot })] }));
|
|
40
|
-
return (jsxs(
|
|
44
|
+
return (jsxs(BaseButton, { type: type, buttonRef: buttonRef, onClick: handleClick, className: buttonEffectiveClassName, disabled: disabled || internalButtonLoading || loading, dataTestId: dataTestId, style: style, ariaExpanded: expanded, children: [(internalButtonLoading || loading) && (jsx("div", { className: 'button__spinner-container', "data-testid": 'button__spinner', children: jsx(Spinner, { className: 'button__spinner' }) })), buttonContent] }));
|
|
41
45
|
};
|
|
42
46
|
|
|
43
47
|
export { Button, defaultButtonVariant };
|
package/src/lib/components/NetworkPicker/components/NetworkSwitchControl/NetworkSwitchControl.cjs
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
-
var utils = require('@dynamic-labs/utils');
|
|
8
7
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
9
8
|
require('react');
|
|
10
9
|
var stroke = require('../../../../shared/assets/stroke.cjs');
|
|
@@ -15,6 +14,7 @@ require('../../../Accordion/components/AccordionItem/AccordionItem.cjs');
|
|
|
15
14
|
require('../../../Alert/Alert.cjs');
|
|
16
15
|
require('../../../../events/dynamicEvents.cjs');
|
|
17
16
|
require('../../../../../../_virtual/_tslib.cjs');
|
|
17
|
+
require('@dynamic-labs/utils');
|
|
18
18
|
require('../../../../context/DynamicContext/DynamicContext.cjs');
|
|
19
19
|
require('@dynamic-labs/sdk-api-core');
|
|
20
20
|
require('../../../../shared/logger.cjs');
|
|
@@ -101,7 +101,7 @@ require('../../../Popper/PopperContext/PopperContext.cjs');
|
|
|
101
101
|
|
|
102
102
|
const NetworkSwitchControl = ({ enabledNetworks, className = '', activeClassName = '', network, walletConnector, isOpen, setIsOpen, showNetworkName = false, }) => {
|
|
103
103
|
var _a, _b;
|
|
104
|
-
const currentNetwork = enabledNetworks.find((element) => network && element.chainId ===
|
|
104
|
+
const currentNetwork = enabledNetworks.find((element) => network && element.chainId.toString() === network.toString());
|
|
105
105
|
if (!enabledNetworks.length) {
|
|
106
106
|
return (jsxRuntime.jsx("div", { "data-testid": 'NetworkSwitchControl', className: classNames.classNames('network-switch-control__container network-switch-control__container--error', className), children: jsxRuntime.jsx(UnsupportedNetwork.UnsupportedNetwork, { showMsg: showNetworkName }) }));
|
|
107
107
|
}
|
package/src/lib/components/NetworkPicker/components/NetworkSwitchControl/NetworkSwitchControl.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import { parseChainId } from '@dynamic-labs/utils';
|
|
4
3
|
import { getChainInfo } from '@dynamic-labs/wallet-connector-core';
|
|
5
4
|
import 'react';
|
|
6
5
|
import { ReactComponent as SvgStroke } from '../../../../shared/assets/stroke.js';
|
|
@@ -11,6 +10,7 @@ import '../../../Accordion/components/AccordionItem/AccordionItem.js';
|
|
|
11
10
|
import '../../../Alert/Alert.js';
|
|
12
11
|
import '../../../../events/dynamicEvents.js';
|
|
13
12
|
import '../../../../../../_virtual/_tslib.js';
|
|
13
|
+
import '@dynamic-labs/utils';
|
|
14
14
|
import '../../../../context/DynamicContext/DynamicContext.js';
|
|
15
15
|
import '@dynamic-labs/sdk-api-core';
|
|
16
16
|
import '../../../../shared/logger.js';
|
|
@@ -97,7 +97,7 @@ import '../../../Popper/PopperContext/PopperContext.js';
|
|
|
97
97
|
|
|
98
98
|
const NetworkSwitchControl = ({ enabledNetworks, className = '', activeClassName = '', network, walletConnector, isOpen, setIsOpen, showNetworkName = false, }) => {
|
|
99
99
|
var _a, _b;
|
|
100
|
-
const currentNetwork = enabledNetworks.find((element) => network && element.chainId ===
|
|
100
|
+
const currentNetwork = enabledNetworks.find((element) => network && element.chainId.toString() === network.toString());
|
|
101
101
|
if (!enabledNetworks.length) {
|
|
102
102
|
return (jsx("div", { "data-testid": 'NetworkSwitchControl', className: classNames('network-switch-control__container network-switch-control__container--error', className), children: jsx(UnsupportedNetwork, { showMsg: showNetworkName }) }));
|
|
103
103
|
}
|
|
@@ -126,6 +126,7 @@ const useHandleLogout = (params) => {
|
|
|
126
126
|
utils.StorageService.removeItem(localStorage.WALLET_PICKER_SEARCH_KEY);
|
|
127
127
|
utils.StorageService.removeItem(localStorage.PHANTOM_SIGNATURE_STATE);
|
|
128
128
|
utils.StorageService.removeItem(localStorage.AUTH_EXPIRES_AT);
|
|
129
|
+
utils.StorageService.removeItem(localStorage.ZERODEV_AUTHORIZATION);
|
|
129
130
|
p.setAuthMode(p.initialAuthenticationMode);
|
|
130
131
|
p.setShowAuthFlow(false, {
|
|
131
132
|
emitCancelAuth: false,
|
|
@@ -7,7 +7,7 @@ import '../../../../config/ApiEndpoint.js';
|
|
|
7
7
|
import { DYNAMIC_AUTH_COOKIE_NAME } from '../../../../utils/constants/values.js';
|
|
8
8
|
import '@dynamic-labs/multi-wallet';
|
|
9
9
|
import '../../../../shared/logger.js';
|
|
10
|
-
import { AUTH_TOKEN, AUTH_MIN_TOKEN, WALLET_PICKER_SEARCH_KEY, PHANTOM_SIGNATURE_STATE, AUTH_EXPIRES_AT } from '../../../../utils/constants/localStorage.js';
|
|
10
|
+
import { AUTH_TOKEN, AUTH_MIN_TOKEN, WALLET_PICKER_SEARCH_KEY, PHANTOM_SIGNATURE_STATE, AUTH_EXPIRES_AT, ZERODEV_AUTHORIZATION } from '../../../../utils/constants/localStorage.js';
|
|
11
11
|
import '../../../../utils/constants/colors.js';
|
|
12
12
|
import 'react-international-phone';
|
|
13
13
|
import '@dynamic-labs/iconic';
|
|
@@ -122,6 +122,7 @@ const useHandleLogout = (params) => {
|
|
|
122
122
|
StorageService.removeItem(WALLET_PICKER_SEARCH_KEY);
|
|
123
123
|
StorageService.removeItem(PHANTOM_SIGNATURE_STATE);
|
|
124
124
|
StorageService.removeItem(AUTH_EXPIRES_AT);
|
|
125
|
+
StorageService.removeItem(ZERODEV_AUTHORIZATION);
|
|
125
126
|
p.setAuthMode(p.initialAuthenticationMode);
|
|
126
127
|
p.setShowAuthFlow(false, {
|
|
127
128
|
emitCancelAuth: false,
|
|
@@ -26,7 +26,7 @@ const useNameService = ({ currentWallet, user }) => {
|
|
|
26
26
|
const lastFetchedNameServiceNetwork = React.useRef();
|
|
27
27
|
const fetchNameServiceFromBlockchain = React.useCallback((wallet) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
28
28
|
const { address, connector } = wallet;
|
|
29
|
-
const network = yield connector.getNetwork();
|
|
29
|
+
const network = yield connector.getNetwork(true);
|
|
30
30
|
if (address === lastFetchedNameServiceAddress.current &&
|
|
31
31
|
network === lastFetchedNameServiceNetwork.current) {
|
|
32
32
|
return;
|
|
@@ -62,7 +62,7 @@ const useNameService = ({ currentWallet, user }) => {
|
|
|
62
62
|
if (!currentWallet) {
|
|
63
63
|
return;
|
|
64
64
|
}
|
|
65
|
-
const network = yield currentWallet.connector.getNetwork();
|
|
65
|
+
const network = yield currentWallet.connector.getNetwork(true);
|
|
66
66
|
const verifiedCredentials = user === null || user === void 0 ? void 0 : user.verifiedCredentials;
|
|
67
67
|
//if there are verified credentials, check if there is a name service for the current wallet
|
|
68
68
|
if (verifiedCredentials) {
|
|
@@ -22,7 +22,7 @@ const useNameService = ({ currentWallet, user }) => {
|
|
|
22
22
|
const lastFetchedNameServiceNetwork = useRef();
|
|
23
23
|
const fetchNameServiceFromBlockchain = useCallback((wallet) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
24
|
const { address, connector } = wallet;
|
|
25
|
-
const network = yield connector.getNetwork();
|
|
25
|
+
const network = yield connector.getNetwork(true);
|
|
26
26
|
if (address === lastFetchedNameServiceAddress.current &&
|
|
27
27
|
network === lastFetchedNameServiceNetwork.current) {
|
|
28
28
|
return;
|
|
@@ -58,7 +58,7 @@ const useNameService = ({ currentWallet, user }) => {
|
|
|
58
58
|
if (!currentWallet) {
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
-
const network = yield currentWallet.connector.getNetwork();
|
|
61
|
+
const network = yield currentWallet.connector.getNetwork(true);
|
|
62
62
|
const verifiedCredentials = user === null || user === void 0 ? void 0 : user.verifiedCredentials;
|
|
63
63
|
//if there are verified credentials, check if there is a name service for the current wallet
|
|
64
64
|
if (verifiedCredentials) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentProps, FC } from 'react';
|
|
2
2
|
import { viewToComponentMap } from '../../../views/viewToComponentMap';
|
|
3
|
-
export type ViewType = 'access-blocked' | 'select-hardware-wallet' | 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-no-wallet' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-wallet-only' | 'login-with-email-verification' | 'login-with-sms-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'verify-email' | 'verify-sms' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'external-funding-wallet-list' | 'sandbox-maximum-threshold-reached' | 'multi-wallet-wallet-list' | 'wallet-sign' | 'wallet-used' | 'wallet-group' | 'select-wallet-in-wallet-group' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view' | 'wallet-locked-view' | 'social-wrong-account' | 'gate-blocked-wallet' | 'bridge-welcome' | 'bridge-summary' | 'bridge-next-wallet-connection' | 'account-exists' | 'merge-user-accounts' | 'merge-user-accounts-conflicts' | 'merge-user-accounts-with-same-email' | 'mfa-choose-device' | 'mfa-recovery' | 'mfa-secure-device' | 'mfa-secure-device-help' | 'mfa-verification' | 'mfa-display-backup-codes' | 'wallet-cannot-be-transferred' | 'passkey-intro' | 'passkey-recovery-add-email' | 'global-wallet-confirm' | 'global-wallet-malicious' | 'global-wallet-info' | 'passkey-recovery-start' | 'passkey-recovery-bundle' | 'passkey-recovery-complete' | 'passkey-new-domain-detected' | 'embedded-delete-view' | 'embedded-reveal-view' | 'embedded-reveal-account-view' | 'embedded-wallet-auth-choice' | 'rename-passkey' | 'wallet-redirect-view' | 'mobile-wallet-redirect-view' | 'farcaster-connect-view' | 'embedded-wallet-exists';
|
|
3
|
+
export type ViewType = 'access-blocked' | 'select-hardware-wallet' | 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-no-wallet' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-wallet-only' | 'login-with-email-verification' | 'login-with-sms-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'verify-email' | 'verify-sms' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'external-funding-wallet-list' | 'sandbox-maximum-threshold-reached' | 'multi-wallet-wallet-list' | 'wallet-sign' | 'wallet-used' | 'wallet-group' | 'select-wallet-in-wallet-group' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view' | 'wallet-locked-view' | 'social-wrong-account' | 'gate-blocked-wallet' | 'bridge-welcome' | 'bridge-summary' | 'bridge-next-wallet-connection' | 'account-exists' | 'merge-user-accounts' | 'merge-user-accounts-conflicts' | 'merge-user-accounts-with-same-email' | 'mfa-choose-device' | 'mfa-recovery' | 'mfa-secure-device' | 'mfa-secure-device-help' | 'mfa-verification' | 'mfa-display-backup-codes' | 'wallet-cannot-be-transferred' | 'passkey-intro' | 'passkey-recovery-add-email' | 'global-wallet-confirm' | 'global-wallet-malicious' | 'global-wallet-info' | 'passkey-recovery-start' | 'passkey-recovery-bundle' | 'passkey-recovery-complete' | 'passkey-new-domain-detected' | 'embedded-delete-view' | 'embedded-reveal-view' | 'embedded-reveal-account-view' | 'embedded-wallet-auth-choice' | 'rename-passkey' | 'wallet-redirect-view' | 'mobile-wallet-redirect-view' | 'farcaster-connect-view' | 'embedded-wallet-exists' | 'user-delete-account';
|
|
4
4
|
export type ViewMapConstraint = Record<ViewType, FC<any>>;
|
|
5
5
|
export type ViewMap = typeof viewToComponentMap;
|
|
6
6
|
export type ViewState<T extends ViewType> = {
|
|
@@ -105,7 +105,7 @@ const Header = ({ onClose: handleClose, heading, projectSettings, copykey, descr
|
|
|
105
105
|
const { setError } = ErrorContext.useErrorContext();
|
|
106
106
|
const { isFooterExpanded, setIsFooterExpanded } = index.useFooterAnimationContext();
|
|
107
107
|
const { view, canGoBack, goBack } = ViewContext.useViewContext();
|
|
108
|
-
const { showCloseButton, showHelpContent, isWalletListTypeView, displayBorderBelowHeader, } = useAuthLayoutChecks.useAuthLayoutChecks();
|
|
108
|
+
const { showCloseButton, showHelpContent, isWalletListTypeView, displayBorderBelowHeader, showBackButton, } = useAuthLayoutChecks.useAuthLayoutChecks();
|
|
109
109
|
const { setExistentAccountData } = AccountExistsContext.useAccountExistsContext();
|
|
110
110
|
const handleBackClick = React.useCallback(() => {
|
|
111
111
|
var _a, _b;
|
|
@@ -117,7 +117,7 @@ const Header = ({ onClose: handleClose, heading, projectSettings, copykey, descr
|
|
|
117
117
|
const closeButton = showCloseButton && handleClose && (jsxRuntime.jsx(IconButton.IconButton, { onClick: handleClose, type: 'button', id: 'close-button', "data-testid": 'close-button', className: 'layout-header__icon', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
|
|
118
118
|
const infoButton = showHelpContent && (jsxRuntime.jsx(Tooltip.Tooltip, { content: 'Need some help?', className: 'layout-header__tooltip', children: jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: () => setIsFooterExpanded(!isFooterExpanded), "data-testid": 'info-button', className: 'layout-header__icon', children: isWalletListTypeView ? jsxRuntime.jsx(questionMark.ReactComponent, {}) : jsxRuntime.jsx(footerInfoIcon.ReactComponent, {}) }) }, 'info-button'));
|
|
119
119
|
const leadingButtons = [];
|
|
120
|
-
if (canGoBack) {
|
|
120
|
+
if (canGoBack && showBackButton) {
|
|
121
121
|
leadingButtons.push(jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', className: 'layout-header__icon', children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }, 'back-button'));
|
|
122
122
|
}
|
|
123
123
|
// if has close button and info button, info button should be on the right
|
|
@@ -101,7 +101,7 @@ const Header = ({ onClose: handleClose, heading, projectSettings, copykey, descr
|
|
|
101
101
|
const { setError } = useErrorContext();
|
|
102
102
|
const { isFooterExpanded, setIsFooterExpanded } = useFooterAnimationContext();
|
|
103
103
|
const { view, canGoBack, goBack } = useViewContext();
|
|
104
|
-
const { showCloseButton, showHelpContent, isWalletListTypeView, displayBorderBelowHeader, } = useAuthLayoutChecks();
|
|
104
|
+
const { showCloseButton, showHelpContent, isWalletListTypeView, displayBorderBelowHeader, showBackButton, } = useAuthLayoutChecks();
|
|
105
105
|
const { setExistentAccountData } = useAccountExistsContext();
|
|
106
106
|
const handleBackClick = useCallback(() => {
|
|
107
107
|
var _a, _b;
|
|
@@ -113,7 +113,7 @@ const Header = ({ onClose: handleClose, heading, projectSettings, copykey, descr
|
|
|
113
113
|
const closeButton = showCloseButton && handleClose && (jsx(IconButton, { onClick: handleClose, type: 'button', id: 'close-button', "data-testid": 'close-button', className: 'layout-header__icon', children: jsx(SvgClose, {}) }));
|
|
114
114
|
const infoButton = showHelpContent && (jsx(Tooltip, { content: 'Need some help?', className: 'layout-header__tooltip', children: jsx(IconButton, { type: 'button', onClick: () => setIsFooterExpanded(!isFooterExpanded), "data-testid": 'info-button', className: 'layout-header__icon', children: isWalletListTypeView ? jsx(SvgQuestionMark, {}) : jsx(SvgFooterInfoIcon, {}) }) }, 'info-button'));
|
|
115
115
|
const leadingButtons = [];
|
|
116
|
-
if (canGoBack) {
|
|
116
|
+
if (canGoBack && showBackButton) {
|
|
117
117
|
leadingButtons.push(jsx(IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', className: 'layout-header__icon', children: jsx(SvgArrowLeft, {}) }, 'back-button'));
|
|
118
118
|
}
|
|
119
119
|
// if has close button and info button, info button should be on the right
|
|
@@ -990,6 +990,16 @@ const translation = {
|
|
|
990
990
|
empty_screen: {
|
|
991
991
|
title: 'Nothing to see here yet!',
|
|
992
992
|
},
|
|
993
|
+
delete_account: {
|
|
994
|
+
title: 'Delete My Account',
|
|
995
|
+
description: 'Deleting your account will permanently remove all data, including wallet details and linked smart contract wallets. This action cannot be undone.',
|
|
996
|
+
backup_confirmation: "I confirm I've backed up my wallet key. If I return, a new wallet will be created.",
|
|
997
|
+
type_delete: 'Enter DELETE in the box below to confirm this action.',
|
|
998
|
+
cancel: 'Cancel',
|
|
999
|
+
confirm: 'Delete Account',
|
|
1000
|
+
deleting: 'Deleting...',
|
|
1001
|
+
type_delete_label: 'Type to confirm',
|
|
1002
|
+
},
|
|
993
1003
|
},
|
|
994
1004
|
/**
|
|
995
1005
|
* @description copy keys for global wallet view
|
|
@@ -986,6 +986,16 @@ export declare const translation: {
|
|
|
986
986
|
empty_screen: {
|
|
987
987
|
title: string;
|
|
988
988
|
};
|
|
989
|
+
delete_account: {
|
|
990
|
+
title: string;
|
|
991
|
+
description: string;
|
|
992
|
+
backup_confirmation: string;
|
|
993
|
+
type_delete: string;
|
|
994
|
+
cancel: string;
|
|
995
|
+
confirm: string;
|
|
996
|
+
deleting: string;
|
|
997
|
+
type_delete_label: string;
|
|
998
|
+
};
|
|
989
999
|
};
|
|
990
1000
|
/**
|
|
991
1001
|
* @description copy keys for global wallet view
|
|
@@ -986,6 +986,16 @@ const translation = {
|
|
|
986
986
|
empty_screen: {
|
|
987
987
|
title: 'Nothing to see here yet!',
|
|
988
988
|
},
|
|
989
|
+
delete_account: {
|
|
990
|
+
title: 'Delete My Account',
|
|
991
|
+
description: 'Deleting your account will permanently remove all data, including wallet details and linked smart contract wallets. This action cannot be undone.',
|
|
992
|
+
backup_confirmation: "I confirm I've backed up my wallet key. If I return, a new wallet will be created.",
|
|
993
|
+
type_delete: 'Enter DELETE in the box below to confirm this action.',
|
|
994
|
+
cancel: 'Cancel',
|
|
995
|
+
confirm: 'Delete Account',
|
|
996
|
+
deleting: 'Deleting...',
|
|
997
|
+
type_delete_label: 'Type to confirm',
|
|
998
|
+
},
|
|
989
999
|
},
|
|
990
1000
|
/**
|
|
991
1001
|
* @description copy keys for global wallet view
|