@dynamic-labs/wallet-book 1.1.0-alpha.9 → 1.1.0

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 (48) hide show
  1. package/CHANGELOG.md +198 -0
  2. package/README.md +46 -1
  3. package/_virtual/_tslib.cjs +6 -1
  4. package/_virtual/_tslib.js +6 -1
  5. package/package.json +4 -2
  6. package/src/build/index.d.ts +4 -0
  7. package/src/build/sources/walletConnect/index.d.ts +28 -24
  8. package/src/build/sources/walletConnectOverrides/index.d.ts +12 -0
  9. package/src/components/BrandIcon.cjs +25 -0
  10. package/src/components/BrandIcon.d.ts +8 -0
  11. package/src/components/BrandIcon.js +21 -0
  12. package/src/components/WalletIcon.cjs +2 -1
  13. package/src/components/WalletIcon.js +2 -1
  14. package/src/components/index.d.ts +1 -0
  15. package/src/helpers/findWalletBookWallet.cjs +0 -2
  16. package/src/helpers/findWalletBookWallet.d.ts +4 -1
  17. package/src/helpers/findWalletBookWallet.js +0 -2
  18. package/src/helpers/findWalletGroup.d.ts +9 -0
  19. package/src/helpers/findWalletGroupOverride.cjs +13 -0
  20. package/src/helpers/findWalletGroupOverride.d.ts +3 -0
  21. package/src/helpers/findWalletGroupOverride.js +9 -0
  22. package/src/helpers/getBrandIconUrl.cjs +17 -0
  23. package/src/helpers/getBrandIconUrl.d.ts +2 -0
  24. package/src/helpers/getBrandIconUrl.js +13 -0
  25. package/src/helpers/getWalletBookWallet.cjs +18 -6
  26. package/src/helpers/getWalletBookWallet.js +18 -6
  27. package/src/helpers/getWalletIconUrl.cjs +3 -6
  28. package/src/helpers/getWalletIconUrl.js +3 -6
  29. package/src/helpers/index.d.ts +2 -0
  30. package/src/helpers/normalizeWalletName.cjs +7 -0
  31. package/src/helpers/normalizeWalletName.js +3 -0
  32. package/src/hooks/useWalletBookCdn.cjs +22 -16
  33. package/src/hooks/useWalletBookCdn.d.ts +13 -1
  34. package/src/hooks/useWalletBookCdn.js +22 -16
  35. package/src/hooks/useWalletBookContext.cjs +2 -0
  36. package/src/hooks/useWalletBookContext.js +2 -0
  37. package/src/index.cjs +6 -0
  38. package/src/index.d.ts +2 -2
  39. package/src/index.js +3 -0
  40. package/src/schemas/walletBookSchema.d.ts +213 -20
  41. package/src/schemas/walletGroup.cjs +6 -0
  42. package/src/schemas/walletGroup.d.ts +112 -2
  43. package/src/schemas/walletGroup.js +6 -0
  44. package/src/schemas/walletSchema.cjs +39 -20
  45. package/src/schemas/walletSchema.d.ts +77 -4
  46. package/src/schemas/walletSchema.js +39 -21
  47. package/wallet-book-fallbacks.cjs +217 -9
  48. package/wallet-book-fallbacks.js +217 -9
package/CHANGELOG.md CHANGED
@@ -1,4 +1,202 @@
1
1
 
