@dynamic-labs/solana 0.18.0-RC.2 → 0.18.0-RC.21

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,299 @@
1
1
 
2
+ ## [0.18.0-RC.21](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.20...v0.18.0-RC.21) (2023-07-28)
3
+
4
+ ## [0.18.0-RC.20](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.19...v0.18.0-RC.20) (2023-07-27)
5
+
6
+
7
+ ### Features
8
+
9
+ * **QNTM-56:** add onBeforeConnectSuccessConfirmation callback ([#2753](https://github.com/dynamic-labs/DynamicAuth/issues/2753)) ([b174396](https://github.com/dynamic-labs/DynamicAuth/commit/b174396ab341cbcf11c6940e54931c0db3954d0d))
10
+ * **QNTM-72:** add backpack wallet ([#2702](https://github.com/dynamic-labs/DynamicAuth/issues/2702)) ([0d0ce9c](https://github.com/dynamic-labs/DynamicAuth/commit/0d0ce9c0d92118a78b5e40f64c5530246523712a))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * bump sdk version and change sdksettings api ([#2760](https://github.com/dynamic-labs/DynamicAuth/issues/2760)) ([6e3e205](https://github.com/dynamic-labs/DynamicAuth/commit/6e3e2050ed63d2df2d88d9169bc89d5f17870847))
16
+ * check funding enabled based on enabled onramp providers instead of onrampFunding settings ([#2662](https://github.com/dynamic-labs/DynamicAuth/issues/2662)) ([d542a9b](https://github.com/dynamic-labs/DynamicAuth/commit/d542a9b2950640e473afe378c857f4d2dd1926ff))
17
+ * ensure metamask auto-redirect upon message signing ([#2757](https://github.com/dynamic-labs/DynamicAuth/issues/2757)) ([a590f4b](https://github.com/dynamic-labs/DynamicAuth/commit/a590f4b054cd1de7ad400763d769b0daf4fcaad2))
18
+ * **QNTM-123:** use `linkedWallets` after signing the first message ([#2741](https://github.com/dynamic-labs/DynamicAuth/issues/2741)) ([7f26151](https://github.com/dynamic-labs/DynamicAuth/commit/7f26151db69b50102fd4b09ec470c8f19ce7b68f))
19
+
20
+ ## [0.18.0-RC.19](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.18...v0.18.0-RC.19) (2023-07-25)
21
+
22
+
23
+ ### ⚠ BREAKING CHANGES
24
+
25
+ * it updates the variable name isUserConnected to isFullyConnected
26
+ to better reflect its purpose in the codebase. user should be reserved for fully authenticated entities
27
+
28
+ ### Features
29
+
30
+ * Update WalletConnect wallet registry ([#2744](https://github.com/dynamic-labs/DynamicAuth/issues/2744)) ([46285ad](https://github.com/dynamic-labs/DynamicAuth/commit/46285adc77d12cdfe43d0ce1296308f4905fbfb5))
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * missing field handling on email verification ([#2740](https://github.com/dynamic-labs/DynamicAuth/issues/2740)) ([3a42804](https://github.com/dynamic-labs/DynamicAuth/commit/3a428049a1f56a263135d636a335e597b3195b51))
36
+
37
+
38
+ * rename isUserConnected to isFullyConnected ([#2739](https://github.com/dynamic-labs/DynamicAuth/issues/2739)) ([951780b](https://github.com/dynamic-labs/DynamicAuth/commit/951780be79acdc5191ffb8a6a525a2701832a2ad))
39
+
40
+ ## [0.18.0-RC.18](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.17...v0.18.0-RC.18) (2023-07-24)
41
+
42
+ ### Bug Fixes
43
+
44
+ * do not call connectSuccess when already connected ([#2705](https://github.com/dynamic-labs/DynamicAuth/issues/2705)) ([12a65fb](https://github.com/dynamic-labs/DynamicAuth/commit/12a65fb5e59a38de0f5fb0e7eab3ce3d558f201f))
45
+ * do not proceed to authSuccess if there are still missing fields ([#2712](https://github.com/dynamic-labs/DynamicAuth/issues/2712)) ([2fb10ed](https://github.com/dynamic-labs/DynamicAuth/commit/2fb10ed7f9c28476d61856887b517bdae10b80f4))
46
+ * add legacy safari detection ([#2733](https://github.com/dynamic-labs/DynamicAuth/issues/2733)) ([1b21c57](https://github.com/dynamic-labs/DynamicAuth/commit/1b21c57c1fd7c458f499cc09ef60364c314b0464))
47
+
48
+ ## [0.18.0-RC.17](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.16...v0.18.0-RC.17) (2023-07-24)
49
+
50
+
51
+ ### Features
52
+
53
+ * add ongoingVerifications object disclaiming which verifications are in progress ([#2633](https://github.com/dynamic-labs/DynamicAuth/issues/2633)) ([948c778](https://github.com/dynamic-labs/DynamicAuth/commit/948c778e5955fcf80e31ac7f368e7605cd7eb7d5))
54
+ * add rabby wallet support ([#2590](https://github.com/dynamic-labs/DynamicAuth/issues/2590)) ([d70c49d](https://github.com/dynamic-labs/DynamicAuth/commit/d70c49d0b348ced3ee5691fdfc19b3eef5ba79db))
55
+ * **DYN-2399:** send dynamicContext props from sdk to api ([#2659](https://github.com/dynamic-labs/DynamicAuth/issues/2659)) ([f06787b](https://github.com/dynamic-labs/DynamicAuth/commit/f06787bf6ec1dc69c53ee6287fd3721d47901ad1))
56
+ * introduce MenuList and Dropdown components to unify previously redundant implementations ([#2675](https://github.com/dynamic-labs/DynamicAuth/issues/2675)) ([dfc63a5](https://github.com/dynamic-labs/DynamicAuth/commit/dfc63a5fef2c00cf0187e7a481dc3267d44f6cc3))
57
+ * **QNTM-101:** add loading state to button ([#2691](https://github.com/dynamic-labs/DynamicAuth/issues/2691)) ([5a7b539](https://github.com/dynamic-labs/DynamicAuth/commit/5a7b5392c4b17cc26ecc621d11afdf37f2f10c65))
58
+ * update blocto version to v2 ([#2651](https://github.com/dynamic-labs/DynamicAuth/issues/2651)) ([441f85e](https://github.com/dynamic-labs/DynamicAuth/commit/441f85efa3921a57b9b282631016162902c8aabb))
59
+ * verify connected wallets network at runtime ([#2667](https://github.com/dynamic-labs/DynamicAuth/issues/2667)) ([8fa8dcc](https://github.com/dynamic-labs/DynamicAuth/commit/8fa8dccdfcb56d9d76d0cd00a153a95e5d52b4dc))
60
+
61
+
62
+ ### Bug Fixes
63
+
64
+ * correctly round balance numbers on widget ([#2625](https://github.com/dynamic-labs/DynamicAuth/issues/2625)) ([7b45483](https://github.com/dynamic-labs/DynamicAuth/commit/7b45483e7bdb458434b7787f9df930ba9acbc8e0))
65
+ * decrease NetworkNotSupported useEffects calls to avoid race condition ([#2731](https://github.com/dynamic-labs/DynamicAuth/issues/2731)) ([6a7baf1](https://github.com/dynamic-labs/DynamicAuth/commit/6a7baf1c63e82b27d03540d670603fe11685348a))
66
+ * **GVTY-58:** do not allow users to submit empty whitespace strings in onboarding form ([#2720](https://github.com/dynamic-labs/DynamicAuth/issues/2720)) ([916f27a](https://github.com/dynamic-labs/DynamicAuth/commit/916f27a5c880281245c71af3f16217cda5317c26))
67
+ * playwright tests were failing due to new cookies popup that overlapped sdk modal ([#2709](https://github.com/dynamic-labs/DynamicAuth/issues/2709)) ([9254777](https://github.com/dynamic-labs/DynamicAuth/commit/92547773047687fcc50ad6b895b1b59176d42af7))
68
+ * **QNTM-111:** call onConnectSuccess with correct wallet connector in… ([#2724](https://github.com/dynamic-labs/DynamicAuth/issues/2724)) ([159e78c](https://github.com/dynamic-labs/DynamicAuth/commit/159e78ce458762f0e2ccbaf2acbc81efde35830a))
69
+ * **QNTM-98:** improve connectedWallets state management and connected wallets events listeners ([#2696](https://github.com/dynamic-labs/DynamicAuth/issues/2696)) ([3a91a37](https://github.com/dynamic-labs/DynamicAuth/commit/3a91a371423f50d28640141d0ca6a643a8dcf25a))
70
+ * update broken safe icon ([#2713](https://github.com/dynamic-labs/DynamicAuth/issues/2713)) ([42943b4](https://github.com/dynamic-labs/DynamicAuth/commit/42943b4684c165ec103fbed0e69e691bee4d305f))
71
+
72
+ ## [0.18.0-RC.16](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.15...v0.18.0-RC.16) (2023-07-18)
73
+
74
+
75
+ ### Features
76
+
77
+ * **QNTM-30:** add spinner to log out button ([#2663](https://github.com/dynamic-labs/DynamicAuth/issues/2663)) ([fceafbb](https://github.com/dynamic-labs/DynamicAuth/commit/fceafbb6fecf323df39ac3a8f518ba8005d4b550))
78
+
79
+
80
+ ### Bug Fixes
81
+
82
+ * handle edge cases for missing projectSettings for PoweredByDynamic ([#2684](https://github.com/dynamic-labs/DynamicAuth/issues/2684)) ([6f5b3d8](https://github.com/dynamic-labs/DynamicAuth/commit/6f5b3d8d1b1d4aed0dd2e73e5423f6e50347ff3d))
83
+ * typo in blocked view ([#2673](https://github.com/dynamic-labs/DynamicAuth/issues/2673)) ([034bdaf](https://github.com/dynamic-labs/DynamicAuth/commit/034bdafb44b767600ea7c0148f39dd026280e3b8))
84
+
85
+ ## [0.18.0-RC.15](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.14...v0.18.0-RC.15) (2023-07-18)
86
+
87
+
88
+ ### Features
89
+
90
+ * add `updateConnectedWalletById` function, add `network` property to connectedWallets ([#2666](https://github.com/dynamic-labs/DynamicAuth/issues/2666)) ([3c50abf](https://github.com/dynamic-labs/DynamicAuth/commit/3c50abf964a2807c6e1af9fceeb1ca259785a21f))
91
+ * add magic to ethereum-all package ([#2576](https://github.com/dynamic-labs/DynamicAuth/issues/2576)) ([7676ef2](https://github.com/dynamic-labs/DynamicAuth/commit/7676ef2883b30adf2c1b521d7c1848248ceadb24))
92
+ * allow switching between multiwallet and single wallet on demo ([#2596](https://github.com/dynamic-labs/DynamicAuth/issues/2596)) ([dae87c1](https://github.com/dynamic-labs/DynamicAuth/commit/dae87c12d2f1be64c2ca1f232ffdf2da998b1c1e))
93
+ * clear values from LS that cannot be parsed ([#2542](https://github.com/dynamic-labs/DynamicAuth/issues/2542)) ([41faf5d](https://github.com/dynamic-labs/DynamicAuth/commit/41faf5dbc07937685b4d89f87ae040021c5fee00))
94
+ * **QNTM-82:** should not go back to "get started" view if one wallet already connected ([#2653](https://github.com/dynamic-labs/DynamicAuth/issues/2653)) ([004db41](https://github.com/dynamic-labs/DynamicAuth/commit/004db410eb11af9ba105058df4958f20633a3002))
95
+
96
+
97
+ ### Bug Fixes
98
+
99
+ * **bridge:** update the wallets to connect when unlinking ([#2604](https://github.com/dynamic-labs/DynamicAuth/issues/2604)) ([4739306](https://github.com/dynamic-labs/DynamicAuth/commit/4739306c2d742e961281747427821af7c36b6cc2))
100
+ * network picker is broken in network switch view ([#2612](https://github.com/dynamic-labs/DynamicAuth/issues/2612)) ([c514ba4](https://github.com/dynamic-labs/DynamicAuth/commit/c514ba4f931c243bdd60329db7ed1691fc36819c))
101
+ * search not found icon in wrong color in dark mode ([#2656](https://github.com/dynamic-labs/DynamicAuth/issues/2656)) ([a4db736](https://github.com/dynamic-labs/DynamicAuth/commit/a4db736b8659567330dd857792cc12b17ce9d851))
102
+ * use dynamicauth.com for api requests ([#2649](https://github.com/dynamic-labs/DynamicAuth/issues/2649)) ([acae0af](https://github.com/dynamic-labs/DynamicAuth/commit/acae0afc2a18c41fa61b2c487ff1ceb46c5d9a1f))
103
+ * wallet should be disconnected when NetworkNotSupported view is ignored in connect-only mode ([#2658](https://github.com/dynamic-labs/DynamicAuth/issues/2658)) ([f3565cf](https://github.com/dynamic-labs/DynamicAuth/commit/f3565cf09a1ddcc671b596bbe23c68d35afc81b5))
104
+
105
+ ## [0.18.0-RC.14](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.13...v0.18.0-RC.14) (2023-07-11)
106
+
107
+
108
+ ### ⚠ BREAKING CHANGES
109
+
110
+ * **QNTM-68:** we currently expose concatenated primary and secondary
111
+ wallets array as connectedWallets, this is wrong and may cause issues with
112
+ understanding our architecture as well as issues for customers that want
113
+ to have access to connectedWallets array.
114
+
115
+ * chore(QNTM-68): expose connectedWallets from DynamicContext
116
+
117
+ since, we renamed connectedWallets to linkedWallets, we now want to expose correct value
118
+ for connectedWallets.
119
+
120
+ * chore(QNTM-68)!: remove connectedWalletsInfo from useDynamicContext
121
+ * **QNTM-68:** since we're exposing connectedWallets and this variable
122
+ has less information there is no need in exposing it from DynamicContext
123
+
124
+ * **QNTM-68:** update connectedWallets property and expose linkedWallets ([#2644](https://github.com/dynamic-labs/DynamicAuth/issues/2644)) ([8b707c3](https://github.com/dynamic-labs/DynamicAuth/commit/8b707c3fb2e14aa25385b35768ffa355ef7117e5))
125
+
126
+ ## [0.18.0-RC.13](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.12...v0.18.0-RC.13) (2023-07-11)
127
+
128
+
129
+ ### Features
130
+
131
+ * **DynamicContextProvider:** expose socialProviderFilter to modify social provider display order ([#2607](https://github.com/dynamic-labs/DynamicAuth/issues/2607)) ([0f03260](https://github.com/dynamic-labs/DynamicAuth/commit/0f03260e739da3e68c32a2a87a2ca629bb1f28b5))
132
+ * **GVTY-21:** Blocto Email provider ([#2524](https://github.com/dynamic-labs/DynamicAuth/issues/2524)) ([434ce59](https://github.com/dynamic-labs/DynamicAuth/commit/434ce598b3bc13841121b61e5ead7547d3c44eea))
133
+ * listen for the network change in network not supported views ([#2611](https://github.com/dynamic-labs/DynamicAuth/issues/2611)) ([957fbce](https://github.com/dynamic-labs/DynamicAuth/commit/957fbce55d7906f9d6b109838035b2c0306a4b85))
134
+
135
+
136
+ ### Bug Fixes
137
+
138
+ * Clean up provider re-initializing after logout ([#2632](https://github.com/dynamic-labs/DynamicAuth/issues/2632)) ([fbc2201](https://github.com/dynamic-labs/DynamicAuth/commit/fbc22013d6784061cb4fdd72e24695c89f0e2fe5))
139
+ * **MagicWalletConnector:** check if user is logged when getting balance ([#2614](https://github.com/dynamic-labs/DynamicAuth/issues/2614)) ([ced9d66](https://github.com/dynamic-labs/DynamicAuth/commit/ced9d66cb335c3033a18642bdd841ee6be6c1e05))
140
+ * **useValidateSessin:** only check for bridge on wallet connect wallets ([#2571](https://github.com/dynamic-labs/DynamicAuth/issues/2571)) ([349b659](https://github.com/dynamic-labs/DynamicAuth/commit/349b65963f1d5392f63aaa138f6498f0d17cd43f))
141
+
142
+ ## [0.18.0-RC.12](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.11...v0.18.0-RC.12) (2023-07-07)
143
+
144
+
145
+ ### Features
146
+
147
+ * add event listeners to connect-only ([#2578](https://github.com/dynamic-labs/DynamicAuth/issues/2578)) ([42fcf09](https://github.com/dynamic-labs/DynamicAuth/commit/42fcf096ac439ec883a79bf5811b27cdc360015a))
148
+ * add message when search finds no wallet ([#2421](https://github.com/dynamic-labs/DynamicAuth/issues/2421)) ([694ecee](https://github.com/dynamic-labs/DynamicAuth/commit/694ecee94d9f6f636364eae4aa95ea48e3ff0e0a))
149
+ * allow adding either ToS or PP and enable customization for both ([#2451](https://github.com/dynamic-labs/DynamicAuth/issues/2451)) ([0dce0fe](https://github.com/dynamic-labs/DynamicAuth/commit/0dce0fe534056298cbfdd9caa694231ede00c3fc))
150
+
151
+
152
+ ### Bug Fixes
153
+
154
+ * **BridgeSummaryView:** handle primary wallet when it is not defined ([#2602](https://github.com/dynamic-labs/DynamicAuth/issues/2602)) ([8a5daa4](https://github.com/dynamic-labs/DynamicAuth/commit/8a5daa4b2ad218460ccfaab0fa68c75d0d5d569f))
155
+ * secondary wallets network change overrides primary wallet network ([#2603](https://github.com/dynamic-labs/DynamicAuth/issues/2603)) ([358fc45](https://github.com/dynamic-labs/DynamicAuth/commit/358fc45ecb73f31294744f7ba4dbba5779a3e1cf))
156
+
157
+ ## [0.18.0-RC.11](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.10...v0.18.0-RC.11) (2023-07-07)
158
+
159
+
160
+ ### Features
161
+
162
+ * **DYN-2384:** expose useDynamicScopes hook ([#2179](https://github.com/dynamic-labs/DynamicAuth/issues/2179)) ([c224749](https://github.com/dynamic-labs/DynamicAuth/commit/c2247493d9c99dab7e41d7d8d156ae7e478973bc))
163
+ * **DynamicBridgeWidget:** add UI inline widget to match designs ([#2587](https://github.com/dynamic-labs/DynamicAuth/issues/2587)) ([d623aec](https://github.com/dynamic-labs/DynamicAuth/commit/d623aecda6388b67e40a3f8dabb03ca03a6f22b6))
164
+ * support starknet networks ([#2579](https://github.com/dynamic-labs/DynamicAuth/issues/2579)) ([a01545e](https://github.com/dynamic-labs/DynamicAuth/commit/a01545e0cf8e4e19a22dc64877d590d78647c579))
165
+
166
+
167
+ ### Bug Fixes
168
+
169
+ * metamask getConnectedAccounts triggering an infinite loop ([#2580](https://github.com/dynamic-labs/DynamicAuth/issues/2580)) ([e025cea](https://github.com/dynamic-labs/DynamicAuth/commit/e025cea33e4a95ea2a03ac11e47a88a73db39848))
170
+
171
+ ## [0.18.0-RC.10](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.9...v0.18.0-RC.10) (2023-07-06)
172
+
173
+
174
+ ### Features
175
+
176
+ * Update handleUnlink to support connected only wallets ([#2573](https://github.com/dynamic-labs/DynamicAuth/issues/2573)) ([07438c9](https://github.com/dynamic-labs/DynamicAuth/commit/07438c9580b830aa68fcc6a06ea4050a3743a501))
177
+
178
+
179
+ ### Bug Fixes
180
+
181
+ * restore connectedWallet clearing function ([#2575](https://github.com/dynamic-labs/DynamicAuth/issues/2575)) ([8d3c41a](https://github.com/dynamic-labs/DynamicAuth/commit/8d3c41a6871037b1003270e724259f23c5f6f370))
182
+
183
+ ## [0.18.0-RC.9](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.8...v0.18.0-RC.9) (2023-07-04)
184
+
185
+
186
+ ### Features
187
+
188
+ * add Network Not Supported prompt to connect-only & show prompt before sign in connect-sign mode ([#2474](https://github.com/dynamic-labs/DynamicAuth/issues/2474)) ([8d5bfa9](https://github.com/dynamic-labs/DynamicAuth/commit/8d5bfa97ca4da50e06ce258a38a63e7407a795f6))
189
+ * **DYN-2602:** add ability to unlink connected wallet ([#2494](https://github.com/dynamic-labs/DynamicAuth/issues/2494)) ([389861b](https://github.com/dynamic-labs/DynamicAuth/commit/389861bc0281baec379b1593e529cef3467f3326))
190
+ * **DYN-2604:** add chainId property to walletsByChain object ([#2405](https://github.com/dynamic-labs/DynamicAuth/issues/2405)) ([d9b42f7](https://github.com/dynamic-labs/DynamicAuth/commit/d9b42f7b1d53dac1ed0228ecb5e56a44c6abd8d2))
191
+ * **DynamicAuthLayout:** show connected wallet progress ([#2567](https://github.com/dynamic-labs/DynamicAuth/issues/2567)) ([a20ff6f](https://github.com/dynamic-labs/DynamicAuth/commit/a20ff6f32b360ccc699d2a271c7a96751ae87d29))
192
+ * **DynamicBridgeFlow:** add bridge flow ([#2543](https://github.com/dynamic-labs/DynamicAuth/issues/2543)) ([79c4c87](https://github.com/dynamic-labs/DynamicAuth/commit/79c4c870d47a0c853c292a8d913bd9be9e209a15))
193
+
194
+
195
+ ### Bug Fixes
196
+
197
+ * don't force required chain to eth in case is not enabled ([#2537](https://github.com/dynamic-labs/DynamicAuth/issues/2537)) ([b01d6c9](https://github.com/dynamic-labs/DynamicAuth/commit/b01d6c9e91e9971e82739c5a2c900de4768f977c))
198
+ * log out if there's any session sync issue ([#2545](https://github.com/dynamic-labs/DynamicAuth/issues/2545)) ([29972fa](https://github.com/dynamic-labs/DynamicAuth/commit/29972fad1067f5550a61f6e2cd9adcaf811fd268))
199
+ * persist chain to WalletConnect session when changed in wallet ([#2556](https://github.com/dynamic-labs/DynamicAuth/issues/2556)) ([fc9ec35](https://github.com/dynamic-labs/DynamicAuth/commit/fc9ec3501de1e3235adee4df95b296dc22cce23e))
200
+ * WC2 sign-message on non-selected chain ([#2544](https://github.com/dynamic-labs/DynamicAuth/issues/2544)) ([48a4384](https://github.com/dynamic-labs/DynamicAuth/commit/48a4384f77c29775e0c28ed335956cfbd6f89ca3))
201
+ * **wcv2:** add eth_signTypedData_v4 to optional methods ([#2527](https://github.com/dynamic-labs/DynamicAuth/issues/2527)) ([b99474b](https://github.com/dynamic-labs/DynamicAuth/commit/b99474b81b083134762be0fe9554a6f049b3edda))
202
+ * **wcv2:** allow getWeb3Provider to wait to provider init ([#2523](https://github.com/dynamic-labs/DynamicAuth/issues/2523)) ([d9c7fee](https://github.com/dynamic-labs/DynamicAuth/commit/d9c7fee10d2a6c766043515e19829fd7e3d5b2ef))
203
+
204
+ ## [0.18.0-RC.8](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.7...v0.18.0-RC.8) (2023-06-29)
205
+
206
+
207
+ ### Features
208
+
209
+ * add support for custom walletconnect v1 bridge ([#2487](https://github.com/dynamic-labs/DynamicAuth/issues/2487)) ([5b0ca2e](https://github.com/dynamic-labs/DynamicAuth/commit/5b0ca2e4e8aa241ed13e4f38346c31da8479a6c4))
210
+ * **DYN-2623:** improve error message on sign cancellation for wallets ([#2493](https://github.com/dynamic-labs/DynamicAuth/issues/2493)) ([081c515](https://github.com/dynamic-labs/DynamicAuth/commit/081c515c9d28d6fa4c0eaac388ee421a7b23144b))
211
+
212
+
213
+ ### Bug Fixes
214
+
215
+ * clearing the activeAccount value ([#2469](https://github.com/dynamic-labs/DynamicAuth/issues/2469)) ([ff75bde](https://github.com/dynamic-labs/DynamicAuth/commit/ff75bde938a4178541568b79754f773607b9d87f))
216
+ * don't initialize provider if it's already initialized ([#2490](https://github.com/dynamic-labs/DynamicAuth/issues/2490)) ([878d38f](https://github.com/dynamic-labs/DynamicAuth/commit/878d38f5c8d7d7448c65e58b25cefd9f3518217e))
217
+ * more wcv2 improvements ([#2475](https://github.com/dynamic-labs/DynamicAuth/issues/2475)) ([13baa84](https://github.com/dynamic-labs/DynamicAuth/commit/13baa84218d6259d02df7d8c387b40dc3cb11ce5)), closes [#2469](https://github.com/dynamic-labs/DynamicAuth/issues/2469) [#2470](https://github.com/dynamic-labs/DynamicAuth/issues/2470) [#2471](https://github.com/dynamic-labs/DynamicAuth/issues/2471) [#2477](https://github.com/dynamic-labs/DynamicAuth/issues/2477) [#2479](https://github.com/dynamic-labs/DynamicAuth/issues/2479) [#2471](https://github.com/dynamic-labs/DynamicAuth/issues/2471) [#2476](https://github.com/dynamic-labs/DynamicAuth/issues/2476)
218
+ * multiple improvements for WC2 ([#2458](https://github.com/dynamic-labs/DynamicAuth/issues/2458)) ([0813af2](https://github.com/dynamic-labs/DynamicAuth/commit/0813af2aafa8019868117084efe8ae147ac24581))
219
+ * revert changes since latest wcv2 improvements ([#2473](https://github.com/dynamic-labs/DynamicAuth/issues/2473)) ([3375371](https://github.com/dynamic-labs/DynamicAuth/commit/337537101a13d67b860748b62f172eba01d0b461)), closes [#2471](https://github.com/dynamic-labs/DynamicAuth/issues/2471) [#2470](https://github.com/dynamic-labs/DynamicAuth/issues/2470) [#2469](https://github.com/dynamic-labs/DynamicAuth/issues/2469)
220
+ * sync issue within connect-only mode ([#2496](https://github.com/dynamic-labs/DynamicAuth/issues/2496)) ([44af274](https://github.com/dynamic-labs/DynamicAuth/commit/44af274618c30fe65ec95739cd16a8ddde08e34e))
221
+ * typo in terms of service ([#2401](https://github.com/dynamic-labs/DynamicAuth/issues/2401)) ([5b195e5](https://github.com/dynamic-labs/DynamicAuth/commit/5b195e54479d9a88bd017fc45f2f2455d1caedc4))
222
+ * **wc_v1_bridget:** disable WC v2 when WC v1 bridge is set ([#2505](https://github.com/dynamic-labs/DynamicAuth/issues/2505)) ([b3f0a68](https://github.com/dynamic-labs/DynamicAuth/commit/b3f0a6895095bb37c635984fc970b52446e04f56))
223
+ * wc2 android improvements ([#2488](https://github.com/dynamic-labs/DynamicAuth/issues/2488)) ([f60ef9c](https://github.com/dynamic-labs/DynamicAuth/commit/f60ef9c1dd672f78199eee40edbe2707c043e1b5))
224
+ * **wcv2:** make sure to clear active account when ending session ([#2471](https://github.com/dynamic-labs/DynamicAuth/issues/2471)) ([b766df3](https://github.com/dynamic-labs/DynamicAuth/commit/b766df39a7e4dabc54fda9131b7bd9b53895cf2f))
225
+ * **wcv2:** use native or universal link when signing message ([#2502](https://github.com/dynamic-labs/DynamicAuth/issues/2502)) ([6e3e3fb](https://github.com/dynamic-labs/DynamicAuth/commit/6e3e3fbb58fb9e3eb314e6631ac2123237f41e8c))
226
+
227
+ ## [0.18.0-RC.7](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.6...v0.18.0-RC.7) (2023-06-23)
228
+
229
+
230
+ ### Features
231
+
232
+ * add bridge connect button ([#2399](https://github.com/dynamic-labs/DynamicAuth/issues/2399)) ([6987eea](https://github.com/dynamic-labs/DynamicAuth/commit/6987eeae8f49a5d077de6c4343b83ecbb1fc8b89))
233
+ * add useTimeout, useInterval and useIsomorphicLayoutEffect hooks ([#2418](https://github.com/dynamic-labs/DynamicAuth/issues/2418)) ([3ed8595](https://github.com/dynamic-labs/DynamicAuth/commit/3ed859526a6ec982b61a4335a9a63512d0e631e3))
234
+ * **DYN-2411:** WalletLockedView when user has valid jwt and all of their wallets are disconnected ([#2273](https://github.com/dynamic-labs/DynamicAuth/issues/2273)) ([2e6d0d6](https://github.com/dynamic-labs/DynamicAuth/commit/2e6d0d6ed734eb628bd05b6ad64560c496ad915f))
235
+ * **DYN-2598:** add powered by, update copy and paddings in the select wallet chain layout ([#2391](https://github.com/dynamic-labs/DynamicAuth/issues/2391)) ([f2a7924](https://github.com/dynamic-labs/DynamicAuth/commit/f2a79241dcf1ea5720242c2cc65a6fcd077ea0e9))
236
+ * **solana:** add logic to get network based on genesis hash ([#2402](https://github.com/dynamic-labs/DynamicAuth/issues/2402)) ([b76c626](https://github.com/dynamic-labs/DynamicAuth/commit/b76c62660bae334aef84678db5d8349a3d575630))
237
+
238
+
239
+ ### Bug Fixes
240
+
241
+ * better handling of the CB wallet provider ([#2376](https://github.com/dynamic-labs/DynamicAuth/issues/2376)) ([720e510](https://github.com/dynamic-labs/DynamicAuth/commit/720e510d0793c530d06db5eaa1d5a7be608703bb))
242
+ * clear AUTH_USER when there is no AUTH_TOKEN on LS ([#2423](https://github.com/dynamic-labs/DynamicAuth/issues/2423)) ([bf1e1c0](https://github.com/dynamic-labs/DynamicAuth/commit/bf1e1c0f8a7a7a852c67ef363613deecacdad92e))
243
+ * set auth mode to connect-and-sign when verifiying wallet ([#2369](https://github.com/dynamic-labs/DynamicAuth/issues/2369)) ([666aa69](https://github.com/dynamic-labs/DynamicAuth/commit/666aa6954d19551a354af933a69ab8eeee7a98b5))
244
+ * use getAuthTokenValue in initExpirationTime ([#2422](https://github.com/dynamic-labs/DynamicAuth/issues/2422)) ([fa8ff78](https://github.com/dynamic-labs/DynamicAuth/commit/fa8ff78d64421ca4447794fe9af53c175adf94c3))
245
+
246
+ ## [0.18.0-RC.6](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.5...v0.18.0-RC.6) (2023-06-20)
247
+
248
+
249
+ ### Features
250
+
251
+ * add export keys option for magic wallets ([#2377](https://github.com/dynamic-labs/DynamicAuth/issues/2377)) ([6b40f53](https://github.com/dynamic-labs/DynamicAuth/commit/6b40f538f207691b54fe2f245ed6018c467b83fe))
252
+
253
+
254
+ ### Bug Fixes
255
+
256
+ * add polyfill for css layers ([#2386](https://github.com/dynamic-labs/DynamicAuth/issues/2386)) ([3d489f5](https://github.com/dynamic-labs/DynamicAuth/commit/3d489f59d676864134a94d031697e0f83fc0d742))
257
+
258
+ ## [0.18.0-RC.5](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.4...v0.18.0-RC.5) (2023-06-20)
259
+
260
+
261
+ ### Bug Fixes
262
+
263
+ * remove process variable declaration ([#2389](https://github.com/dynamic-labs/DynamicAuth/issues/2389)) ([3c05121](https://github.com/dynamic-labs/DynamicAuth/commit/3c05121473850444f2c8393fa6e98e10d58870bc))
264
+ * wallet book singleton class to initalize when walletBook is undefined ([#2392](https://github.com/dynamic-labs/DynamicAuth/issues/2392)) ([7e07137](https://github.com/dynamic-labs/DynamicAuth/commit/7e0713712321439ee48e0c9ec88fef8c9aecd9cf))
265
+
266
+ ## [0.18.0-RC.4](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.3...v0.18.0-RC.4) (2023-06-20)
267
+
268
+
269
+ ### ⚠ BREAKING CHANGES
270
+
271
+ * **DYN-1260:** integrate wallets group view with group logic (#2305)
272
+
273
+ ### Features
274
+
275
+ * **DYN-1260:** integrate wallets group view with group logic ([#2305](https://github.com/dynamic-labs/DynamicAuth/issues/2305)) ([d5adb41](https://github.com/dynamic-labs/DynamicAuth/commit/d5adb411f263d1583abe5102e60d02573c6bf416))
276
+
277
+
278
+ ### Bug Fixes
279
+
280
+ * **DYN-2507:** too long network name shrinks users avatar ([#2383](https://github.com/dynamic-labs/DynamicAuth/issues/2383)) ([8586c3b](https://github.com/dynamic-labs/DynamicAuth/commit/8586c3be5a499118b7229eb7a3702d3350642107))
281
+ * hide wallet menu items that are not needed ([#2375](https://github.com/dynamic-labs/DynamicAuth/issues/2375)) ([35a6723](https://github.com/dynamic-labs/DynamicAuth/commit/35a67234da47f1a992a94c17e445b1fcba1c700f))
282
+ * use overflow auto to avoid showing the disabled scrollbar on gecko browser ([#2382](https://github.com/dynamic-labs/DynamicAuth/issues/2382)) ([16a7db4](https://github.com/dynamic-labs/DynamicAuth/commit/16a7db49e5b154bc6a4ea263c8a8c8a92cf1d810))
283
+ * use primary color for wallet group item copy ([#2384](https://github.com/dynamic-labs/DynamicAuth/issues/2384)) ([3fe439e](https://github.com/dynamic-labs/DynamicAuth/commit/3fe439ea2a271bc4b24b145db3f70774e221723e))
284
+
285
+ ## [0.18.0-RC.3](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.2...v0.18.0-RC.3) (2023-06-16)
286
+
287
+
288
+ ### Features
289
+
290
+ * add skeleton to walletlistfooter ([#2361](https://github.com/dynamic-labs/DynamicAuth/issues/2361)) ([676be6c](https://github.com/dynamic-labs/DynamicAuth/commit/676be6c108dff8df7175f0587cf0568658276e4e))
291
+
292
+
293
+ ### Bug Fixes
294
+
295
+ * **local-storage:** load auth token when stringified ([#2368](https://github.com/dynamic-labs/DynamicAuth/issues/2368)) ([3a54266](https://github.com/dynamic-labs/DynamicAuth/commit/3a54266fde3cd1f7362ccc490f89b8925132271b))
296
+
2
297
  ## [0.18.0-RC.2](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.1...v0.18.0-RC.2) (2023-06-16)
3
298
 
4
299
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/solana",
3
- "version": "0.18.0-RC.2",
3
+ "version": "0.18.0-RC.21",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -27,10 +27,10 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@solana/web3.js": "1.70.1",
30
- "@dynamic-labs/rpc-providers": "0.18.0-RC.2",
31
- "@dynamic-labs/types": "0.18.0-RC.2",
32
- "@dynamic-labs/utils": "0.18.0-RC.2",
33
- "@dynamic-labs/wallet-connector-core": "0.18.0-RC.2"
30
+ "@dynamic-labs/rpc-providers": "0.18.0-RC.21",
31
+ "@dynamic-labs/types": "0.18.0-RC.21",
32
+ "@dynamic-labs/utils": "0.18.0-RC.21",
33
+ "@dynamic-labs/wallet-connector-core": "0.18.0-RC.21"
34
34
  },
35
35
  "peerDependencies": {}
36
36
  }
@@ -0,0 +1,53 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _tslib = require('../../_virtual/_tslib.cjs');
6
+ var utils = require('@dynamic-labs/utils');
7
+ var solProviderHelper = require('../solProviderHelper.cjs');
8
+ var InjectedWalletBase = require('./InjectedWalletBase.cjs');
9
+
10
+ class BackpackSol extends InjectedWalletBase.InjectedWalletBase {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.name = 'BackpackSol';
14
+ }
15
+ setupEventListeners(listeners) {
16
+ const web3Provider = solProviderHelper.SolProviderHelper.findProvider(this.name);
17
+ if (!web3Provider)
18
+ return;
19
+ web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.on('activeWalletDidChange', (publicKey) => solProviderHelper.SolProviderHelper.handleAccountChange(listeners, web3Provider, publicKey));
20
+ solProviderHelper.SolProviderHelper._setupEventListeners(listeners, web3Provider);
21
+ }
22
+ fetchPublicAddress() {
23
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
24
+ return solProviderHelper.SolProviderHelper.fetchPublicAddressWithName(this.name);
25
+ });
26
+ }
27
+ getSigner() {
28
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
29
+ return solProviderHelper.SolProviderHelper.connectWithName(this.name);
30
+ });
31
+ }
32
+ signMessage(messageToSign) {
33
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
34
+ const publicAddress = yield this.fetchPublicAddress();
35
+ if (!publicAddress) {
36
+ return undefined;
37
+ }
38
+ const provider = yield this.getSigner();
39
+ if (!provider) {
40
+ return undefined;
41
+ }
42
+ const signedMessage = (yield provider.signMessage(Buffer.from(messageToSign, 'utf8'), publicAddress));
43
+ return utils.bufferToBase64(signedMessage);
44
+ });
45
+ }
46
+ getConnectedAccounts() {
47
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
48
+ return solProviderHelper.SolProviderHelper.getConnectedAccountsWithName(this.name);
49
+ });
50
+ }
51
+ }
52
+
53
+ exports.BackpackSol = BackpackSol;
@@ -0,0 +1,11 @@
1
+ import { WalletEventListeners } from '@dynamic-labs/wallet-connector-core';
2
+ import { ISolana } from '../types';
3
+ import { InjectedWalletBase } from './InjectedWalletBase';
4
+ export declare class BackpackSol extends InjectedWalletBase {
5
+ name: string;
6
+ setupEventListeners(listeners: WalletEventListeners): void;
7
+ fetchPublicAddress(): Promise<string | undefined>;
8
+ getSigner(): Promise<ISolana | undefined>;
9
+ signMessage(messageToSign: string): Promise<string | undefined>;
10
+ getConnectedAccounts(): Promise<string[]>;
11
+ }
@@ -0,0 +1,49 @@
1
+ import { __awaiter } from '../../_virtual/_tslib.js';
2
+ import { bufferToBase64 } from '@dynamic-labs/utils';
3
+ import { SolProviderHelper } from '../solProviderHelper.js';
4
+ import { InjectedWalletBase } from './InjectedWalletBase.js';
5
+
6
+ class BackpackSol extends InjectedWalletBase {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.name = 'BackpackSol';
10
+ }
11
+ setupEventListeners(listeners) {
12
+ const web3Provider = SolProviderHelper.findProvider(this.name);
13
+ if (!web3Provider)
14
+ return;
15
+ web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.on('activeWalletDidChange', (publicKey) => SolProviderHelper.handleAccountChange(listeners, web3Provider, publicKey));
16
+ SolProviderHelper._setupEventListeners(listeners, web3Provider);
17
+ }
18
+ fetchPublicAddress() {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ return SolProviderHelper.fetchPublicAddressWithName(this.name);
21
+ });
22
+ }
23
+ getSigner() {
24
+ return __awaiter(this, void 0, void 0, function* () {
25
+ return SolProviderHelper.connectWithName(this.name);
26
+ });
27
+ }
28
+ signMessage(messageToSign) {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ const publicAddress = yield this.fetchPublicAddress();
31
+ if (!publicAddress) {
32
+ return undefined;
33
+ }
34
+ const provider = yield this.getSigner();
35
+ if (!provider) {
36
+ return undefined;
37
+ }
38
+ const signedMessage = (yield provider.signMessage(Buffer.from(messageToSign, 'utf8'), publicAddress));
39
+ return bufferToBase64(signedMessage);
40
+ });
41
+ }
42
+ getConnectedAccounts() {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ return SolProviderHelper.getConnectedAccountsWithName(this.name);
45
+ });
46
+ }
47
+ }
48
+
49
+ export { BackpackSol };
@@ -1,11 +1,11 @@
1
1
  import { WalletEventListeners } from '@dynamic-labs/wallet-connector-core';
2
2
  import { SolWalletConnector } from '../solWalletConnector';
3
- import { ISolana } from '../types';
3
+ import { IBackpackSolana, ISolana } from '../types';
4
4
  export declare abstract class InjectedWalletBase extends SolWalletConnector {
5
5
  setupEventListeners(listeners: WalletEventListeners): void;
6
6
  teardownEventListeners(): void;
7
7
  connect(): Promise<void>;
8
- getSigner(): Promise<ISolana | undefined>;
8
+ getSigner(): Promise<ISolana | IBackpackSolana | undefined>;
9
9
  isInstalledOnBrowser(): boolean;
10
10
  fetchPublicAddress(): Promise<string | undefined>;
11
11
  signMessage(messageToSign: string): Promise<string | undefined>;
@@ -6,7 +6,14 @@ var BraveSol = require('./BraveSol.cjs');
6
6
  var ExodusSol = require('./ExodusSol.cjs');
7
7
  var PhantomLedger = require('./PhantomLedger.cjs');
8
8
  var Phantom = require('./Phantom.cjs');
9
+ var BackpackSol = require('./BackpackSol.cjs');
9
10
 
10
- const injectedWallets = [BraveSol.BraveSol, ExodusSol.ExodusSol, PhantomLedger.PhantomLedger, Phantom.Phantom];
11
+ const injectedWallets = [
12
+ BraveSol.BraveSol,
13
+ ExodusSol.ExodusSol,
14
+ BackpackSol.BackpackSol,
15
+ PhantomLedger.PhantomLedger,
16
+ Phantom.Phantom,
17
+ ];
11
18
 
12
19
  exports.injectedWallets = injectedWallets;
@@ -2,7 +2,14 @@ import { BraveSol } from './BraveSol.js';
2
2
  import { ExodusSol } from './ExodusSol.js';
3
3
  import { PhantomLedger } from './PhantomLedger.js';
4
4
  import { Phantom } from './Phantom.js';
5
+ import { BackpackSol } from './BackpackSol.js';
5
6
 
6
- const injectedWallets = [BraveSol, ExodusSol, PhantomLedger, Phantom];
7
+ const injectedWallets = [
8
+ BraveSol,
9
+ ExodusSol,
10
+ BackpackSol,
11
+ PhantomLedger,
12
+ Phantom,
13
+ ];
7
14
 
8
15
  export { injectedWallets };
@@ -12,7 +12,7 @@ class SolProviderHelper {
12
12
  return walletConnectorCore.ProviderLookup(this.allInstalledProviders(), providerFlags);
13
13
  }
14
14
  static allInstalledProviders() {
15
- return this.findSolanaProviders(window.solana).concat(this.findSolanaProviders(window.solflare), this.findSolanaProviders(window.glowSolana));
15
+ return this.findSolanaProviders(window.solana).concat(this.findSolanaProviders(window.solflare), this.findSolanaProviders(window.glowSolana), this.findSolanaProviders(window.backpack));
16
16
  }
17
17
  static findSolanaProviders(solana) {
18
18
  const solanaProviders = [];
@@ -39,7 +39,9 @@ class SolProviderHelper {
39
39
  if (!provider) {
40
40
  return Promise.resolve(undefined);
41
41
  }
42
- yield provider.connect();
42
+ if (!provider.isConnected) {
43
+ yield provider.connect();
44
+ }
43
45
  const { publicKey } = provider;
44
46
  return publicKey ? publicKey.toString() : Promise.resolve(undefined);
45
47
  });
@@ -51,7 +53,9 @@ class SolProviderHelper {
51
53
  return Promise.resolve(undefined);
52
54
  }
53
55
  try {
54
- yield provider.connect();
56
+ if (!provider.isConnected) {
57
+ yield provider.connect();
58
+ }
55
59
  return provider;
56
60
  }
57
61
  catch (err) {
@@ -69,33 +73,17 @@ class SolProviderHelper {
69
73
  if (!provider) {
70
74
  return Promise.resolve(undefined);
71
75
  }
76
+ if (!provider.isConnected) {
77
+ yield provider.connect();
78
+ }
72
79
  const encodedMessage = new TextEncoder().encode(messageToSign);
73
- return provider.connect().then(() => _tslib.__awaiter(this, void 0, void 0, function* () {
74
- const { signature } = (yield provider.signMessage(encodedMessage, 'utf8'));
75
- return utils.bufferToBase64(signature);
76
- }));
80
+ return utils.bufferToBase64((yield provider.signMessage(encodedMessage, 'utf8'))
81
+ .signature);
77
82
  });
78
83
  }
79
84
  static _setupEventListeners(listeners, web3Provider) {
80
- const handleAccountChange = (address) => _tslib.__awaiter(this, void 0, void 0, function* () {
81
- var _b, _c, _d;
82
- if (!address) {
83
- yield (web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.connect());
84
- if ((_b = web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.publicKey) === null || _b === void 0 ? void 0 : _b.toString()) {
85
- (_c = listeners.onAccountChange) === null || _c === void 0 ? void 0 : _c.call(listeners, [web3Provider.publicKey.toString()]);
86
- }
87
- return;
88
- }
89
- if (address.toString()) {
90
- yield ((_d = listeners.onAccountChange) === null || _d === void 0 ? void 0 : _d.call(listeners, [address.toString()]));
91
- }
92
- });
93
- const handleDisconnect = () => _tslib.__awaiter(this, void 0, void 0, function* () {
94
- var _e;
95
- yield ((_e = listeners.onDisconnect) === null || _e === void 0 ? void 0 : _e.call(listeners));
96
- });
97
- web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.on('accountChanged', handleAccountChange);
98
- web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.on('disconnect', handleDisconnect);
85
+ web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.on('accountChanged', (publicKey) => this.handleAccountChange(listeners, web3Provider, publicKey));
86
+ web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.on('disconnect', () => this.handleDisconnect(listeners));
99
87
  }
100
88
  static _teardownEventListeners(name) {
101
89
  const web3Provider = this.findProvider(name);
@@ -113,9 +101,11 @@ class SolProviderHelper {
113
101
  }
114
102
  let connectionResult;
115
103
  try {
116
- connectionResult = yield provider.connect({
117
- onlyIfTrusted: true,
118
- });
104
+ if (!provider.isConnected) {
105
+ connectionResult = yield provider.connect({
106
+ onlyIfTrusted: true,
107
+ });
108
+ }
119
109
  }
120
110
  catch (e) {
121
111
  return [];
@@ -152,7 +142,9 @@ SolProviderHelper.ExodusProvider = () => _a.installedProviderLookup([
152
142
  { flag: 'isPhantom', value: true },
153
143
  { flag: 'isExodus', value: true },
154
144
  ]);
145
+ SolProviderHelper.BackpackSol = () => _a.installedProviderLookup([{ flag: 'isBackpack', value: true }]);
155
146
  SolProviderHelper.providers = {
147
+ backpacksol: _a.BackpackSol,
156
148
  bravesol: _a.BraveProvider,
157
149
  coinbasesolana: _a.CoinbaseProvider,
158
150
  exodussol: _a.ExodusProvider,
@@ -160,6 +152,23 @@ SolProviderHelper.providers = {
160
152
  phantom: _a.PhantomProvider,
161
153
  phantomledger: _a.PhantomProvider,
162
154
  solflare: _a.SolflareProvider,
163
- };
155
+ };
156
+ SolProviderHelper.handleAccountChange = (listeners, web3Provider, address) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
157
+ var _b, _c, _d;
158
+ if (!address) {
159
+ yield (web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.connect());
160
+ if ((_b = web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.publicKey) === null || _b === void 0 ? void 0 : _b.toString()) {
161
+ (_c = listeners.onAccountChange) === null || _c === void 0 ? void 0 : _c.call(listeners, [web3Provider.publicKey.toString()]);
162
+ }
163
+ return;
164
+ }
165
+ if (address.toString()) {
166
+ yield ((_d = listeners.onAccountChange) === null || _d === void 0 ? void 0 : _d.call(listeners, [address.toString()]));
167
+ }
168
+ });
169
+ SolProviderHelper.handleDisconnect = (listeners) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
170
+ var _e;
171
+ yield ((_e = listeners.onDisconnect) === null || _e === void 0 ? void 0 : _e.call(listeners));
172
+ });
164
173
 
165
174
  exports.SolProviderHelper = SolProviderHelper;
@@ -4,6 +4,10 @@ export interface SignedMessage {
4
4
  signature: Uint8Array;
5
5
  }
6
6
  type Provider = () => ISolana | undefined;
7
+ export type AccountChangeEventHandler = (address: {
8
+ toString(): string;
9
+ } | null) => Promise<void>;
10
+ export type DisconnectEventHandler = () => Promise<void>;
7
11
  export declare class SolProviderHelper {
8
12
  static GlowProvider: Provider;
9
13
  static CoinbaseProvider: Provider;
@@ -11,6 +15,7 @@ export declare class SolProviderHelper {
11
15
  static SolflareProvider: Provider;
12
16
  static BraveProvider: Provider;
13
17
  static ExodusProvider: Provider;
18
+ static BackpackSol: Provider;
14
19
  static providers: {
15
20
  [wallet: string]: Provider;
16
21
  };
@@ -22,6 +27,8 @@ export declare class SolProviderHelper {
22
27
  static fetchPublicAddressWithName(name: string): Promise<string | undefined>;
23
28
  static connectWithName(name: string): Promise<ISolana | undefined>;
24
29
  static signMessageWithName(messageToSign: string, name: string): Promise<string | undefined>;
30
+ static handleAccountChange: (listeners: WalletEventListeners, web3Provider: ISolana, address: string) => Promise<void>;
31
+ static handleDisconnect: (listeners: WalletEventListeners) => Promise<void>;
25
32
  static _setupEventListeners(listeners: WalletEventListeners, web3Provider?: ISolana): void;
26
33
  static _teardownEventListeners(name: string): void;
27
34
  static getConnectedAccountsWithName(name: string): Promise<string[]>;
@@ -8,7 +8,7 @@ class SolProviderHelper {
8
8
  return ProviderLookup(this.allInstalledProviders(), providerFlags);
9
9
  }
10
10
  static allInstalledProviders() {
11
- return this.findSolanaProviders(window.solana).concat(this.findSolanaProviders(window.solflare), this.findSolanaProviders(window.glowSolana));
11
+ return this.findSolanaProviders(window.solana).concat(this.findSolanaProviders(window.solflare), this.findSolanaProviders(window.glowSolana), this.findSolanaProviders(window.backpack));
12
12
  }
13
13
  static findSolanaProviders(solana) {
14
14
  const solanaProviders = [];
@@ -35,7 +35,9 @@ class SolProviderHelper {
35
35
  if (!provider) {
36
36
  return Promise.resolve(undefined);
37
37
  }
38
- yield provider.connect();
38
+ if (!provider.isConnected) {
39
+ yield provider.connect();
40
+ }
39
41
  const { publicKey } = provider;
40
42
  return publicKey ? publicKey.toString() : Promise.resolve(undefined);
41
43
  });
@@ -47,7 +49,9 @@ class SolProviderHelper {
47
49
  return Promise.resolve(undefined);
48
50
  }
49
51
  try {
50
- yield provider.connect();
52
+ if (!provider.isConnected) {
53
+ yield provider.connect();
54
+ }
51
55
  return provider;
52
56
  }
53
57
  catch (err) {
@@ -65,33 +69,17 @@ class SolProviderHelper {
65
69
  if (!provider) {
66
70
  return Promise.resolve(undefined);
67
71
  }
72
+ if (!provider.isConnected) {
73
+ yield provider.connect();
74
+ }
68
75
  const encodedMessage = new TextEncoder().encode(messageToSign);
69
- return provider.connect().then(() => __awaiter(this, void 0, void 0, function* () {
70
- const { signature } = (yield provider.signMessage(encodedMessage, 'utf8'));
71
- return bufferToBase64(signature);
72
- }));
76
+ return bufferToBase64((yield provider.signMessage(encodedMessage, 'utf8'))
77
+ .signature);
73
78
  });
74
79
  }
75
80
  static _setupEventListeners(listeners, web3Provider) {
76
- const handleAccountChange = (address) => __awaiter(this, void 0, void 0, function* () {
77
- var _b, _c, _d;
78
- if (!address) {
79
- yield (web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.connect());
80
- if ((_b = web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.publicKey) === null || _b === void 0 ? void 0 : _b.toString()) {
81
- (_c = listeners.onAccountChange) === null || _c === void 0 ? void 0 : _c.call(listeners, [web3Provider.publicKey.toString()]);
82
- }
83
- return;
84
- }
85
- if (address.toString()) {
86
- yield ((_d = listeners.onAccountChange) === null || _d === void 0 ? void 0 : _d.call(listeners, [address.toString()]));
87
- }
88
- });
89
- const handleDisconnect = () => __awaiter(this, void 0, void 0, function* () {
90
- var _e;
91
- yield ((_e = listeners.onDisconnect) === null || _e === void 0 ? void 0 : _e.call(listeners));
92
- });
93
- web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.on('accountChanged', handleAccountChange);
94
- web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.on('disconnect', handleDisconnect);
81
+ web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.on('accountChanged', (publicKey) => this.handleAccountChange(listeners, web3Provider, publicKey));
82
+ web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.on('disconnect', () => this.handleDisconnect(listeners));
95
83
  }
96
84
  static _teardownEventListeners(name) {
97
85
  const web3Provider = this.findProvider(name);
@@ -109,9 +97,11 @@ class SolProviderHelper {
109
97
  }
110
98
  let connectionResult;
111
99
  try {
112
- connectionResult = yield provider.connect({
113
- onlyIfTrusted: true,
114
- });
100
+ if (!provider.isConnected) {
101
+ connectionResult = yield provider.connect({
102
+ onlyIfTrusted: true,
103
+ });
104
+ }
115
105
  }
116
106
  catch (e) {
117
107
  return [];
@@ -148,7 +138,9 @@ SolProviderHelper.ExodusProvider = () => _a.installedProviderLookup([
148
138
  { flag: 'isPhantom', value: true },
149
139
  { flag: 'isExodus', value: true },
150
140
  ]);
141
+ SolProviderHelper.BackpackSol = () => _a.installedProviderLookup([{ flag: 'isBackpack', value: true }]);
151
142
  SolProviderHelper.providers = {
143
+ backpacksol: _a.BackpackSol,
152
144
  bravesol: _a.BraveProvider,
153
145
  coinbasesolana: _a.CoinbaseProvider,
154
146
  exodussol: _a.ExodusProvider,
@@ -156,6 +148,23 @@ SolProviderHelper.providers = {
156
148
  phantom: _a.PhantomProvider,
157
149
  phantomledger: _a.PhantomProvider,
158
150
  solflare: _a.SolflareProvider,
159
- };
151
+ };
152
+ SolProviderHelper.handleAccountChange = (listeners, web3Provider, address) => __awaiter(void 0, void 0, void 0, function* () {
153
+ var _b, _c, _d;
154
+ if (!address) {
155
+ yield (web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.connect());
156
+ if ((_b = web3Provider === null || web3Provider === void 0 ? void 0 : web3Provider.publicKey) === null || _b === void 0 ? void 0 : _b.toString()) {
157
+ (_c = listeners.onAccountChange) === null || _c === void 0 ? void 0 : _c.call(listeners, [web3Provider.publicKey.toString()]);
158
+ }
159
+ return;
160
+ }
161
+ if (address.toString()) {
162
+ yield ((_d = listeners.onAccountChange) === null || _d === void 0 ? void 0 : _d.call(listeners, [address.toString()]));
163
+ }
164
+ });
165
+ SolProviderHelper.handleDisconnect = (listeners) => __awaiter(void 0, void 0, void 0, function* () {
166
+ var _e;
167
+ yield ((_e = listeners.onDisconnect) === null || _e === void 0 ? void 0 : _e.call(listeners));
168
+ });
160
169
 
161
170
  export { SolProviderHelper };
@@ -33,6 +33,23 @@ class SolWalletConnector extends walletConnectorCore.WalletConnectorBase {
33
33
  return rpcProviders.solana;
34
34
  });
35
35
  }
36
+ getNetwork() {
37
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
38
+ const provider = this.getWeb3Provider();
39
+ let genesisHash = yield provider.getGenesisHash();
40
+ genesisHash = genesisHash.substring(0, 32);
41
+ // see: https://github.com/ChainAgnostic/namespaces/blob/main/solana/caip2.md
42
+ if (genesisHash === '5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp') {
43
+ return 'mainnet';
44
+ }
45
+ else if (genesisHash === 'EtWTRABZaYq6iMfeYKouRu166VU2xqa1') {
46
+ return 'devnet';
47
+ }
48
+ else {
49
+ return 'testnet';
50
+ }
51
+ });
52
+ }
36
53
  getWeb3Provider() {
37
54
  var _a;
38
55
  const [network] = this.solNetworks;
@@ -12,6 +12,7 @@ export declare abstract class SolWalletConnector extends WalletConnectorBase {
12
12
  supportedChains: Chain[];
13
13
  connectedChain: Chain;
14
14
  constructor({ solNetworks, chainRpcProviders }: SolWalletConnectorOpts);
15
+ getNetwork(): Promise<string>;
15
16
  getWeb3Provider(): Connection;
16
17
  getRpcProvider(): Promise<Connection | undefined>;
17
18
  abstract getSigner(): Promise<ISolana | undefined>;
@@ -29,6 +29,23 @@ class SolWalletConnector extends WalletConnectorBase {
29
29
  return rpcProviders.solana;
30
30
  });
31
31
  }
32
+ getNetwork() {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ const provider = this.getWeb3Provider();
35
+ let genesisHash = yield provider.getGenesisHash();
36
+ genesisHash = genesisHash.substring(0, 32);
37
+ // see: https://github.com/ChainAgnostic/namespaces/blob/main/solana/caip2.md
38
+ if (genesisHash === '5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp') {
39
+ return 'mainnet';
40
+ }
41
+ else if (genesisHash === 'EtWTRABZaYq6iMfeYKouRu166VU2xqa1') {
42
+ return 'devnet';
43
+ }
44
+ else {
45
+ return 'testnet';
46
+ }
47
+ });
48
+ }
32
49
  getWeb3Provider() {
33
50
  var _a;
34
51
  const [network] = this.solNetworks;
package/src/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Transaction } from '@solana/web3.js';
1
+ import { Connection, SendOptions, Signer, Transaction, TransactionSignature } from '@solana/web3.js';
2
2
  import { ProviderCondition } from '@dynamic-labs/wallet-connector-core';
3
3
  declare global {
4
4
  interface IWindowPhantom {
@@ -13,6 +13,7 @@ declare global {
13
13
  phantom?: IWindowPhantom;
14
14
  solana?: ISolana;
15
15
  solflare?: ISolana;
16
+ backpack?: IBackpackSolana;
16
17
  }
17
18
  }
18
19
  type PublicKey = {
@@ -36,7 +37,12 @@ export type ISolana = {
36
37
  removeListener: (eventMessage: string, callback?: (publickey: string) => void) => Promise<void | object>;
37
38
  signMessage: (message: Uint8Array, encoding?: string) => Promise<void | object>;
38
39
  signTransaction: (transaction: Transaction) => Promise<Transaction>;
40
+ isConnected?: boolean;
39
41
  };
40
- export type ProviderFlag = 'isBraveWallet' | 'isGlow' | 'isPhantom' | 'isSolflare' | 'isExodus';
42
+ export type IBackpackSolana = ISolana & {
43
+ signMessage: (message: Uint8Array, publicKey: string) => Promise<void | object>;
44
+ send: (transaction: Transaction, signers?: Signer[], options?: SendOptions, connection?: Connection, publicKey?: PublicKey) => Promise<TransactionSignature>;
45
+ };
46
+ export type ProviderFlag = 'isBraveWallet' | 'isGlow' | 'isPhantom' | 'isSolflare' | 'isExodus' | 'isBackpack';
41
47
  export type EthProviderCondition = ProviderCondition<ProviderFlag>;
42
48
  export {};