@show-karma/karma-gap-sdk 0.3.30 → 0.3.31
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.
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ethers } from "ethers";
|
|
2
|
-
import { GrantArgs } from "../types/allo";
|
|
3
2
|
import { NFTStorage } from "nft.storage";
|
|
4
3
|
export declare class AlloBase {
|
|
5
4
|
private signer;
|
|
@@ -9,8 +8,9 @@ export declare class AlloBase {
|
|
|
9
8
|
constructor(signer: ethers.Signer, ipfsStorage: NFTStorage, chainId: number);
|
|
10
9
|
saveAndGetCID(data: any): Promise<import("nft.storage").CIDString>;
|
|
11
10
|
encodeStrategyInitData(applicationStart: number, applicationEnd: number, roundStart: number, roundEnd: number, payoutToken: string): Promise<string>;
|
|
12
|
-
createGrant(args:
|
|
11
|
+
createGrant(args: any): Promise<{
|
|
13
12
|
poolId: string;
|
|
14
13
|
txHash: string;
|
|
15
14
|
}>;
|
|
15
|
+
updatePoolMetadata(poolId: string, poolMetadata: any): Promise<any>;
|
|
16
16
|
}
|
|
@@ -82,5 +82,20 @@ class AlloBase {
|
|
|
82
82
|
console.error(`Failed to create pool: ${error}`);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
+
async updatePoolMetadata(poolId, poolMetadata) {
|
|
86
|
+
try {
|
|
87
|
+
const metadata_cid = await this.saveAndGetCID(poolMetadata);
|
|
88
|
+
const metadata = {
|
|
89
|
+
protocol: 1,
|
|
90
|
+
pointer: metadata_cid,
|
|
91
|
+
};
|
|
92
|
+
const tx = await this.contract.updatePoolMetadata(poolId, metadata);
|
|
93
|
+
const receipt = await tx.wait();
|
|
94
|
+
return receipt;
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
console.error(`Failed to update pool metadata: ${error}`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
85
100
|
}
|
|
86
101
|
exports.AlloBase = AlloBase;
|
package/core/consts.js
CHANGED
|
@@ -13,12 +13,12 @@ exports.useDefaultAttestation = [
|
|
|
13
13
|
"GrantUpdateStatus",
|
|
14
14
|
];
|
|
15
15
|
exports.chainIdToNetwork = {
|
|
16
|
-
11155420:
|
|
17
|
-
42161:
|
|
18
|
-
10:
|
|
19
|
-
11155111:
|
|
20
|
-
84532:
|
|
21
|
-
42220:
|
|
16
|
+
11155420: "optimism-sepolia",
|
|
17
|
+
42161: "arbitrum",
|
|
18
|
+
10: "optimism",
|
|
19
|
+
11155111: "sepolia",
|
|
20
|
+
84532: "base-sepolia",
|
|
21
|
+
42220: "celo",
|
|
22
22
|
};
|
|
23
23
|
exports.nullRef = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
24
24
|
// TODO: Remove null resolver and change usage to zero address
|
|
@@ -39,6 +39,7 @@ exports.Networks = {
|
|
|
39
39
|
multicall: "0xd2eD366393FDfd243931Fe48e9fb65A192B0018c", //proxy,
|
|
40
40
|
projectResolver: "0x7177AdC0f924b695C0294A40C4C5FEFf5EE1E141",
|
|
41
41
|
communityResolver: "0x6dC1D6b864e8BEf815806f9e4677123496e12026",
|
|
42
|
+
donations: "0x021896771412C1D3f31BC7B01fFA3a6A17c5dA30",
|
|
42
43
|
},
|
|
43
44
|
schemas: {
|
|
44
45
|
Community: "0x721c17b065dccc5c916e0c2708d0ef50f1810591b76d0402ff6fe5accbd8488f",
|
|
@@ -62,6 +63,7 @@ exports.Networks = {
|
|
|
62
63
|
multicall: "0xC891F8eBA218f5034bf3a472528408BE19E1130E",
|
|
63
64
|
projectResolver: "0x832931F23ea4e3c70957DA71a7eB50F5B7efA93D",
|
|
64
65
|
schema: "0x4200000000000000000000000000000000000020",
|
|
66
|
+
donations: "0x3caF83Ed040501f1f439fb22E198bB5a67Bc2884",
|
|
65
67
|
},
|
|
66
68
|
schemas: {
|
|
67
69
|
Community: "0x314bb1c3c9b5311c1b813a3ad123b6ac5a03902b987795056dd2e4ff38e833ea",
|
|
@@ -85,6 +87,7 @@ exports.Networks = {
|
|
|
85
87
|
multicall: "0x6dC1D6b864e8BEf815806f9e4677123496e12026", //proxy,
|
|
86
88
|
projectResolver: "0x28BE0b0515be8BB8822aF1467A6613795E74717b",
|
|
87
89
|
communityResolver: "0xD534C4704F82494aBbc901560046fB62Ac63E9C4",
|
|
90
|
+
donations: "0x475F3E915601d975c792E6116791FBe9ACdBE902",
|
|
88
91
|
},
|
|
89
92
|
schemas: {
|
|
90
93
|
Community: "0xc604f0661cfd522583835ed2b2c644b80e068139d287f93c7f1680888894bacc",
|
|
@@ -108,6 +111,7 @@ exports.Networks = {
|
|
|
108
111
|
multicall: "0xec8d7BFe344790FD860920C41B46B259c005727A",
|
|
109
112
|
projectResolver: "0x099787D5a5aC92779A519CfD925ACB0Dc7E8bd23",
|
|
110
113
|
communityResolver: "0xa9E55D9F52d7B47792d2Db15F6A9674c56ccc5C9",
|
|
114
|
+
donations: "0xb2021F7550b8B07cA71696159B592C1F713593e4",
|
|
111
115
|
},
|
|
112
116
|
schemas: {
|
|
113
117
|
Community: "0xf3d790c7fdab6c1b1f25ffcc9289e5be2792eb596d2851a4d059c8aae1bc8b2e", //test with resolver
|
|
@@ -132,6 +136,7 @@ exports.Networks = {
|
|
|
132
136
|
multicall: "0x4Ca7230fB6b78875bdd1B1e4F665B7B7f1891239",
|
|
133
137
|
projectResolver: "0xC891F8eBA218f5034bf3a472528408BE19E1130E",
|
|
134
138
|
communityResolver: "0x009dC7dF3Ea3b23CE80Fd3Ba811d5bA5675934A1",
|
|
139
|
+
donations: "0x61eD6D070EE996698fB35B909e45111402336645",
|
|
135
140
|
},
|
|
136
141
|
schemas: {
|
|
137
142
|
Community: "0xe130107659909d20cbd75a2c82e1988b09b1c08fd39ad6f4397ce27c089e0e95",
|
|
@@ -145,7 +150,7 @@ exports.Networks = {
|
|
|
145
150
|
Project: "0x5ddd6b7a11406771308431ca9bd146cc717848b74b52993a532dc1aad0ccc83f",
|
|
146
151
|
},
|
|
147
152
|
},
|
|
148
|
-
|
|
153
|
+
celo: {
|
|
149
154
|
chainId: 42220,
|
|
150
155
|
url: "https://celo.easscan.org/graphql",
|
|
151
156
|
rpcUrl: "https://forno.celo.org",
|
|
@@ -155,6 +160,7 @@ exports.Networks = {
|
|
|
155
160
|
multicall: "0x8791Ac8c099314bB1D1514D76de13a1E80275950",
|
|
156
161
|
projectResolver: "0x6dC1D6b864e8BEf815806f9e4677123496e12026",
|
|
157
162
|
communityResolver: "0xfddb660F2F1C27d219372210745BB9f73431856E",
|
|
163
|
+
donations: "0xf373467c21841DF20529FAA8bE49381106DBc258",
|
|
158
164
|
},
|
|
159
165
|
schemas: {
|
|
160
166
|
Community: "0x3c2231024f4f17f3718b5bd9ed9ff29cc323dea5449f9ceba11a9888bfbdd0e1",
|
|
@@ -167,7 +173,7 @@ exports.Networks = {
|
|
|
167
173
|
GrantUpdateStatus: "0xf45fdf2c064073f0623416571c2746085d785cde5a57fd0696ff88bdf78bcbdc",
|
|
168
174
|
Project: "0xf3f753b41e04d1052b5a5ec7624d1dfdb6c2da288a985120e477ddbcac071022",
|
|
169
175
|
},
|
|
170
|
-
}
|
|
176
|
+
},
|
|
171
177
|
};
|
|
172
178
|
const DetailsSchema = [{ type: "string", name: "json", value: null }];
|
|
173
179
|
/**
|
package/core/types.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export interface AttestArgs<T = unknown> {
|
|
|
25
25
|
export type TSchemaName = "Community" | "CommunityDetails" | "Grant" | "GrantDetails" | "GrantVerified" | "MemberOf" | "MemberDetails" | "Milestone" | "MilestoneCompleted" | "MilestoneApproved" | "Project" | "ProjectDetails" | "Details" | "ProjectImpact" | "GrantUpdate" | "GrantUpdateStatus" | "ProjectEndorsement";
|
|
26
26
|
export type TResolvedSchemaNames = "Community" | "Grant" | "GrantVerified" | "MemberOf" | "MilestoneCompleted" | "MilestoneApproved" | "Project" | "Details" | "GrantUpdateStatus";
|
|
27
27
|
export type TExternalLink = "twitter" | "github" | "website" | "linkedin" | "discord";
|
|
28
|
-
export type TNetwork = "optimism" |
|
|
28
|
+
export type TNetwork = "optimism" | "celo" | "optimism-sepolia" | "arbitrum" | "sepolia" | "base-sepolia";
|
|
29
29
|
/**
|
|
30
30
|
* Generic GAP Facade interface.
|
|
31
31
|
* This supplies the GAP class with the necessary properties.
|
|
@@ -64,6 +64,7 @@ export interface EASNetworkConfig {
|
|
|
64
64
|
multicall: Hex;
|
|
65
65
|
projectResolver: Hex;
|
|
66
66
|
communityResolver: Hex;
|
|
67
|
+
donations: Hex;
|
|
67
68
|
};
|
|
68
69
|
/**
|
|
69
70
|
* A tuple containing the schema name and it's UID for that network
|