Commit 07e9be6
fix: Critical bugs and centralized validation layer (#6)
* Docs: rm old files
* fix: critical bugs and add centralized validation layer
This commit fixes several critical bugs and implements a centralized validation service:
Bug Fixes:
- Fix inconsistent storage projectName (transaction-store now uses 'safe-cli')
- Fix date serialization issues (use ISO strings instead of Date objects)
- Add fetch timeout handling (10s timeout for ABI service API calls)
- Fix unsafe parseInt calls (add explicit radix parameter)
New Features:
- Add ValidationService for centralized validation logic
- Implement 20+ validation methods covering addresses, private keys, URLs, etc.
- Support both validate*() for prompts and assert*() for business logic
- Update commands to use ValidationService (wallet/import, config/chains, tx/create, account/create)
Benefits:
- Consistent validation across the application
- Better error messages
- Easier to test and maintain
- Improved type safety
- Reduced code duplication
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* perf: move validator instantiation outside loop in account create
- Move getValidationService() call outside the while loop
- Reduces unnecessary singleton lookups on each iteration
- Validator is now instantiated once and reused for all validations
Addresses Copilot AI code review feedback
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* docs: improve README user-friendliness and remove roadmap
Major improvements:
- Add 'Why Safe CLI?' section explaining value proposition
- Reorganize content with better visual hierarchy
- Add table-based command reference for easier scanning
- Include 'Common Workflows' section with practical examples
- Simplify language and reduce technical jargon
- Better formatting with emojis and clear sections
- Add 'Need Help?' section with support resources
Removed:
- Roadmap section (completed phases no longer relevant)
- Overly detailed explanations moved to more concise format
- Redundant information consolidated
Result: 64 fewer lines, more user-friendly, easier to navigate
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Update README.md
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/services/validation-service.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix: eliminate all type issues and lint warnings
- Replace 47 explicit 'any' types with proper TypeScript types
- Remove 14 unused error variables in catch blocks
- Add proper type interfaces (ABIItem, APITransaction)
- Improve type safety across commands, services, and storage
- All files now pass strict TypeScript checks and ESLint
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Update README.md
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent 6393291 commit 07e9be6
File tree
28 files changed
+1291
-2154
lines changed- src
- commands
- account
- config
- tx
- wallet
- services
- storage
- tests/integration
- test/helpers
- types
28 files changed
+1291
-2154
lines changedLarge diffs are not rendered by default.
This file was deleted.
This file was deleted.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
90 | | - | |
91 | | - | |
92 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| |||
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 119 | + | |
125 | 120 | | |
126 | 121 | | |
127 | 122 | | |
| |||
135 | 130 | | |
136 | 131 | | |
137 | 132 | | |
138 | | - | |
| 133 | + | |
139 | 134 | | |
140 | 135 | | |
141 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 49 | + | |
54 | 50 | | |
55 | 51 | | |
56 | 52 | | |
| |||
61 | 57 | | |
62 | 58 | | |
63 | 59 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 60 | + | |
69 | 61 | | |
70 | 62 | | |
71 | 63 | | |
| |||
86 | 78 | | |
87 | 79 | | |
88 | 80 | | |
89 | | - | |
| 81 | + | |
90 | 82 | | |
91 | 83 | | |
92 | 84 | | |
| |||
97 | 89 | | |
98 | 90 | | |
99 | 91 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 92 | + | |
104 | 93 | | |
105 | 94 | | |
106 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | | - | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | | - | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
84 | | - | |
| 85 | + | |
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
138 | | - | |
| 139 | + | |
139 | 140 | | |
140 | | - | |
| 141 | + | |
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| |||
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
163 | | - | |
| 164 | + | |
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 109 | + | |
113 | 110 | | |
114 | 111 | | |
115 | 112 | | |
116 | 113 | | |
117 | 114 | | |
118 | 115 | | |
119 | 116 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 117 | + | |
| 118 | + | |
129 | 119 | | |
130 | 120 | | |
131 | 121 | | |
| |||
139 | 129 | | |
140 | 130 | | |
141 | 131 | | |
142 | | - | |
| 132 | + | |
143 | 133 | | |
144 | 134 | | |
145 | 135 | | |
| |||
159 | 149 | | |
160 | 150 | | |
161 | 151 | | |
162 | | - | |
| 152 | + | |
163 | 153 | | |
164 | 154 | | |
165 | 155 | | |
| |||
203 | 193 | | |
204 | 194 | | |
205 | 195 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
212 | 199 | | |
213 | 200 | | |
214 | 201 | | |
215 | 202 | | |
216 | | - | |
| 203 | + | |
| 204 | + | |
217 | 205 | | |
218 | 206 | | |
219 | 207 | | |
| |||
225 | 213 | | |
226 | 214 | | |
227 | 215 | | |
228 | | - | |
| 216 | + | |
229 | 217 | | |
230 | 218 | | |
231 | 219 | | |
232 | 220 | | |
233 | 221 | | |
234 | 222 | | |
235 | | - | |
| 223 | + | |
236 | 224 | | |
237 | 225 | | |
238 | 226 | | |
| |||
261 | 249 | | |
262 | 250 | | |
263 | 251 | | |
264 | | - | |
| 252 | + | |
265 | 253 | | |
266 | 254 | | |
267 | 255 | | |
| |||
277 | 265 | | |
278 | 266 | | |
279 | 267 | | |
280 | | - | |
| 268 | + | |
281 | 269 | | |
282 | 270 | | |
283 | 271 | | |
| |||
307 | 295 | | |
308 | 296 | | |
309 | 297 | | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
| 298 | + | |
319 | 299 | | |
320 | 300 | | |
321 | 301 | | |
| |||
327 | 307 | | |
328 | 308 | | |
329 | 309 | | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
| 310 | + | |
338 | 311 | | |
339 | 312 | | |
340 | 313 | | |
| |||
374 | 347 | | |
375 | 348 | | |
376 | 349 | | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
| 350 | + | |
385 | 351 | | |
386 | 352 | | |
387 | 353 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| |||
0 commit comments