@show-karma/karma-gap-sdk 0.3.43 → 0.3.45
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.
- package/core/abi/AirdropNFT.json +622 -0
- package/core/abi/Donations.json +260 -0
- package/core/abi/EAS.json +1 -0
- package/core/abi/SchemaRegistry.json +1 -0
- package/core/abi/index.d.ts +1114 -0
- package/core/abi/index.js +26 -0
- package/core/class/Attestation.d.ts +3 -2
- package/core/class/Attestation.js +11 -8
- package/core/class/GAP.d.ts +1 -1
- package/core/class/GAP.js +9 -10
- package/core/class/GapSchema.js +1 -0
- package/core/class/GraphQL/GapEasClient.d.ts +7 -7
- package/core/class/GraphQL/GapEasClient.js +60 -60
- package/core/class/Schema.d.ts +12 -3
- package/core/class/Schema.js +32 -12
- package/core/class/SchemaError.d.ts +2 -1
- package/core/class/SchemaError.js +4 -3
- package/core/class/contract/GapContract.d.ts +11 -6
- package/core/class/contract/GapContract.js +35 -6
- package/core/class/entities/Community.d.ts +2 -2
- package/core/class/entities/Community.js +9 -3
- package/core/class/entities/Grant.d.ts +11 -11
- package/core/class/entities/Grant.js +33 -29
- package/core/class/entities/GrantUpdate.d.ts +8 -2
- package/core/class/entities/GrantUpdate.js +26 -6
- package/core/class/entities/MemberOf.d.ts +2 -2
- package/core/class/entities/MemberOf.js +4 -2
- package/core/class/entities/Milestone.d.ts +14 -7
- package/core/class/entities/Milestone.js +63 -21
- package/core/class/entities/Project.d.ts +10 -5
- package/core/class/entities/Project.js +77 -9
- package/core/class/entities/ProjectImpact.d.ts +7 -3
- package/core/class/entities/ProjectImpact.js +23 -6
- package/core/class/entities/ProjectMilestone.d.ts +60 -0
- package/core/class/entities/ProjectMilestone.js +174 -0
- package/core/class/entities/ProjectUpdate.d.ts +4 -2
- package/core/class/entities/ProjectUpdate.js +21 -5
- package/core/class/karma-indexer/GapIndexerClient.d.ts +9 -7
- package/core/class/karma-indexer/GapIndexerClient.js +15 -10
- package/core/class/karma-indexer/api/GapIndexerApi.d.ts +3 -1
- package/core/class/karma-indexer/api/GapIndexerApi.js +9 -0
- package/core/class/karma-indexer/api/types.d.ts +21 -0
- package/core/class/types/attestations.d.ts +20 -1
- package/core/class/types/attestations.js +4 -1
- package/core/consts.js +219 -45
- package/core/index.d.ts +1 -0
- package/core/index.js +1 -0
- package/core/types.d.ts +12 -2
- package/package.json +1 -1
- package/core/abi/AlloCaller.json +0 -117
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectMilestone = exports.ProjectMilestoneStatus = void 0;
|
|
4
|
+
const Attestation_1 = require("../Attestation");
|
|
5
|
+
const SchemaError_1 = require("../SchemaError");
|
|
6
|
+
const AllGapSchemas_1 = require("../AllGapSchemas");
|
|
7
|
+
const consts_1 = require("../../../core/consts");
|
|
8
|
+
const attestations_1 = require("../types/attestations");
|
|
9
|
+
class ProjectMilestoneStatus extends Attestation_1.Attestation {
|
|
10
|
+
}
|
|
11
|
+
exports.ProjectMilestoneStatus = ProjectMilestoneStatus;
|
|
12
|
+
class ProjectMilestone extends Attestation_1.Attestation {
|
|
13
|
+
constructor(data) {
|
|
14
|
+
data.data.type = "project-milestone";
|
|
15
|
+
super(data);
|
|
16
|
+
this.verified = [];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Attest the status of the update as approved, rejected or completed.
|
|
20
|
+
*/
|
|
21
|
+
async attestStatus(signer, schema, callback) {
|
|
22
|
+
const eas = this.schema.gap.eas.connect(signer);
|
|
23
|
+
try {
|
|
24
|
+
if (callback)
|
|
25
|
+
callback("preparing");
|
|
26
|
+
const tx = await eas.attest({
|
|
27
|
+
schema: schema.uid,
|
|
28
|
+
data: {
|
|
29
|
+
recipient: this.recipient,
|
|
30
|
+
data: schema.encode(),
|
|
31
|
+
refUID: this.uid,
|
|
32
|
+
expirationTime: 0n,
|
|
33
|
+
revocable: schema.revocable,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
if (callback)
|
|
37
|
+
callback("pending");
|
|
38
|
+
const uid = await tx.wait();
|
|
39
|
+
if (callback)
|
|
40
|
+
callback("confirmed");
|
|
41
|
+
console.log(uid);
|
|
42
|
+
return {
|
|
43
|
+
tx: [
|
|
44
|
+
{
|
|
45
|
+
hash: tx.tx.hash,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
uids: [uid],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
console.error(error);
|
|
53
|
+
throw new SchemaError_1.AttestationError("ATTEST_ERROR", error.message, error);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Verify this ProjectUpdate. If the ProjectUpdate is not already verified,
|
|
58
|
+
* it will throw an error.
|
|
59
|
+
* @param signer
|
|
60
|
+
* @param reason
|
|
61
|
+
*/
|
|
62
|
+
async verify(signer, data, callback) {
|
|
63
|
+
console.log("Verifying");
|
|
64
|
+
const schema = this.schema.gap.findSchema("ProjectMilestoneStatus");
|
|
65
|
+
if (this.schema.isJsonSchema()) {
|
|
66
|
+
schema.setValue("json", JSON.stringify({
|
|
67
|
+
type: "verified",
|
|
68
|
+
reason: data?.reason || "",
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
schema.setValue("type", "project-milestone-verified");
|
|
73
|
+
schema.setValue("reason", data?.reason || "");
|
|
74
|
+
}
|
|
75
|
+
console.log("Before attest project milestone verified");
|
|
76
|
+
await this.attestStatus(signer, schema, callback);
|
|
77
|
+
console.log("After attest project milestone verified");
|
|
78
|
+
this.verified.push(new ProjectMilestoneStatus({
|
|
79
|
+
data: {
|
|
80
|
+
type: "project-milestone-verified",
|
|
81
|
+
reason: data?.reason || "",
|
|
82
|
+
},
|
|
83
|
+
refUID: this.uid,
|
|
84
|
+
schema: schema,
|
|
85
|
+
recipient: this.recipient,
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Marks a milestone as completed. If the milestone is already completed,
|
|
90
|
+
* it will throw an error.
|
|
91
|
+
* @param signer
|
|
92
|
+
* @param reason
|
|
93
|
+
*/
|
|
94
|
+
async complete(signer, data, callback) {
|
|
95
|
+
console.log("Completing");
|
|
96
|
+
const schema = this.schema.gap.findSchema("ProjectMilestoneStatus");
|
|
97
|
+
if (this.schema.isJsonSchema()) {
|
|
98
|
+
schema.setValue("json", JSON.stringify({
|
|
99
|
+
type: "project-milestone-completed",
|
|
100
|
+
...data,
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
schema.setValue("type", "project-milestone-completed");
|
|
105
|
+
schema.setValue("proofOfWork", data?.proofOfWork || "");
|
|
106
|
+
schema.setValue("reason", data?.reason || "");
|
|
107
|
+
}
|
|
108
|
+
console.log("Before attest project milestone completed");
|
|
109
|
+
const { tx, uids } = await this.attestStatus(signer, schema, callback);
|
|
110
|
+
console.log("After attest project milestone completed");
|
|
111
|
+
this.completed = new attestations_1.MilestoneCompleted({
|
|
112
|
+
data: {
|
|
113
|
+
reason: data?.reason || "",
|
|
114
|
+
},
|
|
115
|
+
refUID: this.uid,
|
|
116
|
+
schema: schema,
|
|
117
|
+
recipient: this.recipient,
|
|
118
|
+
});
|
|
119
|
+
return { tx, uids };
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Revokes the completed status of the milestone. If the milestone is not completed,
|
|
123
|
+
* it will throw an error.
|
|
124
|
+
* @param signer
|
|
125
|
+
*/
|
|
126
|
+
async revokeCompletion(signer, callback) {
|
|
127
|
+
if (!this.completed)
|
|
128
|
+
throw new SchemaError_1.AttestationError("ATTEST_ERROR", "Milestone is not completed");
|
|
129
|
+
const { tx, uids } = await this.completed.schema.multiRevoke(signer, [
|
|
130
|
+
{
|
|
131
|
+
schemaId: this.completed.schema.uid,
|
|
132
|
+
uid: this.completed.uid,
|
|
133
|
+
},
|
|
134
|
+
], callback);
|
|
135
|
+
return { tx, uids };
|
|
136
|
+
}
|
|
137
|
+
static from(attestations, network) {
|
|
138
|
+
return attestations.map((attestation) => {
|
|
139
|
+
const projectMilestone = new ProjectMilestone({
|
|
140
|
+
...attestation,
|
|
141
|
+
data: {
|
|
142
|
+
...attestation.data,
|
|
143
|
+
},
|
|
144
|
+
schema: new AllGapSchemas_1.AllGapSchemas().findSchema("ProjectMilestone", consts_1.chainIdToNetwork[attestation.chainID]),
|
|
145
|
+
chainID: attestation.chainID,
|
|
146
|
+
});
|
|
147
|
+
if (attestation.verified?.length > 0) {
|
|
148
|
+
projectMilestone.verified = attestation.verified.map((m) => new ProjectMilestoneStatus({
|
|
149
|
+
...m,
|
|
150
|
+
data: {
|
|
151
|
+
...m.data,
|
|
152
|
+
type: m.data.type === "completed"
|
|
153
|
+
? "project-milestone-completed"
|
|
154
|
+
: "project-milestone-verified",
|
|
155
|
+
},
|
|
156
|
+
schema: new AllGapSchemas_1.AllGapSchemas().findSchema("ProjectMilestoneStatus", consts_1.chainIdToNetwork[attestation.chainID]),
|
|
157
|
+
chainID: attestation.chainID,
|
|
158
|
+
}));
|
|
159
|
+
}
|
|
160
|
+
if (attestation.completed) {
|
|
161
|
+
projectMilestone.completed = new attestations_1.MilestoneCompleted({
|
|
162
|
+
...attestation.completed,
|
|
163
|
+
data: {
|
|
164
|
+
...attestation.completed.data,
|
|
165
|
+
},
|
|
166
|
+
schema: new AllGapSchemas_1.AllGapSchemas().findSchema("MilestoneCompleted", consts_1.chainIdToNetwork[attestation.chainID]),
|
|
167
|
+
chainID: attestation.chainID,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
return projectMilestone;
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
exports.ProjectMilestone = ProjectMilestone;
|
|
@@ -9,12 +9,14 @@ export interface IProjectUpdate {
|
|
|
9
9
|
}
|
|
10
10
|
type IStatus = "verified";
|
|
11
11
|
export interface IProjectUpdateStatus {
|
|
12
|
-
type
|
|
12
|
+
type?: `project-update-${IStatus}`;
|
|
13
13
|
reason?: string;
|
|
14
|
+
proofOfWork?: string;
|
|
14
15
|
}
|
|
15
16
|
export declare class ProjectUpdateStatus extends Attestation<IProjectUpdateStatus> implements IProjectUpdateStatus {
|
|
16
17
|
type: `project-update-${IStatus}`;
|
|
17
18
|
reason?: string;
|
|
19
|
+
proofOfWork?: string;
|
|
18
20
|
}
|
|
19
21
|
export declare class ProjectUpdate extends Attestation<IProjectUpdate> implements IProjectUpdate {
|
|
20
22
|
title: string;
|
|
@@ -30,7 +32,7 @@ export declare class ProjectUpdate extends Attestation<IProjectUpdate> implement
|
|
|
30
32
|
* @param signer
|
|
31
33
|
* @param reason
|
|
32
34
|
*/
|
|
33
|
-
verify(signer: SignerOrProvider,
|
|
35
|
+
verify(signer: SignerOrProvider, data?: IProjectUpdateStatus, callback?: Function): Promise<void>;
|
|
34
36
|
static from(attestations: _IProjectUpdate[], network: TNetwork): ProjectUpdate[];
|
|
35
37
|
}
|
|
36
38
|
export {};
|
|
@@ -37,10 +37,18 @@ class ProjectUpdate extends Attestation_1.Attestation {
|
|
|
37
37
|
if (callback)
|
|
38
38
|
callback("confirmed");
|
|
39
39
|
console.log(uid);
|
|
40
|
+
return {
|
|
41
|
+
tx: [
|
|
42
|
+
{
|
|
43
|
+
hash: tx.tx.hash,
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
uids: [uid],
|
|
47
|
+
};
|
|
40
48
|
}
|
|
41
49
|
catch (error) {
|
|
42
50
|
console.error(error);
|
|
43
|
-
throw new SchemaError_1.AttestationError("ATTEST_ERROR", error.message);
|
|
51
|
+
throw new SchemaError_1.AttestationError("ATTEST_ERROR", error.message, error);
|
|
44
52
|
}
|
|
45
53
|
}
|
|
46
54
|
/**
|
|
@@ -49,18 +57,26 @@ class ProjectUpdate extends Attestation_1.Attestation {
|
|
|
49
57
|
* @param signer
|
|
50
58
|
* @param reason
|
|
51
59
|
*/
|
|
52
|
-
async verify(signer,
|
|
60
|
+
async verify(signer, data, callback) {
|
|
53
61
|
console.log("Verifying");
|
|
54
62
|
const schema = this.schema.gap.findSchema("ProjectUpdateStatus");
|
|
55
|
-
schema.
|
|
56
|
-
|
|
63
|
+
if (this.schema.isJsonSchema()) {
|
|
64
|
+
schema.setValue("json", JSON.stringify({
|
|
65
|
+
type: "verified",
|
|
66
|
+
reason: data?.reason || "",
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
schema.setValue("type", "project-update-verified");
|
|
71
|
+
schema.setValue("reason", data?.reason || "");
|
|
72
|
+
}
|
|
57
73
|
console.log("Before attest project update verified");
|
|
58
74
|
await this.attestStatus(signer, schema, callback);
|
|
59
75
|
console.log("After attest project update verified");
|
|
60
76
|
this.verified.push(new ProjectUpdateStatus({
|
|
61
77
|
data: {
|
|
62
78
|
type: "project-update-verified",
|
|
63
|
-
reason,
|
|
79
|
+
reason: data?.reason || "",
|
|
64
80
|
},
|
|
65
81
|
refUID: this.uid,
|
|
66
82
|
schema: schema,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { TSchemaName, IAttestation, Hex } from
|
|
2
|
-
import { Attestation } from
|
|
3
|
-
import { GapSchema } from
|
|
4
|
-
import { Fetcher } from
|
|
5
|
-
import { Community, Project, Grant, Milestone, MemberOf } from
|
|
6
|
-
import { Grantee } from
|
|
7
|
-
import { ICommunityAdminsResponse } from
|
|
1
|
+
import { TSchemaName, IAttestation, Hex } from "core/types";
|
|
2
|
+
import { Attestation } from "../Attestation";
|
|
3
|
+
import { GapSchema } from "../GapSchema";
|
|
4
|
+
import { Fetcher } from "../Fetcher";
|
|
5
|
+
import { Community, Project, Grant, Milestone, MemberOf } from "../entities";
|
|
6
|
+
import { Grantee } from "../types/attestations";
|
|
7
|
+
import { ICommunityAdminsResponse } from "./api/types";
|
|
8
|
+
import { ProjectMilestone } from "../entities/ProjectMilestone";
|
|
8
9
|
export declare class GapIndexerClient extends Fetcher {
|
|
9
10
|
private apiClient;
|
|
10
11
|
constructor(params: any);
|
|
@@ -29,6 +30,7 @@ export declare class GapIndexerClient extends Fetcher {
|
|
|
29
30
|
searchProjects(query: string): Promise<Project[]>;
|
|
30
31
|
projects(name?: string): Promise<Project[]>;
|
|
31
32
|
projectsOf(grantee: `0x${string}`): Promise<Project[]>;
|
|
33
|
+
projectMilestones(uidOrSlug: string): Promise<ProjectMilestone[]>;
|
|
32
34
|
grantee(address: `0x${string}`): Promise<Grantee>;
|
|
33
35
|
grantees(): Promise<Grantee[]>;
|
|
34
36
|
grantsOf(grantee: `0x${string}`, withCommunity?: boolean): Promise<Grant[]>;
|
|
@@ -5,31 +5,32 @@ const Attestation_1 = require("../Attestation");
|
|
|
5
5
|
const Fetcher_1 = require("../Fetcher");
|
|
6
6
|
const entities_1 = require("../entities");
|
|
7
7
|
const GapIndexerApi_1 = require("./api/GapIndexerApi");
|
|
8
|
+
const ProjectMilestone_1 = require("../entities/ProjectMilestone");
|
|
8
9
|
const Endpoints = {
|
|
9
10
|
attestations: {
|
|
10
|
-
all: () =>
|
|
11
|
+
all: () => "/attestations",
|
|
11
12
|
byUid: (uid) => `/attestations/${uid}`,
|
|
12
13
|
},
|
|
13
14
|
communities: {
|
|
14
|
-
all: () =>
|
|
15
|
+
all: () => "/communities",
|
|
15
16
|
byUidOrSlug: (uidOrSlug) => `/communities/${uidOrSlug}`,
|
|
16
17
|
grants: (uidOrSlug) => `/communities/${uidOrSlug}/grants`,
|
|
17
18
|
},
|
|
18
19
|
grantees: {
|
|
19
|
-
all: () =>
|
|
20
|
+
all: () => "/grantees",
|
|
20
21
|
byAddress: (address) => `/grantees/${address}`,
|
|
21
22
|
grants: (address) => `/grantees/${address}/grants`,
|
|
22
23
|
projects: (address) => `/grantees/${address}/projects`,
|
|
23
|
-
communities: (address, withGrants) => `/grantees/${address}/communities${withGrants ?
|
|
24
|
-
communitiesAdmin: (address, withGrants) => `/grantees/${address}/communities/admin${withGrants ?
|
|
24
|
+
communities: (address, withGrants) => `/grantees/${address}/communities${withGrants ? "?withGrants=true" : ""}`,
|
|
25
|
+
communitiesAdmin: (address, withGrants) => `/grantees/${address}/communities/admin${withGrants ? "?withGrants=true" : ""}`,
|
|
25
26
|
},
|
|
26
27
|
grants: {
|
|
27
|
-
all: () =>
|
|
28
|
+
all: () => "/grants",
|
|
28
29
|
byUid: (uid) => `/grants/${uid}`,
|
|
29
30
|
byExternalId: (id) => `/grants/external-id/${id}`,
|
|
30
31
|
},
|
|
31
32
|
project: {
|
|
32
|
-
all: () =>
|
|
33
|
+
all: () => "/projects",
|
|
33
34
|
byUidOrSlug: (uidOrSlug) => `/projects/${uidOrSlug}`,
|
|
34
35
|
grants: (uidOrSlug) => `/projects/${uidOrSlug}/grants`,
|
|
35
36
|
milestones: (uidOrSlug) => `/projects/${uidOrSlug}/milestones`,
|
|
@@ -43,7 +44,7 @@ class GapIndexerClient extends Fetcher_1.Fetcher {
|
|
|
43
44
|
async attestation(uid) {
|
|
44
45
|
const { data } = await this.apiClient.attestation(uid);
|
|
45
46
|
if (!data)
|
|
46
|
-
throw new Error(
|
|
47
|
+
throw new Error("Attestation not found");
|
|
47
48
|
return Attestation_1.Attestation.fromInterface([data], this.gap.network)[0];
|
|
48
49
|
}
|
|
49
50
|
async attestations(schemaName, search) {
|
|
@@ -76,7 +77,7 @@ class GapIndexerClient extends Fetcher_1.Fetcher {
|
|
|
76
77
|
return entities_1.Community.from(data, this.gap.network);
|
|
77
78
|
}
|
|
78
79
|
communitiesByIds(uids) {
|
|
79
|
-
throw new Error(
|
|
80
|
+
throw new Error("Method not implemented.");
|
|
80
81
|
}
|
|
81
82
|
async communityBySlug(slug) {
|
|
82
83
|
const { data } = await this.apiClient.communityBySlug(slug);
|
|
@@ -112,6 +113,10 @@ class GapIndexerClient extends Fetcher_1.Fetcher {
|
|
|
112
113
|
const { data } = await this.apiClient.projectsOf(grantee);
|
|
113
114
|
return entities_1.Project.from(data, this.gap.network);
|
|
114
115
|
}
|
|
116
|
+
async projectMilestones(uidOrSlug) {
|
|
117
|
+
const { data } = await this.apiClient.projectMilestones(uidOrSlug);
|
|
118
|
+
return ProjectMilestone_1.ProjectMilestone.from(data, this.gap.network);
|
|
119
|
+
}
|
|
115
120
|
async grantee(address) {
|
|
116
121
|
const { data } = await this.apiClient.grantee(address);
|
|
117
122
|
return data;
|
|
@@ -141,7 +146,7 @@ class GapIndexerClient extends Fetcher_1.Fetcher {
|
|
|
141
146
|
return entities_1.Milestone.from(data, this.gap.network);
|
|
142
147
|
}
|
|
143
148
|
async membersOf(projects) {
|
|
144
|
-
throw new Error(
|
|
149
|
+
throw new Error("Method not implemented.");
|
|
145
150
|
}
|
|
146
151
|
async slugExists(slug) {
|
|
147
152
|
return await this.apiClient.slugExists(slug);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosGQL } from "../../GraphQL/AxiosGQL";
|
|
2
|
-
import { Hex, IAttestationResponse, ICommunityResponse, ICommunityAdminsResponse, IGrantResponse, IProjectResponse, ISearchResponse } from "./types";
|
|
2
|
+
import { Hex, IAttestationResponse, ICommunityResponse, ICommunityAdminsResponse, IGrantResponse, IProjectResponse, ISearchResponse, IProjectMilestoneResponse } from "./types";
|
|
3
3
|
export declare class GapIndexerApi extends AxiosGQL {
|
|
4
4
|
constructor(url: string);
|
|
5
5
|
attestation(uid: Hex): Promise<import("axios").AxiosResponse<IAttestationResponse, any>>;
|
|
@@ -21,6 +21,7 @@ export declare class GapIndexerApi extends AxiosGQL {
|
|
|
21
21
|
searchProjects(query: string): Promise<import("axios").AxiosResponse<IProjectResponse[], any>>;
|
|
22
22
|
projects(name?: string): Promise<import("axios").AxiosResponse<IProjectResponse[], any>>;
|
|
23
23
|
projectsOf(grantee: Hex): Promise<import("axios").AxiosResponse<IProjectResponse[], any>>;
|
|
24
|
+
projectMilestones(uidOrSlug: string): Promise<import("axios").AxiosResponse<IProjectMilestoneResponse[], any>>;
|
|
24
25
|
/**
|
|
25
26
|
* Grantee
|
|
26
27
|
*/
|
|
@@ -37,6 +38,7 @@ export declare class GapIndexerApi extends AxiosGQL {
|
|
|
37
38
|
grantsOf(grantee: Hex, withCommunity?: boolean): Promise<import("axios").AxiosResponse<IGrantResponse[], any>>;
|
|
38
39
|
grantsFor(uid: string, withCommunity?: boolean): Promise<import("axios").AxiosResponse<IGrantResponse[], any>>;
|
|
39
40
|
grantsForExtProject(projectExtId: string): Promise<import("axios").AxiosResponse<IGrantResponse[], any>>;
|
|
41
|
+
grantBySlug(slug: Hex): Promise<import("axios").AxiosResponse<IGrantResponse, any>>;
|
|
40
42
|
grantsByCommunity(uid: Hex): Promise<import("axios").AxiosResponse<IGrantResponse[], any>>;
|
|
41
43
|
/**
|
|
42
44
|
* Milestone
|
|
@@ -31,6 +31,7 @@ const Endpoints = {
|
|
|
31
31
|
byUidOrSlug: (uidOrSlug) => `/projects/${uidOrSlug}`,
|
|
32
32
|
grants: (uidOrSlug) => `/projects/${uidOrSlug}/grants`,
|
|
33
33
|
milestones: (uidOrSlug) => `/projects/${uidOrSlug}/milestones`,
|
|
34
|
+
projectMilestones: (uidOrSlug) => `/projects/${uidOrSlug}/project-milestones`,
|
|
34
35
|
},
|
|
35
36
|
search: {
|
|
36
37
|
all: () => "/search",
|
|
@@ -124,6 +125,10 @@ class GapIndexerApi extends AxiosGQL_1.AxiosGQL {
|
|
|
124
125
|
const response = await this.client.get(Endpoints.grantees.projects(grantee));
|
|
125
126
|
return response;
|
|
126
127
|
}
|
|
128
|
+
async projectMilestones(uidOrSlug) {
|
|
129
|
+
const response = await this.client.get(Endpoints.project.projectMilestones(uidOrSlug));
|
|
130
|
+
return response;
|
|
131
|
+
}
|
|
127
132
|
/**
|
|
128
133
|
* Grantee
|
|
129
134
|
*/
|
|
@@ -151,6 +156,10 @@ class GapIndexerApi extends AxiosGQL_1.AxiosGQL {
|
|
|
151
156
|
const response = await this.client.get(Endpoints.grants.byExternalId(projectExtId));
|
|
152
157
|
return response;
|
|
153
158
|
}
|
|
159
|
+
async grantBySlug(slug) {
|
|
160
|
+
const response = await this.client.get(Endpoints.grants.byUid(slug));
|
|
161
|
+
return response;
|
|
162
|
+
}
|
|
154
163
|
async grantsByCommunity(uid) {
|
|
155
164
|
const response = await this.client.get(Endpoints.communities.grants(uid));
|
|
156
165
|
return response;
|
|
@@ -36,6 +36,7 @@ export interface IMilestoneCompleted extends IAttestationResponse {
|
|
|
36
36
|
data: {
|
|
37
37
|
type: "approved" | "rejected" | "completed";
|
|
38
38
|
reason?: string;
|
|
39
|
+
proofOfWork?: string;
|
|
39
40
|
};
|
|
40
41
|
}
|
|
41
42
|
export interface IMilestoneResponse extends IAttestationResponse {
|
|
@@ -65,6 +66,7 @@ export interface IGrantUpdate extends IAttestationResponse {
|
|
|
65
66
|
text: string;
|
|
66
67
|
title: string;
|
|
67
68
|
type: "grant-update";
|
|
69
|
+
proofOfWork?: string;
|
|
68
70
|
};
|
|
69
71
|
verified?: IGrantUpdateStatus[];
|
|
70
72
|
}
|
|
@@ -84,6 +86,23 @@ export interface IProjectUpdate extends IAttestationResponse {
|
|
|
84
86
|
};
|
|
85
87
|
verified?: IProjectUpdateStatus[];
|
|
86
88
|
}
|
|
89
|
+
export interface IProjectMilestoneStatus extends IAttestationResponse {
|
|
90
|
+
type: `project-milestone-verified`;
|
|
91
|
+
reason?: string;
|
|
92
|
+
data: {
|
|
93
|
+
type: "approved" | "rejected" | "completed";
|
|
94
|
+
reason?: string;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export interface IProjectMilestoneResponse extends IAttestationResponse {
|
|
98
|
+
data: {
|
|
99
|
+
text: string;
|
|
100
|
+
title: string;
|
|
101
|
+
type: "project-milestone";
|
|
102
|
+
};
|
|
103
|
+
verified?: IProjectMilestoneStatus[];
|
|
104
|
+
completed?: IMilestoneCompleted;
|
|
105
|
+
}
|
|
87
106
|
export interface IProjectPointer extends IAttestationResponse {
|
|
88
107
|
data: {
|
|
89
108
|
ogProjectUID: string;
|
|
@@ -105,6 +124,7 @@ export interface IGrantDetails extends IAttestationResponse {
|
|
|
105
124
|
explanation: string;
|
|
106
125
|
}[];
|
|
107
126
|
startDate: number;
|
|
127
|
+
programId?: string;
|
|
108
128
|
type: "grant-details";
|
|
109
129
|
};
|
|
110
130
|
}
|
|
@@ -191,6 +211,7 @@ export interface IProjectResponse extends IAttestationResponse {
|
|
|
191
211
|
pointers: IProjectPointer[];
|
|
192
212
|
symlinks: Hex[];
|
|
193
213
|
endorsements: IProjectEndorsement[];
|
|
214
|
+
milestones: IProjectMilestoneResponse[];
|
|
194
215
|
}
|
|
195
216
|
export interface ICommunityDetails extends IAttestationResponse {
|
|
196
217
|
type: "CommunityDetails";
|
|
@@ -3,7 +3,12 @@ import { Hex } from "core/types";
|
|
|
3
3
|
import { Project } from "../entities/Project";
|
|
4
4
|
import { GapSchema } from "../GapSchema";
|
|
5
5
|
import { GrantUpdate } from "../entities/GrantUpdate";
|
|
6
|
+
import { Transaction } from "ethers";
|
|
6
7
|
/** Attestation interfaces */
|
|
8
|
+
export type AttestationWithTx = {
|
|
9
|
+
uids: Hex[];
|
|
10
|
+
tx: Transaction[];
|
|
11
|
+
};
|
|
7
12
|
export type ExternalLink = {
|
|
8
13
|
type: string;
|
|
9
14
|
url: string;
|
|
@@ -38,10 +43,12 @@ export interface IGrantDetails {
|
|
|
38
43
|
questions?: IGrantDetailsQuestion[];
|
|
39
44
|
type?: string;
|
|
40
45
|
startDate?: number;
|
|
46
|
+
programId?: string;
|
|
41
47
|
}
|
|
42
48
|
export declare class GrantDetails extends Attestation<IGrantDetails> implements IGrantDetails {
|
|
43
49
|
title: string;
|
|
44
50
|
proposalURL: string;
|
|
51
|
+
programId?: string;
|
|
45
52
|
payoutAddress?: Hex;
|
|
46
53
|
amount?: string;
|
|
47
54
|
assetAndChainId?: [Hex, number];
|
|
@@ -73,12 +80,14 @@ export declare class MemberDetails extends Attestation<IMemberDetails> implement
|
|
|
73
80
|
profilePictureURL: string;
|
|
74
81
|
}
|
|
75
82
|
export interface IMilestoneCompleted {
|
|
76
|
-
type
|
|
83
|
+
type?: "approved" | "rejected" | "completed" | "verified";
|
|
77
84
|
reason?: string;
|
|
85
|
+
proofOfWork?: string;
|
|
78
86
|
}
|
|
79
87
|
export declare class MilestoneCompleted extends Attestation<IMilestoneCompleted> implements IMilestoneCompleted {
|
|
80
88
|
type: "approved" | "rejected" | "completed" | "verified";
|
|
81
89
|
reason?: string;
|
|
90
|
+
proofOfWork?: string;
|
|
82
91
|
}
|
|
83
92
|
export interface ITag {
|
|
84
93
|
name: string;
|
|
@@ -143,3 +152,13 @@ export declare class ProjectEndorsement extends Attestation<IProjectEndorsement>
|
|
|
143
152
|
type?: string;
|
|
144
153
|
constructor(data: AttestationArgs<IProjectEndorsement, GapSchema>);
|
|
145
154
|
}
|
|
155
|
+
export interface IProjectMilestoneCompleted {
|
|
156
|
+
type?: "approved" | "rejected" | "completed" | "verified";
|
|
157
|
+
reason?: string;
|
|
158
|
+
proofOfWork?: string;
|
|
159
|
+
}
|
|
160
|
+
export declare class ProjectMilestoneCompleted extends Attestation<IProjectMilestoneCompleted> implements IProjectMilestoneCompleted {
|
|
161
|
+
type: "approved" | "rejected" | "completed" | "verified";
|
|
162
|
+
reason?: string;
|
|
163
|
+
proofOfWork?: string;
|
|
164
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProjectEndorsement = exports.GrantCompleted = exports.Grantee = exports.ProjectDetails = exports.Tag = exports.MilestoneCompleted = exports.MemberDetails = exports.GrantVerified = exports.GrantRound = exports.GrantDetails = exports.CommunityDetails = void 0;
|
|
3
|
+
exports.ProjectMilestoneCompleted = exports.ProjectEndorsement = exports.GrantCompleted = exports.Grantee = exports.ProjectDetails = exports.Tag = exports.MilestoneCompleted = exports.MemberDetails = exports.GrantVerified = exports.GrantRound = exports.GrantDetails = exports.CommunityDetails = void 0;
|
|
4
4
|
const Attestation_1 = require("../Attestation");
|
|
5
5
|
const GrantUpdate_1 = require("../entities/GrantUpdate");
|
|
6
6
|
class CommunityDetails extends Attestation_1.Attestation {
|
|
@@ -61,3 +61,6 @@ class ProjectEndorsement extends Attestation_1.Attestation {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
exports.ProjectEndorsement = ProjectEndorsement;
|
|
64
|
+
class ProjectMilestoneCompleted extends Attestation_1.Attestation {
|
|
65
|
+
}
|
|
66
|
+
exports.ProjectMilestoneCompleted = ProjectMilestoneCompleted;
|