@show-karma/karma-gap-sdk 0.4.5 → 0.4.8
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.
|
@@ -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
|
+
]
|
|
@@ -10,6 +10,8 @@ const consts_1 = require("../../consts");
|
|
|
10
10
|
const ethers_2 = require("ethers");
|
|
11
11
|
const allo_v2_sdk_1 = require("@allo-team/allo-v2-sdk/");
|
|
12
12
|
const axios_1 = __importDefault(require("axios"));
|
|
13
|
+
// ABI fragment for the Initialized event
|
|
14
|
+
const INITIALIZED_EVENT = ["event Initialized(uint256 poolId, bytes data)"];
|
|
13
15
|
class AlloBase {
|
|
14
16
|
constructor(signer, pinataJWTToken, chainId) {
|
|
15
17
|
this.signer = signer;
|
|
@@ -80,10 +82,30 @@ class AlloBase {
|
|
|
80
82
|
callback?.("pending");
|
|
81
83
|
const receipt = await tx.wait();
|
|
82
84
|
callback?.("confirmed");
|
|
83
|
-
//
|
|
84
|
-
const
|
|
85
|
+
// Create interface to parse the logs
|
|
86
|
+
const iface = new ethers_1.ethers.Interface(INITIALIZED_EVENT);
|
|
87
|
+
let poolId;
|
|
88
|
+
// Find the Initialized event in the logs
|
|
89
|
+
const initializedLog = receipt.logs.find((log) => {
|
|
90
|
+
try {
|
|
91
|
+
const parsed = iface.parseLog(log);
|
|
92
|
+
return parsed.name === "Initialized";
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
if (initializedLog) {
|
|
99
|
+
const parsedLog = iface.parseLog(initializedLog);
|
|
100
|
+
poolId = parsedLog.args.poolId.toString();
|
|
101
|
+
console.log(`Transaction ${tx.hash} - Found poolId: ${poolId}`);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
poolId = receipt.logs[receipt.logs.length - 1].topics[1]; // Fallback to Initialized order logic
|
|
105
|
+
console.log(`No Initialized event found in tx ${tx.hash}`);
|
|
106
|
+
}
|
|
85
107
|
return {
|
|
86
|
-
poolId: poolId,
|
|
108
|
+
poolId: BigInt(poolId).toString(),
|
|
87
109
|
txHash: tx.hash,
|
|
88
110
|
};
|
|
89
111
|
}
|
|
@@ -146,6 +146,9 @@ export interface IGrantResponse extends IAttestationResponse {
|
|
|
146
146
|
externalAddresses?: {
|
|
147
147
|
[key: string]: string;
|
|
148
148
|
};
|
|
149
|
+
external?: {
|
|
150
|
+
[key: string]: string[];
|
|
151
|
+
};
|
|
149
152
|
}
|
|
150
153
|
export interface IMemberDetails extends IAttestationResponse {
|
|
151
154
|
name: string;
|