@dynamic-labs/multi-wallet 0.18.0-RC.1 → 0.18.0-RC.11

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,167 @@
1
1
 
2
+ ## [0.18.0-RC.11](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.10...v0.18.0-RC.11) (2023-07-07)
3
+
4
+
5
+ ### Features
6
+
7
+ * **DYN-2384:** expose useDynamicScopes hook ([#2179](https://github.com/dynamic-labs/DynamicAuth/issues/2179)) ([c224749](https://github.com/dynamic-labs/DynamicAuth/commit/c2247493d9c99dab7e41d7d8d156ae7e478973bc))
8
+ * **DynamicBridgeWidget:** add UI inline widget to match designs ([#2587](https://github.com/dynamic-labs/DynamicAuth/issues/2587)) ([d623aec](https://github.com/dynamic-labs/DynamicAuth/commit/d623aecda6388b67e40a3f8dabb03ca03a6f22b6))
9
+ * support starknet networks ([#2579](https://github.com/dynamic-labs/DynamicAuth/issues/2579)) ([a01545e](https://github.com/dynamic-labs/DynamicAuth/commit/a01545e0cf8e4e19a22dc64877d590d78647c579))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * metamask getConnectedAccounts triggering an infinite loop ([#2580](https://github.com/dynamic-labs/DynamicAuth/issues/2580)) ([e025cea](https://github.com/dynamic-labs/DynamicAuth/commit/e025cea33e4a95ea2a03ac11e47a88a73db39848))
15
+
16
+ ## [0.18.0-RC.10](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.9...v0.18.0-RC.10) (2023-07-06)
17
+
18
+
19
+ ### Features
20
+
21
+ * Update handleUnlink to support connected only wallets ([#2573](https://github.com/dynamic-labs/DynamicAuth/issues/2573)) ([07438c9](https://github.com/dynamic-labs/DynamicAuth/commit/07438c9580b830aa68fcc6a06ea4050a3743a501))
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * restore connectedWallet clearing function ([#2575](https://github.com/dynamic-labs/DynamicAuth/issues/2575)) ([8d3c41a](https://github.com/dynamic-labs/DynamicAuth/commit/8d3c41a6871037b1003270e724259f23c5f6f370))
27
+
28
+ ## [0.18.0-RC.9](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.8...v0.18.0-RC.9) (2023-07-04)
29
+
30
+
31
+ ### Features
32
+
33
+ * add Network Not Supported prompt to connect-only & show prompt before sign in connect-sign mode ([#2474](https://github.com/dynamic-labs/DynamicAuth/issues/2474)) ([8d5bfa9](https://github.com/dynamic-labs/DynamicAuth/commit/8d5bfa97ca4da50e06ce258a38a63e7407a795f6))
34
+ * **DYN-2602:** add ability to unlink connected wallet ([#2494](https://github.com/dynamic-labs/DynamicAuth/issues/2494)) ([389861b](https://github.com/dynamic-labs/DynamicAuth/commit/389861bc0281baec379b1593e529cef3467f3326))
35
+ * **DYN-2604:** add chainId property to walletsByChain object ([#2405](https://github.com/dynamic-labs/DynamicAuth/issues/2405)) ([d9b42f7](https://github.com/dynamic-labs/DynamicAuth/commit/d9b42f7b1d53dac1ed0228ecb5e56a44c6abd8d2))
36
+ * **DynamicAuthLayout:** show connected wallet progress ([#2567](https://github.com/dynamic-labs/DynamicAuth/issues/2567)) ([a20ff6f](https://github.com/dynamic-labs/DynamicAuth/commit/a20ff6f32b360ccc699d2a271c7a96751ae87d29))
37
+ * **DynamicBridgeFlow:** add bridge flow ([#2543](https://github.com/dynamic-labs/DynamicAuth/issues/2543)) ([79c4c87](https://github.com/dynamic-labs/DynamicAuth/commit/79c4c870d47a0c853c292a8d913bd9be9e209a15))
38
+
39
+
40
+ ### Bug Fixes
41
+
42
+ * don't force required chain to eth in case is not enabled ([#2537](https://github.com/dynamic-labs/DynamicAuth/issues/2537)) ([b01d6c9](https://github.com/dynamic-labs/DynamicAuth/commit/b01d6c9e91e9971e82739c5a2c900de4768f977c))
43
+ * log out if there's any session sync issue ([#2545](https://github.com/dynamic-labs/DynamicAuth/issues/2545)) ([29972fa](https://github.com/dynamic-labs/DynamicAuth/commit/29972fad1067f5550a61f6e2cd9adcaf811fd268))
44
+ * persist chain to WalletConnect session when changed in wallet ([#2556](https://github.com/dynamic-labs/DynamicAuth/issues/2556)) ([fc9ec35](https://github.com/dynamic-labs/DynamicAuth/commit/fc9ec3501de1e3235adee4df95b296dc22cce23e))
45
+ * WC2 sign-message on non-selected chain ([#2544](https://github.com/dynamic-labs/DynamicAuth/issues/2544)) ([48a4384](https://github.com/dynamic-labs/DynamicAuth/commit/48a4384f77c29775e0c28ed335956cfbd6f89ca3))
46
+ * **wcv2:** add eth_signTypedData_v4 to optional methods ([#2527](https://github.com/dynamic-labs/DynamicAuth/issues/2527)) ([b99474b](https://github.com/dynamic-labs/DynamicAuth/commit/b99474b81b083134762be0fe9554a6f049b3edda))
47
+ * **wcv2:** allow getWeb3Provider to wait to provider init ([#2523](https://github.com/dynamic-labs/DynamicAuth/issues/2523)) ([d9c7fee](https://github.com/dynamic-labs/DynamicAuth/commit/d9c7fee10d2a6c766043515e19829fd7e3d5b2ef))
48
+
49
+ ## [0.18.0-RC.8](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.7...v0.18.0-RC.8) (2023-06-29)
50
+
51
+
52
+ ### Features
53
+
54
+ * add support for custom walletconnect v1 bridge ([#2487](https://github.com/dynamic-labs/DynamicAuth/issues/2487)) ([5b0ca2e](https://github.com/dynamic-labs/DynamicAuth/commit/5b0ca2e4e8aa241ed13e4f38346c31da8479a6c4))
55
+ * **DYN-2623:** improve error message on sign cancellation for wallets ([#2493](https://github.com/dynamic-labs/DynamicAuth/issues/2493)) ([081c515](https://github.com/dynamic-labs/DynamicAuth/commit/081c515c9d28d6fa4c0eaac388ee421a7b23144b))
56
+
57
+
58
+ ### Bug Fixes
59
+
60
+ * clearing the activeAccount value ([#2469](https://github.com/dynamic-labs/DynamicAuth/issues/2469)) ([ff75bde](https://github.com/dynamic-labs/DynamicAuth/commit/ff75bde938a4178541568b79754f773607b9d87f))
61
+ * don't initialize provider if it's already initialized ([#2490](https://github.com/dynamic-labs/DynamicAuth/issues/2490)) ([878d38f](https://github.com/dynamic-labs/DynamicAuth/commit/878d38f5c8d7d7448c65e58b25cefd9f3518217e))
62
+ * more wcv2 improvements ([#2475](https://github.com/dynamic-labs/DynamicAuth/issues/2475)) ([13baa84](https://github.com/dynamic-labs/DynamicAuth/commit/13baa84218d6259d02df7d8c387b40dc3cb11ce5)), closes [#2469](https://github.com/dynamic-labs/DynamicAuth/issues/2469) [#2470](https://github.com/dynamic-labs/DynamicAuth/issues/2470) [#2471](https://github.com/dynamic-labs/DynamicAuth/issues/2471) [#2477](https://github.com/dynamic-labs/DynamicAuth/issues/2477) [#2479](https://github.com/dynamic-labs/DynamicAuth/issues/2479) [#2471](https://github.com/dynamic-labs/DynamicAuth/issues/2471) [#2476](https://github.com/dynamic-labs/DynamicAuth/issues/2476)
63
+ * multiple improvements for WC2 ([#2458](https://github.com/dynamic-labs/DynamicAuth/issues/2458)) ([0813af2](https://github.com/dynamic-labs/DynamicAuth/commit/0813af2aafa8019868117084efe8ae147ac24581))
64
+ * revert changes since latest wcv2 improvements ([#2473](https://github.com/dynamic-labs/DynamicAuth/issues/2473)) ([3375371](https://github.com/dynamic-labs/DynamicAuth/commit/337537101a13d67b860748b62f172eba01d0b461)), closes [#2471](https://github.com/dynamic-labs/DynamicAuth/issues/2471) [#2470](https://github.com/dynamic-labs/DynamicAuth/issues/2470) [#2469](https://github.com/dynamic-labs/DynamicAuth/issues/2469)
65
+ * sync issue within connect-only mode ([#2496](https://github.com/dynamic-labs/DynamicAuth/issues/2496)) ([44af274](https://github.com/dynamic-labs/DynamicAuth/commit/44af274618c30fe65ec95739cd16a8ddde08e34e))
66
+ * typo in terms of service ([#2401](https://github.com/dynamic-labs/DynamicAuth/issues/2401)) ([5b195e5](https://github.com/dynamic-labs/DynamicAuth/commit/5b195e54479d9a88bd017fc45f2f2455d1caedc4))
67
+ * **wc_v1_bridget:** disable WC v2 when WC v1 bridge is set ([#2505](https://github.com/dynamic-labs/DynamicAuth/issues/2505)) ([b3f0a68](https://github.com/dynamic-labs/DynamicAuth/commit/b3f0a6895095bb37c635984fc970b52446e04f56))
68
+ * wc2 android improvements ([#2488](https://github.com/dynamic-labs/DynamicAuth/issues/2488)) ([f60ef9c](https://github.com/dynamic-labs/DynamicAuth/commit/f60ef9c1dd672f78199eee40edbe2707c043e1b5))
69
+ * **wcv2:** make sure to clear active account when ending session ([#2471](https://github.com/dynamic-labs/DynamicAuth/issues/2471)) ([b766df3](https://github.com/dynamic-labs/DynamicAuth/commit/b766df39a7e4dabc54fda9131b7bd9b53895cf2f))
70
+ * **wcv2:** use native or universal link when signing message ([#2502](https://github.com/dynamic-labs/DynamicAuth/issues/2502)) ([6e3e3fb](https://github.com/dynamic-labs/DynamicAuth/commit/6e3e3fbb58fb9e3eb314e6631ac2123237f41e8c))
71
+
72
+ ## [0.18.0-RC.7](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.6...v0.18.0-RC.7) (2023-06-23)
73
+
74
+
75
+ ### Features
76
+
77
+ * add bridge connect button ([#2399](https://github.com/dynamic-labs/DynamicAuth/issues/2399)) ([6987eea](https://github.com/dynamic-labs/DynamicAuth/commit/6987eeae8f49a5d077de6c4343b83ecbb1fc8b89))
78
+ * add useTimeout, useInterval and useIsomorphicLayoutEffect hooks ([#2418](https://github.com/dynamic-labs/DynamicAuth/issues/2418)) ([3ed8595](https://github.com/dynamic-labs/DynamicAuth/commit/3ed859526a6ec982b61a4335a9a63512d0e631e3))
79
+ * **DYN-2411:** WalletLockedView when user has valid jwt and all of their wallets are disconnected ([#2273](https://github.com/dynamic-labs/DynamicAuth/issues/2273)) ([2e6d0d6](https://github.com/dynamic-labs/DynamicAuth/commit/2e6d0d6ed734eb628bd05b6ad64560c496ad915f))
80
+ * **DYN-2598:** add powered by, update copy and paddings in the select wallet chain layout ([#2391](https://github.com/dynamic-labs/DynamicAuth/issues/2391)) ([f2a7924](https://github.com/dynamic-labs/DynamicAuth/commit/f2a79241dcf1ea5720242c2cc65a6fcd077ea0e9))
81
+ * **solana:** add logic to get network based on genesis hash ([#2402](https://github.com/dynamic-labs/DynamicAuth/issues/2402)) ([b76c626](https://github.com/dynamic-labs/DynamicAuth/commit/b76c62660bae334aef84678db5d8349a3d575630))
82
+
83
+
84
+ ### Bug Fixes
85
+
86
+ * better handling of the CB wallet provider ([#2376](https://github.com/dynamic-labs/DynamicAuth/issues/2376)) ([720e510](https://github.com/dynamic-labs/DynamicAuth/commit/720e510d0793c530d06db5eaa1d5a7be608703bb))
87
+ * clear AUTH_USER when there is no AUTH_TOKEN on LS ([#2423](https://github.com/dynamic-labs/DynamicAuth/issues/2423)) ([bf1e1c0](https://github.com/dynamic-labs/DynamicAuth/commit/bf1e1c0f8a7a7a852c67ef363613deecacdad92e))
88
+ * set auth mode to connect-and-sign when verifiying wallet ([#2369](https://github.com/dynamic-labs/DynamicAuth/issues/2369)) ([666aa69](https://github.com/dynamic-labs/DynamicAuth/commit/666aa6954d19551a354af933a69ab8eeee7a98b5))
89
+ * use getAuthTokenValue in initExpirationTime ([#2422](https://github.com/dynamic-labs/DynamicAuth/issues/2422)) ([fa8ff78](https://github.com/dynamic-labs/DynamicAuth/commit/fa8ff78d64421ca4447794fe9af53c175adf94c3))
90
+
91
+ ## [0.18.0-RC.6](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.5...v0.18.0-RC.6) (2023-06-20)
92
+
93
+
94
+ ### Features
95
+
96
+ * add export keys option for magic wallets ([#2377](https://github.com/dynamic-labs/DynamicAuth/issues/2377)) ([6b40f53](https://github.com/dynamic-labs/DynamicAuth/commit/6b40f538f207691b54fe2f245ed6018c467b83fe))
97
+
98
+
99
+ ### Bug Fixes
100
+
101
+ * add polyfill for css layers ([#2386](https://github.com/dynamic-labs/DynamicAuth/issues/2386)) ([3d489f5](https://github.com/dynamic-labs/DynamicAuth/commit/3d489f59d676864134a94d031697e0f83fc0d742))
102
+
103
+ ## [0.18.0-RC.5](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.4...v0.18.0-RC.5) (2023-06-20)
104
+
105
+
106
+ ### Bug Fixes
107
+
108
+ * remove process variable declaration ([#2389](https://github.com/dynamic-labs/DynamicAuth/issues/2389)) ([3c05121](https://github.com/dynamic-labs/DynamicAuth/commit/3c05121473850444f2c8393fa6e98e10d58870bc))
109
+ * wallet book singleton class to initalize when walletBook is undefined ([#2392](https://github.com/dynamic-labs/DynamicAuth/issues/2392)) ([7e07137](https://github.com/dynamic-labs/DynamicAuth/commit/7e0713712321439ee48e0c9ec88fef8c9aecd9cf))
110
+
111
+ ## [0.18.0-RC.4](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.3...v0.18.0-RC.4) (2023-06-20)
112
+
113
+
114
+ ### ⚠ BREAKING CHANGES
115
+
116
+ * **DYN-1260:** integrate wallets group view with group logic (#2305)
117
+
118
+ ### Features
119
+
120
+ * **DYN-1260:** integrate wallets group view with group logic ([#2305](https://github.com/dynamic-labs/DynamicAuth/issues/2305)) ([d5adb41](https://github.com/dynamic-labs/DynamicAuth/commit/d5adb411f263d1583abe5102e60d02573c6bf416))
121
+
122
+
123
+ ### Bug Fixes
124
+
125
+ * **DYN-2507:** too long network name shrinks users avatar ([#2383](https://github.com/dynamic-labs/DynamicAuth/issues/2383)) ([8586c3b](https://github.com/dynamic-labs/DynamicAuth/commit/8586c3be5a499118b7229eb7a3702d3350642107))
126
+ * hide wallet menu items that are not needed ([#2375](https://github.com/dynamic-labs/DynamicAuth/issues/2375)) ([35a6723](https://github.com/dynamic-labs/DynamicAuth/commit/35a67234da47f1a992a94c17e445b1fcba1c700f))
127
+ * use overflow auto to avoid showing the disabled scrollbar on gecko browser ([#2382](https://github.com/dynamic-labs/DynamicAuth/issues/2382)) ([16a7db4](https://github.com/dynamic-labs/DynamicAuth/commit/16a7db49e5b154bc6a4ea263c8a8c8a92cf1d810))
128
+ * use primary color for wallet group item copy ([#2384](https://github.com/dynamic-labs/DynamicAuth/issues/2384)) ([3fe439e](https://github.com/dynamic-labs/DynamicAuth/commit/3fe439ea2a271bc4b24b145db3f70774e221723e))
129
+
130
+ ## [0.18.0-RC.3](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.2...v0.18.0-RC.3) (2023-06-16)
131
+
132
+
133
+ ### Features
134
+
135
+ * add skeleton to walletlistfooter ([#2361](https://github.com/dynamic-labs/DynamicAuth/issues/2361)) ([676be6c](https://github.com/dynamic-labs/DynamicAuth/commit/676be6c108dff8df7175f0587cf0568658276e4e))
136
+
137
+
138
+ ### Bug Fixes
139
+
140
+ * **local-storage:** load auth token when stringified ([#2368](https://github.com/dynamic-labs/DynamicAuth/issues/2368)) ([3a54266](https://github.com/dynamic-labs/DynamicAuth/commit/3a54266fde3cd1f7362ccc490f89b8925132271b))
141
+
142
+ ## [0.18.0-RC.2](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.1...v0.18.0-RC.2) (2023-06-16)
143
+
144
+
145
+ ### Features
146
+
147
+ * add Dynamic Bridge widget ([#2316](https://github.com/dynamic-labs/DynamicAuth/issues/2316)) ([0e71a88](https://github.com/dynamic-labs/DynamicAuth/commit/0e71a88c6dd740583448ed7b45fa335aaa736079))
148
+ * add search bar to bridge wallets view ([#2357](https://github.com/dynamic-labs/DynamicAuth/issues/2357)) ([a8415fc](https://github.com/dynamic-labs/DynamicAuth/commit/a8415fc744216660a78c1443962711699e45429a))
149
+ * bridge flow improvements ([#2367](https://github.com/dynamic-labs/DynamicAuth/issues/2367)) ([38a44be](https://github.com/dynamic-labs/DynamicAuth/commit/38a44be417fd1363b0d8e45ec1834f9aaf680427))
150
+ * **Bridge:** add bridge navigation component ([#2340](https://github.com/dynamic-labs/DynamicAuth/issues/2340)) ([1e9adae](https://github.com/dynamic-labs/DynamicAuth/commit/1e9adaed3682bc9a7aab385221818946cad397f2))
151
+ * **Bridge:** integrate dynamic bridge ui ([#2354](https://github.com/dynamic-labs/DynamicAuth/issues/2354)) ([1465bf8](https://github.com/dynamic-labs/DynamicAuth/commit/1465bf8717cbc9905285c2d867bc3e1d0cd1114b))
152
+ * **DYN-2519:** create state for multiple connected wallets ([#2326](https://github.com/dynamic-labs/DynamicAuth/issues/2326)) ([fc05aa4](https://github.com/dynamic-labs/DynamicAuth/commit/fc05aa4d91b0af8950c5da84c69130557ba36b09)), closes [#2319](https://github.com/dynamic-labs/DynamicAuth/issues/2319)
153
+ * **MultiWalletStepSelectorModal:** add modal to connect multiple wallets ([#2348](https://github.com/dynamic-labs/DynamicAuth/issues/2348)) ([39ce0b2](https://github.com/dynamic-labs/DynamicAuth/commit/39ce0b26fdf6494a4e1ba7867e80bf399d11631f))
154
+ * use wallet-book from CDN ([#2352](https://github.com/dynamic-labs/DynamicAuth/issues/2352)) ([9d1498f](https://github.com/dynamic-labs/DynamicAuth/commit/9d1498f2aec4bb9f3e3d6b386d9cafea3a33bd58))
155
+
156
+
157
+ ### Bug Fixes
158
+
159
+ * handle email only without primary wallet state ([#2342](https://github.com/dynamic-labs/DynamicAuth/issues/2342)) ([98583bb](https://github.com/dynamic-labs/DynamicAuth/commit/98583bb8820ac80967bf1059cbaf47d04bfd603a))
160
+ * s3 cp for walletbook json ([8127b79](https://github.com/dynamic-labs/DynamicAuth/commit/8127b790333b36f40a2cc230a576c01aaad42196))
161
+ * setting initial view when error in auth flow ([#2345](https://github.com/dynamic-labs/DynamicAuth/issues/2345)) ([85dcefb](https://github.com/dynamic-labs/DynamicAuth/commit/85dcefb54be498b540904b381b53f9ea7e0cd024))
162
+ * typo in github action ([d746bc0](https://github.com/dynamic-labs/DynamicAuth/commit/d746bc01981a3263e3ab4f654debf77b408cda3a))
163
+ * **widget:** add fallback icon when oauth provider does not exist ([#2349](https://github.com/dynamic-labs/DynamicAuth/issues/2349)) ([bd2a505](https://github.com/dynamic-labs/DynamicAuth/commit/bd2a505724affd6f5356c0c4f31586ffd188e539))
164
+
2
165
  ## [0.18.0-RC.1](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.0...v0.18.0-RC.1) (2023-06-14)
3
166
 
4
167
 
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@dynamic-labs/multi-wallet",
3
- "version": "0.18.0-RC.1",
3
+ "version": "0.18.0-RC.11",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
7
7
  "directory": "packages/multi-wallet"
8
8
  },
9
9
  "dependencies": {
10
- "@dynamic-labs/sdk-api": "0.0.218",
10
+ "@dynamic-labs/sdk-api": "0.0.222",
11
11
  "ethers": "5.7.2",
12
12
  "tslib": "2.4.1",
13
- "@dynamic-labs/rpc-providers": "0.18.0-RC.1",
14
- "@dynamic-labs/types": "0.18.0-RC.1",
15
- "@dynamic-labs/utils": "0.18.0-RC.1",
16
- "@dynamic-labs/wallet-book": "0.18.0-RC.1",
17
- "@dynamic-labs/wallet-connector-core": "0.18.0-RC.1"
13
+ "@dynamic-labs/rpc-providers": "0.18.0-RC.11",
14
+ "@dynamic-labs/types": "0.18.0-RC.11",
15
+ "@dynamic-labs/utils": "0.18.0-RC.11",
16
+ "@dynamic-labs/wallet-book": "0.18.0-RC.11",
17
+ "@dynamic-labs/wallet-connector-core": "0.18.0-RC.11"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@walletconnect/types": "2.4.2"
@@ -20,13 +20,14 @@ const defaultWalletUiUtils = {
20
20
  },
21
21
  };
22
22
  const getSupportedWallets = (args) => {
23
- const { appLogoUrl = '', appName = '', chainRpcProviders, flowNetwork, isWalletConnectV2Enabled = false, networkConfigurations = { cosmos: [], evm: [], solana: [], starknet: [] }, customerApiProviders = [], skipMemo = false, walletConnectProjectId = '', walletConnectorsProp, walletUiUtils = undefined, } = args;
23
+ const { appLogoUrl = '', appName = '', chainRpcProviders, flowNetwork, isWalletConnectV2Enabled = false, networkConfigurations = { cosmos: [], evm: [], solana: [], starknet: [] }, customerApiProviders = [], skipMemo = false, walletConnectProjectId = '', walletConnectorsProp, walletUiUtils = undefined, walletBook, walletConnectV1Bridge, } = args;
24
24
  if (!skipMemo && wallets.length > 0) {
25
25
  return wallets;
26
26
  }
27
27
  const evmNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.evm) || [];
28
28
  const solanaNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.solana) || [];
29
29
  const cosmosNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.cosmos) || [];
30
+ const starknetNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.starknet) || [];
30
31
  const apiProviders = getApiProviders.getApiProviders(customerApiProviders);
31
32
  const opts = {
32
33
  apiProviders,
@@ -39,6 +40,9 @@ const getSupportedWallets = (args) => {
39
40
  isWalletConnectV2Enabled,
40
41
  projectId: walletConnectProjectId,
41
42
  solNetworks: solanaNetworkConfigs,
43
+ starknetNetworks: starknetNetworkConfigs,
44
+ walletBook,
45
+ walletConnectV1Bridge,
42
46
  walletUiUtils: walletUiUtils || defaultWalletUiUtils,
43
47
  };
44
48
  const allWallets = walletConnectorsProp
@@ -46,19 +50,19 @@ const getSupportedWallets = (args) => {
46
50
  .flat()
47
51
  .map((wallet) => new wallet(opts).getMobileOrInstalledWallet());
48
52
  // Memoize the wallets
49
- const filteredWallets = filterWalletsForPlatform(allWallets);
50
- wallets = applyLinksOverrides(filteredWallets);
53
+ const filteredWallets = filterWalletsForPlatform(walletBook, allWallets);
54
+ wallets = applyLinksOverrides(walletBook, filteredWallets);
51
55
  return wallets;
52
56
  };
53
- const applyLinksOverrides = (wallets) => wallets.map((wallet) => {
54
- const metadata = walletBook.getWalletBookWallet(wallet.name);
57
+ const applyLinksOverrides = (walletBook$1, wallets) => wallets.map((wallet) => {
58
+ const metadata = walletBook.getWalletBookWallet(walletBook$1, wallet.name);
55
59
  if (metadata.switchNetworkOnlyFromWallet !== undefined) {
56
60
  wallet.switchNetworkOnlyFromWallet = metadata.switchNetworkOnlyFromWallet;
57
61
  }
58
62
  return wallet;
59
63
  });
60
- const filterWalletsForPlatform = (wallets) => wallets.filter((wallet) => {
61
- const metadata = walletBook.getWalletBookWallet(wallet.name);
64
+ const filterWalletsForPlatform = (walletBook$1, wallets) => wallets.filter((wallet) => {
65
+ const metadata = walletBook.getWalletBookWallet(walletBook$1, wallet.name);
62
66
  if (wallet.isInstalledOnBrowser()) {
63
67
  return true;
64
68
  }
@@ -72,10 +76,10 @@ const filterWalletsForPlatform = (wallets) => wallets.filter((wallet) => {
72
76
  return true;
73
77
  }
74
78
  else {
75
- return handleMobileWalletFilter(wallet.name, metadata);
79
+ return handleMobileWalletFilter(walletBook$1, wallet.name, metadata);
76
80
  }
77
81
  });
78
- const handleMobileWalletFilter = (walletName, metadata) => {
82
+ const handleMobileWalletFilter = (walletBook$1, walletName, metadata) => {
79
83
  if (!metadata.mobile)
80
84
  return false;
81
85
  /**
@@ -87,13 +91,13 @@ const handleMobileWalletFilter = (walletName, metadata) => {
87
91
  const hasWalletConnectLink = Boolean(metadata.mobile.universal) || Boolean(metadata.mobile.native);
88
92
  const isWalletConnectWallet = metadata.walletConnect !== undefined;
89
93
  if (utils.isIPad() || utils.isIPhone()) {
90
- const hasIOSLink = Boolean(walletBook.getWalletLinks(walletName).ios);
94
+ const hasIOSLink = Boolean(walletBook.getWalletLinks(walletBook$1, walletName).ios);
91
95
  return !isWalletConnectWallet
92
96
  ? hasIOSLink
93
97
  : hasIOSLink && hasWalletConnectLink;
94
98
  }
95
99
  else {
96
- const hasAndroidLink = Boolean(walletBook.getWalletLinks(walletName).android);
100
+ const hasAndroidLink = Boolean(walletBook.getWalletLinks(walletBook$1, walletName).android);
97
101
  return !isWalletConnectWallet
98
102
  ? hasAndroidLink
99
103
  : hasAndroidLink && hasWalletConnectLink;
@@ -103,9 +107,9 @@ const chainStringToChains = {
103
107
  'eip155:1': ['ETH', 'EVM'],
104
108
  'flow:mainnet': ['FLOW'],
105
109
  };
106
- const getSupportedChainsForWalletConnector = (walletConnector) => {
110
+ const getSupportedChainsForWalletConnector = (walletBook$1, walletConnector) => {
107
111
  var _a;
108
- const metadata = walletBook.getWalletBookWallet(walletConnector.name);
112
+ const metadata = walletBook.getWalletBookWallet(walletBook$1, walletConnector.name);
109
113
  /**
110
114
  * chains could contain multiple eth networks eg
111
115
  * "eip155:1",
@@ -130,7 +134,7 @@ const getSupportedChainsForWalletConnector = (walletConnector) => {
130
134
  };
131
135
  const getEnabledWallets = (props) => {
132
136
  const supportedWallets = getSupportedWallets(props.getSupportedWalletOpts);
133
- const allEnabledWallets = supportedWallets.filter((wallet) => (props.enabledChains.some((chain) => getSupportedChainsForWalletConnector(wallet).includes(chain)) &&
137
+ const allEnabledWallets = supportedWallets.filter((wallet) => (props.enabledChains.some((chain) => getSupportedChainsForWalletConnector(props.getSupportedWalletOpts.walletBook, wallet).includes(chain)) &&
134
138
  wallet.isInstalledOnBrowser() === props.installed) ||
135
139
  wallet.key === 'magiclink');
136
140
  return allEnabledWallets;
@@ -1,7 +1,8 @@
1
1
  import { Chain, WalletConnector } from '@dynamic-labs/wallet-connector-core';
2
+ import { WalletBookSchema } from '@dynamic-labs/wallet-book';
2
3
  import { GetSupportedWallets, GetSupportedWalletsOpts } from './types';
3
4
  export declare const getSupportedWallets: GetSupportedWallets;
4
- export declare const getSupportedChainsForWalletConnector: (walletConnector: WalletConnector) => Chain[];
5
+ export declare const getSupportedChainsForWalletConnector: (walletBook: WalletBookSchema, walletConnector: WalletConnector) => Chain[];
5
6
  export declare const getEnabledWallets: (props: {
6
7
  enabledChains: Chain[];
7
8
  getSupportedWalletOpts: GetSupportedWalletsOpts;
@@ -16,13 +16,14 @@ const defaultWalletUiUtils = {
16
16
  },
17
17
  };
18
18
  const getSupportedWallets = (args) => {
19
- const { appLogoUrl = '', appName = '', chainRpcProviders, flowNetwork, isWalletConnectV2Enabled = false, networkConfigurations = { cosmos: [], evm: [], solana: [], starknet: [] }, customerApiProviders = [], skipMemo = false, walletConnectProjectId = '', walletConnectorsProp, walletUiUtils = undefined, } = args;
19
+ const { appLogoUrl = '', appName = '', chainRpcProviders, flowNetwork, isWalletConnectV2Enabled = false, networkConfigurations = { cosmos: [], evm: [], solana: [], starknet: [] }, customerApiProviders = [], skipMemo = false, walletConnectProjectId = '', walletConnectorsProp, walletUiUtils = undefined, walletBook, walletConnectV1Bridge, } = args;
20
20
  if (!skipMemo && wallets.length > 0) {
21
21
  return wallets;
22
22
  }
23
23
  const evmNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.evm) || [];
24
24
  const solanaNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.solana) || [];
25
25
  const cosmosNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.cosmos) || [];
26
+ const starknetNetworkConfigs = (networkConfigurations === null || networkConfigurations === void 0 ? void 0 : networkConfigurations.starknet) || [];
26
27
  const apiProviders = getApiProviders(customerApiProviders);
27
28
  const opts = {
28
29
  apiProviders,
@@ -35,6 +36,9 @@ const getSupportedWallets = (args) => {
35
36
  isWalletConnectV2Enabled,
36
37
  projectId: walletConnectProjectId,
37
38
  solNetworks: solanaNetworkConfigs,
39
+ starknetNetworks: starknetNetworkConfigs,
40
+ walletBook,
41
+ walletConnectV1Bridge,
38
42
  walletUiUtils: walletUiUtils || defaultWalletUiUtils,
39
43
  };
40
44
  const allWallets = walletConnectorsProp
@@ -42,19 +46,19 @@ const getSupportedWallets = (args) => {
42
46
  .flat()
43
47
  .map((wallet) => new wallet(opts).getMobileOrInstalledWallet());
44
48
  // Memoize the wallets
45
- const filteredWallets = filterWalletsForPlatform(allWallets);
46
- wallets = applyLinksOverrides(filteredWallets);
49
+ const filteredWallets = filterWalletsForPlatform(walletBook, allWallets);
50
+ wallets = applyLinksOverrides(walletBook, filteredWallets);
47
51
  return wallets;
48
52
  };
49
- const applyLinksOverrides = (wallets) => wallets.map((wallet) => {
50
- const metadata = getWalletBookWallet(wallet.name);
53
+ const applyLinksOverrides = (walletBook, wallets) => wallets.map((wallet) => {
54
+ const metadata = getWalletBookWallet(walletBook, wallet.name);
51
55
  if (metadata.switchNetworkOnlyFromWallet !== undefined) {
52
56
  wallet.switchNetworkOnlyFromWallet = metadata.switchNetworkOnlyFromWallet;
53
57
  }
54
58
  return wallet;
55
59
  });
56
- const filterWalletsForPlatform = (wallets) => wallets.filter((wallet) => {
57
- const metadata = getWalletBookWallet(wallet.name);
60
+ const filterWalletsForPlatform = (walletBook, wallets) => wallets.filter((wallet) => {
61
+ const metadata = getWalletBookWallet(walletBook, wallet.name);
58
62
  if (wallet.isInstalledOnBrowser()) {
59
63
  return true;
60
64
  }
@@ -68,10 +72,10 @@ const filterWalletsForPlatform = (wallets) => wallets.filter((wallet) => {
68
72
  return true;
69
73
  }
70
74
  else {
71
- return handleMobileWalletFilter(wallet.name, metadata);
75
+ return handleMobileWalletFilter(walletBook, wallet.name, metadata);
72
76
  }
73
77
  });
74
- const handleMobileWalletFilter = (walletName, metadata) => {
78
+ const handleMobileWalletFilter = (walletBook, walletName, metadata) => {
75
79
  if (!metadata.mobile)
76
80
  return false;
77
81
  /**
@@ -83,13 +87,13 @@ const handleMobileWalletFilter = (walletName, metadata) => {
83
87
  const hasWalletConnectLink = Boolean(metadata.mobile.universal) || Boolean(metadata.mobile.native);
84
88
  const isWalletConnectWallet = metadata.walletConnect !== undefined;
85
89
  if (isIPad() || isIPhone()) {
86
- const hasIOSLink = Boolean(getWalletLinks(walletName).ios);
90
+ const hasIOSLink = Boolean(getWalletLinks(walletBook, walletName).ios);
87
91
  return !isWalletConnectWallet
88
92
  ? hasIOSLink
89
93
  : hasIOSLink && hasWalletConnectLink;
90
94
  }
91
95
  else {
92
- const hasAndroidLink = Boolean(getWalletLinks(walletName).android);
96
+ const hasAndroidLink = Boolean(getWalletLinks(walletBook, walletName).android);
93
97
  return !isWalletConnectWallet
94
98
  ? hasAndroidLink
95
99
  : hasAndroidLink && hasWalletConnectLink;
@@ -99,9 +103,9 @@ const chainStringToChains = {
99
103
  'eip155:1': ['ETH', 'EVM'],
100
104
  'flow:mainnet': ['FLOW'],
101
105
  };
102
- const getSupportedChainsForWalletConnector = (walletConnector) => {
106
+ const getSupportedChainsForWalletConnector = (walletBook, walletConnector) => {
103
107
  var _a;
104
- const metadata = getWalletBookWallet(walletConnector.name);
108
+ const metadata = getWalletBookWallet(walletBook, walletConnector.name);
105
109
  /**
106
110
  * chains could contain multiple eth networks eg
107
111
  * "eip155:1",
@@ -126,7 +130,7 @@ const getSupportedChainsForWalletConnector = (walletConnector) => {
126
130
  };
127
131
  const getEnabledWallets = (props) => {
128
132
  const supportedWallets = getSupportedWallets(props.getSupportedWalletOpts);
129
- const allEnabledWallets = supportedWallets.filter((wallet) => (props.enabledChains.some((chain) => getSupportedChainsForWalletConnector(wallet).includes(chain)) &&
133
+ const allEnabledWallets = supportedWallets.filter((wallet) => (props.enabledChains.some((chain) => getSupportedChainsForWalletConnector(props.getSupportedWalletOpts.walletBook, wallet).includes(chain)) &&
130
134
  wallet.isInstalledOnBrowser() === props.installed) ||
131
135
  wallet.key === 'magiclink');
132
136
  return allEnabledWallets;
package/src/types.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { Provider } from '@dynamic-labs/sdk-api';
2
2
  import { WalletConnector, Chain, WalletConnectorsMethod } from '@dynamic-labs/wallet-connector-core';
3
3
  import { NetworkConfigurationMap, WalletUiUtils } from '@dynamic-labs/types';
4
4
  import { ChainRpcProviders } from '@dynamic-labs/rpc-providers';
5
+ import { WalletBookSchema } from '@dynamic-labs/wallet-book';
5
6
  export type GetSupportedWalletsOpts = {
6
7
  appLogoUrl?: string;
7
8
  appName?: string;
@@ -11,6 +12,8 @@ export type GetSupportedWalletsOpts = {
11
12
  isWalletConnectV2Enabled?: boolean;
12
13
  networkConfigurations?: NetworkConfigurationMap;
13
14
  skipMemo?: boolean;
15
+ walletBook: WalletBookSchema;
16
+ walletConnectV1Bridge?: string;
14
17
  walletConnectProjectId?: string;
15
18
  walletConnectorsProp: WalletConnectorsMethod[];
16
19
  walletUiUtils?: WalletUiUtils;