@show-karma/karma-gap-sdk 0.4.21 → 0.4.23

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/class/GAP.js CHANGED
@@ -233,6 +233,10 @@ class GAP extends types_1.Facade {
233
233
  const currentChainId = chainId ||
234
234
  Number((await signer.provider.getNetwork())?.chainId ||
235
235
  (await signer.getChainId()));
236
+ if (chainId && !rpcConfig) {
237
+ throw new Error(`rpcConfig is required when specifying chainId for cross-chain operations. ` +
238
+ `Either provide rpcConfig or omit chainId to use the signer's chain.`);
239
+ }
236
240
  const provider = chainId && rpcConfig
237
241
  ? (0, get_web3_provider_1.getWeb3Provider)(chainId, rpcConfig)
238
242
  : signer;
@@ -254,6 +258,10 @@ class GAP extends types_1.Facade {
254
258
  const currentChainId = chainId ||
255
259
  Number((await signer.provider.getNetwork())?.chainId ||
256
260
  (await signer.getChainId()));
261
+ if (chainId && !rpcConfig) {
262
+ throw new Error(`rpcConfig is required when specifying chainId for cross-chain operations. ` +
263
+ `Either provide rpcConfig or omit chainId to use the signer's chain.`);
264
+ }
257
265
  const provider = chainId && rpcConfig
258
266
  ? (0, get_web3_provider_1.getWeb3Provider)(chainId, rpcConfig)
259
267
  : signer;
@@ -67,10 +67,10 @@ class Project extends Attestation_1.Attestation {
67
67
  return { tx: txArray, uids: [this.uid] };
68
68
  }
69
69
  isOwner(signer, publicAddress) {
70
- return GapContract_1.GapContract.isProjectOwner(signer, this.uid, this.chainID, publicAddress);
70
+ return GapContract_1.GapContract.isProjectOwner(signer, this.uid, this.chainID, publicAddress, this.schema.gap.rpcConfig);
71
71
  }
72
72
  isAdmin(signer, publicAddress) {
73
- return GapContract_1.GapContract.isProjectAdmin(signer, this.uid, this.chainID, publicAddress);
73
+ return GapContract_1.GapContract.isProjectAdmin(signer, this.uid, this.chainID, publicAddress, this.schema.gap.rpcConfig);
74
74
  }
75
75
  /**
76
76
  * Add new members to the project.
@@ -2,72 +2,72 @@ import { AxiosGQL } from "../../GraphQL/AxiosGQL";
2
2
  import { Hex, IAttestationResponse, ICommunityResponse, ICommunityAdminsResponse, IGrantResponse, IProjectResponse, ISearchResponse, IProjectMilestoneResponse, ITrackResponse, ITrackAssignmentResponse, IProjectTrackResponse } from "./types";
3
3
  export declare class GapIndexerApi extends AxiosGQL {
4
4
  constructor(url: string);
5
- attestation(uid: Hex): Promise<import("axios").AxiosResponse<IAttestationResponse, any, {}>>;
6
- attestations(schemaUID: string, search?: string): Promise<import("axios").AxiosResponse<IAttestationResponse[], any, {}>>;
7
- attestationsOf(schemaUID: string, attester: Hex): Promise<import("axios").AxiosResponse<IAttestationResponse[], any, {}>>;
5
+ attestation(uid: Hex): Promise<import("axios").AxiosResponse<IAttestationResponse, any>>;
6
+ attestations(schemaUID: string, search?: string): Promise<import("axios").AxiosResponse<IAttestationResponse[], any>>;
7
+ attestationsOf(schemaUID: string, attester: Hex): Promise<import("axios").AxiosResponse<IAttestationResponse[], any>>;
8
8
  /**
9
9
  * Community
10
10
  */
11
- communities(search?: string): Promise<import("axios").AxiosResponse<ICommunityResponse[], any, {}>>;
12
- communitiesOf(address: Hex, withGrants: boolean): Promise<import("axios").AxiosResponse<ICommunityResponse[], any, {}>>;
13
- adminOf(address: Hex): Promise<import("axios").AxiosResponse<ICommunityResponse[], any, {}>>;
14
- communityBySlug(slug: string): Promise<import("axios").AxiosResponse<ICommunityResponse, any, {}>>;
15
- communityAdmins(uid: Hex): Promise<import("axios").AxiosResponse<ICommunityAdminsResponse, any, {}>>;
11
+ communities(search?: string): Promise<import("axios").AxiosResponse<ICommunityResponse[], any>>;
12
+ communitiesOf(address: Hex, withGrants: boolean): Promise<import("axios").AxiosResponse<ICommunityResponse[], any>>;
13
+ adminOf(address: Hex): Promise<import("axios").AxiosResponse<ICommunityResponse[], any>>;
14
+ communityBySlug(slug: string): Promise<import("axios").AxiosResponse<ICommunityResponse, any>>;
15
+ communityAdmins(uid: Hex): Promise<import("axios").AxiosResponse<ICommunityAdminsResponse, any>>;
16
16
  /**
17
17
  * Project
18
18
  */
19
- projectBySlug(slug: string): Promise<import("axios").AxiosResponse<IProjectResponse, any, {}>>;
20
- search(query: string): Promise<import("axios").AxiosResponse<ISearchResponse, any, {}>>;
21
- searchProjects(query: string): Promise<import("axios").AxiosResponse<IProjectResponse[], any, {}>>;
22
- projects(name?: string): Promise<import("axios").AxiosResponse<IProjectResponse[], any, {}>>;
23
- projectsOf(grantee: Hex): Promise<import("axios").AxiosResponse<IProjectResponse[], any, {}>>;
24
- projectMilestones(uidOrSlug: string): Promise<import("axios").AxiosResponse<IProjectMilestoneResponse[], any, {}>>;
19
+ projectBySlug(slug: string): Promise<import("axios").AxiosResponse<IProjectResponse, any>>;
20
+ search(query: string): Promise<import("axios").AxiosResponse<ISearchResponse, any>>;
21
+ searchProjects(query: string): Promise<import("axios").AxiosResponse<IProjectResponse[], any>>;
22
+ projects(name?: string): Promise<import("axios").AxiosResponse<IProjectResponse[], any>>;
23
+ projectsOf(grantee: Hex): Promise<import("axios").AxiosResponse<IProjectResponse[], any>>;
24
+ projectMilestones(uidOrSlug: string): Promise<import("axios").AxiosResponse<IProjectMilestoneResponse[], any>>;
25
25
  /**
26
26
  * Grantee
27
27
  */
28
- grantee(address: Hex): Promise<import("axios").AxiosResponse<any, any, {}>>;
28
+ grantee(address: Hex): Promise<import("axios").AxiosResponse<any, any>>;
29
29
  grantees(): Promise<import("axios").AxiosResponse<{
30
30
  [key: `0x${string}`]: {
31
31
  grants: number;
32
32
  projects: number;
33
33
  };
34
- }, any, {}>>;
34
+ }, any>>;
35
35
  /**
36
36
  * Grant
37
37
  */
38
- grantsOf(grantee: Hex, withCommunity?: boolean): Promise<import("axios").AxiosResponse<IGrantResponse[], any, {}>>;
39
- grantsFor(uid: string, withCommunity?: boolean): Promise<import("axios").AxiosResponse<IGrantResponse[], any, {}>>;
40
- grantsForExtProject(projectExtId: string): Promise<import("axios").AxiosResponse<IGrantResponse[], any, {}>>;
41
- grantBySlug(slug: Hex): Promise<import("axios").AxiosResponse<IGrantResponse, any, {}>>;
38
+ grantsOf(grantee: Hex, withCommunity?: boolean): Promise<import("axios").AxiosResponse<IGrantResponse[], any>>;
39
+ grantsFor(uid: string, withCommunity?: boolean): Promise<import("axios").AxiosResponse<IGrantResponse[], any>>;
40
+ grantsForExtProject(projectExtId: string): Promise<import("axios").AxiosResponse<IGrantResponse[], any>>;
41
+ grantBySlug(slug: Hex): Promise<import("axios").AxiosResponse<IGrantResponse, any>>;
42
42
  grantsByCommunity(uid: Hex, page?: number, pageLimit?: number): Promise<import("axios").AxiosResponse<{
43
43
  data: IGrantResponse[];
44
- }, any, {}>>;
44
+ }, any>>;
45
45
  /**
46
46
  * Milestone
47
47
  */
