@dynamic-labs/bitcoin 3.0.0-alpha.4 → 3.0.0-alpha.40

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +371 -0
  2. package/package.json +5 -5
  3. package/src/BitcoinLocalStorageCache.cjs +0 -16
  4. package/src/BitcoinLocalStorageCache.d.ts +0 -7
  5. package/src/BitcoinLocalStorageCache.js +0 -16
  6. package/src/bitcoinProviderHelper.d.ts +4 -0
  7. package/src/connectors/BitcoinSatsConnectConnector/BitcoinSatsConnectConnector.cjs +14 -11
  8. package/src/connectors/BitcoinSatsConnectConnector/BitcoinSatsConnectConnector.d.ts +0 -1
  9. package/src/connectors/BitcoinSatsConnectConnector/BitcoinSatsConnectConnector.js +14 -11
  10. package/src/connectors/BitcoinWalletConnector.cjs +32 -23
  11. package/src/connectors/BitcoinWalletConnector.d.ts +4 -1
  12. package/src/connectors/BitcoinWalletConnector.js +33 -24
  13. package/src/connectors/FallbackBitcoinConnector/FallbackBitcoinConnector.cjs +37 -0
  14. package/src/connectors/FallbackBitcoinConnector/FallbackBitcoinConnector.d.ts +11 -0
  15. package/src/connectors/FallbackBitcoinConnector/FallbackBitcoinConnector.js +33 -0
  16. package/src/connectors/FallbackBitcoinConnector/index.d.ts +1 -0
  17. package/src/connectors/OkxConnector/OkxConnector.cjs +2 -2
  18. package/src/connectors/OkxConnector/OkxConnector.d.ts +0 -1
  19. package/src/connectors/OkxConnector/OkxConnector.js +2 -2
  20. package/src/connectors/PhantomConnector/PhantomConnector.cjs +1 -2
  21. package/src/connectors/PhantomConnector/PhantomConnector.d.ts +0 -1
  22. package/src/connectors/PhantomConnector/PhantomConnector.js +1 -2
  23. package/src/connectors/UnisatConnector/UnisatConnector.cjs +9 -1
  24. package/src/connectors/UnisatConnector/UnisatConnector.d.ts +1 -1
  25. package/src/connectors/UnisatConnector/UnisatConnector.js +9 -1
  26. package/src/connectors/UnknownInjected/UnknownInjected.cjs +0 -1
  27. package/src/connectors/UnknownInjected/UnknownInjected.d.ts +0 -1
  28. package/src/connectors/UnknownInjected/UnknownInjected.js +0 -1
  29. package/src/connectors/index.d.ts +1 -0
  30. package/src/index.cjs +3 -1
  31. package/src/index.js +3 -1
  32. package/src/utils/fetchSatsConnectConnectors/fetchSatsConnectConnectors.cjs +1 -1
  33. package/src/utils/fetchSatsConnectConnectors/fetchSatsConnectConnectors.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,4 +1,375 @@
1
1
 
