@show-karma/karma-gap-sdk 0.3.34 → 0.3.36

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.
@@ -9,9 +9,9 @@ export declare class AlloBase {
9
9
  name: string;
10
10
  }): Promise<any>;
11
11
  encodeStrategyInitData(applicationStart: number, applicationEnd: number, roundStart: number, roundEnd: number, payoutToken: string): Promise<string>;
12
- createGrant(args: any): Promise<{
12
+ createGrant(args: any, callback?: Function): Promise<{
13
13
  poolId: string;
14
14
  txHash: string;
15
15
  }>;
16
- updatePoolMetadata(poolId: string, poolMetadata: any): Promise<any>;
16
+ updatePoolMetadata(poolId: string, poolMetadata: any, callback?: Function): Promise<any>;
17
17
  }
@@ -47,7 +47,7 @@ class AlloBase {
47
47
  ]);
48
48
  return initStrategyData;
49
49
  }
50
- async createGrant(args) {
50
+ async createGrant(args, callback) {
51
51
  console.log("Creating grant...");
52
52
  const walletBalance = await this.signer.provider.getBalance(await this.signer.getAddress());
53
53
  console.log("Wallet balance:", (0, ethers_1.formatEther)(walletBalance.toString()), " ETH");
@@ -70,13 +70,16 @@ class AlloBase {
70
70
  metadata: metadata,
71
71
  managers: args.managers,
72
72
  };
73
+ callback?.("preparing");
73
74
  const txData = this.allo.createPool(createPoolArgs);
74
75
  const tx = await this.signer.sendTransaction({
75
76
  data: txData.data,
76
77
  to: txData.to,
77
78
  value: BigInt(txData.value),
78
79
  });
80
+ callback?.("pending");
79
81
  const receipt = await tx.wait();
82
+ callback?.("confirmed");
80
83
  // Get ProfileCreated event
81
84
  const poolId = receipt.logs[receipt.logs.length - 1].topics[0];
82
85
  return {
@@ -88,15 +91,18 @@ class AlloBase {
88
91
  console.error(`Failed to create pool: ${error}`);
89
92
  }
90
93
  }
91
- async updatePoolMetadata(poolId, poolMetadata) {
94
+ async updatePoolMetadata(poolId, poolMetadata, callback) {
92
95
  try {
96
+ callback?.("preparing");
93
97
  const metadata_cid = await this.saveAndGetCID(poolMetadata);
94
98
  const metadata = {
95
99
  protocol: 1,
96
100
  pointer: metadata_cid,
97
101
  };
98
102
  const tx = await this.contract.updatePoolMetadata(poolId, metadata);
103
+ callback?.("pending");
99
104
  const receipt = await tx.wait();
105
+ callback?.("confirmed");
100
106
  return receipt;
101
107
  }
102
108
  catch (error) {
@@ -89,6 +89,10 @@ export declare class Tag extends Attestation<ITag> implements ITag {
89
89
  export interface IProjectDetails {
90
90
  title: string;
91
91
  description: string;
92
+ problem?: string;
93
+ solution?: string;
94
+ missionSummary?: string;
95
+ locationOfImpact?: string;
92
96
  imageURL: string;
93
97
  links?: ExternalLink;
94
98
  tags?: ITag[];
@@ -103,6 +107,10 @@ export interface IProjectDetails {
103
107
  export declare class ProjectDetails extends Attestation<IProjectDetails> implements IProjectDetails {
104
108
  title: string;
105
109
  description: string;
110
+ problem?: string;
111
+ solution?: string;
112
+ missionSummary?: string;
113
+ locationOfImpact?: string;
106
114
  imageURL: string;
107
115
  links: ExternalLink;
108
116
  tags: ITag[];
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.3.34",
6
+ "version": "0.3.36",
7
7
  "description": "Simple and easy interface between EAS and Karma GAP.",
8
8
  "main": "./index.js",
9
9
  "author": "KarmaHQ",