@gitmyabi/finance 1.0.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/README.md +108 -0
- package/contracts/Finance_json.d.ts +1561 -0
- package/contracts/Finance_json.js +1728 -0
- package/contracts/Finance_json.ts +2085 -0
- package/contracts/index.d.ts +2 -0
- package/contracts/index.js +7 -0
- package/contracts/index.ts +3 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +43 -0
|
@@ -0,0 +1,1728 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Finance_json = exports.Finance_jsonAbi = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* Finance_json ABI
|
|
7
|
+
*
|
|
8
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
9
|
+
*/
|
|
10
|
+
exports.Finance_jsonAbi = [
|
|
11
|
+
{
|
|
12
|
+
"constant": true,
|
|
13
|
+
"inputs": [],
|
|
14
|
+
"name": "hasInitialized",
|
|
15
|
+
"outputs": [
|
|
16
|
+
{
|
|
17
|
+
"name": "",
|
|
18
|
+
"type": "bool"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"payable": false,
|
|
22
|
+
"stateMutability": "view",
|
|
23
|
+
"type": "function"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"constant": true,
|
|
27
|
+
"inputs": [],
|
|
28
|
+
"name": "CREATE_PAYMENTS_ROLE",
|
|
29
|
+
"outputs": [
|
|
30
|
+
{
|
|
31
|
+
"name": "",
|
|
32
|
+
"type": "bytes32"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"payable": false,
|
|
36
|
+
"stateMutability": "view",
|
|
37
|
+
"type": "function"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"constant": false,
|
|
41
|
+
"inputs": [
|
|
42
|
+
{
|
|
43
|
+
"name": "_token",
|
|
44
|
+
"type": "address"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "_receiver",
|
|
48
|
+
"type": "address"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "_amount",
|
|
52
|
+
"type": "uint256"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "_initialPaymentTime",
|
|
56
|
+
"type": "uint64"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "_interval",
|
|
60
|
+
"type": "uint64"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "_maxExecutions",
|
|
64
|
+
"type": "uint64"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "_reference",
|
|
68
|
+
"type": "string"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"name": "newScheduledPayment",
|
|
72
|
+
"outputs": [
|
|
73
|
+
{
|
|
74
|
+
"name": "paymentId",
|
|
75
|
+
"type": "uint256"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"payable": false,
|
|
79
|
+
"stateMutability": "nonpayable",
|
|
80
|
+
"type": "function"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"constant": false,
|
|
84
|
+
"inputs": [
|
|
85
|
+
{
|
|
86
|
+
"name": "_paymentId",
|
|
87
|
+
"type": "uint256"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"name": "executePayment",
|
|
91
|
+
"outputs": [],
|
|
92
|
+
"payable": false,
|
|
93
|
+
"stateMutability": "nonpayable",
|
|
94
|
+
"type": "function"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"constant": false,
|
|
98
|
+
"inputs": [
|
|
99
|
+
{
|
|
100
|
+
"name": "_vault",
|
|
101
|
+
"type": "address"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "_periodDuration",
|
|
105
|
+
"type": "uint64"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"name": "initialize",
|
|
109
|
+
"outputs": [],
|
|
110
|
+
"payable": false,
|
|
111
|
+
"stateMutability": "nonpayable",
|
|
112
|
+
"type": "function"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"constant": false,
|
|
116
|
+
"inputs": [
|
|
117
|
+
{
|
|
118
|
+
"name": "_token",
|
|
119
|
+
"type": "address"
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
"name": "removeBudget",
|
|
123
|
+
"outputs": [],
|
|
124
|
+
"payable": false,
|
|
125
|
+
"stateMutability": "nonpayable",
|
|
126
|
+
"type": "function"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"constant": true,
|
|
130
|
+
"inputs": [
|
|
131
|
+
{
|
|
132
|
+
"name": "_token",
|
|
133
|
+
"type": "address"
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"name": "getBudget",
|
|
137
|
+
"outputs": [
|
|
138
|
+
{
|
|
139
|
+
"name": "budget",
|
|
140
|
+
"type": "uint256"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "hasBudget",
|
|
144
|
+
"type": "bool"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"payable": false,
|
|
148
|
+
"stateMutability": "view",
|
|
149
|
+
"type": "function"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"constant": true,
|
|
153
|
+
"inputs": [
|
|
154
|
+
{
|
|
155
|
+
"name": "_script",
|
|
156
|
+
"type": "bytes"
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
"name": "getEVMScriptExecutor",
|
|
160
|
+
"outputs": [
|
|
161
|
+
{
|
|
162
|
+
"name": "",
|
|
163
|
+
"type": "address"
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
"payable": false,
|
|
167
|
+
"stateMutability": "view",
|
|
168
|
+
"type": "function"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"constant": false,
|
|
172
|
+
"inputs": [
|
|
173
|
+
{
|
|
174
|
+
"name": "_paymentId",
|
|
175
|
+
"type": "uint256"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "_active",
|
|
179
|
+
"type": "bool"
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
"name": "setPaymentStatus",
|
|
183
|
+
"outputs": [],
|
|
184
|
+
"payable": false,
|
|
185
|
+
"stateMutability": "nonpayable",
|
|
186
|
+
"type": "function"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"constant": true,
|
|
190
|
+
"inputs": [
|
|
191
|
+
{
|
|
192
|
+
"name": "_paymentId",
|
|
193
|
+
"type": "uint256"
|
|
194
|
+
}
|
|
195
|
+
],
|
|
196
|
+
"name": "getPayment",
|
|
197
|
+
"outputs": [
|
|
198
|
+
{
|
|
199
|
+
"name": "token",
|
|
200
|
+
"type": "address"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"name": "receiver",
|
|
204
|
+
"type": "address"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"name": "amount",
|
|
208
|
+
"type": "uint256"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "initialPaymentTime",
|
|
212
|
+
"type": "uint64"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"name": "interval",
|
|
216
|
+
"type": "uint64"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"name": "maxExecutions",
|
|
220
|
+
"type": "uint64"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"name": "inactive",
|
|
224
|
+
"type": "bool"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"name": "executions",
|
|
228
|
+
"type": "uint64"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"name": "createdBy",
|
|
232
|
+
"type": "address"
|
|
233
|
+
}
|
|
234
|
+
],
|
|
235
|
+
"payable": false,
|
|
236
|
+
"stateMutability": "view",
|
|
237
|
+
"type": "function"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"constant": true,
|
|
241
|
+
"inputs": [],
|
|
242
|
+
"name": "getRecoveryVault",
|
|
243
|
+
"outputs": [
|
|
244
|
+
{
|
|
245
|
+
"name": "",
|
|
246
|
+
"type": "address"
|
|
247
|
+
}
|
|
248
|
+
],
|
|
249
|
+
"payable": false,
|
|
250
|
+
"stateMutability": "view",
|
|
251
|
+
"type": "function"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"constant": true,
|
|
255
|
+
"inputs": [
|
|
256
|
+
{
|
|
257
|
+
"name": "_transactionId",
|
|
258
|
+
"type": "uint256"
|
|
259
|
+
}
|
|
260
|
+
],
|
|
261
|
+
"name": "getTransaction",
|
|
262
|
+
"outputs": [
|
|
263
|
+
{
|
|
264
|
+
"name": "periodId",
|
|
265
|
+
"type": "uint64"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"name": "amount",
|
|
269
|
+
"type": "uint256"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"name": "paymentId",
|
|
273
|
+
"type": "uint256"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"name": "paymentExecutionNumber",
|
|
277
|
+
"type": "uint64"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "token",
|
|
281
|
+
"type": "address"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"name": "entity",
|
|
285
|
+
"type": "address"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"name": "isIncoming",
|
|
289
|
+
"type": "bool"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"name": "date",
|
|
293
|
+
"type": "uint64"
|
|
294
|
+
}
|
|
295
|
+
],
|
|
296
|
+
"payable": false,
|
|
297
|
+
"stateMutability": "view",
|
|
298
|
+
"type": "function"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"constant": true,
|
|
302
|
+
"inputs": [],
|
|
303
|
+
"name": "CHANGE_PERIOD_ROLE",
|
|
304
|
+
"outputs": [
|
|
305
|
+
{
|
|
306
|
+
"name": "",
|
|
307
|
+
"type": "bytes32"
|
|
308
|
+
}
|
|
309
|
+
],
|
|
310
|
+
"payable": false,
|
|
311
|
+
"stateMutability": "view",
|
|
312
|
+
"type": "function"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"constant": true,
|
|
316
|
+
"inputs": [],
|
|
317
|
+
"name": "CHANGE_BUDGETS_ROLE",
|
|
318
|
+
"outputs": [
|
|
319
|
+
{
|
|
320
|
+
"name": "",
|
|
321
|
+
"type": "bytes32"
|
|
322
|
+
}
|
|
323
|
+
],
|
|
324
|
+
"payable": false,
|
|
325
|
+
"stateMutability": "view",
|
|
326
|
+
"type": "function"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"constant": false,
|
|
330
|
+
"inputs": [
|
|
331
|
+
{
|
|
332
|
+
"name": "_paymentId",
|
|
333
|
+
"type": "uint256"
|
|
334
|
+
}
|
|
335
|
+
],
|
|
336
|
+
"name": "receiverExecutePayment",
|
|
337
|
+
"outputs": [],
|
|
338
|
+
"payable": false,
|
|
339
|
+
"stateMutability": "nonpayable",
|
|
340
|
+
"type": "function"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"constant": true,
|
|
344
|
+
"inputs": [
|
|
345
|
+
{
|
|
346
|
+
"name": "_periodId",
|
|
347
|
+
"type": "uint64"
|
|
348
|
+
}
|
|
349
|
+
],
|
|
350
|
+
"name": "getPeriod",
|
|
351
|
+
"outputs": [
|
|
352
|
+
{
|
|
353
|
+
"name": "isCurrent",
|
|
354
|
+
"type": "bool"
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"name": "startTime",
|
|
358
|
+
"type": "uint64"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"name": "endTime",
|
|
362
|
+
"type": "uint64"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"name": "firstTransactionId",
|
|
366
|
+
"type": "uint256"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"name": "lastTransactionId",
|
|
370
|
+
"type": "uint256"
|
|
371
|
+
}
|
|
372
|
+
],
|
|
373
|
+
"payable": false,
|
|
374
|
+
"stateMutability": "view",
|
|
375
|
+
"type": "function"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"constant": false,
|
|
379
|
+
"inputs": [
|
|
380
|
+
{
|
|
381
|
+
"name": "_periodDuration",
|
|
382
|
+
"type": "uint64"
|
|
383
|
+
}
|
|
384
|
+
],
|
|
385
|
+
"name": "setPeriodDuration",
|
|
386
|
+
"outputs": [],
|
|
387
|
+
"payable": false,
|
|
388
|
+
"stateMutability": "nonpayable",
|
|
389
|
+
"type": "function"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"constant": true,
|
|
393
|
+
"inputs": [],
|
|
394
|
+
"name": "periodsLength",
|
|
395
|
+
"outputs": [
|
|
396
|
+
{
|
|
397
|
+
"name": "",
|
|
398
|
+
"type": "uint64"
|
|
399
|
+
}
|
|
400
|
+
],
|
|
401
|
+
"payable": false,
|
|
402
|
+
"stateMutability": "view",
|
|
403
|
+
"type": "function"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"constant": false,
|
|
407
|
+
"inputs": [
|
|
408
|
+
{
|
|
409
|
+
"name": "_token",
|
|
410
|
+
"type": "address"
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"name": "_amount",
|
|
414
|
+
"type": "uint256"
|
|
415
|
+
}
|
|
416
|
+
],
|
|
417
|
+
"name": "setBudget",
|
|
418
|
+
"outputs": [],
|
|
419
|
+
"payable": false,
|
|
420
|
+
"stateMutability": "nonpayable",
|
|
421
|
+
"type": "function"
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"constant": true,
|
|
425
|
+
"inputs": [
|
|
426
|
+
{
|
|
427
|
+
"name": "",
|
|
428
|
+
"type": "address"
|
|
429
|
+
}
|
|
430
|
+
],
|
|
431
|
+
"name": "allowRecoverability",
|
|
432
|
+
"outputs": [
|
|
433
|
+
{
|
|
434
|
+
"name": "",
|
|
435
|
+
"type": "bool"
|
|
436
|
+
}
|
|
437
|
+
],
|
|
438
|
+
"payable": false,
|
|
439
|
+
"stateMutability": "view",
|
|
440
|
+
"type": "function"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"constant": true,
|
|
444
|
+
"inputs": [],
|
|
445
|
+
"name": "appId",
|
|
446
|
+
"outputs": [
|
|
447
|
+
{
|
|
448
|
+
"name": "",
|
|
449
|
+
"type": "bytes32"
|
|
450
|
+
}
|
|
451
|
+
],
|
|
452
|
+
"payable": false,
|
|
453
|
+
"stateMutability": "view",
|
|
454
|
+
"type": "function"
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"constant": true,
|
|
458
|
+
"inputs": [],
|
|
459
|
+
"name": "getInitializationBlock",
|
|
460
|
+
"outputs": [
|
|
461
|
+
{
|
|
462
|
+
"name": "",
|
|
463
|
+
"type": "uint256"
|
|
464
|
+
}
|
|
465
|
+
],
|
|
466
|
+
"payable": false,
|
|
467
|
+
"stateMutability": "view",
|
|
468
|
+
"type": "function"
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
"constant": false,
|
|
472
|
+
"inputs": [
|
|
473
|
+
{
|
|
474
|
+
"name": "_token",
|
|
475
|
+
"type": "address"
|
|
476
|
+
}
|
|
477
|
+
],
|
|
478
|
+
"name": "recoverToVault",
|
|
479
|
+
"outputs": [],
|
|
480
|
+
"payable": false,
|
|
481
|
+
"stateMutability": "nonpayable",
|
|
482
|
+
"type": "function"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"constant": true,
|
|
486
|
+
"inputs": [],
|
|
487
|
+
"name": "EXECUTE_PAYMENTS_ROLE",
|
|
488
|
+
"outputs": [
|
|
489
|
+
{
|
|
490
|
+
"name": "",
|
|
491
|
+
"type": "bytes32"
|
|
492
|
+
}
|
|
493
|
+
],
|
|
494
|
+
"payable": false,
|
|
495
|
+
"stateMutability": "view",
|
|
496
|
+
"type": "function"
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
"constant": true,
|
|
500
|
+
"inputs": [],
|
|
501
|
+
"name": "currentPeriodId",
|
|
502
|
+
"outputs": [
|
|
503
|
+
{
|
|
504
|
+
"name": "",
|
|
505
|
+
"type": "uint64"
|
|
506
|
+
}
|
|
507
|
+
],
|
|
508
|
+
"payable": false,
|
|
509
|
+
"stateMutability": "view",
|
|
510
|
+
"type": "function"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"constant": false,
|
|
514
|
+
"inputs": [
|
|
515
|
+
{
|
|
516
|
+
"name": "_token",
|
|
517
|
+
"type": "address"
|
|
518
|
+
}
|
|
519
|
+
],
|
|
520
|
+
"name": "transferToVault",
|
|
521
|
+
"outputs": [],
|
|
522
|
+
"payable": false,
|
|
523
|
+
"stateMutability": "nonpayable",
|
|
524
|
+
"type": "function"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
"constant": true,
|
|
528
|
+
"inputs": [
|
|
529
|
+
{
|
|
530
|
+
"name": "_sender",
|
|
531
|
+
"type": "address"
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"name": "_role",
|
|
535
|
+
"type": "bytes32"
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
"name": "_params",
|
|
539
|
+
"type": "uint256[]"
|
|
540
|
+
}
|
|
541
|
+
],
|
|
542
|
+
"name": "canPerform",
|
|
543
|
+
"outputs": [
|
|
544
|
+
{
|
|
545
|
+
"name": "",
|
|
546
|
+
"type": "bool"
|
|
547
|
+
}
|
|
548
|
+
],
|
|
549
|
+
"payable": false,
|
|
550
|
+
"stateMutability": "view",
|
|
551
|
+
"type": "function"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"constant": true,
|
|
555
|
+
"inputs": [],
|
|
556
|
+
"name": "getEVMScriptRegistry",
|
|
557
|
+
"outputs": [
|
|
558
|
+
{
|
|
559
|
+
"name": "",
|
|
560
|
+
"type": "address"
|
|
561
|
+
}
|
|
562
|
+
],
|
|
563
|
+
"payable": false,
|
|
564
|
+
"stateMutability": "view",
|
|
565
|
+
"type": "function"
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"constant": false,
|
|
569
|
+
"inputs": [
|
|
570
|
+
{
|
|
571
|
+
"name": "_maxTransitions",
|
|
572
|
+
"type": "uint64"
|
|
573
|
+
}
|
|
574
|
+
],
|
|
575
|
+
"name": "tryTransitionAccountingPeriod",
|
|
576
|
+
"outputs": [
|
|
577
|
+
{
|
|
578
|
+
"name": "success",
|
|
579
|
+
"type": "bool"
|
|
580
|
+
}
|
|
581
|
+
],
|
|
582
|
+
"payable": false,
|
|
583
|
+
"stateMutability": "nonpayable",
|
|
584
|
+
"type": "function"
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
"constant": true,
|
|
588
|
+
"inputs": [],
|
|
589
|
+
"name": "getPeriodDuration",
|
|
590
|
+
"outputs": [
|
|
591
|
+
{
|
|
592
|
+
"name": "",
|
|
593
|
+
"type": "uint64"
|
|
594
|
+
}
|
|
595
|
+
],
|
|
596
|
+
"payable": false,
|
|
597
|
+
"stateMutability": "view",
|
|
598
|
+
"type": "function"
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
"constant": false,
|
|
602
|
+
"inputs": [
|
|
603
|
+
{
|
|
604
|
+
"name": "_token",
|
|
605
|
+
"type": "address"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"name": "_amount",
|
|
609
|
+
"type": "uint256"
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
"name": "_reference",
|
|
613
|
+
"type": "string"
|
|
614
|
+
}
|
|
615
|
+
],
|
|
616
|
+
"name": "deposit",
|
|
617
|
+
"outputs": [],
|
|
618
|
+
"payable": true,
|
|
619
|
+
"stateMutability": "payable",
|
|
620
|
+
"type": "function"
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
"constant": true,
|
|
624
|
+
"inputs": [
|
|
625
|
+
{
|
|
626
|
+
"name": "_paymentId",
|
|
627
|
+
"type": "uint256"
|
|
628
|
+
}
|
|
629
|
+
],
|
|
630
|
+
"name": "nextPaymentTime",
|
|
631
|
+
"outputs": [
|
|
632
|
+
{
|
|
633
|
+
"name": "",
|
|
634
|
+
"type": "uint64"
|
|
635
|
+
}
|
|
636
|
+
],
|
|
637
|
+
"payable": false,
|
|
638
|
+
"stateMutability": "view",
|
|
639
|
+
"type": "function"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
"constant": true,
|
|
643
|
+
"inputs": [
|
|
644
|
+
{
|
|
645
|
+
"name": "_periodId",
|
|
646
|
+
"type": "uint64"
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
"name": "_token",
|
|
650
|
+
"type": "address"
|
|
651
|
+
}
|
|
652
|
+
],
|
|
653
|
+
"name": "getPeriodTokenStatement",
|
|
654
|
+
"outputs": [
|
|
655
|
+
{
|
|
656
|
+
"name": "expenses",
|
|
657
|
+
"type": "uint256"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"name": "income",
|
|
661
|
+
"type": "uint256"
|
|
662
|
+
}
|
|
663
|
+
],
|
|
664
|
+
"payable": false,
|
|
665
|
+
"stateMutability": "view",
|
|
666
|
+
"type": "function"
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
"constant": true,
|
|
670
|
+
"inputs": [],
|
|
671
|
+
"name": "kernel",
|
|
672
|
+
"outputs": [
|
|
673
|
+
{
|
|
674
|
+
"name": "",
|
|
675
|
+
"type": "address"
|
|
676
|
+
}
|
|
677
|
+
],
|
|
678
|
+
"payable": false,
|
|
679
|
+
"stateMutability": "view",
|
|
680
|
+
"type": "function"
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
"constant": true,
|
|
684
|
+
"inputs": [],
|
|
685
|
+
"name": "paymentsNextIndex",
|
|
686
|
+
"outputs": [
|
|
687
|
+
{
|
|
688
|
+
"name": "",
|
|
689
|
+
"type": "uint256"
|
|
690
|
+
}
|
|
691
|
+
],
|
|
692
|
+
"payable": false,
|
|
693
|
+
"stateMutability": "view",
|
|
694
|
+
"type": "function"
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
"constant": true,
|
|
698
|
+
"inputs": [],
|
|
699
|
+
"name": "isPetrified",
|
|
700
|
+
"outputs": [
|
|
701
|
+
{
|
|
702
|
+
"name": "",
|
|
703
|
+
"type": "bool"
|
|
704
|
+
}
|
|
705
|
+
],
|
|
706
|
+
"payable": false,
|
|
707
|
+
"stateMutability": "view",
|
|
708
|
+
"type": "function"
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
"constant": true,
|
|
712
|
+
"inputs": [
|
|
713
|
+
{
|
|
714
|
+
"name": "_token",
|
|
715
|
+
"type": "address"
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
"name": "_amount",
|
|
719
|
+
"type": "uint256"
|
|
720
|
+
}
|
|
721
|
+
],
|
|
722
|
+
"name": "canMakePayment",
|
|
723
|
+
"outputs": [
|
|
724
|
+
{
|
|
725
|
+
"name": "",
|
|
726
|
+
"type": "bool"
|
|
727
|
+
}
|
|
728
|
+
],
|
|
729
|
+
"payable": false,
|
|
730
|
+
"stateMutability": "view",
|
|
731
|
+
"type": "function"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"constant": true,
|
|
735
|
+
"inputs": [],
|
|
736
|
+
"name": "MANAGE_PAYMENTS_ROLE",
|
|
737
|
+
"outputs": [
|
|
738
|
+
{
|
|
739
|
+
"name": "",
|
|
740
|
+
"type": "bytes32"
|
|
741
|
+
}
|
|
742
|
+
],
|
|
743
|
+
"payable": false,
|
|
744
|
+
"stateMutability": "view",
|
|
745
|
+
"type": "function"
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
"constant": true,
|
|
749
|
+
"inputs": [],
|
|
750
|
+
"name": "transactionsNextIndex",
|
|
751
|
+
"outputs": [
|
|
752
|
+
{
|
|
753
|
+
"name": "",
|
|
754
|
+
"type": "uint256"
|
|
755
|
+
}
|
|
756
|
+
],
|
|
757
|
+
"payable": false,
|
|
758
|
+
"stateMutability": "view",
|
|
759
|
+
"type": "function"
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"constant": true,
|
|
763
|
+
"inputs": [
|
|
764
|
+
{
|
|
765
|
+
"name": "_token",
|
|
766
|
+
"type": "address"
|
|
767
|
+
}
|
|
768
|
+
],
|
|
769
|
+
"name": "getRemainingBudget",
|
|
770
|
+
"outputs": [
|
|
771
|
+
{
|
|
772
|
+
"name": "",
|
|
773
|
+
"type": "uint256"
|
|
774
|
+
}
|
|
775
|
+
],
|
|
776
|
+
"payable": false,
|
|
777
|
+
"stateMutability": "view",
|
|
778
|
+
"type": "function"
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
"constant": false,
|
|
782
|
+
"inputs": [
|
|
783
|
+
{
|
|
784
|
+
"name": "_token",
|
|
785
|
+
"type": "address"
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
"name": "_receiver",
|
|
789
|
+
"type": "address"
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
"name": "_amount",
|
|
793
|
+
"type": "uint256"
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
"name": "_reference",
|
|
797
|
+
"type": "string"
|
|
798
|
+
}
|
|
799
|
+
],
|
|
800
|
+
"name": "newImmediatePayment",
|
|
801
|
+
"outputs": [],
|
|
802
|
+
"payable": false,
|
|
803
|
+
"stateMutability": "nonpayable",
|
|
804
|
+
"type": "function"
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
"constant": true,
|
|
808
|
+
"inputs": [],
|
|
809
|
+
"name": "vault",
|
|
810
|
+
"outputs": [
|
|
811
|
+
{
|
|
812
|
+
"name": "",
|
|
813
|
+
"type": "address"
|
|
814
|
+
}
|
|
815
|
+
],
|
|
816
|
+
"payable": false,
|
|
817
|
+
"stateMutability": "view",
|
|
818
|
+
"type": "function"
|
|
819
|
+
},
|
|
820
|
+
{
|
|
821
|
+
"payable": true,
|
|
822
|
+
"stateMutability": "payable",
|
|
823
|
+
"type": "fallback"
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
"anonymous": false,
|
|
827
|
+
"inputs": [
|
|
828
|
+
{
|
|
829
|
+
"indexed": true,
|
|
830
|
+
"name": "periodId",
|
|
831
|
+
"type": "uint64"
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
"indexed": false,
|
|
835
|
+
"name": "periodStarts",
|
|
836
|
+
"type": "uint64"
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
"indexed": false,
|
|
840
|
+
"name": "periodEnds",
|
|
841
|
+
"type": "uint64"
|
|
842
|
+
}
|
|
843
|
+
],
|
|
844
|
+
"name": "NewPeriod",
|
|
845
|
+
"type": "event"
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
"anonymous": false,
|
|
849
|
+
"inputs": [
|
|
850
|
+
{
|
|
851
|
+
"indexed": true,
|
|
852
|
+
"name": "token",
|
|
853
|
+
"type": "address"
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
"indexed": false,
|
|
857
|
+
"name": "amount",
|
|
858
|
+
"type": "uint256"
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
"indexed": false,
|
|
862
|
+
"name": "hasBudget",
|
|
863
|
+
"type": "bool"
|
|
864
|
+
}
|
|
865
|
+
],
|
|
866
|
+
"name": "SetBudget",
|
|
867
|
+
"type": "event"
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
"anonymous": false,
|
|
871
|
+
"inputs": [
|
|
872
|
+
{
|
|
873
|
+
"indexed": true,
|
|
874
|
+
"name": "paymentId",
|
|
875
|
+
"type": "uint256"
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
"indexed": true,
|
|
879
|
+
"name": "recipient",
|
|
880
|
+
"type": "address"
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
"indexed": false,
|
|
884
|
+
"name": "maxExecutions",
|
|
885
|
+
"type": "uint64"
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
"indexed": false,
|
|
889
|
+
"name": "reference",
|
|
890
|
+
"type": "string"
|
|
891
|
+
}
|
|
892
|
+
],
|
|
893
|
+
"name": "NewPayment",
|
|
894
|
+
"type": "event"
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
"anonymous": false,
|
|
898
|
+
"inputs": [
|
|
899
|
+
{
|
|
900
|
+
"indexed": true,
|
|
901
|
+
"name": "transactionId",
|
|
902
|
+
"type": "uint256"
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
"indexed": false,
|
|
906
|
+
"name": "incoming",
|
|
907
|
+
"type": "bool"
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
"indexed": true,
|
|
911
|
+
"name": "entity",
|
|
912
|
+
"type": "address"
|
|
913
|
+
},
|
|
914
|
+
{
|
|
915
|
+
"indexed": false,
|
|
916
|
+
"name": "amount",
|
|
917
|
+
"type": "uint256"
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
"indexed": false,
|
|
921
|
+
"name": "reference",
|
|
922
|
+
"type": "string"
|
|
923
|
+
}
|
|
924
|
+
],
|
|
925
|
+
"name": "NewTransaction",
|
|
926
|
+
"type": "event"
|
|
927
|
+
},
|
|
928
|
+
{
|
|
929
|
+
"anonymous": false,
|
|
930
|
+
"inputs": [
|
|
931
|
+
{
|
|
932
|
+
"indexed": true,
|
|
933
|
+
"name": "paymentId",
|
|
934
|
+
"type": "uint256"
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
"indexed": false,
|
|
938
|
+
"name": "active",
|
|
939
|
+
"type": "bool"
|
|
940
|
+
}
|
|
941
|
+
],
|
|
942
|
+
"name": "ChangePaymentState",
|
|
943
|
+
"type": "event"
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
"anonymous": false,
|
|
947
|
+
"inputs": [
|
|
948
|
+
{
|
|
949
|
+
"indexed": false,
|
|
950
|
+
"name": "newDuration",
|
|
951
|
+
"type": "uint64"
|
|
952
|
+
}
|
|
953
|
+
],
|
|
954
|
+
"name": "ChangePeriodDuration",
|
|
955
|
+
"type": "event"
|
|
956
|
+
},
|
|
957
|
+
{
|
|
958
|
+
"anonymous": false,
|
|
959
|
+
"inputs": [
|
|
960
|
+
{
|
|
961
|
+
"indexed": false,
|
|
962
|
+
"name": "paymentId",
|
|
963
|
+
"type": "uint256"
|
|
964
|
+
}
|
|
965
|
+
],
|
|
966
|
+
"name": "PaymentFailure",
|
|
967
|
+
"type": "event"
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
"anonymous": false,
|
|
971
|
+
"inputs": [
|
|
972
|
+
{
|
|
973
|
+
"indexed": true,
|
|
974
|
+
"name": "executor",
|
|
975
|
+
"type": "address"
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
"indexed": false,
|
|
979
|
+
"name": "script",
|
|
980
|
+
"type": "bytes"
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
"indexed": false,
|
|
984
|
+
"name": "input",
|
|
985
|
+
"type": "bytes"
|
|
986
|
+
},
|
|
987
|
+
{
|
|
988
|
+
"indexed": false,
|
|
989
|
+
"name": "returnData",
|
|
990
|
+
"type": "bytes"
|
|
991
|
+
}
|
|
992
|
+
],
|
|
993
|
+
"name": "ScriptResult",
|
|
994
|
+
"type": "event"
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
"anonymous": false,
|
|
998
|
+
"inputs": [
|
|
999
|
+
{
|
|
1000
|
+
"indexed": true,
|
|
1001
|
+
"name": "vault",
|
|
1002
|
+
"type": "address"
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
"indexed": true,
|
|
1006
|
+
"name": "token",
|
|
1007
|
+
"type": "address"
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
"indexed": false,
|
|
1011
|
+
"name": "amount",
|
|
1012
|
+
"type": "uint256"
|
|
1013
|
+
}
|
|
1014
|
+
],
|
|
1015
|
+
"name": "RecoverToVault",
|
|
1016
|
+
"type": "event"
|
|
1017
|
+
}
|
|
1018
|
+
];
|
|
1019
|
+
/**
|
|
1020
|
+
* Finance_json Contract Class
|
|
1021
|
+
*
|
|
1022
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
1023
|
+
*
|
|
1024
|
+
* @example
|
|
1025
|
+
* ```typescript
|
|
1026
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
1027
|
+
* import { mainnet } from 'viem/chains';
|
|
1028
|
+
* import { Finance_json } from 'Finance_json';
|
|
1029
|
+
*
|
|
1030
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
1031
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
1032
|
+
*
|
|
1033
|
+
* const contract = new Finance_json('0x...', { publicClient, walletClient });
|
|
1034
|
+
*
|
|
1035
|
+
* // Read functions
|
|
1036
|
+
* const result = await contract.balanceOf('0x...');
|
|
1037
|
+
*
|
|
1038
|
+
* // Write functions
|
|
1039
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
1040
|
+
*
|
|
1041
|
+
* // Simulate transactions (dry-run)
|
|
1042
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
1043
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
1044
|
+
*
|
|
1045
|
+
* // Watch events
|
|
1046
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1047
|
+
* console.log('Transfer event:', event);
|
|
1048
|
+
* });
|
|
1049
|
+
* ```
|
|
1050
|
+
*/
|
|
1051
|
+
class Finance_json {
|
|
1052
|
+
constructor(address, clients) {
|
|
1053
|
+
this.contractAddress = address;
|
|
1054
|
+
this.publicClient = clients.publicClient;
|
|
1055
|
+
this.contract = (0, viem_1.getContract)({
|
|
1056
|
+
address,
|
|
1057
|
+
abi: exports.Finance_jsonAbi,
|
|
1058
|
+
client: {
|
|
1059
|
+
public: clients.publicClient,
|
|
1060
|
+
wallet: clients.walletClient,
|
|
1061
|
+
},
|
|
1062
|
+
});
|
|
1063
|
+
}
|
|
1064
|
+
/**
|
|
1065
|
+
* Get the contract address
|
|
1066
|
+
*/
|
|
1067
|
+
get address() {
|
|
1068
|
+
return this.contractAddress;
|
|
1069
|
+
}
|
|
1070
|
+
/**
|
|
1071
|
+
* Get the underlying viem contract instance
|
|
1072
|
+
*/
|
|
1073
|
+
getContract() {
|
|
1074
|
+
return this.contract;
|
|
1075
|
+
}
|
|
1076
|
+
/**
|
|
1077
|
+
* hasInitialized
|
|
1078
|
+
* view
|
|
1079
|
+
*/
|
|
1080
|
+
async hasInitialized() {
|
|
1081
|
+
return this.contract.read.hasInitialized();
|
|
1082
|
+
}
|
|
1083
|
+
/**
|
|
1084
|
+
* CREATE_PAYMENTS_ROLE
|
|
1085
|
+
* view
|
|
1086
|
+
*/
|
|
1087
|
+
async CREATE_PAYMENTS_ROLE() {
|
|
1088
|
+
return this.contract.read.CREATE_PAYMENTS_ROLE();
|
|
1089
|
+
}
|
|
1090
|
+
/**
|
|
1091
|
+
* getBudget
|
|
1092
|
+
* view
|
|
1093
|
+
*/
|
|
1094
|
+
async getBudget(_token) {
|
|
1095
|
+
return this.contract.read.getBudget([_token]);
|
|
1096
|
+
}
|
|
1097
|
+
/**
|
|
1098
|
+
* getEVMScriptExecutor
|
|
1099
|
+
* view
|
|
1100
|
+
*/
|
|
1101
|
+
async getEVMScriptExecutor(_script) {
|
|
1102
|
+
return this.contract.read.getEVMScriptExecutor([_script]);
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* getPayment
|
|
1106
|
+
* view
|
|
1107
|
+
*/
|
|
1108
|
+
async getPayment(_paymentId) {
|
|
1109
|
+
return this.contract.read.getPayment([_paymentId]);
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* getRecoveryVault
|
|
1113
|
+
* view
|
|
1114
|
+
*/
|
|
1115
|
+
async getRecoveryVault() {
|
|
1116
|
+
return this.contract.read.getRecoveryVault();
|
|
1117
|
+
}
|
|
1118
|
+
/**
|
|
1119
|
+
* getTransaction
|
|
1120
|
+
* view
|
|
1121
|
+
*/
|
|
1122
|
+
async getTransaction(_transactionId) {
|
|
1123
|
+
return this.contract.read.getTransaction([_transactionId]);
|
|
1124
|
+
}
|
|
1125
|
+
/**
|
|
1126
|
+
* CHANGE_PERIOD_ROLE
|
|
1127
|
+
* view
|
|
1128
|
+
*/
|
|
1129
|
+
async CHANGE_PERIOD_ROLE() {
|
|
1130
|
+
return this.contract.read.CHANGE_PERIOD_ROLE();
|
|
1131
|
+
}
|
|
1132
|
+
/**
|
|
1133
|
+
* CHANGE_BUDGETS_ROLE
|
|
1134
|
+
* view
|
|
1135
|
+
*/
|
|
1136
|
+
async CHANGE_BUDGETS_ROLE() {
|
|
1137
|
+
return this.contract.read.CHANGE_BUDGETS_ROLE();
|
|
1138
|
+
}
|
|
1139
|
+
/**
|
|
1140
|
+
* getPeriod
|
|
1141
|
+
* view
|
|
1142
|
+
*/
|
|
1143
|
+
async getPeriod(_periodId) {
|
|
1144
|
+
return this.contract.read.getPeriod([_periodId]);
|
|
1145
|
+
}
|
|
1146
|
+
/**
|
|
1147
|
+
* periodsLength
|
|
1148
|
+
* view
|
|
1149
|
+
*/
|
|
1150
|
+
async periodsLength() {
|
|
1151
|
+
return this.contract.read.periodsLength();
|
|
1152
|
+
}
|
|
1153
|
+
/**
|
|
1154
|
+
* allowRecoverability
|
|
1155
|
+
* view
|
|
1156
|
+
*/
|
|
1157
|
+
async allowRecoverability(arg0) {
|
|
1158
|
+
return this.contract.read.allowRecoverability([arg0]);
|
|
1159
|
+
}
|
|
1160
|
+
/**
|
|
1161
|
+
* appId
|
|
1162
|
+
* view
|
|
1163
|
+
*/
|
|
1164
|
+
async appId() {
|
|
1165
|
+
return this.contract.read.appId();
|
|
1166
|
+
}
|
|
1167
|
+
/**
|
|
1168
|
+
* getInitializationBlock
|
|
1169
|
+
* view
|
|
1170
|
+
*/
|
|
1171
|
+
async getInitializationBlock() {
|
|
1172
|
+
return this.contract.read.getInitializationBlock();
|
|
1173
|
+
}
|
|
1174
|
+
/**
|
|
1175
|
+
* EXECUTE_PAYMENTS_ROLE
|
|
1176
|
+
* view
|
|
1177
|
+
*/
|
|
1178
|
+
async EXECUTE_PAYMENTS_ROLE() {
|
|
1179
|
+
return this.contract.read.EXECUTE_PAYMENTS_ROLE();
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* currentPeriodId
|
|
1183
|
+
* view
|
|
1184
|
+
*/
|
|
1185
|
+
async currentPeriodId() {
|
|
1186
|
+
return this.contract.read.currentPeriodId();
|
|
1187
|
+
}
|
|
1188
|
+
/**
|
|
1189
|
+
* canPerform
|
|
1190
|
+
* view
|
|
1191
|
+
*/
|
|
1192
|
+
async canPerform(_sender, _role, _params) {
|
|
1193
|
+
return this.contract.read.canPerform([_sender, _role, _params]);
|
|
1194
|
+
}
|
|
1195
|
+
/**
|
|
1196
|
+
* getEVMScriptRegistry
|
|
1197
|
+
* view
|
|
1198
|
+
*/
|
|
1199
|
+
async getEVMScriptRegistry() {
|
|
1200
|
+
return this.contract.read.getEVMScriptRegistry();
|
|
1201
|
+
}
|
|
1202
|
+
/**
|
|
1203
|
+
* getPeriodDuration
|
|
1204
|
+
* view
|
|
1205
|
+
*/
|
|
1206
|
+
async getPeriodDuration() {
|
|
1207
|
+
return this.contract.read.getPeriodDuration();
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* nextPaymentTime
|
|
1211
|
+
* view
|
|
1212
|
+
*/
|
|
1213
|
+
async nextPaymentTime(_paymentId) {
|
|
1214
|
+
return this.contract.read.nextPaymentTime([_paymentId]);
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* getPeriodTokenStatement
|
|
1218
|
+
* view
|
|
1219
|
+
*/
|
|
1220
|
+
async getPeriodTokenStatement(_periodId, _token) {
|
|
1221
|
+
return this.contract.read.getPeriodTokenStatement([_periodId, _token]);
|
|
1222
|
+
}
|
|
1223
|
+
/**
|
|
1224
|
+
* kernel
|
|
1225
|
+
* view
|
|
1226
|
+
*/
|
|
1227
|
+
async kernel() {
|
|
1228
|
+
return this.contract.read.kernel();
|
|
1229
|
+
}
|
|
1230
|
+
/**
|
|
1231
|
+
* paymentsNextIndex
|
|
1232
|
+
* view
|
|
1233
|
+
*/
|
|
1234
|
+
async paymentsNextIndex() {
|
|
1235
|
+
return this.contract.read.paymentsNextIndex();
|
|
1236
|
+
}
|
|
1237
|
+
/**
|
|
1238
|
+
* isPetrified
|
|
1239
|
+
* view
|
|
1240
|
+
*/
|
|
1241
|
+
async isPetrified() {
|
|
1242
|
+
return this.contract.read.isPetrified();
|
|
1243
|
+
}
|
|
1244
|
+
/**
|
|
1245
|
+
* canMakePayment
|
|
1246
|
+
* view
|
|
1247
|
+
*/
|
|
1248
|
+
async canMakePayment(_token, _amount) {
|
|
1249
|
+
return this.contract.read.canMakePayment([_token, _amount]);
|
|
1250
|
+
}
|
|
1251
|
+
/**
|
|
1252
|
+
* MANAGE_PAYMENTS_ROLE
|
|
1253
|
+
* view
|
|
1254
|
+
*/
|
|
1255
|
+
async MANAGE_PAYMENTS_ROLE() {
|
|
1256
|
+
return this.contract.read.MANAGE_PAYMENTS_ROLE();
|
|
1257
|
+
}
|
|
1258
|
+
/**
|
|
1259
|
+
* transactionsNextIndex
|
|
1260
|
+
* view
|
|
1261
|
+
*/
|
|
1262
|
+
async transactionsNextIndex() {
|
|
1263
|
+
return this.contract.read.transactionsNextIndex();
|
|
1264
|
+
}
|
|
1265
|
+
/**
|
|
1266
|
+
* getRemainingBudget
|
|
1267
|
+
* view
|
|
1268
|
+
*/
|
|
1269
|
+
async getRemainingBudget(_token) {
|
|
1270
|
+
return this.contract.read.getRemainingBudget([_token]);
|
|
1271
|
+
}
|
|
1272
|
+
/**
|
|
1273
|
+
* vault
|
|
1274
|
+
* view
|
|
1275
|
+
*/
|
|
1276
|
+
async vault() {
|
|
1277
|
+
return this.contract.read.vault();
|
|
1278
|
+
}
|
|
1279
|
+
/**
|
|
1280
|
+
* newScheduledPayment
|
|
1281
|
+
* nonpayable
|
|
1282
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1283
|
+
*/
|
|
1284
|
+
async newScheduledPayment(_token, _receiver, _amount, _initialPaymentTime, _interval, _maxExecutions, _reference, options) {
|
|
1285
|
+
if (!this.contract.write) {
|
|
1286
|
+
throw new Error('Wallet client is required for write operations');
|
|
1287
|
+
}
|
|
1288
|
+
return this.contract.write.newScheduledPayment([_token, _receiver, _amount, _initialPaymentTime, _interval, _maxExecutions, _reference], options);
|
|
1289
|
+
}
|
|
1290
|
+
/**
|
|
1291
|
+
* executePayment
|
|
1292
|
+
* nonpayable
|
|
1293
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1294
|
+
*/
|
|
1295
|
+
async executePayment(_paymentId, options) {
|
|
1296
|
+
if (!this.contract.write) {
|
|
1297
|
+
throw new Error('Wallet client is required for write operations');
|
|
1298
|
+
}
|
|
1299
|
+
return this.contract.write.executePayment([_paymentId], options);
|
|
1300
|
+
}
|
|
1301
|
+
/**
|
|
1302
|
+
* initialize
|
|
1303
|
+
* nonpayable
|
|
1304
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1305
|
+
*/
|
|
1306
|
+
async initialize(_vault, _periodDuration, options) {
|
|
1307
|
+
if (!this.contract.write) {
|
|
1308
|
+
throw new Error('Wallet client is required for write operations');
|
|
1309
|
+
}
|
|
1310
|
+
return this.contract.write.initialize([_vault, _periodDuration], options);
|
|
1311
|
+
}
|
|
1312
|
+
/**
|
|
1313
|
+
* removeBudget
|
|
1314
|
+
* nonpayable
|
|
1315
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1316
|
+
*/
|
|
1317
|
+
async removeBudget(_token, options) {
|
|
1318
|
+
if (!this.contract.write) {
|
|
1319
|
+
throw new Error('Wallet client is required for write operations');
|
|
1320
|
+
}
|
|
1321
|
+
return this.contract.write.removeBudget([_token], options);
|
|
1322
|
+
}
|
|
1323
|
+
/**
|
|
1324
|
+
* setPaymentStatus
|
|
1325
|
+
* nonpayable
|
|
1326
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1327
|
+
*/
|
|
1328
|
+
async setPaymentStatus(_paymentId, _active, options) {
|
|
1329
|
+
if (!this.contract.write) {
|
|
1330
|
+
throw new Error('Wallet client is required for write operations');
|
|
1331
|
+
}
|
|
1332
|
+
return this.contract.write.setPaymentStatus([_paymentId, _active], options);
|
|
1333
|
+
}
|
|
1334
|
+
/**
|
|
1335
|
+
* receiverExecutePayment
|
|
1336
|
+
* nonpayable
|
|
1337
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1338
|
+
*/
|
|
1339
|
+
async receiverExecutePayment(_paymentId, options) {
|
|
1340
|
+
if (!this.contract.write) {
|
|
1341
|
+
throw new Error('Wallet client is required for write operations');
|
|
1342
|
+
}
|
|
1343
|
+
return this.contract.write.receiverExecutePayment([_paymentId], options);
|
|
1344
|
+
}
|
|
1345
|
+
/**
|
|
1346
|
+
* setPeriodDuration
|
|
1347
|
+
* nonpayable
|
|
1348
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1349
|
+
*/
|
|
1350
|
+
async setPeriodDuration(_periodDuration, options) {
|
|
1351
|
+
if (!this.contract.write) {
|
|
1352
|
+
throw new Error('Wallet client is required for write operations');
|
|
1353
|
+
}
|
|
1354
|
+
return this.contract.write.setPeriodDuration([_periodDuration], options);
|
|
1355
|
+
}
|
|
1356
|
+
/**
|
|
1357
|
+
* setBudget
|
|
1358
|
+
* nonpayable
|
|
1359
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1360
|
+
*/
|
|
1361
|
+
async setBudget(_token, _amount, options) {
|
|
1362
|
+
if (!this.contract.write) {
|
|
1363
|
+
throw new Error('Wallet client is required for write operations');
|
|
1364
|
+
}
|
|
1365
|
+
return this.contract.write.setBudget([_token, _amount], options);
|
|
1366
|
+
}
|
|
1367
|
+
/**
|
|
1368
|
+
* recoverToVault
|
|
1369
|
+
* nonpayable
|
|
1370
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1371
|
+
*/
|
|
1372
|
+
async recoverToVault(_token, options) {
|
|
1373
|
+
if (!this.contract.write) {
|
|
1374
|
+
throw new Error('Wallet client is required for write operations');
|
|
1375
|
+
}
|
|
1376
|
+
return this.contract.write.recoverToVault([_token], options);
|
|
1377
|
+
}
|
|
1378
|
+
/**
|
|
1379
|
+
* transferToVault
|
|
1380
|
+
* nonpayable
|
|
1381
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1382
|
+
*/
|
|
1383
|
+
async transferToVault(_token, options) {
|
|
1384
|
+
if (!this.contract.write) {
|
|
1385
|
+
throw new Error('Wallet client is required for write operations');
|
|
1386
|
+
}
|
|
1387
|
+
return this.contract.write.transferToVault([_token], options);
|
|
1388
|
+
}
|
|
1389
|
+
/**
|
|
1390
|
+
* tryTransitionAccountingPeriod
|
|
1391
|
+
* nonpayable
|
|
1392
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1393
|
+
*/
|
|
1394
|
+
async tryTransitionAccountingPeriod(_maxTransitions, options) {
|
|
1395
|
+
if (!this.contract.write) {
|
|
1396
|
+
throw new Error('Wallet client is required for write operations');
|
|
1397
|
+
}
|
|
1398
|
+
return this.contract.write.tryTransitionAccountingPeriod([_maxTransitions], options);
|
|
1399
|
+
}
|
|
1400
|
+
/**
|
|
1401
|
+
* deposit
|
|
1402
|
+
* payable
|
|
1403
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1404
|
+
*/
|
|
1405
|
+
async deposit(_token, _amount, _reference, options) {
|
|
1406
|
+
if (!this.contract.write) {
|
|
1407
|
+
throw new Error('Wallet client is required for write operations');
|
|
1408
|
+
}
|
|
1409
|
+
return this.contract.write.deposit([_token, _amount, _reference], options);
|
|
1410
|
+
}
|
|
1411
|
+
/**
|
|
1412
|
+
* newImmediatePayment
|
|
1413
|
+
* nonpayable
|
|
1414
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1415
|
+
*/
|
|
1416
|
+
async newImmediatePayment(_token, _receiver, _amount, _reference, options) {
|
|
1417
|
+
if (!this.contract.write) {
|
|
1418
|
+
throw new Error('Wallet client is required for write operations');
|
|
1419
|
+
}
|
|
1420
|
+
return this.contract.write.newImmediatePayment([_token, _receiver, _amount, _reference], options);
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
1424
|
+
*
|
|
1425
|
+
* @example
|
|
1426
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
1427
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
1428
|
+
* console.log('Would succeed:', result.result);
|
|
1429
|
+
*/
|
|
1430
|
+
get simulate() {
|
|
1431
|
+
const contract = this.contract;
|
|
1432
|
+
if (!contract.simulate) {
|
|
1433
|
+
throw new Error('Public client is required for simulation');
|
|
1434
|
+
}
|
|
1435
|
+
return {
|
|
1436
|
+
/**
|
|
1437
|
+
* Simulate newScheduledPayment
|
|
1438
|
+
* Returns gas estimate and result without sending transaction
|
|
1439
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1440
|
+
*/
|
|
1441
|
+
async newScheduledPayment(_token, _receiver, _amount, _initialPaymentTime, _interval, _maxExecutions, _reference, options) {
|
|
1442
|
+
return contract.simulate.newScheduledPayment([_token, _receiver, _amount, _initialPaymentTime, _interval, _maxExecutions, _reference], options);
|
|
1443
|
+
},
|
|
1444
|
+
/**
|
|
1445
|
+
* Simulate executePayment
|
|
1446
|
+
* Returns gas estimate and result without sending transaction
|
|
1447
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1448
|
+
*/
|
|
1449
|
+
async executePayment(_paymentId, options) {
|
|
1450
|
+
return contract.simulate.executePayment([_paymentId], options);
|
|
1451
|
+
},
|
|
1452
|
+
/**
|
|
1453
|
+
* Simulate initialize
|
|
1454
|
+
* Returns gas estimate and result without sending transaction
|
|
1455
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1456
|
+
*/
|
|
1457
|
+
async initialize(_vault, _periodDuration, options) {
|
|
1458
|
+
return contract.simulate.initialize([_vault, _periodDuration], options);
|
|
1459
|
+
},
|
|
1460
|
+
/**
|
|
1461
|
+
* Simulate removeBudget
|
|
1462
|
+
* Returns gas estimate and result without sending transaction
|
|
1463
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1464
|
+
*/
|
|
1465
|
+
async removeBudget(_token, options) {
|
|
1466
|
+
return contract.simulate.removeBudget([_token], options);
|
|
1467
|
+
},
|
|
1468
|
+
/**
|
|
1469
|
+
* Simulate setPaymentStatus
|
|
1470
|
+
* Returns gas estimate and result without sending transaction
|
|
1471
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1472
|
+
*/
|
|
1473
|
+
async setPaymentStatus(_paymentId, _active, options) {
|
|
1474
|
+
return contract.simulate.setPaymentStatus([_paymentId, _active], options);
|
|
1475
|
+
},
|
|
1476
|
+
/**
|
|
1477
|
+
* Simulate receiverExecutePayment
|
|
1478
|
+
* Returns gas estimate and result without sending transaction
|
|
1479
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1480
|
+
*/
|
|
1481
|
+
async receiverExecutePayment(_paymentId, options) {
|
|
1482
|
+
return contract.simulate.receiverExecutePayment([_paymentId], options);
|
|
1483
|
+
},
|
|
1484
|
+
/**
|
|
1485
|
+
* Simulate setPeriodDuration
|
|
1486
|
+
* Returns gas estimate and result without sending transaction
|
|
1487
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1488
|
+
*/
|
|
1489
|
+
async setPeriodDuration(_periodDuration, options) {
|
|
1490
|
+
return contract.simulate.setPeriodDuration([_periodDuration], options);
|
|
1491
|
+
},
|
|
1492
|
+
/**
|
|
1493
|
+
* Simulate setBudget
|
|
1494
|
+
* Returns gas estimate and result without sending transaction
|
|
1495
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1496
|
+
*/
|
|
1497
|
+
async setBudget(_token, _amount, options) {
|
|
1498
|
+
return contract.simulate.setBudget([_token, _amount], options);
|
|
1499
|
+
},
|
|
1500
|
+
/**
|
|
1501
|
+
* Simulate recoverToVault
|
|
1502
|
+
* Returns gas estimate and result without sending transaction
|
|
1503
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1504
|
+
*/
|
|
1505
|
+
async recoverToVault(_token, options) {
|
|
1506
|
+
return contract.simulate.recoverToVault([_token], options);
|
|
1507
|
+
},
|
|
1508
|
+
/**
|
|
1509
|
+
* Simulate transferToVault
|
|
1510
|
+
* Returns gas estimate and result without sending transaction
|
|
1511
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1512
|
+
*/
|
|
1513
|
+
async transferToVault(_token, options) {
|
|
1514
|
+
return contract.simulate.transferToVault([_token], options);
|
|
1515
|
+
},
|
|
1516
|
+
/**
|
|
1517
|
+
* Simulate tryTransitionAccountingPeriod
|
|
1518
|
+
* Returns gas estimate and result without sending transaction
|
|
1519
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1520
|
+
*/
|
|
1521
|
+
async tryTransitionAccountingPeriod(_maxTransitions, options) {
|
|
1522
|
+
return contract.simulate.tryTransitionAccountingPeriod([_maxTransitions], options);
|
|
1523
|
+
},
|
|
1524
|
+
/**
|
|
1525
|
+
* Simulate deposit
|
|
1526
|
+
* Returns gas estimate and result without sending transaction
|
|
1527
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1528
|
+
*/
|
|
1529
|
+
async deposit(_token, _amount, _reference, options) {
|
|
1530
|
+
return contract.simulate.deposit([_token, _amount, _reference], options);
|
|
1531
|
+
},
|
|
1532
|
+
/**
|
|
1533
|
+
* Simulate newImmediatePayment
|
|
1534
|
+
* Returns gas estimate and result without sending transaction
|
|
1535
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1536
|
+
*/
|
|
1537
|
+
async newImmediatePayment(_token, _receiver, _amount, _reference, options) {
|
|
1538
|
+
return contract.simulate.newImmediatePayment([_token, _receiver, _amount, _reference], options);
|
|
1539
|
+
}
|
|
1540
|
+
};
|
|
1541
|
+
}
|
|
1542
|
+
/**
|
|
1543
|
+
* Watch contract events
|
|
1544
|
+
*
|
|
1545
|
+
* @example
|
|
1546
|
+
* // Watch all Transfer events
|
|
1547
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1548
|
+
* console.log('Transfer:', event);
|
|
1549
|
+
* });
|
|
1550
|
+
*
|
|
1551
|
+
* // Stop watching
|
|
1552
|
+
* unwatch();
|
|
1553
|
+
*/
|
|
1554
|
+
get watch() {
|
|
1555
|
+
return {
|
|
1556
|
+
/**
|
|
1557
|
+
* Watch NewPeriod events
|
|
1558
|
+
* @param callback Function to call when event is emitted
|
|
1559
|
+
* @param filter Optional filter for indexed parameters
|
|
1560
|
+
* @returns Unwatch function to stop listening
|
|
1561
|
+
*/
|
|
1562
|
+
NewPeriod: (callback, filter) => {
|
|
1563
|
+
return this.publicClient.watchContractEvent({
|
|
1564
|
+
address: this.contractAddress,
|
|
1565
|
+
abi: exports.Finance_jsonAbi,
|
|
1566
|
+
eventName: 'NewPeriod',
|
|
1567
|
+
args: filter,
|
|
1568
|
+
onLogs: (logs) => {
|
|
1569
|
+
logs.forEach((log) => {
|
|
1570
|
+
callback(log.args);
|
|
1571
|
+
});
|
|
1572
|
+
},
|
|
1573
|
+
});
|
|
1574
|
+
},
|
|
1575
|
+
/**
|
|
1576
|
+
* Watch SetBudget events
|
|
1577
|
+
* @param callback Function to call when event is emitted
|
|
1578
|
+
* @param filter Optional filter for indexed parameters
|
|
1579
|
+
* @returns Unwatch function to stop listening
|
|
1580
|
+
*/
|
|
1581
|
+
SetBudget: (callback, filter) => {
|
|
1582
|
+
return this.publicClient.watchContractEvent({
|
|
1583
|
+
address: this.contractAddress,
|
|
1584
|
+
abi: exports.Finance_jsonAbi,
|
|
1585
|
+
eventName: 'SetBudget',
|
|
1586
|
+
args: filter,
|
|
1587
|
+
onLogs: (logs) => {
|
|
1588
|
+
logs.forEach((log) => {
|
|
1589
|
+
callback(log.args);
|
|
1590
|
+
});
|
|
1591
|
+
},
|
|
1592
|
+
});
|
|
1593
|
+
},
|
|
1594
|
+
/**
|
|
1595
|
+
* Watch NewPayment events
|
|
1596
|
+
* @param callback Function to call when event is emitted
|
|
1597
|
+
* @param filter Optional filter for indexed parameters
|
|
1598
|
+
* @returns Unwatch function to stop listening
|
|
1599
|
+
*/
|
|
1600
|
+
NewPayment: (callback, filter) => {
|
|
1601
|
+
return this.publicClient.watchContractEvent({
|
|
1602
|
+
address: this.contractAddress,
|
|
1603
|
+
abi: exports.Finance_jsonAbi,
|
|
1604
|
+
eventName: 'NewPayment',
|
|
1605
|
+
args: filter,
|
|
1606
|
+
onLogs: (logs) => {
|
|
1607
|
+
logs.forEach((log) => {
|
|
1608
|
+
callback(log.args);
|
|
1609
|
+
});
|
|
1610
|
+
},
|
|
1611
|
+
});
|
|
1612
|
+
},
|
|
1613
|
+
/**
|
|
1614
|
+
* Watch NewTransaction events
|
|
1615
|
+
* @param callback Function to call when event is emitted
|
|
1616
|
+
* @param filter Optional filter for indexed parameters
|
|
1617
|
+
* @returns Unwatch function to stop listening
|
|
1618
|
+
*/
|
|
1619
|
+
NewTransaction: (callback, filter) => {
|
|
1620
|
+
return this.publicClient.watchContractEvent({
|
|
1621
|
+
address: this.contractAddress,
|
|
1622
|
+
abi: exports.Finance_jsonAbi,
|
|
1623
|
+
eventName: 'NewTransaction',
|
|
1624
|
+
args: filter,
|
|
1625
|
+
onLogs: (logs) => {
|
|
1626
|
+
logs.forEach((log) => {
|
|
1627
|
+
callback(log.args);
|
|
1628
|
+
});
|
|
1629
|
+
},
|
|
1630
|
+
});
|
|
1631
|
+
},
|
|
1632
|
+
/**
|
|
1633
|
+
* Watch ChangePaymentState events
|
|
1634
|
+
* @param callback Function to call when event is emitted
|
|
1635
|
+
* @param filter Optional filter for indexed parameters
|
|
1636
|
+
* @returns Unwatch function to stop listening
|
|
1637
|
+
*/
|
|
1638
|
+
ChangePaymentState: (callback, filter) => {
|
|
1639
|
+
return this.publicClient.watchContractEvent({
|
|
1640
|
+
address: this.contractAddress,
|
|
1641
|
+
abi: exports.Finance_jsonAbi,
|
|
1642
|
+
eventName: 'ChangePaymentState',
|
|
1643
|
+
args: filter,
|
|
1644
|
+
onLogs: (logs) => {
|
|
1645
|
+
logs.forEach((log) => {
|
|
1646
|
+
callback(log.args);
|
|
1647
|
+
});
|
|
1648
|
+
},
|
|
1649
|
+
});
|
|
1650
|
+
},
|
|
1651
|
+
/**
|
|
1652
|
+
* Watch ChangePeriodDuration events
|
|
1653
|
+
* @param callback Function to call when event is emitted
|
|
1654
|
+
* @param filter Optional filter for indexed parameters
|
|
1655
|
+
* @returns Unwatch function to stop listening
|
|
1656
|
+
*/
|
|
1657
|
+
ChangePeriodDuration: (callback) => {
|
|
1658
|
+
return this.publicClient.watchContractEvent({
|
|
1659
|
+
address: this.contractAddress,
|
|
1660
|
+
abi: exports.Finance_jsonAbi,
|
|
1661
|
+
eventName: 'ChangePeriodDuration',
|
|
1662
|
+
onLogs: (logs) => {
|
|
1663
|
+
logs.forEach((log) => {
|
|
1664
|
+
callback(log.args);
|
|
1665
|
+
});
|
|
1666
|
+
},
|
|
1667
|
+
});
|
|
1668
|
+
},
|
|
1669
|
+
/**
|
|
1670
|
+
* Watch PaymentFailure events
|
|
1671
|
+
* @param callback Function to call when event is emitted
|
|
1672
|
+
* @param filter Optional filter for indexed parameters
|
|
1673
|
+
* @returns Unwatch function to stop listening
|
|
1674
|
+
*/
|
|
1675
|
+
PaymentFailure: (callback) => {
|
|
1676
|
+
return this.publicClient.watchContractEvent({
|
|
1677
|
+
address: this.contractAddress,
|
|
1678
|
+
abi: exports.Finance_jsonAbi,
|
|
1679
|
+
eventName: 'PaymentFailure',
|
|
1680
|
+
onLogs: (logs) => {
|
|
1681
|
+
logs.forEach((log) => {
|
|
1682
|
+
callback(log.args);
|
|
1683
|
+
});
|
|
1684
|
+
},
|
|
1685
|
+
});
|
|
1686
|
+
},
|
|
1687
|
+
/**
|
|
1688
|
+
* Watch ScriptResult events
|
|
1689
|
+
* @param callback Function to call when event is emitted
|
|
1690
|
+
* @param filter Optional filter for indexed parameters
|
|
1691
|
+
* @returns Unwatch function to stop listening
|
|
1692
|
+
*/
|
|
1693
|
+
ScriptResult: (callback, filter) => {
|
|
1694
|
+
return this.publicClient.watchContractEvent({
|
|
1695
|
+
address: this.contractAddress,
|
|
1696
|
+
abi: exports.Finance_jsonAbi,
|
|
1697
|
+
eventName: 'ScriptResult',
|
|
1698
|
+
args: filter,
|
|
1699
|
+
onLogs: (logs) => {
|
|
1700
|
+
logs.forEach((log) => {
|
|
1701
|
+
callback(log.args);
|
|
1702
|
+
});
|
|
1703
|
+
},
|
|
1704
|
+
});
|
|
1705
|
+
},
|
|
1706
|
+
/**
|
|
1707
|
+
* Watch RecoverToVault events
|
|
1708
|
+
* @param callback Function to call when event is emitted
|
|
1709
|
+
* @param filter Optional filter for indexed parameters
|
|
1710
|
+
* @returns Unwatch function to stop listening
|
|
1711
|
+
*/
|
|
1712
|
+
RecoverToVault: (callback, filter) => {
|
|
1713
|
+
return this.publicClient.watchContractEvent({
|
|
1714
|
+
address: this.contractAddress,
|
|
1715
|
+
abi: exports.Finance_jsonAbi,
|
|
1716
|
+
eventName: 'RecoverToVault',
|
|
1717
|
+
args: filter,
|
|
1718
|
+
onLogs: (logs) => {
|
|
1719
|
+
logs.forEach((log) => {
|
|
1720
|
+
callback(log.args);
|
|
1721
|
+
});
|
|
1722
|
+
},
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
};
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
exports.Finance_json = Finance_json;
|