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

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, // 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
42
+ false,
43
+ true,
44
+ applicationStart,
45
+ applicationEnd,
46
+ roundStart,
47
+ roundEnd,
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, // unique to the strategy
69
+ initStrategyData: initStrategyData,
70
70
  token: args.payoutToken,
71
71
  amount: BigInt(args.matchingFundAmt),
72
72
  metadata: metadata,
@@ -485,4 +485,6 @@ Schema.schemas = {
485
485
  "base-sepolia": [],
486
486
  lisk: [],
487
487
  scroll: [],
488
+ base: [],
489
+ polygon: [],
488
490
  };
package/core/consts.d.ts CHANGED
@@ -15,6 +15,8 @@ export declare const chainIdToNetwork: {
15
15
  1329: string;
16
16
  1135: string;
17
17
  534352: string;
18
+ 8453: string;
19
+ 137: string;
18
20
  };
19
21
  export declare const nullRef = "0x0000000000000000000000000000000000000000000000000000000000000000";
20
22
  export declare const nullResolver = "0x0000000000000000000000000000000000000000";
package/core/consts.js CHANGED
@@ -28,6 +28,8 @@ exports.chainIdToNetwork = {
28
28
  1329: "sei",
29
29
  1135: "lisk",
30
30
  534352: "scroll",
31
+ 8453: "base",
32
+ 137: "polygon"
31
33
  };
32
34
  exports.nullRef = "0x0000000000000000000000000000000000000000000000000000000000000000";
33
35
  // TODO: Remove null resolver and change usage to zero address
