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

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.
@@ -39,12 +39,12 @@ class AlloBase {
39
39
  async encodeStrategyInitData(applicationStart, applicationEnd, roundStart, roundEnd, payoutToken) {
40
40
  const encoder = new ethers_2.AbiCoder();
41
41
  const initStrategyData = encoder.encode(["bool", "bool", "uint256", "uint256", "uint256", "uint256", "address[]"], [
42
- false,
43
- true,
44
- applicationStart,
45
- applicationEnd,
46
- roundStart,
47
- roundEnd,
42
+ false, // useRegistryAnchor
43
+ true, // metadataRequired
44
+ applicationStart, // Eg. Curr + 1 hour later registrationStartTime
45
+ applicationEnd, // Eg. Curr + 5 days later registrationEndTime
46
+ roundStart, // Eg. Curr + 2 hours later allocationStartTime
47
+ roundEnd, // Eg. Curr + 10 days later allocaitonEndTime
48
48
  [payoutToken],
49
49
  ]);
50
50
  return initStrategyData;
@@ -66,7 +66,7 @@ class AlloBase {
66
66
  const createPoolArgs = {
67
67
  profileId: args.profileId,
68
68
  strategy: args.strategy,
69
- initStrategyData: initStrategyData,
69
+ initStrategyData: initStrategyData, // unique to the strategy
70
70
  token: args.payoutToken,
71
71
  amount: BigInt(args.matchingFundAmt),
72
72
  metadata: metadata,
@@ -6,6 +6,14 @@ export interface _IGrantUpdate extends GrantUpdate {
6
6
  }
7
7
  export interface IGrantUpdate extends IGrantUpdateBase {
8
8
  type?: string;
9
+ proofOfWork?: string;
10
+ pitchDeck?: string;
11
+ demoVideo?: string;
12
+ trackExplanations?: Array<{
13
+ trackId: string;
14
+ trackName: string;
15
+ explanation: string;
16
+ }>;
9
17
  }
10
18
  type IStatus = "verified";
11
19
  export interface IGrantUpdateStatus {
@@ -15,11 +23,25 @@ export interface IGrantUpdateStatus {
15
23
  export declare class GrantUpdateStatus extends Attestation<IGrantUpdateStatus> implements IGrantUpdateStatus {
16
24
  type: `grant-update-${IStatus}`;
17
25
  reason?: string;
26
+ pitchDeck?: string;
27
+ demoVideo?: string;
28
+ trackExplanations?: Array<{
29
+ trackId: string;
30
+ trackName: string;
31
+ explanation: string;
32
+ }>;
18
33
  }
19
34
  export declare class GrantUpdate extends Attestation<IGrantUpdate> implements IGrantUpdate {
20
35
  title: string;
21
36
  text: string;
22
37
  proofOfWork: string;
38
+ pitchDeck?: string;
39
+ demoVideo?: string;
40
+ trackExplanations?: Array<{
41
+ trackId: string;
42
+ trackName: string;
43
+ explanation: string;
44
+ }>;
23
45
  verified: GrantUpdateStatus[];
24
46
  /**
25
47
  * Attest the status of the milestone as approved, rejected or completed.
@@ -5,6 +5,11 @@ export type ExternalLink = {
5
5
  type: string;
6
6
  url: string;
7
7
  };
8
+ export type ExternalCustomLink = {
9
+ type: 'custom';
10
+ url: string;
11
+ name: string;
12
+ };
8
13
  export interface ITag {
9
14
  name: string;
10
15
  }
@@ -61,6 +66,13 @@ export interface IGrantUpdateStatus extends IAttestationResponse {
61
66
  data: {
62
67
  type: "approved" | "rejected" | "completed";
63
68
  reason?: string;
69
+ pitchDeck?: string;
70
+ demoVideo?: string;
71
+ trackExplanations?: Array<{
72
+ trackId: string;
73
+ trackName: string;
74
+ explanation: string;
75
+ }>;
64
76
  };
65
77
  }
66
78
  export interface IGrantUpdate extends IAttestationResponse {
@@ -160,6 +172,7 @@ export interface IGrantResponse extends IAttestationResponse {
160
172
  external?: {
161
173
  [key: string]: string[];
162
174
  };
175
+ amount?: Hex;
163
176
  }
164
177
  export interface IMemberDetails extends IAttestationResponse {
165
178
  name: string;
@@ -182,7 +195,7 @@ export interface IProjectDetails extends IAttestationResponse {
182
195
  missionSummary?: string;
183
196
  locationOfImpact?: string;
184
197
  imageURL: string;
185
- links?: ExternalLink[];
198
+ links?: Array<ExternalLink | ExternalCustomLink>;
186
199
  tags?: ITag[];
187
200
  slug?: string;
188
201
  type: "project-details";
@@ -231,6 +244,7 @@ export interface IProjectResponse extends IAttestationResponse {
231
244
  symlinks: Hex[];
232
245
  endorsements: IProjectEndorsement[];
233
246
  milestones: IProjectMilestoneResponse[];
247
+ payoutAddress?: Hex;
234
248
  }
235
249
  export interface ICommunityDetails extends IAttestationResponse {
236
250
  type: "CommunityDetails";
@@ -13,6 +13,11 @@ export type ExternalLink = {
13
13
  type: string;
14
14
  url: string;
15
15
  }[];
16
+ export type ExternalCustomLink = {
17
+ type: 'custom';
18
+ url: string;
19
+ name: string;
20
+ };
16
21
  export interface ICommunityDetails {
17
22
  name: string;
18
23
  description: string;
@@ -107,7 +112,7 @@ export interface IProjectDetails {
107
112
  missionSummary?: string;
108
113
  locationOfImpact?: string;
109
114
  imageURL: string;
110
- links?: ExternalLink;
115
+ links?: Array<ExternalLink[0] | ExternalCustomLink>;
111
116
  tags?: ITag[];
112
117
  externalIds?: string[];
113
118
  slug?: string;
@@ -125,7 +130,7 @@ export declare class ProjectDetails extends Attestation<IProjectDetails> impleme
125
130
  missionSummary?: string;
126
131
  locationOfImpact?: string;
127
132
  imageURL: string;
128
- links: ExternalLink;
133
+ links: Array<ExternalLink[0] | ExternalCustomLink>;
129
134
  tags: ITag[];
130
135
  slug: string;
131
136
  type: string;
package/core/consts.js CHANGED
@@ -45,7 +45,7 @@ exports.Networks = {
45
45
  contracts: {
46
46
  eas: "0x4200000000000000000000000000000000000021",
47
47
  schema: "0x4200000000000000000000000000000000000020",
48
- multicall: "0xd2eD366393FDfd243931Fe48e9fb65A192B0018c",
48
+ multicall: "0xd2eD366393FDfd243931Fe48e9fb65A192B0018c", //proxy,
49
49
  projectResolver: "0x7177AdC0f924b695C0294A40C4C5FEFf5EE1E141",
50
50
  communityResolver: "0x6dC1D6b864e8BEf815806f9e4677123496e12026",
51
51
  donations: "0x021896771412C1D3f31BC7B01fFA3a6A17c5dA30",
@@ -155,7 +155,7 @@ exports.Networks = {
155
155
  contracts: {
156
156
  eas: "0xbD75f629A22Dc1ceD33dDA0b68c546A1c035c458",
157
157
  schema: "0xA310da9c5B885E7fb3fbA9D66E9Ba6Df512b78eB",
158
- multicall: "0x6dC1D6b864e8BEf815806f9e4677123496e12026",
158
+ multicall: "0x6dC1D6b864e8BEf815806f9e4677123496e12026", //proxy,
159
159
  projectResolver: "0x28BE0b0515be8BB8822aF1467A6613795E74717b",
160
160
  communityResolver: "0xD534C4704F82494aBbc901560046fB62Ac63E9C4",
161
161
  donations: "0x475F3E915601d975c792E6116791FBe9ACdBE902",
@@ -217,10 +217,10 @@ exports.Networks = {
217
217
  airdropNFT: "0x11f48e68Ff894D417956839263337a2989822703",
218
218
  },
219
219
  schemas: {
220
- Community: "0xf3d790c7fdab6c1b1f25ffcc9289e5be2792eb596d2851a4d059c8aae1bc8b2e",
220
+ Community: "0xf3d790c7fdab6c1b1f25ffcc9289e5be2792eb596d2851a4d059c8aae1bc8b2e", //test with resolver
221
221
  // "0x1954572e3fe21bf4334afdaf1358ed7098af1ed136e76dc93c2fdc25e83934c1", // original without resolver
222
222
  Details: "0x2c270e35bfcdc4d611f0e9d3d2ab6924ec6c673505abc22a1dd07e19b67211af",
223
- Grant: "0x09697aeeb3ae71de1cc19e388fd74264f11af5fba3016094764553ac341fdc72",
223
+ Grant: "0x09697aeeb3ae71de1cc19e388fd74264f11af5fba3016094764553ac341fdc72", // with communityUID/resolver
224
224
  GrantVerified: "0x0be8952e2dd74ffd63a02f4d55b20b603fe7a60130cb9d70de31feb9c52fdd37",
225
225
  MemberOf: "0xdd87b3500457931252424f4439365534ba72a367503a8805ff3482353fb90301",
226
226
  MilestoneApproved: "0xcdef0e492d2e7ad25d0b0fdb868f6dcd1f5e5c30e42fd5fa0debdc12f7618322",
@@ -405,7 +405,7 @@ exports.Networks = {
405
405
  contracts: {
406
406
  eas: "0x4200000000000000000000000000000000000021",
407
407
  schema: "0x4200000000000000000000000000000000000020",
408
- multicall: "0x28BE0b0515be8BB8822aF1467A6613795E74717b",
408
+ multicall: "0x28BE0b0515be8BB8822aF1467A6613795E74717b", //proxy,
409
409
  projectResolver: "0x6dC1D6b864e8BEf815806f9e4677123496e12026",
410
410
  communityResolver: "0xfddb660F2F1C27d219372210745BB9f73431856E",
411
411
  donations: "0x28BE0b0515be8BB8822aF1467A6613795E74717b",
@@ -433,7 +433,7 @@ exports.Networks = {
433
433
  contracts: {
434
434
  eas: "0xC47300428b6AD2c7D03BB76D05A176058b47E6B0",
435
435
  schema: "0xD2CDF46556543316e7D34e8eDc4624e2bB95e3B6",
436
- multicall: "0x8791Ac8c099314bB1D1514D76de13a1E80275950",
436
+ multicall: "0x8791Ac8c099314bB1D1514D76de13a1E80275950", //proxy,
437
437
  projectResolver: "0xAFaE7aA6118D75Fe7FDB3eF8c1623cAaF8C8a653",
438
438
  communityResolver: "0xfddb660F2F1C27d219372210745BB9f73431856E",
439
439
  donations: "0x8791Ac8c099314bB1D1514D76de13a1E80275950",
@@ -3,4 +3,11 @@ export interface IGrantUpdateBase {
3
3
  text: string;
4
4
  proofOfWork?: string;
5
5
  completionPercentage?: string;
6
+ pitchDeck?: string;
7
+ demoVideo?: string;
8
+ trackExplanations?: Array<{
9
+ trackId: string;
10
+ trackName: string;
11
+ explanation: string;
12
+ }>;
6
13
  }
package/core/types.d.ts CHANGED
@@ -29,7 +29,7 @@ export interface AttestArgs<T = unknown> {
29
29
  }
30
30
  export type TSchemaName = "Community" | "CommunityDetails" | "Grant" | "GrantDetails" | "GrantVerified" | "MemberOf" | "MemberDetails" | "Milestone" | "MilestoneCompleted" | "MilestoneApproved" | "Project" | "ProjectDetails" | "Details" | "ProjectImpact" | "ProjectUpdate" | "ProjectUpdateStatus" | "ProjectPointer" | "GrantUpdate" | "GrantUpdateStatus" | "ProjectEndorsement" | "ProjectMilestone" | "ProjectMilestoneStatus" | "ContributorProfile";
31
31
  export type TResolvedSchemaNames = "Community" | "Grant" | "GrantVerified" | "MemberOf" | "MilestoneCompleted" | "MilestoneApproved" | "Project" | "Details" | "ProjectUpdateStatus" | "GrantUpdateStatus" | "ProjectUpdateStatus" | "ProjectMilestoneStatus" | "ContributorProfile";
32
- export type TExternalLink = "twitter" | "github" | "website" | "linkedin" | "discord" | "pitchDeck" | "demoVideo" | "farcaster";
32
+ export type TExternalLink = "twitter" | "github" | "website" | "linkedin" | "discord" | "pitchDeck" | "demoVideo" | "farcaster" | "custom";
33
33
  export type TNetwork = "optimism" | "celo" | "optimism-sepolia" | "arbitrum" | "sepolia" | "sei" | "sei-testnet" | "base-sepolia" | "lisk" | "scroll";
34
34
  /**
35
35
  * Generic GAP Facade interface.
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Gelato = exports.sendGelatoTxn = void 0;
6
+ exports.Gelato = void 0;
7
+ exports.sendGelatoTxn = sendGelatoTxn;
7
8
  const axios_1 = __importDefault(require("axios"));
8
9
  const relay_sdk_1 = require("@gelatonetwork/relay-sdk");
9
10
  const watch_gelato_txn_1 = require("./watch-gelato-txn");
@@ -56,7 +57,6 @@ async function sendGelatoTxn(...params) {
56
57
  const { wait } = await sendByApiKey(...params);
57
58
  return wait();
58
59
  }
59
- exports.sendGelatoTxn = sendGelatoTxn;
60
60
  /**
61
61
  * Builds the arguments for a sponsored call using GelatoRelay
62
62
  * @param data Populated contract call.
@@ -86,7 +86,7 @@ data, chainId, target) {
86
86
  chainId,
87
87
  target,
88
88
  },
89
- '{apiKey}',
89
+ '{apiKey}', // filled in the api
90
90
  {
91
91
  retries: 3,
92
92
  },
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handler = void 0;
3
+ exports.handler = handler;
4
4
  const send_gelato_txn_1 = require("./send-gelato-txn");
5
5
  const assertionObj = [
6
6
  {
@@ -57,4 +57,3 @@ async function handler(req, res, env_gelatoApiKey) {
57
57
  res.send(error.message);
58
58
  }
59
59
  }
60
- exports.handler = handler;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.watchGelatoTxn = void 0;
3
+ exports.watchGelatoTxn = watchGelatoTxn;
4
4
  const relay_sdk_1 = require("@gelatonetwork/relay-sdk");
5
5
  var TaskState;
6
6
  (function (TaskState) {
@@ -60,4 +60,3 @@ async function watchGelatoTxn(taskId, ttl = 500) {
60
60
  loop();
61
61
  });
62
62
  }
63
- exports.watchGelatoTxn = watchGelatoTxn;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDate = void 0;
3
+ exports.getDate = getDate;
4
4
  function getDate(date) {
5
5
  return typeof date === "number" ? new Date(date * 1000) : date;
6
6
  }
7
- exports.getDate = getDate;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getIPFSData = void 0;
6
+ exports.getIPFSData = getIPFSData;
7
7
  const axios_1 = __importDefault(require("axios"));
8
8
  async function getIPFSData(cid) {
9
9
  try {
@@ -17,4 +17,3 @@ async function getIPFSData(cid) {
17
17
  throw new Error(`Error to retrive data for CID: ${cid}`);
18
18
  }
19
19
  }
20
- exports.getIPFSData = getIPFSData;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapFilter = void 0;
3
+ exports.mapFilter = mapFilter;
4
4
  /**
5
5
  * Filters an array by its condition then maps it to the desired format.
6
6
  * @param arr
@@ -17,4 +17,3 @@ function mapFilter(arr, condition, mapTo) {
17
17
  }
18
18
  return newArray;
19
19
  }
20
- exports.mapFilter = mapFilter;
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.serializeWithBigint = void 0;
3
+ exports.serializeWithBigint = serializeWithBigint;
4
4
  function serializeWithBigint(value) {
5
5
  return JSON.stringify(value, (this,
6
6
  (key, value) => (typeof value === "bigint" ? value.toString() : value)));
7
7
  }
8
- exports.serializeWithBigint = serializeWithBigint;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toUnix = void 0;
3
+ exports.toUnix = toUnix;
4
4
  function toUnix(value) {
5
5
  switch (typeof value) {
6
6
  case "number":
@@ -22,4 +22,3 @@ function toUnix(value) {
22
22
  return null;
23
23
  }
24
24
  }
25
- exports.toUnix = toUnix;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.4.15",
6
+ "version": "0.4.17",
7
7
  "description": "Simple and easy interface between EAS and Karma GAP.",
8
8
  "main": "./index.js",
9
9
  "author": "KarmaHQ",
@@ -18,18 +18,24 @@
18
18
  "csv-upload": "npx ts-node ./csv-upload/scripts/run.ts",
19
19
  "test-file": "npx ts-node ./test-file-indexer-api.ts",
20
20
  "test-milestone": "npx ts-node ./milestone-workflow-example.ts",
21
+ "create-community": "npx ts-node ./create-community-example.ts",
21
22
  "publish-npm": "npm version patch && tsc && cd .dist && npm publish --scope=@show-karma/karma-gap-sdk --access public"
22
23
  },
23
24
  "dependencies": {
24
25
  "@allo-team/allo-v2-sdk": "^1.0.63",
25
26
  "@ethereum-attestation-service/eas-sdk": "1.4.2",
26
- "@gelatonetwork/relay-sdk": "^5.2.0",
27
+ "@gelatonetwork/relay-sdk": "^5.6.0",
27
28
  "@types/sha256": "^0.2.0",
28
- "axios": "^1.4.0",
29
+ "axios": "^1.7.9",
30
+ "dotenv": "^17.2.3",
29
31
  "ethers": "6.11.0",
30
32
  "sha256": "^0.2.0",
31
33
  "simple-ts-job-runner": "^1.0.12"
32
34
  },
35
+ "overrides": {
36
+ "ws": ">=8.17.1",
37
+ "cookie": ">=0.7.0"
38
+ },
33
39
  "devDependencies": {
34
40
  "@types/node": "^20.5.0",
35
41
  "eslint": "^8.47.0",