@dynamic-labs/wallet-book 0.18.0-RC.0 → 0.18.0-RC.10

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 (76) hide show
  1. package/CHANGELOG.md +157 -0
  2. package/package.json +5 -4
  3. package/src/build/index.d.ts +41 -1
  4. package/src/build/sources/walletConnect/index.d.ts +11 -11
  5. package/src/build/sources/walletConnectOverrides/index.d.ts +12 -0
  6. package/src/components/WalletBookContext.cjs +13 -0
  7. package/src/components/WalletBookContext.d.ts +9 -0
  8. package/src/components/WalletBookContext.js +8 -0
  9. package/src/components/WalletIcon.cjs +8 -3
  10. package/src/components/WalletIcon.js +8 -3
  11. package/src/components/index.d.ts +1 -0
  12. package/src/helpers/findWalletBookWallet.cjs +2 -2
  13. package/src/helpers/findWalletBookWallet.d.ts +2 -1
  14. package/src/helpers/findWalletBookWallet.js +2 -2
  15. package/src/helpers/findWalletGroup.cjs +2 -2
  16. package/src/helpers/findWalletGroup.d.ts +2 -1
  17. package/src/helpers/findWalletGroup.js +2 -2
  18. package/src/helpers/getWalletBookCdnUrl.cjs +4 -1
  19. package/src/helpers/getWalletBookCdnUrl.js +4 -1
  20. package/src/helpers/getWalletBookWallet.cjs +3 -6
  21. package/src/helpers/getWalletBookWallet.d.ts +2 -2
  22. package/src/helpers/getWalletBookWallet.js +3 -6
  23. package/src/helpers/getWalletGroup.cjs +1 -5
  24. package/src/helpers/getWalletGroup.d.ts +2 -1
  25. package/src/helpers/getWalletGroup.js +1 -5
  26. package/src/helpers/{getIconUrl.cjs → getWalletIconUrl.cjs} +2 -2
  27. package/src/helpers/getWalletIconUrl.d.ts +2 -0
  28. package/src/helpers/{getIconUrl.js → getWalletIconUrl.js} +2 -2
  29. package/src/helpers/getWalletLinks.cjs +12 -11
  30. package/src/helpers/getWalletLinks.d.ts +2 -1
  31. package/src/helpers/getWalletLinks.js +12 -11
  32. package/src/helpers/getWalletPrimaryColor.cjs +2 -2
  33. package/src/helpers/getWalletPrimaryColor.d.ts +2 -1
  34. package/src/helpers/getWalletPrimaryColor.js +2 -2
  35. package/src/helpers/index.d.ts +1 -1
  36. package/src/hooks/index.d.ts +1 -1
  37. package/src/hooks/useWalletBookCdn.cjs +33 -0
  38. package/src/hooks/useWalletBookCdn.js +29 -0
  39. package/src/hooks/useWalletBookContext.cjs +20 -0
  40. package/src/hooks/useWalletBookContext.d.ts +1 -0
  41. package/src/hooks/useWalletBookContext.js +16 -0
  42. package/src/index.cjs +8 -5
  43. package/src/index.d.ts +2 -2
  44. package/src/index.js +4 -3
  45. package/src/schemas/utils/filterEmptyObject.cjs +12 -0
  46. package/src/schemas/utils/filterEmptyObject.js +8 -0
  47. package/src/schemas/utils/nonEmptyString.cjs +12 -0
  48. package/src/schemas/utils/nonEmptyString.js +8 -0
  49. package/src/schemas/utils/nonEmptyStringArray.cjs +12 -0
  50. package/src/schemas/utils/nonEmptyStringArray.js +8 -0
  51. package/src/schemas/utils/transformAndroidId.cjs +23 -0
  52. package/src/schemas/utils/transformAndroidId.js +19 -0
  53. package/src/schemas/utils/transformChromeExtensionId.cjs +20 -0
  54. package/src/schemas/utils/transformChromeExtensionId.js +16 -0
  55. package/src/schemas/utils/transformEdgeExtensionId.cjs +20 -0
  56. package/src/schemas/utils/transformEdgeExtensionId.js +16 -0
  57. package/src/schemas/utils/transformFirefoxExtensionId.cjs +20 -0
  58. package/src/schemas/utils/transformFirefoxExtensionId.js +16 -0
  59. package/src/schemas/utils/transformIosId.cjs +27 -0
  60. package/src/schemas/utils/transformIosId.js +23 -0
  61. package/src/schemas/walletBookSchema.cjs +16 -0
  62. package/src/schemas/walletBookSchema.js +12 -0
  63. package/src/schemas/walletConnectSourceSchema.cjs +73 -0
  64. package/src/schemas/walletConnectSourceSchema.js +69 -0
  65. package/src/schemas/walletGroup.cjs +32 -0
  66. package/src/schemas/walletGroup.js +28 -0
  67. package/src/schemas/walletSchema.cjs +83 -0
  68. package/src/schemas/walletSchema.js +79 -0
  69. package/wallet-book-fallbacks.cjs +299 -0
  70. package/wallet-book-fallbacks.js +293 -0
  71. package/src/helpers/getIconUrl.d.ts +0 -1
  72. package/src/hooks/useWalletBook.cjs +0 -9
  73. package/src/hooks/useWalletBook.d.ts +0 -2
  74. package/src/hooks/useWalletBook.js +0 -5
  75. package/wallet-book.cjs +0 -6534
  76. package/wallet-book.js +0 -6528
package/CHANGELOG.md CHANGED
@@ -1,4 +1,161 @@
1
1
 
