@dynamic-labs/sdk-react-core 2.3.10 → 2.5.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 +25 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +13 -13
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.cjs +1 -1
- package/src/lib/components/NetworkPicker/components/NonNetworkSwitchingSupportedControl/NonNetworkSwitchingSupportedControl.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +13 -9
- package/src/lib/context/DynamicContext/DynamicContext.js +14 -10
- package/src/lib/context/DynamicContext/types/index.d.ts +5 -1
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.cjs +1 -1
- package/src/lib/layout/DynamicAuthLayout/WalletProgressStepper/WalletProgressStepper.js +2 -2
- package/src/lib/shared/utils/functions/chain/getChainDisplayName.cjs +1 -1
- package/src/lib/shared/utils/functions/chain/getChainDisplayName.js +2 -2
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/usePromise/utils/index.d.ts +0 -2
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +1 -1
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +1 -1
- package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.cjs +1 -1
- package/src/lib/views/BridgeNextWalletConnectionView/BridgeNextWalletConnectionView.js +2 -2
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.cjs +2 -2
- package/src/lib/views/BridgeSummaryView/BridgeSummaryView.js +3 -3
- package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.cjs +2 -2
- package/src/lib/views/BridgeWelcomeView/BridgeWelcomeView.js +3 -3
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.cjs +1 -1
- package/src/lib/views/WalletGroupView/components/WalletGroupItem/WalletGroupItem.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeWidgetEmptyCard/DynamicBridgeWidgetEmptyCard.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/WalletsView.js +2 -2
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs +1 -1
- package/src/lib/widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js +2 -2
- package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchChain/useFetchChain.js +2 -2
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/hooks/useFetchCurrency/useFetchCurrency.js +2 -2
|
@@ -118,7 +118,7 @@ const useWalletConnectors = ({ authMode, connectedWallets, walletConnectorOption
|
|
|
118
118
|
!wallet.connector.canConnectViaCustodialService, []);
|
|
119
119
|
const setPrimaryWallet = React.useCallback((walletId) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
120
120
|
const { newWallet: newPrimaryWallet, connectedAccounts } = yield getSelectedWallet(walletId);
|
|
121
|
-
if (!primaryWalletId) {
|
|
121
|
+
if (!primaryWalletId && !checkIfShowQrCodeModal(newPrimaryWallet)) {
|
|
122
122
|
yield newPrimaryWallet.connector.connect();
|
|
123
123
|
setPrimaryWalletId(walletId);
|
|
124
124
|
return;
|
|
@@ -114,7 +114,7 @@ const useWalletConnectors = ({ authMode, connectedWallets, walletConnectorOption
|
|
|
114
114
|
!wallet.connector.canConnectViaCustodialService, []);
|
|
115
115
|
const setPrimaryWallet = useCallback((walletId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
116
116
|
const { newWallet: newPrimaryWallet, connectedAccounts } = yield getSelectedWallet(walletId);
|
|
117
|
-
if (!primaryWalletId) {
|
|
117
|
+
if (!primaryWalletId && !checkIfShowQrCodeModal(newPrimaryWallet)) {
|
|
118
118
|
yield newPrimaryWallet.connector.connect();
|
|
119
119
|
setPrimaryWalletId(walletId);
|
|
120
120
|
return;
|
|
@@ -89,7 +89,7 @@ const BridgeNextWalletConnectionView = () => {
|
|
|
89
89
|
}
|
|
90
90
|
const [nextWalletToConnect] = bridgeChainsToConnect;
|
|
91
91
|
const { chain } = nextWalletToConnect;
|
|
92
|
-
const chainInfo = walletConnectorCore.
|
|
92
|
+
const chainInfo = walletConnectorCore.getChainInfoWithOverrides(chain);
|
|
93
93
|
const ChainIcon = getChainIcon.getChainIcon(chain);
|
|
94
94
|
if (!chainInfo) {
|
|
95
95
|
throw new utils.DynamicError('No chain info found for chain', chain);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
3
|
+
import { getChainInfoWithOverrides } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
import { DynamicError } from '@dynamic-labs/utils';
|
|
5
5
|
import { useViewContext } from '../../context/ViewContext/ViewContext.js';
|
|
6
6
|
import { BridgeNextWalletToConnectLayout } from '../../layouts/BridgeNextWalletToConnectLayout/BridgeNextWalletToConnectLayout.js';
|
|
@@ -85,7 +85,7 @@ const BridgeNextWalletConnectionView = () => {
|
|
|
85
85
|
}
|
|
86
86
|
const [nextWalletToConnect] = bridgeChainsToConnect;
|
|
87
87
|
const { chain } = nextWalletToConnect;
|
|
88
|
-
const chainInfo =
|
|
88
|
+
const chainInfo = getChainInfoWithOverrides(chain);
|
|
89
89
|
const ChainIcon = getChainIcon(chain);
|
|
90
90
|
if (!chainInfo) {
|
|
91
91
|
throw new DynamicError('No chain info found for chain', chain);
|
|
@@ -89,7 +89,7 @@ const BridgeSummaryView = () => {
|
|
|
89
89
|
const { t } = reactI18next.useTranslation();
|
|
90
90
|
const onClickClose = () => setShowAuthFlow(false, { emitCancelAuth: true });
|
|
91
91
|
const body = React.useMemo(() => {
|
|
92
|
-
const blockchainNames = bridgeChains.map(({ chain }) => { var _a; return (_a = walletConnectorCore.
|
|
92
|
+
const blockchainNames = bridgeChains.map(({ chain }) => { var _a; return (_a = walletConnectorCore.getChainInfoWithOverrides(chain)) === null || _a === void 0 ? void 0 : _a.blockchainName; });
|
|
93
93
|
const [firstBlockchainName, secondBlockchainName] = blockchainNames;
|
|
94
94
|
return t('dyn_bridge.summary_view.connection_succeed', {
|
|
95
95
|
firstBlockchainName,
|
|
@@ -98,7 +98,7 @@ const BridgeSummaryView = () => {
|
|
|
98
98
|
}, [bridgeChains, t]);
|
|
99
99
|
const createPrimaryWalletCard = (wallet) => {
|
|
100
100
|
const PrimaryWalletChainIcon = getChainIcon.getChainIcon(wallet.chain);
|
|
101
|
-
const primaryWalletChainInfo = walletConnectorCore.
|
|
101
|
+
const primaryWalletChainInfo = walletConnectorCore.getChainInfoWithOverrides(wallet.chain);
|
|
102
102
|
return (jsxRuntime.jsx(DynamicBridgeWalletCard.DynamicBridgeWalletCard, { networkIcon: jsxRuntime.jsx(PrimaryWalletChainIcon, {}), networkName: primaryWalletChainInfo === null || primaryWalletChainInfo === void 0 ? void 0 : primaryWalletChainInfo.displayName, children: jsxRuntime.jsx(DynamicBridgeWalletCardBody.DynamicBridgeWalletCardBody, { walletKey: wallet.connector.key, walletAddress: wallet.address, walletBalance:
|
|
103
103
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
104
104
|
jsxRuntime.jsx(Balance.Balance, { address: wallet.address, connector: wallet.connector, network: wallet.chain }) }) }));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import {
|
|
5
|
+
import { getChainInfoWithOverrides } from '@dynamic-labs/wallet-connector-core';
|
|
6
6
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
7
7
|
import '@dynamic-labs/sdk-api-core';
|
|
8
8
|
import '../../shared/logger.js';
|
|
@@ -85,7 +85,7 @@ const BridgeSummaryView = () => {
|
|
|
85
85
|
const { t } = useTranslation();
|
|
86
86
|
const onClickClose = () => setShowAuthFlow(false, { emitCancelAuth: true });
|
|
87
87
|
const body = useMemo(() => {
|
|
88
|
-
const blockchainNames = bridgeChains.map(({ chain }) => { var _a; return (_a =
|
|
88
|
+
const blockchainNames = bridgeChains.map(({ chain }) => { var _a; return (_a = getChainInfoWithOverrides(chain)) === null || _a === void 0 ? void 0 : _a.blockchainName; });
|
|
89
89
|
const [firstBlockchainName, secondBlockchainName] = blockchainNames;
|
|
90
90
|
return t('dyn_bridge.summary_view.connection_succeed', {
|
|
91
91
|
firstBlockchainName,
|
|
@@ -94,7 +94,7 @@ const BridgeSummaryView = () => {
|
|
|
94
94
|
}, [bridgeChains, t]);
|
|
95
95
|
const createPrimaryWalletCard = (wallet) => {
|
|
96
96
|
const PrimaryWalletChainIcon = getChainIcon(wallet.chain);
|
|
97
|
-
const primaryWalletChainInfo =
|
|
97
|
+
const primaryWalletChainInfo = getChainInfoWithOverrides(wallet.chain);
|
|
98
98
|
return (jsx(DynamicBridgeWalletCard, { networkIcon: jsx(PrimaryWalletChainIcon, {}), networkName: primaryWalletChainInfo === null || primaryWalletChainInfo === void 0 ? void 0 : primaryWalletChainInfo.displayName, children: jsx(DynamicBridgeWalletCardBody, { walletKey: wallet.connector.key, walletAddress: wallet.address, walletBalance:
|
|
99
99
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
100
100
|
jsx(Balance, { address: wallet.address, connector: wallet.connector, network: wallet.chain }) }) }));
|
|
@@ -87,7 +87,7 @@ const BridgeWelcomeView = () => {
|
|
|
87
87
|
const { setView } = ViewContext.useViewContext();
|
|
88
88
|
const { t } = reactI18next.useTranslation();
|
|
89
89
|
const body = React.useMemo(() => {
|
|
90
|
-
const blockchainNames = bridgeChains.map(({ chain }) => { var _a; return (_a = walletConnectorCore.
|
|
90
|
+
const blockchainNames = bridgeChains.map(({ chain }) => { var _a; return (_a = walletConnectorCore.getChainInfoWithOverrides(chain)) === null || _a === void 0 ? void 0 : _a.blockchainName; });
|
|
91
91
|
const [firstBlockchainName, secondBlockchainName] = blockchainNames;
|
|
92
92
|
return t('dyn_bridge.welcome_view.description', {
|
|
93
93
|
firstBlockchainName,
|
|
@@ -96,7 +96,7 @@ const BridgeWelcomeView = () => {
|
|
|
96
96
|
}, [bridgeChains, t]);
|
|
97
97
|
const chains = React.useMemo(() => bridgeChains
|
|
98
98
|
.map(({ chain }, index) => {
|
|
99
|
-
const chainInfo = walletConnectorCore.
|
|
99
|
+
const chainInfo = walletConnectorCore.getChainInfoWithOverrides(chain);
|
|
100
100
|
const ChainIcon = getChainIcon.getChainIcon(chain);
|
|
101
101
|
if (chainInfo && ChainIcon) {
|
|
102
102
|
return {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import {
|
|
5
|
+
import { getChainInfoWithOverrides } from '@dynamic-labs/wallet-connector-core';
|
|
6
6
|
import '../../context/DynamicContext/DynamicContext.js';
|
|
7
7
|
import '@dynamic-labs/sdk-api-core';
|
|
8
8
|
import '../../shared/logger.js';
|
|
@@ -83,7 +83,7 @@ const BridgeWelcomeView = () => {
|
|
|
83
83
|
const { setView } = useViewContext();
|
|
84
84
|
const { t } = useTranslation();
|
|
85
85
|
const body = useMemo(() => {
|
|
86
|
-
const blockchainNames = bridgeChains.map(({ chain }) => { var _a; return (_a =
|
|
86
|
+
const blockchainNames = bridgeChains.map(({ chain }) => { var _a; return (_a = getChainInfoWithOverrides(chain)) === null || _a === void 0 ? void 0 : _a.blockchainName; });
|
|
87
87
|
const [firstBlockchainName, secondBlockchainName] = blockchainNames;
|
|
88
88
|
return t('dyn_bridge.welcome_view.description', {
|
|
89
89
|
firstBlockchainName,
|
|
@@ -92,7 +92,7 @@ const BridgeWelcomeView = () => {
|
|
|
92
92
|
}, [bridgeChains, t]);
|
|
93
93
|
const chains = useMemo(() => bridgeChains
|
|
94
94
|
.map(({ chain }, index) => {
|
|
95
|
-
const chainInfo =
|
|
95
|
+
const chainInfo = getChainInfoWithOverrides(chain);
|
|
96
96
|
const ChainIcon = getChainIcon(chain);
|
|
97
97
|
if (chainInfo && ChainIcon) {
|
|
98
98
|
return {
|
|
@@ -90,7 +90,7 @@ require('../../../../context/IpConfigurationContext/IpConfigurationContext.cjs')
|
|
|
90
90
|
const WalletGroupItem = ({ wallet, onClick, }) => {
|
|
91
91
|
const [supportedChain] = wallet.walletConnector.supportedChains;
|
|
92
92
|
const { walletBook: walletBook$1 } = walletBook.useWalletBookContext();
|
|
93
|
-
const chainInfo = walletConnectorCore.
|
|
93
|
+
const chainInfo = walletConnectorCore.getChainInfoWithOverrides(supportedChain);
|
|
94
94
|
const walletOverride = wallet.group
|
|
95
95
|
? walletBook.findWalletGroupOverride(walletBook$1, wallet.group, wallet.key)
|
|
96
96
|
: undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { getChainInfoWithOverrides } from '@dynamic-labs/wallet-connector-core';
|
|
5
5
|
import { useWalletBookContext, findWalletGroupOverride, BrandIcon } from '@dynamic-labs/wallet-book';
|
|
6
6
|
import '@dynamic-labs/sdk-api-core';
|
|
7
7
|
import '../../../../shared/logger.js';
|
|
@@ -86,7 +86,7 @@ import '../../../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
|
86
86
|
const WalletGroupItem = ({ wallet, onClick, }) => {
|
|
87
87
|
const [supportedChain] = wallet.walletConnector.supportedChains;
|
|
88
88
|
const { walletBook } = useWalletBookContext();
|
|
89
|
-
const chainInfo =
|
|
89
|
+
const chainInfo = getChainInfoWithOverrides(supportedChain);
|
|
90
90
|
const walletOverride = wallet.group
|
|
91
91
|
? findWalletGroupOverride(walletBook, wallet.group, wallet.key)
|
|
92
92
|
: undefined;
|
|
@@ -87,7 +87,7 @@ const DynamicBridgeWidgetEmptyCard = ({ chain }) => {
|
|
|
87
87
|
if (!(bridgeChainsToConnect === null || bridgeChainsToConnect === void 0 ? void 0 : bridgeChainsToConnect.length) || !chain) {
|
|
88
88
|
return null;
|
|
89
89
|
}
|
|
90
|
-
const chainInfo = walletConnectorCore.
|
|
90
|
+
const chainInfo = walletConnectorCore.getChainInfoWithOverrides(chain);
|
|
91
91
|
const ChainIcon = getChainIcon.getChainIcon(chain);
|
|
92
92
|
return (jsxRuntime.jsxs("div", { role: 'button', className: 'dynamic-bridge-widget-empty-card', onClick: () => {
|
|
93
93
|
setShowBridgeWidget(false);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import {
|
|
4
|
+
import { getChainInfoWithOverrides } from '@dynamic-labs/wallet-connector-core';
|
|
5
5
|
import 'react';
|
|
6
6
|
import '../../../../context/DynamicContext/DynamicContext.js';
|
|
7
7
|
import '@dynamic-labs/sdk-api-core';
|
|
@@ -83,7 +83,7 @@ const DynamicBridgeWidgetEmptyCard = ({ chain }) => {
|
|
|
83
83
|
if (!(bridgeChainsToConnect === null || bridgeChainsToConnect === void 0 ? void 0 : bridgeChainsToConnect.length) || !chain) {
|
|
84
84
|
return null;
|
|
85
85
|
}
|
|
86
|
-
const chainInfo =
|
|
86
|
+
const chainInfo = getChainInfoWithOverrides(chain);
|
|
87
87
|
const ChainIcon = getChainIcon(chain);
|
|
88
88
|
return (jsxs("div", { role: 'button', className: 'dynamic-bridge-widget-empty-card', onClick: () => {
|
|
89
89
|
setShowBridgeWidget(false);
|
|
@@ -94,7 +94,7 @@ const WalletsView = () => {
|
|
|
94
94
|
if (!chainWallets.length)
|
|
95
95
|
return jsxRuntime.jsx(DynamicBridgeWidgetEmptyCard.DynamicBridgeWidgetEmptyCard, { chain: chain }, chain);
|
|
96
96
|
const WalletIcon = getChainIcon.getChainIcon(chain);
|
|
97
|
-
const walletInfo = walletConnectorCore.
|
|
97
|
+
const walletInfo = walletConnectorCore.getChainInfoWithOverrides(chain);
|
|
98
98
|
// Wallets info for chains with connected wallets
|
|
99
99
|
return chainWallets.map(({ connector, address, id }) => (jsxRuntime.jsx(DynamicBridgeWalletCard.DynamicBridgeWalletCard, { networkIcon: jsxRuntime.jsx(WalletIcon, {}), networkName: walletInfo === null || walletInfo === void 0 ? void 0 : walletInfo.displayName, children: jsxRuntime.jsx(DynamicBridgeWalletCardBody.DynamicBridgeWalletCardBody, { walletKey: connector.key, walletAddress: address, walletBalance: jsxRuntime.jsx(Balance.Balance, { address: address, connector: connector, network: chain }), onDisconnectClick: () => disconnectWallet(id) }) }, `${id}-${connector.name}`)));
|
|
100
100
|
}) }), jsxRuntime.jsx(DynamicWidgetFooter.DynamicWidgetFooter, { children: jsxRuntime.jsx(LogoutButton.LogoutButton, { buttonClassName: 'dynamic-bridge-widget-wallets-view__logout-button', isTextButton: true }) })] }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import {
|
|
3
|
+
import { getChainInfoWithOverrides } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
import '../../../../components/Accordion/components/AccordionItem/AccordionItem.js';
|
|
5
5
|
import '../../../../components/Alert/Alert.js';
|
|
6
6
|
import 'react';
|
|
@@ -90,7 +90,7 @@ const WalletsView = () => {
|
|
|
90
90
|
if (!chainWallets.length)
|
|
91
91
|
return jsx(DynamicBridgeWidgetEmptyCard, { chain: chain }, chain);
|
|
92
92
|
const WalletIcon = getChainIcon(chain);
|
|
93
|
-
const walletInfo =
|
|
93
|
+
const walletInfo = getChainInfoWithOverrides(chain);
|
|
94
94
|
// Wallets info for chains with connected wallets
|
|
95
95
|
return chainWallets.map(({ connector, address, id }) => (jsx(DynamicBridgeWalletCard, { networkIcon: jsx(WalletIcon, {}), networkName: walletInfo === null || walletInfo === void 0 ? void 0 : walletInfo.displayName, children: jsx(DynamicBridgeWalletCardBody, { walletKey: connector.key, walletAddress: address, walletBalance: jsx(Balance, { address: address, connector: connector, network: chain }), onDisconnectClick: () => disconnectWallet(id) }) }, `${id}-${connector.name}`)));
|
|
96
96
|
}) }), jsx(DynamicWidgetFooter, { children: jsx(LogoutButton, { buttonClassName: 'dynamic-bridge-widget-wallets-view__logout-button', isTextButton: true }) })] }));
|
|
@@ -91,7 +91,7 @@ const SecondaryWallets = ({ hideUnlinkAction = false }) => {
|
|
|
91
91
|
const { disconnectWallet, getConnectedWalletById, bridgeChains } = useInternalDynamicContext.useInternalDynamicContext();
|
|
92
92
|
const wallet = getConnectedWalletById('connect-wallet-1');
|
|
93
93
|
const NetworkIcon = wallet && getChainIcon.getChainIcon(wallet === null || wallet === void 0 ? void 0 : wallet.chain);
|
|
94
|
-
const networkInfo = wallet && walletConnectorCore.
|
|
94
|
+
const networkInfo = wallet && walletConnectorCore.getChainInfoWithOverrides(wallet === null || wallet === void 0 ? void 0 : wallet.chain);
|
|
95
95
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!wallet && (jsxRuntime.jsx(DynamicBridgeWidgetEmptyCard.DynamicBridgeWidgetEmptyCard, { chain: bridgeChains === null || bridgeChains === void 0 ? void 0 : bridgeChains[1].chain })), wallet && NetworkIcon && (jsxRuntime.jsx(DynamicBridgeWalletCard.DynamicBridgeWalletCard, { networkIcon: jsxRuntime.jsx(NetworkIcon, {}), networkName: networkInfo === null || networkInfo === void 0 ? void 0 : networkInfo.displayName, children: jsxRuntime.jsx(DynamicBridgeWalletCardBody.DynamicBridgeWalletCardBody, { walletKey: wallet.connector.key, walletAddress: wallet.address, walletBalance:
|
|
96
96
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
97
97
|
jsxRuntime.jsx(Balance.Balance, { address: wallet.address, connector: wallet.connector, network: wallet.chain }), onDisconnectClick: !hideUnlinkAction ? () => disconnectWallet(wallet.id) : undefined }, wallet.id) }))] }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { getChainInfoWithOverrides } from '@dynamic-labs/wallet-connector-core';
|
|
5
5
|
import '@dynamic-labs/sdk-api-core';
|
|
6
6
|
import '../../../../../../shared/logger.js';
|
|
7
7
|
import { getChainIcon } from '../../../../../../shared/utils/functions/chain/getChainIcon.js';
|
|
@@ -83,7 +83,7 @@ const SecondaryWallets = ({ hideUnlinkAction = false }) => {
|
|
|
83
83
|
const { disconnectWallet, getConnectedWalletById, bridgeChains } = useInternalDynamicContext();
|
|
84
84
|
const wallet = getConnectedWalletById('connect-wallet-1');
|
|
85
85
|
const NetworkIcon = wallet && getChainIcon(wallet === null || wallet === void 0 ? void 0 : wallet.chain);
|
|
86
|
-
const networkInfo = wallet &&
|
|
86
|
+
const networkInfo = wallet && getChainInfoWithOverrides(wallet === null || wallet === void 0 ? void 0 : wallet.chain);
|
|
87
87
|
return (jsxs(Fragment, { children: [!wallet && (jsx(DynamicBridgeWidgetEmptyCard, { chain: bridgeChains === null || bridgeChains === void 0 ? void 0 : bridgeChains[1].chain })), wallet && NetworkIcon && (jsx(DynamicBridgeWalletCard, { networkIcon: jsx(NetworkIcon, {}), networkName: networkInfo === null || networkInfo === void 0 ? void 0 : networkInfo.displayName, children: jsx(DynamicBridgeWalletCardBody, { walletKey: wallet.connector.key, walletAddress: wallet.address, walletBalance:
|
|
88
88
|
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
89
89
|
jsx(Balance, { address: wallet.address, connector: wallet.connector, network: wallet.chain }), onDisconnectClick: !hideUnlinkAction ? () => disconnectWallet(wallet.id) : undefined }, wallet.id) }))] }));
|
|
@@ -86,7 +86,7 @@ const useFetchChain = (connector) => {
|
|
|
86
86
|
return { name: '', symbol: undefined };
|
|
87
87
|
const chainId = yield connector.getNetwork();
|
|
88
88
|
const { connectedChain } = connector;
|
|
89
|
-
const chainInfo = walletConnectorCore.
|
|
89
|
+
const chainInfo = walletConnectorCore.getChainInfoWithOverrides(connectedChain || '');
|
|
90
90
|
const chainWithIcon = {
|
|
91
91
|
name: chainInfo === null || chainInfo === void 0 ? void 0 : chainInfo.displayName,
|
|
92
92
|
symbol: chainInfo === null || chainInfo === void 0 ? void 0 : chainInfo.symbol,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
3
|
-
import {
|
|
3
|
+
import { getChainInfoWithOverrides } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '../../../../events/dynamicEvents.js';
|
|
6
6
|
import '@dynamic-labs/utils';
|
|
@@ -82,7 +82,7 @@ const useFetchChain = (connector) => {
|
|
|
82
82
|
return { name: '', symbol: undefined };
|
|
83
83
|
const chainId = yield connector.getNetwork();
|
|
84
84
|
const { connectedChain } = connector;
|
|
85
|
-
const chainInfo =
|
|
85
|
+
const chainInfo = getChainInfoWithOverrides(connectedChain || '');
|
|
86
86
|
const chainWithIcon = {
|
|
87
87
|
name: chainInfo === null || chainInfo === void 0 ? void 0 : chainInfo.displayName,
|
|
88
88
|
symbol: chainInfo === null || chainInfo === void 0 ? void 0 : chainInfo.symbol,
|
|
@@ -85,7 +85,7 @@ const useFetchCurrency = (connector, network) => {
|
|
|
85
85
|
if (!connector)
|
|
86
86
|
return null;
|
|
87
87
|
const chainId = yield connector.getNetwork();
|
|
88
|
-
const chainInfo = walletConnectorCore.
|
|
88
|
+
const chainInfo = walletConnectorCore.getChainInfoWithOverrides((_a = connector.connectedChain) !== null && _a !== void 0 ? _a : '');
|
|
89
89
|
/* istanbul ignore else */
|
|
90
90
|
if (!chainId) {
|
|
91
91
|
return chainInfo === null || chainInfo === void 0 ? void 0 : chainInfo.symbol;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../../../../_virtual/_tslib.js';
|
|
3
|
-
import {
|
|
3
|
+
import { getChainInfoWithOverrides } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '../../../../events/dynamicEvents.js';
|
|
6
6
|
import '@dynamic-labs/utils';
|
|
@@ -81,7 +81,7 @@ const useFetchCurrency = (connector, network) => {
|
|
|
81
81
|
if (!connector)
|
|
82
82
|
return null;
|
|
83
83
|
const chainId = yield connector.getNetwork();
|
|
84
|
-
const chainInfo =
|
|
84
|
+
const chainInfo = getChainInfoWithOverrides((_a = connector.connectedChain) !== null && _a !== void 0 ? _a : '');
|
|
85
85
|
/* istanbul ignore else */
|
|
86
86
|
if (!chainId) {
|
|
87
87
|
return chainInfo === null || chainInfo === void 0 ? void 0 : chainInfo.symbol;
|