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

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/.cursorrules +43 -0
  2. package/core/abi/AirdropNFT.json +1 -1
  3. package/core/abi/Allo.json +860 -860
  4. package/core/abi/AlloRegistry.json +578 -578
  5. package/core/abi/CommunityResolverABI.json +506 -506
  6. package/core/abi/Donations.json +251 -251
  7. package/core/abi/EAS.json +1 -1
  8. package/core/abi/MultiAttester.json +746 -746
  9. package/core/abi/ProjectResolver.json +574 -574
  10. package/core/abi/SchemaRegistry.json +1 -1
  11. package/core/abi/index.ts +21 -0
  12. package/core/class/AllGapSchemas.ts +21 -0
  13. package/core/class/Attestation.ts +429 -0
  14. package/core/class/Fetcher.ts +224 -0
  15. package/core/class/GAP.ts +481 -0
  16. package/core/class/GapSchema.ts +93 -0
  17. package/core/class/Gelato/{Gelato.js → Gelato.ts} +23 -0
  18. package/core/class/GrantProgramRegistry/Allo.ts +188 -0
  19. package/core/class/GrantProgramRegistry/AlloRegistry.ts +101 -0
  20. package/core/class/GraphQL/AxiosGQL.ts +29 -0
  21. package/core/class/GraphQL/EASClient.ts +34 -0
  22. package/core/class/GraphQL/GapEasClient.ts +869 -0
  23. package/core/class/Schema.ts +659 -0
  24. package/core/class/SchemaError.ts +42 -0
  25. package/core/class/contract/GapContract.ts +457 -0
  26. package/core/class/entities/Community.ts +148 -0
  27. package/core/class/entities/ContributorProfile.ts +108 -0
  28. package/core/class/entities/Grant.ts +321 -0
  29. package/core/class/entities/GrantUpdate.ts +187 -0
  30. package/core/class/entities/MemberOf.ts +52 -0
  31. package/core/class/entities/Milestone.ts +898 -0
  32. package/core/class/entities/Project.ts +672 -0
  33. package/core/class/entities/ProjectImpact.ts +170 -0
  34. package/core/class/entities/ProjectMilestone.ts +254 -0
  35. package/core/class/entities/ProjectPointer.ts +39 -0
  36. package/core/class/entities/ProjectUpdate.ts +176 -0
  37. package/core/class/entities/Track.ts +32 -0
  38. package/core/class/karma-indexer/GapIndexerClient.ts +383 -0
  39. package/core/class/karma-indexer/api/GapIndexerApi.ts +446 -0
  40. package/core/class/karma-indexer/api/types.ts +313 -0
  41. package/core/class/remote-storage/IpfsStorage.ts +76 -0
  42. package/core/class/remote-storage/RemoteStorage.ts +65 -0
  43. package/core/class/types/allo.ts +93 -0
  44. package/core/class/types/attestations.ts +223 -0
  45. package/core/consts.ts +775 -0
  46. package/core/scripts/create-grant.ts +102 -0
  47. package/core/scripts/create-program.ts +43 -0
  48. package/core/scripts/create-schemas.ts +65 -0
  49. package/core/scripts/deploy.ts +65 -0
  50. package/core/scripts/index.ts +1 -0
  51. package/core/scripts/milestone-multi-grants.ts +125 -0
  52. package/core/shared/types.ts +13 -0
  53. package/core/types.ts +224 -0
  54. package/core/utils/gelato/send-gelato-txn.ts +114 -0
  55. package/core/utils/gelato/sponsor-handler.ts +77 -0
  56. package/core/utils/gelato/watch-gelato-txn.ts +67 -0
  57. package/core/utils/get-date.ts +3 -0
  58. package/core/utils/get-ipfs-data.ts +13 -0
  59. package/core/utils/get-web3-provider.ts +18 -0
  60. package/core/utils/gql-queries.ts +133 -0
  61. package/core/utils/map-filter.ts +21 -0
  62. package/core/utils/serialize-bigint.ts +7 -0
  63. package/core/utils/to-unix.ts +18 -0
  64. package/create-community-example.ts +119 -0
  65. package/csv-upload/README.md +74 -0
  66. package/csv-upload/config.ts +41 -0
  67. package/csv-upload/example.csv +2 -0
  68. package/csv-upload/keys.example.json +8 -0
  69. package/csv-upload/scripts/run.ts +417 -0
  70. package/csv-upload/types.ts +39 -0
  71. package/docs/.gitkeep +0 -0
  72. package/docs/images/attestation-architecture.png +0 -0
  73. package/docs/images/dfd-get-projects.png +0 -0
  74. package/gap-schema.yaml +155 -0
  75. package/milestone-workflow-example.ts +353 -0
  76. package/package.json +45 -39
  77. package/readme.md +872 -0
  78. package/schemas/.gitkeep +0 -0
  79. package/schemas/GAP-schemas-1692135812877.json +33 -0
  80. package/test-file-indexer-api.ts +25 -0
  81. package/tsconfig.json +26 -0
  82. package/core/abi/index.d.ts +0 -1114
  83. package/core/abi/index.js +0 -26
  84. package/core/class/AllGapSchemas.d.ts +0 -9
  85. package/core/class/AllGapSchemas.js +0 -19
  86. package/core/class/Attestation.d.ts +0 -173
  87. package/core/class/Attestation.js +0 -333
  88. package/core/class/Fetcher.d.ts +0 -175
  89. package/core/class/Fetcher.js +0 -13
  90. package/core/class/GAP.d.ts +0 -254
  91. package/core/class/GAP.js +0 -289
  92. package/core/class/GapSchema.d.ts +0 -34
  93. package/core/class/GapSchema.js +0 -62
  94. package/core/class/GrantProgramRegistry/Allo.d.ts +0 -17
  95. package/core/class/GrantProgramRegistry/Allo.js +0 -137
  96. package/core/class/GrantProgramRegistry/AlloRegistry.d.ts +0 -15
  97. package/core/class/GrantProgramRegistry/AlloRegistry.js +0 -70
  98. package/core/class/GraphQL/AxiosGQL.d.ts +0 -6
  99. package/core/class/GraphQL/AxiosGQL.js +0 -25
  100. package/core/class/GraphQL/EASClient.d.ts +0 -16
  101. package/core/class/GraphQL/EASClient.js +0 -26
  102. package/core/class/GraphQL/GapEasClient.d.ts +0 -71
  103. package/core/class/GraphQL/GapEasClient.js +0 -451
  104. package/core/class/GraphQL/index.js +0 -19
  105. package/core/class/Schema.d.ts +0 -233
  106. package/core/class/Schema.js +0 -488
  107. package/core/class/SchemaError.d.ts +0 -30
  108. package/core/class/SchemaError.js +0 -39
  109. package/core/class/contract/GapContract.d.ts +0 -102
  110. package/core/class/contract/GapContract.js +0 -285
  111. package/core/class/entities/Community.d.ts +0 -34
  112. package/core/class/entities/Community.js +0 -109
  113. package/core/class/entities/ContributorProfile.d.ts +0 -41
  114. package/core/class/entities/ContributorProfile.js +0 -69
  115. package/core/class/entities/Grant.d.ts +0 -54
  116. package/core/class/entities/Grant.js +0 -223
  117. package/core/class/entities/GrantUpdate.d.ts +0 -40
  118. package/core/class/entities/GrantUpdate.js +0 -114
  119. package/core/class/entities/MemberOf.d.ts +0 -11
  120. package/core/class/entities/MemberOf.js +0 -33
  121. package/core/class/entities/Milestone.d.ts +0 -168
  122. package/core/class/entities/Milestone.js +0 -657
  123. package/core/class/entities/Project.d.ts +0 -92
  124. package/core/class/entities/Project.js +0 -418
  125. package/core/class/entities/ProjectImpact.d.ts +0 -50
  126. package/core/class/entities/ProjectImpact.js +0 -112
  127. package/core/class/entities/ProjectMilestone.d.ts +0 -60
  128. package/core/class/entities/ProjectMilestone.js +0 -174
  129. package/core/class/entities/ProjectPointer.d.ts +0 -12
  130. package/core/class/entities/ProjectPointer.js +0 -22
  131. package/core/class/entities/ProjectUpdate.d.ts +0 -50
  132. package/core/class/entities/ProjectUpdate.js +0 -110
  133. package/core/class/entities/Track.d.ts +0 -16
  134. package/core/class/entities/Track.js +0 -21
  135. package/core/class/entities/index.js +0 -26
  136. package/core/class/index.js +0 -26
  137. package/core/class/karma-indexer/GapIndexerClient.d.ts +0 -66
  138. package/core/class/karma-indexer/GapIndexerClient.js +0 -207
  139. package/core/class/karma-indexer/api/GapIndexerApi.d.ts +0 -73
  140. package/core/class/karma-indexer/api/GapIndexerApi.js +0 -256
  141. package/core/class/karma-indexer/api/types.d.ts +0 -295
  142. package/core/class/karma-indexer/api/types.js +0 -2
  143. package/core/class/remote-storage/IpfsStorage.d.ts +0 -23
  144. package/core/class/remote-storage/IpfsStorage.js +0 -56
  145. package/core/class/remote-storage/RemoteStorage.d.ts +0 -41
  146. package/core/class/remote-storage/RemoteStorage.js +0 -38
  147. package/core/class/types/allo.d.ts +0 -78
  148. package/core/class/types/allo.js +0 -2
  149. package/core/class/types/attestations.d.ts +0 -168
  150. package/core/class/types/attestations.js +0 -66
  151. package/core/consts.d.ts +0 -48
  152. package/core/consts.js +0 -641
  153. package/core/index.js +0 -24
  154. package/core/shared/types.d.ts +0 -6
  155. package/core/shared/types.js +0 -2
  156. package/core/types.d.ts +0 -131
  157. package/core/types.js +0 -13
  158. package/core/utils/gelato/index.js +0 -19
  159. package/core/utils/gelato/send-gelato-txn.d.ts +0 -55
  160. package/core/utils/gelato/send-gelato-txn.js +0 -100
  161. package/core/utils/gelato/sponsor-handler.d.ts +0 -9
  162. package/core/utils/gelato/sponsor-handler.js +0 -60
  163. package/core/utils/gelato/watch-gelato-txn.d.ts +0 -7
  164. package/core/utils/gelato/watch-gelato-txn.js +0 -63
  165. package/core/utils/get-date.d.ts +0 -1
  166. package/core/utils/get-date.js +0 -7
  167. package/core/utils/get-ipfs-data.d.ts +0 -1
  168. package/core/utils/get-ipfs-data.js +0 -20
  169. package/core/utils/get-web3-provider.d.ts +0 -2
  170. package/core/utils/get-web3-provider.js +0 -18
  171. package/core/utils/gql-queries.d.ts +0 -12
  172. package/core/utils/gql-queries.js +0 -90
  173. package/core/utils/index.js +0 -23
  174. package/core/utils/map-filter.d.ts +0 -8
  175. package/core/utils/map-filter.js +0 -20
  176. package/core/utils/serialize-bigint.d.ts +0 -1
  177. package/core/utils/serialize-bigint.js +0 -8
  178. package/core/utils/to-unix.d.ts +0 -1
  179. package/core/utils/to-unix.js +0 -25
  180. package/index.js +0 -17
  181. /package/core/class/GraphQL/{index.d.ts → index.ts} +0 -0
  182. /package/core/class/entities/{index.d.ts → index.ts} +0 -0
  183. /package/core/class/{index.d.ts → index.ts} +0 -0
  184. /package/core/{index.d.ts → index.ts} +0 -0
  185. /package/core/utils/gelato/{index.d.ts → index.ts} +0 -0
  186. /package/core/utils/{index.d.ts → index.ts} +0 -0
  187. /package/{core/class/Gelato/Gelato.d.ts → csv-upload/.gitkeep} +0 -0
  188. /package/{index.d.ts → index.ts} +0 -0