2
+ ## [0.18.0-RC.10](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.9...v0.18.0-RC.10) (2023-07-06)
3
+
4
+
5
+ ### Features
6
+
7
+ * Update handleUnlink to support connected only wallets ([#2573](https://github.com/dynamic-labs/DynamicAuth/issues/2573)) ([07438c9](https://github.com/dynamic-labs/DynamicAuth/commit/07438c9580b830aa68fcc6a06ea4050a3743a501))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * restore connectedWallet clearing function ([#2575](https://github.com/dynamic-labs/DynamicAuth/issues/2575)) ([8d3c41a](https://github.com/dynamic-labs/DynamicAuth/commit/8d3c41a6871037b1003270e724259f23c5f6f370))
13
+
14
+ ## [0.18.0-RC.9](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.8...v0.18.0-RC.9) (2023-07-04)
15
+
16
+
17
+ ### Features
18
+
19
+ * add Network Not Supported prompt to connect-only & show prompt before sign in connect-sign mode ([#2474](https://github.com/dynamic-labs/DynamicAuth/issues/2474)) ([8d5bfa9](https://github.com/dynamic-labs/DynamicAuth/commit/8d5bfa97ca4da50e06ce258a38a63e7407a795f6))
20
+ * **DYN-2602:** add ability to unlink connected wallet ([#2494](https://github.com/dynamic-labs/DynamicAuth/issues/2494)) ([389861b](https://github.com/dynamic-labs/DynamicAuth/commit/389861bc0281baec379b1593e529cef3467f3326))
21
+ * **DYN-2604:** add chainId property to walletsByChain object ([#2405](https://github.com/dynamic-labs/DynamicAuth/issues/2405)) ([d9b42f7](https://github.com/dynamic-labs/DynamicAuth/commit/d9b42f7b1d53dac1ed0228ecb5e56a44c6abd8d2))
22
+ * **DynamicAuthLayout:** show connected wallet progress ([#2567](https://github.com/dynamic-labs/DynamicAuth/issues/2567)) ([a20ff6f](https://github.com/dynamic-labs/DynamicAuth/commit/a20ff6f32b360ccc699d2a271c7a96751ae87d29))
23
+ * **DynamicBridgeFlow:** add bridge flow ([#2543](https://github.com/dynamic-labs/DynamicAuth/issues/2543)) ([79c4c87](https://github.com/dynamic-labs/DynamicAuth/commit/79c4c870d47a0c853c292a8d913bd9be9e209a15))
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * don't force required chain to eth in case is not enabled ([#2537](https://github.com/dynamic-labs/DynamicAuth/issues/2537)) ([b01d6c9](https://github.com/dynamic-labs/DynamicAuth/commit/b01d6c9e91e9971e82739c5a2c900de4768f977c))
29
+ * log out if there's any session sync issue ([#2545](https://github.com/dynamic-labs/DynamicAuth/issues/2545)) ([29972fa](https://github.com/dynamic-labs/DynamicAuth/commit/29972fad1067f5550a61f6e2cd9adcaf811fd268))
30
+ * persist chain to WalletConnect session when changed in wallet ([#2556](https://github.com/dynamic-labs/DynamicAuth/issues/2556)) ([fc9ec35](https://github.com/dynamic-labs/DynamicAuth/commit/fc9ec3501de1e3235adee4df95b296dc22cce23e))
31
+ * WC2 sign-message on non-selected chain ([#2544](https://github.com/dynamic-labs/DynamicAuth/issues/2544)) ([48a4384](https://github.com/dynamic-labs/DynamicAuth/commit/48a4384f77c29775e0c28ed335956cfbd6f89ca3))
32
+ * **wcv2:** add eth_signTypedData_v4 to optional methods ([#2527](https://github.com/dynamic-labs/DynamicAuth/issues/2527)) ([b99474b](https://github.com/dynamic-labs/DynamicAuth/commit/b99474b81b083134762be0fe9554a6f049b3edda))
33
+ * **wcv2:** allow getWeb3Provider to wait to provider init ([#2523](https://github.com/dynamic-labs/DynamicAuth/issues/2523)) ([d9c7fee](https://github.com/dynamic-labs/DynamicAuth/commit/d9c7fee10d2a6c766043515e19829fd7e3d5b2ef))
34
+
35
+ ## [0.18.0-RC.8](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.7...v0.18.0-RC.8) (2023-06-29)
36
+
37
+
38
+ ### Features
39
+
40
+ * add support for custom walletconnect v1 bridge ([#2487](https://github.com/dynamic-labs/DynamicAuth/issues/2487)) ([5b0ca2e](https://github.com/dynamic-labs/DynamicAuth/commit/5b0ca2e4e8aa241ed13e4f38346c31da8479a6c4))
41
+ * **DYN-2623:** improve error message on sign cancellation for wallets ([#2493](https://github.com/dynamic-labs/DynamicAuth/issues/2493)) ([081c515](https://github.com/dynamic-labs/DynamicAuth/commit/081c515c9d28d6fa4c0eaac388ee421a7b23144b))
42
+
43
+
44
+ ### Bug Fixes
45
+
46
+ * clearing the activeAccount value ([#2469](https://github.com/dynamic-labs/DynamicAuth/issues/2469)) ([ff75bde](https://github.com/dynamic-labs/DynamicAuth/commit/ff75bde938a4178541568b79754f773607b9d87f))
47
+ * don't initialize provider if it's already initialized ([#2490](https://github.com/dynamic-labs/DynamicAuth/issues/2490)) ([878d38f](https://github.com/dynamic-labs/DynamicAuth/commit/878d38f5c8d7d7448c65e58b25cefd9f3518217e))
48
+ * more wcv2 improvements ([#2475](https://github.com/dynamic-labs/DynamicAuth/issues/2475)) ([13baa84](https://github.com/dynamic-labs/DynamicAuth/commit/13baa84218d6259d02df7d8c387b40dc3cb11ce5)), closes [#2469](https://github.com/dynamic-labs/DynamicAuth/issues/2469) [#2470](https://github.com/dynamic-labs/DynamicAuth/issues/2470) [#2471](https://github.com/dynamic-labs/DynamicAuth/issues/2471) [#2477](https://github.com/dynamic-labs/DynamicAuth/issues/2477) [#2479](https://github.com/dynamic-labs/DynamicAuth/issues/2479) [#2471](https://github.com/dynamic-labs/DynamicAuth/issues/2471) [#2476](https://github.com/dynamic-labs/DynamicAuth/issues/2476)
49
+ * multiple improvements for WC2 ([#2458](https://github.com/dynamic-labs/DynamicAuth/issues/2458)) ([0813af2](https://github.com/dynamic-labs/DynamicAuth/commit/0813af2aafa8019868117084efe8ae147ac24581))
50
+ * revert changes since latest wcv2 improvements ([#2473](https://github.com/dynamic-labs/DynamicAuth/issues/2473)) ([3375371](https://github.com/dynamic-labs/DynamicAuth/commit/337537101a13d67b860748b62f172eba01d0b461)), closes [#2471](https://github.com/dynamic-labs/DynamicAuth/issues/2471) [#2470](https://github.com/dynamic-labs/DynamicAuth/issues/2470) [#2469](https://github.com/dynamic-labs/DynamicAuth/issues/2469)
51
+ * sync issue within connect-only mode ([#2496](https://github.com/dynamic-labs/DynamicAuth/issues/2496)) ([44af274](https://github.com/dynamic-labs/DynamicAuth/commit/44af274618c30fe65ec95739cd16a8ddde08e34e))
52
+ * typo in terms of service ([#2401](https://github.com/dynamic-labs/DynamicAuth/issues/2401)) ([5b195e5](https://github.com/dynamic-labs/DynamicAuth/commit/5b195e54479d9a88bd017fc45f2f2455d1caedc4))
53
+ * **wc_v1_bridget:** disable WC v2 when WC v1 bridge is set ([#2505](https://github.com/dynamic-labs/DynamicAuth/issues/2505)) ([b3f0a68](https://github.com/dynamic-labs/DynamicAuth/commit/b3f0a6895095bb37c635984fc970b52446e04f56))
54
+ * wc2 android improvements ([#2488](https://github.com/dynamic-labs/DynamicAuth/issues/2488)) ([f60ef9c](https://github.com/dynamic-labs/DynamicAuth/commit/f60ef9c1dd672f78199eee40edbe2707c043e1b5))
55
+ * **wcv2:** make sure to clear active account when ending session ([#2471](https://github.com/dynamic-labs/DynamicAuth/issues/2471)) ([b766df3](https://github.com/dynamic-labs/DynamicAuth/commit/b766df39a7e4dabc54fda9131b7bd9b53895cf2f))
56
+ * **wcv2:** use native or universal link when signing message ([#2502](https://github.com/dynamic-labs/DynamicAuth/issues/2502)) ([6e3e3fb](https://github.com/dynamic-labs/DynamicAuth/commit/6e3e3fbb58fb9e3eb314e6631ac2123237f41e8c))
57
+
58
+ ## [0.18.0-RC.7](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.6...v0.18.0-RC.7) (2023-06-23)
59
+
60
+
61
+ ### Features
62
+
63
+ * add bridge connect button ([#2399](https://github.com/dynamic-labs/DynamicAuth/issues/2399)) ([6987eea](https://github.com/dynamic-labs/DynamicAuth/commit/6987eeae8f49a5d077de6c4343b83ecbb1fc8b89))
64
+ * add useTimeout, useInterval and useIsomorphicLayoutEffect hooks ([#2418](https://github.com/dynamic-labs/DynamicAuth/issues/2418)) ([3ed8595](https://github.com/dynamic-labs/DynamicAuth/commit/3ed859526a6ec982b61a4335a9a63512d0e631e3))
65
+ * **DYN-2411:** WalletLockedView when user has valid jwt and all of their wallets are disconnected ([#2273](https://github.com/dynamic-labs/DynamicAuth/issues/2273)) ([2e6d0d6](https://github.com/dynamic-labs/DynamicAuth/commit/2e6d0d6ed734eb628bd05b6ad64560c496ad915f))
66
+ * **DYN-2598:** add powered by, update copy and paddings in the select wallet chain layout ([#2391](https://github.com/dynamic-labs/DynamicAuth/issues/2391)) ([f2a7924](https://github.com/dynamic-labs/DynamicAuth/commit/f2a79241dcf1ea5720242c2cc65a6fcd077ea0e9))
67
+ * **solana:** add logic to get network based on genesis hash ([#2402](https://github.com/dynamic-labs/DynamicAuth/issues/2402)) ([b76c626](https://github.com/dynamic-labs/DynamicAuth/commit/b76c62660bae334aef84678db5d8349a3d575630))
68
+
69
+
70
+ ### Bug Fixes
71
+
72
+ * better handling of the CB wallet provider ([#2376](https://github.com/dynamic-labs/DynamicAuth/issues/2376)) ([720e510](https://github.com/dynamic-labs/DynamicAuth/commit/720e510d0793c530d06db5eaa1d5a7be608703bb))
73
+ * clear AUTH_USER when there is no AUTH_TOKEN on LS ([#2423](https://github.com/dynamic-labs/DynamicAuth/issues/2423)) ([bf1e1c0](https://github.com/dynamic-labs/DynamicAuth/commit/bf1e1c0f8a7a7a852c67ef363613deecacdad92e))
74
+ * set auth mode to connect-and-sign when verifiying wallet ([#2369](https://github.com/dynamic-labs/DynamicAuth/issues/2369)) ([666aa69](https://github.com/dynamic-labs/DynamicAuth/commit/666aa6954d19551a354af933a69ab8eeee7a98b5))
75
+ * use getAuthTokenValue in initExpirationTime ([#2422](https://github.com/dynamic-labs/DynamicAuth/issues/2422)) ([fa8ff78](https://github.com/dynamic-labs/DynamicAuth/commit/fa8ff78d64421ca4447794fe9af53c175adf94c3))
76
+
77
+ ## [0.18.0-RC.6](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.5...v0.18.0-RC.6) (2023-06-20)
78
+
79
+
80
+ ### Features
81
+
82
+ * add export keys option for magic wallets ([#2377](https://github.com/dynamic-labs/DynamicAuth/issues/2377)) ([6b40f53](https://github.com/dynamic-labs/DynamicAuth/commit/6b40f538f207691b54fe2f245ed6018c467b83fe))
83
+
84
+
85
+ ### Bug Fixes
86
+
87
+ * add polyfill for css layers ([#2386](https://github.com/dynamic-labs/DynamicAuth/issues/2386)) ([3d489f5](https://github.com/dynamic-labs/DynamicAuth/commit/3d489f59d676864134a94d031697e0f83fc0d742))
88
+
89
+ ## [0.18.0-RC.5](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.4...v0.18.0-RC.5) (2023-06-20)
90
+
91
+
92
+ ### Bug Fixes
93
+
94
+ * remove process variable declaration ([#2389](https://github.com/dynamic-labs/DynamicAuth/issues/2389)) ([3c05121](https://github.com/dynamic-labs/DynamicAuth/commit/3c05121473850444f2c8393fa6e98e10d58870bc))
95
+ * wallet book singleton class to initalize when walletBook is undefined ([#2392](https://github.com/dynamic-labs/DynamicAuth/issues/2392)) ([7e07137](https://github.com/dynamic-labs/DynamicAuth/commit/7e0713712321439ee48e0c9ec88fef8c9aecd9cf))
96
+
97
+ ## [0.18.0-RC.4](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.3...v0.18.0-RC.4) (2023-06-20)
98
+
99
+
100
+ ### ⚠ BREAKING CHANGES
101
+
102
+ * **DYN-1260:** integrate wallets group view with group logic (#2305)
103
+
104
+ ### Features
105
+
106
+ * **DYN-1260:** integrate wallets group view with group logic ([#2305](https://github.com/dynamic-labs/DynamicAuth/issues/2305)) ([d5adb41](https://github.com/dynamic-labs/DynamicAuth/commit/d5adb411f263d1583abe5102e60d02573c6bf416))
107
+
108
+
109
+ ### Bug Fixes
110
+
111
+ * **DYN-2507:** too long network name shrinks users avatar ([#2383](https://github.com/dynamic-labs/DynamicAuth/issues/2383)) ([8586c3b](https://github.com/dynamic-labs/DynamicAuth/commit/8586c3be5a499118b7229eb7a3702d3350642107))
112
+ * hide wallet menu items that are not needed ([#2375](https://github.com/dynamic-labs/DynamicAuth/issues/2375)) ([35a6723](https://github.com/dynamic-labs/DynamicAuth/commit/35a67234da47f1a992a94c17e445b1fcba1c700f))
113
+ * use overflow auto to avoid showing the disabled scrollbar on gecko browser ([#2382](https://github.com/dynamic-labs/DynamicAuth/issues/2382)) ([16a7db4](https://github.com/dynamic-labs/DynamicAuth/commit/16a7db49e5b154bc6a4ea263c8a8c8a92cf1d810))
114
+ * use primary color for wallet group item copy ([#2384](https://github.com/dynamic-labs/DynamicAuth/issues/2384)) ([3fe439e](https://github.com/dynamic-labs/DynamicAuth/commit/3fe439ea2a271bc4b24b145db3f70774e221723e))
115
+
116
+ ## [0.18.0-RC.3](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.2...v0.18.0-RC.3) (2023-06-16)
117
+
118
+
119
+ ### Features
120
+
121
+ * add skeleton to walletlistfooter ([#2361](https://github.com/dynamic-labs/DynamicAuth/issues/2361)) ([676be6c](https://github.com/dynamic-labs/DynamicAuth/commit/676be6c108dff8df7175f0587cf0568658276e4e))
122
+
123
+
124
+ ### Bug Fixes
125
+
126
+ * **local-storage:** load auth token when stringified ([#2368](https://github.com/dynamic-labs/DynamicAuth/issues/2368)) ([3a54266](https://github.com/dynamic-labs/DynamicAuth/commit/3a54266fde3cd1f7362ccc490f89b8925132271b))
127
+
128
+ ## [0.18.0-RC.2](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.1...v0.18.0-RC.2) (2023-06-16)
129
+
130
+
131
+ ### Features
132
+
133
+ * add Dynamic Bridge widget ([#2316](https://github.com/dynamic-labs/DynamicAuth/issues/2316)) ([0e71a88](https://github.com/dynamic-labs/DynamicAuth/commit/0e71a88c6dd740583448ed7b45fa335aaa736079))
134
+ * add search bar to bridge wallets view ([#2357](https://github.com/dynamic-labs/DynamicAuth/issues/2357)) ([a8415fc](https://github.com/dynamic-labs/DynamicAuth/commit/a8415fc744216660a78c1443962711699e45429a))
135
+ * bridge flow improvements ([#2367](https://github.com/dynamic-labs/DynamicAuth/issues/2367)) ([38a44be](https://github.com/dynamic-labs/DynamicAuth/commit/38a44be417fd1363b0d8e45ec1834f9aaf680427))
136
+ * **Bridge:** add bridge navigation component ([#2340](https://github.com/dynamic-labs/DynamicAuth/issues/2340)) ([1e9adae](https://github.com/dynamic-labs/DynamicAuth/commit/1e9adaed3682bc9a7aab385221818946cad397f2))
137
+ * **Bridge:** integrate dynamic bridge ui ([#2354](https://github.com/dynamic-labs/DynamicAuth/issues/2354)) ([1465bf8](https://github.com/dynamic-labs/DynamicAuth/commit/1465bf8717cbc9905285c2d867bc3e1d0cd1114b))
138
+ * **DYN-2519:** create state for multiple connected wallets ([#2326](https://github.com/dynamic-labs/DynamicAuth/issues/2326)) ([fc05aa4](https://github.com/dynamic-labs/DynamicAuth/commit/fc05aa4d91b0af8950c5da84c69130557ba36b09)), closes [#2319](https://github.com/dynamic-labs/DynamicAuth/issues/2319)
139
+ * **MultiWalletStepSelectorModal:** add modal to connect multiple wallets ([#2348](https://github.com/dynamic-labs/DynamicAuth/issues/2348)) ([39ce0b2](https://github.com/dynamic-labs/DynamicAuth/commit/39ce0b26fdf6494a4e1ba7867e80bf399d11631f))
140
+ * use wallet-book from CDN ([#2352](https://github.com/dynamic-labs/DynamicAuth/issues/2352)) ([9d1498f](https://github.com/dynamic-labs/DynamicAuth/commit/9d1498f2aec4bb9f3e3d6b386d9cafea3a33bd58))
141
+
142
+
143
+ ### Bug Fixes
144
+
145
+ * handle email only without primary wallet state ([#2342](https://github.com/dynamic-labs/DynamicAuth/issues/2342)) ([98583bb](https://github.com/dynamic-labs/DynamicAuth/commit/98583bb8820ac80967bf1059cbaf47d04bfd603a))
146
+ * s3 cp for walletbook json ([8127b79](https://github.com/dynamic-labs/DynamicAuth/commit/8127b790333b36f40a2cc230a576c01aaad42196))
147
+ * setting initial view when error in auth flow ([#2345](https://github.com/dynamic-labs/DynamicAuth/issues/2345)) ([85dcefb](https://github.com/dynamic-labs/DynamicAuth/commit/85dcefb54be498b540904b381b53f9ea7e0cd024))
148
+ * typo in github action ([d746bc0](https://github.com/dynamic-labs/DynamicAuth/commit/d746bc01981a3263e3ab4f654debf77b408cda3a))
149
+ * **widget:** add fallback icon when oauth provider does not exist ([#2349](https://github.com/dynamic-labs/DynamicAuth/issues/2349)) ([bd2a505](https://github.com/dynamic-labs/DynamicAuth/commit/bd2a505724affd6f5356c0c4f31586ffd188e539))
150
+
151
+ ## [0.18.0-RC.1](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.0-RC.0...v0.18.0-RC.1) (2023-06-14)
152
+
153
+
154
+ ### Bug Fixes
155
+
156
+ * await setEmailInput in handleSubmit for LoginWithemailForm ([#2336](https://github.com/dynamic-labs/DynamicAuth/issues/2336)) ([05b1fe0](https://github.com/dynamic-labs/DynamicAuth/commit/05b1fe09abaa1563fb187cf410b1e0e991f29c60))
157
+ * don't remove project settings from ls if there's a connected wallet ([#2329](https://github.com/dynamic-labs/DynamicAuth/issues/2329)) ([bc2f627](https://github.com/dynamic-labs/DynamicAuth/commit/bc2f627a80d0a8e6a4637dc60c699ffd07362a19))
158
+
2
159
  ## [0.18.0-RC.0](https://github.com/dynamic-labs/DynamicAuth/compare/v0.17.0...v0.18.0-RC.0) (2023-06-14)
3
160
 
4
161
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/wallet-book",
3
- "version": "0.18.0-RC.0",
3
+ "version": "0.18.0-RC.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -24,11 +24,12 @@
24
24
  },
25
25
  "./package.json": "./package.json"
26
26
  },
27
+ "dependencies": {
28
+ "zod": "3.21.4",
29
+ "@dynamic-labs/logger": "0.18.0-RC.10"
30
+ },
27
31
  "peerDependencies": {
28
32
  "react": "^17.0.2 || ^18.0.0",
29
33
  "react-dom": "^17.0.2 || ^18.0.0"
30
- },
31
- "dependencies": {
32
- "@dynamic-labs/logger": "0.18.0-RC.0"
33
34
  }
34
35
  }
@@ -1 +1,41 @@
1
- export {};
1
+ import { WalletRecordsSchema } from '../schemas';
2
+ /**
3
+ * Create a fallback wallet book with only the wallets that are in the fallback list.
4
+ * They must exist in the main wallet book
5
+ * @param wallets
6
+ * @returns
7
+ */
8
+ export declare const generateWalletFallbacks: (wallets: WalletRecordsSchema) => Record<string, {
9
+ name: string;
10
+ brand?: {
11
+ alt?: string | undefined;
12
+ imageId?: string | undefined;
13
+ primaryColor?: string | undefined;
14
+ spriteId?: string | undefined;
15
+ } | undefined;
16
+ chains?: string[] | undefined;
17
+ desktop?: {
18
+ chromeId?: string | undefined;
19
+ edgeId?: string | undefined;
20
+ firefoxId?: string | undefined;
21
+ native?: string | undefined;
22
+ operaId?: string | undefined;
23
+ safariId?: string | undefined;
24
+ universal?: string | undefined;
25
+ } | undefined;
26
+ group?: string | undefined;
27
+ mobile?: {
28
+ android?: string | null | undefined;
29
+ androidId?: string | undefined;
30
+ ios?: string | null | undefined;
31
+ iosId?: string | undefined;
32
+ native?: string | undefined;
33
+ universal?: string | undefined;
34
+ } | undefined;
35
+ shortName?: string | undefined;
36
+ showOnlyIfInstalled?: boolean | undefined;
37
+ switchNetworkOnlyFromWallet?: boolean | undefined;
38
+ walletConnect?: {
39
+ sdks?: string[] | undefined;
40
+ } | undefined;
41
+ }>;
@@ -1,12 +1,5 @@
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
- };
2
+ name: string;
10
3
  chains: string[];
11
4
  desktop: {
12
5
  native: string | null;
@@ -16,7 +9,6 @@ export declare const walletConnectSourceData: Record<string, {
16
9
  native: string | null;
17
10
  universal: string | null;
18
11
  };
19
- name: string;
20
12
  sdks: string[];
21
13
  app: {
22
14
  android: string | null;
@@ -34,6 +26,7 @@ export declare const walletConnectSourceData: Record<string, {
34
26
  app_type: string;
35
27
  description: string | null;
36
28
  homepage: string;
29
+ id: string;
37
30
  image_id: string;
38
31
  image_url: {
39
32
  lg: string;
@@ -44,13 +37,20 @@ export declare const walletConnectSourceData: Record<string, {
44
37
  injected_id: string;
45
38
  namespace: string;
46
39
  }[] | null;
40
+ metadata: {
41
+ shortName: string | null;
42
+ colors: {
43
+ primary: string | null;
44
+ secondary: string | null;
45
+ };
46
+ };
47
47
  slug: string;
48
48
  supported_standards: {
49
- url: string;
50
49
  id: string;
51
- title: string;
52
50
  standard_id: number;
53
51
  standard_prefix: string;
52
+ title: string;
53
+ url: string;
54
54
  }[];
55
55
  updatedAt: string;
56
56
  versions: string[];
@@ -35,6 +35,12 @@ export declare const applyOverrides: (sourceData: any, overrides?: {
35
35
  value: null;
36
36
  };
37
37
  };
38
+ walletConnect: {
39
+ sdks: {
40
+ action: string;
41
+ value: string[];
42
+ };
43
+ };
38
44
  };
39
45
  rainbow: {
40
46
  brand: {
@@ -121,6 +127,12 @@ export declare const walletConnectOverrides: {
121
127
  value: null;
122
128
  };
123
129
  };
130
+ walletConnect: {
131
+ sdks: {
132
+ action: string;
133
+ value: string[];
134
+ };
135
+ };
124
136
  };
125
137
  rainbow: {
126
138
  brand: {
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var react = require('react');
6
+
7
+ const WalletBookContext = react.createContext({});
8
+ const WalletBookContextProvider = ({ walletBook, children, }) => react.createElement(WalletBookContext.Provider, {
9
+ value: { walletBook },
10
+ }, children);
11
+
12
+ exports.WalletBookContext = WalletBookContext;
13
+ exports.WalletBookContextProvider = WalletBookContextProvider;
@@ -0,0 +1,9 @@
1
+ import { WalletBookSchema } from '../schemas';
2
+ export type IWalletBookContext = {
3
+ walletBook: WalletBookSchema;
4
+ };
5
+ export declare const WalletBookContext: import("react").Context<IWalletBookContext>;
6
+ export declare const WalletBookContextProvider: ({ walletBook, children, }: {
7
+ walletBook: WalletBookSchema;
8
+ children: React.ReactNode;
9
+ }) => import("react").FunctionComponentElement<import("react").ProviderProps<IWalletBookContext>>;
@@ -0,0 +1,8 @@
1
+ import { createContext, createElement } from 'react';
2
+
3
+ const WalletBookContext = createContext({});
4
+ const WalletBookContextProvider = ({ walletBook, children, }) => createElement(WalletBookContext.Provider, {
5
+ value: { walletBook },
6
+ }, children);
7
+
8
+ export { WalletBookContext, WalletBookContextProvider };
@@ -3,13 +3,18 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var react = require('react');
6
- var getIconUrl = require('../helpers/getIconUrl.cjs');
6
+ var getWalletIconUrl = require('../helpers/getWalletIconUrl.cjs');
7
7
  var findWalletBookWallet = require('../helpers/findWalletBookWallet.cjs');
8
8
  require('../helpers/logger.cjs');
9
+ require('../schemas/walletConnectSourceSchema.cjs');
10
+ require('../schemas/walletBookSchema.cjs');
11
+ require('../schemas/walletSchema.cjs');
12
+ var useWalletBookContext = require('../hooks/useWalletBookContext.cjs');
9
13
 
10
14
  const WalletIcon = ({ walletName, children, ...props }) => {
11
- const walletData = findWalletBookWallet.findWalletBookWallet(walletName);
12
- const walletIconUrl = getIconUrl.getWalletIconUrl(walletName);
15
+ const { walletBook } = useWalletBookContext.useWalletBookContext();
16
+ const walletData = findWalletBookWallet.findWalletBookWallet(walletBook, walletName);
17
+ const walletIconUrl = getWalletIconUrl.getWalletIconUrl(walletBook, walletName);
13
18
  if (!walletData || !walletData.brand || !walletIconUrl) {
14
19
  return react.createElement(react.Fragment, {}, children);
15
20
  }
@@ -1,11 +1,16 @@
1
1
  import { createElement, Fragment } from 'react';
2
- import { getWalletIconUrl } from '../helpers/getIconUrl.js';
2
+ import { getWalletIconUrl } from '../helpers/getWalletIconUrl.js';
3
3
  import { findWalletBookWallet } from '../helpers/findWalletBookWallet.js';
4
4
  import '../helpers/logger.js';
5
+ import '../schemas/walletConnectSourceSchema.js';
6
+ import '../schemas/walletBookSchema.js';
7
+ import '../schemas/walletSchema.js';
8
+ import { useWalletBookContext } from '../hooks/useWalletBookContext.js';
5
9
 
6
10
  const WalletIcon = ({ walletName, children, ...props }) => {
7
- const walletData = findWalletBookWallet(walletName);
8
- const walletIconUrl = getWalletIconUrl(walletName);
11
+ const { walletBook } = useWalletBookContext();
12
+ const walletData = findWalletBookWallet(walletBook, walletName);
13
+ const walletIconUrl = getWalletIconUrl(walletBook, walletName);
9
14
  if (!walletData || !walletData.brand || !walletIconUrl) {
10
15
  return createElement(Fragment, {}, children);
11
16
  }
@@ -1 +1,2 @@
1
1
  export * from './WalletIcon';
2
+ export * from './WalletBookContext';
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var getWalletBookWallet = require('./getWalletBookWallet.cjs');
6
6
  var logger = require('./logger.cjs');
7
7
 
8
- const findWalletBookWallet = (walletName) => {
8
+ const findWalletBookWallet = (walletBook, walletName) => {
9
9
  try {
10
- const walletData = getWalletBookWallet.getWalletBookWallet(walletName);
10
+ const walletData = getWalletBookWallet.getWalletBookWallet(walletBook, walletName);
11
11
  return walletData;
12
12
  }
13
13
  catch (err) {
@@ -1,4 +1,5 @@
1
- export declare const findWalletBookWallet: (walletName: string | undefined) => {
1
+ import { WalletBookSchema } from '../schemas';
2
+ export declare const findWalletBookWallet: (walletBook: WalletBookSchema, walletName: string | undefined) => {
2
3
  name: string;
3
4
  brand?: {
4
5
  alt?: string | undefined;
@@ -1,9 +1,9 @@
1
1
  import { getWalletBookWallet } from './getWalletBookWallet.js';
2
2
  import { logger } from './logger.js';
3
3
 
4
- const findWalletBookWallet = (walletName) => {
4
+ const findWalletBookWallet = (walletBook, walletName) => {
5
5
  try {
6
- const walletData = getWalletBookWallet(walletName);
6
+ const walletData = getWalletBookWallet(walletBook, walletName);
7
7
  return walletData;
8
8
  }
9
9
  catch (err) {
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var getWalletGroup = require('./getWalletGroup.cjs');
6
6
  var logger = require('./logger.cjs');
7
7
 
8
- const findWalletGroup = (walletGroup) => {
8
+ const findWalletGroup = (walletBook, walletGroup) => {
9
9
  try {
10
- return getWalletGroup.getWalletGroup(walletGroup);
10
+ return getWalletGroup.getWalletGroup(walletBook, walletGroup);
11
11
  }
12
12
  catch (err) {
13
13
  logger.logger.error(err);
@@ -1,4 +1,5 @@
1
- export declare const findWalletGroup: (walletGroup: string) => {
1
+ import { WalletBookSchema } from '../schemas';
2
+ export declare const findWalletGroup: (walletBook: WalletBookSchema, walletGroup: string) => {
2
3
  key: string;
3
4
  name: string;
4
5
  brand?: {
@@ -1,9 +1,9 @@
1
1
  import { getWalletGroup } from './getWalletGroup.js';
2
2
  import { logger } from './logger.js';
3
3
 
4
- const findWalletGroup = (walletGroup) => {
4
+ const findWalletGroup = (walletBook, walletGroup) => {
5
5
  try {
6
- return getWalletGroup(walletGroup);
6
+ return getWalletGroup(walletBook, walletGroup);
7
7
  }
8
8
  catch (err) {
9
9
  logger.error(err);
@@ -2,6 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const getWalletBookCdnUrl = () => 'https://dynamic-static-assets.com/wallet-book/v1/data.json';
5
+ const getWalletBookCdnUrl = () => process.env.WALLET_BOOK_CDN_URL ??
6
+ process.env.NEXT_PUBLIC_WALLET_BOOK_CDN_URL ??
7
+ process.env.REACT_APP_WALLET_BOOK_CDN_URL ??
8
+ 'https://dynamic-static-assets.com/wallet-book/v1/stable/wallet-book.json';
6
9
 
7
10
  exports.getWalletBookCdnUrl = getWalletBookCdnUrl;
@@ -1,3 +1,6 @@
1
- const getWalletBookCdnUrl = () => 'https://dynamic-static-assets.com/wallet-book/v1/data.json';
1
+ const getWalletBookCdnUrl = () => process.env.WALLET_BOOK_CDN_URL ??
2
+ process.env.NEXT_PUBLIC_WALLET_BOOK_CDN_URL ??
3
+ process.env.REACT_APP_WALLET_BOOK_CDN_URL ??
4
+ 'https://dynamic-static-assets.com/wallet-book/v1/stable/wallet-book.json';
2
5
 
3
6
  export { getWalletBookCdnUrl };
@@ -2,16 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var useWalletBook = require('../hooks/useWalletBook.cjs');
6
- require('react');
7
5
  var normalizeWalletName = require('./normalizeWalletName.cjs');
8
6
 
9
- const getWalletBookWallet = (walletName) => {
10
- const walletBook = useWalletBook.useWalletBook();
7
+ const getWalletBookWallet = (walletBook, walletName) => {
11
8
  const normalizedWalletName = normalizeWalletName.normalizeWalletName(walletName);
12
- const walletData = walletBook.wallets[normalizedWalletName];
9
+ const walletData = walletBook?.wallets?.[normalizedWalletName];
13
10
  if (!walletData)
14
- throw new Error(`Wallet ${walletName} not found in wallet book`);
11
+ throw new Error(`Wallet ${walletName} not found in wallet book (${Object.keys(walletBook?.wallets ?? {}).length} wallets found)`);
15
12
  return walletData;
16
13
  };
17
14
 
@@ -1,2 +1,2 @@
1
- import { WalletSchema } from '../schemas';
2
- export declare const getWalletBookWallet: (walletName: string | undefined) => WalletSchema;
1
+ import { WalletBookSchema, WalletSchema } from '../schemas';
2
+ export declare const getWalletBookWallet: (walletBook: WalletBookSchema, walletName: string | undefined) => WalletSchema;
@@ -1,13 +1,10 @@
1
- import { useWalletBook } from '../hooks/useWalletBook.js';
2
- import 'react';
3
1
  import { normalizeWalletName } from './normalizeWalletName.js';
4
2
 
5
- const getWalletBookWallet = (walletName) => {
6
- const walletBook = useWalletBook();
3
+ const getWalletBookWallet = (walletBook, walletName) => {
7
4
  const normalizedWalletName = normalizeWalletName(walletName);
8
- const walletData = walletBook.wallets[normalizedWalletName];
5
+ const walletData = walletBook?.wallets?.[normalizedWalletName];
9
6
  if (!walletData)
10
- throw new Error(`Wallet ${walletName} not found in wallet book`);
7
+ throw new Error(`Wallet ${walletName} not found in wallet book (${Object.keys(walletBook?.wallets ?? {}).length} wallets found)`);
11
8
  return walletData;
12
9
  };
13
10
 
@@ -2,11 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var useWalletBook = require('../hooks/useWalletBook.cjs');
6
- require('react');
7
-
8
- const getWalletGroup = (key) => {
9
- const walletBook = useWalletBook.useWalletBook();
5
+ const getWalletGroup = (walletBook, key) => {
10
6
  const group = walletBook.groups[key];
11
7
  if (!group)
12
8
  throw new Error(`Group ${key} not found in wallet book`);
@@ -1,2 +1,3 @@
1
+ import { WalletBookSchema } from '../schemas';
1
2
  import { WalletGroupSchema } from '../schemas/walletGroup';
2
- export declare const getWalletGroup: (key: string) => WalletGroupSchema;
3
+ export declare const getWalletGroup: (walletBook: WalletBookSchema, key: string) => WalletGroupSchema;
@@ -1,8 +1,4 @@
1
- import { useWalletBook } from '../hooks/useWalletBook.js';
2
- import 'react';
3
-
4
- const getWalletGroup = (key) => {
5
- const walletBook = useWalletBook();
1
+ const getWalletGroup = (walletBook, key) => {
6
2
  const group = walletBook.groups[key];
7
3
  if (!group)
8
4
  throw new Error(`Group ${key} not found in wallet book`);
@@ -6,9 +6,9 @@ var getWalletBookWallet = require('./getWalletBookWallet.cjs');
6
6
  var logger = require('./logger.cjs');
7
7
  var renderTemplate = require('./renderTemplate.cjs');
8
8
 
9
- const getWalletIconUrl = (walletName) => {
9
+ const getWalletIconUrl = (walletBook, walletName) => {
10
10
  try {
11
- const walletData = getWalletBookWallet.getWalletBookWallet(walletName);
11
+ const walletData = getWalletBookWallet.getWalletBookWallet(walletBook, walletName);
12
12
  if (walletData?.brand?.spriteId) {
13
13
  return renderTemplate.renderTemplate('iconicUrl', walletData.brand.spriteId);
14
14
  }
@@ -0,0 +1,2 @@
1
+ import { WalletBookSchema } from '../schemas';
2
+ export declare const getWalletIconUrl: (walletBook: WalletBookSchema, walletName?: string) => string | undefined;
@@ -2,9 +2,9 @@ import { getWalletBookWallet } from './getWalletBookWallet.js';
2
2
  import { logger } from './logger.js';
3
3
  import { renderTemplate } from './renderTemplate.js';
4
4
 
5
- const getWalletIconUrl = (walletName) => {
5
+ const getWalletIconUrl = (walletBook, walletName) => {
6
6
  try {
7
- const walletData = getWalletBookWallet(walletName);
7
+ const walletData = getWalletBookWallet(walletBook, walletName);
8
8
  if (walletData?.brand?.spriteId) {
9
9
  return renderTemplate('iconicUrl', walletData.brand.spriteId);
10
10
  }