@dynamic-labs/sdk-react-core 0.16.2 → 0.16.3

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,11 @@
1
1
 
2
+ ### [0.16.3](https://github.com/dynamic-labs/DynamicAuth/compare/v0.16.2...v0.16.3) (2023-04-19)
3
+
4
+
5
+ ### Features
6
+
7
+ * add wallet filter by chain name ([#1878](https://github.com/dynamic-labs/DynamicAuth/issues/1878)) ([3587209](https://github.com/dynamic-labs/DynamicAuth/commit/3587209b9bd7305224dac4ebc91dba85ddddcf99))
8
+
2
9
  ### [0.16.2](https://github.com/dynamic-labs/DynamicAuth/compare/v0.16.1...v0.16.2) (2023-04-18)
3
10
 
4
11
 
package/package.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = "0.16.2";
5
+ var version = "0.16.3";
6
6
  var dependencies = {
7
7
  "react-focus-lock": "^2.9.2",
8
8
  "@dynamic-labs/sdk-api": "0.0.174",
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
- var version = "0.16.2";
1
+ var version = "0.16.3";
2
2
  var dependencies = {
3
3
  "react-focus-lock": "^2.9.2",
4
4
  "@dynamic-labs/sdk-api": "0.0.174",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "0.16.2",
3
+ "version": "0.16.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -17,9 +17,9 @@
17
17
  "formik": "^2.2.9",
18
18
  "qrcode": "^1.5.1",
19
19
  "ethers": "^5.7.2",
20
- "@dynamic-labs/logger": "0.16.2",
21
- "@dynamic-labs/multi-wallet": "0.16.2",
22
- "@dynamic-labs/wallet-connector-core": "0.16.2"
20
+ "@dynamic-labs/logger": "0.16.3",
21
+ "@dynamic-labs/multi-wallet": "0.16.3",
22
+ "@dynamic-labs/wallet-connector-core": "0.16.3"
23
23
  },
24
24
  "devDependencies": {
25
25
  "semver": "^7.3.8"
package/src/index.cjs CHANGED
@@ -20,7 +20,7 @@ var validateType = require('./lib/shared/utils/functions/validateType/validateTy
20
20
  var getChainIcon = require('./lib/shared/utils/functions/chain/getChainIcon.cjs');
21
21
  var getChainDisplayName = require('./lib/shared/utils/functions/chain/getChainDisplayName.cjs');
22
22
  var createWallet = require('./lib/shared/utils/functions/wallet/createWallet.cjs');
23
- var index$1 = require('./lib/shared/utils/functions/getValueByKey/index.cjs');
23
+ var index = require('./lib/shared/utils/functions/getValueByKey/index.cjs');
24
24
  var detectBrowser = require('./lib/shared/utils/functions/detectBrowser/detectBrowser.cjs');
25
25
  var shortenWalletAddress = require('./lib/shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
26
26
  var debounce = require('./lib/shared/utils/functions/debounce/debounce.cjs');
@@ -29,7 +29,7 @@ var isDisplayOrderPriorityForWeb3 = require('./lib/shared/utils/functions/isDisp
29
29
  var isDisplayOrderPriorityForWeb2 = require('./lib/shared/utils/functions/isDisplayOrderPriorityForWeb2/isDisplayOrderPriorityForWeb2.cjs');
30
30
  var getWalletListItemLabel = require('./lib/shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.cjs');
31
31
  var useLocalStorage = require('./lib/shared/utils/hooks/useLocalStorage/useLocalStorage.cjs');
32
- var index$2 = require('./lib/shared/utils/hooks/useOnClickOutside/index.cjs');
32
+ var index$1 = require('./lib/shared/utils/hooks/useOnClickOutside/index.cjs');
33
33
  var usePreventPageScroll = require('./lib/shared/utils/hooks/usePreventPageScroll/usePreventPageScroll.cjs');
34
34
  var PhantomLedgerIcon = require('./lib/shared/assets/wallets/PhantomLedgerIcon/PhantomLedgerIcon.cjs');
35
35
  var stroke = require('./lib/shared/assets/stroke.cjs');
@@ -63,7 +63,7 @@ var pencilAltIcon = require('./lib/shared/assets/pencil-alt-icon.cjs');
63
63
  var pencil = require('./lib/shared/assets/pencil.cjs');
64
64
  var tooltipArrow = require('./lib/shared/assets/tooltip-arrow.cjs');
65
65
  var switchHorizontal = require('./lib/shared/assets/switch-horizontal.cjs');
66
- var index$3 = require('./lib/shared/consts/index.cjs');
66
+ var index$2 = require('./lib/shared/consts/index.cjs');
67
67
  var logger = require('./lib/shared/logger.cjs');
68
68
  require('./lib/utils/constants/colors.cjs');
69
69
  var multiWallet = require('@dynamic-labs/multi-wallet');
@@ -98,7 +98,7 @@ var MockContext = require('./lib/context/MockContext/MockContext.cjs');
98
98
  var themesData = require('./lib/context/ThemeContext/themesData.cjs');
99
99
  var getNetwork = require('./lib/utils/functions/getNetwork/getNetwork.cjs');
100
100
  var useAuthenticateConnectedUser = require('./lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.cjs');
101
- var index = require('./lib/utils/functions/walletFilters/index.cjs');
101
+ var index$3 = require('./lib/utils/functions/walletFilters/index.cjs');
102
102
  var DynamicWidgetContext = require('./lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
103
103
  var useEmailVerificationRequest = require('./lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs');
104
104
 
@@ -122,7 +122,7 @@ exports.validateType = validateType.validateType;
122
122
  exports.getChainIcon = getChainIcon.getChainIcon;
123
123
  exports.getChainDisplayName = getChainDisplayName.getChainDisplayName;
124
124
  exports.createWallet = createWallet.createWallet;
125
- exports.getValueByKey = index$1.getValueByKey;
125
+ exports.getValueByKey = index.getValueByKey;
126
126
  exports.detectBrowserName = detectBrowser.detectBrowserName;
127
127
  exports.shortenWalletAddress = shortenWalletAddress.shortenWalletAddress;
128
128
  exports.debounce = debounce.debounce;
@@ -131,7 +131,7 @@ exports.isDisplayOrderPriorityForWeb3 = isDisplayOrderPriorityForWeb3.isDisplayO
131
131
  exports.isDisplayOrderPriorityForWeb2 = isDisplayOrderPriorityForWeb2.isDisplayOrderPriorityForWeb2;
132
132
  exports.getWalletListItemLabel = getWalletListItemLabel.getWalletListItemLabel;
133
133
  exports.useLocalStorage = useLocalStorage.useLocalStorage;
134
- exports.useOnClickOutside = index$2.useOnClickOutside;
134
+ exports.useOnClickOutside = index$1.useOnClickOutside;
135
135
  exports.usePreventPageScroll = usePreventPageScroll.usePreventPageScroll;
136
136
  exports.PhantomLedgerIcon = PhantomLedgerIcon.PhantomLedgerIcon;
137
137
  exports.ArrowIcon = stroke.ReactComponent;
@@ -165,14 +165,14 @@ exports.PencilAltIcon = pencilAltIcon.ReactComponent;
165
165
  exports.PencilIcon = pencil.ReactComponent;
166
166
  exports.TooltipArrow = tooltipArrow.ReactComponent;
167
167
  exports.SwitchHorizontalIcon = switchHorizontal.ReactComponent;
168
- exports.authModalZIndex = index$3.authModalZIndex;
169
- exports.countryCodes = index$3.countryCodes;
170
- exports.defaultWalletsForChains = index$3.defaultWalletsForChains;
171
- exports.tShirtSizes = index$3.tShirtSizes;
172
- exports.teamNames = index$3.teamNames;
173
- exports.toolkitZIndex = index$3.toolkitZIndex;
174
- exports.tooltipZIndex = index$3.tooltipZIndex;
175
- exports.widgetModalZIndex = index$3.widgetModalZIndex;
168
+ exports.authModalZIndex = index$2.authModalZIndex;
169
+ exports.countryCodes = index$2.countryCodes;
170
+ exports.defaultWalletsForChains = index$2.defaultWalletsForChains;
171
+ exports.tShirtSizes = index$2.tShirtSizes;
172
+ exports.teamNames = index$2.teamNames;
173
+ exports.toolkitZIndex = index$2.toolkitZIndex;
174
+ exports.tooltipZIndex = index$2.tooltipZIndex;
175
+ exports.widgetModalZIndex = index$2.widgetModalZIndex;
176
176
  exports.logger = logger.logger;
177
177
  Object.defineProperty(exports, 'normalizeWalletName', {
178
178
  enumerable: true,
@@ -201,10 +201,11 @@ exports.getThemeConfig = themesData.getThemeConfig;
201
201
  exports.themesData = themesData.themesData;
202
202
  exports.getNetwork = getNetwork.getNetwork;
203
203
  exports.useAuthenticateConnectedUser = useAuthenticateConnectedUser.useAuthenticateConnectedUser;
204
- exports.FilterAndSortWallets = index.FilterAndSortWallets;
205
- exports.FilterWallets = index.FilterWallets;
206
- exports.RemoveWallets = index.RemoveWallets;
207
- exports.SortWallets = index.SortWallets;
208
- exports.UniswapFilter = index.UniswapFilter;
204
+ exports.FilterAndSortWallets = index$3.FilterAndSortWallets;
205
+ exports.FilterWallets = index$3.FilterWallets;
206
+ exports.FilterWalletsByChainName = index$3.FilterWalletsByChainName;
207
+ exports.RemoveWallets = index$3.RemoveWallets;
208
+ exports.SortWallets = index$3.SortWallets;
209
+ exports.UniswapFilter = index$3.UniswapFilter;
209
210
  exports.DynamicWidgetContextProvider = DynamicWidgetContext.DynamicWidgetContextProvider;
210
211
  exports.useEmailVerificationRequest = useEmailVerificationRequest.useEmailVerificationRequest;
package/src/index.d.ts CHANGED
@@ -13,13 +13,13 @@ export * from './lib/context/MockContext';
13
13
  export * from './lib/context/ThemeContext/themesData';
14
14
  export type { ViewType } from './lib/context/ViewContext';
15
15
  export type { EvmNetwork, NotSupportedError, NoAccessError, ChainalysisError, EmailAlreadyExistsError, UsernameAlreadyExistsError, WalletNotDeployedError, WalletUsedError, EmailVerificationError, } from '@dynamic-labs/multi-wallet';
16
- export type { WalletConnector } from '@dynamic-labs/wallet-connector-core';
16
+ export type { WalletConnector, Chain, } from '@dynamic-labs/wallet-connector-core';
17
17
  export { normalizeWalletName } from '@dynamic-labs/multi-wallet';
18
18
  export { isSameWalletName } from './lib/utils/functions/isSameWalletName';
19
19
  export { classNames } from './lib/utils/functions/classNames';
20
20
  export { getNetwork } from './lib/utils/functions/getNetwork';
21
21
  export { useAuthenticateConnectedUser } from './lib/utils/hooks/useAuthenticateConnectedUser';
22
- export { FilterWallets, RemoveWallets, SortWallets, FilterAndSortWallets, UniswapFilter, } from './lib/utils/functions/walletFilters';
22
+ export * from './lib/utils/functions/walletFilters';
23
23
  export { useWalletItemActions } from './lib/utils/hooks/useWalletItemActions';
24
24
  export { DynamicWidgetContextProvider } from './lib/widgets/DynamicWidget/context';
25
25
  export { useUserUpdateRequest } from './lib/utils/hooks/useUserUpdateRequest/useUserUpdateRequest';
package/src/index.js CHANGED
@@ -94,6 +94,6 @@ export { MockContext, MockContextProvider, MockContextWrapper, useMockContext }
94
94
  export { getDefaultColor, getThemeConfig, themesData } from './lib/context/ThemeContext/themesData.js';
95
95
  export { getNetwork } from './lib/utils/functions/getNetwork/getNetwork.js';
96
96
  export { useAuthenticateConnectedUser } from './lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.js';
97
- export { FilterAndSortWallets, FilterWallets, RemoveWallets, SortWallets, UniswapFilter } from './lib/utils/functions/walletFilters/index.js';
97
+ export { FilterAndSortWallets, FilterWallets, FilterWalletsByChainName, RemoveWallets, SortWallets, UniswapFilter } from './lib/utils/functions/walletFilters/index.js';
98
98
  export { DynamicWidgetContextProvider } from './lib/widgets/DynamicWidget/context/DynamicWidgetContext.js';
99
99
  export { useEmailVerificationRequest } from './lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js';
@@ -74,10 +74,6 @@ export interface VerifyWallet {
74
74
  walletName: string;
75
75
  walletProvider: WalletProvider;
76
76
  }
77
- export interface Chain {
78
- enabled: boolean;
79
- name: string;
80
- }
81
77
  export type OnAuthSuccess = (params: {
82
78
  authToken: string;
83
79
  handleLogOut: () => Promise<void>;
@@ -24,6 +24,7 @@ const SortWallets = (sortedWalletKeys) => (wallets) => [...wallets].sort((wallet
24
24
  });
25
25
  const FilterWallets = (walletKeys) => (wallets) => wallets.filter((wallet) => walletKeys.includes(wallet.key));
26
26
  const RemoveWallets = (walletKeys) => (wallets) => wallets.filter((wallet) => !walletKeys.includes(wallet.key));
27
+ const FilterWalletsByChainName = (chainName) => (wallets) => wallets.filter((wallet) => wallet.walletConnector.supportedChains.includes(chainName));
27
28
  /**
28
29
  * Filters and sorts the wallet selection by the provided sortedWalletKeys.
29
30
  * This filter should be used when you only want specific wallets to be available
@@ -37,6 +38,7 @@ const UniswapFilter = () => (wallets) => FilterAndSortWallets(['uniswap', 'metam
37
38
 
38
39
  exports.FilterAndSortWallets = FilterAndSortWallets;
39
40
  exports.FilterWallets = FilterWallets;
41
+ exports.FilterWalletsByChainName = FilterWalletsByChainName;
40
42
  exports.RemoveWallets = RemoveWallets;
41
43
  exports.SortWallets = SortWallets;
42
44
  exports.UniswapFilter = UniswapFilter;
@@ -1,3 +1,4 @@
1
+ import { Chain } from '@dynamic-labs/wallet-connector-core';
1
2
  import { WalletOption } from '../../../shared';
2
3
  /**
3
4
  * Sorts the provided wallets by the provided sortedWalletKeys
@@ -9,6 +10,7 @@ import { WalletOption } from '../../../shared';
9
10
  export declare const SortWallets: (sortedWalletKeys: string[]) => (wallets: WalletOption[]) => WalletOption[];
10
11
  export declare const FilterWallets: (walletKeys: string[]) => (wallets: WalletOption[]) => WalletOption[];
11
12
  export declare const RemoveWallets: (walletKeys: string[]) => (wallets: WalletOption[]) => WalletOption[];
13
+ export declare const FilterWalletsByChainName: (chainName: Chain) => (wallets: WalletOption[]) => WalletOption[];
12
14
  /**
13
15
  * Filters and sorts the wallet selection by the provided sortedWalletKeys.
14
16
  * This filter should be used when you only want specific wallets to be available
@@ -20,6 +20,7 @@ const SortWallets = (sortedWalletKeys) => (wallets) => [...wallets].sort((wallet
20
20
  });
21
21
  const FilterWallets = (walletKeys) => (wallets) => wallets.filter((wallet) => walletKeys.includes(wallet.key));
22
22
  const RemoveWallets = (walletKeys) => (wallets) => wallets.filter((wallet) => !walletKeys.includes(wallet.key));
23
+ const FilterWalletsByChainName = (chainName) => (wallets) => wallets.filter((wallet) => wallet.walletConnector.supportedChains.includes(chainName));
23
24
  /**
24
25
  * Filters and sorts the wallet selection by the provided sortedWalletKeys.
25
26
  * This filter should be used when you only want specific wallets to be available
@@ -31,4 +32,4 @@ const FilterAndSortWallets = (sortedWalletKeys) => (wallets) => {
31
32
  };
32
33
  const UniswapFilter = () => (wallets) => FilterAndSortWallets(['uniswap', 'metamask', 'coinbase', 'walletconnect'])(wallets);
33
34
 
34
- export { FilterAndSortWallets, FilterWallets, RemoveWallets, SortWallets, UniswapFilter };
35
+ export { FilterAndSortWallets, FilterWallets, FilterWalletsByChainName, RemoveWallets, SortWallets, UniswapFilter };