48
- milestonesOf(uid: Hex): Promise<import("axios").AxiosResponse<any, any, {}>>;
48
+ milestonesOf(uid: Hex): Promise<import("axios").AxiosResponse<any, any>>;
49
49
  slugExists(slug: string): Promise<boolean>;
50
50
  /**
51
51
  * Tracks
52
52
  */
53
- getTracks(communityUID: string, includeArchived?: boolean): Promise<import("axios").AxiosResponse<ITrackResponse[], any, {}>>;
54
- getTrackById(id: string): Promise<import("axios").AxiosResponse<ITrackResponse, any, {}>>;
53
+ getTracks(communityUID: string, includeArchived?: boolean): Promise<import("axios").AxiosResponse<ITrackResponse[], any>>;
54
+ getTrackById(id: string): Promise<import("axios").AxiosResponse<ITrackResponse, any>>;
55
55
  createTrack(data: {
56
56
  name: string;
57
57
  description?: string;
58
58
  communityUID: string;
59
- }): Promise<import("axios").AxiosResponse<ITrackResponse, any, {}>>;
59
+ }): Promise<import("axios").AxiosResponse<ITrackResponse, any>>;
60
60
  updateTrack(id: string, data: {
61
61
  name?: string;
62
62
  description?: string;
63
63
  communityUID?: string;
64
- }): Promise<import("axios").AxiosResponse<ITrackResponse, any, {}>>;
65
- archiveTrack(id: string): Promise<import("axios").AxiosResponse<ITrackResponse, any, {}>>;
66
- assignTracksToProgram(programId: string, trackIds: string[]): Promise<import("axios").AxiosResponse<ITrackAssignmentResponse[], any, {}>>;
67
- unassignTrackFromProgram(programId: string, trackId: string): Promise<import("axios").AxiosResponse<ITrackAssignmentResponse, any, {}>>;
68
- getTracksForProgram(programId: string): Promise<import("axios").AxiosResponse<ITrackResponse[], any, {}>>;
69
- getTracksForProject(projectId: string, programId: string, activeOnly?: boolean): Promise<import("axios").AxiosResponse<ITrackResponse[], any, {}>>;
70
- assignTracksToProject(projectId: string, programId: string, trackIds: string[]): Promise<import("axios").AxiosResponse<any[], any, {}>>;
71
- unassignTracksFromProject(projectId: string, programId: string, trackIds: string[]): Promise<import("axios").AxiosResponse<any[], any, {}>>;
72
- getProjectsByTrack(communityId: string, programId: string, trackId?: string): Promise<import("axios").AxiosResponse<IProjectTrackResponse[], any, {}>>;
64
+ }): Promise<import("axios").AxiosResponse<ITrackResponse, any>>;
65
+ archiveTrack(id: string): Promise<import("axios").AxiosResponse<ITrackResponse, any>>;
66
+ assignTracksToProgram(programId: string, trackIds: string[]): Promise<import("axios").AxiosResponse<ITrackAssignmentResponse[], any>>;
67
+ unassignTrackFromProgram(programId: string, trackId: string): Promise<import("axios").AxiosResponse<ITrackAssignmentResponse, any>>;
68
+ getTracksForProgram(programId: string): Promise<import("axios").AxiosResponse<ITrackResponse[], any>>;
69
+ getTracksForProject(projectId: string, programId: string, activeOnly?: boolean): Promise<import("axios").AxiosResponse<ITrackResponse[], any>>;
70
+ assignTracksToProject(projectId: string, programId: string, trackIds: string[]): Promise<import("axios").AxiosResponse<any[], any>>;
71
+ unassignTracksFromProject(projectId: string, programId: string, trackIds: string[]): Promise<import("axios").AxiosResponse<any[], any>>;
72
+ getProjectsByTrack(communityId: string, programId: string, trackId?: string): Promise<import("axios").AxiosResponse<IProjectTrackResponse[], any>>;
73
73
  }
