@show-karma/karma-gap-sdk 0.3.9 → 0.3.11

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.
@@ -10,12 +10,6 @@ const GapContract_1 = require("../contract/GapContract");
10
10
  const Community_1 = require("./Community");
11
11
  const Project_1 = require("./Project");
12
12
  const AllGapSchemas_1 = require("../AllGapSchemas");
13
- const chainIdToNetwork = {
14
- 11155420: 'optimism-sepolia',
15
- 42161: 'arbitrum',
16
- 10: 'optimism',
17
- 11155111: 'sepolia'
18
- };
19
13
  class Grant extends Attestation_1.Attestation {
20
14
  constructor() {
21
15
  super(...arguments);
@@ -170,7 +164,7 @@ class Grant extends Attestation_1.Attestation {
170
164
  data: {
171
165
  communityUID: attestation.data.communityUID,
172
166
  },
173
- schema: new AllGapSchemas_1.AllGapSchemas().findSchema('Grant', chainIdToNetwork[attestation.chainID]),
167
+ schema: new AllGapSchemas_1.AllGapSchemas().findSchema('Grant', consts_1.chainIdToNetwork[attestation.chainID]),
174
168
  chainID: attestation.chainID,
175
169
  });
176
170
  if (attestation.details) {
@@ -180,7 +174,7 @@ class Grant extends Attestation_1.Attestation {
180
174
  data: {
181
175
  ...details.data,
182
176
  },
183
- schema: new AllGapSchemas_1.AllGapSchemas().findSchema('GrantDetails', chainIdToNetwork[attestation.chainID]),
177
+ schema: new AllGapSchemas_1.AllGapSchemas().findSchema('GrantDetails', consts_1.chainIdToNetwork[attestation.chainID]),
184
178
  chainID: attestation.chainID,
185
179
  });
186
180
  }
@@ -195,7 +189,7 @@ class Grant extends Attestation_1.Attestation {
195
189
  data: {
196
190
  ...u.data,
197
191
  },
198
- schema: new AllGapSchemas_1.AllGapSchemas().findSchema('GrantDetails', chainIdToNetwork[attestation.chainID]),
192
+ schema: new AllGapSchemas_1.AllGapSchemas().findSchema('GrantDetails', consts_1.chainIdToNetwork[attestation.chainID]),
199
193
  chainID: attestation.chainID,
200
194
  }));
201
195
  }
@@ -206,7 +200,7 @@ class Grant extends Attestation_1.Attestation {
206
200
  data: {
207
201
  ...completed.data,
208
202
  },
209
- schema: new AllGapSchemas_1.AllGapSchemas().findSchema('GrantDetails', chainIdToNetwork[attestation.chainID]),
203
+ schema: new AllGapSchemas_1.AllGapSchemas().findSchema('GrantDetails', consts_1.chainIdToNetwork[attestation.chainID]),
210
204
  chainID: attestation.chainID,
211
205
  });
212
206
  }
@@ -1,17 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Milestone = void 0;
4
+ const consts_1 = require("../../consts");
4
5
  const AllGapSchemas_1 = require("../AllGapSchemas");
5
6
  const Attestation_1 = require("../Attestation");
6
7
  const SchemaError_1 = require("../SchemaError");
7
8
  const GapContract_1 = require("../contract/GapContract");
8
9
  const attestations_1 = require("../types/attestations");
9
- const chainIdToNetwork = {
10
- 11155420: 'optimism-sepolia',
11
- 42161: 'arbitrum',
12
- 10: 'optimism',
13
- 11155111: 'sepolia'
14
- };
15
10
  class Milestone extends Attestation_1.Attestation {
16
11
  constructor() {
17
12
  super(...arguments);
@@ -194,7 +189,7 @@ class Milestone extends Attestation_1.Attestation {
194
189
  data: {
195
190
  ...attestation.data,
196
191
  },
197
- schema: new AllGapSchemas_1.AllGapSchemas().findSchema('Milestone', chainIdToNetwork[attestation.chainID]),
192
+ schema: new AllGapSchemas_1.AllGapSchemas().findSchema('Milestone', consts_1.chainIdToNetwork[attestation.chainID]),
198
193
  chainID: attestation.chainID,
199
194
  });
200
195
  if (attestation.completed) {
@@ -203,7 +198,7 @@ class Milestone extends Attestation_1.Attestation {
203
198
  data: {
204
199
  ...attestation.completed.data,
205
200
  },
206
- schema: new AllGapSchemas_1.AllGapSchemas().findSchema('MilestoneCompleted', chainIdToNetwork[attestation.chainID]),
201
+ schema: new AllGapSchemas_1.AllGapSchemas().findSchema('MilestoneCompleted', consts_1.chainIdToNetwork[attestation.chainID]),
207
202
  chainID: attestation.chainID,
208
203
  });
209
204
  }
@@ -213,7 +208,7 @@ class Milestone extends Attestation_1.Attestation {
213
208
  data: {
214
209
  ...attestation.completed.data,
215
210
  },
216
- schema: new AllGapSchemas_1.AllGapSchemas().findSchema('MilestoneCompleted', chainIdToNetwork[attestation.chainID]),
211
+ schema: new AllGapSchemas_1.AllGapSchemas().findSchema('MilestoneCompleted', consts_1.chainIdToNetwork[attestation.chainID]),
217
212
  chainID: attestation.chainID,
218
213
  });
219
214
  }
