@dynamic-labs/sdk-react-core 2.1.4 → 2.1.5
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 +4 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +13 -13
- package/src/lib/locale/en/translation.cjs +4 -4
- package/src/lib/locale/en/translation.d.ts +2 -2
- package/src/lib/locale/en/translation.js +4 -4
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.cjs +2 -1
- package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +2 -1
- package/src/lib/utils/hooks/useSwitchWallet/useSwitchWallet.cjs +1 -1
- package/src/lib/utils/hooks/useSwitchWallet/useSwitchWallet.js +1 -1
- package/src/lib/utils/hooks/useWalletConnectors/utils/findWallet/findWallet.cjs +1 -1
- package/src/lib/utils/hooks/useWalletConnectors/utils/findWallet/findWallet.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
|
|
2
|
+
### [2.1.5](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.4...v2.1.5) (2024-06-16)
|
|
3
|
+
|
|
4
|
+
* Improve handling of unknown wallets, css fixes and copy updates in multi wallet experience
|
|
5
|
+
|
|
2
6
|
### [2.1.4](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.3...v2.1.4) (2024-06-14)
|
|
3
7
|
|
|
4
8
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -17,18 +17,18 @@
|
|
|
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": "2.1.
|
|
21
|
-
"@dynamic-labs/logger": "2.1.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "2.1.
|
|
23
|
-
"@dynamic-labs/rpc-provider-ethereum": "2.1.
|
|
24
|
-
"@dynamic-labs/rpc-provider-solana": "2.1.
|
|
25
|
-
"@dynamic-labs/rpc-providers": "2.1.
|
|
26
|
-
"@dynamic-labs/store": "2.1.
|
|
27
|
-
"@dynamic-labs/types": "2.1.
|
|
28
|
-
"@dynamic-labs/utils": "2.1.
|
|
29
|
-
"@dynamic-labs/viem-utils": "2.1.
|
|
30
|
-
"@dynamic-labs/wallet-book": "2.1.
|
|
31
|
-
"@dynamic-labs/wallet-connector-core": "2.1.
|
|
20
|
+
"@dynamic-labs/iconic": "2.1.5",
|
|
21
|
+
"@dynamic-labs/logger": "2.1.5",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "2.1.5",
|
|
23
|
+
"@dynamic-labs/rpc-provider-ethereum": "2.1.5",
|
|
24
|
+
"@dynamic-labs/rpc-provider-solana": "2.1.5",
|
|
25
|
+
"@dynamic-labs/rpc-providers": "2.1.5",
|
|
26
|
+
"@dynamic-labs/store": "2.1.5",
|
|
27
|
+
"@dynamic-labs/types": "2.1.5",
|
|
28
|
+
"@dynamic-labs/utils": "2.1.5",
|
|
29
|
+
"@dynamic-labs/viem-utils": "2.1.5",
|
|
30
|
+
"@dynamic-labs/wallet-book": "2.1.5",
|
|
31
|
+
"@dynamic-labs/wallet-connector-core": "2.1.5",
|
|
32
32
|
"eventemitter3": "5.0.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
@@ -1768,8 +1768,8 @@ const translation = {
|
|
|
1768
1768
|
search: {
|
|
1769
1769
|
label: 'Search through {{numberOfWallets}} wallets...',
|
|
1770
1770
|
not_found: {
|
|
1771
|
-
description: '
|
|
1772
|
-
title: '
|
|
1771
|
+
description: 'The wallet you’re looking for may not be available, or linking more than one of these wallets might not be possible.',
|
|
1772
|
+
title: 'Wallet not available',
|
|
1773
1773
|
},
|
|
1774
1774
|
},
|
|
1775
1775
|
title: {
|
|
@@ -1790,8 +1790,8 @@ const translation = {
|
|
|
1790
1790
|
search: {
|
|
1791
1791
|
label: 'Search through {{numberOfWallets}} wallets...',
|
|
1792
1792
|
not_found: {
|
|
1793
|
-
description: '
|
|
1794
|
-
title: '
|
|
1793
|
+
description: 'The wallet you’re looking for may not be available, or linking more than one of these wallets might not be possible.',
|
|
1794
|
+
title: 'Wallet not available',
|
|
1795
1795
|
},
|
|
1796
1796
|
},
|
|
1797
1797
|
title: {
|
|
@@ -1764,8 +1764,8 @@ export declare const translation: {
|
|
|
1764
1764
|
search: {
|
|
1765
1765
|
label: 'Search through {{numberOfWallets}} wallets...',
|
|
1766
1766
|
not_found: {
|
|
1767
|
-
description: '
|
|
1768
|
-
title: '
|
|
1767
|
+
description: 'The wallet you’re looking for may not be available, or linking more than one of these wallets might not be possible.',
|
|
1768
|
+
title: 'Wallet not available',
|
|
1769
1769
|
},
|
|
1770
1770
|
},
|
|
1771
1771
|
title: {
|
|
@@ -1764,8 +1764,8 @@ const translation = {
|
|
|
1764
1764
|
search: {
|
|
1765
1765
|
label: 'Search through {{numberOfWallets}} wallets...',
|
|
1766
1766
|
not_found: {
|
|
1767
|
-
description: '
|
|
1768
|
-
title: '
|
|
1767
|
+
description: 'The wallet you’re looking for may not be available, or linking more than one of these wallets might not be possible.',
|
|
1768
|
+
title: 'Wallet not available',
|
|
1769
1769
|
},
|
|
1770
1770
|
},
|
|
1771
1771
|
title: {
|
|
@@ -1786,8 +1786,8 @@ const translation = {
|
|
|
1786
1786
|
search: {
|
|
1787
1787
|
label: 'Search through {{numberOfWallets}} wallets...',
|
|
1788
1788
|
not_found: {
|
|
1789
|
-
description: '
|
|
1790
|
-
title: '
|
|
1789
|
+
description: 'The wallet you’re looking for may not be available, or linking more than one of these wallets might not be possible.',
|
|
1790
|
+
title: 'Wallet not available',
|
|
1791
1791
|
},
|
|
1792
1792
|
},
|
|
1793
1793
|
title: {
|
|
@@ -82,7 +82,8 @@ const walletListBuilder = ({ authMode, userWallets, multiWallet, numberOfWallets
|
|
|
82
82
|
if (walletConnectorCore.isEmbeddedConnector(wallet.walletConnector)) {
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
else if (wallet.key === 'unknown'
|
|
85
|
+
else if (wallet.key === 'unknown' ||
|
|
86
|
+
!wallet.walletConnector.isAvailable) {
|
|
86
87
|
return;
|
|
87
88
|
}
|
|
88
89
|
else if (isRecommendedWallet) {
|
|
@@ -78,7 +78,8 @@ const walletListBuilder = ({ authMode, userWallets, multiWallet, numberOfWallets
|
|
|
78
78
|
if (isEmbeddedConnector(wallet.walletConnector)) {
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
else if (wallet.key === 'unknown'
|
|
81
|
+
else if (wallet.key === 'unknown' ||
|
|
82
|
+
!wallet.walletConnector.isAvailable) {
|
|
82
83
|
return;
|
|
83
84
|
}
|
|
84
85
|
else if (isRecommendedWallet) {
|
|
@@ -112,7 +112,7 @@ const useSwitchWallet = () => {
|
|
|
112
112
|
throw new Error(`Wallet with id ${walletId} not found`);
|
|
113
113
|
}
|
|
114
114
|
if (((_a = wallet.connector) === null || _a === void 0 ? void 0 : _a.key) === 'unknown') {
|
|
115
|
-
throw new Error("Cannot
|
|
115
|
+
throw new Error("Cannot make this wallet active, since this wallet doesn't have a compatible connector on this device.");
|
|
116
116
|
}
|
|
117
117
|
const { connector } = wallet;
|
|
118
118
|
const email = (_b = user === null || user === void 0 ? void 0 : user.verifiedCredentials.find((verifiedCredential) => verifiedCredential.format === 'email')) === null || _b === void 0 ? void 0 : _b.email;
|
|
@@ -108,7 +108,7 @@ const useSwitchWallet = () => {
|
|
|
108
108
|
throw new Error(`Wallet with id ${walletId} not found`);
|
|
109
109
|
}
|
|
110
110
|
if (((_a = wallet.connector) === null || _a === void 0 ? void 0 : _a.key) === 'unknown') {
|
|
111
|
-
throw new Error("Cannot
|
|
111
|
+
throw new Error("Cannot make this wallet active, since this wallet doesn't have a compatible connector on this device.");
|
|
112
112
|
}
|
|
113
113
|
const { connector } = wallet;
|
|
114
114
|
const email = (_b = user === null || user === void 0 ? void 0 : user.verifiedCredentials.find((verifiedCredential) => verifiedCredential.format === 'email')) === null || _b === void 0 ? void 0 : _b.email;
|
|
@@ -17,7 +17,7 @@ const findWallet = (account, walletOptions) => {
|
|
|
17
17
|
}
|
|
18
18
|
// if we cannot find the correct connector for the wallet, we default to the unknown
|
|
19
19
|
// this way the wallet will appear in user wallets, but will not be able to be interacted with
|
|
20
|
-
return ((_a = walletOptions.find((wallet) => walletKey === wallet.key)) !== null && _a !== void 0 ? _a : walletOptions.find((wallet) => wallet.key === '
|
|
20
|
+
return ((_a = walletOptions.find((wallet) => walletKey === wallet.key)) !== null && _a !== void 0 ? _a : walletOptions.find((wallet) => wallet.key === 'fallbackconnector'));
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
exports.findWallet = findWallet;
|
|
@@ -13,7 +13,7 @@ const findWallet = (account, walletOptions) => {
|
|
|
13
13
|
}
|
|
14
14
|
// if we cannot find the correct connector for the wallet, we default to the unknown
|
|
15
15
|
// this way the wallet will appear in user wallets, but will not be able to be interacted with
|
|
16
|
-
return ((_a = walletOptions.find((wallet) => walletKey === wallet.key)) !== null && _a !== void 0 ? _a : walletOptions.find((wallet) => wallet.key === '
|
|
16
|
+
return ((_a = walletOptions.find((wallet) => walletKey === wallet.key)) !== null && _a !== void 0 ? _a : walletOptions.find((wallet) => wallet.key === 'fallbackconnector'));
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export { findWallet };
|
|
@@ -88,7 +88,7 @@ require('../../views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
|
88
88
|
var useInternalDynamicContext = require('../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
89
89
|
|
|
90
90
|
const Wallet = ({ wallet, ens }) => {
|
|
91
|
-
var _a;
|
|
91
|
+
var _a, _b;
|
|
92
92
|
const { connector, address } = wallet;
|
|
93
93
|
const switchWallet = useSwitchWallet.useSwitchWallet();
|
|
94
94
|
const { setSelectedWalletWithAction, projectSettings, authMode } = useInternalDynamicContext.useInternalDynamicContext();
|
|
@@ -97,7 +97,7 @@ const Wallet = ({ wallet, ens }) => {
|
|
|
97
97
|
{
|
|
98
98
|
Icon: jsxRuntime.jsx(switchHorizontal.ReactComponent, {}),
|
|
99
99
|
callback: () => switchWallet(wallet.id),
|
|
100
|
-
hide: ((_a = wallet.connector) === null || _a === void 0 ? void 0 : _a.key) === 'unknown',
|
|
100
|
+
hide: ((_a = wallet.connector) === null || _a === void 0 ? void 0 : _a.key) === 'unknown' || !((_b = wallet.connector) === null || _b === void 0 ? void 0 : _b.isAvailable),
|
|
101
101
|
text: 'Select wallet',
|
|
102
102
|
},
|
|
103
103
|
];
|
|
@@ -84,7 +84,7 @@ import '../../views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
|
84
84
|
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
85
85
|
|
|
86
86
|
const Wallet = ({ wallet, ens }) => {
|
|
87
|
-
var _a;
|
|
87
|
+
var _a, _b;
|
|
88
88
|
const { connector, address } = wallet;
|
|
89
89
|
const switchWallet = useSwitchWallet();
|
|
90
90
|
const { setSelectedWalletWithAction, projectSettings, authMode } = useInternalDynamicContext();
|
|
@@ -93,7 +93,7 @@ const Wallet = ({ wallet, ens }) => {
|
|
|
93
93
|
{
|
|
94
94
|
Icon: jsx(SvgSwitchHorizontal, {}),
|
|
95
95
|
callback: () => switchWallet(wallet.id),
|
|
96
|
-
hide: ((_a = wallet.connector) === null || _a === void 0 ? void 0 : _a.key) === 'unknown',
|
|
96
|
+
hide: ((_a = wallet.connector) === null || _a === void 0 ? void 0 : _a.key) === 'unknown' || !((_b = wallet.connector) === null || _b === void 0 ? void 0 : _b.isAvailable),
|
|
97
97
|
text: 'Select wallet',
|
|
98
98
|
},
|
|
99
99
|
];
|