@dynamic-labs/wallet-connector-core 3.0.0-alpha.2 → 3.0.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,235 @@
1
1
 
2
+ ## [3.0.0-alpha.20](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.19...v3.0.0-alpha.20) (2024-07-15)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * show/hide confirmation ui for aa session key wallets ([#6334](https://github.com/dynamic-labs/DynamicAuth/issues/6334)) ([6e17162](https://github.com/dynamic-labs/DynamicAuth/commit/6e17162e31915620b622f3ec5b4f8b7087f1728c))
8
+
9
+ ## [3.0.0-alpha.19](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.18...v3.0.0-alpha.19) (2024-07-13)
10
+
11
+ ## [3.0.0-alpha.18](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.17...v3.0.0-alpha.18) (2024-07-12)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * hide confirmation ui triggers passkey creation ([#6322](https://github.com/dynamic-labs/DynamicAuth/issues/6322)) ([c66f282](https://github.com/dynamic-labs/DynamicAuth/commit/c66f282cf8d64f19d7f5a7355aaaec980afbe245))
17
+
18
+ ## [3.0.0-alpha.17](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.16...v3.0.0-alpha.17) (2024-07-11)
19
+
20
+
21
+ ### Features
22
+
23
+ * add new hook to select wallet option to connect ([#6301](https://github.com/dynamic-labs/DynamicAuth/issues/6301)) ([833d71d](https://github.com/dynamic-labs/DynamicAuth/commit/833d71de164c57bfa22898c3425641a83a12e135))
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * refresh session keys correctly for solana embedded wallets ([#6309](https://github.com/dynamic-labs/DynamicAuth/issues/6309)) ([4b28e8a](https://github.com/dynamic-labs/DynamicAuth/commit/4b28e8ae231567754b6cfd07a7d41e86f1c73daa))
29
+
30
+ ## [3.0.0-alpha.16](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.15...v3.0.0-alpha.16) (2024-07-11)
31
+
32
+
33
+ ### ⚠ BREAKING CHANGES
34
+
35
+ * remove isConnected prop from wallets and have it as a method instead (#6265)
36
+
37
+ ### Features
38
+
39
+ * add bundlerRpc and paymasterRpc parameters to zerodev ([#6304](https://github.com/dynamic-labs/DynamicAuth/issues/6304)) ([156469b](https://github.com/dynamic-labs/DynamicAuth/commit/156469bf703f0c7fa455a24b8e4e328d3a0c58fc))
40
+
41
+
42
+ ### Bug Fixes
43
+
44
+ * headless embedded wallet export session refresh ([#6307](https://github.com/dynamic-labs/DynamicAuth/issues/6307)) ([5423cc1](https://github.com/dynamic-labs/DynamicAuth/commit/5423cc14c370968acf718b7deff6ea8df9228189))
45
+
46
+
47
+ * remove isConnected prop from wallets and have it as a method instead ([#6265](https://github.com/dynamic-labs/DynamicAuth/issues/6265)) ([652dcc2](https://github.com/dynamic-labs/DynamicAuth/commit/652dcc2d34c9a9719238606c67f600e40621183b))
48
+
49
+ ## [3.0.0-alpha.15](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.14...v3.0.0-alpha.15) (2024-07-11)
50
+
51
+
52
+ ### Bug Fixes
53
+
54
+ * catch third party wallet construction errors ([#6268](https://github.com/dynamic-labs/DynamicAuth/issues/6268)) ([badef39](https://github.com/dynamic-labs/DynamicAuth/commit/badef39d753c7d29925c6c8680053027bd99b69b))
55
+ * decode all solana transactions ([#6294](https://github.com/dynamic-labs/DynamicAuth/issues/6294)) ([5220ab2](https://github.com/dynamic-labs/DynamicAuth/commit/5220ab29381f3a7f1afc7043332b5a018b47eb0a))
56
+ * passkey cta ([#6255](https://github.com/dynamic-labs/DynamicAuth/issues/6255)) ([1b1b152](https://github.com/dynamic-labs/DynamicAuth/commit/1b1b152a24b409c5d941a9c92a003daf0bbe48a1))
57
+
58
+ ## [3.0.0-alpha.14](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.13...v3.0.0-alpha.14) (2024-07-09)
59
+
60
+
61
+ ### ⚠ BREAKING CHANGES
62
+
63
+ * remove setPrimaryWallet in favor of useSwitchWallet (#6212)
64
+ * move getBalance method to wallet so it can be fetched for any wallet not just the active one (#6200)
65
+ * make Wallet a class instead of just a type (#6094)
66
+
67
+ ### Features
68
+
69
+ * add @dynamic-labs/solana-extension ([#6140](https://github.com/dynamic-labs/DynamicAuth/issues/6140)) ([c0e2a06](https://github.com/dynamic-labs/DynamicAuth/commit/c0e2a067dd83163094b58a15696df8654da47c65))
70
+ * add solana support for multi-asset ([#6222](https://github.com/dynamic-labs/DynamicAuth/issues/6222)) ([9660d79](https://github.com/dynamic-labs/DynamicAuth/commit/9660d7962f1fb01011d68397bb367fdfc5335ca9))
71
+
72
+
73
+ ### Bug Fixes
74
+
75
+ * allow closing re-connect wallet modal ([#6250](https://github.com/dynamic-labs/DynamicAuth/issues/6250)) ([55ba25b](https://github.com/dynamic-labs/DynamicAuth/commit/55ba25bd3e907629aaa26e788885bfa38f8fe350))
76
+ * move getBalance method to wallet so it can be fetched for any wallet not just the active one ([#6200](https://github.com/dynamic-labs/DynamicAuth/issues/6200)) ([ee94773](https://github.com/dynamic-labs/DynamicAuth/commit/ee94773df9b31462a325666760fcf1fc70dec68a))
77
+ * move getNameService method to wallet so name service data can be fetched for any wallet ([#6205](https://github.com/dynamic-labs/DynamicAuth/issues/6205)) ([6671ae9](https://github.com/dynamic-labs/DynamicAuth/commit/6671ae92532ffc1889e24519e75f47d336ac0da6))
78
+ * relax phone number length validation ([#6226](https://github.com/dynamic-labs/DynamicAuth/issues/6226)) ([f0969b4](https://github.com/dynamic-labs/DynamicAuth/commit/f0969b4fbdafde07125cddecb16b4bfd011ea65e))
79
+ * sdkHasLoaded flipping back to false with otp ([#6242](https://github.com/dynamic-labs/DynamicAuth/issues/6242)) ([32ad9dd](https://github.com/dynamic-labs/DynamicAuth/commit/32ad9dd2dae7775f494506773fb343fe1a249c65))
80
+ * send transaction demo undefined address/value ([#6248](https://github.com/dynamic-labs/DynamicAuth/issues/6248)) ([036a511](https://github.com/dynamic-labs/DynamicAuth/commit/036a511fb848ef461edd9b7a5d79d478b0f1cf23))
81
+ * set last active account on accountChange request ([#6218](https://github.com/dynamic-labs/DynamicAuth/issues/6218)) ([05797d2](https://github.com/dynamic-labs/DynamicAuth/commit/05797d292aab8b4de02555594d4d1bbd4c9543eb))
82
+ * show ledger toggle when linking wallet ([#6202](https://github.com/dynamic-labs/DynamicAuth/issues/6202)) ([a449c0b](https://github.com/dynamic-labs/DynamicAuth/commit/a449c0bfc4e3a75ccd7084b930c48fbd6c14f691))
83
+ * show user wallet in profile view on single wallet mode even if it's not primary ([#6187](https://github.com/dynamic-labs/DynamicAuth/issues/6187)) ([ffaaeb2](https://github.com/dynamic-labs/DynamicAuth/commit/ffaaeb2c6cbb2868a381d85451ae5574024156bb))
84
+ * stop auto-switching to connected secondary wallet if primary wallet is not connected ([#6196](https://github.com/dynamic-labs/DynamicAuth/issues/6196)) ([4e8bcd2](https://github.com/dynamic-labs/DynamicAuth/commit/4e8bcd2d02d3fca54a0ed29c45b386ae99266b84))
85
+ * stop coinbase and solflare popups when secondary ([#6225](https://github.com/dynamic-labs/DynamicAuth/issues/6225)) ([7e9c104](https://github.com/dynamic-labs/DynamicAuth/commit/7e9c1049a09c9fd513c9a2a746d6baac916f1bf4))
86
+ * stop sending double sign request on network switch ([e325709](https://github.com/dynamic-labs/DynamicAuth/commit/e325709bb5d2d1331fe16cc705398fc7b1cc292a))
87
+ * tunrkey solana signer accept uint8array message ([#6137](https://github.com/dynamic-labs/DynamicAuth/issues/6137)) ([70f89ce](https://github.com/dynamic-labs/DynamicAuth/commit/70f89ce0dafa4c99b318c9c5adce59083cd6d284))
88
+ * update formatting of phantom bitcoin publickey ([#6210](https://github.com/dynamic-labs/DynamicAuth/issues/6210)) ([f58cea9](https://github.com/dynamic-labs/DynamicAuth/commit/f58cea99333fd7c6af8f56f637ee32f1f7ce8d76))
89
+ * use white color in farcaster qr code when in dark mode ([#6245](https://github.com/dynamic-labs/DynamicAuth/issues/6245)) ([a91958d](https://github.com/dynamic-labs/DynamicAuth/commit/a91958d8773be138da8f54791c4c67866257bbad))
90
+
91
+
92
+ * make Wallet a class instead of just a type ([#6094](https://github.com/dynamic-labs/DynamicAuth/issues/6094)) ([6dc4672](https://github.com/dynamic-labs/DynamicAuth/commit/6dc4672951cfadc22a6c569e74eae3485bd472f3))
93
+ * remove setPrimaryWallet in favor of useSwitchWallet ([#6212](https://github.com/dynamic-labs/DynamicAuth/issues/6212)) ([de125e1](https://github.com/dynamic-labs/DynamicAuth/commit/de125e1ebbc20507e4ec07f337f5f5fd13aabcbe))
94
+
95
+ ## [3.0.0-alpha.13](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.12...v3.0.0-alpha.13) (2024-06-27)
96
+
97
+
98
+ ### Bug Fixes
99
+
100
+ * coinbase smart wallet better handling in iframes ([#6184](https://github.com/dynamic-labs/DynamicAuth/issues/6184)) ([2c4befe](https://github.com/dynamic-labs/DynamicAuth/commit/2c4befedd09e6a432139cb3d08ea61004c3896d5))
101
+ * show connected network name when icon url is missing ([#6191](https://github.com/dynamic-labs/DynamicAuth/issues/6191)) ([dafd9e3](https://github.com/dynamic-labs/DynamicAuth/commit/dafd9e323f47ca3d61556e9a8c84ba3bfd27af8f))
102
+ * use correct account when creating wallet client ([#6179](https://github.com/dynamic-labs/DynamicAuth/issues/6179)) ([4e45a15](https://github.com/dynamic-labs/DynamicAuth/commit/4e45a15b2d7221ec80df919aa93468a75a94bed3))
103
+
104
+ ## [3.0.0-alpha.12](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.11...v3.0.0-alpha.12) (2024-06-27)
105
+
106
+
107
+ ### ⚠ BREAKING CHANGES
108
+
109
+ * return Transaction type from signTransaction and update solana … (#6180)
110
+
111
+ ### Bug Fixes
112
+
113
+ * return Transaction type from signTransaction and update solana … ([#6180](https://github.com/dynamic-labs/DynamicAuth/issues/6180)) ([07798b2](https://github.com/dynamic-labs/DynamicAuth/commit/07798b241a13f35a62e4ca0172a57a8d0cd98cf9))
114
+
115
+ ## [3.0.0-alpha.11](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.10...v3.0.0-alpha.11) (2024-06-26)
116
+
117
+
118
+ ### Bug Fixes
119
+
120
+ * prevent unwanted magiceden solana popups ([#6158](https://github.com/dynamic-labs/DynamicAuth/issues/6158)) ([b3c8208](https://github.com/dynamic-labs/DynamicAuth/commit/b3c820887eb5ec2badcfce3b19ec4dd874e90811))
121
+ * status icon for embedded wallets ([#6149](https://github.com/dynamic-labs/DynamicAuth/issues/6149)) ([135fd72](https://github.com/dynamic-labs/DynamicAuth/commit/135fd7274f4a6b2dcab98248f7bfe34a09e79f01))
122
+
123
+ ## [3.0.0-alpha.10](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.9...v3.0.0-alpha.10) (2024-06-24)
124
+
125
+
126
+ ### Bug Fixes
127
+
128
+ * clear expiresAt from local storage on logout ([#6110](https://github.com/dynamic-labs/DynamicAuth/issues/6110)) ([cbda893](https://github.com/dynamic-labs/DynamicAuth/commit/cbda893441154b6880a5419ce62a353b80f05e55))
129
+ * show SOL amount for complex transactions and better error display ([#6068](https://github.com/dynamic-labs/DynamicAuth/issues/6068)) ([454a3a0](https://github.com/dynamic-labs/DynamicAuth/commit/454a3a0a50805b3d63f44c2ef8c1dc766617eb2b))
130
+
131
+ ## [3.0.0-alpha.9](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2024-06-21)
132
+
133
+ ## [3.0.0-alpha.8](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.7...v3.0.0-alpha.8) (2024-06-21)
134
+
135
+
136
+ ### ⚠ BREAKING CHANGES
137
+
138
+ * break out turnkey package into 3 separate packages (#6015)
139
+
140
+ ### Features
141
+
142
+ * add reinitialize hook ([#6098](https://github.com/dynamic-labs/DynamicAuth/issues/6098)) ([d978baa](https://github.com/dynamic-labs/DynamicAuth/commit/d978baa404d34064c36cc549229b1fcea1f20df0))
143
+
144
+
145
+ ### Bug Fixes
146
+
147
+ * always reconnect the wallet provider when calling getAddress ([#6097](https://github.com/dynamic-labs/DynamicAuth/issues/6097)) ([0f3d497](https://github.com/dynamic-labs/DynamicAuth/commit/0f3d497cedb38239fa9ada2bb25c6b4eaa72d7b1))
148
+ * break out turnkey package into 3 separate packages ([#6015](https://github.com/dynamic-labs/DynamicAuth/issues/6015)) ([a86fbef](https://github.com/dynamic-labs/DynamicAuth/commit/a86fbefe97558363b085e6f752af32d2943f91fa)), closes [#6017](https://github.com/dynamic-labs/DynamicAuth/issues/6017) [#6059](https://github.com/dynamic-labs/DynamicAuth/issues/6059)
149
+ * set latest blockhash on solana transactions if tx confirmation ui is disabled ([#6102](https://github.com/dynamic-labs/DynamicAuth/issues/6102)) ([b8035a3](https://github.com/dynamic-labs/DynamicAuth/commit/b8035a328e47409bf0416d3a01b2f17914488748))
150
+ * silently query unisat accounts ([#6101](https://github.com/dynamic-labs/DynamicAuth/issues/6101)) ([#6104](https://github.com/dynamic-labs/DynamicAuth/issues/6104)) ([643e704](https://github.com/dynamic-labs/DynamicAuth/commit/643e7048ff8610b31e6397e10b160ad456a45d11))
151
+ * stop querying magiceden solana accounts ([#6103](https://github.com/dynamic-labs/DynamicAuth/issues/6103)) ([#6108](https://github.com/dynamic-labs/DynamicAuth/issues/6108)) ([3cfdbc3](https://github.com/dynamic-labs/DynamicAuth/commit/3cfdbc3bc82bfe9bf53bf4236f7892a5440fcb86))
152
+ * trigger sign when linking an already linked unknown wallet ([#6105](https://github.com/dynamic-labs/DynamicAuth/issues/6105)) ([9e9c03b](https://github.com/dynamic-labs/DynamicAuth/commit/9e9c03bf615991c4f1183bf85c4d75c9a7773c85))
153
+
154
+ ## [3.0.0-alpha.7](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.6...v3.0.0-alpha.7) (2024-06-19)
155
+
156
+
157
+ ### ⚠ BREAKING CHANGES
158
+
159
+ * add selectedTabIndex and helpers (#6040)
160
+
161
+ ### Features
162
+
163
+ * add selectedTabIndex and helpers ([#6040](https://github.com/dynamic-labs/DynamicAuth/issues/6040)) ([ae20b80](https://github.com/dynamic-labs/DynamicAuth/commit/ae20b8081376dce97b18fa69c81c9ab73c1ff317))
164
+ * add useRefreshUser to trigger a user state refresh ([#6079](https://github.com/dynamic-labs/DynamicAuth/issues/6079)) ([1236d35](https://github.com/dynamic-labs/DynamicAuth/commit/1236d35fe9fab44ed2114ad9f3c8c6dca7ec27be))
165
+
166
+
167
+ ### Bug Fixes
168
+
169
+ * always return userWallets when available ([#6080](https://github.com/dynamic-labs/DynamicAuth/issues/6080)) ([#6083](https://github.com/dynamic-labs/DynamicAuth/issues/6083)) ([11992d2](https://github.com/dynamic-labs/DynamicAuth/commit/11992d2af5a401ba4ff1dc6904e2a9f8ef5904ca))
170
+ * less solana rpc calls and improve fee fetching ([#6019](https://github.com/dynamic-labs/DynamicAuth/issues/6019)) ([e2609db](https://github.com/dynamic-labs/DynamicAuth/commit/e2609db962c7708ff5b127cb23260a25bc5032e3))
171
+ * make account change idemopotent ([#6061](https://github.com/dynamic-labs/DynamicAuth/issues/6061)) ([8c87513](https://github.com/dynamic-labs/DynamicAuth/commit/8c8751390ea14888c4889679895e2f06d75717b9))
172
+ * only run multi wallet prompt when user profile or auth flow are open ([#6073](https://github.com/dynamic-labs/DynamicAuth/issues/6073)) ([d48ca10](https://github.com/dynamic-labs/DynamicAuth/commit/d48ca105359018457a78588fd8d9aa8a91583a02))
173
+ * recompute multiwallet state after merging accounts ([#6078](https://github.com/dynamic-labs/DynamicAuth/issues/6078)) ([e08a274](https://github.com/dynamic-labs/DynamicAuth/commit/e08a274c4d848f2a8360be7106cfbfa00b9a8f9b))
174
+ * stop querying okx for accounts while locked ([#6081](https://github.com/dynamic-labs/DynamicAuth/issues/6081)) ([#6084](https://github.com/dynamic-labs/DynamicAuth/issues/6084)) ([34365ac](https://github.com/dynamic-labs/DynamicAuth/commit/34365ac1981fe020b03e666c24535a247645d2ad))
175
+ * update copy for primary wallet not connected modal ([#6069](https://github.com/dynamic-labs/DynamicAuth/issues/6069)) ([4a3f43c](https://github.com/dynamic-labs/DynamicAuth/commit/4a3f43ce5585983f7fea0c5b97e812c0ade80e2c))
176
+
177
+ ## [3.0.0-alpha.6](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.5...v3.0.0-alpha.6) (2024-06-18)
178
+
179
+
180
+ ### Features
181
+
182
+ * implement useExternalAuth hook to signin using external jwt auth ([#6039](https://github.com/dynamic-labs/DynamicAuth/issues/6039)) ([ba90908](https://github.com/dynamic-labs/DynamicAuth/commit/ba90908509ec21f708a4a0782a7f94861fc3b484))
183
+
184
+
185
+ ### Bug Fixes
186
+
187
+ * allow sign-in with different ME BTC wallet after initial connection ([a527b46](https://github.com/dynamic-labs/DynamicAuth/commit/a527b464f321b4fc27730f57c3812e996b5ed878))
188
+ * close sign modal when signing in with a wallet when embedded wallet is enabled ([#6013](https://github.com/dynamic-labs/DynamicAuth/issues/6013)) ([0f4f3c8](https://github.com/dynamic-labs/DynamicAuth/commit/0f4f3c83db162f7a1794a3549b60bbad6b03e2c0))
189
+ * custom network without a valid icon should still display its name in network picker ([#6018](https://github.com/dynamic-labs/DynamicAuth/issues/6018)) ([0b10df6](https://github.com/dynamic-labs/DynamicAuth/commit/0b10df68950bfc9b8492443158a6bb030dc1122c))
190
+ * e2e: remove page pause ([#6045](https://github.com/dynamic-labs/DynamicAuth/issues/6045)) ([55bba00](https://github.com/dynamic-labs/DynamicAuth/commit/55bba0034255055d6ae266b1296542f47ed48e2b))
191
+ * more fixes for connect starknet button ([#6046](https://github.com/dynamic-labs/DynamicAuth/issues/6046)) ([0fb570a](https://github.com/dynamic-labs/DynamicAuth/commit/0fb570a44e65f8dd6d4d2bf5edb2ee54985ec9d4))
192
+ * set verified credentials on embedded wallet creation ([#6044](https://github.com/dynamic-labs/DynamicAuth/issues/6044)) ([b52a96d](https://github.com/dynamic-labs/DynamicAuth/commit/b52a96d321e7efdb30dce9cdb3f6f176c24ceb81))
193
+
194
+ ## [3.0.0-alpha.5](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.4...v3.0.0-alpha.5) (2024-06-14)
195
+
196
+
197
+ ### ⚠ BREAKING CHANGES
198
+
199
+ * remove viem dependency from non-evm packages (#5508)
200
+ * move rpc providers into their own packages (#5981)
201
+
202
+ ### Features
203
+
204
+ * add in-app browser navigation support for sats-connect ([#5988](https://github.com/dynamic-labs/DynamicAuth/issues/5988)) ([be27d2d](https://github.com/dynamic-labs/DynamicAuth/commit/be27d2d4030bbe2157e879497d8e6a00b4a3e404))
205
+ * move rpc providers into their own packages ([#5981](https://github.com/dynamic-labs/DynamicAuth/issues/5981)) ([d7a62d6](https://github.com/dynamic-labs/DynamicAuth/commit/d7a62d60e79dfa6d6651b0fa103e90b6f8a9ccf3))
206
+
207
+
208
+ ### Bug Fixes
209
+
210
+ * embedded solana wallets can send SPL tokens and estimate gas ([#5982](https://github.com/dynamic-labs/DynamicAuth/issues/5982)) ([36623eb](https://github.com/dynamic-labs/DynamicAuth/commit/36623eb99d1d1dfebfd8b6f3194eeff31e7de2bf))
211
+ * improve logic related to turnkey and emailVerifcation ([#5946](https://github.com/dynamic-labs/DynamicAuth/issues/5946)) ([dd0b2dc](https://github.com/dynamic-labs/DynamicAuth/commit/dd0b2dc6d93a8bbbcb6eef88732e62b747005bb3))
212
+ * show linked wallets with unavailable providers in user wallets list ([#5992](https://github.com/dynamic-labs/DynamicAuth/issues/5992)) ([996079c](https://github.com/dynamic-labs/DynamicAuth/commit/996079ced360651c7b1eb5273548e0548f6f9f3a))
213
+ * switch network modal not closing after switching to a supported network ([#5979](https://github.com/dynamic-labs/DynamicAuth/issues/5979)) ([f239952](https://github.com/dynamic-labs/DynamicAuth/commit/f2399523dd82bb28046992cac4582688b688bdc0))
214
+
215
+
216
+ * remove viem dependency from non-evm packages ([#5508](https://github.com/dynamic-labs/DynamicAuth/issues/5508)) ([0299dc3](https://github.com/dynamic-labs/DynamicAuth/commit/0299dc3cbb611182d763e9a89d1270c2e2f32df5))
217
+
218
+ ## [3.0.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.3...v3.0.0-alpha.4) (2024-06-12)
219
+
220
+
221
+ ### Bug Fixes
222
+
223
+ * cache getGenesisHash call to prevent over calling ([#5966](https://github.com/dynamic-labs/DynamicAuth/issues/5966)) ([b4d542f](https://github.com/dynamic-labs/DynamicAuth/commit/b4d542f0a85f5ba8c5b8f02f287caee45b4b6feb))
224
+ * handle raw messages in embedded wallet sign message modal ([#5815](https://github.com/dynamic-labs/DynamicAuth/issues/5815)) ([9adc289](https://github.com/dynamic-labs/DynamicAuth/commit/9adc28993b57c1c7f03c4ce6d500288dcf60881e))
225
+
226
+ ## [3.0.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.2...v3.0.0-alpha.3) (2024-06-11)
227
+
228
+
229
+ ### Bug Fixes
230
+
231
+ * only navigate to mfa backup codes when needed ([#5965](https://github.com/dynamic-labs/DynamicAuth/issues/5965)) ([edc462f](https://github.com/dynamic-labs/DynamicAuth/commit/edc462f20768885db1883a2c8d005e07044092d5))
232
+
2
233
  ## [3.0.0-alpha.2](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.1...v3.0.0-alpha.2) (2024-06-11)
3
234
 
4
235
 
@@ -18,6 +18,18 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18
18
  PERFORMANCE OF THIS SOFTWARE.
19
19
  ***************************************************************************** */
20
20
 
21
+ function __rest(s, e) {
22
+ var t = {};
23
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
24
+ t[p] = s[p];
25
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
26
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
27
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
28
+ t[p[i]] = s[p[i]];
29
+ }
30
+ return t;
31
+ }
32
+
21
33
  function __awaiter(thisArg, _arguments, P, generator) {
22
34
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
35
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -34,6 +46,13 @@ function __classPrivateFieldGet(receiver, state, kind, f) {
34
46
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
35
47
  }
36
48
 
49
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
50
+ if (kind === "m") throw new TypeError("Private method is not writable");
51
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
52
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
53
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
54
+ }
55
+
37
56
  typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
38
57
  var e = new Error(message);
39
58
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
@@ -41,3 +60,5 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
41
60
 
42
61
  exports.__awaiter = __awaiter;
43
62
  exports.__classPrivateFieldGet = __classPrivateFieldGet;
63
+ exports.__classPrivateFieldSet = __classPrivateFieldSet;
64
+ exports.__rest = __rest;
@@ -14,6 +14,18 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
15
  ***************************************************************************** */
16
16
 
17
+ function __rest(s, e) {
18
+ var t = {};
19
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
20
+ t[p] = s[p];
21
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
22
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
23
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
24
+ t[p[i]] = s[p[i]];
25
+ }
26
+ return t;
27
+ }
28
+
17
29
  function __awaiter(thisArg, _arguments, P, generator) {
18
30
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
31
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -30,9 +42,16 @@ function __classPrivateFieldGet(receiver, state, kind, f) {
30
42
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
31
43
  }
32
44
 
45
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
46
+ if (kind === "m") throw new TypeError("Private method is not writable");
47
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
48
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
49
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
50
+ }
51
+
33
52
  typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
34
53
  var e = new Error(message);
35
54
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
36
55
  };
37
56
 
38
- export { __awaiter, __classPrivateFieldGet };
57
+ export { __awaiter, __classPrivateFieldGet, __classPrivateFieldSet, __rest };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/wallet-connector-core",
3
- "version": "3.0.0-alpha.2",
3
+ "version": "3.0.0-alpha.20",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -26,14 +26,14 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@dynamic-labs/sdk-api-core": "0.0.461"
29
+ "@dynamic-labs/sdk-api-core": "0.0.470"
30
30
  },
31
31
  "peerDependencies": {
32
- "@dynamic-labs/logger": "3.0.0-alpha.2",
33
- "@dynamic-labs/rpc-providers": "3.0.0-alpha.2",
34
- "@dynamic-labs/types": "3.0.0-alpha.2",
35
- "@dynamic-labs/utils": "3.0.0-alpha.2",
36
- "@dynamic-labs/wallet-book": "3.0.0-alpha.2",
32
+ "@dynamic-labs/logger": "3.0.0-alpha.20",
33
+ "@dynamic-labs/rpc-providers": "3.0.0-alpha.20",
34
+ "@dynamic-labs/types": "3.0.0-alpha.20",
35
+ "@dynamic-labs/utils": "3.0.0-alpha.20",
36
+ "@dynamic-labs/wallet-book": "3.0.0-alpha.20",
37
37
  "eventemitter3": "5.0.1"
38
38
  }
39
39
  }
package/src/index.cjs CHANGED
@@ -4,6 +4,7 @@
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var WalletConnector = require('./lib/WalletConnector.cjs');
7
+ var Wallet = require('./lib/wallets/Wallet/Wallet.cjs');
7
8
  var logger = require('./utils/logger.cjs');
8
9
  var ProviderLookup = require('./utils/ProviderLookup/ProviderLookup.cjs');
9
10
  var getChainInfo = require('./utils/getChainInfo/getChainInfo.cjs');
@@ -38,6 +39,7 @@ var isSessionKeyCompatibleWalletConnector = require('./utils/isSessionKeyCompati
38
39
  exports.Chains = WalletConnector.Chains;
39
40
  exports.WalletConnectorBase = WalletConnector.WalletConnectorBase;
40
41
  exports.socialProviders = WalletConnector.socialProviders;
42
+ exports.Wallet = Wallet.Wallet;
41
43
  exports.logger = logger.logger;
42
44
  exports.ProviderLookup = ProviderLookup.ProviderLookup;
43
45
  exports.getChainInfo = getChainInfo.getChainInfo;
package/src/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  'use client'
2
2
  export { Chains, WalletConnectorBase, socialProviders } from './lib/WalletConnector.js';
3
+ export { Wallet } from './lib/wallets/Wallet/Wallet.js';
3
4
  export { logger } from './utils/logger.js';
4
5
  export { ProviderLookup } from './utils/ProviderLookup/ProviderLookup.js';
5
6
  export { getChainInfo } from './utils/getChainInfo/getChainInfo.js';
@@ -1,9 +1,13 @@
1
1
  import { IUITransaction } from '@dynamic-labs/types';
2
2
  import { WalletConnector, WalletConnectorBase } from './WalletConnector';
3
+ type GetAccountAbstractionProviderProps = {
4
+ withSponsorship?: boolean;
5
+ };
3
6
  export interface IAccountAbstractionWalletConnector extends WalletConnectorBase {
4
7
  canSponsorTransactionGas(transaction: IUITransaction): Promise<boolean>;
5
8
  disableGasSponsorshipOnce(): void;
6
- getAccountAbstractionProvider<T>(): T;
7
- getAccountAbstractionProvider(): unknown;
9
+ getAccountAbstractionProvider<T>(props?: GetAccountAbstractionProviderProps): T;
10
+ getAccountAbstractionProvider(props?: GetAccountAbstractionProviderProps): unknown;
8
11
  getEOAConnector(): WalletConnector | undefined;
9
12
  }
13
+ export {};
@@ -7,9 +7,13 @@ export interface ISessionKeyCompatibleWalletConnector extends WalletConnectorBas
7
7
  isSessionKeyCompatible(): boolean;
8
8
  isSessionActive(): Promise<boolean>;
9
9
  sessionKeys?: SessionKeys;
10
- setSessionKeyFetcher(fetcher: () => Promise<SessionKeys>): void;
10
+ setSessionKeyFetcher(fetcher: ({ ignoreRestore, }: {
11
+ ignoreRestore?: boolean;
12
+ }) => Promise<SessionKeys>): void;
11
13
  setSessionKeyRemoveFunction(fetcher: () => void): void;
12
- createOrRestoreSession(): Promise<string | undefined>;
14
+ createOrRestoreSession({ ignoreRestore, }?: {
15
+ ignoreRestore?: boolean;
16
+ }): Promise<string | undefined>;
13
17
  removeSessionKeys: (() => Promise<void>) | undefined;
14
18
  }
15
19
  export {};
@@ -6,6 +6,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
  var _tslib = require('../../_virtual/_tslib.cjs');
7
7
  var EventEmitter = require('eventemitter3');
8
8
  var walletBook = require('@dynamic-labs/wallet-book');
9
+ var utils = require('@dynamic-labs/utils');
10
+ var logger = require('../utils/logger.cjs');
9
11
  var WalletBookSingleton = require('./WalletBookSingleton.cjs');
10
12
 
11
13
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -77,21 +79,11 @@ class WalletConnectorBase extends EventEmitter__default["default"] {
77
79
  */
78
80
  this.canConnectViaSocial = false;
79
81
  /**
80
- * @deprecated getWeb3Provider has been renamed to getWalletClient
81
- * If you would like to still get the ethers web3Provider,
82
- * see our docs for enabling ethers: https://docs.dynamic.xyz/ethers
82
+ * Flag if connector/provider is available
83
83
  *
84
- * Get the wallet provider
85
- */
86
- this.getWeb3Provider = this.getWalletClient;
87
- /**
88
- * @deprecated getRpcProvider has been renamed to getPublicClient
89
- * If you would like to still get the ethers rpcProvider,
90
- * see our docs for enabling ethers: https://docs.dynamic.xyz/ethers
91
- *
92
- * Get the rpc provider
84
+ * @default true
93
85
  */
94
- this.getRpcProvider = this.getPublicClient;
86
+ this.isAvailable = true;
95
87
  /**
96
88
  * If the wallet generated by a valid embedded wallet provider
97
89
  * For example: magic wallets
@@ -182,6 +174,25 @@ class WalletConnectorBase extends EventEmitter__default["default"] {
182
174
  getAddress(opts) {
183
175
  return Promise.resolve(undefined);
184
176
  }
177
+ /**
178
+ * Parses a public address to ensure it follows a correct format.
179
+ *
180
+ * For instance, with EVM wallets, this might ensure it follows the EIP 55 format.
181
+ *
182
+ * @default string
183
+ */
184
+ parseAddress(address) {
185
+ return address;
186
+ }
187
+ /**
188
+ * Whether this wallet connector is targeting a testnet.
189
+ * So far only supported for EVM connectors.
190
+ *
191
+ * @default Promise<false>
192
+ */
193
+ isTestnet() {
194
+ return Promise.resolve(false);
195
+ }
185
196
  /**
186
197
  * Gets the additional addresses of the wallet, given the main address
187
198
  *
@@ -203,7 +214,7 @@ class WalletConnectorBase extends EventEmitter__default["default"] {
203
214
  *
204
215
  * @default Promise<undefined>
205
216
  */
206
- getBalance() {
217
+ getBalance(address) {
207
218
  return Promise.resolve(undefined);
208
219
  }
209
220
  /**
@@ -230,7 +241,7 @@ class WalletConnectorBase extends EventEmitter__default["default"] {
230
241
  *
231
242
  * @default Promise<undefined>
232
243
  */
233
- getNameService() {
244
+ getNameService(address) {
234
245
  return Promise.resolve(undefined);
235
246
  }
236
247
  getPublicClient() {
@@ -327,6 +338,41 @@ class WalletConnectorBase extends EventEmitter__default["default"] {
327
338
  setVerifiedCredentials(verifiedCredentials) {
328
339
  return;
329
340
  }
341
+ /**
342
+ * Validates if the address is connected and active in the wallet app
343
+ *
344
+ * @throws {WalletAddressMismatchError} If the active address does not match the expected address.
345
+ * @returns {Promise<void>} A promise that resolves if the active address matches the expected address,
346
+ * otherwise rejects with an error.
347
+ */
348
+ validateActiveWallet(expectedAddress) {
349
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
350
+ var _a, _b;
351
+ const [activeAddress] = yield this.getConnectedAccounts();
352
+ const isWalletActive = activeAddress === expectedAddress;
353
+ logger.logger.debug(`validateActiveWallet - wallet ${isWalletActive ? 'is' : 'is not'} active`, {
354
+ activeAddress,
355
+ expectedAddress,
356
+ });
357
+ const walletUiUtils = this.constructorProps
358
+ .walletUiUtils;
359
+ if (isWalletActive) {
360
+ return;
361
+ }
362
+ if (!walletUiUtils) {
363
+ throw new utils.WalletAddressMismatchError(`Wallet ${expectedAddress !== null && expectedAddress !== void 0 ? expectedAddress : ''} is not currently active in ${(_a = this.name) !== null && _a !== void 0 ? _a : this.key}.`, {
364
+ activeAddress,
365
+ expectedAddress,
366
+ walletName: (_b = this.name) !== null && _b !== void 0 ? _b : this.key,
367
+ });
368
+ }
369
+ return walletUiUtils.syncWallet({
370
+ activeAddress,
371
+ expectedAddress,
372
+ walletConnector: this,
373
+ });
374
+ });
375
+ }
330
376
  }
331
377
  _WalletConnectorBase_registeredExtensions = new WeakMap();
332
378
 
@@ -120,6 +120,21 @@ export declare abstract class WalletConnectorBase extends EventEmitter<WalletCon
120
120
  * @default Promise<undefined>
121
121
  */
122
122
  getAddress(opts?: GetAddressOpts): Promise<string | undefined>;
123
+ /**
124
+ * Parses a public address to ensure it follows a correct format.
125
+ *
126
+ * For instance, with EVM wallets, this might ensure it follows the EIP 55 format.
127
+ *
128
+ * @default string
129
+ */
130
+ parseAddress(address: string): string;
131
+ /**
132
+ * Whether this wallet connector is targeting a testnet.
133
+ * So far only supported for EVM connectors.
134
+ *
135
+ * @default Promise<false>
136
+ */
137
+ isTestnet(): Promise<boolean>;
123
138
  /**
124
139
  * Gets the additional addresses of the wallet, given the main address
125
140
  *
@@ -137,7 +152,7 @@ export declare abstract class WalletConnectorBase extends EventEmitter<WalletCon
137
152
  *
138
153
  * @default Promise<undefined>
139
154
  */
140
- getBalance(): Promise<string | undefined>;
155
+ getBalance(address: string): Promise<string | undefined>;
141
156
  /**
142
157
  * Get the address silently
143
158
  *
@@ -161,7 +176,7 @@ export declare abstract class WalletConnectorBase extends EventEmitter<WalletCon
161
176
  *
162
177
  * @default Promise<undefined>
163
178
  */
164
- getNameService(): Promise<NameServiceData | undefined>;
179
+ getNameService(address: string): Promise<NameServiceData | undefined>;
165
180
  /**
166
181
  * Get the RPC provider for the wallet
167
182
  *
@@ -169,28 +184,6 @@ export declare abstract class WalletConnectorBase extends EventEmitter<WalletCon
169
184
  */
170
185
  getPublicClient(): Promise<unknown>;
171
186
  getPublicClient<T>(): Promise<T>;
172
- /**
173
- * @deprecated getWeb3Provider has been renamed to getWalletClient
174
- * If you would like to still get the ethers web3Provider,
175
- * see our docs for enabling ethers: https://docs.dynamic.xyz/ethers
176
- *
177
- * Get the wallet provider
178
- */
179
- getWeb3Provider: {
180
- (chainId?: string): unknown;
181
- <T>(chainId?: string): T;
182
- };
183
- /**
184
- * @deprecated getRpcProvider has been renamed to getPublicClient
185
- * If you would like to still get the ethers rpcProvider,
186
- * see our docs for enabling ethers: https://docs.dynamic.xyz/ethers
187
- *
188
- * Get the rpc provider
189
- */
190
- getRpcProvider: {
191
- (): Promise<unknown>;
192
- <T>(): Promise<T>;
193
- };
194
187
  /**
195
188
  * Get the session for the wallet
196
189
  * @default Promise<undefined>
@@ -217,6 +210,12 @@ export declare abstract class WalletConnectorBase extends EventEmitter<WalletCon
217
210
  * @default Promise<void>
218
211
  */
219
212
  init(): Promise<void>;
213
+ /**
214
+ * Flag if connector/provider is available
215
+ *
216
+ * @default true
217
+ */
218
+ isAvailable: boolean;
220
219
  /**
221
220
  * If the wallet generated by a valid embedded wallet provider
222
221
  * For example: magic wallets
@@ -316,4 +315,12 @@ export declare abstract class WalletConnectorBase extends EventEmitter<WalletCon
316
315
  * Receive the user verified credentials
317
316
  */
318
317
  setVerifiedCredentials(verifiedCredentials: JwtVerifiedCredential[]): void;
318
+ /**
319
+ * Validates if the address is connected and active in the wallet app
320
+ *
321
+ * @throws {WalletAddressMismatchError} If the active address does not match the expected address.
322
+ * @returns {Promise<void>} A promise that resolves if the active address matches the expected address,
323
+ * otherwise rejects with an error.
324
+ */
325
+ validateActiveWallet(expectedAddress: string): Promise<void>;
319
326
  }
@@ -2,6 +2,8 @@
2
2
  import { __classPrivateFieldGet, __awaiter } from '../../_virtual/_tslib.js';
3
3
  import EventEmitter from 'eventemitter3';
4
4
  import { getWalletBookWallet } from '@dynamic-labs/wallet-book';
5
+ import { WalletAddressMismatchError } from '@dynamic-labs/utils';
6
+ import { logger } from '../utils/logger.js';
5
7
  import { WalletBookSingleton } from './WalletBookSingleton.js';
6
8
 
7
9
  /* eslint-disable @typescript-eslint/triple-slash-reference */
@@ -69,21 +71,11 @@ class WalletConnectorBase extends EventEmitter {
69
71
  */
70
72
  this.canConnectViaSocial = false;
71
73
  /**
72
- * @deprecated getWeb3Provider has been renamed to getWalletClient
73
- * If you would like to still get the ethers web3Provider,
74
- * see our docs for enabling ethers: https://docs.dynamic.xyz/ethers
74
+ * Flag if connector/provider is available
75
75
  *
76
- * Get the wallet provider
77
- */
78
- this.getWeb3Provider = this.getWalletClient;
79
- /**
80
- * @deprecated getRpcProvider has been renamed to getPublicClient
81
- * If you would like to still get the ethers rpcProvider,
82
- * see our docs for enabling ethers: https://docs.dynamic.xyz/ethers
83
- *
84
- * Get the rpc provider
76
+ * @default true
85
77
  */
86
- this.getRpcProvider = this.getPublicClient;
78
+ this.isAvailable = true;
87
79
  /**
88
80
  * If the wallet generated by a valid embedded wallet provider
89
81
  * For example: magic wallets
@@ -174,6 +166,25 @@ class WalletConnectorBase extends EventEmitter {
174
166
  getAddress(opts) {
175
167
  return Promise.resolve(undefined);
176
168
  }
169
+ /**
170
+ * Parses a public address to ensure it follows a correct format.
171
+ *
172
+ * For instance, with EVM wallets, this might ensure it follows the EIP 55 format.
173
+ *
174
+ * @default string
175
+ */
176
+ parseAddress(address) {
177
+ return address;
178
+ }
179
+ /**
180
+ * Whether this wallet connector is targeting a testnet.
181
+ * So far only supported for EVM connectors.
182
+ *
183
+ * @default Promise<false>
184
+ */
185
+ isTestnet() {
186
+ return Promise.resolve(false);
187
+ }
177
188
  /**
178
189
  * Gets the additional addresses of the wallet, given the main address
179
190
  *
@@ -195,7 +206,7 @@ class WalletConnectorBase extends EventEmitter {
195
206
  *
196
207
  * @default Promise<undefined>
197
208
  */
198
- getBalance() {
209
+ getBalance(address) {
199
210
  return Promise.resolve(undefined);
200
211
  }
201
212
  /**
@@ -222,7 +233,7 @@ class WalletConnectorBase extends EventEmitter {
222
233
  *
223
234
  * @default Promise<undefined>
224
235
  */
225
- getNameService() {
236
+ getNameService(address) {
226
237
  return Promise.resolve(undefined);
227
238
  }
228
239
  getPublicClient() {
@@ -319,6 +330,41 @@ class WalletConnectorBase extends EventEmitter {
319
330
  setVerifiedCredentials(verifiedCredentials) {
320
331
  return;
321
332
  }
333
+ /**
334
+ * Validates if the address is connected and active in the wallet app
335
+ *
336
+ * @throws {WalletAddressMismatchError} If the active address does not match the expected address.
337
+ * @returns {Promise<void>} A promise that resolves if the active address matches the expected address,
338
+ * otherwise rejects with an error.
339
+ */
340
+ validateActiveWallet(expectedAddress) {
341
+ return __awaiter(this, void 0, void 0, function* () {
342
+ var _a, _b;
343
+ const [activeAddress] = yield this.getConnectedAccounts();
344
+ const isWalletActive = activeAddress === expectedAddress;
345
+ logger.debug(`validateActiveWallet - wallet ${isWalletActive ? 'is' : 'is not'} active`, {
346
+ activeAddress,
347
+ expectedAddress,
348
+ });
349
+ const walletUiUtils = this.constructorProps
350
+ .walletUiUtils;
351
+ if (isWalletActive) {
352
+ return;
353
+ }
354
+ if (!walletUiUtils) {
355
+ throw new WalletAddressMismatchError(`Wallet ${expectedAddress !== null && expectedAddress !== void 0 ? expectedAddress : ''} is not currently active in ${(_a = this.name) !== null && _a !== void 0 ? _a : this.key}.`, {
356
+ activeAddress,
357
+ expectedAddress,
358
+ walletName: (_b = this.name) !== null && _b !== void 0 ? _b : this.key,
359
+ });
360
+ }
361
+ return walletUiUtils.syncWallet({
362
+ activeAddress,
363
+ expectedAddress,
364
+ walletConnector: this,
365
+ });
366
+ });
367
+ }
322
368
  }
323
369
  _WalletConnectorBase_registeredExtensions = new WeakMap();
324
370
 
@@ -13,3 +13,4 @@ export * from './IWalletConnectConnector';
13
13
  export * from './ISendBalanceWalletConnector';
14
14
  export * from './ISessionKeyCompatibleWalletConnector';
15
15
  export * from './ISMSWalletConnector';
16
+ export * from './wallets';
@@ -0,0 +1,159 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var _tslib = require('../../../../_virtual/_tslib.cjs');
7
+ var types = require('@dynamic-labs/types');
8
+ var logger = require('../../../utils/logger.cjs');
9
+ require('@dynamic-labs/utils');
10
+
11
+ var _Wallet_connector;
12
+ class Wallet extends types.BaseWallet {
13
+ constructor(_a) {
14
+ var { connector } = _a, props = _tslib.__rest(_a, ["connector"]);
15
+ super(props);
16
+ _Wallet_connector.set(this, void 0);
17
+ _tslib.__classPrivateFieldSet(this, _Wallet_connector, connector, "f");
18
+ }
19
+ /**
20
+ * Gets the wallet connector.
21
+ */
22
+ get connector() {
23
+ return _tslib.__classPrivateFieldGet(this, _Wallet_connector, "f");
24
+ }
25
+ /**
26
+ * Retrieves the balance of the wallet.
27
+ * @returns A promise that resolves to the balance of the wallet as a string,
28
+ * or undefined if the balance cannot be retrieved.
29
+ */
30
+ getBalance() {
31
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
32
+ return _tslib.__classPrivateFieldGet(this, _Wallet_connector, "f").getBalance(this.address);
33
+ });
34
+ }
35
+ /**
36
+ * Retrieves the name service data associated with the wallet.
37
+ * @returns A promise that resolves to the name service data of the wallet,
38
+ * or undefined if the data cannot be retrieved.
39
+ */
40
+ getNameService() {
41
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
42
+ return _tslib.__classPrivateFieldGet(this, _Wallet_connector, "f").getNameService(this.address);
43
+ });
44
+ }
45
+ /**
46
+ * Retrieves the network that the wallet is connected to.
47
+ * @returns A promise that resolves to the network value as a string or number,
48
+ * or undefined if the network cannot be retrieved.
49
+ */
50
+ getNetwork() {
51
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
52
+ return _tslib.__classPrivateFieldGet(this, _Wallet_connector, "f").getNetwork();
53
+ });
54
+ }
55
+ /**
56
+ * Retrieves the rpc provider for the wallet.
57
+ * @returns A promise that resolves to the provider,
58
+ * or undefined if the provider cannot be retrieved.
59
+ */
60
+ getPublicClient() {
61
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
62
+ return _tslib.__classPrivateFieldGet(this, _Wallet_connector, "f").getPublicClient();
63
+ });
64
+ }
65
+ /**
66
+ * Retrieves the signer for the wallet.
67
+ * @returns A promise that resolves to the signer,
68
+ * or undefined if the signer cannot be retrieved.
69
+ */
70
+ getSigner() {
71
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
72
+ yield this.sync();
73
+ return _tslib.__classPrivateFieldGet(this, _Wallet_connector, "f").getSigner();
74
+ });
75
+ }
76
+ /**
77
+ * Retrieves the wallet client.
78
+ * @param chainId - (optional) Chain id to be used by the wallet client.
79
+ * @returns A promise that resolves to the wallet client,
80
+ * or undefined if the wallet client cannot be retrieved.
81
+ */
82
+ getWalletClient(chainId) {
83
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
84
+ yield this.sync();
85
+ return _tslib.__classPrivateFieldGet(this, _Wallet_connector, "f").getWalletClient(chainId);
86
+ });
87
+ }
88
+ /**
89
+ * If the wallet is availble to use. A wallet is available if its provider is available.
90
+ * @returns True if the wallet is available, false otherwise.
91
+ */
92
+ isAvailable() {
93
+ return _tslib.__classPrivateFieldGet(this, _Wallet_connector, "f").isAvailable;
94
+ }
95
+ /**
96
+ * If the wallet is connected.
97
+ * @returns A promise that resolves to true the wallet is connected or false if it's not connected.
98
+ */
99
+ isConnected() {
100
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
101
+ try {
102
+ const connectedAccounts = yield _tslib.__classPrivateFieldGet(this, _Wallet_connector, "f").getConnectedAccounts();
103
+ return connectedAccounts.includes(this.address);
104
+ }
105
+ catch (error) {
106
+ logger.logger.error('[Wallet] isConnected - Error detecting if wallet is connected', error);
107
+ return false;
108
+ }
109
+ });
110
+ }
111
+ /**
112
+ * Proves ownership of the wallet by signing a message.
113
+ * @param messageToSign - The message to sign.
114
+ * @returns A promise that resolves to the signature of the message as a string,
115
+ * or undefined if the message cannot be signed.
116
+ */
117
+ proveOwnership(messageToSign) {
118
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
119
+ yield this.sync();
120
+ return _tslib.__classPrivateFieldGet(this, _Wallet_connector, "f").proveOwnership(messageToSign);
121
+ });
122
+ }
123
+ /**
124
+ * Signs a message using the wallet.
125
+ * @param messageToSign - The message to sign.
126
+ * @returns A promise that resolves to the signature of the message as a string,
127
+ * or undefined if the message cannot be signed.
128
+ */
129
+ signMessage(messageToSign) {
130
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
131
+ yield this.sync();
132
+ return _tslib.__classPrivateFieldGet(this, _Wallet_connector, "f").signMessage(messageToSign);
133
+ });
134
+ }
135
+ /**
136
+ * Switches the network that the wallet is connected to.
137
+ * @param networkChainId - The chain id of the network to switch to.
138
+ * @returns A promise that resolves when the network is switched.
139
+ */
140
+ switchNetwork(networkChainId) {
141
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
142
+ return _tslib.__classPrivateFieldGet(this, _Wallet_connector, "f").switchNetwork({
143
+ networkChainId,
144
+ });
145
+ });
146
+ }
147
+ /**
148
+ * Synchronizes the wallet with the connector.
149
+ * @returns A promise that resolves when the wallet is connected and active.
150
+ */
151
+ sync() {
152
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
153
+ return _tslib.__classPrivateFieldGet(this, _Wallet_connector, "f").validateActiveWallet(this.address);
154
+ });
155
+ }
156
+ }
157
+ _Wallet_connector = new WeakMap();
158
+
159
+ exports.Wallet = Wallet;
@@ -0,0 +1,87 @@
1
+ import type { BaseWalletProps } from '@dynamic-labs/types';
2
+ import { BaseWallet } from '@dynamic-labs/types';
3
+ import { NameServiceData, WalletConnector } from '../../';
4
+ type WalletProps = BaseWalletProps & {
5
+ connector: WalletConnector;
6
+ };
7
+ export declare class Wallet extends BaseWallet {
8
+ #private;
9
+ constructor({ connector, ...props }: WalletProps);
10
+ /**
11
+ * Gets the wallet connector.
12
+ */
13
+ get connector(): WalletConnector;
14
+ /**
15
+ * Retrieves the balance of the wallet.
16
+ * @returns A promise that resolves to the balance of the wallet as a string,
17
+ * or undefined if the balance cannot be retrieved.
18
+ */
19
+ getBalance(): Promise<string | undefined>;
20
+ /**
21
+ * Retrieves the name service data associated with the wallet.
22
+ * @returns A promise that resolves to the name service data of the wallet,
23
+ * or undefined if the data cannot be retrieved.
24
+ */
25
+ getNameService(): Promise<NameServiceData | undefined>;
26
+ /**
27
+ * Retrieves the network that the wallet is connected to.
28
+ * @returns A promise that resolves to the network value as a string or number,
29
+ * or undefined if the network cannot be retrieved.
30
+ */
31
+ getNetwork(): Promise<string | number | undefined>;
32
+ /**
33
+ * Retrieves the rpc provider for the wallet.
34
+ * @returns A promise that resolves to the provider,
35
+ * or undefined if the provider cannot be retrieved.
36
+ */
37
+ getPublicClient<T>(): Promise<T>;
38
+ /**
39
+ * Retrieves the signer for the wallet.
40
+ * @returns A promise that resolves to the signer,
41
+ * or undefined if the signer cannot be retrieved.
42
+ */
43
+ getSigner<T>(): Promise<T>;
44
+ /**
45
+ * Retrieves the wallet client.
46
+ * @param chainId - (optional) Chain id to be used by the wallet client.
47
+ * @returns A promise that resolves to the wallet client,
48
+ * or undefined if the wallet client cannot be retrieved.
49
+ */
50
+ getWalletClient<T>(chainId?: string): Promise<T>;
51
+ /**
52
+ * If the wallet is availble to use. A wallet is available if its provider is available.
53
+ * @returns True if the wallet is available, false otherwise.
54
+ */
55
+ isAvailable(): boolean;
56
+ /**
57
+ * If the wallet is connected.
58
+ * @returns A promise that resolves to true the wallet is connected or false if it's not connected.
59
+ */
60
+ isConnected(): Promise<boolean>;
61
+ /**
62
+ * Proves ownership of the wallet by signing a message.
63
+ * @param messageToSign - The message to sign.
64
+ * @returns A promise that resolves to the signature of the message as a string,
65
+ * or undefined if the message cannot be signed.
66
+ */
67
+ proveOwnership(messageToSign: string): Promise<string | undefined>;
68
+ /**
69
+ * Signs a message using the wallet.
70
+ * @param messageToSign - The message to sign.
71
+ * @returns A promise that resolves to the signature of the message as a string,
72
+ * or undefined if the message cannot be signed.
73
+ */
74
+ signMessage(messageToSign: string): Promise<string | undefined>;
75
+ /**
76
+ * Switches the network that the wallet is connected to.
77
+ * @param networkChainId - The chain id of the network to switch to.
78
+ * @returns A promise that resolves when the network is switched.
79
+ */
80
+ switchNetwork(networkChainId: number | string): Promise<void>;
81
+ /**
82
+ * Synchronizes the wallet with the connector.
83
+ * @returns A promise that resolves when the wallet is connected and active.
84
+ */
85
+ sync(): Promise<void>;
86
+ }
87
+ export {};
@@ -0,0 +1,155 @@
1
+ 'use client'
2
+ import { __rest, __classPrivateFieldSet, __classPrivateFieldGet, __awaiter } from '../../../../_virtual/_tslib.js';
3
+ import { BaseWallet } from '@dynamic-labs/types';
4
+ import { logger } from '../../../utils/logger.js';
5
+ import '@dynamic-labs/utils';
6
+
7
+ var _Wallet_connector;
8
+ class Wallet extends BaseWallet {
9
+ constructor(_a) {
10
+ var { connector } = _a, props = __rest(_a, ["connector"]);
11
+ super(props);
12
+ _Wallet_connector.set(this, void 0);
13
+ __classPrivateFieldSet(this, _Wallet_connector, connector, "f");
14
+ }
15
+ /**
16
+ * Gets the wallet connector.
17
+ */
18
+ get connector() {
19
+ return __classPrivateFieldGet(this, _Wallet_connector, "f");
20
+ }
21
+ /**
22
+ * Retrieves the balance of the wallet.
23
+ * @returns A promise that resolves to the balance of the wallet as a string,
24
+ * or undefined if the balance cannot be retrieved.
25
+ */
26
+ getBalance() {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ return __classPrivateFieldGet(this, _Wallet_connector, "f").getBalance(this.address);
29
+ });
30
+ }
31
+ /**
32
+ * Retrieves the name service data associated with the wallet.
33
+ * @returns A promise that resolves to the name service data of the wallet,
34
+ * or undefined if the data cannot be retrieved.
35
+ */
36
+ getNameService() {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ return __classPrivateFieldGet(this, _Wallet_connector, "f").getNameService(this.address);
39
+ });
40
+ }
41
+ /**
42
+ * Retrieves the network that the wallet is connected to.
43
+ * @returns A promise that resolves to the network value as a string or number,
44
+ * or undefined if the network cannot be retrieved.
45
+ */
46
+ getNetwork() {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ return __classPrivateFieldGet(this, _Wallet_connector, "f").getNetwork();
49
+ });
50
+ }
51
+ /**
52
+ * Retrieves the rpc provider for the wallet.
53
+ * @returns A promise that resolves to the provider,
54
+ * or undefined if the provider cannot be retrieved.
55
+ */
56
+ getPublicClient() {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ return __classPrivateFieldGet(this, _Wallet_connector, "f").getPublicClient();
59
+ });
60
+ }
61
+ /**
62
+ * Retrieves the signer for the wallet.
63
+ * @returns A promise that resolves to the signer,
64
+ * or undefined if the signer cannot be retrieved.
65
+ */
66
+ getSigner() {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ yield this.sync();
69
+ return __classPrivateFieldGet(this, _Wallet_connector, "f").getSigner();
70
+ });
71
+ }
72
+ /**
73
+ * Retrieves the wallet client.
74
+ * @param chainId - (optional) Chain id to be used by the wallet client.
75
+ * @returns A promise that resolves to the wallet client,
76
+ * or undefined if the wallet client cannot be retrieved.
77
+ */
78
+ getWalletClient(chainId) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ yield this.sync();
81
+ return __classPrivateFieldGet(this, _Wallet_connector, "f").getWalletClient(chainId);
82
+ });
83
+ }
84
+ /**
85
+ * If the wallet is availble to use. A wallet is available if its provider is available.
86
+ * @returns True if the wallet is available, false otherwise.
87
+ */
88
+ isAvailable() {
89
+ return __classPrivateFieldGet(this, _Wallet_connector, "f").isAvailable;
90
+ }
91
+ /**
92
+ * If the wallet is connected.
93
+ * @returns A promise that resolves to true the wallet is connected or false if it's not connected.
94
+ */
95
+ isConnected() {
96
+ return __awaiter(this, void 0, void 0, function* () {
97
+ try {
98
+ const connectedAccounts = yield __classPrivateFieldGet(this, _Wallet_connector, "f").getConnectedAccounts();
99
+ return connectedAccounts.includes(this.address);
100
+ }
101
+ catch (error) {
102
+ logger.error('[Wallet] isConnected - Error detecting if wallet is connected', error);
103
+ return false;
104
+ }
105
+ });
106
+ }
107
+ /**
108
+ * Proves ownership of the wallet by signing a message.
109
+ * @param messageToSign - The message to sign.
110
+ * @returns A promise that resolves to the signature of the message as a string,
111
+ * or undefined if the message cannot be signed.
112
+ */
113
+ proveOwnership(messageToSign) {
114
+ return __awaiter(this, void 0, void 0, function* () {
115
+ yield this.sync();
116
+ return __classPrivateFieldGet(this, _Wallet_connector, "f").proveOwnership(messageToSign);
117
+ });
118
+ }
119
+ /**
120
+ * Signs a message using the wallet.
121
+ * @param messageToSign - The message to sign.
122
+ * @returns A promise that resolves to the signature of the message as a string,
123
+ * or undefined if the message cannot be signed.
124
+ */
125
+ signMessage(messageToSign) {
126
+ return __awaiter(this, void 0, void 0, function* () {
127
+ yield this.sync();
128
+ return __classPrivateFieldGet(this, _Wallet_connector, "f").signMessage(messageToSign);
129
+ });
130
+ }
131
+ /**
132
+ * Switches the network that the wallet is connected to.
133
+ * @param networkChainId - The chain id of the network to switch to.
134
+ * @returns A promise that resolves when the network is switched.
135
+ */
136
+ switchNetwork(networkChainId) {
137
+ return __awaiter(this, void 0, void 0, function* () {
138
+ return __classPrivateFieldGet(this, _Wallet_connector, "f").switchNetwork({
139
+ networkChainId,
140
+ });
141
+ });
142
+ }
143
+ /**
144
+ * Synchronizes the wallet with the connector.
145
+ * @returns A promise that resolves when the wallet is connected and active.
146
+ */
147
+ sync() {
148
+ return __awaiter(this, void 0, void 0, function* () {
149
+ return __classPrivateFieldGet(this, _Wallet_connector, "f").validateActiveWallet(this.address);
150
+ });
151
+ }
152
+ }
153
+ _Wallet_connector = new WeakMap();
154
+
155
+ export { Wallet };
@@ -0,0 +1 @@
1
+ export * from './Wallet';
@@ -0,0 +1 @@
1
+ export * from './Wallet';