2
+ ## [3.0.0-alpha.40](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.39...v3.0.0-alpha.40) (2024-08-13)
3
+
4
+
5
+ ### Features
6
+
7
+ * add log out button to mfa screens ([#6557](https://github.com/dynamic-labs/DynamicAuth/issues/6557)) ([a006f6a](https://github.com/dynamic-labs/DynamicAuth/commit/a006f6a3f801a93d305fbd8151a51c7b08b73983))
8
+ * signIn/link using dynamicOauthState ([#6523](https://github.com/dynamic-labs/DynamicAuth/issues/6523)) ([b72e98f](https://github.com/dynamic-labs/DynamicAuth/commit/b72e98f0d243591c1a8ca14c3a4a6e5024560141))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * clicking back on MFA verification view should take you to MFA secure device view ([#6556](https://github.com/dynamic-labs/DynamicAuth/issues/6556)) ([7ae39c9](https://github.com/dynamic-labs/DynamicAuth/commit/7ae39c9b073b42a14d3e77fba28217905a1dbf0c))
14
+ * mfa design feedback ([#6551](https://github.com/dynamic-labs/DynamicAuth/issues/6551)) ([c367e38](https://github.com/dynamic-labs/DynamicAuth/commit/c367e3836e331a2dc24496ea81436b6bd57460a1))
15
+ * remove 2 factor authenticator header unless there is an applicable security option available ([#6545](https://github.com/dynamic-labs/DynamicAuth/issues/6545)) ([11f7f5a](https://github.com/dynamic-labs/DynamicAuth/commit/11f7f5ae87bf26be783c353607b39943e4a2b796))
16
+
17
+ ## [3.0.0-alpha.39](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.38...v3.0.0-alpha.39) (2024-08-09)
18
+
19
+
20
+ ### Features
21
+
22
+ * add MFA settings ([e5a5755](https://github.com/dynamic-labs/DynamicAuth/commit/e5a5755a6349d3076c0e4fb8bab0853784bef9cc))
23
+
24
+ ## [3.0.0-alpha.38](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.37...v3.0.0-alpha.38) (2024-08-09)
25
+
26
+
27
+ ### Features
28
+
29
+ * add dynamic footer options switcher ([#6528](https://github.com/dynamic-labs/DynamicAuth/issues/6528)) ([7d8a7ff](https://github.com/dynamic-labs/DynamicAuth/commit/7d8a7ff5c7d07e3ac2a916bd8b37e87e7cbfdaa2))
30
+
31
+
32
+ ### Bug Fixes
33
+
34
+ * hcaptcha for mobile login ([#6525](https://github.com/dynamic-labs/DynamicAuth/issues/6525)) ([146888e](https://github.com/dynamic-labs/DynamicAuth/commit/146888e91add7f3be3ed4defafc038107648c20a))
35
+
36
+ ## [3.0.0-alpha.37](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.36...v3.0.0-alpha.37) (2024-08-08)
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * normalize wallet address before comparing on wallet sync ([#6514](https://github.com/dynamic-labs/DynamicAuth/issues/6514)) ([49d9dcf](https://github.com/dynamic-labs/DynamicAuth/commit/49d9dcf300b360f46ac6618756f6741fffce47a7))
42
+
43
+ ## [3.0.0-alpha.36](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.35...v3.0.0-alpha.36) (2024-08-06)
44
+
45
+
46
+ ### Bug Fixes
47
+
48
+ * emb wallet export with silent signing ([#6493](https://github.com/dynamic-labs/DynamicAuth/issues/6493)) ([af69c3a](https://github.com/dynamic-labs/DynamicAuth/commit/af69c3a85d8c1db6a0bf9b42c1310bf3183f9360))
49
+ * use correct redirect url override when connecting with social ([#6502](https://github.com/dynamic-labs/DynamicAuth/issues/6502)) ([e27a0de](https://github.com/dynamic-labs/DynamicAuth/commit/e27a0ded2ad2d95b80a2ad354accaf57f5228691))
50
+ * wagmi account sync issues when switching wallets ([#6441](https://github.com/dynamic-labs/DynamicAuth/issues/6441)) ([4536f88](https://github.com/dynamic-labs/DynamicAuth/commit/4536f88d41bf4a30cf114e8cd7efd7a211c00889))
51
+
52
+ ## [3.0.0-alpha.35](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.34...v3.0.0-alpha.35) (2024-08-06)
53
+
54
+
55
+ ### Bug Fixes
56
+
57
+ * allow mfa sync to rerun after logout ([#6503](https://github.com/dynamic-labs/DynamicAuth/issues/6503)) ([74377e8](https://github.com/dynamic-labs/DynamicAuth/commit/74377e844a84da422173289a10561eb7acf4f8b9))
58
+
59
+ ## [3.0.0-alpha.34](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.33...v3.0.0-alpha.34) (2024-08-02)
60
+
61
+ ## [3.0.0-alpha.33](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.32...v3.0.0-alpha.33) (2024-08-02)
62
+
63
+
64
+ ### Features
65
+
66
+ * add async handler for mfa enrollment and completion ([#6481](https://github.com/dynamic-labs/DynamicAuth/issues/6481)) ([63ce10d](https://github.com/dynamic-labs/DynamicAuth/commit/63ce10dd9f9aa58f43411455d6bbeb2f440ddcac))
67
+
68
+ ## [3.0.0-alpha.32](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.31...v3.0.0-alpha.32) (2024-07-30)
69
+
70
+
71
+ ### Bug Fixes
72
+
73
+ * react native flicker when redirecting back from farcaster ([#6338](https://github.com/dynamic-labs/DynamicAuth/issues/6338)) ([6ab8464](https://github.com/dynamic-labs/DynamicAuth/commit/6ab846476f7961564445223dd12a552ed4c0f0c8))
74
+ * stop unnecessary phantom btc popup when disconnecting - Revert ([#6439](https://github.com/dynamic-labs/DynamicAuth/issues/6439)) ([79ba97d](https://github.com/dynamic-labs/DynamicAuth/commit/79ba97d82c4eb89f0118a925e4dc899853e04550)), closes [#6188](https://github.com/dynamic-labs/DynamicAuth/issues/6188)
75
+
76
+ ## [3.0.0-alpha.31](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.30...v3.0.0-alpha.31) (2024-07-27)
77
+
78
+ ## [3.0.0-alpha.30](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.29...v3.0.0-alpha.30) (2024-07-27)
79
+
80
+
81
+ ### Bug Fixes
82
+
83
+ * don't filter out bitcoin.com when searching for bitcoin ([#6408](https://github.com/dynamic-labs/DynamicAuth/issues/6408)) ([6af5456](https://github.com/dynamic-labs/DynamicAuth/commit/6af54567faa430660b2443638adc103e829eb49d))
84
+ * improve metamask starknet snap network polling interval management ([#6424](https://github.com/dynamic-labs/DynamicAuth/issues/6424)) ([22c4376](https://github.com/dynamic-labs/DynamicAuth/commit/22c4376596d5e07d1da30190baf159c43a8956c6))
85
+ * isCookieEnabled should check externalAuth.cookieName ([#6433](https://github.com/dynamic-labs/DynamicAuth/issues/6433)) ([91d95e5](https://github.com/dynamic-labs/DynamicAuth/commit/91d95e5664f70c2eb306082419d6fece9753f220))
86
+ * phantom ledger works on safari ([#6428](https://github.com/dynamic-labs/DynamicAuth/issues/6428)) ([a8a81f6](https://github.com/dynamic-labs/DynamicAuth/commit/a8a81f6fd4d8ae5ba04525ef6ff6a84a1732a03a))
87
+
88
+ ## [3.0.0-alpha.29](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.28...v3.0.0-alpha.29) (2024-07-25)
89
+
90
+
91
+ ### Features
92
+
93
+ * add link to starknet snap companion app in network switch modal ([#6417](https://github.com/dynamic-labs/DynamicAuth/issues/6417)) ([132a3f8](https://github.com/dynamic-labs/DynamicAuth/commit/132a3f84af62930583f042f35e9616bc837ee49d))
94
+
95
+
96
+ ### Bug Fixes
97
+
98
+ * improve network switch ux for starknet snap on login ([#6376](https://github.com/dynamic-labs/DynamicAuth/issues/6376)) ([db4af65](https://github.com/dynamic-labs/DynamicAuth/commit/db4af6576dc164876750ad6e13f4624d8a11a1a3))
99
+
100
+ ## [3.0.0-alpha.28](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.27...v3.0.0-alpha.28) (2024-07-25)
101
+
102
+ ## [3.0.0-alpha.27](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.26...v3.0.0-alpha.27) (2024-07-24)
103
+
104
+
105
+ ### Features
106
+
107
+ * add ability to use a different ecdsa validator ([#6407](https://github.com/dynamic-labs/DynamicAuth/issues/6407)) ([a3e99e1](https://github.com/dynamic-labs/DynamicAuth/commit/a3e99e1b2cdcadbce35ff0cacfb8fb82778c0216))
108
+
109
+ ## [3.0.0-alpha.26](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.25...v3.0.0-alpha.26) (2024-07-24)
110
+
111
+ ## [3.0.0-alpha.25](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.24...v3.0.0-alpha.25) (2024-07-24)
112
+
113
+
114
+ ### Features
115
+
116
+ * add ability to specify mobileExperience on a wallet by wallet ([#6195](https://github.com/dynamic-labs/DynamicAuth/issues/6195)) ([947fd0a](https://github.com/dynamic-labs/DynamicAuth/commit/947fd0ab864d1995a1ef35a51c77a585649fd43f))
117
+ * global wallet new package ([#6385](https://github.com/dynamic-labs/DynamicAuth/issues/6385)) ([230a0f3](https://github.com/dynamic-labs/DynamicAuth/commit/230a0f380c2bc8c69619daed0c7f3280da8b8bb9))
118
+ * solana send balance modal for injected ([#6405](https://github.com/dynamic-labs/DynamicAuth/issues/6405)) ([b8aa84b](https://github.com/dynamic-labs/DynamicAuth/commit/b8aa84b58eb71791405bf68b6c46c40bebb170f8))
119
+
120
+ ## [3.0.0-alpha.24](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.23...v3.0.0-alpha.24) (2024-07-20)
121
+
122
+ ## [3.0.0-alpha.23](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.22...v3.0.0-alpha.23) (2024-07-19)
123
+
124
+
125
+ ### Features
126
+
127
+ * show custom labels in the sdk ([#6352](https://github.com/dynamic-labs/DynamicAuth/issues/6352)) ([6eec9b2](https://github.com/dynamic-labs/DynamicAuth/commit/6eec9b26dbfd25c5138378aa92de8379a5cd0ddc))
128
+
129
+
130
+ ### Bug Fixes
131
+
132
+ * add missing await to viem controller ([#6354](https://github.com/dynamic-labs/DynamicAuth/issues/6354)) ([32c7362](https://github.com/dynamic-labs/DynamicAuth/commit/32c73625c5575f9134edd541c7221aba08a741b5))
133
+ * allow for react-native 0.74.x ([#6371](https://github.com/dynamic-labs/DynamicAuth/issues/6371)) ([37e08b6](https://github.com/dynamic-labs/DynamicAuth/commit/37e08b6b32bcaef7b7f6a4dedc45b2321f3f64a6))
134
+ * not able to switch to secondary wallet ([#6373](https://github.com/dynamic-labs/DynamicAuth/issues/6373)) ([f85ed10](https://github.com/dynamic-labs/DynamicAuth/commit/f85ed10aca8bf41658eb1418cd87e1c5061d4b1b))
135
+
136
+ ## [3.0.0-alpha.22](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.21...v3.0.0-alpha.22) (2024-07-18)
137
+
138
+
139
+ ### Features
140
+
141
+ * add support for aa kernel 3.1 ([#6333](https://github.com/dynamic-labs/DynamicAuth/issues/6333)) ([93c743a](https://github.com/dynamic-labs/DynamicAuth/commit/93c743a74d1af79f15baec343d15212a2feeac39))
142
+
143
+
144
+ ### Bug Fixes
145
+
146
+ * ensure retryableFn props are passed through ([#6357](https://github.com/dynamic-labs/DynamicAuth/issues/6357)) ([246da78](https://github.com/dynamic-labs/DynamicAuth/commit/246da78ebaa0e623843d93fc990d8a0f3298af54))
147
+ * removes wallet connect qr code from magic eden ([#6360](https://github.com/dynamic-labs/DynamicAuth/issues/6360)) ([5968c2e](https://github.com/dynamic-labs/DynamicAuth/commit/5968c2e220f98b0995a2067e6f5397f27da4dfb0))
148
+
149
+ ## [3.0.0-alpha.21](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.20...v3.0.0-alpha.21) (2024-07-17)
150
+
151
+
152
+ ### Bug Fixes
153
+
154
+ * invalid email error appears ([#6348](https://github.com/dynamic-labs/DynamicAuth/issues/6348)) ([01bcfd2](https://github.com/dynamic-labs/DynamicAuth/commit/01bcfd2f3cc37083c47c0f26e3398f974f6b6a17))
155
+ * stop unnecessary phantom btc popup when disconnecting ([#6188](https://github.com/dynamic-labs/DynamicAuth/issues/6188)) ([15c2eb5](https://github.com/dynamic-labs/DynamicAuth/commit/15c2eb5da90be93ab917e7c61a873a0e9a568211))
156
+
157
+ ## [3.0.0-alpha.20](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.19...v3.0.0-alpha.20) (2024-07-15)
158
+
159
+
160
+ ### Bug Fixes
161
+
162
+ * show/hide confirmation ui for aa session key wallets ([#6334](https://github.com/dynamic-labs/DynamicAuth/issues/6334)) ([6e17162](https://github.com/dynamic-labs/DynamicAuth/commit/6e17162e31915620b622f3ec5b4f8b7087f1728c))
163
+
164
+ ## [3.0.0-alpha.19](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.18...v3.0.0-alpha.19) (2024-07-13)
165
+
166
+ ## [3.0.0-alpha.18](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.17...v3.0.0-alpha.18) (2024-07-12)
167
+
168
+
169
+ ### Bug Fixes
170
+
171
+ * hide confirmation ui triggers passkey creation ([#6322](https://github.com/dynamic-labs/DynamicAuth/issues/6322)) ([c66f282](https://github.com/dynamic-labs/DynamicAuth/commit/c66f282cf8d64f19d7f5a7355aaaec980afbe245))
172
+
173
+ ## [3.0.0-alpha.17](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.16...v3.0.0-alpha.17) (2024-07-11)
174
+
175
+
176
+ ### Features
177
+
178
+ * add new hook to select wallet option to connect ([#6301](https://github.com/dynamic-labs/DynamicAuth/issues/6301)) ([833d71d](https://github.com/dynamic-labs/DynamicAuth/commit/833d71de164c57bfa22898c3425641a83a12e135))
179
+
180
+
181
+ ### Bug Fixes
182
+
183
+ * refresh session keys correctly for solana embedded wallets ([#6309](https://github.com/dynamic-labs/DynamicAuth/issues/6309)) ([4b28e8a](https://github.com/dynamic-labs/DynamicAuth/commit/4b28e8ae231567754b6cfd07a7d41e86f1c73daa))
184
+
185
+ ## [3.0.0-alpha.16](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.15...v3.0.0-alpha.16) (2024-07-11)
186
+
187
+
188
+ ### ⚠ BREAKING CHANGES
189
+
190
+ * remove isConnected prop from wallets and have it as a method instead (#6265)
191
+
192
+ ### Features
193
+
194
+ * add bundlerRpc and paymasterRpc parameters to zerodev ([#6304](https://github.com/dynamic-labs/DynamicAuth/issues/6304)) ([156469b](https://github.com/dynamic-labs/DynamicAuth/commit/156469bf703f0c7fa455a24b8e4e328d3a0c58fc))
195
+
196
+
197
+ ### Bug Fixes
198
+
199
+ * headless embedded wallet export session refresh ([#6307](https://github.com/dynamic-labs/DynamicAuth/issues/6307)) ([5423cc1](https://github.com/dynamic-labs/DynamicAuth/commit/5423cc14c370968acf718b7deff6ea8df9228189))
200
+
201
+
202
+ * remove isConnected prop from wallets and have it as a method instead ([#6265](https://github.com/dynamic-labs/DynamicAuth/issues/6265)) ([652dcc2](https://github.com/dynamic-labs/DynamicAuth/commit/652dcc2d34c9a9719238606c67f600e40621183b))
203
+
204
+ ## [3.0.0-alpha.15](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.14...v3.0.0-alpha.15) (2024-07-11)
205
+
206
+
207
+ ### Bug Fixes
208
+
209
+ * catch third party wallet construction errors ([#6268](https://github.com/dynamic-labs/DynamicAuth/issues/6268)) ([badef39](https://github.com/dynamic-labs/DynamicAuth/commit/badef39d753c7d29925c6c8680053027bd99b69b))
210
+ * decode all solana transactions ([#6294](https://github.com/dynamic-labs/DynamicAuth/issues/6294)) ([5220ab2](https://github.com/dynamic-labs/DynamicAuth/commit/5220ab29381f3a7f1afc7043332b5a018b47eb0a))
211
+ * passkey cta ([#6255](https://github.com/dynamic-labs/DynamicAuth/issues/6255)) ([1b1b152](https://github.com/dynamic-labs/DynamicAuth/commit/1b1b152a24b409c5d941a9c92a003daf0bbe48a1))
212
+
213
+ ## [3.0.0-alpha.14](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.13...v3.0.0-alpha.14) (2024-07-09)
214
+
215
+
216
+ ### ⚠ BREAKING CHANGES
217
+
218
+ * remove setPrimaryWallet in favor of useSwitchWallet (#6212)
219
+ * move getBalance method to wallet so it can be fetched for any wallet not just the active one (#6200)
220
+ * make Wallet a class instead of just a type (#6094)
221
+
222
+ ### Features
223
+
224
+ * add @dynamic-labs/solana-extension ([#6140](https://github.com/dynamic-labs/DynamicAuth/issues/6140)) ([c0e2a06](https://github.com/dynamic-labs/DynamicAuth/commit/c0e2a067dd83163094b58a15696df8654da47c65))
225
+ * add solana support for multi-asset ([#6222](https://github.com/dynamic-labs/DynamicAuth/issues/6222)) ([9660d79](https://github.com/dynamic-labs/DynamicAuth/commit/9660d7962f1fb01011d68397bb367fdfc5335ca9))
226
+
227
+
228
+ ### Bug Fixes
229
+
230
+ * allow closing re-connect wallet modal ([#6250](https://github.com/dynamic-labs/DynamicAuth/issues/6250)) ([55ba25b](https://github.com/dynamic-labs/DynamicAuth/commit/55ba25bd3e907629aaa26e788885bfa38f8fe350))
231
+ * move getBalance method to wallet so it can be fetched for any wallet not just the active one ([#6200](https://github.com/dynamic-labs/DynamicAuth/issues/6200)) ([ee94773](https://github.com/dynamic-labs/DynamicAuth/commit/ee94773df9b31462a325666760fcf1fc70dec68a))
232
+ * move getNameService method to wallet so name service data can be fetched for any wallet ([#6205](https://github.com/dynamic-labs/DynamicAuth/issues/6205)) ([6671ae9](https://github.com/dynamic-labs/DynamicAuth/commit/6671ae92532ffc1889e24519e75f47d336ac0da6))
233
+ * relax phone number length validation ([#6226](https://github.com/dynamic-labs/DynamicAuth/issues/6226)) ([f0969b4](https://github.com/dynamic-labs/DynamicAuth/commit/f0969b4fbdafde07125cddecb16b4bfd011ea65e))
234
+ * sdkHasLoaded flipping back to false with otp ([#6242](https://github.com/dynamic-labs/DynamicAuth/issues/6242)) ([32ad9dd](https://github.com/dynamic-labs/DynamicAuth/commit/32ad9dd2dae7775f494506773fb343fe1a249c65))
235
+ * send transaction demo undefined address/value ([#6248](https://github.com/dynamic-labs/DynamicAuth/issues/6248)) ([036a511](https://github.com/dynamic-labs/DynamicAuth/commit/036a511fb848ef461edd9b7a5d79d478b0f1cf23))
236
+ * set last active account on accountChange request ([#6218](https://github.com/dynamic-labs/DynamicAuth/issues/6218)) ([05797d2](https://github.com/dynamic-labs/DynamicAuth/commit/05797d292aab8b4de02555594d4d1bbd4c9543eb))
237
+ * show ledger toggle when linking wallet ([#6202](https://github.com/dynamic-labs/DynamicAuth/issues/6202)) ([a449c0b](https://github.com/dynamic-labs/DynamicAuth/commit/a449c0bfc4e3a75ccd7084b930c48fbd6c14f691))
238
+ * show user wallet in profile view on single wallet mode even if it's not primary ([#6187](https://github.com/dynamic-labs/DynamicAuth/issues/6187)) ([ffaaeb2](https://github.com/dynamic-labs/DynamicAuth/commit/ffaaeb2c6cbb2868a381d85451ae5574024156bb))
239
+ * stop auto-switching to connected secondary wallet if primary wallet is not connected ([#6196](https://github.com/dynamic-labs/DynamicAuth/issues/6196)) ([4e8bcd2](https://github.com/dynamic-labs/DynamicAuth/commit/4e8bcd2d02d3fca54a0ed29c45b386ae99266b84))
240
+ * stop coinbase and solflare popups when secondary ([#6225](https://github.com/dynamic-labs/DynamicAuth/issues/6225)) ([7e9c104](https://github.com/dynamic-labs/DynamicAuth/commit/7e9c1049a09c9fd513c9a2a746d6baac916f1bf4))
241
+ * stop sending double sign request on network switch ([e325709](https://github.com/dynamic-labs/DynamicAuth/commit/e325709bb5d2d1331fe16cc705398fc7b1cc292a))
242
+ * tunrkey solana signer accept uint8array message ([#6137](https://github.com/dynamic-labs/DynamicAuth/issues/6137)) ([70f89ce](https://github.com/dynamic-labs/DynamicAuth/commit/70f89ce0dafa4c99b318c9c5adce59083cd6d284))
243
+ * update formatting of phantom bitcoin publickey ([#6210](https://github.com/dynamic-labs/DynamicAuth/issues/6210)) ([f58cea9](https://github.com/dynamic-labs/DynamicAuth/commit/f58cea99333fd7c6af8f56f637ee32f1f7ce8d76))
244
+ * use white color in farcaster qr code when in dark mode ([#6245](https://github.com/dynamic-labs/DynamicAuth/issues/6245)) ([a91958d](https://github.com/dynamic-labs/DynamicAuth/commit/a91958d8773be138da8f54791c4c67866257bbad))
245
+
246
+
247
+ * make Wallet a class instead of just a type ([#6094](https://github.com/dynamic-labs/DynamicAuth/issues/6094)) ([6dc4672](https://github.com/dynamic-labs/DynamicAuth/commit/6dc4672951cfadc22a6c569e74eae3485bd472f3))
248
+ * remove setPrimaryWallet in favor of useSwitchWallet ([#6212](https://github.com/dynamic-labs/DynamicAuth/issues/6212)) ([de125e1](https://github.com/dynamic-labs/DynamicAuth/commit/de125e1ebbc20507e4ec07f337f5f5fd13aabcbe))
249
+
250
+ ## [3.0.0-alpha.13](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.12...v3.0.0-alpha.13) (2024-06-27)
251
+
252
+
253
+ ### Bug Fixes
254
+
255
+ * coinbase smart wallet better handling in iframes ([#6184](https://github.com/dynamic-labs/DynamicAuth/issues/6184)) ([2c4befe](https://github.com/dynamic-labs/DynamicAuth/commit/2c4befedd09e6a432139cb3d08ea61004c3896d5))
256
+ * show connected network name when icon url is missing ([#6191](https://github.com/dynamic-labs/DynamicAuth/issues/6191)) ([dafd9e3](https://github.com/dynamic-labs/DynamicAuth/commit/dafd9e323f47ca3d61556e9a8c84ba3bfd27af8f))
257
+ * use correct account when creating wallet client ([#6179](https://github.com/dynamic-labs/DynamicAuth/issues/6179)) ([4e45a15](https://github.com/dynamic-labs/DynamicAuth/commit/4e45a15b2d7221ec80df919aa93468a75a94bed3))
258
+
259
+ ## [3.0.0-alpha.12](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.11...v3.0.0-alpha.12) (2024-06-27)
260
+
261
+
262
+ ### ⚠ BREAKING CHANGES
263
+
264
+ * return Transaction type from signTransaction and update solana … (#6180)
265
+
266
+ ### Bug Fixes
267
+
268
+ * return Transaction type from signTransaction and update solana … ([#6180](https://github.com/dynamic-labs/DynamicAuth/issues/6180)) ([07798b2](https://github.com/dynamic-labs/DynamicAuth/commit/07798b241a13f35a62e4ca0172a57a8d0cd98cf9))
269
+
270
+ ## [3.0.0-alpha.11](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.10...v3.0.0-alpha.11) (2024-06-26)
271
+
272
+
273
+ ### Bug Fixes
274
+
275
+ * prevent unwanted magiceden solana popups ([#6158](https://github.com/dynamic-labs/DynamicAuth/issues/6158)) ([b3c8208](https://github.com/dynamic-labs/DynamicAuth/commit/b3c820887eb5ec2badcfce3b19ec4dd874e90811))
276
+ * status icon for embedded wallets ([#6149](https://github.com/dynamic-labs/DynamicAuth/issues/6149)) ([135fd72](https://github.com/dynamic-labs/DynamicAuth/commit/135fd7274f4a6b2dcab98248f7bfe34a09e79f01))
277
+
278
+ ## [3.0.0-alpha.10](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.9...v3.0.0-alpha.10) (2024-06-24)
279
+
280
+
281
+ ### Bug Fixes
282
+
283
+ * clear expiresAt from local storage on logout ([#6110](https://github.com/dynamic-labs/DynamicAuth/issues/6110)) ([cbda893](https://github.com/dynamic-labs/DynamicAuth/commit/cbda893441154b6880a5419ce62a353b80f05e55))
284
+ * show SOL amount for complex transactions and better error display ([#6068](https://github.com/dynamic-labs/DynamicAuth/issues/6068)) ([454a3a0](https://github.com/dynamic-labs/DynamicAuth/commit/454a3a0a50805b3d63f44c2ef8c1dc766617eb2b))
285
+
286
+ ## [3.0.0-alpha.9](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2024-06-21)
287
+
288
+ ## [3.0.0-alpha.8](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.7...v3.0.0-alpha.8) (2024-06-21)
289
+
290
+
291
+ ### ⚠ BREAKING CHANGES
292
+
293
+ * break out turnkey package into 3 separate packages (#6015)
294
+
295
+ ### Features
296
+
297
+ * add reinitialize hook ([#6098](https://github.com/dynamic-labs/DynamicAuth/issues/6098)) ([d978baa](https://github.com/dynamic-labs/DynamicAuth/commit/d978baa404d34064c36cc549229b1fcea1f20df0))
298
+
299
+
300
+ ### Bug Fixes
301
+
302
+ * always reconnect the wallet provider when calling getAddress ([#6097](https://github.com/dynamic-labs/DynamicAuth/issues/6097)) ([0f3d497](https://github.com/dynamic-labs/DynamicAuth/commit/0f3d497cedb38239fa9ada2bb25c6b4eaa72d7b1))
303
+ * break out turnkey package into 3 separate packages ([#6015](https://github.com/dynamic-labs/DynamicAuth/issues/6015)) ([a86fbef](https://github.com/dynamic-labs/DynamicAuth/commit/a86fbefe97558363b085e6f752af32d2943f91fa)), closes [#6017](https://github.com/dynamic-labs/DynamicAuth/issues/6017) [#6059](https://github.com/dynamic-labs/DynamicAuth/issues/6059)
304
+ * set latest blockhash on solana transactions if tx confirmation ui is disabled ([#6102](https://github.com/dynamic-labs/DynamicAuth/issues/6102)) ([b8035a3](https://github.com/dynamic-labs/DynamicAuth/commit/b8035a328e47409bf0416d3a01b2f17914488748))
305
+ * silently query unisat accounts ([#6101](https://github.com/dynamic-labs/DynamicAuth/issues/6101)) ([#6104](https://github.com/dynamic-labs/DynamicAuth/issues/6104)) ([643e704](https://github.com/dynamic-labs/DynamicAuth/commit/643e7048ff8610b31e6397e10b160ad456a45d11))
306
+ * stop querying magiceden solana accounts ([#6103](https://github.com/dynamic-labs/DynamicAuth/issues/6103)) ([#6108](https://github.com/dynamic-labs/DynamicAuth/issues/6108)) ([3cfdbc3](https://github.com/dynamic-labs/DynamicAuth/commit/3cfdbc3bc82bfe9bf53bf4236f7892a5440fcb86))
307
+ * trigger sign when linking an already linked unknown wallet ([#6105](https://github.com/dynamic-labs/DynamicAuth/issues/6105)) ([9e9c03b](https://github.com/dynamic-labs/DynamicAuth/commit/9e9c03bf615991c4f1183bf85c4d75c9a7773c85))
308
+
309
+ ## [3.0.0-alpha.7](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.6...v3.0.0-alpha.7) (2024-06-19)
310
+
311
+
312
+ ### ⚠ BREAKING CHANGES
313
+
314
+ * add selectedTabIndex and helpers (#6040)
315
+
316
+ ### Features
317
+
318
+ * add selectedTabIndex and helpers ([#6040](https://github.com/dynamic-labs/DynamicAuth/issues/6040)) ([ae20b80](https://github.com/dynamic-labs/DynamicAuth/commit/ae20b8081376dce97b18fa69c81c9ab73c1ff317))
319
+ * add useRefreshUser to trigger a user state refresh ([#6079](https://github.com/dynamic-labs/DynamicAuth/issues/6079)) ([1236d35](https://github.com/dynamic-labs/DynamicAuth/commit/1236d35fe9fab44ed2114ad9f3c8c6dca7ec27be))
320
+
321
+
322
+ ### Bug Fixes
323
+
324
+ * always return userWallets when available ([#6080](https://github.com/dynamic-labs/DynamicAuth/issues/6080)) ([#6083](https://github.com/dynamic-labs/DynamicAuth/issues/6083)) ([11992d2](https://github.com/dynamic-labs/DynamicAuth/commit/11992d2af5a401ba4ff1dc6904e2a9f8ef5904ca))
325
+ * less solana rpc calls and improve fee fetching ([#6019](https://github.com/dynamic-labs/DynamicAuth/issues/6019)) ([e2609db](https://github.com/dynamic-labs/DynamicAuth/commit/e2609db962c7708ff5b127cb23260a25bc5032e3))
326
+ * make account change idemopotent ([#6061](https://github.com/dynamic-labs/DynamicAuth/issues/6061)) ([8c87513](https://github.com/dynamic-labs/DynamicAuth/commit/8c8751390ea14888c4889679895e2f06d75717b9))
327
+ * only run multi wallet prompt when user profile or auth flow are open ([#6073](https://github.com/dynamic-labs/DynamicAuth/issues/6073)) ([d48ca10](https://github.com/dynamic-labs/DynamicAuth/commit/d48ca105359018457a78588fd8d9aa8a91583a02))
328
+ * recompute multiwallet state after merging accounts ([#6078](https://github.com/dynamic-labs/DynamicAuth/issues/6078)) ([e08a274](https://github.com/dynamic-labs/DynamicAuth/commit/e08a274c4d848f2a8360be7106cfbfa00b9a8f9b))
329
+ * stop querying okx for accounts while locked ([#6081](https://github.com/dynamic-labs/DynamicAuth/issues/6081)) ([#6084](https://github.com/dynamic-labs/DynamicAuth/issues/6084)) ([34365ac](https://github.com/dynamic-labs/DynamicAuth/commit/34365ac1981fe020b03e666c24535a247645d2ad))
330
+ * update copy for primary wallet not connected modal ([#6069](https://github.com/dynamic-labs/DynamicAuth/issues/6069)) ([4a3f43c](https://github.com/dynamic-labs/DynamicAuth/commit/4a3f43ce5585983f7fea0c5b97e812c0ade80e2c))
331
+
332
+ ## [3.0.0-alpha.6](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.5...v3.0.0-alpha.6) (2024-06-18)
333
+
334
+
335
+ ### Features
336
+
337
+ * implement useExternalAuth hook to signin using external jwt auth ([#6039](https://github.com/dynamic-labs/DynamicAuth/issues/6039)) ([ba90908](https://github.com/dynamic-labs/DynamicAuth/commit/ba90908509ec21f708a4a0782a7f94861fc3b484))
338
+
339
+
340
+ ### Bug Fixes
341
+
342
+ * allow sign-in with different ME BTC wallet after initial connection ([a527b46](https://github.com/dynamic-labs/DynamicAuth/commit/a527b464f321b4fc27730f57c3812e996b5ed878))
343
+ * close sign modal when signing in with a wallet when embedded wallet is enabled ([#6013](https://github.com/dynamic-labs/DynamicAuth/issues/6013)) ([0f4f3c8](https://github.com/dynamic-labs/DynamicAuth/commit/0f4f3c83db162f7a1794a3549b60bbad6b03e2c0))
344
+ * custom network without a valid icon should still display its name in network picker ([#6018](https://github.com/dynamic-labs/DynamicAuth/issues/6018)) ([0b10df6](https://github.com/dynamic-labs/DynamicAuth/commit/0b10df68950bfc9b8492443158a6bb030dc1122c))
345
+ * e2e: remove page pause ([#6045](https://github.com/dynamic-labs/DynamicAuth/issues/6045)) ([55bba00](https://github.com/dynamic-labs/DynamicAuth/commit/55bba0034255055d6ae266b1296542f47ed48e2b))
346
+ * more fixes for connect starknet button ([#6046](https://github.com/dynamic-labs/DynamicAuth/issues/6046)) ([0fb570a](https://github.com/dynamic-labs/DynamicAuth/commit/0fb570a44e65f8dd6d4d2bf5edb2ee54985ec9d4))
347
+ * set verified credentials on embedded wallet creation ([#6044](https://github.com/dynamic-labs/DynamicAuth/issues/6044)) ([b52a96d](https://github.com/dynamic-labs/DynamicAuth/commit/b52a96d321e7efdb30dce9cdb3f6f176c24ceb81))
348
+
349
+ ## [3.0.0-alpha.5](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.4...v3.0.0-alpha.5) (2024-06-14)
350
+
351
+
352
+ ### ⚠ BREAKING CHANGES
353
+
354
+ * remove viem dependency from non-evm packages (#5508)
355
+ * move rpc providers into their own packages (#5981)
356
+
357
+ ### Features
358
+
359
+ * add in-app browser navigation support for sats-connect ([#5988](https://github.com/dynamic-labs/DynamicAuth/issues/5988)) ([be27d2d](https://github.com/dynamic-labs/DynamicAuth/commit/be27d2d4030bbe2157e879497d8e6a00b4a3e404))
360
+ * move rpc providers into their own packages ([#5981](https://github.com/dynamic-labs/DynamicAuth/issues/5981)) ([d7a62d6](https://github.com/dynamic-labs/DynamicAuth/commit/d7a62d60e79dfa6d6651b0fa103e90b6f8a9ccf3))
361
+
362
+
363
+ ### Bug Fixes
364
+
365
+ * embedded solana wallets can send SPL tokens and estimate gas ([#5982](https://github.com/dynamic-labs/DynamicAuth/issues/5982)) ([36623eb](https://github.com/dynamic-labs/DynamicAuth/commit/36623eb99d1d1dfebfd8b6f3194eeff31e7de2bf))
366
+ * improve logic related to turnkey and emailVerifcation ([#5946](https://github.com/dynamic-labs/DynamicAuth/issues/5946)) ([dd0b2dc](https://github.com/dynamic-labs/DynamicAuth/commit/dd0b2dc6d93a8bbbcb6eef88732e62b747005bb3))
367
+ * show linked wallets with unavailable providers in user wallets list ([#5992](https://github.com/dynamic-labs/DynamicAuth/issues/5992)) ([996079c](https://github.com/dynamic-labs/DynamicAuth/commit/996079ced360651c7b1eb5273548e0548f6f9f3a))
368
+ * switch network modal not closing after switching to a supported network ([#5979](https://github.com/dynamic-labs/DynamicAuth/issues/5979)) ([f239952](https://github.com/dynamic-labs/DynamicAuth/commit/f2399523dd82bb28046992cac4582688b688bdc0))
369
+
370
+
371
+ * remove viem dependency from non-evm packages ([#5508](https://github.com/dynamic-labs/DynamicAuth/issues/5508)) ([0299dc3](https://github.com/dynamic-labs/DynamicAuth/commit/0299dc3cbb611182d763e9a89d1270c2e2f32df5))
372
+
2
373
  ## [3.0.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.3...v3.0.0-alpha.4) (2024-06-12)
3
374
 
4
375
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/bitcoin",
3
- "version": "3.0.0-alpha.4",
3
+ "version": "3.0.0-alpha.40",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -27,14 +27,14 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@btckit/types": "0.0.19",
30
- "@dynamic-labs/sdk-api-core": "0.0.461",
30
+ "@dynamic-labs/sdk-api-core": "0.0.510",
31
31
  "@wallet-standard/app": "1.0.1",
32
32
  "@wallet-standard/base": "1.0.1",
33
33
  "bitcoinjs-lib": "6.1.5",
34
34
  "sats-connect": "2.0.0",
35
- "@dynamic-labs/utils": "3.0.0-alpha.4",
36
- "@dynamic-labs/wallet-book": "3.0.0-alpha.4",
37
- "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.4",
35
+ "@dynamic-labs/utils": "3.0.0-alpha.40",
36
+ "@dynamic-labs/wallet-book": "3.0.0-alpha.40",
37
+ "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.40",
38
38
  "stream": "0.0.2"
39
39
  },
40
40
  "peerDependencies": {}
@@ -9,7 +9,6 @@ var utils = require('@dynamic-labs/utils');
9
9
  class BitcoinLocalStorageCache {
10
10
  constructor(key) {
11
11
  this.CONNECTED_ACCOUNTS_KEY = `bitcoin_${key}_connectedAccounts`;
12
- this.LAST_BALANCE_KEY = `bitcoin_${key}_lastBalance`;
13
12
  }
14
13
  getActiveAccount() {
15
14
  return _tslib.__awaiter(this, void 0, void 0, function* () {
@@ -63,21 +62,6 @@ class BitcoinLocalStorageCache {
63
62
  return utils.removeItemAsync(this.CONNECTED_ACCOUNTS_KEY);
64
63
  });
65
64
  }
66
- getLastBalance() {
67
- return _tslib.__awaiter(this, void 0, void 0, function* () {
68
- return utils.getItemAsync(this.LAST_BALANCE_KEY);
69
- });
70
- }
71
- setLastBalance(balance) {
72
- return _tslib.__awaiter(this, void 0, void 0, function* () {
73
- return utils.setItemAsync(this.LAST_BALANCE_KEY, balance);
74
- });
75
- }
76
- clearLastBalance() {
77
- return _tslib.__awaiter(this, void 0, void 0, function* () {
78
- return utils.removeItemAsync(this.LAST_BALANCE_KEY);
79
- });
80
- }
81
65
  }
82
66
 
83
67
  exports.BitcoinLocalStorageCache = BitcoinLocalStorageCache;
@@ -9,16 +9,12 @@ type BitcoinActiveAccount = {
9
9
  };
10
10
  export declare class BitcoinLocalStorageCache implements IBitcoinSessionCache {
11
11
  private readonly CONNECTED_ACCOUNTS_KEY;
12
- private readonly LAST_BALANCE_KEY;
13
12
  constructor(key: string);
14
13
  getActiveAccount(): Promise<BitcoinActiveAccount | undefined>;
15
14
  getConnectedAccounts(): Promise<BitcoinConnectedAccounts | undefined>;
16
15
  getConnectedAccount(address: string): Promise<BitcoinConnectedAccount | undefined>;
17
16
  setConnectedAccount(addess: string, account: BitcoinConnectedAccount): Promise<void>;
18
17
  clearConnectedAcccounts(): Promise<void>;
19
- getLastBalance(): Promise<string | undefined>;
20
- setLastBalance(balance: string): Promise<void>;
21
- clearLastBalance(): Promise<void>;
22
18
  }
23
19
  export interface IBitcoinSessionCache {
24
20
  clearConnectedAcccounts(): Promise<void>;
@@ -26,8 +22,5 @@ export interface IBitcoinSessionCache {
26
22
  getConnectedAccount(address: string): Promise<BitcoinConnectedAccount | undefined>;
27
23
  getConnectedAccounts(): Promise<BitcoinConnectedAccounts | undefined>;
28
24
  setConnectedAccount(addess: string, account: BitcoinConnectedAccount): Promise<void>;
29
- clearLastBalance(): Promise<void>;
30
- getLastBalance(): Promise<string | undefined>;
31
- setLastBalance(balance: string): Promise<void>;
32
25
  }
33
26
  export {};
@@ -5,7 +5,6 @@ import { getItemAsync, setItemAsync, removeItemAsync } from '@dynamic-labs/utils
5
5
  class BitcoinLocalStorageCache {
6
6
  constructor(key) {
7
7
  this.CONNECTED_ACCOUNTS_KEY = `bitcoin_${key}_connectedAccounts`;
8
- this.LAST_BALANCE_KEY = `bitcoin_${key}_lastBalance`;
9
8
  }
10
9
  getActiveAccount() {
11
10
  return __awaiter(this, void 0, void 0, function* () {
@@ -59,21 +58,6 @@ class BitcoinLocalStorageCache {
59
58
  return removeItemAsync(this.CONNECTED_ACCOUNTS_KEY);
60
59
  });
61
60
  }
62
- getLastBalance() {
63
- return __awaiter(this, void 0, void 0, function* () {
64
- return getItemAsync(this.LAST_BALANCE_KEY);
65
- });
66
- }
67
- setLastBalance(balance) {
68
- return __awaiter(this, void 0, void 0, function* () {
69
- return setItemAsync(this.LAST_BALANCE_KEY, balance);
70
- });
71
- }
72
- clearLastBalance() {
73
- return __awaiter(this, void 0, void 0, function* () {
74
- return removeItemAsync(this.LAST_BALANCE_KEY);
75
- });
76
- }
77
61
  }
78
62
 
79
63
  export { BitcoinLocalStorageCache };
@@ -15,6 +15,10 @@ export declare class BitcoinProviderHelper {
15
15
  features: string[];
16
16
  name: string;
17
17
  } | undefined;
18
+ walletStandardLocators?: {
19
+ name: string;
20
+ locator: string;
21
+ }[] | undefined;
18
22
  windowLocations?: string[] | undefined;
19
23
  } | undefined;
20
24
  getProvider(): any;
@@ -6,9 +6,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
  var _tslib = require('../../../_virtual/_tslib.cjs');
7
7
  var bitcoinjsLib = require('bitcoinjs-lib');
8
8
  var satsConnect = require('sats-connect');
9
- var sdkApiCore = require('@dynamic-labs/sdk-api-core');
9
+ var utils = require('@dynamic-labs/utils');
10
+ var walletBook = require('@dynamic-labs/wallet-book');
10
11
  var _const = require('../../const.cjs');
11
- require('@dynamic-labs/utils');
12
12
  require('@dynamic-labs/wallet-connector-core');
13
13
  var BitcoinWalletConnector = require('../BitcoinWalletConnector.cjs');
14
14
  var validatePsbt = require('../../utils/psbt/validator/validatePsbt.cjs');
@@ -20,10 +20,6 @@ class BitcoinSatsConnectConnector extends BitcoinWalletConnector.BitcoinWalletCo
20
20
  constructor(opts) {
21
21
  super(opts);
22
22
  this.currentNetwork = satsConnect.BitcoinNetworkType.Mainnet;
23
- this.canFetchConnectedAccounts = true;
24
- // xverse does't support fetching connected accounts without prompting
25
- // for a connection, so we handle getConnectedAccounts differently
26
- this.canFetchConnectedAccounts = this.key !== 'xverse';
27
23
  }
28
24
  getAddress() {
29
25
  return _tslib.__awaiter(this, void 0, void 0, function* () {
@@ -36,11 +32,18 @@ class BitcoinSatsConnectConnector extends BitcoinWalletConnector.BitcoinWalletCo
36
32
  if (!supportsSatsConnect.supportsSatsConnect(this)) {
37
33
  return;
38
34
  }
39
- const cachedActiveAccount = yield this.cache.getActiveAccount();
40
- if (cachedActiveAccount) {
41
- const ordinalsAddress = cachedActiveAccount.additionalAddresses.find((address) => address.type === sdkApiCore.WalletAddressType.Ordinals);
42
- const paymentAddress = cachedActiveAccount.additionalAddresses.find((address) => address.type === sdkApiCore.WalletAddressType.Payment);
43
- return (_a = ordinalsAddress === null || ordinalsAddress === void 0 ? void 0 : ordinalsAddress.address) !== null && _a !== void 0 ? _a : paymentAddress === null || paymentAddress === void 0 ? void 0 : paymentAddress.address;
35
+ const wallet = walletBook.findWalletBookWallet(this.walletBook, this.key);
36
+ const inAppBrowserUrl = (_a = wallet === null || wallet === void 0 ? void 0 : wallet.mobile) === null || _a === void 0 ? void 0 : _a.inAppBrowser;
37
+ if (utils.isMobile() &&
38
+ !this.isInstalledOnBrowser() &&
39
+ inAppBrowserUrl &&
40
+ this.mobileExperience === 'in-app-browser') {
41
+ const inAppBrowserTemplate = utils.template(inAppBrowserUrl);
42
+ const deepLink = inAppBrowserTemplate({
43
+ encodedDappURI: encodeURIComponent(window.location.toString()),
44
+ });
45
+ window.location.href = deepLink;
46
+ return;
44
47
  }
45
48
  return new Promise((resolve, reject) => {
46
49
  satsConnect.getAddress({
@@ -3,7 +3,6 @@ import { BitcoinSignPsbtRequest, BitcoinSignPsbtResponse, BitcoinTransaction, Sa
3
3
  import { BitcoinWalletConnector, BitcoinWalletConnectorOpts } from '../BitcoinWalletConnector';
4
4
  export declare abstract class BitcoinSatsConnectConnector extends BitcoinWalletConnector {
5
5
  currentNetwork: BitcoinNetworkType;
6
- canFetchConnectedAccounts: boolean;
7
6
  constructor(opts: BitcoinWalletConnectorOpts);
8
7
  getAddress(): Promise<string | undefined>;
9
8
  signMessage(messageToSign: string): Promise<string | undefined>;
@@ -2,9 +2,9 @@
2
2
  import { __awaiter } from '../../../_virtual/_tslib.js';
3
3
  import { Psbt } from 'bitcoinjs-lib';
4
4
  import { BitcoinNetworkType, getAddress, AddressPurpose, signMessage, sendBtcTransaction, signTransaction } from 'sats-connect';
5
- import { WalletAddressType } from '@dynamic-labs/sdk-api-core';
5
+ import { isMobile, template } from '@dynamic-labs/utils';
6
+ import { findWalletBookWallet } from '@dynamic-labs/wallet-book';
6
7
  import { SATSCONNECT_FEATURE } from '../../const.js';
7
- import '@dynamic-labs/utils';
8
8
  import '@dynamic-labs/wallet-connector-core';
9
9
  import { BitcoinWalletConnector } from '../BitcoinWalletConnector.js';
10
10
  import { validatePsbt } from '../../utils/psbt/validator/validatePsbt.js';
@@ -16,10 +16,6 @@ class BitcoinSatsConnectConnector extends BitcoinWalletConnector {
16
16
  constructor(opts) {
17
17
  super(opts);
18
18
  this.currentNetwork = BitcoinNetworkType.Mainnet;
19
- this.canFetchConnectedAccounts = true;
20
- // xverse does't support fetching connected accounts without prompting
21
- // for a connection, so we handle getConnectedAccounts differently
22
- this.canFetchConnectedAccounts = this.key !== 'xverse';
23
19
  }
24
20
  getAddress() {
25
21
  return __awaiter(this, void 0, void 0, function* () {
@@ -32,11 +28,18 @@ class BitcoinSatsConnectConnector extends BitcoinWalletConnector {
32
28
  if (!supportsSatsConnect(this)) {
33
29
  return;
34
30
  }
35
- const cachedActiveAccount = yield this.cache.getActiveAccount();
36
- if (cachedActiveAccount) {
37
- const ordinalsAddress = cachedActiveAccount.additionalAddresses.find((address) => address.type === WalletAddressType.Ordinals);
38
- const paymentAddress = cachedActiveAccount.additionalAddresses.find((address) => address.type === WalletAddressType.Payment);
39
- return (_a = ordinalsAddress === null || ordinalsAddress === void 0 ? void 0 : ordinalsAddress.address) !== null && _a !== void 0 ? _a : paymentAddress === null || paymentAddress === void 0 ? void 0 : paymentAddress.address;
31
+ const wallet = findWalletBookWallet(this.walletBook, this.key);
32
+ const inAppBrowserUrl = (_a = wallet === null || wallet === void 0 ? void 0 : wallet.mobile) === null || _a === void 0 ? void 0 : _a.inAppBrowser;
33
+ if (isMobile() &&
34
+ !this.isInstalledOnBrowser() &&
35
+ inAppBrowserUrl &&
36
+ this.mobileExperience === 'in-app-browser') {
37
+ const inAppBrowserTemplate = template(inAppBrowserUrl);
38
+ const deepLink = inAppBrowserTemplate({
39
+ encodedDappURI: encodeURIComponent(window.location.toString()),
40
+ });
41
+ window.location.href = deepLink;
42
+ return;
40
43
  }
41
44
  return new Promise((resolve, reject) => {
42
45
  getAddress({
@@ -4,6 +4,7 @@
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var _tslib = require('../../_virtual/_tslib.cjs');
7
+ var satsConnect = require('sats-connect');
7
8
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
8
9
  var walletBook = require('@dynamic-labs/wallet-book');
9
10
  var utils = require('@dynamic-labs/utils');
@@ -26,12 +27,20 @@ class BitcoinWalletConnector extends walletConnectorCore.WalletConnectorBase {
26
27
  this.verifiedCredentials = [];
27
28
  // this is the key from the wallet book entry so that we don't purely rely on the normalized name
28
29
  this.overrideKey = (_a = opts.overrideKey) !== null && _a !== void 0 ? _a : this.key;
29
- this.bitcoinProviderHelper = new bitcoinProviderHelper.BitcoinProviderHelper(opts.walletData || walletBook.getWalletBookWallet(this.walletBook, this.key));
30
+ const walletBookWallet = opts.walletData || walletBook.getWalletBookWallet(this.walletBook, this.key);
31
+ this.bitcoinProviderHelper = new bitcoinProviderHelper.BitcoinProviderHelper(walletBookWallet);
30
32
  this.wallet = this.bitcoinProviderHelper.findWallet();
31
33
  if (this.wallet) {
32
34
  this.walletMethods = this.bitcoinProviderHelper.getWalletMethods(this.wallet);
33
35
  }
34
36
  this.cache = new BitcoinLocalStorageCache.BitcoinLocalStorageCache(this.overrideKey);
37
+ this.canFetchConnectedAccounts = walletBook.isWalletMethodSupported(walletBookWallet, 'getConnectedAccounts', 'browserExtension');
38
+ }
39
+ isSameAccountChangeRequest(to) {
40
+ return this.lastAccountChange === to;
41
+ }
42
+ setLastAccountChangeRequest(to) {
43
+ this.lastAccountChange = to;
35
44
  }
36
45
  clearConnectedAccounts() {
37
46
  return _tslib.__awaiter(this, void 0, void 0, function* () {
@@ -53,31 +62,17 @@ class BitcoinWalletConnector extends walletConnectorCore.WalletConnectorBase {
53
62
  }
54
63
  endSession() {
55
64
  return _tslib.__awaiter(this, void 0, void 0, function* () {
56
- yield this.cache.clearLastBalance();
65
+ yield this.cache.clearConnectedAcccounts();
57
66
  });
58
67
  }
59
- getBalance() {
68
+ getBalance(address) {
60
69
  return _tslib.__awaiter(this, void 0, void 0, function* () {
61
- var _a, _b;
62
- const [connectedAddress] = yield this.getConnectedAccounts();
63
- if (!connectedAddress) {
64
- throw new utils.DynamicError('getBalance - No connected address found!');
65
- }
66
- const additionalAddresses = yield this.getAdditionalAddresses(connectedAddress);
67
- const ordinalsAdditionalAddress = (_a = additionalAddresses.find((address) => address.type === sdkApiCore.WalletAddressType.Ordinals)) === null || _a === void 0 ? void 0 : _a.address;
68
- const paymentAdditionalAddress = (_b = additionalAddresses.find((address) => address.type === sdkApiCore.WalletAddressType.Payment)) === null || _b === void 0 ? void 0 : _b.address;
69
- // Some BTC wallet connectors only have 1 address type. when this is the case, it would always be `ordinals`
70
- // if a BTC walletConnector does NOT have a payment address, just use the ordinal address
71
- const paymentAddress = paymentAdditionalAddress !== null && paymentAdditionalAddress !== void 0 ? paymentAdditionalAddress : ordinalsAdditionalAddress;
72
- if (!paymentAddress) {
73
- throw new utils.DynamicError('getBalance - No payment address found!');
74
- }
75
- const API_URL = getMempoolApiUrl.getMempoolApiUrl(paymentAddress);
76
- const response = yield fetch(`${API_URL}/address/${paymentAddress}`);
70
+ const API_URL = getMempoolApiUrl.getMempoolApiUrl(address);
71
+ const response = yield fetch(`${API_URL}/address/${address}`);
77
72
  if (!response.ok) {
78
73
  // if the request fails due to rate limits, return cached value
79
74
  if (response.status === _const.HTTP_STATUS_TOO_MANY_REQUESTS) {
80
- return this.cache.getLastBalance();
75
+ return '0';
81
76
  }
82
77
  // new accounts not yet indexed will return a 404
83
78
  if (response.status === _const.HTTP_STATUS_NOT_FOUND) {
@@ -94,7 +89,6 @@ class BitcoinWalletConnector extends walletConnectorCore.WalletConnectorBase {
94
89
  const unconfirmedBalanceInSats = Number(addressInfo.mempool_stats.funded_txo_sum) -
95
90
  Number(addressInfo.mempool_stats.spent_txo_sum);
96
91
  const balance = satoshisToBtc.satoshisToBtc(confirmedBalanceInSats + unconfirmedBalanceInSats);
97
- yield this.cache.setLastBalance(balance.toString());
98
92
  return balance.toString();
99
93
  });
100
94
  }
@@ -225,18 +219,33 @@ class BitcoinWalletConnector extends walletConnectorCore.WalletConnectorBase {
225
219
  const { handleAccountChange, handleChainChange, handleDisconnect } = walletConnectorCore.eventListenerHandlers(this);
226
220
  const handleBitcoinAccountChange = (accounts) => _tslib.__awaiter(this, void 0, void 0, function* () {
227
221
  let connectedAccounts = accounts;
222
+ let ordinalsAccount, paymentAccount;
228
223
  // if accounts is an array of objects, we need to parse them to return only addresses
229
224
  // since ordinals is the main address we use, we should return it as the first address
230
225
  if (typeof accounts[0] === 'object') {
231
226
  connectedAccounts = accounts
232
- .sort((account) => (account.purpose === 'ordinals' ? -1 : 1))
227
+ .sort((account) => account.purpose === satsConnect.AddressPurpose.Ordinals ? -1 : 1)
233
228
  .map((account) => account.address);
229
+ [ordinalsAccount, paymentAccount] = connectedAccounts;
234
230
  }
235
231
  const currentConnectedAccounts = yield this.getConnectedAccountsFromCache();
236
232
  // don't do anything if the connected accounts haven't changed
237
- if (currentConnectedAccounts[0] === connectedAccounts[0]) {
233
+ // or if the account change request is the same as previous request
234
+ if (currentConnectedAccounts[0] === connectedAccounts[0] ||
235
+ this.isSameAccountChangeRequest(connectedAccounts[0])) {
238
236
  return;
239
237
  }
238
+ // set the last account change request with the from and to addresses
239
+ // to ensure that the requests are not duplicated
240
+ this.setLastAccountChangeRequest(connectedAccounts[0]);
241
+ if (ordinalsAccount || paymentAccount) {
242
+ this.setConnectedAccountWithAddresses({
243
+ active: true,
244
+ mainAddress: ordinalsAccount !== null && ordinalsAccount !== void 0 ? ordinalsAccount : paymentAccount,
245
+ ordinalsAddress: ordinalsAccount,
246
+ paymentAddress: paymentAccount,
247
+ });
248
+ }
240
249
  handleAccountChange(connectedAccounts);
241
250
  });
242
251
  provider.on('accountsChanged', handleBitcoinAccountChange);
@@ -23,13 +23,16 @@ export declare abstract class BitcoinWalletConnector extends WalletConnectorBase
23
23
  canFetchConnectedAccounts: boolean;
24
24
  isHardwareWalletEnabled: boolean;
25
25
  verifiedCredentials: JwtVerifiedCredential[];
26
+ private lastAccountChange;
26
27
  constructor(opts: BitcoinWalletConnectorOpts);
28
+ private isSameAccountChangeRequest;
29
+ private setLastAccountChangeRequest;
27
30
  clearConnectedAccounts(): Promise<void>;
28
31
  canConnectWithHardwareWallet(): boolean;
29
32
  isInstalledOnBrowser(): boolean;
30
33
  getDeepLink(): string | undefined;
31
34
  endSession(): Promise<void>;
32
- getBalance(): Promise<string | undefined>;
35
+ getBalance(address: string): Promise<string | undefined>;
33
36
  getConnectedAccountsFromCache(): Promise<string[]>;
34
37
  getConnectedAccounts(): Promise<string[]>;
35
38
  getAdditionalAddresses(mainAddress?: string): Promise<WalletAdditionalAddress[]>;
@@ -1,7 +1,8 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../_virtual/_tslib.js';
3
+ import { AddressPurpose } from 'sats-connect';
3
4
  import { WalletConnectorBase, eventListenerHandlers, logger } from '@dynamic-labs/wallet-connector-core';
4
- import { getWalletBookWallet, findWalletBookWallet } from '@dynamic-labs/wallet-book';
5
+ import { getWalletBookWallet, isWalletMethodSupported, findWalletBookWallet } from '@dynamic-labs/wallet-book';
5
6
  import { isLedgerAddressViaVerifiedCredentials, DynamicError } from '@dynamic-labs/utils';
6
7
  import { WalletAddressType } from '@dynamic-labs/sdk-api-core';
7
8
  import { BitcoinLocalStorageCache } from '../BitcoinLocalStorageCache.js';
@@ -22,12 +23,20 @@ class BitcoinWalletConnector extends WalletConnectorBase {
22
23
  this.verifiedCredentials = [];
23
24
  // this is the key from the wallet book entry so that we don't purely rely on the normalized name
24
25
  this.overrideKey = (_a = opts.overrideKey) !== null && _a !== void 0 ? _a : this.key;
25
- this.bitcoinProviderHelper = new BitcoinProviderHelper(opts.walletData || getWalletBookWallet(this.walletBook, this.key));
26
+ const walletBookWallet = opts.walletData || getWalletBookWallet(this.walletBook, this.key);
27
+ this.bitcoinProviderHelper = new BitcoinProviderHelper(walletBookWallet);
26
28
  this.wallet = this.bitcoinProviderHelper.findWallet();
27
29
  if (this.wallet) {
28
30
  this.walletMethods = this.bitcoinProviderHelper.getWalletMethods(this.wallet);
29
31
  }
30
32
  this.cache = new BitcoinLocalStorageCache(this.overrideKey);
33
+ this.canFetchConnectedAccounts = isWalletMethodSupported(walletBookWallet, 'getConnectedAccounts', 'browserExtension');
34
+ }
35
+ isSameAccountChangeRequest(to) {
36
+ return this.lastAccountChange === to;
37
+ }
38
+ setLastAccountChangeRequest(to) {
39
+ this.lastAccountChange = to;
31
40
  }
32
41
  clearConnectedAccounts() {
33
42
  return __awaiter(this, void 0, void 0, function* () {
@@ -49,31 +58,17 @@ class BitcoinWalletConnector extends WalletConnectorBase {
49
58
  }
50
59
  endSession() {
51
60
  return __awaiter(this, void 0, void 0, function* () {
52
- yield this.cache.clearLastBalance();
61
+ yield this.cache.clearConnectedAcccounts();
53
62
  });
54
63
  }
55
- getBalance() {
64
+ getBalance(address) {
56
65
  return __awaiter(this, void 0, void 0, function* () {
57
- var _a, _b;
58
- const [connectedAddress] = yield this.getConnectedAccounts();
59
- if (!connectedAddress) {
60
- throw new DynamicError('getBalance - No connected address found!');
61
- }
62
- const additionalAddresses = yield this.getAdditionalAddresses(connectedAddress);
63
- const ordinalsAdditionalAddress = (_a = additionalAddresses.find((address) => address.type === WalletAddressType.Ordinals)) === null || _a === void 0 ? void 0 : _a.address;
64
- const paymentAdditionalAddress = (_b = additionalAddresses.find((address) => address.type === WalletAddressType.Payment)) === null || _b === void 0 ? void 0 : _b.address;
65
- // Some BTC wallet connectors only have 1 address type. when this is the case, it would always be `ordinals`
66
- // if a BTC walletConnector does NOT have a payment address, just use the ordinal address
67
- const paymentAddress = paymentAdditionalAddress !== null && paymentAdditionalAddress !== void 0 ? paymentAdditionalAddress : ordinalsAdditionalAddress;
68
- if (!paymentAddress) {
69
- throw new DynamicError('getBalance - No payment address found!');
70
- }
71
- const API_URL = getMempoolApiUrl(paymentAddress);
72
- const response = yield fetch(`${API_URL}/address/${paymentAddress}`);
66
+ const API_URL = getMempoolApiUrl(address);
67
+ const response = yield fetch(`${API_URL}/address/${address}`);
73
68
  if (!response.ok) {
74
69
  // if the request fails due to rate limits, return cached value
75
70
  if (response.status === HTTP_STATUS_TOO_MANY_REQUESTS) {
76
- return this.cache.getLastBalance();
71
+ return '0';
77
72
  }
78
73
  // new accounts not yet indexed will return a 404
79
74
  if (response.status === HTTP_STATUS_NOT_FOUND) {
@@ -90,7 +85,6 @@ class BitcoinWalletConnector extends WalletConnectorBase {
90
85
  const unconfirmedBalanceInSats = Number(addressInfo.mempool_stats.funded_txo_sum) -
91
86
  Number(addressInfo.mempool_stats.spent_txo_sum);
92
87
  const balance = satoshisToBtc(confirmedBalanceInSats + unconfirmedBalanceInSats);
93
- yield this.cache.setLastBalance(balance.toString());
94
88
  return balance.toString();
95
89
  });
96
90
  }
@@ -221,18 +215,33 @@ class BitcoinWalletConnector extends WalletConnectorBase {
221
215
  const { handleAccountChange, handleChainChange, handleDisconnect } = eventListenerHandlers(this);
222
216
  const handleBitcoinAccountChange = (accounts) => __awaiter(this, void 0, void 0, function* () {
223
217
  let connectedAccounts = accounts;
218
+ let ordinalsAccount, paymentAccount;
224
219
  // if accounts is an array of objects, we need to parse them to return only addresses
225
220
  // since ordinals is the main address we use, we should return it as the first address
226
221
  if (typeof accounts[0] === 'object') {
227
222
  connectedAccounts = accounts
228
- .sort((account) => (account.purpose === 'ordinals' ? -1 : 1))
223
+ .sort((account) => account.purpose === AddressPurpose.Ordinals ? -1 : 1)
229
224
  .map((account) => account.address);
225
+ [ordinalsAccount, paymentAccount] = connectedAccounts;
230
226
  }
231
227
  const currentConnectedAccounts = yield this.getConnectedAccountsFromCache();
232
228
  // don't do anything if the connected accounts haven't changed
233
- if (currentConnectedAccounts[0] === connectedAccounts[0]) {
229
+ // or if the account change request is the same as previous request
230
+ if (currentConnectedAccounts[0] === connectedAccounts[0] ||
231
+ this.isSameAccountChangeRequest(connectedAccounts[0])) {
234
232
  return;
235
233
  }
234
+ // set the last account change request with the from and to addresses
235
+ // to ensure that the requests are not duplicated
236
+ this.setLastAccountChangeRequest(connectedAccounts[0]);
237
+ if (ordinalsAccount || paymentAccount) {
238
+ this.setConnectedAccountWithAddresses({
239
+ active: true,
240
+ mainAddress: ordinalsAccount !== null && ordinalsAccount !== void 0 ? ordinalsAccount : paymentAccount,
241
+ ordinalsAddress: ordinalsAccount,
242
+ paymentAddress: paymentAccount,
243
+ });
244
+ }
236
245
  handleAccountChange(connectedAccounts);
237
246
  });
238
247
  provider.on('accountsChanged', handleBitcoinAccountChange);
@@ -0,0 +1,37 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var _tslib = require('../../../_virtual/_tslib.cjs');
7
+ var BitcoinWalletConnector = require('../BitcoinWalletConnector.cjs');
8
+
9
+ class FallbackBitcoinConnector extends BitcoinWalletConnector.BitcoinWalletConnector {
10
+ constructor(opts) {
11
+ super(Object.assign(Object.assign({}, opts), { overrideKey: 'fallbackconnector' }));
12
+ this.name = 'Fallback Connector';
13
+ this.overrideKey = 'fallbackconnector';
14
+ this.isAvailable = false;
15
+ }
16
+ getAddress() {
17
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
18
+ return;
19
+ });
20
+ }
21
+ signPsbt(
22
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
23
+ _request) {
24
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
25
+ return;
26
+ });
27
+ }
28
+ sendBitcoin(
29
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
30
+ _transaction) {
31
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
32
+ return;
33
+ });
34
+ }
35
+ }
36
+
37
+ exports.FallbackBitcoinConnector = FallbackBitcoinConnector;
@@ -0,0 +1,11 @@
1
+ import { BitcoinSignPsbtRequest, BitcoinSignPsbtResponse, BitcoinTransaction } from '../../types';
2
+ import { BitcoinWalletConnector, BitcoinWalletConnectorOpts } from '../BitcoinWalletConnector';
3
+ export declare class FallbackBitcoinConnector extends BitcoinWalletConnector {
4
+ name: string;
5
+ overrideKey: string;
6
+ isAvailable: boolean;
7
+ constructor(opts: BitcoinWalletConnectorOpts);
8
+ getAddress(): Promise<string | undefined>;
9
+ signPsbt(_request: BitcoinSignPsbtRequest): Promise<BitcoinSignPsbtResponse | undefined>;
10
+ sendBitcoin(_transaction: BitcoinTransaction): Promise<string | undefined>;
11
+ }
@@ -0,0 +1,33 @@
1
+ 'use client'
2
+ import { __awaiter } from '../../../_virtual/_tslib.js';
3
+ import { BitcoinWalletConnector } from '../BitcoinWalletConnector.js';
4
+
5
+ class FallbackBitcoinConnector extends BitcoinWalletConnector {
6
+ constructor(opts) {
7
+ super(Object.assign(Object.assign({}, opts), { overrideKey: 'fallbackconnector' }));
8
+ this.name = 'Fallback Connector';
9
+ this.overrideKey = 'fallbackconnector';
10
+ this.isAvailable = false;
11
+ }
12
+ getAddress() {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ return;
15
+ });
16
+ }
17
+ signPsbt(
18
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
19
+ _request) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ return;
22
+ });
23
+ }
24
+ sendBitcoin(
25
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
26
+ _transaction) {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ return;
29
+ });
30
+ }
31
+ }
32
+
33
+ export { FallbackBitcoinConnector };
@@ -0,0 +1 @@
1
+ export { FallbackBitcoinConnector } from './FallbackBitcoinConnector';
@@ -13,7 +13,6 @@ class OkxConnector extends BitcoinWalletConnector.BitcoinWalletConnector {
13
13
  constructor(opts) {
14
14
  super(Object.assign(Object.assign({}, opts), { overrideKey: 'okxwalletbtc' }));
15
15
  this.name = 'OKX Wallet';
16
- this.canFetchConnectedAccounts = true;
17
16
  }
18
17
  get walletBookWallet() {
19
18
  return this.walletBook.wallets[this.key];
@@ -23,7 +22,8 @@ class OkxConnector extends BitcoinWalletConnector.BitcoinWalletConnector {
23
22
  if (!this.isInstalledOnBrowser() &&
24
23
  utils.isMobile() &&
25
24
  this.walletBookWallet.mobile &&
26
- this.walletBookWallet.mobile.inAppBrowser) {
25
+ this.walletBookWallet.mobile.inAppBrowser &&
26
+ this.mobileExperience === 'in-app-browser') {
27
27
  const inAppBrowserCompiledTemplate = utils.template(this.walletBookWallet.mobile.inAppBrowser);
28
28
  const deepLink = inAppBrowserCompiledTemplate({
29
29
  encodedDappURI: encodeURIComponent(window.location.toString()),
@@ -2,7 +2,6 @@ import { BitcoinWalletConnector, BitcoinWalletConnectorOpts } from '../BitcoinWa
2
2
  import { BitcoinTransaction, BitcoinSignPsbtRequest, BitcoinSignPsbtResponse } from '../../types';
3
3
  export declare class OkxConnector extends BitcoinWalletConnector {
4
4
  name: string;
5
- canFetchConnectedAccounts: boolean;
6
5
  constructor(opts: BitcoinWalletConnectorOpts);
7
6
  private get walletBookWallet();
8
7
  getAddress(): Promise<string | undefined>;
@@ -9,7 +9,6 @@ class OkxConnector extends BitcoinWalletConnector {
9
9
  constructor(opts) {
10
10
  super(Object.assign(Object.assign({}, opts), { overrideKey: 'okxwalletbtc' }));
11
11
  this.name = 'OKX Wallet';
12
- this.canFetchConnectedAccounts = true;
13
12
  }
14
13
  get walletBookWallet() {
15
14
  return this.walletBook.wallets[this.key];
@@ -19,7 +18,8 @@ class OkxConnector extends BitcoinWalletConnector {
19
18
  if (!this.isInstalledOnBrowser() &&
20
19
  isMobile() &&
21
20
  this.walletBookWallet.mobile &&
22
- this.walletBookWallet.mobile.inAppBrowser) {
21
+ this.walletBookWallet.mobile.inAppBrowser &&
22
+ this.mobileExperience === 'in-app-browser') {
23
23
  const inAppBrowserCompiledTemplate = template(this.walletBookWallet.mobile.inAppBrowser);
24
24
  const deepLink = inAppBrowserCompiledTemplate({
25
25
  encodedDappURI: encodeURIComponent(window.location.toString()),
@@ -17,7 +17,6 @@ class PhantomConnector extends BitcoinWalletConnector.BitcoinWalletConnector {
17
17
  constructor(opts) {
18
18
  super(Object.assign(Object.assign({}, opts), { overrideKey: 'phantombtc' }));
19
19
  this.name = 'Phantom';
20
- this.canFetchConnectedAccounts = true;
21
20
  }
22
21
  connectWithInstalledExtension() {
23
22
  return _tslib.__awaiter(this, void 0, void 0, function* () {
@@ -27,7 +26,7 @@ class PhantomConnector extends BitcoinWalletConnector.BitcoinWalletConnector {
27
26
  const { accounts } = yield this.walletMethods.connect();
28
27
  const parsedAccounts = accounts.map((account) => ({
29
28
  address: account.address,
30
- publicKey: Buffer.from(account.publicKey).toString('base64'),
29
+ publicKey: Buffer.from(account.publicKey).toString('hex'),
31
30
  }));
32
31
  [paymentAccount, ordinalsAccount] = parsedAccounts;
33
32
  // in case it only returns one account, we will use it as both payment and ordinals
@@ -2,7 +2,6 @@ import { BitcoinTransaction, BitcoinSignPsbtRequest, BitcoinSignPsbtResponse } f
2
2
  import { BitcoinWalletConnector, BitcoinWalletConnectorOpts } from '../BitcoinWalletConnector';
3
3
  export declare class PhantomConnector extends BitcoinWalletConnector {
4
4
  name: string;
5
- canFetchConnectedAccounts: boolean;
6
5
  constructor(opts: BitcoinWalletConnectorOpts);
7
6
  private connectWithInstalledExtension;
8
7
  getAddress(): Promise<string | undefined>;
@@ -13,7 +13,6 @@ class PhantomConnector extends BitcoinWalletConnector {
13
13
  constructor(opts) {
14
14
  super(Object.assign(Object.assign({}, opts), { overrideKey: 'phantombtc' }));
15
15
  this.name = 'Phantom';
16
- this.canFetchConnectedAccounts = true;
17
16
  }
18
17
  connectWithInstalledExtension() {
19
18
  return __awaiter(this, void 0, void 0, function* () {
@@ -23,7 +22,7 @@ class PhantomConnector extends BitcoinWalletConnector {
23
22
  const { accounts } = yield this.walletMethods.connect();
24
23
  const parsedAccounts = accounts.map((account) => ({
25
24
  address: account.address,
26
- publicKey: Buffer.from(account.publicKey).toString('base64'),
25
+ publicKey: Buffer.from(account.publicKey).toString('hex'),
27
26
  }));
28
27
  [paymentAccount, ordinalsAccount] = parsedAccounts;
29
28
  // in case it only returns one account, we will use it as both payment and ordinals
@@ -13,7 +13,6 @@ class UnisatConnector extends BitcoinWalletConnector.BitcoinWalletConnector {
13
13
  super(Object.assign(Object.assign({}, opts), { overrideKey: 'unisat' }));
14
14
  this.name = 'UniSat';
15
15
  this.overrideKey = 'unisat';
16
- this.canFetchConnectedAccounts = true;
17
16
  }
18
17
  getAddress() {
19
18
  return _tslib.__awaiter(this, void 0, void 0, function* () {
@@ -65,6 +64,15 @@ class UnisatConnector extends BitcoinWalletConnector.BitcoinWalletConnector {
65
64
  return { signedPsbt: bitcoinjsLib.Psbt.fromHex(signedPsbtHex).toBase64() };
66
65
  });
67
66
  }
67
+ getConnectedAccounts() {
68
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
69
+ const provider = this.getProvider();
70
+ if (!provider) {
71
+ return [];
72
+ }
73
+ return provider.getAccounts();
74
+ });
75
+ }
68
76
  }
69
77
 
70
78
  exports.UnisatConnector = UnisatConnector;
@@ -3,10 +3,10 @@ import { BitcoinTransaction, BitcoinSignPsbtRequest, BitcoinSignPsbtResponse } f
3
3
  export declare class UnisatConnector extends BitcoinWalletConnector {
4
4
  name: string;
5
5
  overrideKey: string;
6
- canFetchConnectedAccounts: boolean;
7
6
  constructor(opts: BitcoinWalletConnectorOpts);
8
7
  getAddress(): Promise<string | undefined>;
9
8
  signMessage(messageToSign: string): Promise<string | undefined>;
10
9
  sendBitcoin(transaction: BitcoinTransaction): Promise<string | undefined>;
11
10
  signPsbt(request: BitcoinSignPsbtRequest): Promise<BitcoinSignPsbtResponse | undefined>;
11
+ getConnectedAccounts(): Promise<string[]>;
12
12
  }
@@ -9,7 +9,6 @@ class UnisatConnector extends BitcoinWalletConnector {
9
9
  super(Object.assign(Object.assign({}, opts), { overrideKey: 'unisat' }));
10
10
  this.name = 'UniSat';
11
11
  this.overrideKey = 'unisat';
12
- this.canFetchConnectedAccounts = true;
13
12
  }
14
13
  getAddress() {
15
14
  return __awaiter(this, void 0, void 0, function* () {
@@ -61,6 +60,15 @@ class UnisatConnector extends BitcoinWalletConnector {
61
60
  return { signedPsbt: Psbt.fromHex(signedPsbtHex).toBase64() };
62
61
  });
63
62
  }
63
+ getConnectedAccounts() {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ const provider = this.getProvider();
66
+ if (!provider) {
67
+ return [];
68
+ }
69
+ return provider.getAccounts();
70
+ });
71
+ }
64
72
  }
65
73
 
66
74
  export { UnisatConnector };
@@ -11,7 +11,6 @@ class UnknownInjectedConnector extends BitcoinWalletConnector.BitcoinWalletConne
11
11
  super(Object.assign(Object.assign({}, opts), { overrideKey: 'unknown' }));
12
12
  this.name = 'Unknown';
13
13
  this.overrideKey = 'unknown';
14
- this.canFetchConnectedAccounts = false;
15
14
  }
16
15
  getAddress() {
17
16
  return _tslib.__awaiter(this, void 0, void 0, function* () {
@@ -3,7 +3,6 @@ import { BitcoinWalletConnector, BitcoinWalletConnectorOpts } from '../BitcoinWa
3
3
  export declare class UnknownInjectedConnector extends BitcoinWalletConnector {
4
4
  name: string;
5
5
  overrideKey: string;
6
- canFetchConnectedAccounts: boolean;
7
6
  constructor(opts: BitcoinWalletConnectorOpts);
8
7
  getAddress(): Promise<string | undefined>;
9
8
  signPsbt(_request: BitcoinSignPsbtRequest): Promise<BitcoinSignPsbtResponse | undefined>;
@@ -7,7 +7,6 @@ class UnknownInjectedConnector extends BitcoinWalletConnector {
7
7
  super(Object.assign(Object.assign({}, opts), { overrideKey: 'unknown' }));
8
8
  this.name = 'Unknown';
9
9
  this.overrideKey = 'unknown';
10
- this.canFetchConnectedAccounts = false;
11
10
  }
12
11
  getAddress() {
13
12
  return __awaiter(this, void 0, void 0, function* () {
@@ -5,3 +5,4 @@ export * from './PhantomConnector';
5
5
  export * from './OkxConnector';
6
6
  export * from './UnisatConnector';
7
7
  export * from './UnknownInjected';
8
+ export * from './FallbackBitcoinConnector';
package/src/index.cjs CHANGED
@@ -9,7 +9,7 @@ require('sats-connect');
9
9
  require('bitcoinjs-lib');
10
10
  require('@dynamic-labs/wallet-connector-core');
11
11
  require('@dynamic-labs/utils');
12
- require('@dynamic-labs/sdk-api-core');
12
+ require('@dynamic-labs/wallet-book');
13
13
  var fetchBtcKitConnectors = require('./utils/fetchBtcKitConnectors/fetchBtcKitConnectors.cjs');
14
14
  var fetchSatsConnectConnectors = require('./utils/fetchSatsConnectConnectors/fetchSatsConnectConnectors.cjs');
15
15
  var hasSatsConnectFeature = require('./utils/hasSatsConnectFeature.cjs');
@@ -19,6 +19,7 @@ var PhantomConnector = require('./connectors/PhantomConnector/PhantomConnector.c
19
19
  var OkxConnector = require('./connectors/OkxConnector/OkxConnector.cjs');
20
20
  var UnisatConnector = require('./connectors/UnisatConnector/UnisatConnector.cjs');
21
21
  var UnknownInjected = require('./connectors/UnknownInjected/UnknownInjected.cjs');
22
+ var FallbackBitcoinConnector = require('./connectors/FallbackBitcoinConnector/FallbackBitcoinConnector.cjs');
22
23
 
23
24
  const BitcoinWalletConnectors = (props) => [
24
25
  ...fetchSatsConnectConnectors.fetchSatsConnectConnectors(props),
@@ -27,6 +28,7 @@ const BitcoinWalletConnectors = (props) => [
27
28
  OkxConnector.OkxConnector,
28
29
  UnisatConnector.UnisatConnector,
29
30
  UnknownInjected.UnknownInjectedConnector,
31
+ FallbackBitcoinConnector.FallbackBitcoinConnector,
30
32
  ];
31
33
 
32
34
  exports.BitcoinWalletConnector = BitcoinWalletConnector.BitcoinWalletConnector;
package/src/index.js CHANGED
@@ -5,7 +5,7 @@ import 'sats-connect';
5
5
  import 'bitcoinjs-lib';
6
6
  import '@dynamic-labs/wallet-connector-core';
7
7
  import '@dynamic-labs/utils';
8
- import '@dynamic-labs/sdk-api-core';
8
+ import '@dynamic-labs/wallet-book';
9
9
  import { fetchBtcKitConnectors } from './utils/fetchBtcKitConnectors/fetchBtcKitConnectors.js';
10
10
  export { fetchBtcKitConnectors } from './utils/fetchBtcKitConnectors/fetchBtcKitConnectors.js';
11
11
  import { fetchSatsConnectConnectors } from './utils/fetchSatsConnectConnectors/fetchSatsConnectConnectors.js';
@@ -17,6 +17,7 @@ import { PhantomConnector } from './connectors/PhantomConnector/PhantomConnector
17
17
  import { OkxConnector } from './connectors/OkxConnector/OkxConnector.js';
18
18
  import { UnisatConnector } from './connectors/UnisatConnector/UnisatConnector.js';
19
19
  import { UnknownInjectedConnector } from './connectors/UnknownInjected/UnknownInjected.js';
20
+ import { FallbackBitcoinConnector } from './connectors/FallbackBitcoinConnector/FallbackBitcoinConnector.js';
20
21
 
21
22
  const BitcoinWalletConnectors = (props) => [
22
23
  ...fetchSatsConnectConnectors(props),
@@ -25,6 +26,7 @@ const BitcoinWalletConnectors = (props) => [
25
26
  OkxConnector,
26
27
  UnisatConnector,
27
28
  UnknownInjectedConnector,
29
+ FallbackBitcoinConnector,
28
30
  ];
29
31
 
30
32
  export { BitcoinWalletConnectors };
@@ -5,12 +5,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var _const = require('../../const.cjs');
7
7
  require('../../../_virtual/_tslib.cjs');
8
+ require('sats-connect');
8
9
  require('@dynamic-labs/wallet-connector-core');
9
10
  require('@dynamic-labs/wallet-book');
10
11
  require('@dynamic-labs/utils');
11
12
  require('@dynamic-labs/sdk-api-core');
12
13
  require('@wallet-standard/app');
13
- require('sats-connect');
14
14
  require('bitcoinjs-lib');
15
15
  var BitcoinSatsConnectConnector = require('../../connectors/BitcoinSatsConnectConnector/BitcoinSatsConnectConnector.cjs');
16
16
 
@@ -1,12 +1,12 @@
1
1
  'use client'
2
2
  import { SATSCONNECT_FEATURE } from '../../const.js';
3
3
  import '../../../_virtual/_tslib.js';
4
+ import 'sats-connect';
4
5
  import '@dynamic-labs/wallet-connector-core';
5
6
  import '@dynamic-labs/wallet-book';
6
7
  import '@dynamic-labs/utils';
7
8
  import '@dynamic-labs/sdk-api-core';
8
9
  import '@wallet-standard/app';
9
- import 'sats-connect';
10
10
  import 'bitcoinjs-lib';
11
11
  import { BitcoinSatsConnectConnector } from '../../connectors/BitcoinSatsConnectConnector/BitcoinSatsConnectConnector.js';
12
12