package/core/consts.js CHANGED
@@ -435,16 +435,43 @@ exports.Networks = {
435
435
  Community: "0x3c2231024f4f17f3718b5bd9ed9ff29cc323dea5449f9ceba11a9888bfbdd0e1",
436
436
  Details: "0x9895e82115987d8e3e02b35ced92e6a0509293890333f58f50ec291b34853dac",
437
437
  Grant: "0x7afa603a89cee2d8f93d30007e2c64efddc6509fd76aa95d2ccd97b6e34acc71",
438
- GrantVerified: "0xf45fdf2c064073f0623416571c2746085d785cde5a57fd0696ff88bdf78bcbdc",
438
+ GrantVerified: "0x837ae97827bdec74d0c8d755331634f730bb8ad00702099e9a6a2bbe193b1511",
439
439
  MemberOf: "0xb4186a2401f40a4c78768941ef9140e1fbe5fe595053a65d44f31d6df180b712",
440
- MilestoneApproved: "0xf45fdf2c064073f0623416571c2746085d785cde5a57fd0696ff88bdf78bcbdc",
441
- MilestoneCompleted: "0xf45fdf2c064073f0623416571c2746085d785cde5a57fd0696ff88bdf78bcbdc",
442
- GrantUpdateStatus: "0xf45fdf2c064073f0623416571c2746085d785cde5a57fd0696ff88bdf78bcbdc",
440
+ MilestoneApproved: "0x837ae97827bdec74d0c8d755331634f730bb8ad00702099e9a6a2bbe193b1511",
441
+ MilestoneCompleted: "0x837ae97827bdec74d0c8d755331634f730bb8ad00702099e9a6a2bbe193b1511",
442
+ GrantUpdateStatus: "0x837ae97827bdec74d0c8d755331634f730bb8ad00702099e9a6a2bbe193b1511",
443
443
  Project: "0x672fbaa8a1fb6e1f73a89c84a8e97a808da0750003a9d1d18aba3d39fa165945",
444
- ProjectUpdateStatus: "0xf45fdf2c064073f0623416571c2746085d785cde5a57fd0696ff88bdf78bcbdc",
445
- ProjectMilestoneStatus: "0xf45fdf2c064073f0623416571c2746085d785cde5a57fd0696ff88bdf78bcbdc",
444
+ ProjectUpdateStatus: "0x837ae97827bdec74d0c8d755331634f730bb8ad00702099e9a6a2bbe193b1511",
445
+ ProjectMilestoneStatus: "0x837ae97827bdec74d0c8d755331634f730bb8ad00702099e9a6a2bbe193b1511",
446
446
  ContributorProfile: null
447
447
  },
