()
| 212 | } |
| 213 | |
| 214 | async function fetchProjects(): Promise<Project[]> { |
| 215 | const [events, deletionEvents] = await Promise.all([ |
| 216 | relayClient.fetchEvents({ |
| 217 | kinds: [KIND_REPO_ANNOUNCEMENT], |
| 218 | limit: 200, |
| 219 | }), |
| 220 | relayClient.fetchEvents({ |
| 221 | kinds: [KIND_DELETION], |
| 222 | limit: 500, |
| 223 | }), |
| 224 | ]); |
| 225 | |
| 226 | return dedup(events) |
| 227 | .map(eventToProject) |
| 228 | .filter( |
| 229 | (project) => |
| 230 | !isHiddenLocally(project) && !isDeletedByA(project, deletionEvents), |
| 231 | ) |
| 232 | .sort((a, b) => b.createdAt - a.createdAt); |
| 233 | } |
| 234 | |
| 235 | /** |
| 236 | * Splits a project route ID into its owner pubkey and dtag. The canonical |
nothing calls this directly
no test coverage detected