2
+ ## [1.1.0](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.25...v1.1.0) (2024-02-07)
3
+
4
+ Check out our changelog here: https://docs.dynamic.xyz/changelog/v1-1
5
+
6
+
7
+ ### Features
8
+
9
+ * add retry when using magic ([#4579](https://github.com/dynamic-labs/DynamicAuth/issues/4579)) ([183561c](https://github.com/dynamic-labs/DynamicAuth/commit/183561cc64f083fd1489c38a8cc8b1c4c51d2924))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * bug where deprecated fields were still being used in the SDK ([#4604](https://github.com/dynamic-labs/DynamicAuth/issues/4604)) ([4fd15fc](https://github.com/dynamic-labs/DynamicAuth/commit/4fd15fc4daa9c5b7bbc81ce05a3b046c80a6d5b4))
15
+ * log magic RPC error and update magic network error ([#4606](https://github.com/dynamic-labs/DynamicAuth/issues/4606)) ([2206961](https://github.com/dynamic-labs/DynamicAuth/commit/22069618a317bc40b1a17fd521eadf0956983de4))
16
+ * onConnect is properly called for additional connected wallets ([#4607](https://github.com/dynamic-labs/DynamicAuth/issues/4607)) ([23241f4](https://github.com/dynamic-labs/DynamicAuth/commit/23241f4d5dc91ac9ca1251710161efbfce42dc40))
17
+
18
+ ## [1.1.0-alpha.25](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.24...v1.1.0-alpha.25) (2024-02-05)
19
+
20
+
21
+ ### Features
22
+
23
+ * add signin with coinbase to sdk ([#4581](https://github.com/dynamic-labs/DynamicAuth/issues/4581)) ([08a31ed](https://github.com/dynamic-labs/DynamicAuth/commit/08a31ed3552c48645b398881f184440800af21ec))
24
+ * exposing hook for creating either one-time code or passkeys authenticators ([#4591](https://github.com/dynamic-labs/DynamicAuth/issues/4591)) ([864d755](https://github.com/dynamic-labs/DynamicAuth/commit/864d75576152a10f73f5901bc06e2d66892b63ab))
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * solana wallet sign message with one-time code session ([#4588](https://github.com/dynamic-labs/DynamicAuth/issues/4588)) ([a738d10](https://github.com/dynamic-labs/DynamicAuth/commit/a738d10814dc5058158b9c0c59a399a375c69c10))
30
+
31
+ ## [1.1.0-alpha.24](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.23...v1.1.0-alpha.24) (2024-02-02)
32
+
33
+
34
+ ### Bug Fixes
35
+
36
+ * remove isFullyConnected when unable to restore wallet ([#4575](https://github.com/dynamic-labs/DynamicAuth/issues/4575)) ([4504ff0](https://github.com/dynamic-labs/DynamicAuth/commit/4504ff03f594cd9a60055e6f52b7ea8001542bbe))
37
+
38
+ ## [1.1.0-alpha.23](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.22...v1.1.0-alpha.23) (2024-02-01)
39
+
40
+
41
+ ### Features
42
+
43
+ * bitcoin signPsbt ([3c964de](https://github.com/dynamic-labs/DynamicAuth/commit/3c964dea8a55debaf184c5a94f0f5fabdda3c877))
44
+ * embedded wallet email auth flow ([#4353](https://github.com/dynamic-labs/DynamicAuth/issues/4353)) ([4875da3](https://github.com/dynamic-labs/DynamicAuth/commit/4875da32c47c27facef1b1cdbdc214566bbfd171))
45
+
46
+ ## [1.1.0-alpha.22](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.21...v1.1.0-alpha.22) (2024-02-01)
47
+
48
+
49
+ ### Bug Fixes
50
+
51
+ * onAuthFlowClose not being called ([#4563](https://github.com/dynamic-labs/DynamicAuth/issues/4563)) ([c4b2648](https://github.com/dynamic-labs/DynamicAuth/commit/c4b264885b7dba6e204ef49bf642d25c7d287b04))
52
+
53
+ ## [1.1.0-alpha.21](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.20...v1.1.0-alpha.21) (2024-02-01)
54
+
55
+
56
+ ### Features
57
+
58
+ * add phantom redirect handling context ([#4479](https://github.com/dynamic-labs/DynamicAuth/issues/4479)) ([e0218ee](https://github.com/dynamic-labs/DynamicAuth/commit/e0218eec1a67787f5c0e7483d542a5f773e911ef))
59
+ * add signPsbt method to bitcoin wallet connectors ([dfdc0fe](https://github.com/dynamic-labs/DynamicAuth/commit/dfdc0fe0e6894c1307b286e89b43a4c58a8808f3))
60
+
61
+
62
+ ### Bug Fixes
63
+
64
+ * relax passkey feature detection check in sdk to avoid false nega… ([#4556](https://github.com/dynamic-labs/DynamicAuth/issues/4556)) ([4554f7d](https://github.com/dynamic-labs/DynamicAuth/commit/4554f7d7c5339859481cdecca95a9c07fae4ba5c))
65
+ * workaround braavos undefined selectedWallet on chainChange event ([#4552](https://github.com/dynamic-labs/DynamicAuth/issues/4552)) ([aa35df0](https://github.com/dynamic-labs/DynamicAuth/commit/aa35df0e894feafa0606aa1c87bd3d3879ebc594))
66
+
67
+ ## [1.1.0-alpha.20](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.19...v1.1.0-alpha.20) (2024-01-31)
68
+
69
+
70
+ ### Bug Fixes
71
+
72
+ * return all enabled chains in getSupportedNetworks instead of undefined ([#4547](https://github.com/dynamic-labs/DynamicAuth/issues/4547)) ([08e7889](https://github.com/dynamic-labs/DynamicAuth/commit/08e78896e045f24bbd96e39416a7f58006929da0))
73
+ * show modal for existing social account from other signin provider ([#4535](https://github.com/dynamic-labs/DynamicAuth/issues/4535)) ([282914a](https://github.com/dynamic-labs/DynamicAuth/commit/282914ac94b3ef5bd66e0b2265d9e414203a7406))
74
+
75
+ ## [1.1.0-alpha.19](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.18...v1.1.0-alpha.19) (2024-01-31)
76
+
77
+
78
+ ### Features
79
+
80
+ * add PhantomRedirect connector ([#4467](https://github.com/dynamic-labs/DynamicAuth/issues/4467)) ([75d6c95](https://github.com/dynamic-labs/DynamicAuth/commit/75d6c95940fcec185a699c2100b3e2d21a8233d5))
81
+
82
+
83
+ ### Bug Fixes
84
+
85
+ * lock starknet to 5.25.0 since 5.27.0 breaks the build ([#4541](https://github.com/dynamic-labs/DynamicAuth/issues/4541)) ([00b4799](https://github.com/dynamic-labs/DynamicAuth/commit/00b479977f768cb067480e2e565eabf45e1000a2))
86
+
87
+ ## [1.1.0-alpha.18](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.17...v1.1.0-alpha.18) (2024-01-30)
88
+
89
+
90
+ ### Bug Fixes
91
+
92
+ * catch email_associated_with_different_provider from response ([#4532](https://github.com/dynamic-labs/DynamicAuth/issues/4532)) ([52be1b4](https://github.com/dynamic-labs/DynamicAuth/commit/52be1b45af46c2b70972b99d73387eb4d7161ec6))
93
+
94
+ ## [1.1.0-alpha.17](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.16...v1.1.0-alpha.17) (2024-01-30)
95
+
96
+
97
+ ### Features
98
+
99
+ * add sendRawTransaction to BitcoinWalletConnector ([2e86c5a](https://github.com/dynamic-labs/DynamicAuth/commit/2e86c5a5245bd0fc29162ef1f7fe2fbd65245fe1))
100
+
101
+
102
+ ### Bug Fixes
103
+
104
+ * properly handle AccountExistsError for signInOAuth ([#4529](https://github.com/dynamic-labs/DynamicAuth/issues/4529)) ([d37fdc3](https://github.com/dynamic-labs/DynamicAuth/commit/d37fdc310fe4b70f8948fd5ed3d058342afbe08f))
105
+
106
+ ## [1.1.0-alpha.16](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.15...v1.1.0-alpha.16) (2024-01-30)
107
+
108
+
109
+ ### Bug Fixes
110
+
111
+ * add fallback to getWalletBookWallet for customers still passing in name, add deprecation warn ([#4518](https://github.com/dynamic-labs/DynamicAuth/issues/4518)) ([b233ea1](https://github.com/dynamic-labs/DynamicAuth/commit/b233ea1cd640d8d9d94c52ab230787f3d869151a))
112
+ * handle braavos network change to account which doesn not exist ([#4519](https://github.com/dynamic-labs/DynamicAuth/issues/4519)) ([486020f](https://github.com/dynamic-labs/DynamicAuth/commit/486020fb09a274388ba34c8d1b37ac3a1ff3dba6))
113
+
114
+ ## [1.1.0-alpha.15](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.14...v1.1.0-alpha.15) (2024-01-28)
115
+
116
+
117
+ ### Features
118
+
119
+ * add wallet group override to wallet book ([#4488](https://github.com/dynamic-labs/DynamicAuth/issues/4488)) ([cb19ad3](https://github.com/dynamic-labs/DynamicAuth/commit/cb19ad3ea82de488752ceceeaf0e1458a388df6e))
120
+ * enable solana embedded wallets ([#4457](https://github.com/dynamic-labs/DynamicAuth/issues/4457)) ([b0c47f4](https://github.com/dynamic-labs/DynamicAuth/commit/b0c47f4475baa12f52076da46ef993c13bd2c243))
121
+ * group ArgentX wallets ([#4495](https://github.com/dynamic-labs/DynamicAuth/issues/4495)) ([b10d79a](https://github.com/dynamic-labs/DynamicAuth/commit/b10d79a668efecedca37ddb358e6adf95319650d))
122
+
123
+
124
+ ### Bug Fixes
125
+
126
+ * add support for newest backpack extension ([#4468](https://github.com/dynamic-labs/DynamicAuth/issues/4468)) ([a219f32](https://github.com/dynamic-labs/DynamicAuth/commit/a219f325be672599e50b07f6751234a7fc98286e))
127
+ * bump timeout for slower connections ([#4475](https://github.com/dynamic-labs/DynamicAuth/issues/4475)) ([7a07ff5](https://github.com/dynamic-labs/DynamicAuth/commit/7a07ff589eaaf3b28a94d277df3eedabbca60702))
128
+ * change out getWalletBookWallet for findWalletBookWallet to avoid throwing during lookup ([#4477](https://github.com/dynamic-labs/DynamicAuth/issues/4477)) ([4648040](https://github.com/dynamic-labs/DynamicAuth/commit/4648040c166e73dd2c31b0e27897713339436c2f))
129
+ * connect to wallet with wallet connect even if network is not supported ([#4465](https://github.com/dynamic-labs/DynamicAuth/issues/4465)) ([9dbca3e](https://github.com/dynamic-labs/DynamicAuth/commit/9dbca3eb4d4990ee4be642677c1604170b425dc3))
130
+ * pass id to wagmi chain override ([#4512](https://github.com/dynamic-labs/DynamicAuth/issues/4512)) ([2bf2f04](https://github.com/dynamic-labs/DynamicAuth/commit/2bf2f0487f5b1be936dd279107c11fe5d2b42666))
131
+ * switching wallet in extension caused connected flag to be false temporarily ([#4454](https://github.com/dynamic-labs/DynamicAuth/issues/4454)) ([3650f6e](https://github.com/dynamic-labs/DynamicAuth/commit/3650f6ec471a7c779f4d304ab94c9350dd55055b))
132
+
133
+ ## [1.1.0-alpha.14](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.13...v1.1.0-alpha.14) (2024-01-23)
134
+
135
+
136
+ ### Features
137
+
138
+ * add wallet-book retryable ([#4462](https://github.com/dynamic-labs/DynamicAuth/issues/4462)) ([513b1a6](https://github.com/dynamic-labs/DynamicAuth/commit/513b1a67d6c49624398ad4b0cdca4f5618c9583f))
139
+
140
+ ## [1.1.0-alpha.13](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.12...v1.1.0-alpha.13) (2024-01-23)
141
+
142
+
143
+ ### Features
144
+
145
+ * add createWalletClientFromWallet helper function ([#4416](https://github.com/dynamic-labs/DynamicAuth/issues/4416)) ([b384898](https://github.com/dynamic-labs/DynamicAuth/commit/b384898061bb3f9b38b2ed670b6650cfc1d4b429))
146
+ * add hardware wallets to wallet book ([#4445](https://github.com/dynamic-labs/DynamicAuth/issues/4445)) ([66c0f5b](https://github.com/dynamic-labs/DynamicAuth/commit/66c0f5b29a6a700099bb95a6f7622f6178e0bccf))
147
+ * add support for Argent Web and Mobile ([#4328](https://github.com/dynamic-labs/DynamicAuth/issues/4328)) ([bce20b8](https://github.com/dynamic-labs/DynamicAuth/commit/bce20b8f35a8630f2621f53a541a1acb06a38fc0))
148
+ * enable ledger for glow, solflare and backpack ([#4392](https://github.com/dynamic-labs/DynamicAuth/issues/4392)) ([fa7b992](https://github.com/dynamic-labs/DynamicAuth/commit/fa7b992f87ebc43560f87b43ac56f2cd9909b306))
149
+
150
+
151
+ ### Bug Fixes
152
+
153
+ * breaking changes script ([#4440](https://github.com/dynamic-labs/DynamicAuth/issues/4440)) ([446173d](https://github.com/dynamic-labs/DynamicAuth/commit/446173d074d652d81856c6412e304b46b1565320))
154
+ * broken help icon in create passkey view ([#4428](https://github.com/dynamic-labs/DynamicAuth/issues/4428)) ([e0ffc02](https://github.com/dynamic-labs/DynamicAuth/commit/e0ffc02ffea34b7ac3198ff6e1baf7f9907acddd))
155
+ * infinite loop when connecting with trust wallet ([#4448](https://github.com/dynamic-labs/DynamicAuth/issues/4448)) ([4e20edf](https://github.com/dynamic-labs/DynamicAuth/commit/4e20edf9abaabf20e5e9f9167b44d7f691e844f1))
156
+ * render wagmi elements based on react version ([#4453](https://github.com/dynamic-labs/DynamicAuth/issues/4453)) ([43c624c](https://github.com/dynamic-labs/DynamicAuth/commit/43c624ca996b0c51de1454910f19fdf908149938))
157
+
158
+ ## [1.1.0-alpha.12](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.11...v1.1.0-alpha.12) (2024-01-18)
159
+
160
+
161
+ ### Features
162
+
163
+ * expose setAuthMode method ([#4419](https://github.com/dynamic-labs/DynamicAuth/issues/4419)) ([7d156b3](https://github.com/dynamic-labs/DynamicAuth/commit/7d156b3e0eab9b9a80f70ff1c5201d90693ae755))
164
+
165
+
166
+ ### Bug Fixes
167
+
168
+ * call onUnlinkSuccess in headless mode too ([#4412](https://github.com/dynamic-labs/DynamicAuth/issues/4412)) ([4c76af9](https://github.com/dynamic-labs/DynamicAuth/commit/4c76af9ac7c7b43883742d1289558dfcb5d612ca))
169
+ * correctly map keplr chain ids from project settings ([#4418](https://github.com/dynamic-labs/DynamicAuth/issues/4418)) ([7046364](https://github.com/dynamic-labs/DynamicAuth/commit/7046364a316f7551f0b995eaae7afea13502eb9b))
170
+ * logging in with an email linked to a third party wallet gets stuck on otp view ([#4407](https://github.com/dynamic-labs/DynamicAuth/issues/4407)) ([35bf142](https://github.com/dynamic-labs/DynamicAuth/commit/35bf142e74efeef866dbd7b8157a049cd36eeccb))
171
+
172
+ ## [1.1.0-alpha.11](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.10...v1.1.0-alpha.11) (2024-01-17)
173
+
174
+
175
+ ### Features
176
+
177
+ * add Leather wallet and BtcKit connector ([#4335](https://github.com/dynamic-labs/DynamicAuth/issues/4335)) ([fe3316b](https://github.com/dynamic-labs/DynamicAuth/commit/fe3316b5be9ef17eea885e99cf925ccd0f271da7))
178
+ * add solana injected wallet configuration to walletbook ([#4375](https://github.com/dynamic-labs/DynamicAuth/issues/4375)) ([3677ce5](https://github.com/dynamic-labs/DynamicAuth/commit/3677ce5ff40d0c00bfaf0daa0d5d67bc40706ee0))
179
+ * add support for unisat wallet ([#4355](https://github.com/dynamic-labs/DynamicAuth/issues/4355)) ([5b7d6b0](https://github.com/dynamic-labs/DynamicAuth/commit/5b7d6b0a9ea84811a8252b3cdf30a3a8e410180c))
180
+ * add walletbook configurations for solana injected wallets ([#4360](https://github.com/dynamic-labs/DynamicAuth/issues/4360)) ([cdc8e5f](https://github.com/dynamic-labs/DynamicAuth/commit/cdc8e5f4878cb84e26e5b33299aa8547b84b6667))
181
+ * passkey renaming frontend ([#4331](https://github.com/dynamic-labs/DynamicAuth/issues/4331)) ([4551013](https://github.com/dynamic-labs/DynamicAuth/commit/4551013d577c914cb3aedfe458ab9eaa018aceb4))
182
+
183
+
184
+ ### Bug Fixes
185
+
186
+ * correctly update wallets connected flag after wallet switch ([#4397](https://github.com/dynamic-labs/DynamicAuth/issues/4397)) ([543a830](https://github.com/dynamic-labs/DynamicAuth/commit/543a830574f0d5a78fedbb9b18233e8dfbaddd86))
187
+ * export modal header ([#4401](https://github.com/dynamic-labs/DynamicAuth/issues/4401)) ([77cf016](https://github.com/dynamic-labs/DynamicAuth/commit/77cf016fc742458988864647870149a56e991ee4))
188
+ * trigger onAuthSuccess before embedded wallet creation ([4aa341a](https://github.com/dynamic-labs/DynamicAuth/commit/4aa341a1d08332a121daddb7c2dcb09a804a4de7))
189
+ * ui issues on react 17 ([#4373](https://github.com/dynamic-labs/DynamicAuth/issues/4373)) ([93096d6](https://github.com/dynamic-labs/DynamicAuth/commit/93096d6017816a4f0ed299bf618b130d90c81514))
190
+
191
+ ## [1.1.0-alpha.10](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.9...v1.1.0-alpha.10) (2024-01-06)
192
+
193
+
194
+ ### Bug Fixes
195
+
196
+ * pass flow network to magic client ([#4322](https://github.com/dynamic-labs/DynamicAuth/issues/4322)) ([f3adccf](https://github.com/dynamic-labs/DynamicAuth/commit/f3adccf9f8d835f6b04e4767acd0fbd2ac238379))
197
+ * prevent error message when mobile wallet app is open ([#4301](https://github.com/dynamic-labs/DynamicAuth/issues/4301)) ([2a66dcf](https://github.com/dynamic-labs/DynamicAuth/commit/2a66dcfaf8100b3d910c559d35d8b731b1cb380e))
198
+ * turnkeyWalletConnector is not an email otp connector and uses dynamic otp ([#4313](https://github.com/dynamic-labs/DynamicAuth/issues/4313)) ([e4ea56f](https://github.com/dynamic-labs/DynamicAuth/commit/e4ea56f40fdf97b3f5440b016ebd95501089cebe))
199
+
2
200
  ## [1.1.0-alpha.9](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.8...v1.1.0-alpha.9) (2024-01-04)
3
201
 
4
202
 
package/README.md CHANGED
@@ -5,6 +5,10 @@
5
5
  - [Wallet Book](#wallet-book)
6
6
  - [Updating Wallet Book](#updating-wallet-book)
7
7
  - [Adding First Party Wallet](#adding-first-party-wallet)
8
+ - [Adding injected (browser extension) wallets](#adding-injected-browser-extension-wallets)
9
+ - [If you need to override any of the following functions: signMessage, fetchPublicAddress, getSigner, isInstalledOnBrowser, etc...](#if-you-need-to-override-any-of-the-following-functions-signmessage-fetchpublicaddress-getsigner-isinstalledonbrowser-etc)
10
+ - [Things to remember when adding a new wallet](#things-to-remember-when-adding-a-new-wallet)
11
+ - [**Checklist before submitting the PR**:](#checklist-before-submitting-the-pr)
8
12
  - [Updating Wallet Connect Data](#updating-wallet-connect-data)
9
13
  - [Adding overrides to WalletConnect](#adding-overrides-to-walletconnect)
10
14
  - [Compile \& Publish](#compile--publish)
@@ -65,6 +69,30 @@ injectedConfig: [
65
69
  name: 'OKX'
66
70
  ```
67
71
 
72
+ #### If you need to override any of the following functions: signMessage, fetchPublicAddress, getSigner, isInstalledOnBrowser, etc...
73
+
74
+ 1. Create a file in the respective `ethereum/src/injected/` or `solana/src/injected/`. The basic file should follow this form:
75
+
76
+ ```ts
77
+ export class <NameOfConnector> extends InjectedWalletBase {
78
+ override name = '<Name Here>';
79
+ override walletConnectorFallback = true; // only specified on evm wallet connectors
80
+
81
+ constructor(props: EthWalletConnectorOpts) {
82
+ super(props);
83
+
84
+ this.wallet = findWalletBookWallet(this.walletBook, this.key);
85
+ }
86
+
87
+ // override the methods you need below
88
+ override async fetchPublicAddress() {
89
+ ...
90
+ }
91
+ }
92
+ ```
93
+
94
+ 2. Open `fetchInjectedWalletConnectors.ts` for the respective network package (`etherem/solana/...`) and add the new InjectedWalletBase class to `injectedWalletOverrides` and the key (normalized name) to the `filterInjectedWalletKeyOverrides`
95
+
68
96
  #### Things to remember when adding a new wallet
69
97
 
70
98
  - `IF the new wallet is also in wallletconnect.json`: make sure that the key used in `firstParty/index.ts` is the `same` as the value from `walletconnect.json` as to inherit the properties from that wallet definition.
@@ -72,11 +100,28 @@ name: 'OKX'
72
100
  - For every extension locator you add for the new wallet, add the negation `[{ flag: 'isOkxWallet', value: false }, ...]` to the extensionLocators under the `metamask` key in firstParty.
73
101
  - If the new wallet is wallet connect enabled (exists in `walletconnect.json`), make sure to add: `filterFromWalletConnect: true` as a sibling to `injectedConfig` which will filter the wallet from the wallet connect connectors list and use wallet connect as fallback.
74
102
 
103
+ #### **Checklist before submitting the PR**:
104
+
105
+ [ ]: If this change adds a new file to the injected folder, add the wallet key to the `walletBookFallbackList` in `packages/wallet-book/src/build/index.ts`
106
+
107
+ [ ]: If the name is changing in walletbook, make sure that if there is no new file in the `injected/` folder, you make sure at least the `shortName` normalizes down to the wallet key
108
+
109
+ ```
110
+ myawesomenewwallet: {
111
+ ...
112
+ injectedConfig: { ... },
113
+ shortName: 'My Awesome New Wallet', // maps down to the key if you lowercase and remove special characters and spaces
114
+ name: 'Awesome Wallet' // this will be displayed in the wallet list and can be changed as long as the `shortName` normalizes to the key
115
+ }
116
+ ```
117
+
118
+ **NOTE:**
119
+
75
120
  Refer to `injectedConfigSchema` for the schema options
76
121
 
77
122
  ### Updating Wallet Connect Data
78
123
 
79
- - Download the data from : https://registry.walletconnect.org/data/wallets.json replace
124
+ - Download the data from : https://explorer-api.walletconnect.com/v3/wallets?projectId=XXXX replace
80
125
  - Replace packages/wallet-book/src/build/sources/walletConnect/walletconnect.json
81
126
  - [Compile & Publish](#compile--publish)
82
127
 
@@ -37,7 +37,12 @@ function __awaiter(thisArg, _arguments, P, generator) {
37
37
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
38
38
  step((generator = generator.apply(thisArg, _arguments || [])).next());
39
39
  });
40
- }
40
+ }
41
+
42
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
43
+ var e = new Error(message);
44
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
45
+ };
41
46
 
42
47
  exports.__awaiter = __awaiter;
43
48
  exports.__rest = __rest;
@@ -33,6 +33,11 @@ function __awaiter(thisArg, _arguments, P, generator) {
33
33
  function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
34
  step((generator = generator.apply(thisArg, _arguments || [])).next());
35
35
  });
36
- }
36
+ }
37
+
38
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
39
+ var e = new Error(message);
40
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
41
+ };
37
42
 
38
43
  export { __awaiter, __rest };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/wallet-book",
3
- "version": "1.1.0-alpha.9",
3
+ "version": "1.1.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -26,7 +26,9 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "zod": "3.22.4",
29
- "@dynamic-labs/logger": "1.1.0-alpha.9"
29
+ "@dynamic-labs/logger": "1.1.0",
30
+ "@dynamic-labs/utils": "1.1.0",
31
+ "util": "0.12.5"
30
32
  },
31
33
  "peerDependencies": {
32
34
  "react": "^17.0.2 || ^18.0.0",
@@ -13,6 +13,7 @@ export declare const generateWalletFallbacks: (wallets: WalletRecordsSchema) =>
13
13
  primaryColor?: string | undefined;
14
14
  spriteId?: string | undefined;
15
15
  } | undefined;
16
+ chainGroup?: string | undefined;
16
17
  chains?: string[] | undefined;
17
18
  desktop?: {
18
19
  chromeId?: string | undefined;
@@ -28,12 +29,14 @@ export declare const generateWalletFallbacks: (wallets: WalletRecordsSchema) =>
28
29
  } | undefined;
29
30
  filterFromWalletConnect?: boolean | undefined;
30
31
  group?: string | undefined;
32
+ hardwareWallets?: string[] | undefined;
31
33
  injectedConfig?: {
32
34
  chain: string;
33
35
  extensionLocators: {
34
36
  value: boolean;
35
37
  flag: string;
36
38
  }[];
39
+ providerInterface?: string | undefined;
37
40
  walletStandard?: {
38
41
  name: string;
39
42
  features: string[];
@@ -54,4 +57,5 @@ export declare const generateWalletFallbacks: (wallets: WalletRecordsSchema) =>
54
57
  walletConnect?: {
55
58
  sdks?: string[] | undefined;
56
59
  } | undefined;
60
+ walletGroup?: string | undefined;
57
61
  }>;
@@ -1,27 +1,41 @@
1
1
  export declare const walletConnectSourceData: Record<string, {
2
+ id: string;
3
+ metadata: {
4
+ shortName: string | null;
5
+ colors: {
6
+ primary: string | null;
7
+ secondary: string | null;
8
+ };
9
+ };
10
+ name: string;
11
+ chains: string[];
12
+ desktop: {
13
+ native: string | null;
14
+ universal: string | null;
15
+ };
16
+ rdns: string | null;
17
+ mobile: {
18
+ native: string | null;
19
+ universal: string | null;
20
+ };
21
+ sdks: string[];
2
22
  app: {
3
23
  android: string | null;
24
+ ios: string | null;
25
+ opera: string | null;
4
26
  browser: string | null;
5
27
  chrome: string | null;
6
28
  edge: string | null;
7
29
  firefox: string | null;
8
- ios: string | null;
9
30
  linux: string | null;
10
31
  mac: string | null;
11
- opera: string | null;
12
32
  safari: string | null;
13
33
  windows: string | null;
14
34
  };
15
35
  app_type: string;
16
36
  category: string | null;
17
- chains: string[];
18
37
  description: string | null;
19
- desktop: {
20
- native: string | null;
21
- universal: string | null;
22
- };
23
38
  homepage: string;
24
- id: string;
25
39
  image_id: string;
26
40
  image_url: {
27
41
  lg: string;
@@ -32,29 +46,15 @@ export declare const walletConnectSourceData: Record<string, {
32
46
  injected_id: string;
33
47
  namespace: string;
34
48
  }[] | null;
35
- metadata: {
36
- colors: {
37
- primary: string | null;
38
- secondary: string | null;
39
- };
40
- shortName: string | null;
41
- };
42
- mobile: {
43
- native: string | null;
44
- universal: string | null;
45
- };
46
- name: string;
47
- rdns: string | null;
48
- sdks: string[];
49
49
  slug: string;
50
50
  updatedAt: string;
51
51
  versions: string[];
52
52
  supported_standards?: {
53
53
  id: string;
54
- standard_id: number;
55
- standard_prefix: string;
56
54
  title: string;
57
55
  url: string;
56
+ standard_id: number;
57
+ standard_prefix: string;
58
58
  }[] | undefined;
59
59
  }>;
60
60
  export declare const walletConnectTransformedData: Promise<Record<string, {
@@ -65,6 +65,7 @@ export declare const walletConnectTransformedData: Promise<Record<string, {
65
65
  primaryColor?: string | undefined;
66
66
  spriteId?: string | undefined;
67
67
  } | undefined;
68
+ chainGroup?: string | undefined;
68
69
  chains?: string[] | undefined;
69
70
  desktop?: {
70
71
  chromeId?: string | undefined;
@@ -80,12 +81,14 @@ export declare const walletConnectTransformedData: Promise<Record<string, {
80
81
  } | undefined;
81
82
  filterFromWalletConnect?: boolean | undefined;
82
83
  group?: string | undefined;
84
+ hardwareWallets?: string[] | undefined;
83
85
  injectedConfig?: {
84
86
  chain: string;
85
87
  extensionLocators: {
86
88
  value: boolean;
87
89
  flag: string;
88
90
  }[];
91
+ providerInterface?: string | undefined;
89
92
  walletStandard?: {
90
93
  name: string;
91
94
  features: string[];
@@ -106,4 +109,5 @@ export declare const walletConnectTransformedData: Promise<Record<string, {
106
109
  walletConnect?: {
107
110
  sdks?: string[] | undefined;
108
111
  } | undefined;
112
+ walletGroup?: string | undefined;
109
113
  }>>;
@@ -75,6 +75,12 @@ export declare const applyOverrides: (sourceData: any, overrides?: {
75
75
  };
76
76
  };
77
77
  okxwallet: {
78
+ brand: {
79
+ imageId: {
80
+ action: string;
81
+ value: null;
82
+ };
83
+ };
78
84
  desktop: {
79
85
  action: string;
80
86
  value: {
@@ -239,6 +245,12 @@ export declare const walletConnectOverrides: {
239
245
  };
240
246
  };
241
247
  okxwallet: {
248
+ brand: {
249
+ imageId: {
250
+ action: string;
251
+ value: null;
252
+ };
253
+ };
242
254
  desktop: {
243
255
  action: string;
244
256
  value: {
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _tslib = require('../../_virtual/_tslib.cjs');
6
+ var react = require('react');
7
+ var getWalletIconUrl = require('../helpers/getWalletIconUrl.cjs');
8
+ require('../helpers/logger.cjs');
9
+ var getBrandIconUrl = require('../helpers/getBrandIconUrl.cjs');
10
+
11
+ const BrandIcon = (_a) => {
12
+ var { brand, walletKey } = _a, props = _tslib.__rest(_a, ["brand", "walletKey"]);
13
+ const [imgError, setImgError] = react.useState(false);
14
+ const walletIconUrl = getBrandIconUrl.getBrandIconUrl(brand);
15
+ const defaultWalletIconUrl = getWalletIconUrl.getDefaultWalletIconUrl();
16
+ if (!walletIconUrl) {
17
+ return react.createElement(react.Fragment, {});
18
+ }
19
+ const onError = () => {
20
+ setImgError(true);
21
+ };
22
+ return react.createElement('img', Object.assign(Object.assign({ 'data-testid': `wallet-icon-${walletKey}` }, props), { alt: brand.alt, onError: onError, src: imgError ? defaultWalletIconUrl : walletIconUrl }));
23
+ };
24
+
25
+ exports.BrandIcon = BrandIcon;
@@ -0,0 +1,8 @@
1
+ import { FC, ImgHTMLAttributes } from 'react';
2
+ import { WalletBrand } from '../schemas';
3
+ type BrandIconProps = {
4
+ walletKey: string;
5
+ brand: WalletBrand;
6
+ } & ImgHTMLAttributes<HTMLImageElement>;
7
+ export declare const BrandIcon: FC<BrandIconProps>;
8
+ export {};
@@ -0,0 +1,21 @@
1
+ import { __rest } from '../../_virtual/_tslib.js';
2
+ import { useState, createElement, Fragment } from 'react';
3
+ import { getDefaultWalletIconUrl } from '../helpers/getWalletIconUrl.js';
4
+ import '../helpers/logger.js';
5
+ import { getBrandIconUrl } from '../helpers/getBrandIconUrl.js';
6
+
7
+ const BrandIcon = (_a) => {
8
+ var { brand, walletKey } = _a, props = __rest(_a, ["brand", "walletKey"]);
9
+ const [imgError, setImgError] = useState(false);
10
+ const walletIconUrl = getBrandIconUrl(brand);
11
+ const defaultWalletIconUrl = getDefaultWalletIconUrl();
12
+ if (!walletIconUrl) {
13
+ return createElement(Fragment, {});
14
+ }
15
+ const onError = () => {
16
+ setImgError(true);
17
+ };
18
+ return createElement('img', Object.assign(Object.assign({ 'data-testid': `wallet-icon-${walletKey}` }, props), { alt: brand.alt, onError: onError, src: imgError ? defaultWalletIconUrl : walletIconUrl }));
19
+ };
20
+
21
+ export { BrandIcon };
@@ -5,8 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var _tslib = require('../../_virtual/_tslib.cjs');
6
6
  var react = require('react');
7
7
  var getWalletIconUrl = require('../helpers/getWalletIconUrl.cjs');
8
- var findWalletBookWallet = require('../helpers/findWalletBookWallet.cjs');
9
8
  require('../helpers/logger.cjs');
9
+ var findWalletBookWallet = require('../helpers/findWalletBookWallet.cjs');
10
+ require('@dynamic-labs/utils');
10
11
  require('../schemas/walletConnectSourceSchema.cjs');
11
12
  require('../schemas/walletBookSchema.cjs');
12
13
  require('../schemas/walletSchema.cjs');
@@ -1,8 +1,9 @@
1
1
  import { __rest } from '../../_virtual/_tslib.js';
2
2
  import { useState, createElement, Fragment } from 'react';
3
3
  import { getWalletIconUrl, getDefaultWalletIconUrl } from '../helpers/getWalletIconUrl.js';
4
- import { findWalletBookWallet } from '../helpers/findWalletBookWallet.js';
5
4
  import '../helpers/logger.js';
5
+ import { findWalletBookWallet } from '../helpers/findWalletBookWallet.js';
6
+ import '@dynamic-labs/utils';
6
7
  import '../schemas/walletConnectSourceSchema.js';
7
8
  import '../schemas/walletBookSchema.js';
8
9
  import '../schemas/walletSchema.js';
@@ -1,2 +1,3 @@
1
1
  export * from './WalletIcon';
2
2
  export * from './WalletBookContext';
3
+ export * from './BrandIcon';
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var getWalletBookWallet = require('./getWalletBookWallet.cjs');
6
- var logger = require('./logger.cjs');
7
6
 
8
7
  const findWalletBookWallet = (walletBook, walletKey) => {
9
8
  try {
@@ -11,7 +10,6 @@ const findWalletBookWallet = (walletBook, walletKey) => {
11
10
  return walletData;
12
11
  }
13
12
  catch (err) {
14
- logger.logger.warn(err);
15
13
  return undefined;
16
14
  }
17
15
  };
@@ -7,6 +7,7 @@ export declare const findWalletBookWallet: (walletBook: WalletBookSchema, wallet
7
7
  primaryColor?: string | undefined;
8
8
  spriteId?: string | undefined;
9
9
  } | undefined;
10
+ chainGroup?: string | undefined;
10
11
  chains?: string[] | undefined;
11
12
  desktop?: {
12
13
  chromeId?: string | undefined;
@@ -22,12 +23,14 @@ export declare const findWalletBookWallet: (walletBook: WalletBookSchema, wallet
22
23
  } | undefined;
23
24
  filterFromWalletConnect?: boolean | undefined;
24
25
  group?: string | undefined;
26
+ hardwareWallets?: string[] | undefined;
25
27
  injectedConfig?: {
26
28
  chain: string;
27
29
  extensionLocators: {
28
30
  value: boolean;
29
31
  flag: string;
30
32
  }[];
33
+ providerInterface?: string | undefined;
31
34
  walletStandard?: {
32
35
  name: string;
33
36
  features: string[];
@@ -48,5 +51,5 @@ export declare const findWalletBookWallet: (walletBook: WalletBookSchema, wallet
48
51
  walletConnect?: {
49
52
  sdks?: string[] | undefined;
50
53
  } | undefined;
51
- walletStandardId?: string | undefined;
54
+ walletGroup?: string | undefined;
52
55
  } | undefined;
@@ -1,5 +1,4 @@
1
1
  import { getWalletBookWallet } from './getWalletBookWallet.js';
2
- import { logger } from './logger.js';
3
2
 
4
3
  const findWalletBookWallet = (walletBook, walletKey) => {
5
4
  try {
@@ -7,7 +6,6 @@ const findWalletBookWallet = (walletBook, walletKey) => {
7
6
  return walletData;
8
7
  }
9
8
  catch (err) {
10
- logger.warn(err);
11
9
  return undefined;
12
10
  }
13
11
  };
@@ -8,4 +8,13 @@ export declare const findWalletGroup: (walletBook: WalletBookSchema, walletGroup
8
8
  primaryColor?: string | undefined;
9
9
  spriteId?: string | undefined;
10
10
  } | undefined;
11
+ walletOverrides?: Record<string, {
12
+ brand?: {
13
+ alt?: string | undefined;
14
+ imageId?: string | undefined;
15
+ primaryColor?: string | undefined;
16
+ spriteId?: string | undefined;
17
+ } | undefined;
18
+ name?: string | undefined;
19
+ }> | undefined;
11
20
  } | undefined;