1+ // 1. Basic Types & Enums
12export type Address = `0x${string } `;
23
34export enum Status {
@@ -6,6 +7,7 @@ export enum Status {
67 REJECTED = 'REJECTED' ,
78}
89
10+ // 2. Metadata & Supporting Interfaces
911export interface ApplicationMetadata {
1012 signature : string ;
1113 application : {
@@ -52,34 +54,48 @@ export interface ProjectMetadata {
5254 projectTwitter ?: string ;
5355 userGithub ?: string ;
5456 projectGithub ?: string ;
55- // credentials: ProjectCredentials;
5657 owners : Array < { address : string } > ;
5758 createdAt : number ;
5859 lastUpdated : number ;
5960}
6061
61- export interface Application {
62+ // 3. Base Interfaces (Used in Multiple Places)
63+ export interface BaseProject {
64+ metadata : ProjectMetadata ;
65+ metadataCid : string ;
66+ }
67+
68+ export interface BaseApplication {
6269 id : string ;
6370 metadata : ApplicationMetadata ;
6471 metadataCid : string ;
6572 status : Status ;
6673 projectId : string ;
67- project : {
68- metadata : ProjectMetadata ;
69- metadataCid : string ;
70- } ;
7174}
7275
73- export interface RoundWithApplications {
76+ // 4. Extended Implementations
77+ export interface Application extends BaseApplication {
78+ project : BaseProject ;
79+ }
80+
81+ export interface ApplicationQuery extends BaseApplication {
82+ projects : BaseProject [ ] ;
83+ }
84+
85+ export interface BaseRound < T extends BaseApplication > {
7486 chainId : number ;
7587 id : string ;
7688 roundMetadata : RoundMetadata ;
7789 roundMetadataCid : string ;
78- applications : Application [ ] ;
90+ applications : T [ ] ;
7991}
8092
93+ export type RoundWithApplications = BaseRound < Application > ;
94+ export type RoundWithApplicationsQuery = BaseRound < ApplicationQuery > ;
95+
96+ // 5. API Response Structures
8197export interface RoundApplicationsQueryResponse {
82- rounds : RoundWithApplications [ ] ;
98+ rounds : RoundWithApplicationsQuery [ ] ;
8399}
84100
85101export interface ApplicationWithRound {
0 commit comments