@gitgrant/sdk 0.1.0
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/dist/abi.d.ts +384 -0
- package/dist/abi.d.ts.map +1 -0
- package/dist/abi.js +250 -0
- package/dist/abi.js.map +1 -0
- package/dist/client.d.ts +24 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +83 -0
- package/dist/client.js.map +1 -0
- package/dist/contract.d.ts +66 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/contract.js +145 -0
- package/dist/contract.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +125 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +23 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +56 -0
- package/dist/utils.js.map +1 -0
- package/package.json +30 -0
package/dist/abi.d.ts
ADDED
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
export declare const escrowAbi: readonly [{
|
|
2
|
+
readonly type: "function";
|
|
3
|
+
readonly name: "createBountyETH";
|
|
4
|
+
readonly inputs: readonly [{
|
|
5
|
+
readonly name: "issueUri";
|
|
6
|
+
readonly type: "string";
|
|
7
|
+
}, {
|
|
8
|
+
readonly name: "deadline";
|
|
9
|
+
readonly type: "uint256";
|
|
10
|
+
}];
|
|
11
|
+
readonly outputs: readonly [{
|
|
12
|
+
readonly name: "bountyId";
|
|
13
|
+
readonly type: "bytes32";
|
|
14
|
+
}];
|
|
15
|
+
readonly stateMutability: "payable";
|
|
16
|
+
}, {
|
|
17
|
+
readonly type: "function";
|
|
18
|
+
readonly name: "createBountyToken";
|
|
19
|
+
readonly inputs: readonly [{
|
|
20
|
+
readonly name: "issueUri";
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
}, {
|
|
23
|
+
readonly name: "token";
|
|
24
|
+
readonly type: "address";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "totalAmount";
|
|
27
|
+
readonly type: "uint256";
|
|
28
|
+
}, {
|
|
29
|
+
readonly name: "deadline";
|
|
30
|
+
readonly type: "uint256";
|
|
31
|
+
}];
|
|
32
|
+
readonly outputs: readonly [{
|
|
33
|
+
readonly name: "bountyId";
|
|
34
|
+
readonly type: "bytes32";
|
|
35
|
+
}];
|
|
36
|
+
readonly stateMutability: "nonpayable";
|
|
37
|
+
}, {
|
|
38
|
+
readonly type: "function";
|
|
39
|
+
readonly name: "claim";
|
|
40
|
+
readonly inputs: readonly [{
|
|
41
|
+
readonly name: "bountyId";
|
|
42
|
+
readonly type: "bytes32";
|
|
43
|
+
}];
|
|
44
|
+
readonly outputs: readonly [];
|
|
45
|
+
readonly stateMutability: "nonpayable";
|
|
46
|
+
}, {
|
|
47
|
+
readonly type: "function";
|
|
48
|
+
readonly name: "submit";
|
|
49
|
+
readonly inputs: readonly [{
|
|
50
|
+
readonly name: "bountyId";
|
|
51
|
+
readonly type: "bytes32";
|
|
52
|
+
}];
|
|
53
|
+
readonly outputs: readonly [];
|
|
54
|
+
readonly stateMutability: "nonpayable";
|
|
55
|
+
}, {
|
|
56
|
+
readonly type: "function";
|
|
57
|
+
readonly name: "release";
|
|
58
|
+
readonly inputs: readonly [{
|
|
59
|
+
readonly name: "bountyId";
|
|
60
|
+
readonly type: "bytes32";
|
|
61
|
+
}];
|
|
62
|
+
readonly outputs: readonly [];
|
|
63
|
+
readonly stateMutability: "nonpayable";
|
|
64
|
+
}, {
|
|
65
|
+
readonly type: "function";
|
|
66
|
+
readonly name: "cancel";
|
|
67
|
+
readonly inputs: readonly [{
|
|
68
|
+
readonly name: "bountyId";
|
|
69
|
+
readonly type: "bytes32";
|
|
70
|
+
}];
|
|
71
|
+
readonly outputs: readonly [];
|
|
72
|
+
readonly stateMutability: "nonpayable";
|
|
73
|
+
}, {
|
|
74
|
+
readonly type: "function";
|
|
75
|
+
readonly name: "expire";
|
|
76
|
+
readonly inputs: readonly [{
|
|
77
|
+
readonly name: "bountyId";
|
|
78
|
+
readonly type: "bytes32";
|
|
79
|
+
}];
|
|
80
|
+
readonly outputs: readonly [];
|
|
81
|
+
readonly stateMutability: "nonpayable";
|
|
82
|
+
}, {
|
|
83
|
+
readonly type: "function";
|
|
84
|
+
readonly name: "dispute";
|
|
85
|
+
readonly inputs: readonly [{
|
|
86
|
+
readonly name: "bountyId";
|
|
87
|
+
readonly type: "bytes32";
|
|
88
|
+
}];
|
|
89
|
+
readonly outputs: readonly [];
|
|
90
|
+
readonly stateMutability: "nonpayable";
|
|
91
|
+
}, {
|
|
92
|
+
readonly type: "function";
|
|
93
|
+
readonly name: "resolve";
|
|
94
|
+
readonly inputs: readonly [{
|
|
95
|
+
readonly name: "bountyId";
|
|
96
|
+
readonly type: "bytes32";
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "payClaimant";
|
|
99
|
+
readonly type: "bool";
|
|
100
|
+
}];
|
|
101
|
+
readonly outputs: readonly [];
|
|
102
|
+
readonly stateMutability: "nonpayable";
|
|
103
|
+
}, {
|
|
104
|
+
readonly type: "function";
|
|
105
|
+
readonly name: "getBounty";
|
|
106
|
+
readonly inputs: readonly [{
|
|
107
|
+
readonly name: "bountyId";
|
|
108
|
+
readonly type: "bytes32";
|
|
109
|
+
}];
|
|
110
|
+
readonly outputs: readonly [{
|
|
111
|
+
readonly name: "";
|
|
112
|
+
readonly type: "tuple";
|
|
113
|
+
readonly components: readonly [{
|
|
114
|
+
readonly name: "creator";
|
|
115
|
+
readonly type: "address";
|
|
116
|
+
}, {
|
|
117
|
+
readonly name: "token";
|
|
118
|
+
readonly type: "address";
|
|
119
|
+
}, {
|
|
120
|
+
readonly name: "amount";
|
|
121
|
+
readonly type: "uint256";
|
|
122
|
+
}, {
|
|
123
|
+
readonly name: "fee";
|
|
124
|
+
readonly type: "uint256";
|
|
125
|
+
}, {
|
|
126
|
+
readonly name: "deadline";
|
|
127
|
+
readonly type: "uint256";
|
|
128
|
+
}, {
|
|
129
|
+
readonly name: "claimant";
|
|
130
|
+
readonly type: "address";
|
|
131
|
+
}, {
|
|
132
|
+
readonly name: "status";
|
|
133
|
+
readonly type: "uint8";
|
|
134
|
+
}, {
|
|
135
|
+
readonly name: "issueUri";
|
|
136
|
+
readonly type: "string";
|
|
137
|
+
}];
|
|
138
|
+
}];
|
|
139
|
+
readonly stateMutability: "view";
|
|
140
|
+
}, {
|
|
141
|
+
readonly type: "function";
|
|
142
|
+
readonly name: "computeId";
|
|
143
|
+
readonly inputs: readonly [{
|
|
144
|
+
readonly name: "issueUri";
|
|
145
|
+
readonly type: "string";
|
|
146
|
+
}];
|
|
147
|
+
readonly outputs: readonly [{
|
|
148
|
+
readonly name: "";
|
|
149
|
+
readonly type: "bytes32";
|
|
150
|
+
}];
|
|
151
|
+
readonly stateMutability: "pure";
|
|
152
|
+
}, {
|
|
153
|
+
readonly type: "function";
|
|
154
|
+
readonly name: "getBountyCount";
|
|
155
|
+
readonly inputs: readonly [];
|
|
156
|
+
readonly outputs: readonly [{
|
|
157
|
+
readonly name: "";
|
|
158
|
+
readonly type: "uint256";
|
|
159
|
+
}];
|
|
160
|
+
readonly stateMutability: "view";
|
|
161
|
+
}, {
|
|
162
|
+
readonly type: "event";
|
|
163
|
+
readonly name: "BountyCreated";
|
|
164
|
+
readonly inputs: readonly [{
|
|
165
|
+
readonly name: "bountyId";
|
|
166
|
+
readonly type: "bytes32";
|
|
167
|
+
readonly indexed: true;
|
|
168
|
+
}, {
|
|
169
|
+
readonly name: "creator";
|
|
170
|
+
readonly type: "address";
|
|
171
|
+
readonly indexed: true;
|
|
172
|
+
}, {
|
|
173
|
+
readonly name: "token";
|
|
174
|
+
readonly type: "address";
|
|
175
|
+
readonly indexed: false;
|
|
176
|
+
}, {
|
|
177
|
+
readonly name: "amount";
|
|
178
|
+
readonly type: "uint256";
|
|
179
|
+
readonly indexed: false;
|
|
180
|
+
}, {
|
|
181
|
+
readonly name: "deadline";
|
|
182
|
+
readonly type: "uint256";
|
|
183
|
+
readonly indexed: false;
|
|
184
|
+
}, {
|
|
185
|
+
readonly name: "issueUri";
|
|
186
|
+
readonly type: "string";
|
|
187
|
+
readonly indexed: false;
|
|
188
|
+
}];
|
|
189
|
+
readonly anonymous: false;
|
|
190
|
+
}, {
|
|
191
|
+
readonly type: "event";
|
|
192
|
+
readonly name: "BountyClaimed";
|
|
193
|
+
readonly inputs: readonly [{
|
|
194
|
+
readonly name: "bountyId";
|
|
195
|
+
readonly type: "bytes32";
|
|
196
|
+
readonly indexed: true;
|
|
197
|
+
}, {
|
|
198
|
+
readonly name: "claimant";
|
|
199
|
+
readonly type: "address";
|
|
200
|
+
readonly indexed: true;
|
|
201
|
+
}];
|
|
202
|
+
readonly anonymous: false;
|
|
203
|
+
}, {
|
|
204
|
+
readonly type: "event";
|
|
205
|
+
readonly name: "BountySubmitted";
|
|
206
|
+
readonly inputs: readonly [{
|
|
207
|
+
readonly name: "bountyId";
|
|
208
|
+
readonly type: "bytes32";
|
|
209
|
+
readonly indexed: true;
|
|
210
|
+
}, {
|
|
211
|
+
readonly name: "claimant";
|
|
212
|
+
readonly type: "address";
|
|
213
|
+
readonly indexed: true;
|
|
214
|
+
}];
|
|
215
|
+
readonly anonymous: false;
|
|
216
|
+
}, {
|
|
217
|
+
readonly type: "event";
|
|
218
|
+
readonly name: "BountyCompleted";
|
|
219
|
+
readonly inputs: readonly [{
|
|
220
|
+
readonly name: "bountyId";
|
|
221
|
+
readonly type: "bytes32";
|
|
222
|
+
readonly indexed: true;
|
|
223
|
+
}, {
|
|
224
|
+
readonly name: "claimant";
|
|
225
|
+
readonly type: "address";
|
|
226
|
+
readonly indexed: true;
|
|
227
|
+
}, {
|
|
228
|
+
readonly name: "payout";
|
|
229
|
+
readonly type: "uint256";
|
|
230
|
+
readonly indexed: false;
|
|
231
|
+
}];
|
|
232
|
+
readonly anonymous: false;
|
|
233
|
+
}, {
|
|
234
|
+
readonly type: "event";
|
|
235
|
+
readonly name: "BountyDisputed";
|
|
236
|
+
readonly inputs: readonly [{
|
|
237
|
+
readonly name: "bountyId";
|
|
238
|
+
readonly type: "bytes32";
|
|
239
|
+
readonly indexed: true;
|
|
240
|
+
}, {
|
|
241
|
+
readonly name: "disputedBy";
|
|
242
|
+
readonly type: "address";
|
|
243
|
+
readonly indexed: true;
|
|
244
|
+
}];
|
|
245
|
+
readonly anonymous: false;
|
|
246
|
+
}, {
|
|
247
|
+
readonly type: "event";
|
|
248
|
+
readonly name: "BountyResolved";
|
|
249
|
+
readonly inputs: readonly [{
|
|
250
|
+
readonly name: "bountyId";
|
|
251
|
+
readonly type: "bytes32";
|
|
252
|
+
readonly indexed: true;
|
|
253
|
+
}, {
|
|
254
|
+
readonly name: "winner";
|
|
255
|
+
readonly type: "address";
|
|
256
|
+
readonly indexed: true;
|
|
257
|
+
}, {
|
|
258
|
+
readonly name: "payout";
|
|
259
|
+
readonly type: "uint256";
|
|
260
|
+
readonly indexed: false;
|
|
261
|
+
}];
|
|
262
|
+
readonly anonymous: false;
|
|
263
|
+
}, {
|
|
264
|
+
readonly type: "event";
|
|
265
|
+
readonly name: "BountyExpired";
|
|
266
|
+
readonly inputs: readonly [{
|
|
267
|
+
readonly name: "bountyId";
|
|
268
|
+
readonly type: "bytes32";
|
|
269
|
+
readonly indexed: true;
|
|
270
|
+
}];
|
|
271
|
+
readonly anonymous: false;
|
|
272
|
+
}, {
|
|
273
|
+
readonly type: "event";
|
|
274
|
+
readonly name: "BountyCancelled";
|
|
275
|
+
readonly inputs: readonly [{
|
|
276
|
+
readonly name: "bountyId";
|
|
277
|
+
readonly type: "bytes32";
|
|
278
|
+
readonly indexed: true;
|
|
279
|
+
}];
|
|
280
|
+
readonly anonymous: false;
|
|
281
|
+
}];
|
|
282
|
+
export declare const attestationAbi: readonly [{
|
|
283
|
+
readonly type: "function";
|
|
284
|
+
readonly name: "mint";
|
|
285
|
+
readonly inputs: readonly [{
|
|
286
|
+
readonly name: "contributor";
|
|
287
|
+
readonly type: "address";
|
|
288
|
+
}, {
|
|
289
|
+
readonly name: "bountyId";
|
|
290
|
+
readonly type: "bytes32";
|
|
291
|
+
}, {
|
|
292
|
+
readonly name: "issueUri";
|
|
293
|
+
readonly type: "string";
|
|
294
|
+
}, {
|
|
295
|
+
readonly name: "token";
|
|
296
|
+
readonly type: "address";
|
|
297
|
+
}, {
|
|
298
|
+
readonly name: "amount";
|
|
299
|
+
readonly type: "uint256";
|
|
300
|
+
}];
|
|
301
|
+
readonly outputs: readonly [{
|
|
302
|
+
readonly name: "id";
|
|
303
|
+
readonly type: "uint256";
|
|
304
|
+
}];
|
|
305
|
+
readonly stateMutability: "nonpayable";
|
|
306
|
+
}, {
|
|
307
|
+
readonly type: "function";
|
|
308
|
+
readonly name: "getContributorAttestations";
|
|
309
|
+
readonly inputs: readonly [{
|
|
310
|
+
readonly name: "contributor";
|
|
311
|
+
readonly type: "address";
|
|
312
|
+
}];
|
|
313
|
+
readonly outputs: readonly [{
|
|
314
|
+
readonly name: "";
|
|
315
|
+
readonly type: "uint256[]";
|
|
316
|
+
}];
|
|
317
|
+
readonly stateMutability: "view";
|
|
318
|
+
}, {
|
|
319
|
+
readonly type: "function";
|
|
320
|
+
readonly name: "getAttestation";
|
|
321
|
+
readonly inputs: readonly [{
|
|
322
|
+
readonly name: "id";
|
|
323
|
+
readonly type: "uint256";
|
|
324
|
+
}];
|
|
325
|
+
readonly outputs: readonly [{
|
|
326
|
+
readonly name: "";
|
|
327
|
+
readonly type: "tuple";
|
|
328
|
+
readonly components: readonly [{
|
|
329
|
+
readonly name: "contributor";
|
|
330
|
+
readonly type: "address";
|
|
331
|
+
}, {
|
|
332
|
+
readonly name: "bountyId";
|
|
333
|
+
readonly type: "bytes32";
|
|
334
|
+
}, {
|
|
335
|
+
readonly name: "issueUri";
|
|
336
|
+
readonly type: "string";
|
|
337
|
+
}, {
|
|
338
|
+
readonly name: "token";
|
|
339
|
+
readonly type: "address";
|
|
340
|
+
}, {
|
|
341
|
+
readonly name: "amount";
|
|
342
|
+
readonly type: "uint256";
|
|
343
|
+
}, {
|
|
344
|
+
readonly name: "completedAt";
|
|
345
|
+
readonly type: "uint256";
|
|
346
|
+
}];
|
|
347
|
+
}];
|
|
348
|
+
readonly stateMutability: "view";
|
|
349
|
+
}, {
|
|
350
|
+
readonly type: "function";
|
|
351
|
+
readonly name: "totalAttestations";
|
|
352
|
+
readonly inputs: readonly [];
|
|
353
|
+
readonly outputs: readonly [{
|
|
354
|
+
readonly name: "";
|
|
355
|
+
readonly type: "uint256";
|
|
356
|
+
}];
|
|
357
|
+
readonly stateMutability: "view";
|
|
358
|
+
}, {
|
|
359
|
+
readonly type: "event";
|
|
360
|
+
readonly name: "AttestationMinted";
|
|
361
|
+
readonly inputs: readonly [{
|
|
362
|
+
readonly name: "id";
|
|
363
|
+
readonly type: "uint256";
|
|
364
|
+
readonly indexed: true;
|
|
365
|
+
}, {
|
|
366
|
+
readonly name: "contributor";
|
|
367
|
+
readonly type: "address";
|
|
368
|
+
readonly indexed: true;
|
|
369
|
+
}, {
|
|
370
|
+
readonly name: "bountyId";
|
|
371
|
+
readonly type: "bytes32";
|
|
372
|
+
readonly indexed: true;
|
|
373
|
+
}, {
|
|
374
|
+
readonly name: "issueUri";
|
|
375
|
+
readonly type: "string";
|
|
376
|
+
readonly indexed: false;
|
|
377
|
+
}, {
|
|
378
|
+
readonly name: "amount";
|
|
379
|
+
readonly type: "uint256";
|
|
380
|
+
readonly indexed: false;
|
|
381
|
+
}];
|
|
382
|
+
readonly anonymous: false;
|
|
383
|
+
}];
|
|
384
|
+
//# sourceMappingURL=abi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abi.d.ts","sourceRoot":"","sources":["../src/abi.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2LZ,CAAC;AAEX,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4DjB,CAAC"}
|
package/dist/abi.js
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
export const escrowAbi = [
|
|
2
|
+
{
|
|
3
|
+
type: "function",
|
|
4
|
+
name: "createBountyETH",
|
|
5
|
+
inputs: [
|
|
6
|
+
{ name: "issueUri", type: "string" },
|
|
7
|
+
{ name: "deadline", type: "uint256" },
|
|
8
|
+
],
|
|
9
|
+
outputs: [{ name: "bountyId", type: "bytes32" }],
|
|
10
|
+
stateMutability: "payable",
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
type: "function",
|
|
14
|
+
name: "createBountyToken",
|
|
15
|
+
inputs: [
|
|
16
|
+
{ name: "issueUri", type: "string" },
|
|
17
|
+
{ name: "token", type: "address" },
|
|
18
|
+
{ name: "totalAmount", type: "uint256" },
|
|
19
|
+
{ name: "deadline", type: "uint256" },
|
|
20
|
+
],
|
|
21
|
+
outputs: [{ name: "bountyId", type: "bytes32" }],
|
|
22
|
+
stateMutability: "nonpayable",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
type: "function",
|
|
26
|
+
name: "claim",
|
|
27
|
+
inputs: [{ name: "bountyId", type: "bytes32" }],
|
|
28
|
+
outputs: [],
|
|
29
|
+
stateMutability: "nonpayable",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
type: "function",
|
|
33
|
+
name: "submit",
|
|
34
|
+
inputs: [{ name: "bountyId", type: "bytes32" }],
|
|
35
|
+
outputs: [],
|
|
36
|
+
stateMutability: "nonpayable",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: "function",
|
|
40
|
+
name: "release",
|
|
41
|
+
inputs: [{ name: "bountyId", type: "bytes32" }],
|
|
42
|
+
outputs: [],
|
|
43
|
+
stateMutability: "nonpayable",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: "function",
|
|
47
|
+
name: "cancel",
|
|
48
|
+
inputs: [{ name: "bountyId", type: "bytes32" }],
|
|
49
|
+
outputs: [],
|
|
50
|
+
stateMutability: "nonpayable",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: "function",
|
|
54
|
+
name: "expire",
|
|
55
|
+
inputs: [{ name: "bountyId", type: "bytes32" }],
|
|
56
|
+
outputs: [],
|
|
57
|
+
stateMutability: "nonpayable",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type: "function",
|
|
61
|
+
name: "dispute",
|
|
62
|
+
inputs: [{ name: "bountyId", type: "bytes32" }],
|
|
63
|
+
outputs: [],
|
|
64
|
+
stateMutability: "nonpayable",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: "function",
|
|
68
|
+
name: "resolve",
|
|
69
|
+
inputs: [
|
|
70
|
+
{ name: "bountyId", type: "bytes32" },
|
|
71
|
+
{ name: "payClaimant", type: "bool" },
|
|
72
|
+
],
|
|
73
|
+
outputs: [],
|
|
74
|
+
stateMutability: "nonpayable",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
type: "function",
|
|
78
|
+
name: "getBounty",
|
|
79
|
+
inputs: [{ name: "bountyId", type: "bytes32" }],
|
|
80
|
+
outputs: [
|
|
81
|
+
{
|
|
82
|
+
name: "",
|
|
83
|
+
type: "tuple",
|
|
84
|
+
components: [
|
|
85
|
+
{ name: "creator", type: "address" },
|
|
86
|
+
{ name: "token", type: "address" },
|
|
87
|
+
{ name: "amount", type: "uint256" },
|
|
88
|
+
{ name: "fee", type: "uint256" },
|
|
89
|
+
{ name: "deadline", type: "uint256" },
|
|
90
|
+
{ name: "claimant", type: "address" },
|
|
91
|
+
{ name: "status", type: "uint8" },
|
|
92
|
+
{ name: "issueUri", type: "string" },
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
stateMutability: "view",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
type: "function",
|
|
100
|
+
name: "computeId",
|
|
101
|
+
inputs: [{ name: "issueUri", type: "string" }],
|
|
102
|
+
outputs: [{ name: "", type: "bytes32" }],
|
|
103
|
+
stateMutability: "pure",
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: "function",
|
|
107
|
+
name: "getBountyCount",
|
|
108
|
+
inputs: [],
|
|
109
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
110
|
+
stateMutability: "view",
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: "event",
|
|
114
|
+
name: "BountyCreated",
|
|
115
|
+
inputs: [
|
|
116
|
+
{ name: "bountyId", type: "bytes32", indexed: true },
|
|
117
|
+
{ name: "creator", type: "address", indexed: true },
|
|
118
|
+
{ name: "token", type: "address", indexed: false },
|
|
119
|
+
{ name: "amount", type: "uint256", indexed: false },
|
|
120
|
+
{ name: "deadline", type: "uint256", indexed: false },
|
|
121
|
+
{ name: "issueUri", type: "string", indexed: false },
|
|
122
|
+
],
|
|
123
|
+
anonymous: false,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
type: "event",
|
|
127
|
+
name: "BountyClaimed",
|
|
128
|
+
inputs: [
|
|
129
|
+
{ name: "bountyId", type: "bytes32", indexed: true },
|
|
130
|
+
{ name: "claimant", type: "address", indexed: true },
|
|
131
|
+
],
|
|
132
|
+
anonymous: false,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
type: "event",
|
|
136
|
+
name: "BountySubmitted",
|
|
137
|
+
inputs: [
|
|
138
|
+
{ name: "bountyId", type: "bytes32", indexed: true },
|
|
139
|
+
{ name: "claimant", type: "address", indexed: true },
|
|
140
|
+
],
|
|
141
|
+
anonymous: false,
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
type: "event",
|
|
145
|
+
name: "BountyCompleted",
|
|
146
|
+
inputs: [
|
|
147
|
+
{ name: "bountyId", type: "bytes32", indexed: true },
|
|
148
|
+
{ name: "claimant", type: "address", indexed: true },
|
|
149
|
+
{ name: "payout", type: "uint256", indexed: false },
|
|
150
|
+
],
|
|
151
|
+
anonymous: false,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
type: "event",
|
|
155
|
+
name: "BountyDisputed",
|
|
156
|
+
inputs: [
|
|
157
|
+
{ name: "bountyId", type: "bytes32", indexed: true },
|
|
158
|
+
{ name: "disputedBy", type: "address", indexed: true },
|
|
159
|
+
],
|
|
160
|
+
anonymous: false,
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
type: "event",
|
|
164
|
+
name: "BountyResolved",
|
|
165
|
+
inputs: [
|
|
166
|
+
{ name: "bountyId", type: "bytes32", indexed: true },
|
|
167
|
+
{ name: "winner", type: "address", indexed: true },
|
|
168
|
+
{ name: "payout", type: "uint256", indexed: false },
|
|
169
|
+
],
|
|
170
|
+
anonymous: false,
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
type: "event",
|
|
174
|
+
name: "BountyExpired",
|
|
175
|
+
inputs: [
|
|
176
|
+
{ name: "bountyId", type: "bytes32", indexed: true },
|
|
177
|
+
],
|
|
178
|
+
anonymous: false,
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
type: "event",
|
|
182
|
+
name: "BountyCancelled",
|
|
183
|
+
inputs: [
|
|
184
|
+
{ name: "bountyId", type: "bytes32", indexed: true },
|
|
185
|
+
],
|
|
186
|
+
anonymous: false,
|
|
187
|
+
},
|
|
188
|
+
];
|
|
189
|
+
export const attestationAbi = [
|
|
190
|
+
{
|
|
191
|
+
type: "function",
|
|
192
|
+
name: "mint",
|
|
193
|
+
inputs: [
|
|
194
|
+
{ name: "contributor", type: "address" },
|
|
195
|
+
{ name: "bountyId", type: "bytes32" },
|
|
196
|
+
{ name: "issueUri", type: "string" },
|
|
197
|
+
{ name: "token", type: "address" },
|
|
198
|
+
{ name: "amount", type: "uint256" },
|
|
199
|
+
],
|
|
200
|
+
outputs: [{ name: "id", type: "uint256" }],
|
|
201
|
+
stateMutability: "nonpayable",
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
type: "function",
|
|
205
|
+
name: "getContributorAttestations",
|
|
206
|
+
inputs: [{ name: "contributor", type: "address" }],
|
|
207
|
+
outputs: [{ name: "", type: "uint256[]" }],
|
|
208
|
+
stateMutability: "view",
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
type: "function",
|
|
212
|
+
name: "getAttestation",
|
|
213
|
+
inputs: [{ name: "id", type: "uint256" }],
|
|
214
|
+
outputs: [
|
|
215
|
+
{
|
|
216
|
+
name: "",
|
|
217
|
+
type: "tuple",
|
|
218
|
+
components: [
|
|
219
|
+
{ name: "contributor", type: "address" },
|
|
220
|
+
{ name: "bountyId", type: "bytes32" },
|
|
221
|
+
{ name: "issueUri", type: "string" },
|
|
222
|
+
{ name: "token", type: "address" },
|
|
223
|
+
{ name: "amount", type: "uint256" },
|
|
224
|
+
{ name: "completedAt", type: "uint256" },
|
|
225
|
+
],
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
stateMutability: "view",
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
type: "function",
|
|
232
|
+
name: "totalAttestations",
|
|
233
|
+
inputs: [],
|
|
234
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
235
|
+
stateMutability: "view",
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
type: "event",
|
|
239
|
+
name: "AttestationMinted",
|
|
240
|
+
inputs: [
|
|
241
|
+
{ name: "id", type: "uint256", indexed: true },
|
|
242
|
+
{ name: "contributor", type: "address", indexed: true },
|
|
243
|
+
{ name: "bountyId", type: "bytes32", indexed: true },
|
|
244
|
+
{ name: "issueUri", type: "string", indexed: false },
|
|
245
|
+
{ name: "amount", type: "uint256", indexed: false },
|
|
246
|
+
],
|
|
247
|
+
anonymous: false,
|
|
248
|
+
},
|
|
249
|
+
];
|
|
250
|
+
//# sourceMappingURL=abi.js.map
|
package/dist/abi.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abi.js","sourceRoot":"","sources":["../src/abi.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,iBAAiB;QACvB,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE;YACpC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;SACtC;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAChD,eAAe,EAAE,SAAS;KAC3B;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,mBAAmB;QACzB,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE;YACpC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAClC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE;YACxC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;SACtC;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAChD,eAAe,EAAE,YAAY;KAC9B;IACD;QACE,IAAI,EAA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, ClaimIntentResponse, ConfirmClaimBody, ConfirmSubmitBody, ConfirmMaintainerActionBody, ConfirmCreateBody, ConfirmResponse } from "./types.js";
|
|
2
|
+
export declare class GitGrantClient {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(opts: GitGrantClientOptions);
|
|
5
|
+
listBounties(query?: ListBountiesQuery): Promise<ListBountiesResponse>;
|
|
6
|
+
getBounty(bountyId: string): Promise<GetBountyResponse>;
|
|
7
|
+
getStats(): Promise<StatsResponse>;
|
|
8
|
+
getClaimIntent(token: string): Promise<ClaimIntentResponse>;
|
|
9
|
+
confirmClaim(body: ConfirmClaimBody): Promise<ConfirmResponse>;
|
|
10
|
+
confirmSubmit(body: ConfirmSubmitBody): Promise<ConfirmResponse>;
|
|
11
|
+
confirmMaintainerAction(body: ConfirmMaintainerActionBody): Promise<ConfirmResponse>;
|
|
12
|
+
confirmCreate(body: ConfirmCreateBody): Promise<ConfirmResponse>;
|
|
13
|
+
health(): Promise<{
|
|
14
|
+
status: string;
|
|
15
|
+
service: string;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
export declare class GitGrantApiError extends Error {
|
|
19
|
+
status: number;
|
|
20
|
+
body: string;
|
|
21
|
+
path: string;
|
|
22
|
+
constructor(status: number, body: string, path: string);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,2BAA2B,EAC3B,iBAAiB,EACjB,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,qBAAa,cAAc;;gBAIb,IAAI,EAAE,qBAAqB;IAOjC,YAAY,CAAC,KAAK,GAAE,iBAAsB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAa1E,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAIvD,QAAQ,IAAI,OAAO,CAAC,aAAa,CAAC;IAIlC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAM3D,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAI9D,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC;IAIhE,uBAAuB,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,eAAe,CAAC;IAIpF,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,eAAe,CAAC;IAMhE,MAAM,IAAI,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CA2B7D;AAED,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;gBAED,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAOvD"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export class GitGrantClient {
|
|
2
|
+
#baseUrl;
|
|
3
|
+
#fetch;
|
|
4
|
+
constructor(opts) {
|
|
5
|
+
this.#baseUrl = opts.baseUrl.replace(/\/$/, "");
|
|
6
|
+
this.#fetch = opts.fetch ?? globalThis.fetch.bind(globalThis);
|
|
7
|
+
}
|
|
8
|
+
// ─── Read endpoints ──────────────────────────────────────────────────
|
|
9
|
+
async listBounties(query = {}) {
|
|
10
|
+
const params = new URLSearchParams();
|
|
11
|
+
if (query.status) {
|
|
12
|
+
params.set("status", Array.isArray(query.status) ? query.status.join(",") : query.status);
|
|
13
|
+
}
|
|
14
|
+
if (query.repo)
|
|
15
|
+
params.set("repo", query.repo);
|
|
16
|
+
if (query.limit !== undefined)
|
|
17
|
+
params.set("limit", String(query.limit));
|
|
18
|
+
if (query.offset !== undefined)
|
|
19
|
+
params.set("offset", String(query.offset));
|
|
20
|
+
const qs = params.toString();
|
|
21
|
+
return this.#get(`/api/bounties${qs ? `?${qs}` : ""}`);
|
|
22
|
+
}
|
|
23
|
+
async getBounty(bountyId) {
|
|
24
|
+
return this.#get(`/api/bounties/${encodeURIComponent(bountyId)}`);
|
|
25
|
+
}
|
|
26
|
+
async getStats() {
|
|
27
|
+
return this.#get("/api/stats");
|
|
28
|
+
}
|
|
29
|
+
async getClaimIntent(token) {
|
|
30
|
+
return this.#get(`/api/claim-intents/${encodeURIComponent(token)}`);
|
|
31
|
+
}
|
|
32
|
+
// ─── Write endpoints ─────────────────────────────────────────────────
|
|
33
|
+
async confirmClaim(body) {
|
|
34
|
+
return this.#post("/api/claim/confirm", body);
|
|
35
|
+
}
|
|
36
|
+
async confirmSubmit(body) {
|
|
37
|
+
return this.#post("/api/submit/confirm", body);
|
|
38
|
+
}
|
|
39
|
+
async confirmMaintainerAction(body) {
|
|
40
|
+
return this.#post("/api/maintainer/confirm", body);
|
|
41
|
+
}
|
|
42
|
+
async confirmCreate(body) {
|
|
43
|
+
return this.#post("/api/bounties/confirm-create", body);
|
|
44
|
+
}
|
|
45
|
+
// ─── Health ──────────────────────────────────────────────────────────
|
|
46
|
+
async health() {
|
|
47
|
+
return this.#get("/");
|
|
48
|
+
}
|
|
49
|
+
// ─── Internal ────────────────────────────────────────────────────────
|
|
50
|
+
async #get(path) {
|
|
51
|
+
const res = await this.#fetch(`${this.#baseUrl}${path}`);
|
|
52
|
+
if (!res.ok) {
|
|
53
|
+
const body = await res.text();
|
|
54
|
+
throw new GitGrantApiError(res.status, body, path);
|
|
55
|
+
}
|
|
56
|
+
return res.json();
|
|
57
|
+
}
|
|
58
|
+
async #post(path, body) {
|
|
59
|
+
const res = await this.#fetch(`${this.#baseUrl}${path}`, {
|
|
60
|
+
method: "POST",
|
|
61
|
+
headers: { "content-type": "application/json" },
|
|
62
|
+
body: JSON.stringify(body),
|
|
63
|
+
});
|
|
64
|
+
if (!res.ok) {
|
|
65
|
+
const text = await res.text();
|
|
66
|
+
throw new GitGrantApiError(res.status, text, path);
|
|
67
|
+
}
|
|
68
|
+
return res.json();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export class GitGrantApiError extends Error {
|
|
72
|
+
status;
|
|
73
|
+
body;
|
|
74
|
+
path;
|
|
75
|
+
constructor(status, body, path) {
|
|
76
|
+
super(`GitGrant API error ${status} on ${path}: ${body}`);
|
|
77
|
+
this.name = "GitGrantApiError";
|
|
78
|
+
this.status = status;
|
|
79
|
+
this.body = body;
|
|
80
|
+
this.path = path;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAcA,MAAM,OAAO,cAAc;IACzB,QAAQ,CAAS;IACjB,MAAM,CAAe;IAErB,YAAY,IAA2B;QACrC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAChD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAChE,CAAC;IAED,wEAAwE;IAExE,KAAK,CAAC,YAAY,CAAC,QAA2B,EAAE;QAC9C,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YACjB,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KA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9B,MAAM,IAAI,gBAAgB,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACrD,CAAC;QACD,OAAO,GAAG,CAAC,IAAI,EAAgB,CAAC;IAClC,CAAC;CACF;AAED,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC,MAAM,CAAS;IACf,IAAI,CAAS;IACb,IAAI,CAAS;IAEb,YAAY,MAAc,EAAE,IAAY,EAAE,IAAY;QACpD,KAAK,CAAC,sBAAsB,MAAM,OAAO,IAAI,KAAK,IAAI,EAAE,CAAC,CAAC;QAC1D,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type PublicClient, type WalletClient, type Account, type Chain, type Hash } from "viem";
|
|
2
|
+
export interface GitGrantContractOptions {
|
|
3
|
+
publicClient: PublicClient;
|
|
4
|
+
walletClient: WalletClient;
|
|
5
|
+
account: Account;
|
|
6
|
+
escrowAddress: `0x${string}`;
|
|
7
|
+
attestationAddress?: `0x${string}`;
|
|
8
|
+
chain?: Chain;
|
|
9
|
+
}
|
|
10
|
+
export interface OnchainBounty {
|
|
11
|
+
creator: `0x${string}`;
|
|
12
|
+
token: `0x${string}`;
|
|
13
|
+
amount: bigint;
|
|
14
|
+
fee: bigint;
|
|
15
|
+
deadline: bigint;
|
|
16
|
+
claimant: `0x${string}`;
|
|
17
|
+
status: number;
|
|
18
|
+
issueUri: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class GitGrantContract {
|
|
21
|
+
#private;
|
|
22
|
+
publicClient: PublicClient;
|
|
23
|
+
walletClient: WalletClient;
|
|
24
|
+
account: Account;
|
|
25
|
+
escrowAddress: `0x${string}`;
|
|
26
|
+
attestationAddress: `0x${string}`;
|
|
27
|
+
constructor(opts: GitGrantContractOptions);
|
|
28
|
+
/** Create a bounty funded with ETH. Returns the tx hash. */
|
|
29
|
+
createBountyETH(issueUri: string, amountEth: string, deadlineSeconds: number): Promise<Hash>;
|
|
30
|
+
/** Create a bounty funded with ERC20 tokens. The caller must approve the escrow first. */
|
|
31
|
+
createBountyToken(issueUri: string, token: `0x${string}`, totalAmount: bigint, deadlineSeconds: number): Promise<Hash>;
|
|
32
|
+
/** Claim a bounty as a contributor. */
|
|
33
|
+
claim(bountyId: `0x${string}`): Promise<Hash>;
|
|
34
|
+
/** Submit work for a claimed bounty. */
|
|
35
|
+
submit(bountyId: `0x${string}`): Promise<Hash>;
|
|
36
|
+
/** Release payment to the claimant (creator only). */
|
|
37
|
+
release(bountyId: `0x${string}`): Promise<Hash>;
|
|
38
|
+
/** Cancel an open bounty and refund the creator. */
|
|
39
|
+
cancel(bountyId: `0x${string}`): Promise<Hash>;
|
|
40
|
+
/** Expire a bounty past its deadline. */
|
|
41
|
+
expire(bountyId: `0x${string}`): Promise<Hash>;
|
|
42
|
+
/** Dispute a claimed or submitted bounty. */
|
|
43
|
+
dispute(bountyId: `0x${string}`): Promise<Hash>;
|
|
44
|
+
/** Resolve a dispute as the arbiter. */
|
|
45
|
+
resolve(bountyId: `0x${string}`, payClaimant: boolean): Promise<Hash>;
|
|
46
|
+
/** Read a bounty's full onchain state. */
|
|
47
|
+
getBounty(bountyId: `0x${string}`): Promise<OnchainBounty>;
|
|
48
|
+
/** Get the total number of bounties. */
|
|
49
|
+
getBountyCount(): Promise<bigint>;
|
|
50
|
+
/** Compute the deterministic bounty ID for an issue URI. */
|
|
51
|
+
computeId(issueUri: string): Promise<`0x${string}`>;
|
|
52
|
+
/** Get attestations for a contributor address. */
|
|
53
|
+
getContributorAttestations(contributor: `0x${string}`): Promise<readonly bigint[]>;
|
|
54
|
+
/** Get a single attestation by ID. */
|
|
55
|
+
getAttestation(id: bigint): Promise<{
|
|
56
|
+
contributor: `0x${string}`;
|
|
57
|
+
bountyId: `0x${string}`;
|
|
58
|
+
issueUri: string;
|
|
59
|
+
token: `0x${string}`;
|
|
60
|
+
amount: bigint;
|
|
61
|
+
completedAt: bigint;
|
|
62
|
+
}>;
|
|
63
|
+
/** Human-readable status label for a numeric onchain status. */
|
|
64
|
+
statusLabel(statusCode: number): string;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,IAAI,EAGV,MAAM,MAAM,CAAC;AAKd,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,KAAK,MAAM,EAAE,CAAC;IAC7B,kBAAkB,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IACnC,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAID,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB,KAAK,EAAE,KAAK,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAMD,qBAAa,gBAAgB;;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,KAAK,MAAM,EAAE,CAAC;IAC7B,kBAAkB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CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC;IAMzD,kDAAkD;IAC5C,0BAA0B,CAAC,WAAW,EAAE,KAAK,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC;IAMxF,sCAAsC;IAChC,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QACxC,WAAW,EAAE,KAAK,MAAM,EAAE,CAAC;QAC3B,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,KAAK,MAAM,EAAE,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IAaF,gEAAgE;IAChE,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;CAYxC"}
|
package/dist/contract.js
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { parseEther, getAddress, } from "viem";
|
|
2
|
+
import { escrowAbi, attestationAbi } from "./abi.js";
|
|
3
|
+
const STATUS_LABELS = ["None", "Open", "Claimed", "Submitted", "Completed", "Disputed", "Expired", "Cancelled"];
|
|
4
|
+
// ─── Contract wrapper ──────────────────────────────────────────────────
|
|
5
|
+
export class GitGrantContract {
|
|
6
|
+
publicClient;
|
|
7
|
+
walletClient;
|
|
8
|
+
account;
|
|
9
|
+
escrowAddress;
|
|
10
|
+
attestationAddress;
|
|
11
|
+
#chain;
|
|
12
|
+
constructor(opts) {
|
|
13
|
+
this.publicClient = opts.publicClient;
|
|
14
|
+
this.walletClient = opts.walletClient;
|
|
15
|
+
this.account = opts.account;
|
|
16
|
+
this.escrowAddress = getAddress(opts.escrowAddress);
|
|
17
|
+
this.attestationAddress = opts.attestationAddress
|
|
18
|
+
? getAddress(opts.attestationAddress)
|
|
19
|
+
: "0x0000000000000000000000000000000000000000";
|
|
20
|
+
this.#chain = opts.chain;
|
|
21
|
+
}
|
|
22
|
+
// ─── Write: Bounty lifecycle ─────────────────────────────────────────
|
|
23
|
+
#writeOpts(extra = {}) {
|
|
24
|
+
const base = {
|
|
25
|
+
address: this.escrowAddress,
|
|
26
|
+
abi: escrowAbi,
|
|
27
|
+
account: this.account,
|
|
28
|
+
...extra,
|
|
29
|
+
};
|
|
30
|
+
// WalletClient.writeContract requires chain — prefer the one supplied
|
|
31
|
+
// at construction, then fall back to whatever the client already has.
|
|
32
|
+
if (this.#chain)
|
|
33
|
+
base.chain = this.#chain;
|
|
34
|
+
return base;
|
|
35
|
+
}
|
|
36
|
+
#readOpts(extra = {}) {
|
|
37
|
+
const base = {
|
|
38
|
+
address: this.escrowAddress,
|
|
39
|
+
abi: escrowAbi,
|
|
40
|
+
...extra,
|
|
41
|
+
};
|
|
42
|
+
if (this.#chain)
|
|
43
|
+
base.chain = this.#chain;
|
|
44
|
+
return base;
|
|
45
|
+
}
|
|
46
|
+
#attestationReadOpts(extra = {}) {
|
|
47
|
+
const base = {
|
|
48
|
+
address: this.attestationAddress,
|
|
49
|
+
abi: attestationAbi,
|
|
50
|
+
...extra,
|
|
51
|
+
};
|
|
52
|
+
if (this.#chain)
|
|
53
|
+
base.chain = this.#chain;
|
|
54
|
+
return base;
|
|
55
|
+
}
|
|
56
|
+
/** Create a bounty funded with ETH. Returns the tx hash. */
|
|
57
|
+
async createBountyETH(issueUri, amountEth, deadlineSeconds) {
|
|
58
|
+
const deadline = BigInt(Math.floor(Date.now() / 1000) + deadlineSeconds);
|
|
59
|
+
const nonce = await this.#getNonce();
|
|
60
|
+
return this.walletClient.writeContract(this.#writeOpts({
|
|
61
|
+
functionName: "createBountyETH",
|
|
62
|
+
args: [issueUri, deadline],
|
|
63
|
+
value: parseEther(amountEth),
|
|
64
|
+
nonce,
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
/** Create a bounty funded with ERC20 tokens. The caller must approve the escrow first. */
|
|
68
|
+
async createBountyToken(issueUri, token, totalAmount, deadlineSeconds) {
|
|
69
|
+
const deadline = BigInt(Math.floor(Date.now() / 1000) + deadlineSeconds);
|
|
70
|
+
const nonce = await this.#getNonce();
|
|
71
|
+
return this.walletClient.writeContract(this.#writeOpts({
|
|
72
|
+
functionName: "createBountyToken",
|
|
73
|
+
args: [issueUri, token, totalAmount, deadline],
|
|
74
|
+
nonce,
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
/** Claim a bounty as a contributor. */
|
|
78
|
+
async claim(bountyId) {
|
|
79
|
+
const nonce = await this.#getNonce();
|
|
80
|
+
return this.walletClient.writeContract(this.#writeOpts({ functionName: "claim", args: [bountyId], nonce }));
|
|
81
|
+
}
|
|
82
|
+
/** Submit work for a claimed bounty. */
|
|
83
|
+
async submit(bountyId) {
|
|
84
|
+
const nonce = await this.#getNonce();
|
|
85
|
+
return this.walletClient.writeContract(this.#writeOpts({ functionName: "submit", args: [bountyId], nonce }));
|
|
86
|
+
}
|
|
87
|
+
/** Release payment to the claimant (creator only). */
|
|
88
|
+
async release(bountyId) {
|
|
89
|
+
const nonce = await this.#getNonce();
|
|
90
|
+
return this.walletClient.writeContract(this.#writeOpts({ functionName: "release", args: [bountyId], nonce }));
|
|
91
|
+
}
|
|
92
|
+
/** Cancel an open bounty and refund the creator. */
|
|
93
|
+
async cancel(bountyId) {
|
|
94
|
+
const nonce = await this.#getNonce();
|
|
95
|
+
return this.walletClient.writeContract(this.#writeOpts({ functionName: "cancel", args: [bountyId], nonce }));
|
|
96
|
+
}
|
|
97
|
+
/** Expire a bounty past its deadline. */
|
|
98
|
+
async expire(bountyId) {
|
|
99
|
+
const nonce = await this.#getNonce();
|
|
100
|
+
return this.walletClient.writeContract(this.#writeOpts({ functionName: "expire", args: [bountyId], nonce }));
|
|
101
|
+
}
|
|
102
|
+
/** Dispute a claimed or submitted bounty. */
|
|
103
|
+
async dispute(bountyId) {
|
|
104
|
+
const nonce = await this.#getNonce();
|
|
105
|
+
return this.walletClient.writeContract(this.#writeOpts({ functionName: "dispute", args: [bountyId], nonce }));
|
|
106
|
+
}
|
|
107
|
+
/** Resolve a dispute as the arbiter. */
|
|
108
|
+
async resolve(bountyId, payClaimant) {
|
|
109
|
+
const nonce = await this.#getNonce();
|
|
110
|
+
return this.walletClient.writeContract(this.#writeOpts({ functionName: "resolve", args: [bountyId, payClaimant], nonce }));
|
|
111
|
+
}
|
|
112
|
+
// ─── Read: View functions ────────────────────────────────────────────
|
|
113
|
+
/** Read a bounty's full onchain state. */
|
|
114
|
+
async getBounty(bountyId) {
|
|
115
|
+
return this.publicClient.readContract(this.#readOpts({ functionName: "getBounty", args: [bountyId] }));
|
|
116
|
+
}
|
|
117
|
+
/** Get the total number of bounties. */
|
|
118
|
+
async getBountyCount() {
|
|
119
|
+
return this.publicClient.readContract(this.#readOpts({ functionName: "getBountyCount" }));
|
|
120
|
+
}
|
|
121
|
+
/** Compute the deterministic bounty ID for an issue URI. */
|
|
122
|
+
async computeId(issueUri) {
|
|
123
|
+
return this.publicClient.readContract(this.#readOpts({ functionName: "computeId", args: [issueUri] }));
|
|
124
|
+
}
|
|
125
|
+
/** Get attestations for a contributor address. */
|
|
126
|
+
async getContributorAttestations(contributor) {
|
|
127
|
+
return this.publicClient.readContract(this.#attestationReadOpts({ functionName: "getContributorAttestations", args: [contributor] }));
|
|
128
|
+
}
|
|
129
|
+
/** Get a single attestation by ID. */
|
|
130
|
+
async getAttestation(id) {
|
|
131
|
+
return this.publicClient.readContract(this.#attestationReadOpts({ functionName: "getAttestation", args: [id] }));
|
|
132
|
+
}
|
|
133
|
+
/** Human-readable status label for a numeric onchain status. */
|
|
134
|
+
statusLabel(statusCode) {
|
|
135
|
+
return STATUS_LABELS[statusCode] ?? `Unknown(${statusCode})`;
|
|
136
|
+
}
|
|
137
|
+
// ─── Internal ────────────────────────────────────────────────────────
|
|
138
|
+
async #getNonce() {
|
|
139
|
+
return this.publicClient.getTransactionCount({
|
|
140
|
+
address: this.account.address,
|
|
141
|
+
blockTag: "pending",
|
|
142
|
+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AU,CAAC,IAAI,WAAW,UAAU,GAAG,CAAC;IAC/D,CAAC;IAED,wEAAwE;IAExE,KAAK,CAAC,SAAS;QACb,OAAO,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC;YAC3C,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO;YAC7B,QAAQ,EAAE,SAAS;SACpB,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { GitGrantClient, GitGrantApiError } from "./client.js";
|
|
2
|
+
export { GitGrantContract } from "./contract.js";
|
|
3
|
+
export type { GitGrantContractOptions, OnchainBounty } from "./contract.js";
|
|
4
|
+
export { computeBountyId, parseIssueUri, formatWeiToEth, statusLabel, statusEmoji, isTerminalStatus, isActiveStatus, shortAddress, issueUrl } from "./utils.js";
|
|
5
|
+
export { escrowAbi, attestationAbi } from "./abi.js";
|
|
6
|
+
export type { BountyStatus, Bounty, BountyStats, ChainInfo, ClaimIntent, ListBountiesQuery, ListBountiesResponse, GetBountyResponse, StatsResponse, ClaimIntentResponse, ConfirmClaimBody, ConfirmSubmitBody, ConfirmMaintainerActionBody, ConfirmCreateBody, ConfirmResponse, GitGrantClientOptions, } from "./types.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,YAAY,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAChK,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACrD,YAAY,EACV,YAAY,EACZ,MAAM,EACN,WAAW,EACX,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,2BAA2B,EAC3B,iBAAiB,EACjB,eAAe,EACf,qBAAqB,GACtB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { GitGrantClient, GitGrantApiError } from "./client.js";
|
|
2
|
+
export { GitGrantContract } from "./contract.js";
|
|
3
|
+
export { computeBountyId, parseIssueUri, formatWeiToEth, statusLabel, statusEmoji, isTerminalStatus, isActiveStatus, shortAddress, issueUrl } from "./utils.js";
|
|
4
|
+
export { escrowAbi, attestationAbi } from "./abi.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAChK,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
export type BountyStatus = "Open" | "Claimed" | "Submitted" | "Completed" | "Disputed" | "Expired" | "Cancelled";
|
|
2
|
+
export interface OnchainBounty {
|
|
3
|
+
creator: `0x${string}`;
|
|
4
|
+
token: `0x${string}`;
|
|
5
|
+
amount: bigint;
|
|
6
|
+
fee: bigint;
|
|
7
|
+
deadline: bigint;
|
|
8
|
+
claimant: `0x${string}`;
|
|
9
|
+
status: number;
|
|
10
|
+
issueUri: string;
|
|
11
|
+
}
|
|
12
|
+
export interface Bounty {
|
|
13
|
+
bountyId: `0x${string}`;
|
|
14
|
+
issueUri: string;
|
|
15
|
+
repo: string;
|
|
16
|
+
issueNumber: number;
|
|
17
|
+
amountWei: string;
|
|
18
|
+
token: `0x${string}`;
|
|
19
|
+
status: BountyStatus;
|
|
20
|
+
creatorGithub: string | null;
|
|
21
|
+
creatorWallet: `0x${string}`;
|
|
22
|
+
claimantGithub: string | null;
|
|
23
|
+
claimantWallet: `0x${string}` | null;
|
|
24
|
+
deadline: string;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
createTx: `0x${string}` | null;
|
|
28
|
+
claimTx: `0x${string}` | null;
|
|
29
|
+
submitTx: `0x${string}` | null;
|
|
30
|
+
releaseTx: `0x${string}` | null;
|
|
31
|
+
cancelTx: `0x${string}` | null;
|
|
32
|
+
}
|
|
33
|
+
export interface ChainInfo {
|
|
34
|
+
escrowAddress: `0x${string}`;
|
|
35
|
+
chainId: number;
|
|
36
|
+
}
|
|
37
|
+
export interface ListBountiesResponse {
|
|
38
|
+
bounties: Bounty[];
|
|
39
|
+
chain: ChainInfo;
|
|
40
|
+
}
|
|
41
|
+
export interface GetBountyResponse {
|
|
42
|
+
bounty: Bounty;
|
|
43
|
+
chain: ChainInfo;
|
|
44
|
+
}
|
|
45
|
+
export interface BountyStats {
|
|
46
|
+
total: number;
|
|
47
|
+
open: number;
|
|
48
|
+
claimed: number;
|
|
49
|
+
submitted: number;
|
|
50
|
+
completed: number;
|
|
51
|
+
totalEscrowedWei: string;
|
|
52
|
+
totalPaidWei: string;
|
|
53
|
+
}
|
|
54
|
+
export interface StatsResponse {
|
|
55
|
+
stats: BountyStats;
|
|
56
|
+
}
|
|
57
|
+
export interface ClaimIntent {
|
|
58
|
+
token: string;
|
|
59
|
+
bountyId: `0x${string}`;
|
|
60
|
+
githubUsername: string;
|
|
61
|
+
createdAt: string;
|
|
62
|
+
expiresAt: string;
|
|
63
|
+
consumedAt: string | null;
|
|
64
|
+
consumedTx: `0x${string}` | null;
|
|
65
|
+
consumedWallet: `0x${string}` | null;
|
|
66
|
+
}
|
|
67
|
+
export interface ClaimIntentResponse {
|
|
68
|
+
intent: {
|
|
69
|
+
token: string;
|
|
70
|
+
githubUsername: string;
|
|
71
|
+
expiresAt: string;
|
|
72
|
+
};
|
|
73
|
+
bounty: {
|
|
74
|
+
bountyId: `0x${string}`;
|
|
75
|
+
issueUri: string;
|
|
76
|
+
repo: string;
|
|
77
|
+
issueNumber: number;
|
|
78
|
+
amountWei: string;
|
|
79
|
+
token: `0x${string}`;
|
|
80
|
+
status: BountyStatus;
|
|
81
|
+
deadline: string;
|
|
82
|
+
};
|
|
83
|
+
chain: ChainInfo;
|
|
84
|
+
}
|
|
85
|
+
export interface ConfirmClaimBody {
|
|
86
|
+
token: string;
|
|
87
|
+
walletAddress: `0x${string}`;
|
|
88
|
+
txHash: `0x${string}`;
|
|
89
|
+
}
|
|
90
|
+
export interface ConfirmSubmitBody {
|
|
91
|
+
bountyId: `0x${string}`;
|
|
92
|
+
walletAddress: `0x${string}`;
|
|
93
|
+
txHash: `0x${string}`;
|
|
94
|
+
}
|
|
95
|
+
export interface ConfirmMaintainerActionBody {
|
|
96
|
+
bountyId: `0x${string}`;
|
|
97
|
+
walletAddress: `0x${string}`;
|
|
98
|
+
txHash: `0x${string}`;
|
|
99
|
+
action: "release" | "cancel" | "dispute" | "expire";
|
|
100
|
+
}
|
|
101
|
+
export interface ConfirmCreateBody {
|
|
102
|
+
issueUri: string;
|
|
103
|
+
walletAddress: `0x${string}`;
|
|
104
|
+
txHash: `0x${string}`;
|
|
105
|
+
githubUsername?: string;
|
|
106
|
+
}
|
|
107
|
+
export interface ConfirmResponse {
|
|
108
|
+
ok: boolean;
|
|
109
|
+
bountyId?: string;
|
|
110
|
+
status?: string;
|
|
111
|
+
alreadyCreated?: boolean;
|
|
112
|
+
alreadyResolved?: boolean;
|
|
113
|
+
alreadySubmitted?: boolean;
|
|
114
|
+
}
|
|
115
|
+
export interface GitGrantClientOptions {
|
|
116
|
+
baseUrl: string;
|
|
117
|
+
fetch?: typeof fetch;
|
|
118
|
+
}
|
|
119
|
+
export interface ListBountiesQuery {
|
|
120
|
+
status?: BountyStatus | BountyStatus[];
|
|
121
|
+
repo?: string;
|
|
122
|
+
limit?: number;
|
|
123
|
+
offset?: number;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,SAAS,GACT,WAAW,GACX,WAAW,GACX,UAAU,GACV,SAAS,GACT,WAAW,CAAC;AAIhB,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB,KAAK,EAAE,KAAK,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAID,MAAM,WAAW,MAAM;IACrB,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,aAAa,EAAE,MAAM,GAAG,I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AC;CACrD;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,KAAK,MAAM,EAAE,CAAC;IAC7B,MAAM,EAAE,KAAK,MAAM,EAAE,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAID,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAID,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,YAAY,GAAG,YAAY,EAAE,CAAC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,yEAAyE"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { BountyStatus } from "./types.js";
|
|
2
|
+
/** Compute deterministic bounty ID from an issue URI. */
|
|
3
|
+
export declare function computeBountyId(issueUri: string): `0x${string}`;
|
|
4
|
+
/** Parse a bounty issue URI into repo + issue number. */
|
|
5
|
+
export declare function parseIssueUri(uri: string): {
|
|
6
|
+
repo: string;
|
|
7
|
+
issueNumber: number;
|
|
8
|
+
} | null;
|
|
9
|
+
/** Format wei amount to ETH string with up to 6 decimal places. */
|
|
10
|
+
export declare function formatWeiToEth(wei: string | bigint): string;
|
|
11
|
+
/** Human-readable status label. */
|
|
12
|
+
export declare function statusLabel(status: BountyStatus): string;
|
|
13
|
+
/** Status badge emoji for display. */
|
|
14
|
+
export declare function statusEmoji(status: BountyStatus): string;
|
|
15
|
+
/** Check if a status is terminal (no further transitions possible). */
|
|
16
|
+
export declare function isTerminalStatus(status: BountyStatus): boolean;
|
|
17
|
+
/** Check if a status is active (still in play). */
|
|
18
|
+
export declare function isActiveStatus(status: BountyStatus): boolean;
|
|
19
|
+
/** Format a wallet address to a shortened display form. */
|
|
20
|
+
export declare function shortAddress(addr: string): string;
|
|
21
|
+
/** Build a GitHub issue URL from an issue URI. */
|
|
22
|
+
export declare function issueUrl(issueUri: string): string;
|
|
23
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,yDAAyD;AACzD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,CAE/D;AAED,yDAAyD;AACzD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAIvF;AAED,mEAAmE;AACnE,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAG3D;AAED,mCAAmC;AACnC,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAExD;AAED,sCAAsC;AACtC,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAWxD;AAED,uEAAuE;AACvE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAE9D;AAED,mDAAmD;AACnD,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAE5D;AAED,2DAA2D;AAC3D,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGjD;AAED,kDAAkD;AAClD,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIjD"}
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { keccak256, encodePacked, formatEther } from "viem";
|
|
2
|
+
/** Compute deterministic bounty ID from an issue URI. */
|
|
3
|
+
export function computeBountyId(issueUri) {
|
|
4
|
+
return keccak256(encodePacked(["string"], [issueUri]));
|
|
5
|
+
}
|
|
6
|
+
/** Parse a bounty issue URI into repo + issue number. */
|
|
7
|
+
export function parseIssueUri(uri) {
|
|
8
|
+
const match = uri.match(/^github:([A-Za-z0-9._-]+\/[A-Za-z0-9._-]+)#(\d+)$/);
|
|
9
|
+
if (!match)
|
|
10
|
+
return null;
|
|
11
|
+
return { repo: match[1], issueNumber: parseInt(match[2], 10) };
|
|
12
|
+
}
|
|
13
|
+
/** Format wei amount to ETH string with up to 6 decimal places. */
|
|
14
|
+
export function formatWeiToEth(wei) {
|
|
15
|
+
const value = typeof wei === "string" ? BigInt(wei) : wei;
|
|
16
|
+
return formatEther(value);
|
|
17
|
+
}
|
|
18
|
+
/** Human-readable status label. */
|
|
19
|
+
export function statusLabel(status) {
|
|
20
|
+
return status;
|
|
21
|
+
}
|
|
22
|
+
/** Status badge emoji for display. */
|
|
23
|
+
export function statusEmoji(status) {
|
|
24
|
+
const map = {
|
|
25
|
+
Open: "🟢",
|
|
26
|
+
Claimed: "🟡",
|
|
27
|
+
Submitted: "🔵",
|
|
28
|
+
Completed: "✅",
|
|
29
|
+
Disputed: "🔴",
|
|
30
|
+
Expired: "⏰",
|
|
31
|
+
Cancelled: "❌",
|
|
32
|
+
};
|
|
33
|
+
return map[status] ?? "⚪";
|
|
34
|
+
}
|
|
35
|
+
/** Check if a status is terminal (no further transitions possible). */
|
|
36
|
+
export function isTerminalStatus(status) {
|
|
37
|
+
return status === "Completed" || status === "Cancelled" || status === "Expired";
|
|
38
|
+
}
|
|
39
|
+
/** Check if a status is active (still in play). */
|
|
40
|
+
export function isActiveStatus(status) {
|
|
41
|
+
return !isTerminalStatus(status) && status !== "Disputed";
|
|
42
|
+
}
|
|
43
|
+
/** Format a wallet address to a shortened display form. */
|
|
44
|
+
export function shortAddress(addr) {
|
|
45
|
+
if (addr.length < 10)
|
|
46
|
+
return addr;
|
|
47
|
+
return `${addr.slice(0, 6)}...${addr.slice(-4)}`;
|
|
48
|
+
}
|
|
49
|
+
/** Build a GitHub issue URL from an issue URI. */
|
|
50
|
+
export function issueUrl(issueUri) {
|
|
51
|
+
const parsed = parseIssueUri(issueUri);
|
|
52
|
+
if (!parsed)
|
|
53
|
+
return "";
|
|
54
|
+
return `https://github.com/${parsed.repo}/issues/${parsed.issueNumber}`;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAG5D,yDAAyD;AACzD,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,OAAO,SAAS,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;IAC7E,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC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DAAkD;AAClD,MAAM,UAAU,QAAQ,CAAC,QAAgB;IACvC,MAAM,MAAM,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,OAAO,sBAAsB,MAAM,CAAC,IAAI,WAAW,MAAM,CAAC,WAAW,EAAE,CAAC;AAC1E,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gitgrant/sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "GitGrant SDK — typed client for the GitGrant API, onchain contract helpers, and utilities",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"dev": "tsc --watch",
|
|
17
|
+
"typecheck": "tsc --noEmit"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"viem": "^2.23.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"typescript": "^5.7.0"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"viem": "^2.0.0"
|
|
27
|
+
},
|
|
28
|
+
"keywords": ["gitgrant", "bounty", "escrow", "web3", "sdk"],
|
|
29
|
+
"license": "MIT"
|
|
30
|
+
}
|