@show-karma/karma-gap-sdk 0.4.16 → 0.4.18

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 (188) hide show
  1. package/core/abi/AirdropNFT.json +1 -1
  2. package/core/abi/Allo.json +860 -860
  3. package/core/abi/AlloRegistry.json +578 -578
  4. package/core/abi/CommunityResolverABI.json +506 -506
  5. package/core/abi/Donations.json +251 -251
  6. package/core/abi/EAS.json +1 -1
  7. package/core/abi/MultiAttester.json +746 -746
  8. package/core/abi/ProjectResolver.json +574 -574
  9. package/core/abi/SchemaRegistry.json +1 -1
  10. package/core/abi/index.d.ts +1114 -0
  11. package/core/abi/index.js +26 -0
  12. package/core/class/AllGapSchemas.d.ts +9 -0
  13. package/core/class/AllGapSchemas.js +19 -0
  14. package/core/class/Attestation.d.ts +173 -0
  15. package/core/class/Attestation.js +333 -0
  16. package/core/class/Fetcher.d.ts +175 -0
  17. package/core/class/Fetcher.js +13 -0
  18. package/core/class/GAP.d.ts +254 -0
  19. package/core/class/GAP.js +289 -0
  20. package/core/class/GapSchema.d.ts +34 -0
  21. package/core/class/GapSchema.js +62 -0
  22. package/core/class/Gelato/{Gelato.ts → Gelato.js} +0 -23
  23. package/core/class/GrantProgramRegistry/Allo.d.ts +17 -0
  24. package/core/class/GrantProgramRegistry/Allo.js +137 -0
  25. package/core/class/GrantProgramRegistry/AlloRegistry.d.ts +15 -0
  26. package/core/class/GrantProgramRegistry/AlloRegistry.js +70 -0
  27. package/core/class/GraphQL/AxiosGQL.d.ts +6 -0
  28. package/core/class/GraphQL/AxiosGQL.js +25 -0
  29. package/core/class/GraphQL/EASClient.d.ts +16 -0
  30. package/core/class/GraphQL/EASClient.js +26 -0
  31. package/core/class/GraphQL/GapEasClient.d.ts +71 -0
  32. package/core/class/GraphQL/GapEasClient.js +451 -0
  33. package/core/class/GraphQL/index.js +19 -0
  34. package/core/class/Schema.d.ts +233 -0
  35. package/core/class/Schema.js +490 -0
  36. package/core/class/SchemaError.d.ts +30 -0
  37. package/core/class/SchemaError.js +39 -0
  38. package/core/class/contract/GapContract.d.ts +102 -0
  39. package/core/class/contract/GapContract.js +285 -0
  40. package/core/class/entities/Community.d.ts +34 -0
  41. package/core/class/entities/Community.js +109 -0
  42. package/core/class/entities/ContributorProfile.d.ts +41 -0
  43. package/core/class/entities/ContributorProfile.js +69 -0
  44. package/core/class/entities/Grant.d.ts +54 -0
  45. package/core/class/entities/Grant.js +223 -0
  46. package/core/class/entities/GrantUpdate.d.ts +62 -0
  47. package/core/class/entities/GrantUpdate.js +114 -0
  48. package/core/class/entities/MemberOf.d.ts +11 -0
  49. package/core/class/entities/MemberOf.js +33 -0
  50. package/core/class/entities/Milestone.d.ts +168 -0
  51. package/core/class/entities/Milestone.js +657 -0
  52. package/core/class/entities/Project.d.ts +92 -0
  53. package/core/class/entities/Project.js +418 -0
  54. package/core/class/entities/ProjectImpact.d.ts +50 -0
  55. package/core/class/entities/ProjectImpact.js +112 -0
  56. package/core/class/entities/ProjectMilestone.d.ts +60 -0
  57. package/core/class/entities/ProjectMilestone.js +174 -0
  58. package/core/class/entities/ProjectPointer.d.ts +12 -0
  59. package/core/class/entities/ProjectPointer.js +22 -0
  60. package/core/class/entities/ProjectUpdate.d.ts +50 -0
  61. package/core/class/entities/ProjectUpdate.js +110 -0
  62. package/core/class/entities/Track.d.ts +16 -0
  63. package/core/class/entities/Track.js +21 -0
  64. package/core/class/entities/index.js +26 -0
  65. package/core/class/index.js +26 -0
  66. package/core/class/karma-indexer/GapIndexerClient.d.ts +66 -0
  67. package/core/class/karma-indexer/GapIndexerClient.js +207 -0
  68. package/core/class/karma-indexer/api/GapIndexerApi.d.ts +73 -0
  69. package/core/class/karma-indexer/api/GapIndexerApi.js +256 -0
  70. package/core/class/karma-indexer/api/types.d.ts +309 -0
  71. package/core/class/karma-indexer/api/types.js +2 -0
  72. package/core/class/remote-storage/IpfsStorage.d.ts +23 -0
  73. package/core/class/remote-storage/IpfsStorage.js +56 -0
  74. package/core/class/remote-storage/RemoteStorage.d.ts +41 -0
  75. package/core/class/remote-storage/RemoteStorage.js +38 -0
  76. package/core/class/types/allo.d.ts +78 -0
  77. package/core/class/types/allo.js +2 -0
  78. package/core/class/types/attestations.d.ts +173 -0
  79. package/core/class/types/attestations.js +66 -0
  80. package/core/consts.d.ts +50 -0
  81. package/core/consts.js +699 -0
  82. package/core/index.js +24 -0
  83. package/core/shared/types.d.ts +13 -0
  84. package/core/shared/types.js +2 -0
  85. package/core/types.d.ts +131 -0
  86. package/core/types.js +13 -0
  87. package/core/utils/gelato/index.js +19 -0
  88. package/core/utils/gelato/send-gelato-txn.d.ts +55 -0
  89. package/core/utils/gelato/send-gelato-txn.js +100 -0
  90. package/core/utils/gelato/sponsor-handler.d.ts +9 -0
  91. package/core/utils/gelato/sponsor-handler.js +60 -0
  92. package/core/utils/gelato/watch-gelato-txn.d.ts +7 -0
  93. package/core/utils/gelato/watch-gelato-txn.js +63 -0
  94. package/core/utils/get-date.d.ts +1 -0
  95. package/core/utils/get-date.js +7 -0
  96. package/core/utils/get-ipfs-data.d.ts +1 -0
  97. package/core/utils/get-ipfs-data.js +20 -0
  98. package/core/utils/get-web3-provider.d.ts +2 -0
  99. package/core/utils/get-web3-provider.js +18 -0
  100. package/core/utils/gql-queries.d.ts +12 -0
  101. package/core/utils/gql-queries.js +90 -0
  102. package/core/utils/index.js +23 -0
  103. package/core/utils/map-filter.d.ts +8 -0
  104. package/core/utils/map-filter.js +20 -0
  105. package/core/utils/serialize-bigint.d.ts +1 -0
  106. package/core/utils/serialize-bigint.js +8 -0
  107. package/core/utils/to-unix.d.ts +1 -0
  108. package/core/utils/to-unix.js +25 -0
  109. package/index.js +17 -0
  110. package/package.json +45 -45
  111. package/.cursorrules +0 -43
  112. package/core/abi/index.ts +0 -21
  113. package/core/class/AllGapSchemas.ts +0 -21
  114. package/core/class/Attestation.ts +0 -429
  115. package/core/class/Fetcher.ts +0 -224
  116. package/core/class/GAP.ts +0 -481
  117. package/core/class/GapSchema.ts +0 -93
  118. package/core/class/GrantProgramRegistry/Allo.ts +0 -188
  119. package/core/class/GrantProgramRegistry/AlloRegistry.ts +0 -101
  120. package/core/class/GraphQL/AxiosGQL.ts +0 -29
  121. package/core/class/GraphQL/EASClient.ts +0 -34
  122. package/core/class/GraphQL/GapEasClient.ts +0 -869
  123. package/core/class/Schema.ts +0 -659
  124. package/core/class/SchemaError.ts +0 -42
  125. package/core/class/contract/GapContract.ts +0 -457
  126. package/core/class/entities/Community.ts +0 -148
  127. package/core/class/entities/ContributorProfile.ts +0 -108
  128. package/core/class/entities/Grant.ts +0 -321
  129. package/core/class/entities/GrantUpdate.ts +0 -187
  130. package/core/class/entities/MemberOf.ts +0 -52
  131. package/core/class/entities/Milestone.ts +0 -898
  132. package/core/class/entities/Project.ts +0 -672
  133. package/core/class/entities/ProjectImpact.ts +0 -170
  134. package/core/class/entities/ProjectMilestone.ts +0 -254
  135. package/core/class/entities/ProjectPointer.ts +0 -39
  136. package/core/class/entities/ProjectUpdate.ts +0 -176
  137. package/core/class/entities/Track.ts +0 -32
  138. package/core/class/karma-indexer/GapIndexerClient.ts +0 -383
  139. package/core/class/karma-indexer/api/GapIndexerApi.ts +0 -446
  140. package/core/class/karma-indexer/api/types.ts +0 -313
  141. package/core/class/remote-storage/IpfsStorage.ts +0 -76
  142. package/core/class/remote-storage/RemoteStorage.ts +0 -65
  143. package/core/class/types/allo.ts +0 -93
  144. package/core/class/types/attestations.ts +0 -223
  145. package/core/consts.ts +0 -775
  146. package/core/scripts/create-grant.ts +0 -102
  147. package/core/scripts/create-program.ts +0 -43
  148. package/core/scripts/create-schemas.ts +0 -65
  149. package/core/scripts/deploy.ts +0 -65
  150. package/core/scripts/index.ts +0 -1
  151. package/core/scripts/milestone-multi-grants.ts +0 -125
  152. package/core/shared/types.ts +0 -13
  153. package/core/types.ts +0 -224
  154. package/core/utils/gelato/send-gelato-txn.ts +0 -114
  155. package/core/utils/gelato/sponsor-handler.ts +0 -77
  156. package/core/utils/gelato/watch-gelato-txn.ts +0 -67
  157. package/core/utils/get-date.ts +0 -3
  158. package/core/utils/get-ipfs-data.ts +0 -13
  159. package/core/utils/get-web3-provider.ts +0 -18
  160. package/core/utils/gql-queries.ts +0 -133
  161. package/core/utils/map-filter.ts +0 -21
  162. package/core/utils/serialize-bigint.ts +0 -7
  163. package/core/utils/to-unix.ts +0 -18
  164. package/create-community-example.ts +0 -119
  165. package/csv-upload/README.md +0 -74
  166. package/csv-upload/config.ts +0 -41
  167. package/csv-upload/example.csv +0 -2
  168. package/csv-upload/keys.example.json +0 -8
  169. package/csv-upload/scripts/run.ts +0 -417
  170. package/csv-upload/types.ts +0 -39
  171. package/docs/.gitkeep +0 -0
  172. package/docs/images/attestation-architecture.png +0 -0
  173. package/docs/images/dfd-get-projects.png +0 -0
  174. package/gap-schema.yaml +0 -155
  175. package/milestone-workflow-example.ts +0 -353
  176. package/readme.md +0 -872
  177. package/schemas/.gitkeep +0 -0
  178. package/schemas/GAP-schemas-1692135812877.json +0 -33
  179. package/test-file-indexer-api.ts +0 -25
  180. package/tsconfig.json +0 -26
  181. /package/{csv-upload/.gitkeep → core/class/Gelato/Gelato.d.ts} +0 -0
  182. /package/core/class/GraphQL/{index.ts → index.d.ts} +0 -0
  183. /package/core/class/entities/{index.ts → index.d.ts} +0 -0
  184. /package/core/class/{index.ts → index.d.ts} +0 -0
  185. /package/core/{index.ts → index.d.ts} +0 -0
  186. /package/core/utils/gelato/{index.ts → index.d.ts} +0 -0
  187. /package/core/utils/{index.ts → index.d.ts} +0 -0
  188. /package/{index.ts → index.d.ts} +0 -0
