@show-karma/karma-gap-sdk 0.1.38 → 0.1.40

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.
@@ -317,9 +317,14 @@ class GapEasClient extends Fetcher_1.Fetcher {
317
317
  const { attestations: projectAttestations } = await this.query(projectsQuery);
318
318
  const projects = Attestation_1.Attestation.fromInterface(projectAttestations);
319
319
  const milestones = await this.milestonesOf(grants);
320
+ const getSummaryProject = (project) => ({
321
+ title: project.details?.title,
322
+ uid: project.uid,
323
+ slug: project.details?.slug,
324
+ });
320
325
  return grants
321
326
  .map((grant) => {
322
- grant.project = projects.find((p) => p.uid === grant.refUID);
327
+ grant.project = getSummaryProject(projects.find((p) => p.uid === grant.refUID));
323
328
  grant.details = (deps.find((d) => d.refUID === grant.uid &&
324
329
  d.schema.uid === grantDetails.uid &&
325
330
  typeof d.amount !== undefined &&
@@ -4,12 +4,16 @@ import { IMilestone, Milestone } from './Milestone';
4
4
  import { GapSchema } from '../GapSchema';
5
5
  import { Hex, MultiAttestPayload, SignerOrProvider } from 'core/types';
6
6
  import { Community } from './Community';
7
- import { Project } from './Project';
8
7
  interface _Grant extends Grant {
9
8
  }
10
9
  export interface IGrant {
11
10
  communityUID: Hex;
12
11
  }
12
+ export interface ISummaryProject {
13
+ title: string;
14
+ slug?: string;
15
+ uid: Hex;
16
+ }
13
17
  export declare class Grant extends Attestation<IGrant> {
14
18
  details?: GrantDetails;
15
19
  communityUID: Hex;
@@ -18,8 +22,9 @@ export declare class Grant extends Attestation<IGrant> {
18
22
  milestones: Milestone[];
19
23
  community: Community;
20
24
  updates: GrantUpdate[];
25
+ members: string[];
21
26
  completed?: GrantCompleted;
22
- project?: Project;
27
+ project?: ISummaryProject;
23
28
  verify(signer: SignerOrProvider): Promise<void>;
24
29
  /**
25
30
  * Add milestones to the grant.
@@ -17,6 +17,7 @@ class Grant extends Attestation_1.Attestation {
17
17
  this.verified = false;
18
18
  this.milestones = [];
19
19
  this.updates = [];
20
+ this.members = [];
20
21
  }
21
22
  async verify(signer) {
22
23
  const eas = GAP_1.GAP.eas.connect(signer);
@@ -181,12 +182,20 @@ class Grant extends Attestation_1.Attestation {
181
182
  }
182
183
  if (attestation.project) {
183
184
  const { project } = attestation;
184
- grant.project = Project_1.Project.from([project])[0];
185
+ const rawProject = Project_1.Project.from([project])[0];
186
+ grant.project = {
187
+ title: rawProject.details?.title,
188
+ uid: rawProject.uid,
189
+ slug: rawProject.details?.slug,
190
+ };
185
191
  }
186
192
  if (attestation.community) {
187
193
  const { community } = attestation;
188
194
  grant.community = Community_1.Community.from([community])[0];
189
195
  }
196
+ if (attestation.members) {
197
+ grant.members = attestation.members;
198
+ }
190
199
  return grant;
191
200
  });
192
201
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.1.38",
6
+ "version": "0.1.40",
7
7
  "description": "Simple and easy interface between EAS and Karma GAP.",
8
8
  "main": "dist/index.js",
9
9
  "author": "KarmaHQ",