1
+ // 1. Basic Types & Enums
1
2
export type Address = `0x${string } `;
2
3
3
4
export enum Status {
@@ -6,6 +7,7 @@ export enum Status {
6
7
REJECTED = 'REJECTED' ,
7
8
}
8
9
10
+ // 2. Metadata & Supporting Interfaces
9
11
export interface ApplicationMetadata {
10
12
signature : string ;
11
13
application : {
@@ -52,34 +54,48 @@ export interface ProjectMetadata {
52
54
projectTwitter ?: string ;
53
55
userGithub ?: string ;
54
56
projectGithub ?: string ;
55
- // credentials: ProjectCredentials;
56
57
owners : Array < { address : string } > ;
57
58
createdAt : number ;
58
59
lastUpdated : number ;
59
60
}
60
61
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 {
62
69
id : string ;
63
70
metadata : ApplicationMetadata ;
64
71
metadataCid : string ;
65
72
status : Status ;
66
73
projectId : string ;
67
- project : {
68
- metadata : ProjectMetadata ;
69
- metadataCid : string ;
70
- } ;
71
74
}
72
75
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 > {
74
86
chainId : number ;
75
87
id : string ;
76
88
roundMetadata : RoundMetadata ;
77
89
roundMetadataCid : string ;
78
- applications : Application [ ] ;
90
+ applications : T [ ] ;
79
91
}
80
92
93
+ export type RoundWithApplications = BaseRound < Application > ;
94
+ export type RoundWithApplicationsQuery = BaseRound < ApplicationQuery > ;
95
+
96
+ // 5. API Response Structures
81
97
export interface RoundApplicationsQueryResponse {
82
- rounds : RoundWithApplications [ ] ;
98
+ rounds : RoundWithApplicationsQuery [ ] ;
83
99
}
84
100
85
101
export interface ApplicationWithRound {
0 commit comments