@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 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
@@ -3,7 +3,7 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "2.1.4";
6
+ var version = "2.1.5";
7
7
  var dependencies = {
8
8
  "@dynamic-labs/sdk-api-core": "0.0.460",
9
9
  "@hcaptcha/react-hcaptcha": "1.4.4",
package/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client'
2
- var version = "2.1.4";
2
+ var version = "2.1.5";
3
3
  var dependencies = {
4
4
  "@dynamic-labs/sdk-api-core": "0.0.460",
5
5
  "@hcaptcha/react-hcaptcha": "1.4.4",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "2.1.4",
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.4",
21
- "@dynamic-labs/logger": "2.1.4",
22
- "@dynamic-labs/multi-wallet": "2.1.4",
23
- "@dynamic-labs/rpc-provider-ethereum": "2.1.4",
24
- "@dynamic-labs/rpc-provider-solana": "2.1.4",
25
- "@dynamic-labs/rpc-providers": "2.1.4",
26
- "@dynamic-labs/store": "2.1.4",
27
- "@dynamic-labs/types": "2.1.4",
28
- "@dynamic-labs/utils": "2.1.4",
29
- "@dynamic-labs/viem-utils": "2.1.4",
30
- "@dynamic-labs/wallet-book": "2.1.4",
31
- "@dynamic-labs/wallet-connector-core": "2.1.4",
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: 'Try searching for a different wallet',
1772
- title: 'No wallet found.',
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: 'Try searching for a different wallet',
1794
- title: 'No wallet found.',
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: 'Try searching for a different wallet',
1768
- title: 'No wallet found.',
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: 'Try searching for a different wallet',
1768
- title: 'No wallet found.',
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: 'Try searching for a different wallet',
1790
- title: 'No wallet found.',
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 switch to this wallet, as it doesn't have an initialized wallet connector on this platform (desktop/mobile)");
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 switch to this wallet, as it doesn't have an initialized wallet connector on this platform (desktop/mobile)");
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 === 'unknown'));
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 === 'unknown'));
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
  ];