448
+ oldSchemas: [
449
+ {
450
+ name: "GrantVerified",
451
+ uid: "0xf45fdf2c064073f0623416571c2746085d785cde5a57fd0696ff88bdf78bcbdc",
452
+ raw: oldStatusSchema
453
+ },
454
+ {
455
+ name: "MilestoneApproved",
456
+ uid: "0xf45fdf2c064073f0623416571c2746085d785cde5a57fd0696ff88bdf78bcbdc",
457
+ raw: oldStatusSchema
458
+ },
459
+ {
460
+ name: "MilestoneCompleted",
461
+ uid: "0xf45fdf2c064073f0623416571c2746085d785cde5a57fd0696ff88bdf78bcbdc",
462
+ raw: oldStatusSchema
463
+ },
464
+ {
465
+ name: "GrantUpdateStatus",
466
+ uid: "0xf45fdf2c064073f0623416571c2746085d785cde5a57fd0696ff88bdf78bcbdc",
467
+ raw: oldStatusSchema
468
+ },
469
+ {
470
+ name: "ProjectUpdateStatus",
471
+ uid: "0xf45fdf2c064073f0623416571c2746085d785cde5a57fd0696ff88bdf78bcbdc",
472
+ raw: oldStatusSchema
473
+ },
474
+ ]
448
475
  },
