@show-karma/karma-gap-sdk 0.3.39 → 0.3.40
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/abi/AlloCaller.json +117 -0
- package/core/class/Attestation.js +5 -3
- package/core/class/Schema.js +7 -3
- package/core/consts.d.ts +2 -0
- package/core/consts.js +50 -0
- package/core/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"inputs": [
|
|
4
|
+
{
|
|
5
|
+
"internalType": "bytes32",
|
|
6
|
+
"name": "_profileId",
|
|
7
|
+
"type": "bytes32"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"internalType": "address",
|
|
11
|
+
"name": "_strategy",
|
|
12
|
+
"type": "address"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"internalType": "bytes",
|
|
16
|
+
"name": "_initStrategyData",
|
|
17
|
+
"type": "bytes"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"internalType": "address",
|
|
21
|
+
"name": "_token",
|
|
22
|
+
"type": "address"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"internalType": "uint256",
|
|
26
|
+
"name": "_amount",
|
|
27
|
+
"type": "uint256"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"components": [
|
|
31
|
+
{
|
|
32
|
+
"internalType": "uint256",
|
|
33
|
+
"name": "protocol",
|
|
34
|
+
"type": "uint256"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"internalType": "string",
|
|
38
|
+
"name": "pointer",
|
|
39
|
+
"type": "string"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"internalType": "struct IAllo.Metadata",
|
|
43
|
+
"name": "_metadata",
|
|
44
|
+
"type": "tuple"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"internalType": "address[]",
|
|
48
|
+
"name": "_managers",
|
|
49
|
+
"type": "address[]"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"name": "createPool",
|
|
53
|
+
"outputs": [
|
|
54
|
+
{
|
|
55
|
+
"internalType": "uint256",
|
|
56
|
+
"name": "poolId",
|
|
57
|
+
"type": "uint256"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"stateMutability": "payable",
|
|
61
|
+
"type": "function"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"inputs": [
|
|
65
|
+
{
|
|
66
|
+
"internalType": "uint256",
|
|
67
|
+
"name": "_poolId",
|
|
68
|
+
"type": "uint256"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"components": [
|
|
72
|
+
{
|
|
73
|
+
"internalType": "uint256",
|
|
74
|
+
"name": "protocol",
|
|
75
|
+
"type": "uint256"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"internalType": "string",
|
|
79
|
+
"name": "pointer",
|
|
80
|
+
"type": "string"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"internalType": "struct IAllo.Metadata",
|
|
84
|
+
"name": "_metadata",
|
|
85
|
+
"type": "tuple"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"name": "updatePoolMetadata",
|
|
89
|
+
"outputs": [],
|
|
90
|
+
"stateMutability": "nonpayable",
|
|
91
|
+
"type": "function"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"inputs": [
|
|
95
|
+
{
|
|
96
|
+
"internalType": "address",
|
|
97
|
+
"name": "_alloAddress",
|
|
98
|
+
"type": "address"
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"stateMutability": "nonpayable",
|
|
102
|
+
"type": "constructor"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"inputs": [],
|
|
106
|
+
"name": "allo",
|
|
107
|
+
"outputs": [
|
|
108
|
+
{
|
|
109
|
+
"internalType": "contract IAllo",
|
|
110
|
+
"name": "",
|
|
111
|
+
"type": "address"
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"stateMutability": "view",
|
|
115
|
+
"type": "function"
|
|
116
|
+
}
|
|
117
|
+
]
|
|
@@ -4,9 +4,9 @@ exports.Attestation = void 0;
|
|
|
4
4
|
const Schema_1 = require("./Schema");
|
|
5
5
|
const SchemaError_1 = require("./SchemaError");
|
|
6
6
|
const get_date_1 = require("../utils/get-date");
|
|
7
|
-
const GAP_1 = require("./GAP");
|
|
8
7
|
const consts_1 = require("../consts");
|
|
9
8
|
const GapContract_1 = require("./contract/GapContract");
|
|
9
|
+
const IpfsStorage_1 = require("./remote-storage/IpfsStorage");
|
|
10
10
|
/**
|
|
11
11
|
* Represents the EAS Attestation and provides methods to manage attestations.
|
|
12
12
|
* @example
|
|
@@ -196,13 +196,15 @@ class Attestation {
|
|
|
196
196
|
async payloadFor(refIdx) {
|
|
197
197
|
this.assertPayload();
|
|
198
198
|
if (this.schema.isJsonSchema()) {
|
|
199
|
-
const
|
|
199
|
+
const remoteClient = new IpfsStorage_1.IpfsStorage({
|
|
200
|
+
token: process.env.NEXT_PUBLIC_IPFS_TOKEN,
|
|
201
|
+
});
|
|
200
202
|
if (this.type) {
|
|
201
203
|
this._data.type = this.type;
|
|
202
204
|
this.schema.setValue("json", JSON.stringify(this._data));
|
|
203
205
|
}
|
|
204
206
|
if (remoteClient && JSON.stringify(this._data)?.length > 1500) {
|
|
205
|
-
const cid = await remoteClient.save(this._data
|
|
207
|
+
const cid = await remoteClient.save(this._data);
|
|
206
208
|
const encodedData = remoteClient.encode(cid);
|
|
207
209
|
this.schema.setValue("json", JSON.stringify(encodedData));
|
|
208
210
|
}
|
package/core/class/Schema.js
CHANGED
|
@@ -4,9 +4,9 @@ exports.Schema = void 0;
|
|
|
4
4
|
const eas_sdk_1 = require("@ethereum-attestation-service/eas-sdk");
|
|
5
5
|
const SchemaError_1 = require("./SchemaError");
|
|
6
6
|
const consts_1 = require("../consts");
|
|
7
|
-
const GAP_1 = require("./GAP");
|
|
8
7
|
const GapContract_1 = require("./contract/GapContract");
|
|
9
8
|
const ethers_1 = require("ethers");
|
|
9
|
+
const IpfsStorage_1 = require("./remote-storage/IpfsStorage");
|
|
10
10
|
/**
|
|
11
11
|
* Represents the EAS Schema and provides methods to encode and decode the schema,
|
|
12
12
|
* and validate the schema references.
|
|
@@ -224,9 +224,11 @@ class Schema {
|
|
|
224
224
|
if (this.references && !refUID)
|
|
225
225
|
throw new SchemaError_1.AttestationError("INVALID_REFERENCE", "Attestation schema references another schema but no reference UID was provided.");
|
|
226
226
|
if (this.isJsonSchema()) {
|
|
227
|
-
const
|
|
227
|
+
const remoteClient = new IpfsStorage_1.IpfsStorage({
|
|
228
|
+
token: process.env.NEXT_PUBLIC_IPFS_TOKEN,
|
|
229
|
+
});
|
|
228
230
|
if (remoteClient) {
|
|
229
|
-
const cid = await remoteClient.save(data
|
|
231
|
+
const cid = await remoteClient.save(data);
|
|
230
232
|
const encodedData = remoteClient.encode(cid);
|
|
231
233
|
data = encodedData;
|
|
232
234
|
}
|
|
@@ -467,5 +469,7 @@ Schema.schemas = {
|
|
|
467
469
|
sepolia: [],
|
|
468
470
|
arbitrum: [],
|
|
469
471
|
celo: [],
|
|
472
|
+
"sei": [],
|
|
473
|
+
"sei-testnet": [],
|
|
470
474
|
"base-sepolia": [],
|
|
471
475
|
};
|
package/core/consts.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export declare const chainIdToNetwork: {
|
|
|
11
11
|
11155111: string;
|
|
12
12
|
84532: string;
|
|
13
13
|
42220: string;
|
|
14
|
+
1328: string;
|
|
15
|
+
1329: string;
|
|
14
16
|
};
|
|
15
17
|
export declare const nullRef = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
16
18
|
export declare const nullResolver = "0x0000000000000000000000000000000000000000";
|
package/core/consts.js
CHANGED
|
@@ -19,6 +19,8 @@ exports.chainIdToNetwork = {
|
|
|
19
19
|
11155111: "sepolia",
|
|
20
20
|
84532: "base-sepolia",
|
|
21
21
|
42220: "celo",
|
|
22
|
+
1328: "sei-testnet",
|
|
23
|
+
1329: "sei",
|
|
22
24
|
};
|
|
23
25
|
exports.nullRef = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
24
26
|
// TODO: Remove null resolver and change usage to zero address
|
|
@@ -174,6 +176,54 @@ exports.Networks = {
|
|
|
174
176
|
Project: "0xf3f753b41e04d1052b5a5ec7624d1dfdb6c2da288a985120e477ddbcac071022",
|
|
175
177
|
},
|
|
176
178
|
},
|
|
179
|
+
"sei": {
|
|
180
|
+
chainId: 1329,
|
|
181
|
+
url: "https://sei.easscan.org/graphql",
|
|
182
|
+
rpcUrl: "https://evm-rpc.sei-apis.com",
|
|
183
|
+
contracts: {
|
|
184
|
+
eas: "0x391020888b0adBA584A67693458b374e4141f838",
|
|
185
|
+
schema: "0x80A4B50f549a8271e10A6C8e79172cb56f35fD57",
|
|
186
|
+
multicall: "0xB80D85690747C3E2ceCc0f8529594C6602b642D5",
|
|
187
|
+
projectResolver: "0x96f36F25C6bD648d9bdBbd8C3E029CfB2394754d",
|
|
188
|
+
communityResolver: "0x61d519C99279DC91fC2FC56B177f42B90B35050E",
|
|
189
|
+
donations: "0xB80D85690747C3E2ceCc0f8529594C6602b642D5",
|
|
190
|
+
},
|
|
191
|
+
schemas: {
|
|
192
|
+
Community: "0x57dee0b7e1aa8e5c6280c27fecf2edeb225f1b87b47e2750f9dc7eaebe57a2ba",
|
|
193
|
+
Details: "0x1b4365b92aa47de3f67cdfb53127518381c1e66e0d9e0f8a15bbfa7250950967",
|
|
194
|
+
Grant: "0xe9030dc574039832103dd5939f9dd214340602d2af4bbf1c8b2666e720ed0bf6",
|
|
195
|
+
GrantVerified: "0x6edc90af92553109cfed1292a67a75b34e41880bd8a61e9d05db0473b69a2f9e",
|
|
196
|
+
MemberOf: "0xb7278b94cea2b9f1a8fdd1c4bb52ed66906516a0ff9d59d0f80daffcf147ea5d",
|
|
197
|
+
MilestoneApproved: "0x6edc90af92553109cfed1292a67a75b34e41880bd8a61e9d05db0473b69a2f9e",
|
|
198
|
+
MilestoneCompleted: "0x6edc90af92553109cfed1292a67a75b34e41880bd8a61e9d05db0473b69a2f9e",
|
|
199
|
+
GrantUpdateStatus: "0x6edc90af92553109cfed1292a67a75b34e41880bd8a61e9d05db0473b69a2f9e",
|
|
200
|
+
Project: "0xf6b89107f8096220051240b89a48abb66e0a23e529c914953b80f5a2bc5ea44c",
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
"sei-testnet": {
|
|
204
|
+
chainId: 1328,
|
|
205
|
+
url: "https://sei-testnet.easscan.org/graphql",
|
|
206
|
+
rpcUrl: "https://evm-rpc-testnet.sei-apis.com",
|
|
207
|
+
contracts: {
|
|
208
|
+
eas: "0x4F166ed0A038ECdEEefa7Dc508f15991762974Fe",
|
|
209
|
+
schema: "0x906a57aCa067178e76e6eBDF4C7b26CBcAEC0Edd",
|
|
210
|
+
multicall: "0x0bB232f1b137fB55CB6af92c218A1cD63445a2E9",
|
|
211
|
+
projectResolver: "0xdA2c62101851365EEdC5A1f7087d92Ffde7345B4",
|
|
212
|
+
communityResolver: "0x50fb4a65CE924D29b9AC8C508c376a5a21Fda1BC",
|
|
213
|
+
donations: "0xB80D85690747C3E2ceCc0f8529594C6602b642D5",
|
|
214
|
+
},
|
|
215
|
+
schemas: {
|
|
216
|
+
Community: "0x968fe3d635bbf22b6253596df6290d1b6da1f192da9e2b5b41ae3595a965dbc2",
|
|
217
|
+
Details: "0x76f38d22f88a0df52a8ff0763e1c0af912b0822e758be2e0c9cded91aef71d22",
|
|
218
|
+
Grant: "0xfd5af4f0abd2875c64d2fed8be07bc1dfa5192a49e1a80587b0f12cae8d5173f",
|
|
219
|
+
GrantVerified: "0xb25551d21dc886be83a07c241c46de318704cb6f485191fdedcf80f4b8b28188",
|
|
220
|
+
MemberOf: "0x222fa508c0cdb5954905dd30611a940f6402da2b3c49ce0c88d33e22f72121e7",
|
|
221
|
+
MilestoneApproved: "0xb25551d21dc886be83a07c241c46de318704cb6f485191fdedcf80f4b8b28188",
|
|
222
|
+
MilestoneCompleted: "0xb25551d21dc886be83a07c241c46de318704cb6f485191fdedcf80f4b8b28188",
|
|
223
|
+
GrantUpdateStatus: "0xb25551d21dc886be83a07c241c46de318704cb6f485191fdedcf80f4b8b28188",
|
|
224
|
+
Project: "0x9de9294fbb62391b39332a33bfc28b4e0e728dd094aee4bda3955df62f8401a5",
|
|
225
|
+
},
|
|
226
|
+
},
|
|
177
227
|
};
|
|
178
228
|
const DetailsSchema = [{ type: "string", name: "json", value: null }];
|
|
179
229
|
/**
|
package/core/types.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export interface AttestArgs<T = unknown> {
|
|
|
26
26
|
export type TSchemaName = "Community" | "CommunityDetails" | "Grant" | "GrantDetails" | "GrantVerified" | "MemberOf" | "MemberDetails" | "Milestone" | "MilestoneCompleted" | "MilestoneApproved" | "Project" | "ProjectDetails" | "Details" | "ProjectImpact" | "GrantUpdate" | "GrantUpdateStatus" | "ProjectEndorsement";
|
|
27
27
|
export type TResolvedSchemaNames = "Community" | "Grant" | "GrantVerified" | "MemberOf" | "MilestoneCompleted" | "MilestoneApproved" | "Project" | "Details" | "GrantUpdateStatus";
|
|
28
28
|
export type TExternalLink = "twitter" | "github" | "website" | "linkedin" | "discord";
|
|
29
|
-
export type TNetwork = "optimism" | "celo" | "optimism-sepolia" | "arbitrum" | "sepolia" | "base-sepolia";
|
|
29
|
+
export type TNetwork = "optimism" | "celo" | "optimism-sepolia" | "arbitrum" | "sepolia" | "sei" | "sei-testnet" | "base-sepolia";
|
|
30
30
|
/**
|
|
31
31
|
* Generic GAP Facade interface.
|
|
32
32
|
* This supplies the GAP class with the necessary properties.
|