@show-karma/karma-gap-sdk 0.1.39 → 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;
@@ -20,7 +24,7 @@ export declare class Grant extends Attestation<IGrant> {
20
24
  updates: GrantUpdate[];
21
25
  members: string[];
22
26
  completed?: GrantCompleted;
23
- project?: Project;
27
+ project?: ISummaryProject;
24
28
  verify(signer: SignerOrProvider): Promise<void>;
25
29
  /**
26
30
  * Add milestones to the grant.
@@ -182,7 +182,12 @@ class Grant extends Attestation_1.Attestation {
182
182
  }
183
183
  if (attestation.project) {
184
184
  const { project } = attestation;
185
- 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
+ };
186
191
  }
187
192
  if (attestation.community) {
188
193
  const { community } = attestation;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.1.39",
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",