@show-karma/karma-gap-sdk 0.3.29 → 0.3.30

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.
@@ -1,9 +1,9 @@
1
- import { SignerOrProvider, TNetwork } from '../../types';
2
- import { Attestation, AttestationArgs } from '../Attestation';
3
- import { GapSchema } from '../GapSchema';
1
+ import { SignerOrProvider, TNetwork } from "../../types";
2
+ import { Attestation, AttestationArgs } from "../Attestation";
3
+ import { GapSchema } from "../GapSchema";
4
4
  export interface _IProjectImpact extends ProjectImpact {
5
5
  }
6
- type IStatus = 'verified';
6
+ type IStatus = "verified";
7
7
  export interface IProjectImpactStatus {
8
8
  type: `project-impact-${IStatus}`;
9
9
  reason?: string;
@@ -16,6 +16,7 @@ export interface IProjectImpact {
16
16
  work: string;
17
17
  impact: string;
18
18
  proof: string;
19
+ startedAt?: number;
19
20
  completedAt: number;
20
21
  type?: string;
21
22
  }
@@ -23,6 +24,7 @@ export declare class ProjectImpact extends Attestation<IProjectImpact> implement
23
24
  work: string;
24
25
  impact: string;
25
26
  proof: string;
27
+ startedAt?: number;
26
28
  completedAt: number;
27
29
  type?: string;
28
30
  verified: ProjectImpactStatus[];
@@ -31,15 +31,15 @@ class ProjectImpact extends Attestation_1.Attestation {
31
31
  },
32
32
  });
33
33
  if (callback)
34
- callback('pending');
34
+ callback("pending");
35
35
  const uid = await tx.wait();
36
36
  if (callback)
37
- callback('completed');
37
+ callback("completed");
38
38
  console.log(uid);
39
39
  }
40
40
  catch (error) {
41
41
  console.error(error);
42
- throw new SchemaError_1.AttestationError('ATTEST_ERROR', error.message);
42
+ throw new SchemaError_1.AttestationError("ATTEST_ERROR", error.message);
43
43
  }
44
44
  }
45
45
  /**
@@ -48,17 +48,17 @@ class ProjectImpact extends Attestation_1.Attestation {
48
48
  * @param signer
49
49
  * @param reason
50
50
  */
51
- async verify(signer, reason = '', callback) {
52
- console.log('Verifying ProjectImpact');
53
- const schema = this.schema.gap.findSchema('GrantUpdateStatus');
54
- schema.setValue('type', 'project-impact-verified');
55
- schema.setValue('reason', reason);
56
- console.log('Before attest project impact verified');
51
+ async verify(signer, reason = "", callback) {
52
+ console.log("Verifying ProjectImpact");
53
+ const schema = this.schema.gap.findSchema("GrantUpdateStatus");
54
+ schema.setValue("type", "project-impact-verified");
55
+ schema.setValue("reason", reason);
56
+ console.log("Before attest project impact verified");
57
57
  await this.attestStatus(signer, schema, callback);
58
- console.log('After attest project impact verified');
58
+ console.log("After attest project impact verified");
59
59
  this.verified.push(new ProjectImpactStatus({
60
60
  data: {
61
- type: 'project-impact-verified',
61
+ type: "project-impact-verified",
62
62
  reason,
63
63
  },
64
64
  refUID: this.uid,
@@ -73,16 +73,16 @@ class ProjectImpact extends Attestation_1.Attestation {
73
73
  data: {
74
74
  ...attestation.data,
75
75
  },
76
- schema: new AllGapSchemas_1.AllGapSchemas().findSchema('ProjectImpact', consts_1.chainIdToNetwork[attestation.chainID]),
76
+ schema: new AllGapSchemas_1.AllGapSchemas().findSchema("ProjectImpact", consts_1.chainIdToNetwork[attestation.chainID]),
77
77
  chainID: attestation.chainID,
78
78
  });
79
79
  if (attestation.verified?.length > 0) {
80
- projectImpact.verified = attestation.verified.map(m => new ProjectImpactStatus({
80
+ projectImpact.verified = attestation.verified.map((m) => new ProjectImpactStatus({
81
81
  ...m,
82
82
  data: {
83
83
  ...m.data,
84
84
  },
85
- schema: new AllGapSchemas_1.AllGapSchemas().findSchema('GrantUpdateStatus', consts_1.chainIdToNetwork[attestation.chainID]),
85
+ schema: new AllGapSchemas_1.AllGapSchemas().findSchema("GrantUpdateStatus", consts_1.chainIdToNetwork[attestation.chainID]),
86
86
  chainID: attestation.chainID,
87
87
  }));
88
88
  }
@@ -116,6 +116,7 @@ export interface IProjectImpact extends IAttestationResponse {
116
116
  work: string;
117
117
  impact: string;
118
118
  proof: string;
119
+ startedAt?: number;
119
120
  completedAt: number;
120
121
  type: "project-impact";
121
122
  };
@@ -124,7 +125,7 @@ export interface IProjectEndorsement extends IAttestationResponse {
124
125
  type: "ProjectEndorsement";
125
126
  data: {
126
127
  comment?: string;
127
- type?: 'project-endorsement';
128
+ type?: "project-endorsement";
128
129
  };
129
130
  }
130
131
  export interface IProjectResponse extends IAttestationResponse {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.3.29",
6
+ "version": "0.3.30",
7
7
  "description": "Simple and easy interface between EAS and Karma GAP.",
8
8
  "main": "./index.js",
9
9
  "author": "KarmaHQ",