@@ -45,7 +47,7 @@ exports.Networks = {
45
47
  contracts: {
46
48
  eas: "0x4200000000000000000000000000000000000021",
47
49
  schema: "0x4200000000000000000000000000000000000020",
48
- multicall: "0xd2eD366393FDfd243931Fe48e9fb65A192B0018c", //proxy,
50
+ multicall: "0xd2eD366393FDfd243931Fe48e9fb65A192B0018c",
49
51
  projectResolver: "0x7177AdC0f924b695C0294A40C4C5FEFf5EE1E141",
50
52
  communityResolver: "0x6dC1D6b864e8BEf815806f9e4677123496e12026",
51
53
  donations: "0x021896771412C1D3f31BC7B01fFA3a6A17c5dA30",
@@ -155,7 +157,7 @@ exports.Networks = {
155
157
  contracts: {
156
158
  eas: "0xbD75f629A22Dc1ceD33dDA0b68c546A1c035c458",
157
159
  schema: "0xA310da9c5B885E7fb3fbA9D66E9Ba6Df512b78eB",
158
- multicall: "0x6dC1D6b864e8BEf815806f9e4677123496e12026", //proxy,
160
+ multicall: "0x6dC1D6b864e8BEf815806f9e4677123496e12026",
159
161
  projectResolver: "0x28BE0b0515be8BB8822aF1467A6613795E74717b",
160
162
  communityResolver: "0xD534C4704F82494aBbc901560046fB62Ac63E9C4",
161
163
  donations: "0x475F3E915601d975c792E6116791FBe9ACdBE902",
@@ -217,10 +219,10 @@ exports.Networks = {
217
219
  airdropNFT: "0x11f48e68Ff894D417956839263337a2989822703",
218
220
  },
219
221
  schemas: {
220
- Community: "0xf3d790c7fdab6c1b1f25ffcc9289e5be2792eb596d2851a4d059c8aae1bc8b2e", //test with resolver
222
+ Community: "0xf3d790c7fdab6c1b1f25ffcc9289e5be2792eb596d2851a4d059c8aae1bc8b2e",
221
223
  // "0x1954572e3fe21bf4334afdaf1358ed7098af1ed136e76dc93c2fdc25e83934c1", // original without resolver
222
224
  Details: "0x2c270e35bfcdc4d611f0e9d3d2ab6924ec6c673505abc22a1dd07e19b67211af",
223
- Grant: "0x09697aeeb3ae71de1cc19e388fd74264f11af5fba3016094764553ac341fdc72", // with communityUID/resolver
225
+ Grant: "0x09697aeeb3ae71de1cc19e388fd74264f11af5fba3016094764553ac341fdc72",
224
226
  GrantVerified: "0x0be8952e2dd74ffd63a02f4d55b20b603fe7a60130cb9d70de31feb9c52fdd37",
225
227
  MemberOf: "0xdd87b3500457931252424f4439365534ba72a367503a8805ff3482353fb90301",
226
228
  MilestoneApproved: "0xcdef0e492d2e7ad25d0b0fdb868f6dcd1f5e5c30e42fd5fa0debdc12f7618322",
@@ -405,7 +407,7 @@ exports.Networks = {
405
407
  contracts: {
406
408
  eas: "0x4200000000000000000000000000000000000021",
407
409
  schema: "0x4200000000000000000000000000000000000020",
408
- multicall: "0x28BE0b0515be8BB8822aF1467A6613795E74717b", //proxy,
410
+ multicall: "0x28BE0b0515be8BB8822aF1467A6613795E74717b",
409
411
  projectResolver: "0x6dC1D6b864e8BEf815806f9e4677123496e12026",
410
412
  communityResolver: "0xfddb660F2F1C27d219372210745BB9f73431856E",
411
413
  donations: "0x28BE0b0515be8BB8822aF1467A6613795E74717b",
@@ -433,7 +435,7 @@ exports.Networks = {
433
435
  contracts: {
434
436
  eas: "0xC47300428b6AD2c7D03BB76D05A176058b47E6B0",
435
437
  schema: "0xD2CDF46556543316e7D34e8eDc4624e2bB95e3B6",
436
- multicall: "0x8791Ac8c099314bB1D1514D76de13a1E80275950", //proxy,
438
+ multicall: "0x8791Ac8c099314bB1D1514D76de13a1E80275950",
437
439
  projectResolver: "0xAFaE7aA6118D75Fe7FDB3eF8c1623cAaF8C8a653",
438
440
  communityResolver: "0xfddb660F2F1C27d219372210745BB9f73431856E",
439
441
  donations: "0x8791Ac8c099314bB1D1514D76de13a1E80275950",
@@ -454,6 +456,62 @@ exports.Networks = {
454
456
  ContributorProfile: null
455
457
  },
456
458
  },
459
+ "base": {
460
+ chainId: 8453,
461
+ url: "https://base.easscan.org/graphql",
462
+ rpcUrl: "https://mainnet.base.org",
463
+ contracts: {
464
+ eas: "0x4200000000000000000000000000000000000021",
465
+ schema: "0x4200000000000000000000000000000000000020",
466
+ multicall: "0x7177AdC0f924b695C0294A40C4C5FEFf5EE1E141",
467
+ projectResolver: "0xd2eD366393FDfd243931Fe48e9fb65A192B0018c",
468
+ communityResolver: "0x6dC1D6b864e8BEf815806f9e4677123496e12026",
469
+ donations: "0x5f4A21e16b04f9944229DF6CD2724088e3457B0e",
470
+ airdropNFT: null,
471
+ },
472
+ schemas: {
473
+ Community: "0x721c17b065dccc5c916e0c2708d0ef50f1810591b76d0402ff6fe5accbd8488f",
474
+ Details: "0x70a3f615f738fc6a4f56100692ada93d947c028b840940d97af7e7d6f0fa0577",
475
+ Grant: "0x12837231f48acbca4e1e7f4416f684f3353bd4d71d4f03a09d29e5ffa6f21a50",
476
+ GrantVerified: "0xb7eab95609c821624edc3c3a5a6c787bdc9da6c91393a967fb22b0e274c619dd",
477
+ MemberOf: "0x7fbb8a65924d8ad2ae12356e04b1418043e8361ba3b1b6c917de2e23df3ec81c",
478
+ MilestoneApproved: "0xb7eab95609c821624edc3c3a5a6c787bdc9da6c91393a967fb22b0e274c619dd",
479
+ MilestoneCompleted: "0xb7eab95609c821624edc3c3a5a6c787bdc9da6c91393a967fb22b0e274c619dd",
480
+ GrantUpdateStatus: "0xb7eab95609c821624edc3c3a5a6c787bdc9da6c91393a967fb22b0e274c619dd",
481
+ Project: "0x5a6b36ac106c74541efad39f8430751dd843bb78729bf7ffc296eca4cbb8d8f3",
482
+ ProjectUpdateStatus: "0xb7eab95609c821624edc3c3a5a6c787bdc9da6c91393a967fb22b0e274c619dd",
483
+ ProjectMilestoneStatus: "0xb7eab95609c821624edc3c3a5a6c787bdc9da6c91393a967fb22b0e274c619dd",
484
+ ContributorProfile: "0xdfb8ad353dd144235bd45ae38803db6ffe066081770370f603709b9dec9ba8ff"
485
+ },
486
+ },
487
+ "polygon": {
488
+ chainId: 137,
489
+ url: "https://polygon.easscan.org/graphql",
490
+ rpcUrl: "https://polygon-rpc.com/",
491
+ contracts: {
492
+ eas: "0x5E634ef5355f45A855d02D66eCD687b1502AF790",
493
+ schema: "0x7876EEF51A891E737AF8ba5A5E0f0Fd29073D5a7",
494
+ multicall: "0x2B2a82637299F9614f4F4833C946cC7b749C6814",
495
+ projectResolver: "0xA37e6F58289F2c3e650b0cdF3Bb1000889e8d07C",
496
+ communityResolver: "0x710Add6c51327c44d9208aA0Aef2e7011D3678BF",
497
+ donations: "0x5f4A21e16b04f9944229DF6CD2724088e3457B0e",
498
+ airdropNFT: null,
499
+ },
500
+ schemas: {
501
+ Community: "0x884bd33b1d7fce5c637e85aef538e83a8a87157d7df2d357e6cc8d4c59b89400",
502
+ Details: "0x2038ec9d8d0ab60324065aa0b4961d3f93d725f1c71f67b9f1ef209114c75f7f",
503
+ Grant: "0x2cedad5cda259c921f3380eedd5920be86a7dfe9496848cc8afc7f01159dfd65",
504
+ GrantVerified: "0xe4b229d7051c27bb64cca0d29d92377143e6d5b9e076416e997c38d4cb40a399",
505
+ MemberOf: "0x2cfa4adacb1efcd0ff408d749fd12bb36cd5f88aa0822f633962d4bd5c8023aa",
506
+ MilestoneApproved: "0xe4b229d7051c27bb64cca0d29d92377143e6d5b9e076416e997c38d4cb40a399",
507
+ MilestoneCompleted: "0xe4b229d7051c27bb64cca0d29d92377143e6d5b9e076416e997c38d4cb40a399",
508
+ GrantUpdateStatus: "0xe4b229d7051c27bb64cca0d29d92377143e6d5b9e076416e997c38d4cb40a399",
509
+ Project: "0x7f0e4ac5f7cbe2a39af317b46bad7e86b053f76109c364d197447d9da34e821a",
510
+ ProjectUpdateStatus: "0xe4b229d7051c27bb64cca0d29d92377143e6d5b9e076416e997c38d4cb40a399",
511
+ ProjectMilestoneStatus: "0xe4b229d7051c27bb64cca0d29d92377143e6d5b9e076416e997c38d4cb40a399",
512
+ ContributorProfile: "0x281f0afbb0313c6ff851400c4ed317fe9741be75e7e20c337dfd403059523bea"
513
+ },
514
+ },
457
515
  };
458
516
  const DetailsSchema = [{ type: "string", name: "json", value: null }];
459
517
  /**
package/core/types.d.ts CHANGED
@@ -30,7 +30,7 @@ export interface AttestArgs<T = unknown> {
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
32
  export type TExternalLink = "twitter" | "github" | "website" | "linkedin" | "discord" | "pitchDeck" | "demoVideo" | "farcaster" | "custom";
33
- export type TNetwork = "optimism" | "celo" | "optimism-sepolia" | "arbitrum" | "sepolia" | "sei" | "sei-testnet" | "base-sepolia" | "lisk" | "scroll";
33
+ export type TNetwork = "optimism" | "celo" | "optimism-sepolia" | "arbitrum" | "sepolia" | "sei" | "sei-testnet" | "base-sepolia" | "lisk" | "scroll" | "base" | "polygon";
34
34
  /**
35
35
  * Generic GAP Facade interface.
36
36
  * This supplies the GAP class with the necessary properties.
@@ -3,8 +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.Gelato = void 0;
7
- exports.sendGelatoTxn = sendGelatoTxn;
6
+ exports.Gelato = exports.sendGelatoTxn = void 0;
8
7
  const axios_1 = __importDefault(require("axios"));
9
8
  const relay_sdk_1 = require("@gelatonetwork/relay-sdk");
10
9
  const watch_gelato_txn_1 = require("./watch-gelato-txn");
@@ -57,6 +56,7 @@ async function sendGelatoTxn(...params) {
57
56
  const { wait } = await sendByApiKey(...params);
58
57
  return wait();
59
58
  }
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}', // filled in the api
89
+ '{apiKey}',
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 = handler;
3
+ exports.handler = void 0;
4
4
  const send_gelato_txn_1 = require("./send-gelato-txn");
5
5
  const assertionObj = [
6
6
  {
@@ -57,3 +57,4 @@ 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 = watchGelatoTxn;
3
+ exports.watchGelatoTxn = void 0;
4
4
  const relay_sdk_1 = require("@gelatonetwork/relay-sdk");
5
5
  var TaskState;
6
6
  (function (TaskState) {
@@ -60,3 +60,4 @@ async function watchGelatoTxn(taskId, ttl = 500) {
60
60
  loop();
61
61
  });
62
62
  }
63
+ exports.watchGelatoTxn = watchGelatoTxn;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDate = getDate;
3
+ exports.getDate = void 0;
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 = getIPFSData;
6
+ exports.getIPFSData = void 0;
7
7
  const axios_1 = __importDefault(require("axios"));
8
8
  async function getIPFSData(cid) {
9
9
  try {
@@ -17,3 +17,4 @@ 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 = mapFilter;
3
+ exports.mapFilter = void 0;
4
4
  /**
5
5
  * Filters an array by its condition then maps it to the desired format.
6
6
  * @param arr
@@ -17,3 +17,4 @@ function mapFilter(arr, condition, mapTo) {
17
17
  }
18
18
  return newArray;
19
19
  }
20
+ exports.mapFilter = mapFilter;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.serializeWithBigint = serializeWithBigint;
3
+ exports.serializeWithBigint = void 0;
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 = toUnix;
3
+ exports.toUnix = void 0;
4
4
  function toUnix(value) {
5
5
  switch (typeof value) {
6
6
  case "number":
@@ -22,3 +22,4 @@ 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.17",
6
+ "version": "0.4.18",
7
7
  "description": "Simple and easy interface between EAS and Karma GAP.",
8
8
  "main": "./index.js",
9
9
  "author": "KarmaHQ",