@@ -1,313 +0,0 @@
1
- import { IGrantUpdateBase } from "core/shared/types";
2
-
3
- export type Hex = `0x${string}`;
4
- export type JSONStr = string;
5
- export type ExternalLink = { type: string; url: string };
6
- export type ExternalCustomLink = {
7
- type: 'custom';
8
- url: string;
9
- name: string
10
- };
11
- export interface ITag {
12
- name: string;
13
- }
14
-
15
- export interface IAttestationResponse {
16
- id: string;
17
- uid: Hex;
18
- schemaUID: Hex;
19
- refUID: Hex;
20
- attester: Hex;
21
- recipient: Hex;
22
- revoked: boolean;
23
- revocationTime?: number;
24
- createdAt: any;
25
- updatedAt: any;
26
- chainID: number;
27
- type: string;
28
- data: any;
29
- decodedDataJson: JSONStr;
30
- isOffchain: any;
31
- revocable: any;
32
- schemaId: Hex;
33
- }
34
-
35
- export interface ISummaryProject {
36
- title: string;
37
- slug?: string;
38
- uid: Hex;
39
- }
40
-
41
- export interface IMilestoneCompleted extends IAttestationResponse {
42
- type: "MilestoneStatus";
43
- data: {
44
- type: "approved" | "rejected" | "completed";
45
- reason?: string;
46
- proofOfWork?: string;
47
- };
48
- }
49
-
50
- export interface IMilestoneResponse extends IAttestationResponse {
51
- type: "Milestone";
52
- completed?: IMilestoneCompleted;
53
- approved?: IMilestoneCompleted;
54
- rejected?: IMilestoneCompleted;
55
- verified?: IMilestoneCompleted[];
56
- data: {
57
- title: string;
58
- description: string;
59
- endsAt: number;
60
- startsAt?: number;
61
- type: "milestone";
62
- priority?: number;
63
- };
64
- }
65
-
66
- export interface IGrantUpdateStatus extends IAttestationResponse {
67
- type: `grant-update-${IStatus}`;
68
- reason?: string;
69
- data: {
70
- type: "approved" | "rejected" | "completed";
71
- reason?: string;
72
- pitchDeck?: string;
73
- demoVideo?: string;
74
- trackExplanations?: Array<{
75
- trackId: string;
76
- trackName: string;
77
- explanation: string;
78
- }>;
79
- };
80
- }
81
- export interface IGrantUpdate extends IAttestationResponse {
82
- data: IGrantUpdateBase & {
83
- type: "grant-update";
84
- };
85
- verified?: IGrantUpdateStatus[];
86
- }
87
-
88
- export interface IProjectUpdateStatus extends IAttestationResponse {
89
- type: `project-update-${IStatus}`;
90
- reason?: string;
91
- data: {
92
- type: "approved" | "rejected" | "completed";
93
- reason?: string;
94
- };
95
- }
96
- export interface IProjectUpdate extends IAttestationResponse {
97
- data: {
98
- title: string;
99
- text: string;
100
- startDate?: Date;
101
- endDate?: Date;
102
- grants?: string[];
103
- indicators?: {
104
- name: string;
105
- indicatorId: string;
106
- }[];
107
- deliverables?: {
108
- name: string;
109
- proof: string;
110
- description: string;
111
- }[];
112
- type: "project-update";
113
- };
114
- verified?: IProjectUpdateStatus[];
115
- }
116
-
117
- export interface IProjectMilestoneStatus extends IAttestationResponse {
118
- type: `project-milestone-verified`;
119
- reason?: string;
120
- data: {
121
- type: "approved" | "rejected" | "completed";
122
- reason?: string;
123
- };
124
- }
125
-
126
- export interface IProjectMilestoneResponse extends IAttestationResponse {
127
- data: {
128
- text: string;
129
- title: string;
130
- type: "project-milestone";
131
- };
132
- verified?: IProjectMilestoneStatus[];
133
- completed?: IMilestoneCompleted;
134
- }
135
-
136
- export interface IProjectPointer extends IAttestationResponse {
137
- data: {
138
- ogProjectUID: string;
139
- type: "project-pointer";
140
- };
141
- }
142
-
143
- export interface IGrantDetails extends IAttestationResponse {
144
- type: "GrantDetails";
145
- data: {
146
- title: string;
147
- amount: string;
148
- description: string;
149
- proposalURL: string;
150
- assetAndChainId?: [Hex, number];
151
- payoutAddress: Hex;
152
- questions: { type: string; query: string; explanation: string }[];
153
- startDate: number;
154
- programId?: string;
155
- type: "grant-details";
156
- fundUsage?: string;
157
- selectedTrackIds?: string[];
158
- };
159
- }
160
-
161
- export interface IGrantResponse extends IAttestationResponse {
162
- type: "Grant";
163
- data: { communityUID: Hex };
164
- details?: IGrantDetails;
165
- milestones: IMilestoneResponse[];
166
- completed?: IGrantUpdate;
167
- project: IProjectResponse;
168
- updates: IGrantUpdate[];
169
- community: ICommunityResponse;
170
- members: Hex[];
171
- categories?: string[];
172
- externalAddresses?: {
173
- [key: string]: string;
174
- };
175
- external?: {
176
- [key: string]: string[];
177
- };
178
- amount?: Hex;
179
- }
180
-
181
- export interface IMemberDetails extends IAttestationResponse {
182
- name: string;
183
- profilePictureURL: string;
184
- }
185
-
186
- export interface IMemberOf extends IAttestationResponse {
187
- type: "MemberOf";
188
- data: { memberOf: true };
189
- details?: IMemberDetails;
190
- }
191
-
192
- export interface IProjectDetails extends IAttestationResponse {
193
- type: "ProjectDetails";
194
- data: {
195
- title: string;
196
- description: string;
197
- problem?: string;
198
- solution?: string;
199
- missionSummary?: string;
200
- locationOfImpact?: string;
201
- imageURL: string;
202
- links?: Array<ExternalLink | ExternalCustomLink>;
203
- tags?: ITag[];
204
- slug?: string;
205
- type: "project-details";
206
- businessModel?: string;
207
- stageIn?: string;
208
- raisedMoney?: string;
209
- pathToTake?: string;
210
- };
211
- }
212
-
213
- type IStatus = "verified";
214
- export interface IProjectImpactStatus extends IAttestationResponse {
215
- type: `project-impact-${IStatus}`;
216
- reason?: string;
217
- }
218
- export interface IProjectImpact extends IAttestationResponse {
219
- type: "ProjectImpact";
220
- data: {
221
- work: string;
222
- impact: string;
223
- proof: string;
224
- startedAt?: number;
225
- completedAt: number;
226
- type: "project-impact";
227
- };
228
- verified: IProjectImpactStatus[];
229
- }
230
- export interface IProjectEndorsement extends IAttestationResponse {
231
- type: "ProjectEndorsement";
232
- data: {
233
- comment?: string;
234
- type?: "project-endorsement";
235
- };
236
- }
237
-
238
- export interface IProjectResponse extends IAttestationResponse {
239
- type: "Project";
240
- data: { project: true };
241
- details?: IProjectDetails;
242
- members: IMemberOf[];
243
- grants: IGrantResponse[];
244
- grantee: any;
245
- impacts: IProjectImpact[];
246
- updates: IProjectUpdate[];
247
- pointers: IProjectPointer[];
248
- symlinks: Hex[];
249
- endorsements: IProjectEndorsement[];
250
- milestones: IProjectMilestoneResponse[];
251
- payoutAddress?: Hex;
252
- }
253
-
254
- export interface ICommunityDetails extends IAttestationResponse {
255
- type: "CommunityDetails";
256
- data: {
257
- name: string;
258
- description: string;
259
- imageURL: string;
260
- links: ExternalLink[];
261
- slug?: string;
262
- };
263
- }
264
-
265
- export interface ICommunityResponse extends IAttestationResponse {
266
- type: "Community";
267
- data: { community: true };
268
- details?: ICommunityDetails;
269
- grants: IGrantResponse[];
270
- }
271
-
272
- export interface ICommunityAdminsResponse {
273
- id: string;
274
- admins: { user: { id: string } }[];
275
- }
276
-
277
- export interface ISearchResponse {
278
- projects: IProjectResponse[];
279
- communities: ICommunityResponse[];
280
- }
281
-
282
- export interface ITrackResponse {
283
- id: string;
284
- name: string;
285
- description?: string;
286
- communityUID: string;
287
- isArchived: boolean;
288
- createdAt: string;
289
- updatedAt: string;
290
- programId?: string;
291
- isActive?: boolean;
292
- chainID?: number;
293
- }
294
-
295
- export interface ITrackAssignmentResponse {
296
- id: string;
297
- programId: string;
298
- chainID: number;
299
- trackId: string;
300
- track: ITrackResponse;
301
- }
302
-
303
- export interface IProjectTrackResponse {
304
- projectUID: string;
305
- chainID: number;
306
- programId: string;
307
- track: ITrackResponse;
308
- project: {
309
- uid: string;
310
- chainID: number;
311
- details: any;
312
- };
313
- }
@@ -1,76 +0,0 @@
1
- import { RemoteStorage } from "./RemoteStorage";
2
- import { RemoteStorageError } from "../SchemaError";
3
- import { getIPFSData } from "../../utils";
4
- import { STORAGE_TYPE, TRemoteStorageOutput } from "core/types";
5
- import axios from "axios";
6
-
7
- export interface IpfsStorageOptions {
8
- token: string;
9
- }
10
-
11
- export class IpfsStorage extends RemoteStorage {
12
- private pinataJWTToken: string;
13
-
14
- constructor(
15
- opts: IpfsStorageOptions,
16
- /**
17
- * If set, will send request to another server instead of
18
- * using the local instance
19
- */
20
- sponsor?: RemoteStorage["sponsor"]
21
- ) {
22
- super(STORAGE_TYPE.IPFS, sponsor);
23
-
24
- this.assert(opts);
25
- this.pinataJWTToken = opts.token;
26
- }
27
-
28
- private assert(opts: IpfsStorageOptions) {}
29
-
30
- async save<T = unknown>(data: T): Promise<string> {
31
- try {
32
- const cid = await this.saveAndGetCID(data);
33
- return cid;
34
- } catch (error) {
35
- throw new RemoteStorageError(
36
- "REMOTE_STORAGE_UPLOAD",
37
- `Error adding data to IPFS`
38
- );
39
- }
40
- }
41
-
42
- encode(data: string): TRemoteStorageOutput<string> {
43
- return { hash: data, storageType: this.storageType };
44
- }
45
-
46
- async get<T = unknown>(args: { cid: string }): Promise<T> {
47
- return getIPFSData<T>(args.cid);
48
- }
49
-
50
- async saveAndGetCID(
51
- data: any,
52
- pinataMetadata = { name: "via karma-gap-sdk" }
53
- ) {
54
- try {
55
- const res = await axios.post(
56
- "https://api.pinata.cloud/pinning/pinJSONToIPFS",
57
- {
58
- pinataContent: data,
59
- pinataMetadata: pinataMetadata,
60
- },
61
- {
62
- headers: {
63
- "Content-Type": "application/json",
64
- Authorization: `Bearer ${this.pinataJWTToken}`,
65
- },
66
- }
67
- );
68
- return res.data.IpfsHash;
69
- } catch (error) {
70
- throw new RemoteStorageError(
71
- "REMOTE_STORAGE_UPLOAD",
72
- `Error adding data to IPFS`
73
- );
74
- }
75
- }
76
- }
@@ -1,65 +0,0 @@
1
- import axios from 'axios';
2
- import { STORAGE_TYPE, TRemoteStorageOutput, TSchemaName } from 'core/types';
3
-
4
- interface SponsoredRemote {
5
- url: string;
6
- responseParser: (response: any) => string;
7
- }
8
-
9
- export abstract class RemoteStorage<C = unknown> {
10
- protected client: C;
11
- readonly storageType: number;
12
-
13
- readonly sponsor?: SponsoredRemote;
14
-
15
- constructor(
16
- storageType: STORAGE_TYPE,
17
- /**
18
- * If set, will try to POST request to another server instead of
19
- * using the local instance.
20
- *
21
- * > If a response parser is not set, it will try to get { cid: string }.
22
- */
23
- sponsor: SponsoredRemote
24
- ) {
25
- this.storageType = storageType;
26
- this.sponsor = sponsor;
27
- this.interceptRemoteStorage();
28
- }
29
-
30
- /**
31
- * Try to save data to remote storage and return the CID.
32
- * IF sponsorUrl is set, this method will be automatically
33
- * intercepted and will send a POST request to the sponsorUrl
34
- * with the contents: `{ data: T, type: "<AttestationType>" }`
35
- */
36
- abstract save<T = unknown>(data: T, schemaName: string): Promise<string>;
37
-
38
- /**
39
- * Encodes the data according to the remote storage type parameters
40
- * OR returns the data as is if no encoding is required
41
- */
42
- abstract encode(data: unknown): TRemoteStorageOutput;
43
-
44
- /**
45
- * Get data from Remote Storage
46
- */
47
- abstract get<T = unknown>(args: unknown): Promise<T>;
48
-
49
- /**
50
- * If sponsorUrl is set, intercept the save method and send a POST request
51
- * to the sponsorUrl instead of using the local instance.
52
- * @returns
53
- */
54
- private interceptRemoteStorage() {
55
- if (!this.sponsor?.url) return;
56
- this.save = async (data: unknown, schemaName: TSchemaName) => {
57
- const { data: response } = await axios.post(this.sponsor.url, {
58
- data: data,
59
- type: schemaName,
60
- });
61
-
62
- return this.sponsor.responseParser?.(response) || response.cid;
63
- };
64
- }
65
- }
@@ -1,93 +0,0 @@
1
- export type RoundMetadata = {
2
- name: string;
3
- support: {
4
- info: string;
5
- type: string;
6
- };
7
- roundType: "public" | string; // Could be extended to include other round types
8
- eligibility: {
9
- description: string;
10
- requirements: Array<{
11
- requirement: string;
12
- }>;
13
- };
14
- feesAddress: string;
15
- feesPercentage: number;
16
- programContractAddress: string;
17
- quadraticFundingConfig?: {
18
- matchingCap: boolean;
19
- sybilDefense: boolean;
20
- matchingCapAmount: number;
21
- minDonationThreshold: boolean;
22
- matchingFundsAvailable: number;
23
- minDonationThresholdAmount: number;
24
- };
25
- category: string;
26
- source: string;
27
- };
28
-
29
- export type Address = `0x${string}`;
30
-
31
- export type GrantArgs = {
32
- profileId: Address;
33
- roundMetadata: RoundMetadata;
34
- applicationStart: number;
35
- applicationEnd: number;
36
- roundStart: number;
37
- roundEnd: number;
38
- // Use available payout tokens from this file:
39
- // https://github.dev/gitcoinco/grants-stack-indexer/blob/main/src/database/schema.ts
40
- matchingFundAmt: number;
41
- applicationMetadata: ApplicationMetadata;
42
- managers: Address[];
43
- strategy: Address;
44
- payoutToken: Address;
45
- };
46
-
47
- export type ApplicationMetadata = {
48
- version: string;
49
- lastUpdatedOn: number;
50
- applicationSchema: {
51
- questions: Array<{
52
- id: number;
53
- info: string;
54
- type:
55
- | "email"
56
- | "short-answer"
57
- | "link"
58
- | "number"
59
- | "paragraph"
60
- | "address"
61
- | "checkbox"
62
- | "multiple-choice";
63
- title: string;
64
- hidden: boolean;
65
- choices?: string[];
66
- required: boolean;
67
- encrypted: boolean;
68
- }>;
69
- requirements: {
70
- github: {
71
- required: boolean;
72
- verification: boolean;
73
- };
74
- twitter: {
75
- required: boolean;
76
- verification: boolean;
77
- };
78
- // Potentially add more requirements here if they exist in the data
79
- };
80
- };
81
- };
82
-
83
- export type ProfileMetadata = {
84
- title: string;
85
- description: string;
86
- website: string;
87
- projectTwitter: string;
88
- logoImg: string; // Assuming it's a URL to the logo image
89
- bannerImg: string; // Assuming it's a URL to the banner image
90
- logoImgData: any; // Could be object with image data or left as type 'any' if not used
91
- bannerImgData: any; // Could be object with image data or left as type 'any' if not used
92
- createdAt: number; // Timestamp in milliseconds
93
- };