@dynamic-labs/utils 2.0.0-alpha.3 → 2.0.0-alpha.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +394 -0
  2. package/package.json +5 -5
  3. package/src/ceil/ceil.cjs +10 -0
  4. package/src/ceil/ceil.d.ts +1 -0
  5. package/src/ceil/ceil.js +6 -0
  6. package/src/ceil/index.d.ts +1 -0
  7. package/src/errors/AccountExistsError.d.ts +1 -0
  8. package/src/errors/InvalidPhoneNumberError.cjs +13 -0
  9. package/src/errors/InvalidPhoneNumberError.d.ts +4 -0
  10. package/src/errors/InvalidPhoneNumberError.js +9 -0
  11. package/src/errors/NoAccessError.cjs +2 -1
  12. package/src/errors/NoAccessError.d.ts +3 -1
  13. package/src/errors/NoAccessError.js +2 -1
  14. package/src/errors/SmsVerificationError.cjs +10 -0
  15. package/src/errors/SmsVerificationError.d.ts +3 -0
  16. package/src/errors/SmsVerificationError.js +6 -0
  17. package/src/errors/TooManyEmailVerificationsError.cjs +13 -0
  18. package/src/errors/TooManyEmailVerificationsError.d.ts +4 -0
  19. package/src/errors/TooManyEmailVerificationsError.js +9 -0
  20. package/src/errors/UserRejectedTransactionError.cjs +13 -0
  21. package/src/errors/UserRejectedTransactionError.d.ts +4 -0
  22. package/src/errors/UserRejectedTransactionError.js +9 -0
  23. package/src/errors/VerificationDataCollectionError.cjs +16 -0
  24. package/src/errors/VerificationDataCollectionError.d.ts +5 -0
  25. package/src/errors/VerificationDataCollectionError.js +12 -0
  26. package/src/errors/index.d.ts +14 -9
  27. package/src/formatNumberText/formatNumberText.cjs +19 -0
  28. package/src/formatNumberText/formatNumberText.d.ts +5 -0
  29. package/src/formatNumberText/formatNumberText.js +15 -0
  30. package/src/formatNumberText/index.d.ts +1 -0
  31. package/src/getOrMapViemChain.cjs +0 -1
  32. package/src/getOrMapViemChain.js +0 -1
  33. package/src/handleMobileWalletRedirect/handleMobileWalletRedirect.cjs +1 -1
  34. package/src/handleMobileWalletRedirect/handleMobileWalletRedirect.js +1 -1
  35. package/src/index.cjs +34 -16
  36. package/src/index.d.ts +4 -0
  37. package/src/index.js +17 -8
  38. package/src/retryableFn.cjs +1 -1
  39. package/src/retryableFn.js +1 -1
  40. package/src/runSafe/index.d.ts +1 -0
  41. package/src/runSafe/runSafe.cjs +24 -0
  42. package/src/runSafe/runSafe.d.ts +8 -0
  43. package/src/runSafe/runSafe.js +20 -0
  44. package/src/trimEnd/index.d.ts +1 -0
  45. package/src/trimEnd/trimEnd.cjs +13 -0
  46. package/src/trimEnd/trimEnd.d.ts +1 -0
  47. package/src/trimEnd/trimEnd.js +9 -0
package/CHANGELOG.md CHANGED
@@ -1,4 +1,398 @@
1
1
 
