@dynamic-labs/solana 2.1.0-alpha.3 → 2.1.0-alpha.30
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 +253 -0
- package/package.json +14 -10
- package/src/CoinbaseSolana.cjs +1 -0
- package/src/CoinbaseSolana.js +1 -0
- package/src/SolanaWalletStandardConnector/SolanaWalletStandardConnector.cjs +100 -0
- package/src/SolanaWalletStandardConnector/SolanaWalletStandardConnector.d.ts +21 -0
- package/src/SolanaWalletStandardConnector/SolanaWalletStandardConnector.js +96 -0
- package/src/SolanaWalletStandardConnector/index.d.ts +1 -0
- package/src/SolanaWalletStandardConnector/utils/createSolanaSignerFromWalletStandard/createSolanaSignerFromWalletStandard.cjs +117 -0
- package/src/SolanaWalletStandardConnector/utils/createSolanaSignerFromWalletStandard/createSolanaSignerFromWalletStandard.d.ts +4 -0
- package/src/SolanaWalletStandardConnector/utils/createSolanaSignerFromWalletStandard/createSolanaSignerFromWalletStandard.js +113 -0
- package/src/SolanaWalletStandardConnector/utils/createSolanaSignerFromWalletStandard/index.d.ts +1 -0
- package/src/index.cjs +2 -0
- package/src/index.js +2 -0
- package/src/injected/BackpackSol.cjs +1 -1
- package/src/injected/BackpackSol.js +1 -1
- package/src/injected/UnknownInjected.cjs +21 -0
- package/src/injected/UnknownInjected.d.ts +8 -0
- package/src/injected/UnknownInjected.js +17 -0
- package/src/injected/fetchInjectedWalletConnectors.cjs +18 -2
- package/src/injected/fetchInjectedWalletConnectors.js +18 -2
- package/src/injected/index.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,257 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.1.0-alpha.30](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.29...v2.1.0-alpha.30) (2024-05-31)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* ensure initExpirationTime is called automatically after authenticating ([#5797](https://github.com/dynamic-labs/DynamicAuth/issues/5797)) ([87eb802](https://github.com/dynamic-labs/DynamicAuth/commit/87eb802e0c2d3af2ca116e07099bfef426d30a1f))
|
|
8
|
+
* initExpirationTime should use expiresAt from storage ([#5799](https://github.com/dynamic-labs/DynamicAuth/issues/5799)) ([384ed17](https://github.com/dynamic-labs/DynamicAuth/commit/384ed1747d9b813ac0d34aaee36eb6480cb256d3))
|
|
9
|
+
* only run useValidateSession once on rerender ([#5795](https://github.com/dynamic-labs/DynamicAuth/issues/5795)) ([ba4446d](https://github.com/dynamic-labs/DynamicAuth/commit/ba4446df95726248b877a84def959cabe81ad9b6))
|
|
10
|
+
* store expiresAt timestamp from VerifyResponse in local storage for use in initExpirationTime ([#5796](https://github.com/dynamic-labs/DynamicAuth/issues/5796)) ([5f8aaeb](https://github.com/dynamic-labs/DynamicAuth/commit/5f8aaeb1cd45b10cb007f9eac25d18f50f142d8f))
|
|
11
|
+
|
|
12
|
+
## [2.1.0-alpha.29](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.28...v2.1.0-alpha.29) (2024-05-30)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* add account and chain to coinbase walletClient ([#5776](https://github.com/dynamic-labs/DynamicAuth/issues/5776)) ([557091c](https://github.com/dynamic-labs/DynamicAuth/commit/557091c0efaec11273bd40b53c8bcd633c1bf48d))
|
|
18
|
+
* add support for phantom btc ([#5717](https://github.com/dynamic-labs/DynamicAuth/issues/5717)) ([c61ca4f](https://github.com/dynamic-labs/DynamicAuth/commit/c61ca4f437796be2b420902de7e7de730725d122))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* add phantom btc mobile redirect ([#5789](https://github.com/dynamic-labs/DynamicAuth/issues/5789)) ([aaa2654](https://github.com/dynamic-labs/DynamicAuth/commit/aaa26548668b0733e7930c1d7f5cc3937b3dfb50))
|
|
24
|
+
* clear settings and configurations when logged out on page load ([#5787](https://github.com/dynamic-labs/DynamicAuth/issues/5787)) ([53c4d0b](https://github.com/dynamic-labs/DynamicAuth/commit/53c4d0b4686debdb43b1ab1b8b9e296ed4dd74b6))
|
|
25
|
+
* lookup projectSettings from store to check if cookie enabled ([#5790](https://github.com/dynamic-labs/DynamicAuth/issues/5790)) ([6f2314b](https://github.com/dynamic-labs/DynamicAuth/commit/6f2314b0afef984e6caea79ead73d12c5c6d83f0))
|
|
26
|
+
|
|
27
|
+
## [2.1.0-alpha.28](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.27...v2.1.0-alpha.28) (2024-05-29)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
* adds solana standard wallet connector ([#5752](https://github.com/dynamic-labs/DynamicAuth/issues/5752)) ([0040940](https://github.com/dynamic-labs/DynamicAuth/commit/0040940fd1adb37ab3106bb0e4dfe79403bc41f2))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Bug Fixes
|
|
36
|
+
|
|
37
|
+
* farcaster fetch url fix ([#5767](https://github.com/dynamic-labs/DynamicAuth/issues/5767)) ([1408ba9](https://github.com/dynamic-labs/DynamicAuth/commit/1408ba92680363b9db7820a63d5e3d15dc26ad22))
|
|
38
|
+
|
|
39
|
+
## [2.1.0-alpha.27](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.26...v2.1.0-alpha.27) (2024-05-29)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Bug Fixes
|
|
43
|
+
|
|
44
|
+
* coinbase connection ([#5764](https://github.com/dynamic-labs/DynamicAuth/issues/5764)) ([aeacd1c](https://github.com/dynamic-labs/DynamicAuth/commit/aeacd1c55dc471fbf8c14eb05ab356b0a90aa239))
|
|
45
|
+
|
|
46
|
+
## [2.1.0-alpha.26](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.25...v2.1.0-alpha.26) (2024-05-29)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Features
|
|
50
|
+
|
|
51
|
+
* add farcaster login to react native ([#5713](https://github.com/dynamic-labs/DynamicAuth/issues/5713)) ([08f4473](https://github.com/dynamic-labs/DynamicAuth/commit/08f4473eec9b32b82b6f703fa4d5136514a61b25))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Bug Fixes
|
|
55
|
+
|
|
56
|
+
* better error handling of invalid mfa otp ([#5759](https://github.com/dynamic-labs/DynamicAuth/issues/5759)) ([72ab01f](https://github.com/dynamic-labs/DynamicAuth/commit/72ab01f8f919f147eeedfabf8b4838802abf308a))
|
|
57
|
+
* show correct status for magic eden btc wallets after ([#5748](https://github.com/dynamic-labs/DynamicAuth/issues/5748)) ([b8f20bb](https://github.com/dynamic-labs/DynamicAuth/commit/b8f20bb796b9a2e88817ef3b0da6ac32e9012b18))
|
|
58
|
+
|
|
59
|
+
## [2.1.0-alpha.25](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.24...v2.1.0-alpha.25) (2024-05-27)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### Bug Fixes
|
|
63
|
+
|
|
64
|
+
* btc balance calculation ([#5737](https://github.com/dynamic-labs/DynamicAuth/issues/5737)) ([9b5ceb3](https://github.com/dynamic-labs/DynamicAuth/commit/9b5ceb32d543037f60d7104f0b81b3abc86ebd10))
|
|
65
|
+
|
|
66
|
+
## [2.1.0-alpha.24](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.23...v2.1.0-alpha.24) (2024-05-26)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
### Features
|
|
70
|
+
|
|
71
|
+
* add onMfaCompleteOnce to useMfa ([#5702](https://github.com/dynamic-labs/DynamicAuth/issues/5702)) ([6451e33](https://github.com/dynamic-labs/DynamicAuth/commit/6451e3369ef1b4ba116378f0dd3fe4e82007e670))
|
|
72
|
+
* prompt custom fields during onboarding ([#5302](https://github.com/dynamic-labs/DynamicAuth/issues/5302)) ([8664223](https://github.com/dynamic-labs/DynamicAuth/commit/86642232cf2b490a820169f48ba8dc093010e1a0))
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### Bug Fixes
|
|
76
|
+
|
|
77
|
+
* correct text on pending signature screen to match the embedded widget modal text ([#5707](https://github.com/dynamic-labs/DynamicAuth/issues/5707)) ([44a6a06](https://github.com/dynamic-labs/DynamicAuth/commit/44a6a0664e08d4b9fc25dd86c0e30f8d585558e0))
|
|
78
|
+
* pass captcha token for farcaster login ([#5706](https://github.com/dynamic-labs/DynamicAuth/issues/5706)) ([32bcb6e](https://github.com/dynamic-labs/DynamicAuth/commit/32bcb6e0e06c6e273c07f32893dfd550deeb6a19))
|
|
79
|
+
* use coinbase provider to get connected accounts for consistency ([#5711](https://github.com/dynamic-labs/DynamicAuth/issues/5711)) ([b9e9170](https://github.com/dynamic-labs/DynamicAuth/commit/b9e9170dad1ac27a85a44a7177b82055ce0035cb))
|
|
80
|
+
|
|
81
|
+
## [2.1.0-alpha.23](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.22...v2.1.0-alpha.23) (2024-05-23)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
### Features
|
|
85
|
+
|
|
86
|
+
* add authFailure and authInit events ([#5659](https://github.com/dynamic-labs/DynamicAuth/issues/5659)) ([f4f592a](https://github.com/dynamic-labs/DynamicAuth/commit/f4f592aaacd96fae9333b803c235c5f1fea0e20e))
|
|
87
|
+
* prompt mfa on signup and signin ([#5599](https://github.com/dynamic-labs/DynamicAuth/issues/5599)) ([8d4ecf4](https://github.com/dynamic-labs/DynamicAuth/commit/8d4ecf4c69c59c1fb14e79511fb2f9b33a7e3d89))
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Bug Fixes
|
|
91
|
+
|
|
92
|
+
* close auth modal if create embedded wallet throws ([#5683](https://github.com/dynamic-labs/DynamicAuth/issues/5683)) ([5331d73](https://github.com/dynamic-labs/DynamicAuth/commit/5331d731a171bb52a598eb5b25f7ba80cef7a64c))
|
|
93
|
+
* prevent state update when the webview is unmounted ([#5688](https://github.com/dynamic-labs/DynamicAuth/issues/5688)) ([8e4ecbd](https://github.com/dynamic-labs/DynamicAuth/commit/8e4ecbdcdb5f48c57ecaad90d663c66529013192))
|
|
94
|
+
* show phone number in use error message ([#5681](https://github.com/dynamic-labs/DynamicAuth/issues/5681)) ([e62f7b7](https://github.com/dynamic-labs/DynamicAuth/commit/e62f7b7b6a5e217944346faf2410028433cecad4))
|
|
95
|
+
|
|
96
|
+
## [2.1.0-alpha.22](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.21...v2.1.0-alpha.22) (2024-05-21)
|
|
97
|
+
|
|
98
|
+
## [2.1.0-alpha.21](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.20...v2.1.0-alpha.21) (2024-05-21)
|
|
99
|
+
|
|
100
|
+
## [2.1.0-alpha.20](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.19...v2.1.0-alpha.20) (2024-05-21)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
### Features
|
|
104
|
+
|
|
105
|
+
* adds client.networks module ([#5650](https://github.com/dynamic-labs/DynamicAuth/issues/5650)) ([70f7fe5](https://github.com/dynamic-labs/DynamicAuth/commit/70f7fe5f437756c51e787ac12183be0a23c51b89))
|
|
106
|
+
* user fields supports custom fields ([#5639](https://github.com/dynamic-labs/DynamicAuth/issues/5639)) ([8eb5788](https://github.com/dynamic-labs/DynamicAuth/commit/8eb5788fc3e1286929f5949ecb57736b21b13fb5))
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
### Bug Fixes
|
|
110
|
+
|
|
111
|
+
* add webcredentials to expo ([#5640](https://github.com/dynamic-labs/DynamicAuth/issues/5640)) ([9026fbf](https://github.com/dynamic-labs/DynamicAuth/commit/9026fbf0108537e884588f3adcdb9f0db04a159b))
|
|
112
|
+
* init ethers web3provider without a network if selected network is unsupported ([#5651](https://github.com/dynamic-labs/DynamicAuth/issues/5651)) ([e82040f](https://github.com/dynamic-labs/DynamicAuth/commit/e82040f424b17a70fac4400ab5b85a0dc6c0e35a))
|
|
113
|
+
|
|
114
|
+
## [2.1.0-alpha.19](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.18...v2.1.0-alpha.19) (2024-05-17)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
### Features
|
|
118
|
+
|
|
119
|
+
* add createUserProfileFromSDKUser ([#5596](https://github.com/dynamic-labs/DynamicAuth/issues/5596)) ([d37a1b4](https://github.com/dynamic-labs/DynamicAuth/commit/d37a1b4119f5ff4fff1e987d157f6d5abf105a8b))
|
|
120
|
+
* add headless social sign-in ([#5439](https://github.com/dynamic-labs/DynamicAuth/issues/5439)) ([e32fdf8](https://github.com/dynamic-labs/DynamicAuth/commit/e32fdf863718d661b90b592c8df734e92386ddf3))
|
|
121
|
+
* fetch custom fields in profile and update user ([#5627](https://github.com/dynamic-labs/DynamicAuth/issues/5627)) ([3940c25](https://github.com/dynamic-labs/DynamicAuth/commit/3940c2542bb330f3ed9a8eb98eed9d05c8fcb03a))
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### Bug Fixes
|
|
125
|
+
|
|
126
|
+
* include applinks details to AASA ([#5635](https://github.com/dynamic-labs/DynamicAuth/issues/5635)) ([ce94fec](https://github.com/dynamic-labs/DynamicAuth/commit/ce94fec80adbb3eb4efcb79d1aa2cc6eb35eab6f))
|
|
127
|
+
* include the appOrigin to every api call to create correct passkey ([#5636](https://github.com/dynamic-labs/DynamicAuth/issues/5636)) ([ee64df3](https://github.com/dynamic-labs/DynamicAuth/commit/ee64df3b90037bd29cca161e601973ef202c58f0))
|
|
128
|
+
* use PromptModal when using the DynamicMultiWalletPromptsWidget for pending connection views ([#5594](https://github.com/dynamic-labs/DynamicAuth/issues/5594)) ([c095b6e](https://github.com/dynamic-labs/DynamicAuth/commit/c095b6e4c974f02cfe632963be92d16bb201dfa5))
|
|
129
|
+
|
|
130
|
+
## [2.1.0-alpha.18](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.17...v2.1.0-alpha.18) (2024-05-15)
|
|
131
|
+
|
|
132
|
+
## [2.1.0-alpha.17](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.16...v2.1.0-alpha.17) (2024-05-15)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
### Features
|
|
136
|
+
|
|
137
|
+
* add coinbaseWalletPreference prop ([#5607](https://github.com/dynamic-labs/DynamicAuth/issues/5607)) ([1ac3b2c](https://github.com/dynamic-labs/DynamicAuth/commit/1ac3b2ce7abb136465f4aa88b045dfb70d99aad7))
|
|
138
|
+
|
|
139
|
+
## [2.1.0-alpha.16](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.15...v2.1.0-alpha.16) (2024-05-14)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
### Features
|
|
143
|
+
|
|
144
|
+
* add client.sdk.error with errors from the webview ([#5520](https://github.com/dynamic-labs/DynamicAuth/issues/5520)) ([a886927](https://github.com/dynamic-labs/DynamicAuth/commit/a8869273bf361c870d6e3cb82a28d9ccec65905b))
|
|
145
|
+
* add setDefaultTabIndex to default the selected wallets tab ([#5593](https://github.com/dynamic-labs/DynamicAuth/issues/5593)) ([6e8ce05](https://github.com/dynamic-labs/DynamicAuth/commit/6e8ce053c4f6f009acc57dac55a8e9c74fbcc73b))
|
|
146
|
+
* add visibility/auth-flow/user-profile to react-native ([#5564](https://github.com/dynamic-labs/DynamicAuth/issues/5564)) ([d93cea8](https://github.com/dynamic-labs/DynamicAuth/commit/d93cea82a123c6ec4d3d594a7dc064f4db2981c2))
|
|
147
|
+
|
|
148
|
+
## [2.1.0-alpha.15](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.14...v2.1.0-alpha.15) (2024-05-13)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
### Bug Fixes
|
|
152
|
+
|
|
153
|
+
* when a pregen is created, primaryWallet is not being setup ([#5584](https://github.com/dynamic-labs/DynamicAuth/issues/5584)) ([de08721](https://github.com/dynamic-labs/DynamicAuth/commit/de0872151e09f91dcbfaf1d043cf830f9df8d799))
|
|
154
|
+
|
|
155
|
+
## [2.1.0-alpha.14](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.13...v2.1.0-alpha.14) (2024-05-09)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
### Features
|
|
159
|
+
|
|
160
|
+
* add useSwitchWallet ([#5575](https://github.com/dynamic-labs/DynamicAuth/issues/5575)) ([d3053d9](https://github.com/dynamic-labs/DynamicAuth/commit/d3053d920110c26ef8052e77bf59e07dedc7c683))
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
### Bug Fixes
|
|
164
|
+
|
|
165
|
+
* linking phantom wallets in mobile ([#5524](https://github.com/dynamic-labs/DynamicAuth/issues/5524)) ([28d90f5](https://github.com/dynamic-labs/DynamicAuth/commit/28d90f5126b9c22535b63a3797cc060ef089fc63))
|
|
166
|
+
* only show farcaster QR code if Social Login is enabled ([#5559](https://github.com/dynamic-labs/DynamicAuth/issues/5559)) ([fa71aaf](https://github.com/dynamic-labs/DynamicAuth/commit/fa71aaf0f80da31d397600b2fd0cbea99b3689a4))
|
|
167
|
+
* remove goerli testnets and add sepolia ([#5565](https://github.com/dynamic-labs/DynamicAuth/issues/5565)) ([888eb03](https://github.com/dynamic-labs/DynamicAuth/commit/888eb031ef6f4dbbdc3015265cce8647d2c720b0))
|
|
168
|
+
|
|
169
|
+
## [2.1.0-alpha.13](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.12...v2.1.0-alpha.13) (2024-05-03)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
### Bug Fixes
|
|
173
|
+
|
|
174
|
+
* ensure Farcaster QR uses useSocialAuth hook ([#5550](https://github.com/dynamic-labs/DynamicAuth/issues/5550)) ([57fcd97](https://github.com/dynamic-labs/DynamicAuth/commit/57fcd97c44e3f52065dcf856acf7bca7b24fabc7))
|
|
175
|
+
|
|
176
|
+
## [2.1.0-alpha.12](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.11...v2.1.0-alpha.12) (2024-05-02)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
### Features
|
|
180
|
+
|
|
181
|
+
* display Farcaster QR code when it is the only login option ([#5514](https://github.com/dynamic-labs/DynamicAuth/issues/5514)) ([7b166d9](https://github.com/dynamic-labs/DynamicAuth/commit/7b166d9a30c581746f0e2edb71c44fc015dc128e))
|
|
182
|
+
|
|
183
|
+
## [2.1.0-alpha.11](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.10...v2.1.0-alpha.11) (2024-05-02)
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
### Features
|
|
187
|
+
|
|
188
|
+
* **GVTY-1050:** add account token balances hook ([#5521](https://github.com/dynamic-labs/DynamicAuth/issues/5521)) ([5a6f937](https://github.com/dynamic-labs/DynamicAuth/commit/5a6f93733019f3b8d5c7a2c7a5537172a1e7eba4))
|
|
189
|
+
* headless reveal embedded wallet key ([#5518](https://github.com/dynamic-labs/DynamicAuth/issues/5518)) ([77c1536](https://github.com/dynamic-labs/DynamicAuth/commit/77c15360b2b28c52cbdeafb3ce8ca7e80dbecf57))
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
### Bug Fixes
|
|
193
|
+
|
|
194
|
+
* fallback to walletconnect for zerion on mobile ([#5536](https://github.com/dynamic-labs/DynamicAuth/issues/5536)) ([f0e5bfe](https://github.com/dynamic-labs/DynamicAuth/commit/f0e5bfea0b2ab271fd4c1475c8ce708ecb1a5926))
|
|
195
|
+
|
|
196
|
+
## [2.1.0-alpha.10](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.9...v2.1.0-alpha.10) (2024-04-30)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
### Features
|
|
200
|
+
|
|
201
|
+
* bump @coinbase/wallet-sdk to latest beta ([#5388](https://github.com/dynamic-labs/DynamicAuth/issues/5388)) ([9225546](https://github.com/dynamic-labs/DynamicAuth/commit/922554630ccf2ef98bc297521309918f922bc671))
|
|
202
|
+
|
|
203
|
+
## [2.1.0-alpha.9](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.8...v2.1.0-alpha.9) (2024-04-30)
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
### Features
|
|
207
|
+
|
|
208
|
+
* headless create embedded wallet with optional passkey data parameter ([#5487](https://github.com/dynamic-labs/DynamicAuth/issues/5487)) ([891c3d7](https://github.com/dynamic-labs/DynamicAuth/commit/891c3d77a02a019140bcb8dd03b62b1afd69710e))
|
|
209
|
+
|
|
210
|
+
## [2.1.0-alpha.8](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.7...v2.1.0-alpha.8) (2024-04-26)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
### Bug Fixes
|
|
214
|
+
|
|
215
|
+
* display wallet tabs when linking a wallet ([#5491](https://github.com/dynamic-labs/DynamicAuth/issues/5491)) ([10fd6b4](https://github.com/dynamic-labs/DynamicAuth/commit/10fd6b4d9aec7596338c50e17f79f6be534cf2c1))
|
|
216
|
+
* ensure zerodev viem client handles eth_accounts call ([#5477](https://github.com/dynamic-labs/DynamicAuth/issues/5477)) ([1132e1e](https://github.com/dynamic-labs/DynamicAuth/commit/1132e1e8655b58e81cb56789453ba56a059f52ec))
|
|
217
|
+
* network with keplr ([#5485](https://github.com/dynamic-labs/DynamicAuth/issues/5485)) ([b86f2fc](https://github.com/dynamic-labs/DynamicAuth/commit/b86f2fce491f9752e80a86643916da9ac7fb9276))
|
|
218
|
+
* refetch nameservice data and display properly ([#5476](https://github.com/dynamic-labs/DynamicAuth/issues/5476)) ([2aee798](https://github.com/dynamic-labs/DynamicAuth/commit/2aee798846f69496201bec7aa52e7ec1f370b7c3))
|
|
219
|
+
* use embeddedWallet create response authToken in embeddedWalletCreated ([#5478](https://github.com/dynamic-labs/DynamicAuth/issues/5478)) ([51772da](https://github.com/dynamic-labs/DynamicAuth/commit/51772daf557a72984c757efd8301e2b510dc37f1))
|
|
220
|
+
|
|
221
|
+
## [2.1.0-alpha.7](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.6...v2.1.0-alpha.7) (2024-04-25)
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
### Bug Fixes
|
|
225
|
+
|
|
226
|
+
* restore embedded wallet session iframe element conflict ([#5474](https://github.com/dynamic-labs/DynamicAuth/issues/5474)) ([c157477](https://github.com/dynamic-labs/DynamicAuth/commit/c157477ea126b3130b13b711796bdd06215e7af1))
|
|
227
|
+
|
|
228
|
+
## [2.1.0-alpha.6](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.5...v2.1.0-alpha.6) (2024-04-24)
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
### Bug Fixes
|
|
232
|
+
|
|
233
|
+
* embedded wallets headless session control fixes ([#5469](https://github.com/dynamic-labs/DynamicAuth/issues/5469)) ([92e6c35](https://github.com/dynamic-labs/DynamicAuth/commit/92e6c359d2710fd4f5f5a6fedc4acf6c4bab78ba))
|
|
234
|
+
|
|
235
|
+
## [2.1.0-alpha.5](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.4...v2.1.0-alpha.5) (2024-04-23)
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
### Bug Fixes
|
|
239
|
+
|
|
240
|
+
* get embedded wallet checking the wrong chain enum ([#5458](https://github.com/dynamic-labs/DynamicAuth/issues/5458)) ([ed1c523](https://github.com/dynamic-labs/DynamicAuth/commit/ed1c523ca14cd4d21c00181ab40802f876c02b80))
|
|
241
|
+
|
|
242
|
+
## [2.1.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.3...v2.1.0-alpha.4) (2024-04-23)
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
### Features
|
|
246
|
+
|
|
247
|
+
* add email and sms to client auth module ([#5436](https://github.com/dynamic-labs/DynamicAuth/issues/5436)) ([5420476](https://github.com/dynamic-labs/DynamicAuth/commit/5420476d1ba38fd4f987f28e9aefbfb3e61ea2bf))
|
|
248
|
+
* headless create passkeys for embedded wallets ([#5395](https://github.com/dynamic-labs/DynamicAuth/issues/5395)) ([0b64099](https://github.com/dynamic-labs/DynamicAuth/commit/0b6409968457f65886248f0a0879e39ec3803fd0))
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
### Bug Fixes
|
|
252
|
+
|
|
253
|
+
* prevent wagmi from reconnect when DynamicContextProvider rerender ([#5446](https://github.com/dynamic-labs/DynamicAuth/issues/5446)) ([33337af](https://github.com/dynamic-labs/DynamicAuth/commit/33337af76786963cb3db7fa7c58c1292c529d0ac))
|
|
254
|
+
|
|
2
255
|
## [2.1.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.2...v2.1.0-alpha.3) (2024-04-23)
|
|
3
256
|
|
|
4
257
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/solana",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.30",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
|
-
"url": "https://github.com/dynamic-labs/
|
|
6
|
+
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
7
7
|
"directory": "packages/solana"
|
|
8
8
|
},
|
|
9
9
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
@@ -27,16 +27,20 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@solana/web3.js": "1.91.6",
|
|
30
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
30
|
+
"@dynamic-labs/sdk-api-core": "0.0.453",
|
|
31
|
+
"@wallet-standard/app": "1.0.1",
|
|
32
|
+
"@wallet-standard/base": "1.0.1",
|
|
33
|
+
"@wallet-standard/features": "1.0.1",
|
|
34
|
+
"@wallet-standard/experimental-features": "0.1.1",
|
|
31
35
|
"bs58": "5.0.0",
|
|
32
36
|
"tweetnacl": "1.0.3",
|
|
33
|
-
"@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.
|
|
34
|
-
"@dynamic-labs/rpc-providers": "2.1.0-alpha.
|
|
35
|
-
"@dynamic-labs/turnkey": "2.1.0-alpha.
|
|
36
|
-
"@dynamic-labs/types": "2.1.0-alpha.
|
|
37
|
-
"@dynamic-labs/utils": "2.1.0-alpha.
|
|
38
|
-
"@dynamic-labs/wallet-book": "2.1.0-alpha.
|
|
39
|
-
"@dynamic-labs/wallet-connector-core": "2.1.0-alpha.
|
|
37
|
+
"@dynamic-labs/rpc-provider-solana": "2.1.0-alpha.30",
|
|
38
|
+
"@dynamic-labs/rpc-providers": "2.1.0-alpha.30",
|
|
39
|
+
"@dynamic-labs/turnkey": "2.1.0-alpha.30",
|
|
40
|
+
"@dynamic-labs/types": "2.1.0-alpha.30",
|
|
41
|
+
"@dynamic-labs/utils": "2.1.0-alpha.30",
|
|
42
|
+
"@dynamic-labs/wallet-book": "2.1.0-alpha.30",
|
|
43
|
+
"@dynamic-labs/wallet-connector-core": "2.1.0-alpha.30",
|
|
40
44
|
"eventemitter3": "5.0.1"
|
|
41
45
|
},
|
|
42
46
|
"peerDependencies": {}
|
package/src/CoinbaseSolana.cjs
CHANGED
|
@@ -12,6 +12,7 @@ require('tweetnacl');
|
|
|
12
12
|
require('bs58');
|
|
13
13
|
require('@solana/web3.js');
|
|
14
14
|
var InjectedWalletBase = require('./injected/InjectedWalletBase.cjs');
|
|
15
|
+
require('./SolanaWalletStandardConnector/SolanaWalletStandardConnector.cjs');
|
|
15
16
|
var isSignedMessage = require('./utils/isSignedMessage.cjs');
|
|
16
17
|
|
|
17
18
|
class CoinbaseSolana extends InjectedWalletBase.InjectedWalletBase {
|
package/src/CoinbaseSolana.js
CHANGED
|
@@ -8,6 +8,7 @@ import 'tweetnacl';
|
|
|
8
8
|
import 'bs58';
|
|
9
9
|
import '@solana/web3.js';
|
|
10
10
|
import { InjectedWalletBase } from './injected/InjectedWalletBase.js';
|
|
11
|
+
import './SolanaWalletStandardConnector/SolanaWalletStandardConnector.js';
|
|
11
12
|
import { isSignedMessage } from './utils/isSignedMessage.js';
|
|
12
13
|
|
|
13
14
|
class CoinbaseSolana extends InjectedWalletBase {
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var _tslib = require('../../_virtual/_tslib.cjs');
|
|
7
|
+
var app = require('@wallet-standard/app');
|
|
8
|
+
var solWalletConnector = require('../solWalletConnector.cjs');
|
|
9
|
+
var createSolanaSignerFromWalletStandard = require('./utils/createSolanaSignerFromWalletStandard/createSolanaSignerFromWalletStandard.cjs');
|
|
10
|
+
|
|
11
|
+
const encoder = new TextEncoder();
|
|
12
|
+
class SolanaWalletStandardConnector extends solWalletConnector.SolWalletConnector {
|
|
13
|
+
constructor(props) {
|
|
14
|
+
super(props);
|
|
15
|
+
this.connectedChain = 'SOL';
|
|
16
|
+
this.supportedChains = ['SOL'];
|
|
17
|
+
}
|
|
18
|
+
get wallet() {
|
|
19
|
+
const walletStandard = SolanaWalletStandardConnector.getWallet(this.walletBook, this.key);
|
|
20
|
+
if (!walletStandard) {
|
|
21
|
+
throw new Error('Wallet not found');
|
|
22
|
+
}
|
|
23
|
+
return walletStandard;
|
|
24
|
+
}
|
|
25
|
+
get walletFeatures() {
|
|
26
|
+
return this.wallet.features;
|
|
27
|
+
}
|
|
28
|
+
connect() {
|
|
29
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
yield this.walletFeatures['standard:connect'].connect();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
endSession() {
|
|
34
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
yield this.walletFeatures['standard:disconnect'].disconnect();
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
isInstalledOnBrowser() {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
getAddress() {
|
|
42
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
yield this.connect();
|
|
44
|
+
const [address] = yield this.getConnectedAccounts();
|
|
45
|
+
return address;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
getConnectedAccounts() {
|
|
49
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const addresses = this.wallet.accounts.map((account) => account.address);
|
|
51
|
+
return addresses;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
signMessage(messageToSign) {
|
|
55
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
const signer = yield this.getSigner();
|
|
57
|
+
if (!signer) {
|
|
58
|
+
throw new Error('Signer not found');
|
|
59
|
+
}
|
|
60
|
+
const message = encoder.encode(messageToSign);
|
|
61
|
+
const signature = yield signer.signMessage(message);
|
|
62
|
+
if (!(signature instanceof Uint8Array)) {
|
|
63
|
+
throw new Error('Signature not found');
|
|
64
|
+
}
|
|
65
|
+
return Buffer.from(signature).toString('base64');
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
getSigner() {
|
|
69
|
+
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const { wallet } = this;
|
|
71
|
+
return createSolanaSignerFromWalletStandard.createSolanaSignerFromWalletStandard(wallet, this);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
static getWallet(walletBook, walletKey) {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
const wallets = app.getWallets().get();
|
|
77
|
+
const injectedConfig = (_a = walletBook.wallets[walletKey].injectedConfig) === null || _a === void 0 ? void 0 : _a.find((config) => config.chain === 'sol');
|
|
78
|
+
if (!injectedConfig)
|
|
79
|
+
return;
|
|
80
|
+
const { features } = (_b = injectedConfig.walletStandard) !== null && _b !== void 0 ? _b : {};
|
|
81
|
+
if (!features)
|
|
82
|
+
return;
|
|
83
|
+
const wallet = wallets.find((wallet) => {
|
|
84
|
+
var _a;
|
|
85
|
+
const isNameMatch = wallet.name === ((_a = injectedConfig.walletStandard) === null || _a === void 0 ? void 0 : _a.name);
|
|
86
|
+
if (!isNameMatch)
|
|
87
|
+
return false;
|
|
88
|
+
const hasFeatures = features.reduce((hasAllFeatures, key) => {
|
|
89
|
+
const walletFeatures = Object.keys(wallet.features);
|
|
90
|
+
if (!hasAllFeatures)
|
|
91
|
+
return false;
|
|
92
|
+
return walletFeatures.includes(key);
|
|
93
|
+
}, true);
|
|
94
|
+
return hasFeatures;
|
|
95
|
+
});
|
|
96
|
+
return wallet;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
exports.SolanaWalletStandardConnector = SolanaWalletStandardConnector;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Wallet } from '@wallet-standard/base';
|
|
2
|
+
import { ConnectFeature, DisconnectFeature } from '@wallet-standard/features';
|
|
3
|
+
import { Chain } from '@dynamic-labs/wallet-connector-core';
|
|
4
|
+
import { WalletBookSchema } from '@dynamic-labs/wallet-book';
|
|
5
|
+
import { SolWalletConnector, SolWalletConnectorOpts } from './../solWalletConnector';
|
|
6
|
+
import { ISolana } from './../types';
|
|
7
|
+
export declare abstract class SolanaWalletStandardConnector extends SolWalletConnector {
|
|
8
|
+
connectedChain: Chain;
|
|
9
|
+
supportedChains: Chain[];
|
|
10
|
+
constructor(props: SolWalletConnectorOpts);
|
|
11
|
+
get wallet(): Wallet;
|
|
12
|
+
get walletFeatures(): ConnectFeature & DisconnectFeature;
|
|
13
|
+
connect(): Promise<void>;
|
|
14
|
+
endSession(): Promise<void>;
|
|
15
|
+
isInstalledOnBrowser(): boolean;
|
|
16
|
+
getAddress(): Promise<string | undefined>;
|
|
17
|
+
getConnectedAccounts(): Promise<string[]>;
|
|
18
|
+
signMessage(messageToSign: string): Promise<string | undefined>;
|
|
19
|
+
getSigner(): Promise<ISolana | undefined>;
|
|
20
|
+
static getWallet(walletBook: WalletBookSchema, walletKey: string): Wallet | undefined;
|
|
21
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../_virtual/_tslib.js';
|
|
3
|
+
import { getWallets } from '@wallet-standard/app';
|
|
4
|
+
import { SolWalletConnector } from '../solWalletConnector.js';
|
|
5
|
+
import { createSolanaSignerFromWalletStandard } from './utils/createSolanaSignerFromWalletStandard/createSolanaSignerFromWalletStandard.js';
|
|
6
|
+
|
|
7
|
+
const encoder = new TextEncoder();
|
|
8
|
+
class SolanaWalletStandardConnector extends SolWalletConnector {
|
|
9
|
+
constructor(props) {
|
|
10
|
+
super(props);
|
|
11
|
+
this.connectedChain = 'SOL';
|
|
12
|
+
this.supportedChains = ['SOL'];
|
|
13
|
+
}
|
|
14
|
+
get wallet() {
|
|
15
|
+
const walletStandard = SolanaWalletStandardConnector.getWallet(this.walletBook, this.key);
|
|
16
|
+
if (!walletStandard) {
|
|
17
|
+
throw new Error('Wallet not found');
|
|
18
|
+
}
|
|
19
|
+
return walletStandard;
|
|
20
|
+
}
|
|
21
|
+
get walletFeatures() {
|
|
22
|
+
return this.wallet.features;
|
|
23
|
+
}
|
|
24
|
+
connect() {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
yield this.walletFeatures['standard:connect'].connect();
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
endSession() {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
yield this.walletFeatures['standard:disconnect'].disconnect();
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
isInstalledOnBrowser() {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
getAddress() {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
yield this.connect();
|
|
40
|
+
const [address] = yield this.getConnectedAccounts();
|
|
41
|
+
return address;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
getConnectedAccounts() {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const addresses = this.wallet.accounts.map((account) => account.address);
|
|
47
|
+
return addresses;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
signMessage(messageToSign) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const signer = yield this.getSigner();
|
|
53
|
+
if (!signer) {
|
|
54
|
+
throw new Error('Signer not found');
|
|
55
|
+
}
|
|
56
|
+
const message = encoder.encode(messageToSign);
|
|
57
|
+
const signature = yield signer.signMessage(message);
|
|
58
|
+
if (!(signature instanceof Uint8Array)) {
|
|
59
|
+
throw new Error('Signature not found');
|
|
60
|
+
}
|
|
61
|
+
return Buffer.from(signature).toString('base64');
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
getSigner() {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const { wallet } = this;
|
|
67
|
+
return createSolanaSignerFromWalletStandard(wallet, this);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
static getWallet(walletBook, walletKey) {
|
|
71
|
+
var _a, _b;
|
|
72
|
+
const wallets = getWallets().get();
|
|
73
|
+
const injectedConfig = (_a = walletBook.wallets[walletKey].injectedConfig) === null || _a === void 0 ? void 0 : _a.find((config) => config.chain === 'sol');
|
|
74
|
+
if (!injectedConfig)
|
|
75
|
+
return;
|
|
76
|
+
const { features } = (_b = injectedConfig.walletStandard) !== null && _b !== void 0 ? _b : {};
|
|
77
|
+
if (!features)
|
|
78
|
+
return;
|
|
79
|
+
const wallet = wallets.find((wallet) => {
|
|
80
|
+
var _a;
|
|
81
|
+
const isNameMatch = wallet.name === ((_a = injectedConfig.walletStandard) === null || _a === void 0 ? void 0 : _a.name);
|
|
82
|
+
if (!isNameMatch)
|
|
83
|
+
return false;
|
|
84
|
+
const hasFeatures = features.reduce((hasAllFeatures, key) => {
|
|
85
|
+
const walletFeatures = Object.keys(wallet.features);
|
|
86
|
+
if (!hasAllFeatures)
|
|
87
|
+
return false;
|
|
88
|
+
return walletFeatures.includes(key);
|
|
89
|
+
}, true);
|
|
90
|
+
return hasFeatures;
|
|
91
|
+
});
|
|
92
|
+
return wallet;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { SolanaWalletStandardConnector };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SolanaWalletStandardConnector } from './SolanaWalletStandardConnector';
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
7
|
+
var web3_js = require('@solana/web3.js');
|
|
8
|
+
var utils = require('../../../phantomRedirect/utils.cjs');
|
|
9
|
+
|
|
10
|
+
const isVersionedTransaction = (transaction) => !('instructions' in transaction);
|
|
11
|
+
const createSolanaSignerFromWalletStandard = (wallet, walletConnector) => {
|
|
12
|
+
const features = wallet.features;
|
|
13
|
+
const getCurrentAccount = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
+
const address = yield walletConnector.getAddress();
|
|
15
|
+
const account = wallet.accounts.find((account) => account.address === address);
|
|
16
|
+
if (!account) {
|
|
17
|
+
throw new Error('Account not found');
|
|
18
|
+
}
|
|
19
|
+
return account;
|
|
20
|
+
});
|
|
21
|
+
const getChain = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
const rpc = (_b = (_a = walletConnector.solNetworks[0].privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : walletConnector.solNetworks[0].rpcUrls[0];
|
|
24
|
+
const cluster = yield utils.fetchCluster(rpc);
|
|
25
|
+
return `solana:${cluster}`;
|
|
26
|
+
});
|
|
27
|
+
const signTransaction = (transaction) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
+
const account = yield getCurrentAccount();
|
|
29
|
+
const signTransactionResult = yield features['solana:signTransaction'].signTransaction({
|
|
30
|
+
account,
|
|
31
|
+
chain: yield getChain(),
|
|
32
|
+
transaction: transaction.serialize({
|
|
33
|
+
requireAllSignatures: false,
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
if (isVersionedTransaction(transaction)) {
|
|
37
|
+
return web3_js.VersionedTransaction.deserialize(signTransactionResult[0].signedTransaction);
|
|
38
|
+
}
|
|
39
|
+
return web3_js.Transaction.from(signTransactionResult[0].signedTransaction);
|
|
40
|
+
});
|
|
41
|
+
const signAllTransactions = (transactions) => _tslib.__awaiter(void 0, void 0, void 0, function* () { return Promise.all(transactions.map(signTransaction)); });
|
|
42
|
+
const signAndSendTransaction = (transaction) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
+
const account = yield getCurrentAccount();
|
|
44
|
+
const signedTransactions = yield features['solana:signAndSendTransaction'].signAndSendTransaction({
|
|
45
|
+
account,
|
|
46
|
+
chain: yield getChain(),
|
|
47
|
+
transaction: transaction.serialize(),
|
|
48
|
+
});
|
|
49
|
+
const [{ signature }] = signedTransactions;
|
|
50
|
+
return { signature: new TextDecoder().decode(signature) };
|
|
51
|
+
});
|
|
52
|
+
const signMessage = (message) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
+
const account = yield getCurrentAccount();
|
|
54
|
+
const messages = yield features['solana:signMessage'].signMessage({
|
|
55
|
+
account,
|
|
56
|
+
message,
|
|
57
|
+
});
|
|
58
|
+
return messages[0].signature;
|
|
59
|
+
});
|
|
60
|
+
return {
|
|
61
|
+
addListener: () => {
|
|
62
|
+
throw new Error('Not implemented');
|
|
63
|
+
},
|
|
64
|
+
connect: () => {
|
|
65
|
+
throw new Error('Not implemented');
|
|
66
|
+
},
|
|
67
|
+
disconnect: () => walletConnector.endSession(),
|
|
68
|
+
emit: () => {
|
|
69
|
+
throw new Error('Not implemented');
|
|
70
|
+
},
|
|
71
|
+
eventNames: () => {
|
|
72
|
+
throw new Error('Not implemented');
|
|
73
|
+
},
|
|
74
|
+
isBackpack: false,
|
|
75
|
+
isBraveWallet: false,
|
|
76
|
+
isConnected: true,
|
|
77
|
+
isExodus: false,
|
|
78
|
+
isGlow: false,
|
|
79
|
+
isMagicEden: false,
|
|
80
|
+
isPhantom: false,
|
|
81
|
+
isSolflare: false,
|
|
82
|
+
listenerCount: () => {
|
|
83
|
+
throw new Error('Not implemented');
|
|
84
|
+
},
|
|
85
|
+
listeners: () => {
|
|
86
|
+
throw new Error('Not implemented');
|
|
87
|
+
},
|
|
88
|
+
off: () => {
|
|
89
|
+
throw new Error('Not implemented');
|
|
90
|
+
},
|
|
91
|
+
on: () => {
|
|
92
|
+
throw new Error('Not implemented');
|
|
93
|
+
},
|
|
94
|
+
once: () => {
|
|
95
|
+
throw new Error('Not implemented');
|
|
96
|
+
},
|
|
97
|
+
providers: [],
|
|
98
|
+
get publicKey() {
|
|
99
|
+
return new web3_js.PublicKey(wallet.accounts[0].publicKey);
|
|
100
|
+
},
|
|
101
|
+
removeAllListeners: () => {
|
|
102
|
+
throw new Error('Not implemented');
|
|
103
|
+
},
|
|
104
|
+
removeListener: () => {
|
|
105
|
+
throw new Error('Not implemented');
|
|
106
|
+
},
|
|
107
|
+
send: () => {
|
|
108
|
+
throw new Error('Not implemented');
|
|
109
|
+
},
|
|
110
|
+
signAllTransactions,
|
|
111
|
+
signAndSendTransaction,
|
|
112
|
+
signMessage,
|
|
113
|
+
signTransaction,
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
exports.createSolanaSignerFromWalletStandard = createSolanaSignerFromWalletStandard;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Wallet } from '@wallet-standard/base';
|
|
2
|
+
import { ISolana } from '../../../types';
|
|
3
|
+
import { SolWalletConnector } from '../../../solWalletConnector';
|
|
4
|
+
export declare const createSolanaSignerFromWalletStandard: (wallet: Wallet, walletConnector: SolWalletConnector) => ISolana;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
3
|
+
import { PublicKey, VersionedTransaction, Transaction } from '@solana/web3.js';
|
|
4
|
+
import { fetchCluster } from '../../../phantomRedirect/utils.js';
|
|
5
|
+
|
|
6
|
+
const isVersionedTransaction = (transaction) => !('instructions' in transaction);
|
|
7
|
+
const createSolanaSignerFromWalletStandard = (wallet, walletConnector) => {
|
|
8
|
+
const features = wallet.features;
|
|
9
|
+
const getCurrentAccount = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
10
|
+
const address = yield walletConnector.getAddress();
|
|
11
|
+
const account = wallet.accounts.find((account) => account.address === address);
|
|
12
|
+
if (!account) {
|
|
13
|
+
throw new Error('Account not found');
|
|
14
|
+
}
|
|
15
|
+
return account;
|
|
16
|
+
});
|
|
17
|
+
const getChain = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
var _a, _b;
|
|
19
|
+
const rpc = (_b = (_a = walletConnector.solNetworks[0].privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : walletConnector.solNetworks[0].rpcUrls[0];
|
|
20
|
+
const cluster = yield fetchCluster(rpc);
|
|
21
|
+
return `solana:${cluster}`;
|
|
22
|
+
});
|
|
23
|
+
const signTransaction = (transaction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
|
+
const account = yield getCurrentAccount();
|
|
25
|
+
const signTransactionResult = yield features['solana:signTransaction'].signTransaction({
|
|
26
|
+
account,
|
|
27
|
+
chain: yield getChain(),
|
|
28
|
+
transaction: transaction.serialize({
|
|
29
|
+
requireAllSignatures: false,
|
|
30
|
+
}),
|
|
31
|
+
});
|
|
32
|
+
if (isVersionedTransaction(transaction)) {
|
|
33
|
+
return VersionedTransaction.deserialize(signTransactionResult[0].signedTransaction);
|
|
34
|
+
}
|
|
35
|
+
return Transaction.from(signTransactionResult[0].signedTransaction);
|
|
36
|
+
});
|
|
37
|
+
const signAllTransactions = (transactions) => __awaiter(void 0, void 0, void 0, function* () { return Promise.all(transactions.map(signTransaction)); });
|
|
38
|
+
const signAndSendTransaction = (transaction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
+
const account = yield getCurrentAccount();
|
|
40
|
+
const signedTransactions = yield features['solana:signAndSendTransaction'].signAndSendTransaction({
|
|
41
|
+
account,
|
|
42
|
+
chain: yield getChain(),
|
|
43
|
+
transaction: transaction.serialize(),
|
|
44
|
+
});
|
|
45
|
+
const [{ signature }] = signedTransactions;
|
|
46
|
+
return { signature: new TextDecoder().decode(signature) };
|
|
47
|
+
});
|
|
48
|
+
const signMessage = (message) => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
+
const account = yield getCurrentAccount();
|
|
50
|
+
const messages = yield features['solana:signMessage'].signMessage({
|
|
51
|
+
account,
|
|
52
|
+
message,
|
|
53
|
+
});
|
|
54
|
+
return messages[0].signature;
|
|
55
|
+
});
|
|
56
|
+
return {
|
|
57
|
+
addListener: () => {
|
|
58
|
+
throw new Error('Not implemented');
|
|
59
|
+
},
|
|
60
|
+
connect: () => {
|
|
61
|
+
throw new Error('Not implemented');
|
|
62
|
+
},
|
|
63
|
+
disconnect: () => walletConnector.endSession(),
|
|
64
|
+
emit: () => {
|
|
65
|
+
throw new Error('Not implemented');
|
|
66
|
+
},
|
|
67
|
+
eventNames: () => {
|
|
68
|
+
throw new Error('Not implemented');
|
|
69
|
+
},
|
|
70
|
+
isBackpack: false,
|
|
71
|
+
isBraveWallet: false,
|
|
72
|
+
isConnected: true,
|
|
73
|
+
isExodus: false,
|
|
74
|
+
isGlow: false,
|
|
75
|
+
isMagicEden: false,
|
|
76
|
+
isPhantom: false,
|
|
77
|
+
isSolflare: false,
|
|
78
|
+
listenerCount: () => {
|
|
79
|
+
throw new Error('Not implemented');
|
|
80
|
+
},
|
|
81
|
+
listeners: () => {
|
|
82
|
+
throw new Error('Not implemented');
|
|
83
|
+
},
|
|
84
|
+
off: () => {
|
|
85
|
+
throw new Error('Not implemented');
|
|
86
|
+
},
|
|
87
|
+
on: () => {
|
|
88
|
+
throw new Error('Not implemented');
|
|
89
|
+
},
|
|
90
|
+
once: () => {
|
|
91
|
+
throw new Error('Not implemented');
|
|
92
|
+
},
|
|
93
|
+
providers: [],
|
|
94
|
+
get publicKey() {
|
|
95
|
+
return new PublicKey(wallet.accounts[0].publicKey);
|
|
96
|
+
},
|
|
97
|
+
removeAllListeners: () => {
|
|
98
|
+
throw new Error('Not implemented');
|
|
99
|
+
},
|
|
100
|
+
removeListener: () => {
|
|
101
|
+
throw new Error('Not implemented');
|
|
102
|
+
},
|
|
103
|
+
send: () => {
|
|
104
|
+
throw new Error('Not implemented');
|
|
105
|
+
},
|
|
106
|
+
signAllTransactions,
|
|
107
|
+
signAndSendTransaction,
|
|
108
|
+
signMessage,
|
|
109
|
+
signTransaction,
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export { createSolanaSignerFromWalletStandard };
|
package/src/SolanaWalletStandardConnector/utils/createSolanaSignerFromWalletStandard/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createSolanaSignerFromWalletStandard } from './createSolanaSignerFromWalletStandard';
|
package/src/index.cjs
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var turnkey = require('@dynamic-labs/turnkey');
|
|
7
7
|
var Phantom = require('./Phantom.cjs');
|
|
8
8
|
var fetchInjectedWalletConnectors = require('./injected/fetchInjectedWalletConnectors.cjs');
|
|
9
|
+
var UnknownInjected = require('./injected/UnknownInjected.cjs');
|
|
9
10
|
var isSignedMessage = require('./utils/isSignedMessage.cjs');
|
|
10
11
|
var isBackpackSolanaSigner = require('./utils/isBackpackSolanaSigner.cjs');
|
|
11
12
|
|
|
@@ -15,6 +16,7 @@ const SolanaWalletConnectors = (props) => [
|
|
|
15
16
|
...fetchInjectedWalletConnectors.fetchInjectedWalletConnectors(props),
|
|
16
17
|
...turnkey.TurnkeySolanaWalletConnectors(props),
|
|
17
18
|
Phantom.Phantom,
|
|
19
|
+
UnknownInjected.UnknownInjected,
|
|
18
20
|
];
|
|
19
21
|
|
|
20
22
|
exports.isSignedMessage = isSignedMessage.isSignedMessage;
|
package/src/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { TurnkeySolanaWalletConnectors } from '@dynamic-labs/turnkey';
|
|
3
3
|
import { Phantom } from './Phantom.js';
|
|
4
4
|
import { injectedWalletOverrides, fetchInjectedWalletConnectors } from './injected/fetchInjectedWalletConnectors.js';
|
|
5
|
+
import { UnknownInjected } from './injected/UnknownInjected.js';
|
|
5
6
|
export { isSignedMessage } from './utils/isSignedMessage.js';
|
|
6
7
|
export { isBackpackSolanaSigner } from './utils/isBackpackSolanaSigner.js';
|
|
7
8
|
|
|
@@ -11,6 +12,7 @@ const SolanaWalletConnectors = (props) => [
|
|
|
11
12
|
...fetchInjectedWalletConnectors(props),
|
|
12
13
|
...TurnkeySolanaWalletConnectors(props),
|
|
13
14
|
Phantom,
|
|
15
|
+
UnknownInjected,
|
|
14
16
|
];
|
|
15
17
|
|
|
16
18
|
export { SolanaWalletConnectors };
|
|
@@ -11,7 +11,7 @@ var InjectedWalletBase = require('./InjectedWalletBase.cjs');
|
|
|
11
11
|
class BackpackSol extends InjectedWalletBase.InjectedWalletBase {
|
|
12
12
|
constructor(opts) {
|
|
13
13
|
super(opts);
|
|
14
|
-
this.name = '
|
|
14
|
+
this.name = 'Backpack';
|
|
15
15
|
this.overrideKey = 'backpacksol';
|
|
16
16
|
this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
17
17
|
}
|
|
@@ -7,7 +7,7 @@ import { InjectedWalletBase } from './InjectedWalletBase.js';
|
|
|
7
7
|
class BackpackSol extends InjectedWalletBase {
|
|
8
8
|
constructor(opts) {
|
|
9
9
|
super(opts);
|
|
10
|
-
this.name = '
|
|
10
|
+
this.name = 'Backpack';
|
|
11
11
|
this.overrideKey = 'backpacksol';
|
|
12
12
|
this.wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
13
13
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
|
+
var InjectedWalletBase = require('./InjectedWalletBase.cjs');
|
|
8
|
+
|
|
9
|
+
class UnknownInjected extends InjectedWalletBase.InjectedWalletBase {
|
|
10
|
+
constructor(opts) {
|
|
11
|
+
super(opts);
|
|
12
|
+
this.name = 'Unknown';
|
|
13
|
+
this.overrideKey = 'unknown';
|
|
14
|
+
this.wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
|
|
15
|
+
}
|
|
16
|
+
isInstalledOnBrowser() {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
exports.UnknownInjected = UnknownInjected;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SolWalletConnectorOpts } from '../solWalletConnector';
|
|
2
|
+
import { InjectedWalletBase } from './InjectedWalletBase';
|
|
3
|
+
export declare class UnknownInjected extends InjectedWalletBase {
|
|
4
|
+
name: string;
|
|
5
|
+
overrideKey: string;
|
|
6
|
+
constructor(opts: SolWalletConnectorOpts);
|
|
7
|
+
isInstalledOnBrowser(): boolean;
|
|
8
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
|
|
3
|
+
import { InjectedWalletBase } from './InjectedWalletBase.js';
|
|
4
|
+
|
|
5
|
+
class UnknownInjected extends InjectedWalletBase {
|
|
6
|
+
constructor(opts) {
|
|
7
|
+
super(opts);
|
|
8
|
+
this.name = 'Unknown';
|
|
9
|
+
this.overrideKey = 'unknown';
|
|
10
|
+
this.wallet = findWalletBookWallet(this.walletBook, this.key);
|
|
11
|
+
}
|
|
12
|
+
isInstalledOnBrowser() {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { UnknownInjected };
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var CoinbaseSolana = require('../CoinbaseSolana.cjs');
|
|
7
7
|
var Solflare = require('../Solflare.cjs');
|
|
8
|
+
var SolanaWalletStandardConnector = require('../SolanaWalletStandardConnector/SolanaWalletStandardConnector.cjs');
|
|
8
9
|
var InjectedWalletBase = require('./InjectedWalletBase.cjs');
|
|
9
10
|
var BackpackSol = require('./BackpackSol.cjs');
|
|
10
11
|
|
|
@@ -25,12 +26,27 @@ const fetchInjectedWalletConnectors = ({ walletBook, }) => {
|
|
|
25
26
|
return Object.entries((_a = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _a !== void 0 ? _a : {})
|
|
26
27
|
.filter(([key, wallet]) => {
|
|
27
28
|
var _a;
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
const isSolanaWallet = Boolean((_a = wallet.injectedConfig) === null || _a === void 0 ? void 0 : _a.find((config) => config.chain === 'sol'));
|
|
30
|
+
const shouldBeFiltered = filteredInjectedWalletKeysOverrides.includes(key);
|
|
31
|
+
return isSolanaWallet && !shouldBeFiltered;
|
|
30
32
|
})
|
|
31
33
|
.map(([key, wallet]) => {
|
|
34
|
+
var _a;
|
|
32
35
|
const { shortName } = wallet;
|
|
33
36
|
const name = shortName || wallet.name;
|
|
37
|
+
const hasWalletStandard = Boolean((_a = wallet.injectedConfig) === null || _a === void 0 ? void 0 : _a.find((config) => config.walletStandard));
|
|
38
|
+
if (hasWalletStandard) {
|
|
39
|
+
const isWalletStandardPresent = Boolean(SolanaWalletStandardConnector.SolanaWalletStandardConnector.getWallet(walletBook, key));
|
|
40
|
+
if (isWalletStandardPresent) {
|
|
41
|
+
return class extends SolanaWalletStandardConnector.SolanaWalletStandardConnector {
|
|
42
|
+
constructor(props) {
|
|
43
|
+
super(Object.assign({}, props));
|
|
44
|
+
this.name = name;
|
|
45
|
+
this.overrideKey = key;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
34
50
|
return class extends InjectedWalletBase.InjectedWalletBase {
|
|
35
51
|
constructor(props) {
|
|
36
52
|
super(Object.assign({}, props));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { CoinbaseSolana } from '../CoinbaseSolana.js';
|
|
3
3
|
import { Solflare } from '../Solflare.js';
|
|
4
|
+
import { SolanaWalletStandardConnector } from '../SolanaWalletStandardConnector/SolanaWalletStandardConnector.js';
|
|
4
5
|
import { InjectedWalletBase } from './InjectedWalletBase.js';
|
|
5
6
|
import { BackpackSol } from './BackpackSol.js';
|
|
6
7
|
|
|
@@ -21,12 +22,27 @@ const fetchInjectedWalletConnectors = ({ walletBook, }) => {
|
|
|
21
22
|
return Object.entries((_a = walletBook === null || walletBook === void 0 ? void 0 : walletBook.wallets) !== null && _a !== void 0 ? _a : {})
|
|
22
23
|
.filter(([key, wallet]) => {
|
|
23
24
|
var _a;
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
const isSolanaWallet = Boolean((_a = wallet.injectedConfig) === null || _a === void 0 ? void 0 : _a.find((config) => config.chain === 'sol'));
|
|
26
|
+
const shouldBeFiltered = filteredInjectedWalletKeysOverrides.includes(key);
|
|
27
|
+
return isSolanaWallet && !shouldBeFiltered;
|
|
26
28
|
})
|
|
27
29
|
.map(([key, wallet]) => {
|
|
30
|
+
var _a;
|
|
28
31
|
const { shortName } = wallet;
|
|
29
32
|
const name = shortName || wallet.name;
|
|
33
|
+
const hasWalletStandard = Boolean((_a = wallet.injectedConfig) === null || _a === void 0 ? void 0 : _a.find((config) => config.walletStandard));
|
|
34
|
+
if (hasWalletStandard) {
|
|
35
|
+
const isWalletStandardPresent = Boolean(SolanaWalletStandardConnector.getWallet(walletBook, key));
|
|
36
|
+
if (isWalletStandardPresent) {
|
|
37
|
+
return class extends SolanaWalletStandardConnector {
|
|
38
|
+
constructor(props) {
|
|
39
|
+
super(Object.assign({}, props));
|
|
40
|
+
this.name = name;
|
|
41
|
+
this.overrideKey = key;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
30
46
|
return class extends InjectedWalletBase {
|
|
31
47
|
constructor(props) {
|
|
32
48
|
super(Object.assign({}, props));
|
package/src/injected/index.d.ts
CHANGED