@@ -223,7 +218,7 @@ class Milestone extends Attestation_1.Attestation {
223
218
  data: {
224
219
  ...attestation.completed.data,
225
220
  },
226
- schema: new AllGapSchemas_1.AllGapSchemas().findSchema('MilestoneCompleted', chainIdToNetwork[attestation.chainID]),
221
+ schema: new AllGapSchemas_1.AllGapSchemas().findSchema('MilestoneCompleted', consts_1.chainIdToNetwork[attestation.chainID]),
227
222
  chainID: attestation.chainID,
228
223
  });
229
224
  }
@@ -10,12 +10,6 @@ const consts_1 = require("../../consts");
10
10
  const MemberOf_1 = require("./MemberOf");
11
11
  const GapContract_1 = require("../contract/GapContract");
12
12
  const AllGapSchemas_1 = require("../AllGapSchemas");
13
- const chainIdToNetwork = {
14
- 11155420: 'optimism-sepolia',
15
- 42161: 'arbitrum',
16
- 10: 'optimism',
17
- 11155111: 'sepolia'
18
- };
19
13
  class Project extends Attestation_1.Attestation {
20
14
  constructor() {
21
15
  super(...arguments);
@@ -199,7 +193,7 @@ class Project extends Attestation_1.Attestation {
199
193
  data: {
200
194
  project: true,
201
195
  },
202
- schema: new AllGapSchemas_1.AllGapSchemas().findSchema('Project', chainIdToNetwork[attestation.chainID]),
196
+ schema: new AllGapSchemas_1.AllGapSchemas().findSchema('Project', consts_1.chainIdToNetwork[attestation.chainID]),
203
197
  chainID: attestation.chainID,
204
198
  });
205
199
  if (attestation.details) {
@@ -209,7 +203,7 @@ class Project extends Attestation_1.Attestation {
209
203
  data: {
210
204
  ...details.data,
211
205
  },
212
- schema: new AllGapSchemas_1.AllGapSchemas().findSchema('ProjectDetails', chainIdToNetwork[attestation.chainID]),
206
+ schema: new AllGapSchemas_1.AllGapSchemas().findSchema('ProjectDetails', consts_1.chainIdToNetwork[attestation.chainID]),
213
207
  chainID: attestation.chainID,
214
208
  });
215
209
  project.details.links = details.data.links || [];
@@ -228,7 +222,7 @@ class Project extends Attestation_1.Attestation {
228
222
  data: {
229
223
  memberOf: true,
230
224
  },
231
- schema: new AllGapSchemas_1.AllGapSchemas().findSchema('MemberOf', chainIdToNetwork[attestation.chainID]),
225
+ schema: new AllGapSchemas_1.AllGapSchemas().findSchema('MemberOf', consts_1.chainIdToNetwork[attestation.chainID]),
232
226
  chainID: attestation.chainID,
233
227
  });
234
228
  if (m.details) {
@@ -238,7 +232,7 @@ class Project extends Attestation_1.Attestation {
238
232
  data: {
239
233
  ...details.data,
240
234
  },
241
- schema: new AllGapSchemas_1.AllGapSchemas().findSchema('MemberDetails', chainIdToNetwork[attestation.chainID]),
235
+ schema: new AllGapSchemas_1.AllGapSchemas().findSchema('MemberDetails', consts_1.chainIdToNetwork[attestation.chainID]),
242
236
  chainID: attestation.chainID,
243
237
  });
244
238
  }
package/core/consts.d.ts CHANGED
@@ -4,6 +4,12 @@ import { EASNetworkConfig, SchemaInterface, TNetwork, TSchemaName } from "./type
4
4
  * instead of the custom contract.
5
5
  */
6
6
  export declare const useDefaultAttestation: TSchemaName[];
7
+ export declare const chainIdToNetwork: {
8
+ 11155420: string;
9
+ 42161: string;
10
+ 10: string;
11
+ 11155111: string;
12
+ };
7
13
  export declare const nullRef = "0x0000000000000000000000000000000000000000000000000000000000000000";
8
14
  export declare const nullResolver = "0x0000000000000000000000000000000000000000";
9
15
  export declare const zeroAddress = "0x0000000000000000000000000000000000000000";
package/core/consts.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MountEntities = exports.Networks = exports.zeroAddress = exports.nullResolver = exports.nullRef = exports.useDefaultAttestation = void 0;
3
+ exports.MountEntities = exports.Networks = exports.zeroAddress = exports.nullResolver = exports.nullRef = exports.chainIdToNetwork = exports.useDefaultAttestation = void 0;
4
4
  /**
5
5
  * Schemas that should use default EAS attestation
6
6
  * instead of the custom contract.
@@ -11,6 +11,12 @@ exports.useDefaultAttestation = [
11
11
  "GrantVerified",
12
12
  "Community",
13
13
  ];
14
+ exports.chainIdToNetwork = {
15
+ 11155420: 'optimism-sepolia',
16
+ 42161: 'arbitrum',
17
+ 10: 'optimism',
18
+ 11155111: 'sepolia'
19
+ };
14
20
  exports.nullRef = "0x0000000000000000000000000000000000000000000000000000000000000000";
15
21
  // TODO: Remove null resolver and change usage to zero address
16
22
  exports.nullResolver = "0x0000000000000000000000000000000000000000";
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.3.9",
6
+ "version": "0.3.11",
7
7
  "description": "Simple and easy interface between EAS and Karma GAP.",
8
8
  "main": "./index.js",
9
9
  "author": "KarmaHQ",