2
+ ## [2.0.0-alpha.30](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.29...v2.0.0-alpha.30) (2024-04-11)
3
+
4
+
5
+ ### ⚠ BREAKING CHANGES
6
+
7
+ * add headless sms sign-in (#5274)
8
+
9
+ ### Features
10
+
11
+ * add headless sms sign-in ([#5274](https://github.com/dynamic-labs/DynamicAuth/issues/5274)) ([fffc293](https://github.com/dynamic-labs/DynamicAuth/commit/fffc293f85447a784e8c728d1586f3555ab1fbfa))
12
+
13
+ ## [2.0.0-alpha.29](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.28...v2.0.0-alpha.29) (2024-04-10)
14
+
15
+
16
+ ### ⚠ BREAKING CHANGES
17
+
18
+ * replace sdk-api with sdk-api-core (#5280)
19
+
20
+ ### Features
21
+
22
+ * add dynamic client context ([#5250](https://github.com/dynamic-labs/DynamicAuth/issues/5250)) ([778ebe6](https://github.com/dynamic-labs/DynamicAuth/commit/778ebe6313e0bf3c9876feb6eff5bf152c15c55e))
23
+ * **webview-controller:** fetch manifest and render Dynamic SDK ([#5287](https://github.com/dynamic-labs/DynamicAuth/issues/5287)) ([00e84ac](https://github.com/dynamic-labs/DynamicAuth/commit/00e84acc4bdda92bad91108788f8d7882d0790d6))
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * don't render modal header component if there's no content ([#5269](https://github.com/dynamic-labs/DynamicAuth/issues/5269)) ([f4d7266](https://github.com/dynamic-labs/DynamicAuth/commit/f4d72668a5243108649774c6581733655f385cab))
29
+ * don't show get extension button when there are no download links ([#5276](https://github.com/dynamic-labs/DynamicAuth/issues/5276)) ([e8cf660](https://github.com/dynamic-labs/DynamicAuth/commit/e8cf66076a9914881a8edda69feb2fb192ac63a3))
30
+
31
+
32
+ * replace sdk-api with sdk-api-core ([#5280](https://github.com/dynamic-labs/DynamicAuth/issues/5280)) ([da4b695](https://github.com/dynamic-labs/DynamicAuth/commit/da4b6955a81d6bfb5c994cd62e21e9ae11a4f454))
33
+
34
+ ## [2.0.0-alpha.28](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.27...v2.0.0-alpha.28) (2024-04-10)
35
+
36
+
37
+ ### Bug Fixes
38
+
39
+ * improve bridge connect experience on mobile ([#5283](https://github.com/dynamic-labs/DynamicAuth/issues/5283)) ([155e4a9](https://github.com/dynamic-labs/DynamicAuth/commit/155e4a99e2cf5f78a1a5e91e774acbf170d6b083))
40
+
41
+ ## [2.0.0-alpha.27](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.26...v2.0.0-alpha.27) (2024-04-09)
42
+
43
+
44
+ ### Bug Fixes
45
+
46
+ * coinbase improvements ([#5268](https://github.com/dynamic-labs/DynamicAuth/issues/5268)) ([c10a6de](https://github.com/dynamic-labs/DynamicAuth/commit/c10a6debcacff6cd97f2436fbde387f85faa5682))
47
+ * show qr code for metamask on desktop when not installed ([#5262](https://github.com/dynamic-labs/DynamicAuth/issues/5262)) ([1dcb4d9](https://github.com/dynamic-labs/DynamicAuth/commit/1dcb4d98de8a95f6b11d7bad90b9059110087385))
48
+ * update title of hardware wallet select screen ([#5270](https://github.com/dynamic-labs/DynamicAuth/issues/5270)) ([6e8fe17](https://github.com/dynamic-labs/DynamicAuth/commit/6e8fe17306677786ccf528b97ab673b9ae6b57b9))
49
+
50
+ ## [2.0.0-alpha.26](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.25...v2.0.0-alpha.26) (2024-04-08)
51
+
52
+
53
+ ### ⚠ BREAKING CHANGES
54
+
55
+ * add onWalletAdded/onWalletRemoved callbacks and removed onConnect/onDisconnect/onLinkSuccess/onUnlinkSuccess (#5194)
56
+ * note:
57
+ - use "events" in favour of "eventsCallbacks"
58
+ - use "handlers.handleConnectedWallet" in favour of "eventsCallbacks.onBeforeConnectSuccessConfirmation"
59
+
60
+ ### Bug Fixes
61
+
62
+ * coinbase wallet settings ([#5233](https://github.com/dynamic-labs/DynamicAuth/issues/5233)) ([1b04411](https://github.com/dynamic-labs/DynamicAuth/commit/1b04411eb90db438f3eacf622d9c28db4c7cf532))
63
+ * remove local storage settings on logout ([#5212](https://github.com/dynamic-labs/DynamicAuth/issues/5212)) ([e686628](https://github.com/dynamic-labs/DynamicAuth/commit/e686628f602a44cd13083e7bb9afb4f50304390e))
64
+ * show app name or logo in sign message modal ([#5225](https://github.com/dynamic-labs/DynamicAuth/issues/5225)) ([a77b6ba](https://github.com/dynamic-labs/DynamicAuth/commit/a77b6ba9b5646b400ebf933949dabe06a35d1c81))
65
+ * user wallets not being cleared immediately when logout is called ([#5211](https://github.com/dynamic-labs/DynamicAuth/issues/5211)) ([a649c46](https://github.com/dynamic-labs/DynamicAuth/commit/a649c462d171cf6f8d67159df9f5f2144f315e5c))
66
+
67
+
68
+ * add onWalletAdded/onWalletRemoved callbacks and removed onConnect/onDisconnect/onLinkSuccess/onUnlinkSuccess ([#5194](https://github.com/dynamic-labs/DynamicAuth/issues/5194)) ([fdec78c](https://github.com/dynamic-labs/DynamicAuth/commit/fdec78c1c32c58c8f7dc7ffd9b877320aa4d90e0))
69
+ * rename eventsCallbacks to events ([#5196](https://github.com/dynamic-labs/DynamicAuth/issues/5196)) ([5797185](https://github.com/dynamic-labs/DynamicAuth/commit/5797185c18fa091032ef27043b63a1d5201b5e23))
70
+
71
+ ## [2.0.0-alpha.25](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.24...v2.0.0-alpha.25) (2024-04-04)
72
+
73
+
74
+ ### Features
75
+
76
+ * add in-app browser deeplink for metamask ([#5176](https://github.com/dynamic-labs/DynamicAuth/issues/5176)) ([02ce607](https://github.com/dynamic-labs/DynamicAuth/commit/02ce6077ed0deeaefc7a62ee91ff72f5bce2b327)), closes [#5123](https://github.com/dynamic-labs/DynamicAuth/issues/5123)
77
+
78
+ ## [2.0.0-alpha.24](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.23...v2.0.0-alpha.24) (2024-04-03)
79
+
80
+
81
+ ### ⚠ BREAKING CHANGES
82
+
83
+ * rename otp verification callbacks (#5180)
84
+ * remove deprecated isVerificationInProgress flag and setter (#5089)
85
+
86
+ ### Features
87
+
88
+ * allow creating embedded wallets even if user signs in with a wallet ([#5093](https://github.com/dynamic-labs/DynamicAuth/issues/5093)) ([ba2dd62](https://github.com/dynamic-labs/DynamicAuth/commit/ba2dd625e0a7bf35018cf8aac8e80bd23b4e3b0f))
89
+
90
+
91
+ ### Bug Fixes
92
+
93
+ * api unit test by removing api and sdk versions for assertion ([#5168](https://github.com/dynamic-labs/DynamicAuth/issues/5168)) ([6d3b8ad](https://github.com/dynamic-labs/DynamicAuth/commit/6d3b8adebe62a4f2a7878630384348b2c491d779))
94
+ * bug when phone input is empty ([#5139](https://github.com/dynamic-labs/DynamicAuth/issues/5139)) ([7155b63](https://github.com/dynamic-labs/DynamicAuth/commit/7155b63518d00ba807bc321c6740b341d0a8b82f))
95
+ * clear error message on otp resend for sms ([#5182](https://github.com/dynamic-labs/DynamicAuth/issues/5182)) ([f40b48c](https://github.com/dynamic-labs/DynamicAuth/commit/f40b48c7f58c8e3dfe73fb124d642c3b8f193cee))
96
+ * link farcaster account ([#5170](https://github.com/dynamic-labs/DynamicAuth/issues/5170)) ([10fe272](https://github.com/dynamic-labs/DynamicAuth/commit/10fe272247605b5f09385f063231e2c881399cc8))
97
+ * show correct otp message for sms verification failure ([#5177](https://github.com/dynamic-labs/DynamicAuth/issues/5177)) ([b3bcd76](https://github.com/dynamic-labs/DynamicAuth/commit/b3bcd7694047dac55ce37babb71684a418633f95))
98
+ * update wagmi connector id when wallet connector changes ([#5185](https://github.com/dynamic-labs/DynamicAuth/issues/5185)) ([14fb83a](https://github.com/dynamic-labs/DynamicAuth/commit/14fb83a22c8e39095b79cc9951cae3f00f4fca2f))
99
+
100
+
101
+ * remove deprecated isVerificationInProgress flag and setter ([#5089](https://github.com/dynamic-labs/DynamicAuth/issues/5089)) ([060fef7](https://github.com/dynamic-labs/DynamicAuth/commit/060fef70df0c497e7a9b6e67ad0bfafef52c2bbb))
102
+ * rename otp verification callbacks ([#5180](https://github.com/dynamic-labs/DynamicAuth/issues/5180)) ([a580eec](https://github.com/dynamic-labs/DynamicAuth/commit/a580eec02d15b46a25c01d5473e4db2db89937e2))
103
+
104
+ ## [2.0.0-alpha.23](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.22...v2.0.0-alpha.23) (2024-04-01)
105
+
106
+
107
+ ### ⚠ BREAKING CHANGES
108
+
109
+ * implement proper solana embedded wallet signer (#5092)
110
+ * prevent adding temporary wallet connection to userWallets (#5104)
111
+
112
+ ### Bug Fixes
113
+
114
+ * Multiple WC bug fixes ([#5142](https://github.com/dynamic-labs/DynamicAuth/issues/5142)) ([92236e6](https://github.com/dynamic-labs/DynamicAuth/commit/92236e6d74c28516403f6df79c539406ece3d6d0)) ([#5132](https://github.com/dynamic-labs/DynamicAuth/issues/5132)) ([99f564a](https://github.com/dynamic-labs/DynamicAuth/commit/99f564a39e35e28af0be2a03617f12aa19cbeb7f))
115
+
116
+ * Better handling of empty callback queue([#5147](https://github.com/dynamic-labs/DynamicAuth/issues/5147)) ([e2d6bf2](https://github.com/dynamic-labs/DynamicAuth/commit/e2d6bf2444ca01199796ead4136f34b81b6c9b61))
117
+
118
+ * multiple improvements to the wallet list ([#5112](https://github.com/dynamic-labs/DynamicAuth/issues/5112)) ([00eec5f](https://github.com/dynamic-labs/DynamicAuth/commit/00eec5fde70548c3d771260f3d86e5365e73878d))
119
+
120
+ * Improved scroll experience on ios ([#5152](https://github.com/dynamic-labs/DynamicAuth/issues/5152)) ([341704f](https://github.com/dynamic-labs/DynamicAuth/commit/341704f99cb6e06f253309f3a8afb1684bb8ae2a))
121
+
122
+ * better handling of multiwallet state([#5146](https://github.com/dynamic-labs/DynamicAuth/issues/5146)) ([403267b](https://github.com/dynamic-labs/DynamicAuth/commit/403267b3c268d648aba155e0b6fea31d7fdc1b56))
123
+
124
+ * show correct OTP error message ([#5135](https://github.com/dynamic-labs/DynamicAuth/issues/5135)) ([e7494ce](https://github.com/dynamic-labs/DynamicAuth/commit/e7494cee4a1b5132af91058cbcb2dae0b7eac44b))
125
+
126
+ * implement proper solana embedded wallet signer ([#5092](https://github.com/dynamic-labs/DynamicAuth/issues/5092)) ([7749b97](https://github.com/dynamic-labs/DynamicAuth/commit/7749b97db49fb9af8ae0668172f478e1f0c29665))
127
+
128
+ * prevent adding temporary wallet connection to userWallets ([#5104](https://github.com/dynamic-labs/DynamicAuth/issues/5104)) ([3c02b78](https://github.com/dynamic-labs/DynamicAuth/commit/3c02b781c997c63ff11a7f1c255b92d10962327f))
129
+
130
+
131
+ ## [2.0.0-alpha.22](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.21...v2.0.0-alpha.22) (2024-03-27)
132
+
133
+
134
+ ### ⚠ BREAKING CHANGES
135
+
136
+ * remove isFullyConnected (#5066)
137
+ * remove and deprecated exported methods (#5065)
138
+ * remove emailOnly provider
139
+
140
+ ### Features
141
+
142
+ * add method property to track which phantom connector function was called ([#5044](https://github.com/dynamic-labs/DynamicAuth/issues/5044)) ([f820cd4](https://github.com/dynamic-labs/DynamicAuth/commit/f820cd4c7e047fd5181115b4d388e54df682e5c8))
143
+ * add signAndSendTransaction to phantom redirect connector ([#5054](https://github.com/dynamic-labs/DynamicAuth/issues/5054)) ([694a300](https://github.com/dynamic-labs/DynamicAuth/commit/694a3003c8765098878a5c95174be5eba4509fc2))
144
+ * implement remaining signer methods on phantom redirect connector ([#5060](https://github.com/dynamic-labs/DynamicAuth/issues/5060)) ([29db446](https://github.com/dynamic-labs/DynamicAuth/commit/29db4464de6eea11c92a8080fed1eb3e7588b2b8))
145
+
146
+
147
+ ### Bug Fixes
148
+
149
+ * add recommended wallet tags to the WalletSimpleSignIn component ([#5041](https://github.com/dynamic-labs/DynamicAuth/issues/5041)) ([aefde4d](https://github.com/dynamic-labs/DynamicAuth/commit/aefde4d927427c131dce4402eb3c705527c64e8f))
150
+ * display invalid phone number error ([#5103](https://github.com/dynamic-labs/DynamicAuth/issues/5103)) ([842c0ba](https://github.com/dynamic-labs/DynamicAuth/commit/842c0ba3cfe1120c166f12410efbc346d8e30ed0))
151
+ * ensure the user field modals uses the base widget context ([#5105](https://github.com/dynamic-labs/DynamicAuth/issues/5105)) ([aa2a545](https://github.com/dynamic-labs/DynamicAuth/commit/aa2a545bdbf6f38f4131ccdde61142389dbf5480))
152
+ * force aspect ratio for social icon pfps ([#5072](https://github.com/dynamic-labs/DynamicAuth/issues/5072)) ([6f611a7](https://github.com/dynamic-labs/DynamicAuth/commit/6f611a7cbe41d66796449b28af919bc93a7bae42))
153
+ * handle too many email verifications error ([#5051](https://github.com/dynamic-labs/DynamicAuth/issues/5051)) ([7af96df](https://github.com/dynamic-labs/DynamicAuth/commit/7af96dfb85cdc68577fdb8cc880e2fd09bcff5af))
154
+ * hardcode zerion provider and update walletbook to prevent showing up as metamask when not installed ([#5071](https://github.com/dynamic-labs/DynamicAuth/issues/5071)) ([3ab6c37](https://github.com/dynamic-labs/DynamicAuth/commit/3ab6c3772efe2c2e3259ca7a9dbb92e924314029))
155
+ * issue where ethereum is tree shaken ([#5028](https://github.com/dynamic-labs/DynamicAuth/issues/5028)) ([fda542d](https://github.com/dynamic-labs/DynamicAuth/commit/fda542db2b65a437004fe809a0ea9f90fde47b13))
156
+ * not clearing the loading when creating an embedded wallet ([323086f](https://github.com/dynamic-labs/DynamicAuth/commit/323086f673fb8a2108b8262181511987d0bc1d09))
157
+ * solflare double connection on page refresh ([#5083](https://github.com/dynamic-labs/DynamicAuth/issues/5083)) ([ef76005](https://github.com/dynamic-labs/DynamicAuth/commit/ef7600564b646cf45396287a0d6b6f1420473b04))
158
+ * swap out findProvider for getSigner on solflare ([#5057](https://github.com/dynamic-labs/DynamicAuth/issues/5057)) ([b78827f](https://github.com/dynamic-labs/DynamicAuth/commit/b78827f8fd87a594114908d890f58b8771123383))
159
+ * validate user session whenever user is connected/authenticated ([#5082](https://github.com/dynamic-labs/DynamicAuth/issues/5082)) ([432faa0](https://github.com/dynamic-labs/DynamicAuth/commit/432faa0a69b43cb7324a252a2450db3cbd3b4b12))
160
+ * walletconnect improvements and fixes ([#5085](https://github.com/dynamic-labs/DynamicAuth/issues/5085)) ([bb42566](https://github.com/dynamic-labs/DynamicAuth/commit/bb425666aef5071b7827ef0aa167a328493f1ae7))
161
+
162
+
163
+ * remove and deprecated exported methods ([#5065](https://github.com/dynamic-labs/DynamicAuth/issues/5065)) ([63af7ea](https://github.com/dynamic-labs/DynamicAuth/commit/63af7ea691b2112032de332f2b3558ac6260a38d))
164
+ * remove emailOnly provider ([60a30bc](https://github.com/dynamic-labs/DynamicAuth/commit/60a30bc2f242de19d9c6167279fc44b7f9395ac8))
165
+ * remove isFullyConnected ([#5066](https://github.com/dynamic-labs/DynamicAuth/issues/5066)) ([0a662d9](https://github.com/dynamic-labs/DynamicAuth/commit/0a662d9eda19045f13c21ad1b5238ca11594fde5))
166
+
167
+ ## [2.0.0-alpha.21](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.20...v2.0.0-alpha.21) (2024-03-20)
168
+
169
+
170
+ ### Features
171
+
172
+ * implement barebones signer in PhantomRedirect connector ([#5043](https://github.com/dynamic-labs/DynamicAuth/issues/5043)) ([4d7ff79](https://github.com/dynamic-labs/DynamicAuth/commit/4d7ff79acfe554d651791139b5e1d23ebafe712c))
173
+
174
+
175
+ ### Bug Fixes
176
+
177
+ * find embedded wallets when no chain is specified ([#5036](https://github.com/dynamic-labs/DynamicAuth/issues/5036)) ([ac50742](https://github.com/dynamic-labs/DynamicAuth/commit/ac50742c6002f48aae7b60c9ec094eb12df8dcca))
178
+ * ignore walletconnect chainChange event when it's the same chain ([#5029](https://github.com/dynamic-labs/DynamicAuth/issues/5029)) ([115311a](https://github.com/dynamic-labs/DynamicAuth/commit/115311a4a64ae35317b8864f93c38203566714fc))
179
+
180
+ ## [2.0.0-alpha.20](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.19...v2.0.0-alpha.20) (2024-03-19)
181
+
182
+
183
+ ### Bug Fixes
184
+
185
+ * prevent solflare connect popping up on page refresh when connected ([#5032](https://github.com/dynamic-labs/DynamicAuth/issues/5032)) ([28175a9](https://github.com/dynamic-labs/DynamicAuth/commit/28175a9af43f3e7f2cab30148563eaf5573477d1))
186
+ * show correct user identifier in onboarding view ([#5021](https://github.com/dynamic-labs/DynamicAuth/issues/5021)) ([c84747f](https://github.com/dynamic-labs/DynamicAuth/commit/c84747f01eb2a0a827ca48e62f03739d4e6df136))
187
+ * use address as the wallet client account ([#5037](https://github.com/dynamic-labs/DynamicAuth/issues/5037)) ([287631e](https://github.com/dynamic-labs/DynamicAuth/commit/287631e9a027e3a39ee2ad6b45ca404febd03929))
188
+
189
+ ## [2.0.0-alpha.19](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.18...v2.0.0-alpha.19) (2024-03-19)
190
+
191
+
192
+ ### Bug Fixes
193
+
194
+ * add localization to email form ([#5009](https://github.com/dynamic-labs/DynamicAuth/issues/5009)) ([f3c100c](https://github.com/dynamic-labs/DynamicAuth/commit/f3c100cb0b815880d11c6b619d94bfaa7330a115))
195
+ * include domain on signTypedData for ZeroDev connector ([#5017](https://github.com/dynamic-labs/DynamicAuth/issues/5017)) ([71c9131](https://github.com/dynamic-labs/DynamicAuth/commit/71c91311a75309810bc497c8f82981553ddc57fd))
196
+ * Remove Copy Address button if there is no wallet ([#4994](https://github.com/dynamic-labs/DynamicAuth/issues/4994)) ([fe1e641](https://github.com/dynamic-labs/DynamicAuth/commit/fe1e6417be2299e65ba4bcbc3347dfc27f021853))
197
+
198
+ ## [2.0.0-alpha.18](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.17...v2.0.0-alpha.18) (2024-03-15)
199
+
200
+ ## [2.0.0-alpha.17](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.16...v2.0.0-alpha.17) (2024-03-15)
201
+
202
+
203
+ ### ⚠ BREAKING CHANGES
204
+
205
+ * rename prop canConnectViaEmail to requiresNonDynamicEmailOtp (#4991)
206
+
207
+ ### Features
208
+
209
+ * allow creating embedded wallet with phone number without email ([#4953](https://github.com/dynamic-labs/DynamicAuth/issues/4953)) ([39d31cb](https://github.com/dynamic-labs/DynamicAuth/commit/39d31cbc969fff7acf53c0b6c5e5093ff846f3ea))
210
+
211
+
212
+ * rename prop canConnectViaEmail to requiresNonDynamicEmailOtp ([#4991](https://github.com/dynamic-labs/DynamicAuth/issues/4991)) ([e83a365](https://github.com/dynamic-labs/DynamicAuth/commit/e83a3658d4f5cf0630fc8f15be66f2d3db84ab98))
213
+
214
+ ## [2.0.0-alpha.16](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.15...v2.0.0-alpha.16) (2024-03-15)
215
+
216
+
217
+ ### Features
218
+
219
+ * add bundlerProvider prop to allow AA customers to select a provider ([#4975](https://github.com/dynamic-labs/DynamicAuth/issues/4975)) ([1870cef](https://github.com/dynamic-labs/DynamicAuth/commit/1870cef4f50944a86226d10f09ef7bf6595f3c95))
220
+
221
+ ## [2.0.0-alpha.15](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.14...v2.0.0-alpha.15) (2024-03-15)
222
+
223
+
224
+ ### Features
225
+
226
+ * Add support for mobile farcaster signin ([#4973](https://github.com/dynamic-labs/DynamicAuth/issues/4973)) ([98261a4](https://github.com/dynamic-labs/DynamicAuth/commit/98261a47bd319cd93b36f5cdd6a9be0064887686))
227
+
228
+ ## [2.0.0-alpha.14](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.13...v2.0.0-alpha.14) (2024-03-14)
229
+
230
+
231
+ ### Bug Fixes
232
+
233
+ * convert empty value when checking for gas sponsorship ([#4970](https://github.com/dynamic-labs/DynamicAuth/issues/4970)) ([8439a20](https://github.com/dynamic-labs/DynamicAuth/commit/8439a2035729150f33507b22c2678b16ae47976b))
234
+ * omit wallet connect on mobile ([#4954](https://github.com/dynamic-labs/DynamicAuth/issues/4954)) ([6ac29a8](https://github.com/dynamic-labs/DynamicAuth/commit/6ac29a8961dc010688425fb67a4fb621ca9f80b2))
235
+
236
+ ## [2.0.0-alpha.13](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.12...v2.0.0-alpha.13) (2024-03-14)
237
+
238
+ ## [2.0.0-alpha.12](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.11...v2.0.0-alpha.12) (2024-03-13)
239
+
240
+
241
+ ### Features
242
+
243
+ * add sign-in with farcaster ([#4947](https://github.com/dynamic-labs/DynamicAuth/issues/4947)) ([3927d24](https://github.com/dynamic-labs/DynamicAuth/commit/3927d24392a8944997ca05431c6ab54757be62d9))
244
+
245
+
246
+ ### Bug Fixes
247
+
248
+ * wallet connect links with query params ([#4948](https://github.com/dynamic-labs/DynamicAuth/issues/4948)) ([0738130](https://github.com/dynamic-labs/DynamicAuth/commit/0738130f82473a197e035b8dd74d996bdbb24c11))
249
+
250
+ ## [2.0.0-alpha.11](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.10...v2.0.0-alpha.11) (2024-03-12)
251
+
252
+
253
+ ### ⚠ BREAKING CHANGES
254
+
255
+ * rename FetchPublicAddressOpts to GetAddressOpts (#4910)
256
+ * remove use effect in useWalletEventListeners (#4843)
257
+ * rename fetchPublicAddress to getAddress (#4851)
258
+
259
+ ### Features
260
+
261
+ * Add farcaster to iconic ([#4925](https://github.com/dynamic-labs/DynamicAuth/issues/4925)) ([ab282dc](https://github.com/dynamic-labs/DynamicAuth/commit/ab282dc9cdcc0fe11f014d002b056ef4d3b34234))
262
+ * use transaction confirmation ui on signAndSendTransaction for solana embedded wallets ([#4909](https://github.com/dynamic-labs/DynamicAuth/issues/4909)) ([d77e89e](https://github.com/dynamic-labs/DynamicAuth/commit/d77e89ecff9dfc67ed48537f541a9995b2662e1e))
263
+
264
+
265
+ ### Bug Fixes
266
+
267
+ * add back connect button css variables ([#4922](https://github.com/dynamic-labs/DynamicAuth/issues/4922)) ([1119d62](https://github.com/dynamic-labs/DynamicAuth/commit/1119d62c2db6504952393060930524c3823e4a00))
268
+ * keep adaptive wallet list height ([#4916](https://github.com/dynamic-labs/DynamicAuth/issues/4916)) ([62aa54e](https://github.com/dynamic-labs/DynamicAuth/commit/62aa54e81d563082f7aa519f2ff2b5132e7dd83d))
269
+ * pass account and chain to walletClient ([#4865](https://github.com/dynamic-labs/DynamicAuth/issues/4865)) ([17a143f](https://github.com/dynamic-labs/DynamicAuth/commit/17a143f87a77e56227b2517038c20cf67f8e08bf))
270
+ * update walletbook to fix zerion in-app browser detection issue ([#4917](https://github.com/dynamic-labs/DynamicAuth/issues/4917)) ([48b05d7](https://github.com/dynamic-labs/DynamicAuth/commit/48b05d78e4f7add09787b64505723d4eca34d3e0))
271
+
272
+
273
+ * remove use effect in useWalletEventListeners ([#4843](https://github.com/dynamic-labs/DynamicAuth/issues/4843)) ([2e948bb](https://github.com/dynamic-labs/DynamicAuth/commit/2e948bbca0dbdceab7460a844d0988eacd47f581))
274
+ * rename fetchPublicAddress to getAddress ([#4851](https://github.com/dynamic-labs/DynamicAuth/issues/4851)) ([668e7dd](https://github.com/dynamic-labs/DynamicAuth/commit/668e7dd62e1f323dbe64209b5c59c2cd0ee45d61))
275
+ * rename FetchPublicAddressOpts to GetAddressOpts ([#4910](https://github.com/dynamic-labs/DynamicAuth/issues/4910)) ([e5e4b1b](https://github.com/dynamic-labs/DynamicAuth/commit/e5e4b1b08a4e010afa44f8abb0bf6af7f236a86a))
276
+
277
+ ## [2.0.0-alpha.10](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.9...v2.0.0-alpha.10) (2024-03-08)
278
+
279
+
280
+ ### ⚠ BREAKING CHANGES
281
+
282
+ * rename hideEmbeddedWalletUIs prop to hideEmbeddedWalletTra… (#4892)
283
+ * refactor send transaction for multi chain (#4831)
284
+
285
+ ### Features
286
+
287
+ * add sandbox indicator to sdk ([62fd821](https://github.com/dynamic-labs/DynamicAuth/commit/62fd821a895bb54cec4cae3d153aa0056a7e6638))
288
+
289
+
290
+ ### Bug Fixes
291
+
292
+ * coinbase connector and auth fetcher no being set properly ([#4891](https://github.com/dynamic-labs/DynamicAuth/issues/4891)) ([328566f](https://github.com/dynamic-labs/DynamicAuth/commit/328566ff39c38d5b5761ddc655de3a5d08bb567a))
293
+ * fix server side rendering ([#4811](https://github.com/dynamic-labs/DynamicAuth/issues/4811)) ([063dfae](https://github.com/dynamic-labs/DynamicAuth/commit/063dfae8b6750875d2f35dd9709a1f675495f4fb))
294
+ * hide network ([#4885](https://github.com/dynamic-labs/DynamicAuth/issues/4885)) ([ec10c58](https://github.com/dynamic-labs/DynamicAuth/commit/ec10c588218f067e991d5830fc06ec081e4e1d18))
295
+ * network picker on mobile ([#4887](https://github.com/dynamic-labs/DynamicAuth/issues/4887)) ([6e0ab1b](https://github.com/dynamic-labs/DynamicAuth/commit/6e0ab1bc7d138b73373741960a501ff7cf20e3f9))
296
+
297
+
298
+ * refactor send transaction for multi chain ([#4831](https://github.com/dynamic-labs/DynamicAuth/issues/4831)) ([c98444b](https://github.com/dynamic-labs/DynamicAuth/commit/c98444be7935420dda3d8216d03946f5893eb82f))
299
+ * rename hideEmbeddedWalletUIs prop to hideEmbeddedWalletTra… ([#4892](https://github.com/dynamic-labs/DynamicAuth/issues/4892)) ([7cdf519](https://github.com/dynamic-labs/DynamicAuth/commit/7cdf5196b1cd8516de2d456163fe9071956d40d3))
300
+
301
+ ## [2.0.0-alpha.9](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.8...v2.0.0-alpha.9) (2024-03-06)
302
+
303
+
304
+ ### Features
305
+
306
+ * solana connector new sendTransaction method ([#4842](https://github.com/dynamic-labs/DynamicAuth/issues/4842)) ([0b198e3](https://github.com/dynamic-labs/DynamicAuth/commit/0b198e30d83fbbc8d506654d87cbfad403fda289))
307
+ * specify solana network when using phantom redirect deeplinking ([#4863](https://github.com/dynamic-labs/DynamicAuth/issues/4863)) ([fb4ee7c](https://github.com/dynamic-labs/DynamicAuth/commit/fb4ee7cfc0493c9c85b6ccb31954842556c58aa4))
308
+
309
+
310
+ ### Bug Fixes
311
+
312
+ * isLoggedIn should return true even when there is no primary wallet ([#4875](https://github.com/dynamic-labs/DynamicAuth/issues/4875)) ([f396e22](https://github.com/dynamic-labs/DynamicAuth/commit/f396e22b9d809b05ac52194ffa4346f3591d17fe))
313
+ * update btckit network conversion for signPsbt ([a6009e1](https://github.com/dynamic-labs/DynamicAuth/commit/a6009e18c453b4e65545455fea0e52ed7a983b4d))
314
+ * user getting logged out when signing in with email linked to a unavailable wallet ([#4858](https://github.com/dynamic-labs/DynamicAuth/issues/4858)) ([8653e13](https://github.com/dynamic-labs/DynamicAuth/commit/8653e13d2067dd0161e660b4374c08a9fe0bc203))
315
+
316
+ ## [2.0.0-alpha.8](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.7...v2.0.0-alpha.8) (2024-03-04)
317
+
318
+ ## [2.0.0-alpha.7](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.6...v2.0.0-alpha.7) (2024-02-28)
319
+
320
+
321
+ ### ⚠ BREAKING CHANGES
322
+
323
+ * add networkValidationMode and remove enableForcedNetworkValidation (#4778)
324
+
325
+ ### Features
326
+
327
+ * add bitget and okx wallets ([51fab41](https://github.com/dynamic-labs/DynamicAuth/commit/51fab413096fd89ce99c6c617cf4f3f5db9bf44d))
328
+ * add networkValidationMode and remove enableForcedNetworkValidation ([#4778](https://github.com/dynamic-labs/DynamicAuth/issues/4778)) ([ccb9576](https://github.com/dynamic-labs/DynamicAuth/commit/ccb9576c81b2c570185f5126d6d1fcfcbb5ac9e3))
329
+
330
+
331
+ ### Bug Fixes
332
+
333
+ * **GVTY-1243:** non evm onramp urls ([#4791](https://github.com/dynamic-labs/DynamicAuth/issues/4791)) ([fea602e](https://github.com/dynamic-labs/DynamicAuth/commit/fea602e2835b4bb9bc096b96375fa97297bf35f1))
334
+ * revert use enableForcedNetworkValidation on connect-only ([#4750](https://github.com/dynamic-labs/DynamicAuth/issues/4750)) ([#4772](https://github.com/dynamic-labs/DynamicAuth/issues/4772)) ([b871c22](https://github.com/dynamic-labs/DynamicAuth/commit/b871c2295f39230bc34ae1fca5f8817cd9251a17))
335
+ * use correct chromeId for okx and bitget wallets and remove group from coin98 ([#4795](https://github.com/dynamic-labs/DynamicAuth/issues/4795)) ([e63bad7](https://github.com/dynamic-labs/DynamicAuth/commit/e63bad76ed06636151212c915a102359a03b4218))
336
+
337
+ ## [2.0.0-alpha.6](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.5...v2.0.0-alpha.6) (2024-02-26)
338
+
339
+
340
+ ### ⚠ BREAKING CHANGES
341
+
342
+ * setShowAuthFlow opens dynamic profile in non-multi-wallet states
343
+
344
+ ### Features
345
+
346
+ * allow passing prop to hide embedded wallet action confirmation UIs ([#4775](https://github.com/dynamic-labs/DynamicAuth/issues/4775)) ([d7c6a46](https://github.com/dynamic-labs/DynamicAuth/commit/d7c6a4699e41f6a62d31880c3bd0346ebfa0e3ba))
347
+ * make sms mobile keyboard numeric ([#4755](https://github.com/dynamic-labs/DynamicAuth/issues/4755)) ([f36844a](https://github.com/dynamic-labs/DynamicAuth/commit/f36844aeaae240c520181b3242492db8ffc64a50))
348
+ * setShowAuthFlow opens dynamic profile in non-multi-wallet states ([42dbbc0](https://github.com/dynamic-labs/DynamicAuth/commit/42dbbc00a5cebe937dca5a80397cdd3c577f6a45))
349
+
350
+
351
+ ### Bug Fixes
352
+
353
+ * demo one-time codes for solana wallets fix ([#4760](https://github.com/dynamic-labs/DynamicAuth/issues/4760)) ([a5ab2a8](https://github.com/dynamic-labs/DynamicAuth/commit/a5ab2a8bc348a35a898e03db0900bfab88184c17))
354
+ * only store passcode in backend when auto-generated by dynamic ([#4764](https://github.com/dynamic-labs/DynamicAuth/issues/4764)) ([528bedc](https://github.com/dynamic-labs/DynamicAuth/commit/528bedce5cbd3022ddafe4242954a04f5b70ae74))
355
+ * use enableForcedNetworkValidation on connect-only ([#4750](https://github.com/dynamic-labs/DynamicAuth/issues/4750)) ([6299f7c](https://github.com/dynamic-labs/DynamicAuth/commit/6299f7c3ce705ddb19714f6b7a3a488851ed8dde))
356
+
357
+ ## [2.0.0-alpha.5](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.4...v2.0.0-alpha.5) (2024-02-22)
358
+
359
+
360
+ ### ⚠ BREAKING CHANGES
361
+
362
+ * wagmi v2 (#4660)
363
+
364
+ ### Features
365
+
366
+ * wagmi v2 ([#4660](https://github.com/dynamic-labs/DynamicAuth/issues/4660)) ([d8894e6](https://github.com/dynamic-labs/DynamicAuth/commit/d8894e61393b90ccf44904c33394b54286f0f9e9))
367
+
368
+ ## [2.0.0-alpha.4](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.3...v2.0.0-alpha.4) (2024-02-22)
369
+
370
+
371
+ ### ⚠ BREAKING CHANGES
372
+
373
+ * remove wallet connector from callback types (#4730)
374
+ * drop support for walletconnect v1 (#4666)
375
+
376
+ ### Features
377
+
378
+ * add coin98 evm ([1d64f5f](https://github.com/dynamic-labs/DynamicAuth/commit/1d64f5f00885ff671358651fd0251b77a2e05739))
379
+ * add support for solana versioned transactions ([#4721](https://github.com/dynamic-labs/DynamicAuth/issues/4721)) ([25b1643](https://github.com/dynamic-labs/DynamicAuth/commit/25b1643f8addbada09fff5d22e988bdf22038170))
380
+
381
+
382
+ ### Bug Fixes
383
+
384
+ * allow rpc-providers package to use exports based on usage ([#4539](https://github.com/dynamic-labs/DynamicAuth/issues/4539)) ([abdc196](https://github.com/dynamic-labs/DynamicAuth/commit/abdc19641580cbcfe8f9e357c645f8291bc9ed66))
385
+ * coinbasesocial should display coinbase in profile linking section ([#4680](https://github.com/dynamic-labs/DynamicAuth/issues/4680)) ([21cbe2e](https://github.com/dynamic-labs/DynamicAuth/commit/21cbe2e24345a33bc927428c01cc7b5c724e40e5))
386
+ * improve on transaction confirmation step ([#4704](https://github.com/dynamic-labs/DynamicAuth/issues/4704)) ([f2b27cf](https://github.com/dynamic-labs/DynamicAuth/commit/f2b27cfd94452be2eb7e88a298f61ef56985931f))
387
+ * prevent the DynamicMultiWalletPromptsWidget from opening if useris not logged in ([#4701](https://github.com/dynamic-labs/DynamicAuth/issues/4701)) ([2bb35fd](https://github.com/dynamic-labs/DynamicAuth/commit/2bb35fd29b60677e893390f7d47857cd76c73adc))
388
+ * reduce isPreauthorized calls when starknet wallet is connected ([#4710](https://github.com/dynamic-labs/DynamicAuth/issues/4710)) ([ca6a630](https://github.com/dynamic-labs/DynamicAuth/commit/ca6a630dd47a1c116afcd63fe7256ffc745532ab))
389
+ * update sepolia currency symbol ([#4728](https://github.com/dynamic-labs/DynamicAuth/issues/4728)) ([3c228a0](https://github.com/dynamic-labs/DynamicAuth/commit/3c228a03ccc962374ad1dac3ab45af92732ba61a))
390
+ * use overflow clip when available, use hidden by default ([#4696](https://github.com/dynamic-labs/DynamicAuth/issues/4696)) ([29fb2a1](https://github.com/dynamic-labs/DynamicAuth/commit/29fb2a1e48b010c6c1d525403fbdcf7ded068466))
391
+
392
+
393
+ * drop support for walletconnect v1 ([#4666](https://github.com/dynamic-labs/DynamicAuth/issues/4666)) ([4af93e4](https://github.com/dynamic-labs/DynamicAuth/commit/4af93e4f9b95fa4c49bbfda0c1144da1a4a43991))
394
+ * remove wallet connector from callback types ([#4730](https://github.com/dynamic-labs/DynamicAuth/issues/4730)) ([08cb200](https://github.com/dynamic-labs/DynamicAuth/commit/08cb200a09c0fd78d2093d1a60b17089b3b2c2b1))
395
+
2
396
  ## [2.0.0-alpha.3](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2024-02-13)
3
397
 
4
398
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/utils",
3
- "version": "2.0.0-alpha.3",
3
+ "version": "2.0.0-alpha.30",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/dynamic-labs/DynamicAuth.git",
@@ -26,11 +26,11 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "tldts": "^6.0.16",
30
- "@dynamic-labs/logger": "2.0.0-alpha.3",
31
- "@dynamic-labs/types": "2.0.0-alpha.3"
29
+ "tldts": "6.0.16",
30
+ "@dynamic-labs/logger": "2.0.0-alpha.30",
31
+ "@dynamic-labs/types": "2.0.0-alpha.30"
32
32
  },
33
33
  "peerDependencies": {
34
- "viem": "^1.19.13 || ^2.2.0"
34
+ "viem": "^2.7.6"
35
35
  }
36
36
  }
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const ceil = (value, precision = 0) => {
6
+ const multiplier = Math.pow(10, precision);
7
+ return Math.ceil(value * multiplier) / multiplier;
8
+ };
9
+
10
+ exports.ceil = ceil;
@@ -0,0 +1 @@
1
+ export declare const ceil: (value: number, precision?: number) => number;
@@ -0,0 +1,6 @@
1
+ const ceil = (value, precision = 0) => {
2
+ const multiplier = Math.pow(10, precision);
3
+ return Math.ceil(value * multiplier) / multiplier;
4
+ };
5
+
6
+ export { ceil };
@@ -0,0 +1 @@
1
+ export { ceil } from './ceil';
@@ -4,6 +4,7 @@ type AccountExistsPayload = {
4
4
  embeddedSocialSigninProvider: string;
5
5
  embeddedWalletName: string;
6
6
  loginProvider: string;
7
+ phoneNumber?: string;
7
8
  };
8
9
  export declare class AccountExistsError extends DynamicError {
9
10
  errorMessage: string;
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var DynamicError = require('./DynamicError.cjs');
6
+
7
+ class InvalidPhoneNumberError extends DynamicError.DynamicError {
8
+ constructor() {
9
+ super('Invalid phone number.');
10
+ }
11
+ }
12
+
13
+ exports.InvalidPhoneNumberError = InvalidPhoneNumberError;
@@ -0,0 +1,4 @@
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class InvalidPhoneNumberError extends DynamicError {
3
+ constructor();
4
+ }
@@ -0,0 +1,9 @@
1
+ import { DynamicError } from './DynamicError.js';
2
+
3
+ class InvalidPhoneNumberError extends DynamicError {
4
+ constructor() {
5
+ super('Invalid phone number.');
6
+ }
7
+ }
8
+
9
+ export { InvalidPhoneNumberError };
@@ -5,10 +5,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var DynamicError = require('./DynamicError.cjs');
6
6
 
7
7
  class NoAccessError extends DynamicError.DynamicError {
8
- constructor({ walletPublicKey, email, }) {
8
+ constructor({ walletPublicKey, email, phoneNumber, }) {
9
9
  super('User does not have access');
10
10
  this.email = email;
11
11
  this.walletPublicKey = walletPublicKey;
12
+ this.phoneNumber = phoneNumber;
12
13
  }
13
14
  }
14
15
 
@@ -2,8 +2,10 @@ import { DynamicError } from './DynamicError';
2
2
  export declare class NoAccessError extends DynamicError {
3
3
  walletPublicKey?: string;
4
4
  email?: string;
5
- constructor({ walletPublicKey, email, }: {
5
+ phoneNumber?: string;
6
+ constructor({ walletPublicKey, email, phoneNumber, }: {
6
7
  email?: string;
7
8
  walletPublicKey?: string;
9
+ phoneNumber?: string;
8
10
  });
9
11
  }
@@ -1,10 +1,11 @@
1
1
  import { DynamicError } from './DynamicError.js';
2
2
 
3
3
  class NoAccessError extends DynamicError {
4
- constructor({ walletPublicKey, email, }) {
4
+ constructor({ walletPublicKey, email, phoneNumber, }) {
5
5
  super('User does not have access');
6
6
  this.email = email;
7
7
  this.walletPublicKey = walletPublicKey;
8
+ this.phoneNumber = phoneNumber;
8
9
  }
9
10
  }
10
11
 
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var DynamicError = require('./DynamicError.cjs');
6
+
7
+ class SmsVerificationError extends DynamicError.DynamicError {
8
+ }
9
+
10
+ exports.SmsVerificationError = SmsVerificationError;
@@ -0,0 +1,3 @@
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class SmsVerificationError extends DynamicError {
3
+ }
@@ -0,0 +1,6 @@
1
+ import { DynamicError } from './DynamicError.js';
2
+
3
+ class SmsVerificationError extends DynamicError {
4
+ }
5
+
6
+ export { SmsVerificationError };
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var DynamicError = require('./DynamicError.cjs');
6
+
7
+ class TooManyEmailVerificationsError extends DynamicError.DynamicError {
8
+ constructor() {
9
+ super('Too many email verification attempts.');
10
+ }
11
+ }
12
+
13
+ exports.TooManyEmailVerificationsError = TooManyEmailVerificationsError;
@@ -0,0 +1,4 @@
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class TooManyEmailVerificationsError extends DynamicError {
3
+ constructor();
4
+ }
@@ -0,0 +1,9 @@
1
+ import { DynamicError } from './DynamicError.js';
2
+
3
+ class TooManyEmailVerificationsError extends DynamicError {
4
+ constructor() {
5
+ super('Too many email verification attempts.');
6
+ }
7
+ }
8
+
9
+ export { TooManyEmailVerificationsError };
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var DynamicError = require('./DynamicError.cjs');
6
+
7
+ class UserRejectedTransactionError extends DynamicError.DynamicError {
8
+ constructor() {
9
+ super('user rejected transaction');
10
+ }
11
+ }
12
+
13
+ exports.UserRejectedTransactionError = UserRejectedTransactionError;
@@ -0,0 +1,4 @@
1
+ import { DynamicError } from './DynamicError';
2
+ export declare class UserRejectedTransactionError extends DynamicError {
3
+ constructor();
4
+ }
@@ -0,0 +1,9 @@
1
+ import { DynamicError } from './DynamicError.js';
2
+
3
+ class UserRejectedTransactionError extends DynamicError {
4
+ constructor() {
5
+ super('user rejected transaction');
6
+ }
7
+ }
8
+
9
+ export { UserRejectedTransactionError };
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var DynamicError = require('./DynamicError.cjs');
6
+ require('./InsufficientFundsError.cjs');
7
+ require('./TransactionGasCannotBeSponsoredError.cjs');
8
+
9
+ /** Used when trying to get necessary data for verification OTPs */
10
+ class VerificationDataCollectionError extends DynamicError.DynamicError {
11
+ constructor(message) {
12
+ super('Failed to get verification data: ' + message);
13
+ }
14
+ }
15
+
16
+ exports.VerificationDataCollectionError = VerificationDataCollectionError;
@@ -0,0 +1,5 @@
1
+ import { DynamicError } from '.';
2
+ /** Used when trying to get necessary data for verification OTPs */
3
+ export declare class VerificationDataCollectionError extends DynamicError {
4
+ constructor(message: string);
5
+ }
@@ -0,0 +1,12 @@
1
+ import { DynamicError } from './DynamicError.js';
2
+ import './InsufficientFundsError.js';
3
+ import './TransactionGasCannotBeSponsoredError.js';
4
+
5
+ /** Used when trying to get necessary data for verification OTPs */
6
+ class VerificationDataCollectionError extends DynamicError {
7
+ constructor(message) {
8
+ super('Failed to get verification data: ' + message);
9
+ }
10
+ }
11
+
12
+ export { VerificationDataCollectionError };
@@ -3,18 +3,23 @@ export * from './ChainalysisError';
3
3
  export * from './CustomError';
4
4
  export * from './DynamicError';
5
5
  export * from './EmailAlreadyExistsError';
6
+ export * from './EmailProviderError';
6
7
  export * from './EmailVerificationError';
8
+ export * from './GateBlockedError';
9
+ export * from './InsufficientFundsError';
10
+ export * from './MissingEnvironmentIdError';
11
+ export * from './MissingPublicAddressError';
7
12
  export * from './NoAccessError';
8
13
  export * from './NotSupportedError';
14
+ export * from './PasskeyError';
15
+ export * from './SmsVerificationError';
16
+ export * from './SocialAccountAlreadyExistsError';
17
+ export * from './TransactionGasCannotBeSponsoredError';
18
+ export * from './UserHasAccountWithEmailError';
9
19
  export * from './UsernameAlreadyExistsError';
10
20
  export * from './WalletNotDeployedError';
11
21
  export * from './WalletUsedError';
12
- export * from './EmailProviderError';
13
- export * from './MissingEnvironmentIdError';
14
- export * from './GateBlockedError';
15
- export * from './UserHasAccountWithEmailError';
16
- export * from './SocialAccountAlreadyExistsError';
17
- export * from './TransactionGasCannotBeSponsoredError';
18
- export * from './InsufficientFundsError';
19
- export * from './PasskeyError';
20
- export * from './MissingPublicAddressError';
22
+ export * from './UserRejectedTransactionError';
23
+ export * from './TooManyEmailVerificationsError';
24
+ export * from './VerificationDataCollectionError';
25
+ export * from './InvalidPhoneNumberError';
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var ceil = require('../ceil/ceil.cjs');
6
+ var trimEnd = require('../trimEnd/trimEnd.cjs');
7
+
8
+ const formatNumberText = (value, { precision = 0 } = {}) => {
9
+ if (!precision) {
10
+ return value;
11
+ }
12
+ const floatValue = parseFloat(value);
13
+ const formattedAtPrecision = ceil.ceil(floatValue, precision).toFixed(precision);
14
+ const [integerPart, decimalPart] = formattedAtPrecision.split('.');
15
+ const decimalPartTrimmed = trimEnd.trimEnd(decimalPart, '0');
16
+ return `${integerPart}.${decimalPartTrimmed || '0'}`;
17
+ };
18
+
19
+ exports.formatNumberText = formatNumberText;
@@ -0,0 +1,5 @@
1
+ type FormatNumberTextOptions = {
2
+ precision?: number;
3
+ };
4
+ export declare const formatNumberText: (value: string, { precision }?: FormatNumberTextOptions) => string;
5
+ export {};
@@ -0,0 +1,15 @@
1
+ import { ceil } from '../ceil/ceil.js';
2
+ import { trimEnd } from '../trimEnd/trimEnd.js';
3
+
4
+ const formatNumberText = (value, { precision = 0 } = {}) => {
5
+ if (!precision) {
6
+ return value;
7
+ }
8
+ const floatValue = parseFloat(value);
9
+ const formattedAtPrecision = ceil(floatValue, precision).toFixed(precision);
10
+ const [integerPart, decimalPart] = formattedAtPrecision.split('.');
11
+ const decimalPartTrimmed = trimEnd(decimalPart, '0');
12
+ return `${integerPart}.${decimalPartTrimmed || '0'}`;
13
+ };
14
+
15
+ export { formatNumberText };
@@ -0,0 +1 @@
1
+ export { formatNumberText } from './formatNumberText';
@@ -54,7 +54,6 @@ const mapChain = (network) => {
54
54
  id: network.chainId,
55
55
  name: network.vanityName || network.chainName,
56
56
  nativeCurrency: network.nativeCurrency,
57
- network: network.chainName,
58
57
  rpcUrls: {
59
58
  default: { http: network.rpcUrls },
60
59
  public: { http: network.rpcUrls },
@@ -30,7 +30,6 @@ const mapChain = (network) => {
30
30
  id: network.chainId,
31
31
  name: network.vanityName || network.chainName,
32
32
  nativeCurrency: network.nativeCurrency,
33
- network: network.chainName,
34
33
  rpcUrls: {
35
34
  default: { http: network.rpcUrls },
36
35
  public: { http: network.rpcUrls },
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- require('../errors/TransactionGasCannotBeSponsoredError.cjs');
6
5
  require('../errors/InsufficientFundsError.cjs');
6
+ require('../errors/TransactionGasCannotBeSponsoredError.cjs');
7
7
  require('../logger/logger.cjs');
8
8
  var isMobile = require('../isMobile.cjs');
9
9
  require('../../_virtual/_tslib.cjs');
@@ -1,5 +1,5 @@
1
- import '../errors/TransactionGasCannotBeSponsoredError.js';
2
1
  import '../errors/InsufficientFundsError.js';
2
+ import '../errors/TransactionGasCannotBeSponsoredError.js';
3
3
  import '../logger/logger.js';
4
4
  import { isSamsungBrowser } from '../isMobile.js';
5
5
  import '../../_virtual/_tslib.js';
package/src/index.cjs CHANGED
@@ -9,20 +9,25 @@ var ChainalysisError = require('./errors/ChainalysisError.cjs');
9
9
  var CustomError = require('./errors/CustomError.cjs');
10
10
  var DynamicError = require('./errors/DynamicError.cjs');
11
11
  var EmailAlreadyExistsError = require('./errors/EmailAlreadyExistsError.cjs');
12
+ var EmailProviderError = require('./errors/EmailProviderError.cjs');
12
13
  var EmailVerificationError = require('./errors/EmailVerificationError.cjs');
14
+ var GateBlockedError = require('./errors/GateBlockedError.cjs');
15
+ var InsufficientFundsError = require('./errors/InsufficientFundsError.cjs');
16
+ var MissingEnvironmentIdError = require('./errors/MissingEnvironmentIdError.cjs');
17
+ var MissingPublicAddressError = require('./errors/MissingPublicAddressError.cjs');
13
18
  var NoAccessError = require('./errors/NoAccessError.cjs');
14
19
  var NotSupportedError = require('./errors/NotSupportedError.cjs');
20
+ var SmsVerificationError = require('./errors/SmsVerificationError.cjs');
21
+ var SocialAccountAlreadyExistsError = require('./errors/SocialAccountAlreadyExistsError.cjs');
22
+ var TransactionGasCannotBeSponsoredError = require('./errors/TransactionGasCannotBeSponsoredError.cjs');
23
+ var UserHasAccountWithEmailError = require('./errors/UserHasAccountWithEmailError.cjs');
15
24
  var UsernameAlreadyExistsError = require('./errors/UsernameAlreadyExistsError.cjs');
16
25
  var WalletNotDeployedError = require('./errors/WalletNotDeployedError.cjs');
17
26
  var WalletUsedError = require('./errors/WalletUsedError.cjs');
18
- var EmailProviderError = require('./errors/EmailProviderError.cjs');
19
- var MissingEnvironmentIdError = require('./errors/MissingEnvironmentIdError.cjs');
20
- var GateBlockedError = require('./errors/GateBlockedError.cjs');
21
- var UserHasAccountWithEmailError = require('./errors/UserHasAccountWithEmailError.cjs');
22
- var SocialAccountAlreadyExistsError = require('./errors/SocialAccountAlreadyExistsError.cjs');
23
- var TransactionGasCannotBeSponsoredError = require('./errors/TransactionGasCannotBeSponsoredError.cjs');
24
- var InsufficientFundsError = require('./errors/InsufficientFundsError.cjs');
25
- var MissingPublicAddressError = require('./errors/MissingPublicAddressError.cjs');
27
+ var UserRejectedTransactionError = require('./errors/UserRejectedTransactionError.cjs');
28
+ var TooManyEmailVerificationsError = require('./errors/TooManyEmailVerificationsError.cjs');
29
+ var VerificationDataCollectionError = require('./errors/VerificationDataCollectionError.cjs');
30
+ var InvalidPhoneNumberError = require('./errors/InvalidPhoneNumberError.cjs');
26
31
  var CancellablePromise = require('./CancellablePromise/CancellablePromise.cjs');
27
32
  var isFunction = require('./isFunction/isFunction.cjs');
28
33
  var isMobile = require('./isMobile.cjs');
@@ -39,6 +44,10 @@ var handleMobileWalletRedirect = require('./handleMobileWalletRedirect/handleMob
39
44
  var uniq = require('./uniq/uniq.cjs');
40
45
  var getTLD = require('./getTLD/getTLD.cjs');
41
46
  var pipe = require('./pipe/pipe.cjs');
47
+ var formatNumberText = require('./formatNumberText/formatNumberText.cjs');
48
+ var ceil = require('./ceil/ceil.cjs');
49
+ var trimEnd = require('./trimEnd/trimEnd.cjs');
50
+ var runSafe = require('./runSafe/runSafe.cjs');
42
51
 
43
52
 
44
53
 
@@ -49,20 +58,25 @@ exports.ChainalysisError = ChainalysisError.ChainalysisError;
49
58
  exports.CustomError = CustomError.CustomError;
50
59
  exports.DynamicError = DynamicError.DynamicError;
51
60
  exports.EmailAlreadyExistsError = EmailAlreadyExistsError.EmailAlreadyExistsError;
61
+ exports.EmailProviderError = EmailProviderError.EmailProviderError;
52
62
  exports.EmailVerificationError = EmailVerificationError.EmailVerificationError;
63
+ exports.GateBlockedError = GateBlockedError.GateBlockedError;
64
+ exports.InsufficientFundsError = InsufficientFundsError.InsufficientFundsError;
65
+ exports.MissingEnvironmentIdError = MissingEnvironmentIdError.MissingEnvironmentIdError;
66
+ exports.MissingPublicAddressError = MissingPublicAddressError.MissingPublicAddressError;
53
67
  exports.NoAccessError = NoAccessError.NoAccessError;
54
68
  exports.NotSupportedError = NotSupportedError.NotSupportedError;
69
+ exports.SmsVerificationError = SmsVerificationError.SmsVerificationError;
70
+ exports.SocialAccountAlreadyExistsError = SocialAccountAlreadyExistsError.SocialAccountAlreadyExistsError;
71
+ exports.TransactionGasCannotBeSponsoredError = TransactionGasCannotBeSponsoredError.TransactionGasCannotBeSponsoredError;
72
+ exports.UserHasAccountWithEmailError = UserHasAccountWithEmailError.UserHasAccountWithEmailError;
55
73
  exports.UsernameAlreadyExistsError = UsernameAlreadyExistsError.UsernameAlreadyExistsError;
56
74
  exports.WalletNotDeployedError = WalletNotDeployedError.WalletNotDeployedError;
57
75
  exports.WalletUsedError = WalletUsedError.WalletUsedError;
58
- exports.EmailProviderError = EmailProviderError.EmailProviderError;
59
- exports.MissingEnvironmentIdError = MissingEnvironmentIdError.MissingEnvironmentIdError;
60
- exports.GateBlockedError = GateBlockedError.GateBlockedError;
61
- exports.UserHasAccountWithEmailError = UserHasAccountWithEmailError.UserHasAccountWithEmailError;
62
- exports.SocialAccountAlreadyExistsError = SocialAccountAlreadyExistsError.SocialAccountAlreadyExistsError;
63
- exports.TransactionGasCannotBeSponsoredError = TransactionGasCannotBeSponsoredError.TransactionGasCannotBeSponsoredError;
64
- exports.InsufficientFundsError = InsufficientFundsError.InsufficientFundsError;
65
- exports.MissingPublicAddressError = MissingPublicAddressError.MissingPublicAddressError;
76
+ exports.UserRejectedTransactionError = UserRejectedTransactionError.UserRejectedTransactionError;
77
+ exports.TooManyEmailVerificationsError = TooManyEmailVerificationsError.TooManyEmailVerificationsError;
78
+ exports.VerificationDataCollectionError = VerificationDataCollectionError.VerificationDataCollectionError;
79
+ exports.InvalidPhoneNumberError = InvalidPhoneNumberError.InvalidPhoneNumberError;
66
80
  exports.CancellablePromise = CancellablePromise.CancellablePromise;
67
81
  exports.isFunction = isFunction.isFunction;
68
82
  exports.getAndroidVersion = isMobile.getAndroidVersion;
@@ -93,3 +107,7 @@ exports.handleMobileWalletRedirect = handleMobileWalletRedirect.handleMobileWall
93
107
  exports.uniq = uniq.uniq;
94
108
  exports.getTLD = getTLD.getTLD;
95
109
  exports.pipe = pipe.pipe;
110
+ exports.formatNumberText = formatNumberText.formatNumberText;
111
+ exports.ceil = ceil.ceil;
112
+ exports.trimEnd = trimEnd.trimEnd;
113
+ exports.runSafe = runSafe.runSafe;
package/src/index.d.ts CHANGED
@@ -17,3 +17,7 @@ export * from './handleMobileWalletRedirect';
17
17
  export * from './uniq';
18
18
  export * from './getTLD';
19
19
  export * from './pipe';
20
+ export * from './formatNumberText';
21
+ export * from './ceil';
22
+ export * from './trimEnd';
23
+ export { runSafe } from './runSafe';
package/src/index.js CHANGED
@@ -5,20 +5,25 @@ export { ChainalysisError } from './errors/ChainalysisError.js';
5
5
  export { CustomError } from './errors/CustomError.js';
6
6
  export { DynamicError } from './errors/DynamicError.js';
7
7
  export { EmailAlreadyExistsError } from './errors/EmailAlreadyExistsError.js';
8
+ export { EmailProviderError } from './errors/EmailProviderError.js';
8
9
  export { EmailVerificationError } from './errors/EmailVerificationError.js';
10
+ export { GateBlockedError } from './errors/GateBlockedError.js';
11
+ export { InsufficientFundsError } from './errors/InsufficientFundsError.js';
12
+ export { MissingEnvironmentIdError } from './errors/MissingEnvironmentIdError.js';
13
+ export { MissingPublicAddressError } from './errors/MissingPublicAddressError.js';
9
14
  export { NoAccessError } from './errors/NoAccessError.js';
10
15
  export { NotSupportedError } from './errors/NotSupportedError.js';
16
+ export { SmsVerificationError } from './errors/SmsVerificationError.js';
17
+ export { SocialAccountAlreadyExistsError } from './errors/SocialAccountAlreadyExistsError.js';
18
+ export { TransactionGasCannotBeSponsoredError } from './errors/TransactionGasCannotBeSponsoredError.js';
19
+ export { UserHasAccountWithEmailError } from './errors/UserHasAccountWithEmailError.js';
11
20
  export { UsernameAlreadyExistsError } from './errors/UsernameAlreadyExistsError.js';
12
21
  export { WalletNotDeployedError } from './errors/WalletNotDeployedError.js';
13
22
  export { WalletUsedError } from './errors/WalletUsedError.js';
14
- export { EmailProviderError } from './errors/EmailProviderError.js';
15
- export { MissingEnvironmentIdError } from './errors/MissingEnvironmentIdError.js';
16
- export { GateBlockedError } from './errors/GateBlockedError.js';
17
- export { UserHasAccountWithEmailError } from './errors/UserHasAccountWithEmailError.js';
18
- export { SocialAccountAlreadyExistsError } from './errors/SocialAccountAlreadyExistsError.js';
19
- export { TransactionGasCannotBeSponsoredError } from './errors/TransactionGasCannotBeSponsoredError.js';
20
- export { InsufficientFundsError } from './errors/InsufficientFundsError.js';
21
- export { MissingPublicAddressError } from './errors/MissingPublicAddressError.js';
23
+ export { UserRejectedTransactionError } from './errors/UserRejectedTransactionError.js';
24
+ export { TooManyEmailVerificationsError } from './errors/TooManyEmailVerificationsError.js';
25
+ export { VerificationDataCollectionError } from './errors/VerificationDataCollectionError.js';
26
+ export { InvalidPhoneNumberError } from './errors/InvalidPhoneNumberError.js';
22
27
  export { CancellablePromise } from './CancellablePromise/CancellablePromise.js';
23
28
  export { isFunction } from './isFunction/isFunction.js';
24
29
  export { getAndroidVersion, isAndroid, isIOS, isIPad, isIPhone, isIPhone8OrEarlier, isLegacySafari, isMobile, isSamsungBrowser, isWindows } from './isMobile.js';
@@ -35,3 +40,7 @@ export { handleMobileWalletRedirect } from './handleMobileWalletRedirect/handleM
35
40
  export { uniq } from './uniq/uniq.js';
36
41
  export { getTLD } from './getTLD/getTLD.js';
37
42
  export { pipe } from './pipe/pipe.js';
43
+ export { formatNumberText } from './formatNumberText/formatNumberText.js';
44
+ export { ceil } from './ceil/ceil.js';
45
+ export { trimEnd } from './trimEnd/trimEnd.js';
46
+ export { runSafe } from './runSafe/runSafe.js';
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var _tslib = require('../_virtual/_tslib.cjs');
6
- require('./errors/TransactionGasCannotBeSponsoredError.cjs');
7
6
  require('./errors/InsufficientFundsError.cjs');
7
+ require('./errors/TransactionGasCannotBeSponsoredError.cjs');
8
8
  require('./logger/logger.cjs');
9
9
  var sleep = require('./sleep/sleep.cjs');
10
10
  require('viem/chains');
@@ -1,6 +1,6 @@
1
1
  import { __awaiter } from '../_virtual/_tslib.js';
2
- import './errors/TransactionGasCannotBeSponsoredError.js';
3
2
  import './errors/InsufficientFundsError.js';
3
+ import './errors/TransactionGasCannotBeSponsoredError.js';
4
4
  import './logger/logger.js';
5
5
  import { sleep } from './sleep/sleep.js';
6
6
  import 'viem/chains';
@@ -0,0 +1 @@
1
+ export { runSafe } from './runSafe';
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _tslib = require('../../_virtual/_tslib.cjs');
6
+
7
+ /**
8
+ * Safely executes a callback function.
9
+ * @template T The type of the callback's return value.
10
+ * @template E The type of the error.
11
+ * @param {() => Promise<T> | T} callback A function that might throw an error.
12
+ * @returns {Promise<[T | undefined, E | undefined]>} A tuple with either the result or the error.
13
+ */
14
+ const runSafe = (callback) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
15
+ try {
16
+ const resolved = yield callback();
17
+ return [resolved, undefined];
18
+ }
19
+ catch (error) {
20
+ return [undefined, error];
21
+ }
22
+ });
23
+
24
+ exports.runSafe = runSafe;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Safely executes a callback function.
3
+ * @template T The type of the callback's return value.
4
+ * @template E The type of the error.
5
+ * @param {() => Promise<T> | T} callback A function that might throw an error.
6
+ * @returns {Promise<[T | undefined, E | undefined]>} A tuple with either the result or the error.
7
+ */
8
+ export declare const runSafe: <T, E>(callback: () => T | Promise<T>) => Promise<[T | undefined, E | undefined]>;
@@ -0,0 +1,20 @@
1
+ import { __awaiter } from '../../_virtual/_tslib.js';
2
+
3
+ /**
4
+ * Safely executes a callback function.
5
+ * @template T The type of the callback's return value.
6
+ * @template E The type of the error.
7
+ * @param {() => Promise<T> | T} callback A function that might throw an error.
8
+ * @returns {Promise<[T | undefined, E | undefined]>} A tuple with either the result or the error.
9
+ */
10
+ const runSafe = (callback) => __awaiter(void 0, void 0, void 0, function* () {
11
+ try {
12
+ const resolved = yield callback();
13
+ return [resolved, undefined];
14
+ }
15
+ catch (error) {
16
+ return [undefined, error];
17
+ }
18
+ });
19
+
20
+ export { runSafe };
@@ -0,0 +1 @@
1
+ export { trimEnd } from './trimEnd';
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const trimEnd = (text, char = '') => {
6
+ let endIndex = text.length - 1;
7
+ while (endIndex >= 0 && text[endIndex] === char) {
8
+ endIndex--;
9
+ }
10
+ return text.slice(0, endIndex + 1);
11
+ };
12
+
13
+ exports.trimEnd = trimEnd;
@@ -0,0 +1 @@
1
+ export declare const trimEnd: (text: string, char?: string) => string;
@@ -0,0 +1,9 @@
1
+ const trimEnd = (text, char = '') => {
2
+ let endIndex = text.length - 1;
3
+ while (endIndex >= 0 && text[endIndex] === char) {
4
+ endIndex--;
5
+ }
6
+ return text.slice(0, endIndex + 1);
7
+ };
8
+
9
+ export { trimEnd };