@dynamic-labs/ethereum 1.1.0-alpha.2 → 1.1.0-alpha.20

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,225 @@
1
1
 
2
+ ## [1.1.0-alpha.20](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.19...v1.1.0-alpha.20) (2024-01-31)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * return all enabled chains in getSupportedNetworks instead of undefined ([#4547](https://github.com/dynamic-labs/DynamicAuth/issues/4547)) ([08e7889](https://github.com/dynamic-labs/DynamicAuth/commit/08e78896e045f24bbd96e39416a7f58006929da0))
8
+ * show modal for existing social account from other signin provider ([#4535](https://github.com/dynamic-labs/DynamicAuth/issues/4535)) ([282914a](https://github.com/dynamic-labs/DynamicAuth/commit/282914ac94b3ef5bd66e0b2265d9e414203a7406))
9
+
10
+ ## [1.1.0-alpha.19](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.18...v1.1.0-alpha.19) (2024-01-31)
11
+
12
+
13
+ ### Features
14
+
15
+ * add PhantomRedirect connector ([#4467](https://github.com/dynamic-labs/DynamicAuth/issues/4467)) ([75d6c95](https://github.com/dynamic-labs/DynamicAuth/commit/75d6c95940fcec185a699c2100b3e2d21a8233d5))
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * lock starknet to 5.25.0 since 5.27.0 breaks the build ([#4541](https://github.com/dynamic-labs/DynamicAuth/issues/4541)) ([00b4799](https://github.com/dynamic-labs/DynamicAuth/commit/00b479977f768cb067480e2e565eabf45e1000a2))
21
+
22
+ ## [1.1.0-alpha.18](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.17...v1.1.0-alpha.18) (2024-01-30)
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * catch email_associated_with_different_provider from response ([#4532](https://github.com/dynamic-labs/DynamicAuth/issues/4532)) ([52be1b4](https://github.com/dynamic-labs/DynamicAuth/commit/52be1b45af46c2b70972b99d73387eb4d7161ec6))
28
+
29
+ ## [1.1.0-alpha.17](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.16...v1.1.0-alpha.17) (2024-01-30)
30
+
31
+
32
+ ### Features
33
+
34
+ * add sendRawTransaction to BitcoinWalletConnector ([2e86c5a](https://github.com/dynamic-labs/DynamicAuth/commit/2e86c5a5245bd0fc29162ef1f7fe2fbd65245fe1))
35
+
36
+
37
+ ### Bug Fixes
38
+
39
+ * properly handle AccountExistsError for signInOAuth ([#4529](https://github.com/dynamic-labs/DynamicAuth/issues/4529)) ([d37fdc3](https://github.com/dynamic-labs/DynamicAuth/commit/d37fdc310fe4b70f8948fd5ed3d058342afbe08f))
40
+
41
+ ## [1.1.0-alpha.16](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.15...v1.1.0-alpha.16) (2024-01-30)
42
+
43
+
44
+ ### Bug Fixes
45
+
46
+ * add fallback to getWalletBookWallet for customers still passing in name, add deprecation warn ([#4518](https://github.com/dynamic-labs/DynamicAuth/issues/4518)) ([b233ea1](https://github.com/dynamic-labs/DynamicAuth/commit/b233ea1cd640d8d9d94c52ab230787f3d869151a))
47
+ * handle braavos network change to account which doesn not exist ([#4519](https://github.com/dynamic-labs/DynamicAuth/issues/4519)) ([486020f](https://github.com/dynamic-labs/DynamicAuth/commit/486020fb09a274388ba34c8d1b37ac3a1ff3dba6))
48
+
49
+ ## [1.1.0-alpha.15](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.14...v1.1.0-alpha.15) (2024-01-28)
50
+
51
+
52
+ ### Features
53
+
54
+ * add wallet group override to wallet book ([#4488](https://github.com/dynamic-labs/DynamicAuth/issues/4488)) ([cb19ad3](https://github.com/dynamic-labs/DynamicAuth/commit/cb19ad3ea82de488752ceceeaf0e1458a388df6e))
55
+ * enable solana embedded wallets ([#4457](https://github.com/dynamic-labs/DynamicAuth/issues/4457)) ([b0c47f4](https://github.com/dynamic-labs/DynamicAuth/commit/b0c47f4475baa12f52076da46ef993c13bd2c243))
56
+ * group ArgentX wallets ([#4495](https://github.com/dynamic-labs/DynamicAuth/issues/4495)) ([b10d79a](https://github.com/dynamic-labs/DynamicAuth/commit/b10d79a668efecedca37ddb358e6adf95319650d))
57
+
58
+
59
+ ### Bug Fixes
60
+
61
+ * add support for newest backpack extension ([#4468](https://github.com/dynamic-labs/DynamicAuth/issues/4468)) ([a219f32](https://github.com/dynamic-labs/DynamicAuth/commit/a219f325be672599e50b07f6751234a7fc98286e))
62
+ * bump timeout for slower connections ([#4475](https://github.com/dynamic-labs/DynamicAuth/issues/4475)) ([7a07ff5](https://github.com/dynamic-labs/DynamicAuth/commit/7a07ff589eaaf3b28a94d277df3eedabbca60702))
63
+ * change out getWalletBookWallet for findWalletBookWallet to avoid throwing during lookup ([#4477](https://github.com/dynamic-labs/DynamicAuth/issues/4477)) ([4648040](https://github.com/dynamic-labs/DynamicAuth/commit/4648040c166e73dd2c31b0e27897713339436c2f))
64
+ * connect to wallet with wallet connect even if network is not supported ([#4465](https://github.com/dynamic-labs/DynamicAuth/issues/4465)) ([9dbca3e](https://github.com/dynamic-labs/DynamicAuth/commit/9dbca3eb4d4990ee4be642677c1604170b425dc3))
65
+ * pass id to wagmi chain override ([#4512](https://github.com/dynamic-labs/DynamicAuth/issues/4512)) ([2bf2f04](https://github.com/dynamic-labs/DynamicAuth/commit/2bf2f0487f5b1be936dd279107c11fe5d2b42666))
66
+ * switching wallet in extension caused connected flag to be false temporarily ([#4454](https://github.com/dynamic-labs/DynamicAuth/issues/4454)) ([3650f6e](https://github.com/dynamic-labs/DynamicAuth/commit/3650f6ec471a7c779f4d304ab94c9350dd55055b))
67
+
68
+ ## [1.1.0-alpha.14](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.13...v1.1.0-alpha.14) (2024-01-23)
69
+
70
+
71
+ ### Features
72
+
73
+ * add wallet-book retryable ([#4462](https://github.com/dynamic-labs/DynamicAuth/issues/4462)) ([513b1a6](https://github.com/dynamic-labs/DynamicAuth/commit/513b1a67d6c49624398ad4b0cdca4f5618c9583f))
74
+
75
+ ## [1.1.0-alpha.13](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.12...v1.1.0-alpha.13) (2024-01-23)
76
+
77
+
78
+ ### Features
79
+
80
+ * add createWalletClientFromWallet helper function ([#4416](https://github.com/dynamic-labs/DynamicAuth/issues/4416)) ([b384898](https://github.com/dynamic-labs/DynamicAuth/commit/b384898061bb3f9b38b2ed670b6650cfc1d4b429))
81
+ * add hardware wallets to wallet book ([#4445](https://github.com/dynamic-labs/DynamicAuth/issues/4445)) ([66c0f5b](https://github.com/dynamic-labs/DynamicAuth/commit/66c0f5b29a6a700099bb95a6f7622f6178e0bccf))
82
+ * add support for Argent Web and Mobile ([#4328](https://github.com/dynamic-labs/DynamicAuth/issues/4328)) ([bce20b8](https://github.com/dynamic-labs/DynamicAuth/commit/bce20b8f35a8630f2621f53a541a1acb06a38fc0))
83
+ * enable ledger for glow, solflare and backpack ([#4392](https://github.com/dynamic-labs/DynamicAuth/issues/4392)) ([fa7b992](https://github.com/dynamic-labs/DynamicAuth/commit/fa7b992f87ebc43560f87b43ac56f2cd9909b306))
84
+
85
+
86
+ ### Bug Fixes
87
+
88
+ * breaking changes script ([#4440](https://github.com/dynamic-labs/DynamicAuth/issues/4440)) ([446173d](https://github.com/dynamic-labs/DynamicAuth/commit/446173d074d652d81856c6412e304b46b1565320))
89
+ * broken help icon in create passkey view ([#4428](https://github.com/dynamic-labs/DynamicAuth/issues/4428)) ([e0ffc02](https://github.com/dynamic-labs/DynamicAuth/commit/e0ffc02ffea34b7ac3198ff6e1baf7f9907acddd))
90
+ * infinite loop when connecting with trust wallet ([#4448](https://github.com/dynamic-labs/DynamicAuth/issues/4448)) ([4e20edf](https://github.com/dynamic-labs/DynamicAuth/commit/4e20edf9abaabf20e5e9f9167b44d7f691e844f1))
91
+ * render wagmi elements based on react version ([#4453](https://github.com/dynamic-labs/DynamicAuth/issues/4453)) ([43c624c](https://github.com/dynamic-labs/DynamicAuth/commit/43c624ca996b0c51de1454910f19fdf908149938))
92
+
93
+ ## [1.1.0-alpha.12](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.11...v1.1.0-alpha.12) (2024-01-18)
94
+
95
+
96
+ ### Features
97
+
98
+ * expose setAuthMode method ([#4419](https://github.com/dynamic-labs/DynamicAuth/issues/4419)) ([7d156b3](https://github.com/dynamic-labs/DynamicAuth/commit/7d156b3e0eab9b9a80f70ff1c5201d90693ae755))
99
+
100
+
101
+ ### Bug Fixes
102
+
103
+ * call onUnlinkSuccess in headless mode too ([#4412](https://github.com/dynamic-labs/DynamicAuth/issues/4412)) ([4c76af9](https://github.com/dynamic-labs/DynamicAuth/commit/4c76af9ac7c7b43883742d1289558dfcb5d612ca))
104
+ * correctly map keplr chain ids from project settings ([#4418](https://github.com/dynamic-labs/DynamicAuth/issues/4418)) ([7046364](https://github.com/dynamic-labs/DynamicAuth/commit/7046364a316f7551f0b995eaae7afea13502eb9b))
105
+ * logging in with an email linked to a third party wallet gets stuck on otp view ([#4407](https://github.com/dynamic-labs/DynamicAuth/issues/4407)) ([35bf142](https://github.com/dynamic-labs/DynamicAuth/commit/35bf142e74efeef866dbd7b8157a049cd36eeccb))
106
+
107
+ ## [1.1.0-alpha.11](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.10...v1.1.0-alpha.11) (2024-01-17)
108
+
109
+
110
+ ### Features
111
+
112
+ * add Leather wallet and BtcKit connector ([#4335](https://github.com/dynamic-labs/DynamicAuth/issues/4335)) ([fe3316b](https://github.com/dynamic-labs/DynamicAuth/commit/fe3316b5be9ef17eea885e99cf925ccd0f271da7))
113
+ * add solana injected wallet configuration to walletbook ([#4375](https://github.com/dynamic-labs/DynamicAuth/issues/4375)) ([3677ce5](https://github.com/dynamic-labs/DynamicAuth/commit/3677ce5ff40d0c00bfaf0daa0d5d67bc40706ee0))
114
+ * add support for unisat wallet ([#4355](https://github.com/dynamic-labs/DynamicAuth/issues/4355)) ([5b7d6b0](https://github.com/dynamic-labs/DynamicAuth/commit/5b7d6b0a9ea84811a8252b3cdf30a3a8e410180c))
115
+ * add walletbook configurations for solana injected wallets ([#4360](https://github.com/dynamic-labs/DynamicAuth/issues/4360)) ([cdc8e5f](https://github.com/dynamic-labs/DynamicAuth/commit/cdc8e5f4878cb84e26e5b33299aa8547b84b6667))
116
+ * passkey renaming frontend ([#4331](https://github.com/dynamic-labs/DynamicAuth/issues/4331)) ([4551013](https://github.com/dynamic-labs/DynamicAuth/commit/4551013d577c914cb3aedfe458ab9eaa018aceb4))
117
+
118
+
119
+ ### Bug Fixes
120
+
121
+ * correctly update wallets connected flag after wallet switch ([#4397](https://github.com/dynamic-labs/DynamicAuth/issues/4397)) ([543a830](https://github.com/dynamic-labs/DynamicAuth/commit/543a830574f0d5a78fedbb9b18233e8dfbaddd86))
122
+ * export modal header ([#4401](https://github.com/dynamic-labs/DynamicAuth/issues/4401)) ([77cf016](https://github.com/dynamic-labs/DynamicAuth/commit/77cf016fc742458988864647870149a56e991ee4))
123
+ * trigger onAuthSuccess before embedded wallet creation ([4aa341a](https://github.com/dynamic-labs/DynamicAuth/commit/4aa341a1d08332a121daddb7c2dcb09a804a4de7))
124
+ * ui issues on react 17 ([#4373](https://github.com/dynamic-labs/DynamicAuth/issues/4373)) ([93096d6](https://github.com/dynamic-labs/DynamicAuth/commit/93096d6017816a4f0ed299bf618b130d90c81514))
125
+
126
+ ## [1.1.0-alpha.10](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.9...v1.1.0-alpha.10) (2024-01-06)
127
+
128
+
129
+ ### Bug Fixes
130
+
131
+ * pass flow network to magic client ([#4322](https://github.com/dynamic-labs/DynamicAuth/issues/4322)) ([f3adccf](https://github.com/dynamic-labs/DynamicAuth/commit/f3adccf9f8d835f6b04e4767acd0fbd2ac238379))
132
+ * prevent error message when mobile wallet app is open ([#4301](https://github.com/dynamic-labs/DynamicAuth/issues/4301)) ([2a66dcf](https://github.com/dynamic-labs/DynamicAuth/commit/2a66dcfaf8100b3d910c559d35d8b731b1cb380e))
133
+ * turnkeyWalletConnector is not an email otp connector and uses dynamic otp ([#4313](https://github.com/dynamic-labs/DynamicAuth/issues/4313)) ([e4ea56f](https://github.com/dynamic-labs/DynamicAuth/commit/e4ea56f40fdf97b3f5440b016ebd95501089cebe))
134
+
135
+ ## [1.1.0-alpha.9](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.8...v1.1.0-alpha.9) (2024-01-04)
136
+
137
+
138
+ ### Features
139
+
140
+ * add solana magic support ([#4258](https://github.com/dynamic-labs/DynamicAuth/issues/4258)) ([da726aa](https://github.com/dynamic-labs/DynamicAuth/commit/da726aa78466c52ee3e1f18952e4351cde754cbc))
141
+
142
+
143
+ ### Bug Fixes
144
+
145
+ * edge case with unlinking wallet ([#4285](https://github.com/dynamic-labs/DynamicAuth/issues/4285)) ([1057fe4](https://github.com/dynamic-labs/DynamicAuth/commit/1057fe47599381f5d9dc39ce4cbeca2041c70319))
146
+ * remove normalizeWalletName from DynamicAuth ([5592817](https://github.com/dynamic-labs/DynamicAuth/commit/5592817b62e345319e04cca9a98276ffad87cfc2))
147
+ * **useFetchBalance:** ensure the latest wallet balance is fetched ([#4288](https://github.com/dynamic-labs/DynamicAuth/issues/4288)) ([25dd035](https://github.com/dynamic-labs/DynamicAuth/commit/25dd035cf8893b7cd28f550026134ba0eecda142))
148
+
149
+ ## [1.1.0-alpha.8](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.7...v1.1.0-alpha.8) (2024-01-03)
150
+
151
+
152
+ ### Features
153
+
154
+ * add new sdk view section for text ([#4280](https://github.com/dynamic-labs/DynamicAuth/issues/4280)) ([457ae38](https://github.com/dynamic-labs/DynamicAuth/commit/457ae38cd2be8dae078f40b54ffc4704299d4ed9))
155
+ * add new setShowLinkNewWalletModal method ([f46447a](https://github.com/dynamic-labs/DynamicAuth/commit/f46447ab606f4fdbf55e5fef21dd98f8f2650e90))
156
+ * add pk export for hd wallets ([#4266](https://github.com/dynamic-labs/DynamicAuth/issues/4266)) ([44aac69](https://github.com/dynamic-labs/DynamicAuth/commit/44aac69580ed44e66eab971f87cb6061a3fadc90))
157
+ * add starknet support for sopelia ([#4248](https://github.com/dynamic-labs/DynamicAuth/issues/4248)) ([f9a0980](https://github.com/dynamic-labs/DynamicAuth/commit/f9a0980c3cd2d6d95c5dd17b179fbd0931f08b1a))
158
+ * enable hardware wallet for solana wallets ([#4275](https://github.com/dynamic-labs/DynamicAuth/issues/4275)) ([704b380](https://github.com/dynamic-labs/DynamicAuth/commit/704b380186618a5a5793e88f36ccbe84b59a2e4a))
159
+
160
+
161
+ ### Bug Fixes
162
+
163
+ * phantom solana not connecting on mobile ([#4284](https://github.com/dynamic-labs/DynamicAuth/issues/4284)) ([6ad75f1](https://github.com/dynamic-labs/DynamicAuth/commit/6ad75f152896459f5cf658227f998c246b6a572b))
164
+ * use bitcoin payment address for onramp ([#4273](https://github.com/dynamic-labs/DynamicAuth/issues/4273)) ([a2f54e8](https://github.com/dynamic-labs/DynamicAuth/commit/a2f54e812a11a91ee488eca64f14b5eeea1a8874))
165
+
166
+ ## [1.1.0-alpha.7](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.6...v1.1.0-alpha.7) (2023-12-28)
167
+
168
+
169
+ ### Features
170
+
171
+ * better coinbase deeplinking ux ([#4164](https://github.com/dynamic-labs/DynamicAuth/issues/4164)) ([5252608](https://github.com/dynamic-labs/DynamicAuth/commit/525260851900a33a52f129def338963400344205))
172
+
173
+
174
+ ### Bug Fixes
175
+
176
+ * don't prompt for connect when selecting bitcoin wallet if already connected ([#4265](https://github.com/dynamic-labs/DynamicAuth/issues/4265)) ([adef402](https://github.com/dynamic-labs/DynamicAuth/commit/adef402ef94270a17fab896a8585a7f2eacd3681))
177
+
178
+ ## [1.1.0-alpha.6](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.5...v1.1.0-alpha.6) (2023-12-27)
179
+
180
+
181
+ ### Features
182
+
183
+ * add multi-wallet-prompts-widget ([#4166](https://github.com/dynamic-labs/DynamicAuth/issues/4166)) ([151e3d2](https://github.com/dynamic-labs/DynamicAuth/commit/151e3d2e7bebbf18448e4af8eecbf660f713cd3d))
184
+
185
+
186
+ ### Bug Fixes
187
+
188
+ * coinbase solana signMessage ([#4254](https://github.com/dynamic-labs/DynamicAuth/issues/4254)) ([f0300a9](https://github.com/dynamic-labs/DynamicAuth/commit/f0300a93ed6c9ba9dfab613820d8cedbe72abb87))
189
+ * make useConnectWithEmailOtp work cross views ([#4252](https://github.com/dynamic-labs/DynamicAuth/issues/4252)) ([a097119](https://github.com/dynamic-labs/DynamicAuth/commit/a097119556c38a22f338a783f79d512b99203cf5))
190
+
191
+ ## [1.1.0-alpha.5](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.4...v1.1.0-alpha.5) (2023-12-21)
192
+
193
+
194
+ ### Features
195
+
196
+ * add support for xverse wallet ([#4245](https://github.com/dynamic-labs/DynamicAuth/issues/4245)) ([7b68546](https://github.com/dynamic-labs/DynamicAuth/commit/7b6854684412007bcb33896555900936395176df))
197
+ * **gvty-526:** add embedded reveal ([#4233](https://github.com/dynamic-labs/DynamicAuth/issues/4233)) ([c2d0f90](https://github.com/dynamic-labs/DynamicAuth/commit/c2d0f903f4a4646f86c71834540fd49d51a4a7ae))
198
+
199
+ ## [1.1.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.3...v1.1.0-alpha.4) (2023-12-21)
200
+
201
+
202
+ ### Features
203
+
204
+ * add bitcoin integration ([#4216](https://github.com/dynamic-labs/DynamicAuth/issues/4216)) ([9584f1c](https://github.com/dynamic-labs/DynamicAuth/commit/9584f1cc3133835049ad1c53da980192263b8f21))
205
+ * add default footer to wallet list when tos and pp not enabled ([#4224](https://github.com/dynamic-labs/DynamicAuth/issues/4224)) ([0ad81c4](https://github.com/dynamic-labs/DynamicAuth/commit/0ad81c409bcb4aafb0dc565685525d620a95efce))
206
+ * adds useConnectWithEmailOtp ([#4234](https://github.com/dynamic-labs/DynamicAuth/issues/4234)) ([4a4e50a](https://github.com/dynamic-labs/DynamicAuth/commit/4a4e50ac8651c2a249d5125ae6bcf49aaf49be8c))
207
+
208
+ ## [1.1.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.2...v1.1.0-alpha.3) (2023-12-19)
209
+
210
+
211
+ ### Features
212
+
213
+ * add Flow support in magic wallet connector ([#4158](https://github.com/dynamic-labs/DynamicAuth/issues/4158)) ([fbbaea7](https://github.com/dynamic-labs/DynamicAuth/commit/fbbaea76b36ceb693f6bd4f2404dfa1204e61492))
214
+ * add showDynamicUserProfile to DynamicContext ([#4214](https://github.com/dynamic-labs/DynamicAuth/issues/4214)) ([2aeb8e3](https://github.com/dynamic-labs/DynamicAuth/commit/2aeb8e3c45a3d9f87bd9196ea9b46927e02eb633))
215
+
216
+
217
+ ### Bug Fixes
218
+
219
+ * add shortname to braveevm to allow for lookups by name as well as key ([#4213](https://github.com/dynamic-labs/DynamicAuth/issues/4213)) ([969b089](https://github.com/dynamic-labs/DynamicAuth/commit/969b089be516fb57fcdc941f908c078998eb4ec0))
220
+ * solflare connect ([#4215](https://github.com/dynamic-labs/DynamicAuth/issues/4215)) ([9a4164e](https://github.com/dynamic-labs/DynamicAuth/commit/9a4164e53198f33ef7201cd4e1eff745a09e9701))
221
+ * wagmi attempt to connect to primary wallet first ([#4206](https://github.com/dynamic-labs/DynamicAuth/issues/4206)) ([9e5fc8e](https://github.com/dynamic-labs/DynamicAuth/commit/9e5fc8ef026628935ac32d3bb0c22bda35057e5d))
222
+
2
223
  ## [1.1.0-alpha.2](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.1...v1.1.0-alpha.2) (2023-12-18)
3
224
 
4
225
 
@@ -37,7 +37,12 @@ function __awaiter(thisArg, _arguments, P, generator) {
37
37
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
38
38
  step((generator = generator.apply(thisArg, _arguments || [])).next());
39
39
  });
40
- }
40
+ }
41
+
42
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
43
+ var e = new Error(message);
44
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
45
+ };
41
46
 
42
47
  exports.__awaiter = __awaiter;
43
48
  exports.__rest = __rest;
@@ -33,6 +33,11 @@ function __awaiter(thisArg, _arguments, P, generator) {
33
33
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
34
  step((generator = generator.apply(thisArg, _arguments || [])).next());
35
35
  });
36
- }
36
+ }
37
+
38
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
39
+ var e = new Error(message);
40
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
41
+ };
37
42
 
38
43
  export { __awaiter, __rest };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ethereum",
3
- "version": "1.1.0-alpha.2",
3
+ "version": "1.1.0-alpha.20",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -26,21 +26,21 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@coinbase/wallet-sdk": "3.7.2",
29
+ "@coinbase/wallet-sdk": "3.9.1",
30
30
  "@walletconnect/client": "1.8.0",
31
31
  "@walletconnect/ethereum-provider": "1.8.0",
32
32
  "@walletconnect/universal-provider": "2.10.6",
33
33
  "eventemitter3": "5.0.1",
34
34
  "buffer": "6.0.3",
35
- "@dynamic-labs/rpc-providers": "1.1.0-alpha.2",
36
- "@dynamic-labs/turnkey": "1.1.0-alpha.2",
37
- "@dynamic-labs/types": "1.1.0-alpha.2",
38
- "@dynamic-labs/utils": "1.1.0-alpha.2",
39
- "@dynamic-labs/wallet-book": "1.1.0-alpha.2",
40
- "@dynamic-labs/wallet-connector-core": "1.1.0-alpha.2",
35
+ "@dynamic-labs/rpc-providers": "1.1.0-alpha.20",
36
+ "@dynamic-labs/turnkey": "1.1.0-alpha.20",
37
+ "@dynamic-labs/types": "1.1.0-alpha.20",
38
+ "@dynamic-labs/utils": "1.1.0-alpha.20",
39
+ "@dynamic-labs/wallet-book": "1.1.0-alpha.20",
40
+ "@dynamic-labs/wallet-connector-core": "1.1.0-alpha.20",
41
41
  "stream": "0.0.2"
42
42
  },
43
43
  "peerDependencies": {
44
- "viem": "^1.19.13"
44
+ "viem": "^1.19.13 || ^2.2.0"
45
45
  }
46
46
  }
@@ -51,10 +51,10 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
51
51
  [x: string]: Record<string, any>;
52
52
  eth_accounts: Record<string, any>;
53
53
  }) => Promise<import("viem").RequestPermissionsReturnType>;
54
- sendRawTransaction: (args: import("viem/_types/actions/wallet/sendRawTransaction").SendRawTransactionParameters) => Promise<`0x${string}`>;
54
+ sendRawTransaction: (args: import("node_modules/viem/_types/actions/wallet/sendRawTransaction").SendRawTransactionParameters) => Promise<`0x${string}`>;
55
55
  sendTransaction: <TChainOverride_2 extends import("viem").Chain | undefined = undefined>(args: import("viem").SendTransactionParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_2>) => Promise<`0x${string}`>;
56
56
  signMessage: (args: import("viem").SignMessageParameters<import("viem").Account | undefined>) => Promise<`0x${string}`>;
57
- signTransaction: <TChainOverride_3 extends import("viem").Chain | undefined = undefined>(args: import("viem/_types/actions/wallet/signTransaction").SignTransactionParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_3>) => Promise<`0x${string}`>;
57
+ signTransaction: <TChainOverride_3 extends import("viem").Chain | undefined = undefined>(args: import("node_modules/viem/_types/actions/wallet/signTransaction").SignTransactionParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_3>) => Promise<`0x${string}`>;
58
58
  signTypedData: <const TTypedData extends {
59
59
  [x: string]: readonly import("viem").TypedDataParameter[];
60
60
  [x: `string[${string}]`]: undefined;
@@ -95,11 +95,11 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
95
95
  [x: `bytes4[${string}]`]: undefined;
96
96
  [x: `bytes3[${string}]`]: undefined;
97
97
  [x: `int[${string}]`]: undefined;
98
+ [x: `int40[${string}]`]: undefined;
98
99
  [x: `int32[${string}]`]: undefined;
99
100
  [x: `int24[${string}]`]: undefined;
100
101
  [x: `int16[${string}]`]: undefined;
101
102
  [x: `int8[${string}]`]: undefined;
102
- [x: `int40[${string}]`]: undefined;
103
103
  [x: `int48[${string}]`]: undefined;
104
104
  [x: `int56[${string}]`]: undefined;
105
105
  [x: `int64[${string}]`]: undefined;
@@ -128,11 +128,11 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
128
128
  [x: `int248[${string}]`]: undefined;
129
129
  [x: `int256[${string}]`]: undefined;
130
130
  [x: `uint[${string}]`]: undefined;
131
+ [x: `uint40[${string}]`]: undefined;
131
132
  [x: `uint32[${string}]`]: undefined;
132
133
  [x: `uint24[${string}]`]: undefined;
133
134
  [x: `uint16[${string}]`]: undefined;
134
135
  [x: `uint8[${string}]`]: undefined;
135
- [x: `uint40[${string}]`]: undefined;
136
136
  [x: `uint48[${string}]`]: undefined;
137
137
  [x: `uint56[${string}]`]: undefined;
138
138
  [x: `uint64[${string}]`]: undefined;
@@ -196,11 +196,11 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
196
196
  bytes5?: undefined;
197
197
  bytes4?: undefined;
198
198
  bytes3?: undefined;
199
+ int40?: undefined;
199
200
  int32?: undefined;
200
201
  int24?: undefined;
201
202
  int16?: undefined;
202
203
  int8?: undefined;
203
- int40?: undefined;
204
204
  int48?: undefined;
205
205
  int56?: undefined;
206
206
  int64?: undefined;
@@ -228,11 +228,11 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
228
228
  int240?: undefined;
229
229
  int248?: undefined;
230
230
  int256?: undefined;
231
+ uint40?: undefined;
231
232
  uint32?: undefined;
232
233
  uint24?: undefined;
233
234
  uint16?: undefined;
234
235
  uint8?: undefined;
235
- uint40?: undefined;
236
236
  uint48?: undefined;
237
237
  uint56?: undefined;
238
238
  uint64?: undefined;
@@ -11,19 +11,13 @@ var constants = require('../../constants.cjs');
11
11
  const jsonRpcUrl = `https://mainnet.infura.io/v3/${constants.INFURA_ID}`;
12
12
  const chainId = 1;
13
13
  let coinbaseProvider;
14
- const getCoinbaseProvider = ({ opts: { appLogoUrl, appName = '', evmNetworks = [] } = {}, handlers, }) => {
14
+ const getCoinbaseProvider = ({ opts: { appLogoUrl, appName = '', evmNetworks = [] } = {}, }) => {
15
15
  var _a, _b;
16
16
  if (!coinbaseProvider) {
17
17
  const coinbaseWalletSDK = new walletSdk.CoinbaseWalletSDK({
18
18
  appLogoUrl,
19
19
  appName,
20
- eventListener: {
21
- onEvent: (eventType) => {
22
- if (eventType === 'walletlink_sdk.disconnected') {
23
- handlers === null || handlers === void 0 ? void 0 : handlers.onDisconnect();
24
- }
25
- },
26
- },
20
+ enableMobileWalletLink: true,
27
21
  headlessMode: true,
28
22
  reloadOnDisconnect: false,
29
23
  });
@@ -7,19 +7,13 @@ import { INFURA_ID } from '../../constants.js';
7
7
  const jsonRpcUrl = `https://mainnet.infura.io/v3/${INFURA_ID}`;
8
8
  const chainId = 1;
9
9
  let coinbaseProvider;
10
- const getCoinbaseProvider = ({ opts: { appLogoUrl, appName = '', evmNetworks = [] } = {}, handlers, }) => {
10
+ const getCoinbaseProvider = ({ opts: { appLogoUrl, appName = '', evmNetworks = [] } = {}, }) => {
11
11
  var _a, _b;
12
12
  if (!coinbaseProvider) {
13
13
  const coinbaseWalletSDK = new CoinbaseWalletSDK({
14
14
  appLogoUrl,
15
15
  appName,
16
- eventListener: {
17
- onEvent: (eventType) => {
18
- if (eventType === 'walletlink_sdk.disconnected') {
19
- handlers === null || handlers === void 0 ? void 0 : handlers.onDisconnect();
20
- }
21
- },
22
- },
16
+ enableMobileWalletLink: true,
23
17
  headlessMode: true,
24
18
  reloadOnDisconnect: false,
25
19
  });
@@ -5,11 +5,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var _tslib = require('../../_virtual/_tslib.cjs');
6
6
  var viem = require('viem');
7
7
  var walletBook = require('@dynamic-labs/wallet-book');
8
- var EthWalletConnector = require('../EthWalletConnector.cjs');
9
8
  require('../polyfills.cjs');
10
9
  require('@dynamic-labs/turnkey');
11
10
  require('@dynamic-labs/utils');
12
11
  var ethProviderHelper = require('../ethProviderHelper.cjs');
12
+ var EthWalletConnector = require('../EthWalletConnector.cjs');
13
13
  require('../walletConnect/walletConnectV2.cjs');
14
14
  require('@walletconnect/ethereum-provider');
15
15
  require('@dynamic-labs/wallet-connector-core');
@@ -40,7 +40,7 @@ class Coinbase extends EthWalletConnector.EthWalletConnector {
40
40
  if (!provider) {
41
41
  return;
42
42
  }
43
- const setupResponse = (_c = (_b = this.ethProviderHelper) === null || _b === void 0 ? void 0 : _b._setupEventListeners) === null || _c === void 0 ? void 0 : _c.call(_b, this, viem.createPublicClient({ transport: viem.custom(provider) }));
43
+ const setupResponse = (_c = (_b = this.ethProviderHelper) === null || _b === void 0 ? void 0 : _b._setupEventListeners) === null || _c === void 0 ? void 0 : _c.call(_b, this);
44
44
  if (!(setupResponse === null || setupResponse === void 0 ? void 0 : setupResponse.tearDownEventListeners))
45
45
  return;
46
46
  this.teardownEventListeners = setupResponse.tearDownEventListeners;
@@ -1,6 +1,6 @@
1
1
  import { Chain, FetchPublicAddressOpts } from '@dynamic-labs/wallet-connector-core';
2
- import { EthWalletConnector, EthWalletConnectorOpts } from '../EthWalletConnector';
3
2
  import { EthProviderHelper } from '..';
3
+ import { EthWalletConnector, EthWalletConnectorOpts } from '../EthWalletConnector';
4
4
  type CoinbaseOpts = EthWalletConnectorOpts & {
5
5
  appLogoUrl?: string;
6
6
  appName?: string;
@@ -42,10 +42,10 @@ export declare class Coinbase extends EthWalletConnector {
42
42
  [x: string]: Record<string, any>;
43
43
  eth_accounts: Record<string, any>;
44
44
  }) => Promise<import("viem").RequestPermissionsReturnType>;
45
- sendRawTransaction: (args: import("viem/_types/actions/wallet/sendRawTransaction").SendRawTransactionParameters) => Promise<`0x${string}`>;
45
+ sendRawTransaction: (args: import("node_modules/viem/_types/actions/wallet/sendRawTransaction").SendRawTransactionParameters) => Promise<`0x${string}`>;
46
46
  sendTransaction: <TChainOverride_2 extends import("viem").Chain | undefined = undefined>(args: import("viem").SendTransactionParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_2>) => Promise<`0x${string}`>;
47
47
  signMessage: (args: import("viem").SignMessageParameters<import("viem").Account | undefined>) => Promise<`0x${string}`>;
48
- signTransaction: <TChainOverride_3 extends import("viem").Chain | undefined = undefined>(args: import("viem/_types/actions/wallet/signTransaction").SignTransactionParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_3>) => Promise<`0x${string}`>;
48
+ signTransaction: <TChainOverride_3 extends import("viem").Chain | undefined = undefined>(args: import("node_modules/viem/_types/actions/wallet/signTransaction").SignTransactionParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_3>) => Promise<`0x${string}`>;
49
49
  signTypedData: <const TTypedData extends {
50
50
  [x: string]: readonly import("viem").TypedDataParameter[];
51
51
  [x: `string[${string}]`]: undefined;
@@ -299,10 +299,10 @@ export declare class Coinbase extends EthWalletConnector {
299
299
  [x: string]: Record<string, any>;
300
300
  eth_accounts: Record<string, any>;
301
301
  }) => Promise<import("viem").RequestPermissionsReturnType>;
302
- sendRawTransaction: (args: import("viem/_types/actions/wallet/sendRawTransaction").SendRawTransactionParameters) => Promise<`0x${string}`>;
302
+ sendRawTransaction: (args: import("node_modules/viem/_types/actions/wallet/sendRawTransaction").SendRawTransactionParameters) => Promise<`0x${string}`>;
303
303
  sendTransaction: <TChainOverride_7 extends import("viem").Chain | undefined = undefined>(args: import("viem").SendTransactionParameters<undefined, undefined, TChainOverride_7>) => Promise<`0x${string}`>;
304
304
  signMessage: (args: import("viem").SignMessageParameters<undefined>) => Promise<`0x${string}`>;
305
- signTransaction: <TChainOverride_8 extends import("viem").Chain | undefined = undefined>(args: import("viem/_types/actions/wallet/signTransaction").SignTransactionParameters<undefined, undefined, TChainOverride_8>) => Promise<`0x${string}`>;
305
+ signTransaction: <TChainOverride_8 extends import("viem").Chain | undefined = undefined>(args: import("node_modules/viem/_types/actions/wallet/signTransaction").SignTransactionParameters<undefined, undefined, TChainOverride_8>) => Promise<`0x${string}`>;
306
306
  signTypedData: <const TTypedData_1 extends {
307
307
  [x: string]: readonly import("viem").TypedDataParameter[];
308
308
  [x: `string[${string}]`]: undefined;
@@ -1,11 +1,11 @@
1
1
  import { __rest, __awaiter } from '../../_virtual/_tslib.js';
2
- import { createPublicClient, custom, createWalletClient } from 'viem';
2
+ import { createWalletClient, custom } from 'viem';
3
3
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
4
- import { EthWalletConnector } from '../EthWalletConnector.js';
5
4
  import '../polyfills.js';
6
5
  import '@dynamic-labs/turnkey';
7
6
  import '@dynamic-labs/utils';
8
7
  import { EthProviderHelper } from '../ethProviderHelper.js';
8
+ import { EthWalletConnector } from '../EthWalletConnector.js';
9
9
  import '../walletConnect/walletConnectV2.js';
10
10
  import '@walletconnect/ethereum-provider';
11
11
  import '@dynamic-labs/wallet-connector-core';
@@ -36,7 +36,7 @@ class Coinbase extends EthWalletConnector {
36
36
  if (!provider) {
37
37
  return;
38
38
  }
39
- const setupResponse = (_c = (_b = this.ethProviderHelper) === null || _b === void 0 ? void 0 : _b._setupEventListeners) === null || _c === void 0 ? void 0 : _c.call(_b, this, createPublicClient({ transport: custom(provider) }));
39
+ const setupResponse = (_c = (_b = this.ethProviderHelper) === null || _b === void 0 ? void 0 : _b._setupEventListeners) === null || _c === void 0 ? void 0 : _c.call(_b, this);
40
40
  if (!(setupResponse === null || setupResponse === void 0 ? void 0 : setupResponse.tearDownEventListeners))
41
41
  return;
42
42
  this.teardownEventListeners = setupResponse.tearDownEventListeners;
@@ -6,7 +6,6 @@ var _tslib = require('../_virtual/_tslib.cjs');
6
6
  var viem = require('viem');
7
7
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
8
8
  var utils = require('@dynamic-labs/utils');
9
- var eventListenerHandlers = require('./utils/eventListenerHandlers.cjs');
10
9
  var eip6963Provider = require('./eip6963Provider.cjs');
11
10
 
12
11
  class EthProviderHelper {
@@ -124,14 +123,14 @@ class EthProviderHelper {
124
123
  return signedMessage;
125
124
  });
126
125
  }
127
- _setupEventListeners(walletConnector, publicClient) {
126
+ _setupEventListeners(walletConnector) {
128
127
  const web3Provider = this.findProvider();
129
128
  if (!web3Provider) {
130
129
  return {
131
130
  tearDownEventListeners: () => { },
132
131
  };
133
132
  }
134
- const { handleAccountChange, handleChainChange, handleDisconnect } = eventListenerHandlers.eventListenerHandlers(walletConnector, publicClient);
133
+ const { handleAccountChange, handleChainChange, handleDisconnect } = walletConnectorCore.eventListenerHandlers(walletConnector);
135
134
  web3Provider.on('accountsChanged', handleAccountChange);
136
135
  web3Provider.on('chainChanged', handleChainChange);
137
136
  web3Provider.on('disconnect', handleDisconnect);
@@ -1,4 +1,4 @@
1
- import { Hex, PublicClient, WalletClient } from 'viem';
1
+ import { Hex, WalletClient } from 'viem';
2
2
  import { ProviderCondition, WalletConnector } from '@dynamic-labs/wallet-connector-core';
3
3
  import { WalletSchema } from '@dynamic-labs/wallet-book';
4
4
  import { IEthereum, ProviderFlag } from './types';
@@ -15,6 +15,11 @@ export declare class EthProviderHelper {
15
15
  value: boolean;
16
16
  flag: string;
17
17
  }[];
18
+ providerInterface?: string | undefined;
19
+ walletStandard?: {
20
+ features: string[];
21
+ name: string;
22
+ } | undefined;
18
23
  windowLocations?: string[] | undefined;
19
24
  } | undefined;
20
25
  installedProviders(): IEthereum[];
@@ -26,7 +31,7 @@ export declare class EthProviderHelper {
26
31
  fetchPublicAddress(): Promise<Hex | undefined>;
27
32
  fetchPublicAddressWithProvider(client: WalletClient): Promise<Hex | undefined>;
28
33
  signMessage(messageToSign: string): Promise<string | undefined>;
29
- _setupEventListeners(walletConnector: WalletConnector, publicClient: PublicClient): {
34
+ _setupEventListeners(walletConnector: WalletConnector): {
30
35
  tearDownEventListeners: () => void;
31
36
  };
32
37
  }
@@ -1,8 +1,7 @@
1
1
  import { __awaiter } from '../_virtual/_tslib.js';
2
2
  import { createWalletClient, custom, getAddress } from 'viem';
3
- import { ProviderLookup, logger } from '@dynamic-labs/wallet-connector-core';
3
+ import { ProviderLookup, eventListenerHandlers, logger } from '@dynamic-labs/wallet-connector-core';
4
4
  import { getProvidersFromWindow } from '@dynamic-labs/utils';
5
- import { eventListenerHandlers } from './utils/eventListenerHandlers.js';
6
5
  import { Eip6963ProviderSingleton } from './eip6963Provider.js';
7
6
 
8
7
  class EthProviderHelper {
@@ -120,14 +119,14 @@ class EthProviderHelper {
120
119
  return signedMessage;
121
120
  });
122
121
  }
123
- _setupEventListeners(walletConnector, publicClient) {
122
+ _setupEventListeners(walletConnector) {
124
123
  const web3Provider = this.findProvider();
125
124
  if (!web3Provider) {
126
125
  return {
127
126
  tearDownEventListeners: () => { },
128
127
  };
129
128
  }
130
- const { handleAccountChange, handleChainChange, handleDisconnect } = eventListenerHandlers(walletConnector, publicClient);
129
+ const { handleAccountChange, handleChainChange, handleDisconnect } = eventListenerHandlers(walletConnector);
131
130
  web3Provider.on('accountsChanged', handleAccountChange);
132
131
  web3Provider.on('chainChanged', handleChainChange);
133
132
  web3Provider.on('disconnect', handleDisconnect);
package/src/index.cjs CHANGED
@@ -8,6 +8,7 @@ var PhantomEvm = require('./injected/PhantomEvm.cjs');
8
8
  var ExodusEvm = require('./injected/ExodusEvm.cjs');
9
9
  var fetchInjectedWalletConnectors = require('./injected/fetchInjectedWalletConnectors.cjs');
10
10
  require('./walletConnect/walletConnectV2.cjs');
11
+ require('../_virtual/_tslib.cjs');
11
12
  require('@walletconnect/ethereum-provider');
12
13
  require('viem');
13
14
  require('@dynamic-labs/wallet-connector-core');
package/src/index.js CHANGED
@@ -5,6 +5,7 @@ export { ExodusEvm } from './injected/ExodusEvm.js';
5
5
  import { injectedWalletOverrides, fetchInjectedWalletConnector } from './injected/fetchInjectedWalletConnectors.js';
6
6
  export { fetchInjectedWalletConnector, injectedWalletOverrides } from './injected/fetchInjectedWalletConnectors.js';
7
7
  import './walletConnect/walletConnectV2.js';
8
+ import '../_virtual/_tslib.js';
8
9
  import '@walletconnect/ethereum-provider';
9
10
  import 'viem';
10
11
  import '@dynamic-labs/wallet-connector-core';
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var _tslib = require('../../_virtual/_tslib.cjs');
4
- var viem = require('viem');
5
4
  var walletBook = require('@dynamic-labs/wallet-book');
6
5
  var ethProviderHelper = require('../ethProviderHelper.cjs');
7
6
  var EthWalletConnector = require('../EthWalletConnector.cjs');
@@ -17,20 +16,23 @@ class InjectedWalletBase extends EthWalletConnector.EthWalletConnector {
17
16
  }
18
17
  getEthProviderHelper() {
19
18
  if (!this.wallet) {
20
- this.wallet = walletBook.getWalletBookWallet(this.walletBook, this.key);
19
+ // changing this to findWalletBookWallet so it returns undefined if not found which
20
+ // allows the getEthProviderHelper to return undefined if the wallet is not installed
21
+ this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
21
22
  }
22
23
  if (this.wallet && !this.ethProviderHelper) {
23
24
  this.ethProviderHelper = new ethProviderHelper.EthProviderHelper(this.wallet);
24
25
  }
26
+ // this.ethProviderHelper is undefined if the wallet is not installed or found in walletbook
25
27
  return this.ethProviderHelper;
26
28
  }
27
29
  getMobileOrInstalledWallet() {
28
- var _a, _b, _c;
30
+ var _a, _b, _c, _d;
29
31
  if (this.walletConnectorFallback && !this.isInstalledOnBrowser()) {
30
32
  if (!this.wallet)
31
- this.wallet = walletBook.getWalletBookWallet(this.walletBook, this.key);
33
+ this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
32
34
  if (((_a = this.constructorProps) === null || _a === void 0 ? void 0 : _a.isWalletConnectV2Enabled) &&
33
- ((_c = (_b = this.wallet.walletConnect) === null || _b === void 0 ? void 0 : _b.sdks) === null || _c === void 0 ? void 0 : _c.includes('sign_v2'))) {
35
+ ((_d = (_c = (_b = this.wallet) === null || _b === void 0 ? void 0 : _b.walletConnect) === null || _c === void 0 ? void 0 : _c.sdks) === null || _d === void 0 ? void 0 : _d.includes('sign_v2'))) {
34
36
  return new walletConnectV2.WalletConnectV2(Object.assign(Object.assign({}, this.constructorProps), { walletName: this.name }));
35
37
  }
36
38
  else {
@@ -46,7 +48,7 @@ class InjectedWalletBase extends EthWalletConnector.EthWalletConnector {
46
48
  const ethProviderHelper = this.getEthProviderHelper();
47
49
  if (!ethProviderHelper)
48
50
  return;
49
- const { tearDownEventListeners } = ethProviderHelper._setupEventListeners(this, viem.createPublicClient({ transport: viem.custom(provider) }));
51
+ const { tearDownEventListeners } = ethProviderHelper._setupEventListeners(this);
50
52
  this.teardownEventListeners = tearDownEventListeners;
51
53
  }
52
54
  getWalletClient() {
@@ -1,6 +1,5 @@
1
1
  import { __awaiter } from '../../_virtual/_tslib.js';
2
- import { createPublicClient, custom } from 'viem';
3
- import { getWalletBookWallet } from '@dynamic-labs/wallet-book';
2
+ import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
4
3
  import { EthProviderHelper } from '../ethProviderHelper.js';
5
4
  import { EthWalletConnector } from '../EthWalletConnector.js';
6
5
  import { WalletConnectV2 } from '../walletConnect/walletConnectV2.js';
@@ -15,20 +14,23 @@ class InjectedWalletBase extends EthWalletConnector {
15
14
  }
16
15
  getEthProviderHelper() {
17
16
  if (!this.wallet) {
18
- this.wallet = getWalletBookWallet(this.walletBook, this.key);
17
+ // changing this to findWalletBookWallet so it returns undefined if not found which
18
+ // allows the getEthProviderHelper to return undefined if the wallet is not installed
19
+ this.wallet = findWalletBookWallet(this.walletBook, this.key);
19
20
  }
20
21
  if (this.wallet && !this.ethProviderHelper) {
21
22
  this.ethProviderHelper = new EthProviderHelper(this.wallet);
22
23
  }
24
+ // this.ethProviderHelper is undefined if the wallet is not installed or found in walletbook
23
25
  return this.ethProviderHelper;
24
26
  }
25
27
  getMobileOrInstalledWallet() {
26
- var _a, _b, _c;
28
+ var _a, _b, _c, _d;
27
29
  if (this.walletConnectorFallback && !this.isInstalledOnBrowser()) {
28
30
  if (!this.wallet)
29
- this.wallet = getWalletBookWallet(this.walletBook, this.key);
31
+ this.wallet = findWalletBookWallet(this.walletBook, this.key);
30
32
  if (((_a = this.constructorProps) === null || _a === void 0 ? void 0 : _a.isWalletConnectV2Enabled) &&
31
- ((_c = (_b = this.wallet.walletConnect) === null || _b === void 0 ? void 0 : _b.sdks) === null || _c === void 0 ? void 0 : _c.includes('sign_v2'))) {
33
+ ((_d = (_c = (_b = this.wallet) === null || _b === void 0 ? void 0 : _b.walletConnect) === null || _c === void 0 ? void 0 : _c.sdks) === null || _d === void 0 ? void 0 : _d.includes('sign_v2'))) {
32
34
  return new WalletConnectV2(Object.assign(Object.assign({}, this.constructorProps), { walletName: this.name }));
33
35
  }
34
36
  else {
@@ -44,7 +46,7 @@ class InjectedWalletBase extends EthWalletConnector {
44
46
  const ethProviderHelper = this.getEthProviderHelper();
45
47
  if (!ethProviderHelper)
46
48
  return;
47
- const { tearDownEventListeners } = ethProviderHelper._setupEventListeners(this, createPublicClient({ transport: custom(provider) }));
49
+ const { tearDownEventListeners } = ethProviderHelper._setupEventListeners(this);
48
50
  this.teardownEventListeners = tearDownEventListeners;
49
51
  }
50
52
  getWalletClient() {
@@ -21,16 +21,11 @@ class PhantomEvm extends InjectedWalletBase {
21
21
  if (this.isInstalledOnBrowser()) {
22
22
  return _super.fetchPublicAddress.call(this);
23
23
  }
24
- const url = encodeURIComponent(window.location.toString());
25
- const ref = encodeURIComponent(window.location.origin);
26
- // samsung browser only supports native links, not universal links
27
24
  if (utils.isMobile()) {
28
- if (utils.isSamsungBrowser()) {
29
- window.location.assign(`phantom://browse/${url}?ref=${ref}`);
30
- }
31
- else {
32
- window.location.assign(`https://phantom.app/ul/browse/${url}?ref=${ref}`);
33
- }
25
+ utils.handleMobileWalletRedirect({
26
+ nativeLink: 'phantom://browse',
27
+ universalLink: 'https://phantom.app/ul/browse',
28
+ });
34
29
  }
35
30
  return undefined;
36
31
  });
@@ -1,5 +1,5 @@
1
1
  import { __awaiter } from '../../_virtual/_tslib.js';
2
- import { isMobile, isSamsungBrowser } from '@dynamic-labs/utils';
2
+ import { isMobile, handleMobileWalletRedirect } from '@dynamic-labs/utils';
3
3
  import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
4
4
  import InjectedWalletBase from './InjectedWalletBase.js';
5
5
 
@@ -17,16 +17,11 @@ class PhantomEvm extends InjectedWalletBase {
17
17
  if (this.isInstalledOnBrowser()) {
18
18
  return _super.fetchPublicAddress.call(this);
19
19
  }
20
- const url = encodeURIComponent(window.location.toString());
21
- const ref = encodeURIComponent(window.location.origin);
22
- // samsung browser only supports native links, not universal links
23
20
  if (isMobile()) {
24
- if (isSamsungBrowser()) {
25
- window.location.assign(`phantom://browse/${url}?ref=${ref}`);
26
- }
27
- else {
28
- window.location.assign(`https://phantom.app/ul/browse/${url}?ref=${ref}`);
29
- }
21
+ handleMobileWalletRedirect({
22
+ nativeLink: 'phantom://browse',
23
+ universalLink: 'https://phantom.app/ul/browse',
24
+ });
30
25
  }
31
26
  return undefined;
32
27
  });
package/src/types.d.ts CHANGED
@@ -26,11 +26,6 @@ export type IEthereum = {
26
26
  export type ProviderFlag = 'isDawn' | 'isBraveWallet' | 'isCoinbaseWallet' | 'isFrame' | 'isGamestop' | 'isMetaMask' | 'isExodus' | 'isOpera' | 'isBlocto' | 'isTrustWallet' | 'isZerion' | 'isPhantom' | 'isSuperb' | 'isRabby' | 'isOkxWallet';
27
27
  export type EthProviderCondition = ProviderCondition<ProviderFlag>;
28
28
  export type Provider = () => PublicClient | undefined;
29
- export type AccountChangeEventHandler = (accounts: string[]) => Promise<void>;
30
- export type ChainChangeEventHandler = (chainId: string | number) => Promise<void>;
31
- export type DisconnectEventHandler = (error?: {
32
- code: number;
33
- }) => Promise<void>;
34
29
  export type ExternalProviderEventEmitter = PublicClient & {
35
30
  on: (event: string, listener: (...args: Array<any>) => unknown) => void;
36
31
  removeListener: (event: string, listener: (...args: Array<any>) => unknown) => void;
@@ -12,8 +12,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
12
12
 
13
13
  var Client__default = /*#__PURE__*/_interopDefaultLegacy(Client);
14
14
 
15
- const initClient = (name, bridge, settings) => {
16
- const storageId = `walletconnect-${name}`;
15
+ const initClient = (key, bridge, settings) => {
16
+ const storageId = `walletconnect-${key}`;
17
17
  const session = localStorage.getItem(storageId);
18
18
  const clientArgs = session
19
19
  ? { session: JSON.parse(session), storageId }
@@ -2,7 +2,7 @@ import Client from '@walletconnect/client';
2
2
  import { PublicClient } from 'viem';
3
3
  import { FetchPublicAddressOpts, PayloadParams, DeepLinkVariant, WalletConnector } from '@dynamic-labs/wallet-connector-core';
4
4
  import { WalletSchema } from '@dynamic-labs/wallet-book';
5
- export declare const initClient: (name: string, bridge: string, settings?: any) => Client;
5
+ export declare const initClient: (key: string, bridge: string, settings?: any) => Client;
6
6
  /**
7
7
  * Attach event handlers to WalletConnect events.
8
8
  */
@@ -4,8 +4,8 @@ import { hashMessage } from 'viem';
4
4
  import { isSameAddress, logger, performPlatformSpecificConnectionMethod, getDeepLink } from '@dynamic-labs/wallet-connector-core';
5
5
  import { isMobile } from '@dynamic-labs/utils';
6
6
 
7
- const initClient = (name, bridge, settings) => {
8
- const storageId = `walletconnect-${name}`;
7
+ const initClient = (key, bridge, settings) => {
8
+ const storageId = `walletconnect-${key}`;
9
9
  const session = localStorage.getItem(storageId);
10
10
  const clientArgs = session
11
11
  ? { session: JSON.parse(session), storageId }
@@ -36,7 +36,7 @@ class WalletConnect extends EthWalletConnector.EthWalletConnector {
36
36
  if (this.client) {
37
37
  return this.client;
38
38
  }
39
- this.client = client.initClient(walletConnectorCore.normalizeWalletName(this.name), this.bridge, this.clientOptions);
39
+ this.client = client.initClient(this.key, this.bridge, this.clientOptions);
40
40
  return this.client;
41
41
  }
42
42
  supportsNetworkSwitching() {
@@ -1,7 +1,7 @@
1
1
  import { __rest, __awaiter } from '../../_virtual/_tslib.js';
2
2
  import WalletConnectProvider from '@walletconnect/ethereum-provider';
3
3
  import { createWalletClient, custom } from 'viem';
4
- import { normalizeWalletName, getDeepLink } from '@dynamic-labs/wallet-connector-core';
4
+ import { getDeepLink } from '@dynamic-labs/wallet-connector-core';
5
5
  import { getWalletBookWallet } from '@dynamic-labs/wallet-book';
6
6
  import { isMobile, DynamicError } from '@dynamic-labs/utils';
7
7
  import { EthWalletConnector } from '../EthWalletConnector.js';
@@ -28,7 +28,7 @@ class WalletConnect extends EthWalletConnector {
28
28
  if (this.client) {
29
29
  return this.client;
30
30
  }
31
- this.client = initClient(normalizeWalletName(this.name), this.bridge, this.clientOptions);
31
+ this.client = initClient(this.key, this.bridge, this.clientOptions);
32
32
  return this.client;
33
33
  }
34
34
  supportsNetworkSwitching() {
@@ -39,9 +39,6 @@ class WalletConnectV2 extends EthWalletConnector.EthWalletConnector {
39
39
  this.projectId = opts.projectId;
40
40
  this.deepLinkPreference = opts.deepLinkPreference || 'native';
41
41
  this.preferredChains = opts.walletConnectPreferredChains || [];
42
- if (!this.preferredChains.includes('eip155:1')) {
43
- this.preferredChains.push('eip155:1');
44
- }
45
42
  this.hasSwitchedNetwork =
46
43
  (_a = Boolean(localStorage.getItem(this.swicthedNetworkKey))) !== null && _a !== void 0 ? _a : false;
47
44
  const lsCurrentChain = localStorage.getItem(this.currentChainKey);
@@ -55,6 +52,16 @@ class WalletConnectV2 extends EthWalletConnector.EthWalletConnector {
55
52
  .filter((network) => network.chainId !== 11297108109)
56
53
  .map((network) => `eip155:${network.chainId}`));
57
54
  }
55
+ getMappedChainsByPreferredOrder() {
56
+ // adding Ethereum to avoid an error connecting if none of the evm networks are supported by the wallet
57
+ const allChains = this.getMappedChains();
58
+ if (!allChains.includes('eip155:1')) {
59
+ allChains.push('eip155:1');
60
+ }
61
+ const reorderedChains = this.preferredChains.filter((chain) => allChains.includes(chain));
62
+ const remainingChains = allChains.filter((chain) => !this.preferredChains.includes(chain));
63
+ return [...reorderedChains, ...remainingChains];
64
+ }
58
65
  initConnection() {
59
66
  return _tslib.__awaiter(this, void 0, void 0, function* () {
60
67
  const { provider } = WalletConnectV2;
@@ -67,7 +74,7 @@ class WalletConnectV2 extends EthWalletConnector.EthWalletConnector {
67
74
  }
68
75
  const optionalNamespaces = {
69
76
  eip155: {
70
- chains: this.getMappedChains(),
77
+ chains: this.getMappedChainsByPreferredOrder(),
71
78
  events: ['chainChanged', 'accountsChanged'],
72
79
  methods: [
73
80
  'eth_chainId',
@@ -89,7 +96,7 @@ class WalletConnectV2 extends EthWalletConnector.EthWalletConnector {
89
96
  })
90
97
  .catch((e) => {
91
98
  walletConnectorCore.logger.error(e);
92
- ee.emit('walletconnect_connection_failed');
99
+ ee.emit('walletconnect_connection_failed', e);
93
100
  });
94
101
  });
95
102
  }
@@ -432,11 +439,17 @@ class WalletConnectV2 extends EthWalletConnector.EthWalletConnector {
432
439
  return [this.activeAccount];
433
440
  });
434
441
  }
442
+ isMetaMask() {
443
+ var _a, _b, _c, _d, _e;
444
+ return ((_e = (_d = (_c = (_b = (_a = this.session) === null || _a === void 0 ? void 0 : _a.peer) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c.name) === null || _d === void 0 ? void 0 : _d.toLowerCase().startsWith('metamask')) !== null && _e !== void 0 ? _e : false);
445
+ }
435
446
  getSupportedNetworks() {
436
447
  var _a;
437
448
  return _tslib.__awaiter(this, void 0, void 0, function* () {
438
- if (!this.hasSwitchedNetwork) {
439
- return undefined;
449
+ // MM allows you to switch to any network the first time, even if it's not enabled in MM
450
+ // so we should consider all networks as supported if network switching hasn't been triggered yet
451
+ if (this.isMetaMask() && !this.hasSwitchedNetwork) {
452
+ return this.evmNetworks.map((network) => network.chainId.toString());
440
453
  }
441
454
  yield this.initProvider();
442
455
  this.refreshSession();
@@ -452,7 +465,9 @@ class WalletConnectV2 extends EthWalletConnector.EthWalletConnector {
452
465
  }
453
466
  });
454
467
  (_a = this.session.namespaces.eip155) === null || _a === void 0 ? void 0 : _a.accounts.forEach((account) => chains.push(account.split(':')[1]));
455
- return chains.length ? chains : undefined;
468
+ return chains.length
469
+ ? chains
470
+ : this.evmNetworks.map((network) => network.chainId.toString());
456
471
  });
457
472
  }
458
473
  }
@@ -27,6 +27,7 @@ export declare class WalletConnectV2 extends EthWalletConnector {
27
27
  private _hasSwitchedNetwork;
28
28
  constructor(opts: WalletConnectorV2Opts);
29
29
  private getMappedChains;
30
+ private getMappedChainsByPreferredOrder;
30
31
  private initConnection;
31
32
  private createInitProviderPromise;
32
33
  private initProvider;
@@ -71,10 +72,10 @@ export declare class WalletConnectV2 extends EthWalletConnector {
71
72
  [x: string]: Record<string, any>;
72
73
  eth_accounts: Record<string, any>;
73
74
  }) => Promise<import("viem").RequestPermissionsReturnType>;
74
- sendRawTransaction: (args: import("viem/_types/actions/wallet/sendRawTransaction").SendRawTransactionParameters) => Promise<`0x${string}`>;
75
+ sendRawTransaction: (args: import("node_modules/viem/_types/actions/wallet/sendRawTransaction").SendRawTransactionParameters) => Promise<`0x${string}`>;
75
76
  sendTransaction: <TChainOverride_2 extends import("viem").Chain | undefined = undefined>(args: import("viem").SendTransactionParameters<undefined, undefined, TChainOverride_2>) => Promise<`0x${string}`>;
76
77
  signMessage: (args: import("viem").SignMessageParameters<undefined>) => Promise<`0x${string}`>;
77
- signTransaction: <TChainOverride_3 extends import("viem").Chain | undefined = undefined>(args: import("viem/_types/actions/wallet/signTransaction").SignTransactionParameters<undefined, undefined, TChainOverride_3>) => Promise<`0x${string}`>;
78
+ signTransaction: <TChainOverride_3 extends import("viem").Chain | undefined = undefined>(args: import("node_modules/viem/_types/actions/wallet/signTransaction").SignTransactionParameters<undefined, undefined, TChainOverride_3>) => Promise<`0x${string}`>;
78
79
  signTypedData: <const TTypedData extends {
79
80
  [x: string]: readonly import("viem").TypedDataParameter[];
80
81
  [x: `string[${string}]`]: undefined;
@@ -327,5 +328,6 @@ export declare class WalletConnectV2 extends EthWalletConnector {
327
328
  provider: WalletClient;
328
329
  }): Promise<void>;
329
330
  getConnectedAccounts(): Promise<string[]>;
331
+ private isMetaMask;
330
332
  getSupportedNetworks(): Promise<string[] | undefined>;
331
333
  }
@@ -30,9 +30,6 @@ class WalletConnectV2 extends EthWalletConnector {
30
30
  this.projectId = opts.projectId;
31
31
  this.deepLinkPreference = opts.deepLinkPreference || 'native';
32
32
  this.preferredChains = opts.walletConnectPreferredChains || [];
33
- if (!this.preferredChains.includes('eip155:1')) {
34
- this.preferredChains.push('eip155:1');
35
- }
36
33
  this.hasSwitchedNetwork =
37
34
  (_a = Boolean(localStorage.getItem(this.swicthedNetworkKey))) !== null && _a !== void 0 ? _a : false;
38
35
  const lsCurrentChain = localStorage.getItem(this.currentChainKey);
@@ -46,6 +43,16 @@ class WalletConnectV2 extends EthWalletConnector {
46
43
  .filter((network) => network.chainId !== 11297108109)
47
44
  .map((network) => `eip155:${network.chainId}`));
48
45
  }
46
+ getMappedChainsByPreferredOrder() {
47
+ // adding Ethereum to avoid an error connecting if none of the evm networks are supported by the wallet
48
+ const allChains = this.getMappedChains();
49
+ if (!allChains.includes('eip155:1')) {
50
+ allChains.push('eip155:1');
51
+ }
52
+ const reorderedChains = this.preferredChains.filter((chain) => allChains.includes(chain));
53
+ const remainingChains = allChains.filter((chain) => !this.preferredChains.includes(chain));
54
+ return [...reorderedChains, ...remainingChains];
55
+ }
49
56
  initConnection() {
50
57
  return __awaiter(this, void 0, void 0, function* () {
51
58
  const { provider } = WalletConnectV2;
@@ -58,7 +65,7 @@ class WalletConnectV2 extends EthWalletConnector {
58
65
  }
59
66
  const optionalNamespaces = {
60
67
  eip155: {
61
- chains: this.getMappedChains(),
68
+ chains: this.getMappedChainsByPreferredOrder(),
62
69
  events: ['chainChanged', 'accountsChanged'],
63
70
  methods: [
64
71
  'eth_chainId',
@@ -80,7 +87,7 @@ class WalletConnectV2 extends EthWalletConnector {
80
87
  })
81
88
  .catch((e) => {
82
89
  logger.error(e);
83
- ee.emit('walletconnect_connection_failed');
90
+ ee.emit('walletconnect_connection_failed', e);
84
91
  });
85
92
  });
86
93
  }
@@ -423,11 +430,17 @@ class WalletConnectV2 extends EthWalletConnector {
423
430
  return [this.activeAccount];
424
431
  });
425
432
  }
433
+ isMetaMask() {
434
+ var _a, _b, _c, _d, _e;
435
+ return ((_e = (_d = (_c = (_b = (_a = this.session) === null || _a === void 0 ? void 0 : _a.peer) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c.name) === null || _d === void 0 ? void 0 : _d.toLowerCase().startsWith('metamask')) !== null && _e !== void 0 ? _e : false);
436
+ }
426
437
  getSupportedNetworks() {
427
438
  var _a;
428
439
  return __awaiter(this, void 0, void 0, function* () {
429
- if (!this.hasSwitchedNetwork) {
430
- return undefined;
440
+ // MM allows you to switch to any network the first time, even if it's not enabled in MM
441
+ // so we should consider all networks as supported if network switching hasn't been triggered yet
442
+ if (this.isMetaMask() && !this.hasSwitchedNetwork) {
443
+ return this.evmNetworks.map((network) => network.chainId.toString());
431
444
  }
432
445
  yield this.initProvider();
433
446
  this.refreshSession();
@@ -443,7 +456,9 @@ class WalletConnectV2 extends EthWalletConnector {
443
456
  }
444
457
  });
445
458
  (_a = this.session.namespaces.eip155) === null || _a === void 0 ? void 0 : _a.accounts.forEach((account) => chains.push(account.split(':')[1]));
446
- return chains.length ? chains : undefined;
459
+ return chains.length
460
+ ? chains
461
+ : this.evmNetworks.map((network) => network.chainId.toString());
447
462
  });
448
463
  }
449
464
  }
@@ -1,34 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _tslib = require('../../_virtual/_tslib.cjs');
6
-
7
- const eventListenerHandlers = (walletConnector, publicClient) => {
8
- const handleAccountChange = (accounts) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
9
- if (accounts.length === 0) {
10
- walletConnector.emit('disconnect');
11
- return;
12
- }
13
- walletConnector.emit('accountChange', { accounts });
14
- });
15
- const handleChainChange = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
16
- const chainId = yield publicClient.getChainId();
17
- walletConnector.emit('chainChange', {
18
- chain: chainId.toString(),
19
- });
20
- });
21
- const handleDisconnect = (error) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
22
- if ((error === null || error === void 0 ? void 0 : error.code) === 1013) {
23
- return;
24
- }
25
- walletConnector.emit('disconnect');
26
- });
27
- return {
28
- handleAccountChange,
29
- handleChainChange,
30
- handleDisconnect,
31
- };
32
- };
33
-
34
- exports.eventListenerHandlers = eventListenerHandlers;
@@ -1,8 +0,0 @@
1
- import { PublicClient } from 'viem';
2
- import { WalletConnector } from '@dynamic-labs/wallet-connector-core';
3
- import { AccountChangeEventHandler, ChainChangeEventHandler, DisconnectEventHandler } from '../types';
4
- export declare const eventListenerHandlers: (walletConnector: WalletConnector, publicClient: PublicClient) => {
5
- handleAccountChange: AccountChangeEventHandler;
6
- handleChainChange: ChainChangeEventHandler;
7
- handleDisconnect: DisconnectEventHandler;
8
- };
@@ -1,30 +0,0 @@
1
- import { __awaiter } from '../../_virtual/_tslib.js';
2
-
3
- const eventListenerHandlers = (walletConnector, publicClient) => {
4
- const handleAccountChange = (accounts) => __awaiter(void 0, void 0, void 0, function* () {
5
- if (accounts.length === 0) {
6
- walletConnector.emit('disconnect');
7
- return;
8
- }
9
- walletConnector.emit('accountChange', { accounts });
10
- });
11
- const handleChainChange = () => __awaiter(void 0, void 0, void 0, function* () {
12
- const chainId = yield publicClient.getChainId();
13
- walletConnector.emit('chainChange', {
14
- chain: chainId.toString(),
15
- });
16
- });
17
- const handleDisconnect = (error) => __awaiter(void 0, void 0, void 0, function* () {
18
- if ((error === null || error === void 0 ? void 0 : error.code) === 1013) {
19
- return;
20
- }
21
- walletConnector.emit('disconnect');
22
- });
23
- return {
24
- handleAccountChange,
25
- handleChainChange,
26
- handleDisconnect,
27
- };
28
- };
29
-
30
- export { eventListenerHandlers };