449
476
  "base": {
450
477
  chainId: 8453,
@@ -462,16 +489,43 @@ exports.Networks = {
462
489
  Community: "0x721c17b065dccc5c916e0c2708d0ef50f1810591b76d0402ff6fe5accbd8488f",
463
490
  Details: "0x70a3f615f738fc6a4f56100692ada93d947c028b840940d97af7e7d6f0fa0577",
464
491
  Grant: "0x12837231f48acbca4e1e7f4416f684f3353bd4d71d4f03a09d29e5ffa6f21a50",
465
- GrantVerified: "0xb7eab95609c821624edc3c3a5a6c787bdc9da6c91393a967fb22b0e274c619dd",
492
+ GrantVerified: "0x535417d864b95c33fc0289082617b4004737a12c276ee27effd9f54491942934",
466
493
  MemberOf: "0x7fbb8a65924d8ad2ae12356e04b1418043e8361ba3b1b6c917de2e23df3ec81c",
467
- MilestoneApproved: "0xb7eab95609c821624edc3c3a5a6c787bdc9da6c91393a967fb22b0e274c619dd",
468
- MilestoneCompleted: "0xb7eab95609c821624edc3c3a5a6c787bdc9da6c91393a967fb22b0e274c619dd",
469
- GrantUpdateStatus: "0xb7eab95609c821624edc3c3a5a6c787bdc9da6c91393a967fb22b0e274c619dd",
494
+ MilestoneApproved: "0x535417d864b95c33fc0289082617b4004737a12c276ee27effd9f54491942934",
495
+ MilestoneCompleted: "0x535417d864b95c33fc0289082617b4004737a12c276ee27effd9f54491942934",
496
+ GrantUpdateStatus: "0x535417d864b95c33fc0289082617b4004737a12c276ee27effd9f54491942934",
470
497
  Project: "0x5a6b36ac106c74541efad39f8430751dd843bb78729bf7ffc296eca4cbb8d8f3",
471
- ProjectUpdateStatus: "0xb7eab95609c821624edc3c3a5a6c787bdc9da6c91393a967fb22b0e274c619dd",
472
- ProjectMilestoneStatus: "0xb7eab95609c821624edc3c3a5a6c787bdc9da6c91393a967fb22b0e274c619dd",
498
+ ProjectUpdateStatus: "0x535417d864b95c33fc0289082617b4004737a12c276ee27effd9f54491942934",
499
+ ProjectMilestoneStatus: "0x535417d864b95c33fc0289082617b4004737a12c276ee27effd9f54491942934",
473
500
  ContributorProfile: "0xdfb8ad353dd144235bd45ae38803db6ffe066081770370f603709b9dec9ba8ff"
474
501
  },
502
+ oldSchemas: [
503
+ {
504
+ name: "GrantVerified",
505
+ uid: "0xb7eab95609c821624edc3c3a5a6c787bdc9da6c91393a967fb22b0e274c619dd",
506
+ raw: oldStatusSchema
507
+ },
508
+ {
509
+ name: "MilestoneApproved",
510
+ uid: "0xb7eab95609c821624edc3c3a5a6c787bdc9da6c91393a967fb22b0e274c619dd",
511
+ raw: oldStatusSchema
512
+ },
513
+ {
514
+ name: "MilestoneCompleted",
515
+ uid: "0xb7eab95609c821624edc3c3a5a6c787bdc9da6c91393a967fb22b0e274c619dd",
516
+ raw: oldStatusSchema
517
+ },
518
+ {
519
+ name: "GrantUpdateStatus",
520
+ uid: "0xb7eab95609c821624edc3c3a5a6c787bdc9da6c91393a967fb22b0e274c619dd",
521
+ raw: oldStatusSchema
522
+ },
523
+ {
524
+ name: "ProjectUpdateStatus",
525
+ uid: "0xb7eab95609c821624edc3c3a5a6c787bdc9da6c91393a967fb22b0e274c619dd",
526
+ raw: oldStatusSchema
527
+ },
528
+ ]
475
529
  },