@@ -0,0 +1,223 @@
1
+ import { Attestation, AttestationArgs } from "../Attestation";
2
+ import { Hex, SignerOrProvider, TExternalLink } from "core/types";
3
+ import { Project } from "../entities/Project";
4
+ import { GapSchema } from "../GapSchema";
5
+ import { GrantUpdate } from "../entities/GrantUpdate";
6
+ import { Transaction } from "ethers";
7
+
8
+ /** Attestation interfaces */
9
+
10
+ export type AttestationWithTx = {
11
+ uids: Hex[];
12
+ tx: Transaction[];
13
+ };
14
+
15
+ export type ExternalLink = { type: string; url: string }[];
16
+ export type ExternalCustomLink = {
17
+ type: 'custom';
18
+ url: string;
19
+ name: string
20
+ };
21
+
22
+ export interface ICommunityDetails {
23
+ name: string;
24
+ description: string;
25
+ imageURL: string;
26
+ slug?: string;
27
+ links?: ExternalLink;
28
+ type?: string;
29
+ externalId?: string;
30
+ }
31
+
32
+ export class CommunityDetails
33
+ extends Attestation<ICommunityDetails>
34
+ implements ICommunityDetails
35
+ {
36
+ name: string;
37
+ description: string;
38
+ imageURL: string;
39
+ links: ExternalLink = [];
40
+ slug?: string;
41
+ type = "community-details";
42
+ externalId?: string;
43
+ }
44
+
45
+ export interface IGrantDetails {
46
+ title: string;
47
+ amount?: string;
48
+ proposalURL: string;
49
+ assetAndChainId?: [Hex, number];
50
+ payoutAddress?: Hex;
51
+ description?: string;
52
+ season?: string;
53
+ cycle?: string;
54
+ questions?: IGrantDetailsQuestion[];
55
+ type?: string;
56
+ startDate?: number;
57
+ programId?: string;
58
+ fundUsage?: string;
59
+ selectedTrackIds?: string[];
60
+ }
61
+ export class GrantDetails
62
+ extends Attestation<IGrantDetails>
63
+ implements IGrantDetails
64
+ {
65
+ title: string;
66
+ proposalURL: string;
67
+ programId?: string;
68
+ payoutAddress?: Hex;
69
+ amount?: string;
70
+ assetAndChainId?: [Hex, number];
71
+ description?: string;
72
+ season?: string;
73
+ cycle?: string;
74
+ questions?: IGrantDetailsQuestion[];
75
+ type = "grant-details";
76
+ startDate?: number;
77
+ fundUsage?: string;
78
+ selectedTrackIds?: string[];
79
+ }
80
+
81
+ export interface IGrantRound {
82
+ name: string;
83
+ }
84
+ export class GrantRound
85
+ extends Attestation<IGrantRound>
86
+ implements IGrantRound
87
+ {
88
+ name: string;
89
+ }
90
+
91
+ export interface IGrantVerified {
92
+ verified: boolean;
93
+ }
94
+ export class GrantVerified
95
+ extends Attestation<IGrantVerified>
96
+ implements IGrantVerified
97
+ {
98
+ verified: boolean;
99
+ }
100
+
101
+ export interface IMemberDetails {
102
+ name: string;
103
+ profilePictureURL: string;
104
+ }
105
+
106
+ export class MemberDetails
107
+ extends Attestation<IMemberDetails>
108
+ implements IMemberDetails
109
+ {
110
+ name: string;
111
+ profilePictureURL: string;
112
+ }
113
+
114
+ export interface IMilestoneCompleted {
115
+ type?: "approved" | "rejected" | "completed" | "verified";
116
+ reason?: string;
117
+ proofOfWork?: string;
118
+ }
119
+ export class MilestoneCompleted
120
+ extends Attestation<IMilestoneCompleted>
121
+ implements IMilestoneCompleted
122
+ {
123
+ type: "approved" | "rejected" | "completed" | "verified";
124
+ reason?: string;
125
+ proofOfWork?: string;
126
+ }
127
+
128
+ export interface ITag {
129
+ name: string;
130
+ }
131
+ export class Tag extends Attestation<ITag> implements ITag {
132
+ name: string;
133
+ }
134
+
135
+ export interface IProjectDetails {
136
+ title: string;
137
+ description: string;
138
+ problem?: string;
139
+ solution?: string;
140
+ missionSummary?: string;
141
+ locationOfImpact?: string;
142
+ imageURL: string;
143
+ links?: Array<ExternalLink[0] | ExternalCustomLink>;
144
+ tags?: ITag[];
145
+ externalIds?: string[];
146
+ slug?: string;
147
+ type?: string;
148
+ businessModel?: string;
149
+ stageIn?: string;
150
+ raisedMoney?: string;
151
+ pathToTake?: string;
152
+ }
153
+ export class ProjectDetails
154
+ extends Attestation<IProjectDetails>
155
+ implements IProjectDetails
156
+ {
157
+ title: string;
158
+ description: string;
159
+ problem?: string;
160
+ solution?: string;
161
+ missionSummary?: string;
162
+ locationOfImpact?: string;
163
+ imageURL: string;
164
+ links: Array<ExternalLink[0] | ExternalCustomLink> = [];
165
+ tags: ITag[] = [];
166
+ slug: string;
167
+ type = "project-details";
168
+ externalIds: string[] = [];
169
+ businessModel?: string;
170
+ stageIn?: string;
171
+ raisedMoney?: string;
172
+ pathToTake?: string;
173
+ }
174
+
175
+ export class Grantee {
176
+ address: string;
177
+ projects: Project[] = [];
178
+
179
+ constructor(address: Hex, projects: Project[] = []) {
180
+ this.address = address;
181
+ this.projects = projects;
182
+ }
183
+ }
184
+
185
+ export class GrantCompleted extends GrantUpdate {}
186
+
187
+ export interface IGrantDetailsQuestion {
188
+ query: string;
189
+ explanation: string;
190
+ type: string;
191
+ }
192
+
193
+ export interface IProjectEndorsement {
194
+ comment?: string;
195
+ type?: string;
196
+ }
197
+
198
+ export class ProjectEndorsement
199
+ extends Attestation<IProjectEndorsement>
200
+ implements IProjectEndorsement
201
+ {
202
+ comment?: string;
203
+ type?: string;
204
+
205
+ constructor(data: AttestationArgs<IProjectEndorsement, GapSchema>) {
206
+ (data.data as any).type = "project-endorsement";
207
+ super(data);
208
+ }
209
+ }
210
+
211
+ export interface IProjectMilestoneCompleted {
212
+ type?: "approved" | "rejected" | "completed" | "verified";
213
+ reason?: string;
214
+ proofOfWork?: string;
215
+ }
216
+ export class ProjectMilestoneCompleted
217
+ extends Attestation<IProjectMilestoneCompleted>
218
+ implements IProjectMilestoneCompleted
219
+ {
220
+ type: "approved" | "rejected" | "completed" | "verified";
221
+ reason?: string;
222
+ proofOfWork?: string;
223
+ }