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