476
530
  "polygon": {
477
531
  chainId: 137,
@@ -489,16 +543,43 @@ exports.Networks = {
489
543
  Community: "0x884bd33b1d7fce5c637e85aef538e83a8a87157d7df2d357e6cc8d4c59b89400",
490
544
  Details: "0x2038ec9d8d0ab60324065aa0b4961d3f93d725f1c71f67b9f1ef209114c75f7f",
491
545
  Grant: "0x2cedad5cda259c921f3380eedd5920be86a7dfe9496848cc8afc7f01159dfd65",
492
- GrantVerified: "0xe4b229d7051c27bb64cca0d29d92377143e6d5b9e076416e997c38d4cb40a399",
546
+ GrantVerified: "0xefa705f5baaf91745bb4706fa4aa55156c5d9c3cd6834fcc4912bcb51ad5bea3",
493
547
  MemberOf: "0x2cfa4adacb1efcd0ff408d749fd12bb36cd5f88aa0822f633962d4bd5c8023aa",
494
- MilestoneApproved: "0xe4b229d7051c27bb64cca0d29d92377143e6d5b9e076416e997c38d4cb40a399",
495
- MilestoneCompleted: "0xe4b229d7051c27bb64cca0d29d92377143e6d5b9e076416e997c38d4cb40a399",
496
- GrantUpdateStatus: "0xe4b229d7051c27bb64cca0d29d92377143e6d5b9e076416e997c38d4cb40a399",
548
+ MilestoneApproved: "0xefa705f5baaf91745bb4706fa4aa55156c5d9c3cd6834fcc4912bcb51ad5bea3",
549
+ MilestoneCompleted: "0xefa705f5baaf91745bb4706fa4aa55156c5d9c3cd6834fcc4912bcb51ad5bea3",
550
+ GrantUpdateStatus: "0xefa705f5baaf91745bb4706fa4aa55156c5d9c3cd6834fcc4912bcb51ad5bea3",
497
551
  Project: "0x7f0e4ac5f7cbe2a39af317b46bad7e86b053f76109c364d197447d9da34e821a",
498
- ProjectUpdateStatus: "0xe4b229d7051c27bb64cca0d29d92377143e6d5b9e076416e997c38d4cb40a399",
499
- ProjectMilestoneStatus: "0xe4b229d7051c27bb64cca0d29d92377143e6d5b9e076416e997c38d4cb40a399",
552
+ ProjectUpdateStatus: "0xefa705f5baaf91745bb4706fa4aa55156c5d9c3cd6834fcc4912bcb51ad5bea3",
553
+ ProjectMilestoneStatus: "0xefa705f5baaf91745bb4706fa4aa55156c5d9c3cd6834fcc4912bcb51ad5bea3",
500
554
  ContributorProfile: "0x281f0afbb0313c6ff851400c4ed317fe9741be75e7e20c337dfd403059523bea"
501
555
  },
556
+ oldSchemas: [
557
+ {
558
+ name: "GrantVerified",
559
+ uid: "0xe4b229d7051c27bb64cca0d29d92377143e6d5b9e076416e997c38d4cb40a399",
560
+ raw: oldStatusSchema
561
+ },
562
+ {
563
+ name: "MilestoneApproved",
564
+ uid: "0xe4b229d7051c27bb64cca0d29d92377143e6d5b9e076416e997c38d4cb40a399",
565
+ raw: oldStatusSchema
566
+ },
567
+ {
568
+ name: "MilestoneCompleted",
569
+ uid: "0xe4b229d7051c27bb64cca0d29d92377143e6d5b9e076416e997c38d4cb40a399",
570
+ raw: oldStatusSchema
571
+ },
572
+ {
573
+ name: "GrantUpdateStatus",
574
+ uid: "0xe4b229d7051c27bb64cca0d29d92377143e6d5b9e076416e997c38d4cb40a399",
575
+ raw: oldStatusSchema
576
+ },
577
+ {
578
+ name: "ProjectUpdateStatus",
579
+ uid: "0xe4b229d7051c27bb64cca0d29d92377143e6d5b9e076416e997c38d4cb40a399",
580
+ raw: oldStatusSchema
581
+ },
582
+ ]
502
583
  },
503
584
  };
504
585
  const DetailsSchema = [{ type: "string", name: "json", value: null }];
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.4.21",
6
+ "version": "0.4.23",
7
7
  "description": "Simple and easy interface between EAS and Karma GAP.",
8
8
  "main": "./index.js",
9
9
  "author": "KarmaHQ",