@gitmyabi-stg/fpis 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/FPIS.d.ts +1209 -0
- package/contracts/FPIS.js +1246 -0
- package/contracts/FPIS.ts +1612 -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,1246 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FPIS = exports.FPISAbi = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* FPIS ABI
|
|
7
|
+
*
|
|
8
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
9
|
+
*/
|
|
10
|
+
exports.FPISAbi = [
|
|
11
|
+
{
|
|
12
|
+
"inputs": [
|
|
13
|
+
{
|
|
14
|
+
"internalType": "address",
|
|
15
|
+
"name": "_creator_address",
|
|
16
|
+
"type": "address"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"internalType": "address",
|
|
20
|
+
"name": "_timelock_address",
|
|
21
|
+
"type": "address"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"internalType": "address",
|
|
25
|
+
"name": "_fpi_address",
|
|
26
|
+
"type": "address"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"stateMutability": "nonpayable",
|
|
30
|
+
"type": "constructor"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"anonymous": false,
|
|
34
|
+
"inputs": [
|
|
35
|
+
{
|
|
36
|
+
"indexed": true,
|
|
37
|
+
"internalType": "address",
|
|
38
|
+
"name": "owner",
|
|
39
|
+
"type": "address"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"indexed": true,
|
|
43
|
+
"internalType": "address",
|
|
44
|
+
"name": "spender",
|
|
45
|
+
"type": "address"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"indexed": false,
|
|
49
|
+
"internalType": "uint256",
|
|
50
|
+
"name": "value",
|
|
51
|
+
"type": "uint256"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"name": "Approval",
|
|
55
|
+
"type": "event"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"anonymous": false,
|
|
59
|
+
"inputs": [
|
|
60
|
+
{
|
|
61
|
+
"indexed": false,
|
|
62
|
+
"internalType": "address",
|
|
63
|
+
"name": "addr",
|
|
64
|
+
"type": "address"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"name": "FPIAddressSet",
|
|
68
|
+
"type": "event"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"anonymous": false,
|
|
72
|
+
"inputs": [
|
|
73
|
+
{
|
|
74
|
+
"indexed": false,
|
|
75
|
+
"internalType": "address",
|
|
76
|
+
"name": "minter_address",
|
|
77
|
+
"type": "address"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"name": "MinterAdded",
|
|
81
|
+
"type": "event"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"anonymous": false,
|
|
85
|
+
"inputs": [
|
|
86
|
+
{
|
|
87
|
+
"indexed": false,
|
|
88
|
+
"internalType": "address",
|
|
89
|
+
"name": "minter_address",
|
|
90
|
+
"type": "address"
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"name": "MinterRemoved",
|
|
94
|
+
"type": "event"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"anonymous": false,
|
|
98
|
+
"inputs": [
|
|
99
|
+
{
|
|
100
|
+
"indexed": false,
|
|
101
|
+
"internalType": "address",
|
|
102
|
+
"name": "oldOwner",
|
|
103
|
+
"type": "address"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"indexed": false,
|
|
107
|
+
"internalType": "address",
|
|
108
|
+
"name": "newOwner",
|
|
109
|
+
"type": "address"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"name": "OwnerChanged",
|
|
113
|
+
"type": "event"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"anonymous": false,
|
|
117
|
+
"inputs": [
|
|
118
|
+
{
|
|
119
|
+
"indexed": false,
|
|
120
|
+
"internalType": "address",
|
|
121
|
+
"name": "newOwner",
|
|
122
|
+
"type": "address"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"name": "OwnerNominated",
|
|
126
|
+
"type": "event"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"anonymous": false,
|
|
130
|
+
"inputs": [
|
|
131
|
+
{
|
|
132
|
+
"indexed": true,
|
|
133
|
+
"internalType": "address",
|
|
134
|
+
"name": "from",
|
|
135
|
+
"type": "address"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"indexed": true,
|
|
139
|
+
"internalType": "address",
|
|
140
|
+
"name": "to",
|
|
141
|
+
"type": "address"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"indexed": false,
|
|
145
|
+
"internalType": "uint256",
|
|
146
|
+
"name": "amount",
|
|
147
|
+
"type": "uint256"
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"name": "TokenMinterBurned",
|
|
151
|
+
"type": "event"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"anonymous": false,
|
|
155
|
+
"inputs": [
|
|
156
|
+
{
|
|
157
|
+
"indexed": true,
|
|
158
|
+
"internalType": "address",
|
|
159
|
+
"name": "from",
|
|
160
|
+
"type": "address"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"indexed": true,
|
|
164
|
+
"internalType": "address",
|
|
165
|
+
"name": "to",
|
|
166
|
+
"type": "address"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"indexed": false,
|
|
170
|
+
"internalType": "uint256",
|
|
171
|
+
"name": "amount",
|
|
172
|
+
"type": "uint256"
|
|
173
|
+
}
|
|
174
|
+
],
|
|
175
|
+
"name": "TokenMinterMinted",
|
|
176
|
+
"type": "event"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"anonymous": false,
|
|
180
|
+
"inputs": [
|
|
181
|
+
{
|
|
182
|
+
"indexed": true,
|
|
183
|
+
"internalType": "address",
|
|
184
|
+
"name": "from",
|
|
185
|
+
"type": "address"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"indexed": true,
|
|
189
|
+
"internalType": "address",
|
|
190
|
+
"name": "to",
|
|
191
|
+
"type": "address"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"indexed": false,
|
|
195
|
+
"internalType": "uint256",
|
|
196
|
+
"name": "value",
|
|
197
|
+
"type": "uint256"
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
"name": "Transfer",
|
|
201
|
+
"type": "event"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"inputs": [],
|
|
205
|
+
"name": "FPI_TKN",
|
|
206
|
+
"outputs": [
|
|
207
|
+
{
|
|
208
|
+
"internalType": "contract ERC20PermissionedMint",
|
|
209
|
+
"name": "",
|
|
210
|
+
"type": "address"
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
"stateMutability": "view",
|
|
214
|
+
"type": "function"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"inputs": [],
|
|
218
|
+
"name": "acceptOwnership",
|
|
219
|
+
"outputs": [],
|
|
220
|
+
"stateMutability": "nonpayable",
|
|
221
|
+
"type": "function"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"inputs": [
|
|
225
|
+
{
|
|
226
|
+
"internalType": "address",
|
|
227
|
+
"name": "minter_address",
|
|
228
|
+
"type": "address"
|
|
229
|
+
}
|
|
230
|
+
],
|
|
231
|
+
"name": "addMinter",
|
|
232
|
+
"outputs": [],
|
|
233
|
+
"stateMutability": "nonpayable",
|
|
234
|
+
"type": "function"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"inputs": [
|
|
238
|
+
{
|
|
239
|
+
"internalType": "address",
|
|
240
|
+
"name": "owner",
|
|
241
|
+
"type": "address"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"internalType": "address",
|
|
245
|
+
"name": "spender",
|
|
246
|
+
"type": "address"
|
|
247
|
+
}
|
|
248
|
+
],
|
|
249
|
+
"name": "allowance",
|
|
250
|
+
"outputs": [
|
|
251
|
+
{
|
|
252
|
+
"internalType": "uint256",
|
|
253
|
+
"name": "",
|
|
254
|
+
"type": "uint256"
|
|
255
|
+
}
|
|
256
|
+
],
|
|
257
|
+
"stateMutability": "view",
|
|
258
|
+
"type": "function"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"inputs": [
|
|
262
|
+
{
|
|
263
|
+
"internalType": "address",
|
|
264
|
+
"name": "spender",
|
|
265
|
+
"type": "address"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"internalType": "uint256",
|
|
269
|
+
"name": "amount",
|
|
270
|
+
"type": "uint256"
|
|
271
|
+
}
|
|
272
|
+
],
|
|
273
|
+
"name": "approve",
|
|
274
|
+
"outputs": [
|
|
275
|
+
{
|
|
276
|
+
"internalType": "bool",
|
|
277
|
+
"name": "",
|
|
278
|
+
"type": "bool"
|
|
279
|
+
}
|
|
280
|
+
],
|
|
281
|
+
"stateMutability": "nonpayable",
|
|
282
|
+
"type": "function"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"inputs": [
|
|
286
|
+
{
|
|
287
|
+
"internalType": "address",
|
|
288
|
+
"name": "account",
|
|
289
|
+
"type": "address"
|
|
290
|
+
}
|
|
291
|
+
],
|
|
292
|
+
"name": "balanceOf",
|
|
293
|
+
"outputs": [
|
|
294
|
+
{
|
|
295
|
+
"internalType": "uint256",
|
|
296
|
+
"name": "",
|
|
297
|
+
"type": "uint256"
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
"stateMutability": "view",
|
|
301
|
+
"type": "function"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"inputs": [
|
|
305
|
+
{
|
|
306
|
+
"internalType": "uint256",
|
|
307
|
+
"name": "amount",
|
|
308
|
+
"type": "uint256"
|
|
309
|
+
}
|
|
310
|
+
],
|
|
311
|
+
"name": "burn",
|
|
312
|
+
"outputs": [],
|
|
313
|
+
"stateMutability": "nonpayable",
|
|
314
|
+
"type": "function"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"inputs": [
|
|
318
|
+
{
|
|
319
|
+
"internalType": "address",
|
|
320
|
+
"name": "account",
|
|
321
|
+
"type": "address"
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
"internalType": "uint256",
|
|
325
|
+
"name": "amount",
|
|
326
|
+
"type": "uint256"
|
|
327
|
+
}
|
|
328
|
+
],
|
|
329
|
+
"name": "burnFrom",
|
|
330
|
+
"outputs": [],
|
|
331
|
+
"stateMutability": "nonpayable",
|
|
332
|
+
"type": "function"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"inputs": [],
|
|
336
|
+
"name": "decimals",
|
|
337
|
+
"outputs": [
|
|
338
|
+
{
|
|
339
|
+
"internalType": "uint8",
|
|
340
|
+
"name": "",
|
|
341
|
+
"type": "uint8"
|
|
342
|
+
}
|
|
343
|
+
],
|
|
344
|
+
"stateMutability": "view",
|
|
345
|
+
"type": "function"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"inputs": [
|
|
349
|
+
{
|
|
350
|
+
"internalType": "address",
|
|
351
|
+
"name": "spender",
|
|
352
|
+
"type": "address"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"internalType": "uint256",
|
|
356
|
+
"name": "subtractedValue",
|
|
357
|
+
"type": "uint256"
|
|
358
|
+
}
|
|
359
|
+
],
|
|
360
|
+
"name": "decreaseAllowance",
|
|
361
|
+
"outputs": [
|
|
362
|
+
{
|
|
363
|
+
"internalType": "bool",
|
|
364
|
+
"name": "",
|
|
365
|
+
"type": "bool"
|
|
366
|
+
}
|
|
367
|
+
],
|
|
368
|
+
"stateMutability": "nonpayable",
|
|
369
|
+
"type": "function"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"inputs": [
|
|
373
|
+
{
|
|
374
|
+
"internalType": "address",
|
|
375
|
+
"name": "spender",
|
|
376
|
+
"type": "address"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"internalType": "uint256",
|
|
380
|
+
"name": "addedValue",
|
|
381
|
+
"type": "uint256"
|
|
382
|
+
}
|
|
383
|
+
],
|
|
384
|
+
"name": "increaseAllowance",
|
|
385
|
+
"outputs": [
|
|
386
|
+
{
|
|
387
|
+
"internalType": "bool",
|
|
388
|
+
"name": "",
|
|
389
|
+
"type": "bool"
|
|
390
|
+
}
|
|
391
|
+
],
|
|
392
|
+
"stateMutability": "nonpayable",
|
|
393
|
+
"type": "function"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"inputs": [
|
|
397
|
+
{
|
|
398
|
+
"internalType": "address",
|
|
399
|
+
"name": "b_address",
|
|
400
|
+
"type": "address"
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"internalType": "uint256",
|
|
404
|
+
"name": "b_amount",
|
|
405
|
+
"type": "uint256"
|
|
406
|
+
}
|
|
407
|
+
],
|
|
408
|
+
"name": "minter_burn_from",
|
|
409
|
+
"outputs": [],
|
|
410
|
+
"stateMutability": "nonpayable",
|
|
411
|
+
"type": "function"
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"inputs": [
|
|
415
|
+
{
|
|
416
|
+
"internalType": "address",
|
|
417
|
+
"name": "m_address",
|
|
418
|
+
"type": "address"
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"internalType": "uint256",
|
|
422
|
+
"name": "m_amount",
|
|
423
|
+
"type": "uint256"
|
|
424
|
+
}
|
|
425
|
+
],
|
|
426
|
+
"name": "minter_mint",
|
|
427
|
+
"outputs": [],
|
|
428
|
+
"stateMutability": "nonpayable",
|
|
429
|
+
"type": "function"
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"inputs": [
|
|
433
|
+
{
|
|
434
|
+
"internalType": "address",
|
|
435
|
+
"name": "",
|
|
436
|
+
"type": "address"
|
|
437
|
+
}
|
|
438
|
+
],
|
|
439
|
+
"name": "minters",
|
|
440
|
+
"outputs": [
|
|
441
|
+
{
|
|
442
|
+
"internalType": "bool",
|
|
443
|
+
"name": "",
|
|
444
|
+
"type": "bool"
|
|
445
|
+
}
|
|
446
|
+
],
|
|
447
|
+
"stateMutability": "view",
|
|
448
|
+
"type": "function"
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
"inputs": [
|
|
452
|
+
{
|
|
453
|
+
"internalType": "uint256",
|
|
454
|
+
"name": "",
|
|
455
|
+
"type": "uint256"
|
|
456
|
+
}
|
|
457
|
+
],
|
|
458
|
+
"name": "minters_array",
|
|
459
|
+
"outputs": [
|
|
460
|
+
{
|
|
461
|
+
"internalType": "address",
|
|
462
|
+
"name": "",
|
|
463
|
+
"type": "address"
|
|
464
|
+
}
|
|
465
|
+
],
|
|
466
|
+
"stateMutability": "view",
|
|
467
|
+
"type": "function"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
"inputs": [],
|
|
471
|
+
"name": "name",
|
|
472
|
+
"outputs": [
|
|
473
|
+
{
|
|
474
|
+
"internalType": "string",
|
|
475
|
+
"name": "",
|
|
476
|
+
"type": "string"
|
|
477
|
+
}
|
|
478
|
+
],
|
|
479
|
+
"stateMutability": "view",
|
|
480
|
+
"type": "function"
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
"inputs": [
|
|
484
|
+
{
|
|
485
|
+
"internalType": "address",
|
|
486
|
+
"name": "_owner",
|
|
487
|
+
"type": "address"
|
|
488
|
+
}
|
|
489
|
+
],
|
|
490
|
+
"name": "nominateNewOwner",
|
|
491
|
+
"outputs": [],
|
|
492
|
+
"stateMutability": "nonpayable",
|
|
493
|
+
"type": "function"
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"inputs": [],
|
|
497
|
+
"name": "nominatedOwner",
|
|
498
|
+
"outputs": [
|
|
499
|
+
{
|
|
500
|
+
"internalType": "address",
|
|
501
|
+
"name": "",
|
|
502
|
+
"type": "address"
|
|
503
|
+
}
|
|
504
|
+
],
|
|
505
|
+
"stateMutability": "view",
|
|
506
|
+
"type": "function"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"inputs": [],
|
|
510
|
+
"name": "owner",
|
|
511
|
+
"outputs": [
|
|
512
|
+
{
|
|
513
|
+
"internalType": "address",
|
|
514
|
+
"name": "",
|
|
515
|
+
"type": "address"
|
|
516
|
+
}
|
|
517
|
+
],
|
|
518
|
+
"stateMutability": "view",
|
|
519
|
+
"type": "function"
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"inputs": [
|
|
523
|
+
{
|
|
524
|
+
"internalType": "address",
|
|
525
|
+
"name": "minter_address",
|
|
526
|
+
"type": "address"
|
|
527
|
+
}
|
|
528
|
+
],
|
|
529
|
+
"name": "removeMinter",
|
|
530
|
+
"outputs": [],
|
|
531
|
+
"stateMutability": "nonpayable",
|
|
532
|
+
"type": "function"
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
"inputs": [
|
|
536
|
+
{
|
|
537
|
+
"internalType": "address",
|
|
538
|
+
"name": "fpi_contract_address",
|
|
539
|
+
"type": "address"
|
|
540
|
+
}
|
|
541
|
+
],
|
|
542
|
+
"name": "setFPIAddress",
|
|
543
|
+
"outputs": [],
|
|
544
|
+
"stateMutability": "nonpayable",
|
|
545
|
+
"type": "function"
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
"inputs": [],
|
|
549
|
+
"name": "symbol",
|
|
550
|
+
"outputs": [
|
|
551
|
+
{
|
|
552
|
+
"internalType": "string",
|
|
553
|
+
"name": "",
|
|
554
|
+
"type": "string"
|
|
555
|
+
}
|
|
556
|
+
],
|
|
557
|
+
"stateMutability": "view",
|
|
558
|
+
"type": "function"
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"inputs": [],
|
|
562
|
+
"name": "timelock_address",
|
|
563
|
+
"outputs": [
|
|
564
|
+
{
|
|
565
|
+
"internalType": "address",
|
|
566
|
+
"name": "",
|
|
567
|
+
"type": "address"
|
|
568
|
+
}
|
|
569
|
+
],
|
|
570
|
+
"stateMutability": "view",
|
|
571
|
+
"type": "function"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
"inputs": [],
|
|
575
|
+
"name": "totalSupply",
|
|
576
|
+
"outputs": [
|
|
577
|
+
{
|
|
578
|
+
"internalType": "uint256",
|
|
579
|
+
"name": "",
|
|
580
|
+
"type": "uint256"
|
|
581
|
+
}
|
|
582
|
+
],
|
|
583
|
+
"stateMutability": "view",
|
|
584
|
+
"type": "function"
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
"inputs": [
|
|
588
|
+
{
|
|
589
|
+
"internalType": "address",
|
|
590
|
+
"name": "to",
|
|
591
|
+
"type": "address"
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
"internalType": "uint256",
|
|
595
|
+
"name": "amount",
|
|
596
|
+
"type": "uint256"
|
|
597
|
+
}
|
|
598
|
+
],
|
|
599
|
+
"name": "transfer",
|
|
600
|
+
"outputs": [
|
|
601
|
+
{
|
|
602
|
+
"internalType": "bool",
|
|
603
|
+
"name": "",
|
|
604
|
+
"type": "bool"
|
|
605
|
+
}
|
|
606
|
+
],
|
|
607
|
+
"stateMutability": "nonpayable",
|
|
608
|
+
"type": "function"
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
"inputs": [
|
|
612
|
+
{
|
|
613
|
+
"internalType": "address",
|
|
614
|
+
"name": "from",
|
|
615
|
+
"type": "address"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"internalType": "address",
|
|
619
|
+
"name": "to",
|
|
620
|
+
"type": "address"
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
"internalType": "uint256",
|
|
624
|
+
"name": "amount",
|
|
625
|
+
"type": "uint256"
|
|
626
|
+
}
|
|
627
|
+
],
|
|
628
|
+
"name": "transferFrom",
|
|
629
|
+
"outputs": [
|
|
630
|
+
{
|
|
631
|
+
"internalType": "bool",
|
|
632
|
+
"name": "",
|
|
633
|
+
"type": "bool"
|
|
634
|
+
}
|
|
635
|
+
],
|
|
636
|
+
"stateMutability": "nonpayable",
|
|
637
|
+
"type": "function"
|
|
638
|
+
}
|
|
639
|
+
];
|
|
640
|
+
/**
|
|
641
|
+
* FPIS Contract Class
|
|
642
|
+
*
|
|
643
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
644
|
+
*
|
|
645
|
+
* @example
|
|
646
|
+
* ```typescript
|
|
647
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
648
|
+
* import { mainnet } from 'viem/chains';
|
|
649
|
+
* import { FPIS } from 'FPIS';
|
|
650
|
+
*
|
|
651
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
652
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
653
|
+
*
|
|
654
|
+
* const contract = new FPIS('0x...', { publicClient, walletClient });
|
|
655
|
+
*
|
|
656
|
+
* // Read functions
|
|
657
|
+
* const result = await contract.balanceOf('0x...');
|
|
658
|
+
*
|
|
659
|
+
* // Write functions
|
|
660
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
661
|
+
*
|
|
662
|
+
* // Simulate transactions (dry-run)
|
|
663
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
664
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
665
|
+
*
|
|
666
|
+
* // Watch events
|
|
667
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
668
|
+
* console.log('Transfer event:', event);
|
|
669
|
+
* });
|
|
670
|
+
* ```
|
|
671
|
+
*/
|
|
672
|
+
class FPIS {
|
|
673
|
+
constructor(address, clients) {
|
|
674
|
+
this.contractAddress = address;
|
|
675
|
+
this.publicClient = clients.publicClient;
|
|
676
|
+
this.contract = (0, viem_1.getContract)({
|
|
677
|
+
address,
|
|
678
|
+
abi: exports.FPISAbi,
|
|
679
|
+
client: {
|
|
680
|
+
public: clients.publicClient,
|
|
681
|
+
wallet: clients.walletClient,
|
|
682
|
+
},
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
/**
|
|
686
|
+
* Get the contract address
|
|
687
|
+
*/
|
|
688
|
+
get address() {
|
|
689
|
+
return this.contractAddress;
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Get the underlying viem contract instance.
|
|
693
|
+
*/
|
|
694
|
+
getContract() {
|
|
695
|
+
return this.contract;
|
|
696
|
+
}
|
|
697
|
+
/**
|
|
698
|
+
* FPI_TKN
|
|
699
|
+
* view
|
|
700
|
+
*/
|
|
701
|
+
async FPI_TKN() {
|
|
702
|
+
return this.contract.read.FPI_TKN();
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* allowance
|
|
706
|
+
* view
|
|
707
|
+
*/
|
|
708
|
+
async allowance(owner, spender) {
|
|
709
|
+
return this.contract.read.allowance([owner, spender]);
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* balanceOf
|
|
713
|
+
* view
|
|
714
|
+
*/
|
|
715
|
+
async balanceOf(account) {
|
|
716
|
+
return this.contract.read.balanceOf([account]);
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* decimals
|
|
720
|
+
* view
|
|
721
|
+
*/
|
|
722
|
+
async decimals() {
|
|
723
|
+
return this.contract.read.decimals();
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* minters
|
|
727
|
+
* view
|
|
728
|
+
*/
|
|
729
|
+
async minters(arg0) {
|
|
730
|
+
return this.contract.read.minters([arg0]);
|
|
731
|
+
}
|
|
732
|
+
/**
|
|
733
|
+
* minters_array
|
|
734
|
+
* view
|
|
735
|
+
*/
|
|
736
|
+
async minters_array(arg0) {
|
|
737
|
+
return this.contract.read.minters_array([arg0]);
|
|
738
|
+
}
|
|
739
|
+
/**
|
|
740
|
+
* name
|
|
741
|
+
* view
|
|
742
|
+
*/
|
|
743
|
+
async name() {
|
|
744
|
+
return this.contract.read.name();
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* nominatedOwner
|
|
748
|
+
* view
|
|
749
|
+
*/
|
|
750
|
+
async nominatedOwner() {
|
|
751
|
+
return this.contract.read.nominatedOwner();
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* owner
|
|
755
|
+
* view
|
|
756
|
+
*/
|
|
757
|
+
async owner() {
|
|
758
|
+
return this.contract.read.owner();
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* symbol
|
|
762
|
+
* view
|
|
763
|
+
*/
|
|
764
|
+
async symbol() {
|
|
765
|
+
return this.contract.read.symbol();
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* timelock_address
|
|
769
|
+
* view
|
|
770
|
+
*/
|
|
771
|
+
async timelock_address() {
|
|
772
|
+
return this.contract.read.timelock_address();
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* totalSupply
|
|
776
|
+
* view
|
|
777
|
+
*/
|
|
778
|
+
async totalSupply() {
|
|
779
|
+
return this.contract.read.totalSupply();
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* acceptOwnership
|
|
783
|
+
* nonpayable
|
|
784
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
785
|
+
*/
|
|
786
|
+
async acceptOwnership(options) {
|
|
787
|
+
if (!this.contract.write) {
|
|
788
|
+
throw new Error('Wallet client is required for write operations');
|
|
789
|
+
}
|
|
790
|
+
return this.contract.write.acceptOwnership(options);
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* addMinter
|
|
794
|
+
* nonpayable
|
|
795
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
796
|
+
*/
|
|
797
|
+
async addMinter(minter_address, options) {
|
|
798
|
+
if (!this.contract.write) {
|
|
799
|
+
throw new Error('Wallet client is required for write operations');
|
|
800
|
+
}
|
|
801
|
+
return this.contract.write.addMinter([minter_address], options);
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* approve
|
|
805
|
+
* nonpayable
|
|
806
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
807
|
+
*/
|
|
808
|
+
async approve(spender, amount, options) {
|
|
809
|
+
if (!this.contract.write) {
|
|
810
|
+
throw new Error('Wallet client is required for write operations');
|
|
811
|
+
}
|
|
812
|
+
return this.contract.write.approve([spender, amount], options);
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* burn
|
|
816
|
+
* nonpayable
|
|
817
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
818
|
+
*/
|
|
819
|
+
async burn(amount, options) {
|
|
820
|
+
if (!this.contract.write) {
|
|
821
|
+
throw new Error('Wallet client is required for write operations');
|
|
822
|
+
}
|
|
823
|
+
return this.contract.write.burn([amount], options);
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* burnFrom
|
|
827
|
+
* nonpayable
|
|
828
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
829
|
+
*/
|
|
830
|
+
async burnFrom(account, amount, options) {
|
|
831
|
+
if (!this.contract.write) {
|
|
832
|
+
throw new Error('Wallet client is required for write operations');
|
|
833
|
+
}
|
|
834
|
+
return this.contract.write.burnFrom([account, amount], options);
|
|
835
|
+
}
|
|
836
|
+
/**
|
|
837
|
+
* decreaseAllowance
|
|
838
|
+
* nonpayable
|
|
839
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
840
|
+
*/
|
|
841
|
+
async decreaseAllowance(spender, subtractedValue, options) {
|
|
842
|
+
if (!this.contract.write) {
|
|
843
|
+
throw new Error('Wallet client is required for write operations');
|
|
844
|
+
}
|
|
845
|
+
return this.contract.write.decreaseAllowance([spender, subtractedValue], options);
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* increaseAllowance
|
|
849
|
+
* nonpayable
|
|
850
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
851
|
+
*/
|
|
852
|
+
async increaseAllowance(spender, addedValue, options) {
|
|
853
|
+
if (!this.contract.write) {
|
|
854
|
+
throw new Error('Wallet client is required for write operations');
|
|
855
|
+
}
|
|
856
|
+
return this.contract.write.increaseAllowance([spender, addedValue], options);
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* minter_burn_from
|
|
860
|
+
* nonpayable
|
|
861
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
862
|
+
*/
|
|
863
|
+
async minter_burn_from(b_address, b_amount, options) {
|
|
864
|
+
if (!this.contract.write) {
|
|
865
|
+
throw new Error('Wallet client is required for write operations');
|
|
866
|
+
}
|
|
867
|
+
return this.contract.write.minter_burn_from([b_address, b_amount], options);
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* minter_mint
|
|
871
|
+
* nonpayable
|
|
872
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
873
|
+
*/
|
|
874
|
+
async minter_mint(m_address, m_amount, options) {
|
|
875
|
+
if (!this.contract.write) {
|
|
876
|
+
throw new Error('Wallet client is required for write operations');
|
|
877
|
+
}
|
|
878
|
+
return this.contract.write.minter_mint([m_address, m_amount], options);
|
|
879
|
+
}
|
|
880
|
+
/**
|
|
881
|
+
* nominateNewOwner
|
|
882
|
+
* nonpayable
|
|
883
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
884
|
+
*/
|
|
885
|
+
async nominateNewOwner(_owner, options) {
|
|
886
|
+
if (!this.contract.write) {
|
|
887
|
+
throw new Error('Wallet client is required for write operations');
|
|
888
|
+
}
|
|
889
|
+
return this.contract.write.nominateNewOwner([_owner], options);
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* removeMinter
|
|
893
|
+
* nonpayable
|
|
894
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
895
|
+
*/
|
|
896
|
+
async removeMinter(minter_address, options) {
|
|
897
|
+
if (!this.contract.write) {
|
|
898
|
+
throw new Error('Wallet client is required for write operations');
|
|
899
|
+
}
|
|
900
|
+
return this.contract.write.removeMinter([minter_address], options);
|
|
901
|
+
}
|
|
902
|
+
/**
|
|
903
|
+
* setFPIAddress
|
|
904
|
+
* nonpayable
|
|
905
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
906
|
+
*/
|
|
907
|
+
async setFPIAddress(fpi_contract_address, options) {
|
|
908
|
+
if (!this.contract.write) {
|
|
909
|
+
throw new Error('Wallet client is required for write operations');
|
|
910
|
+
}
|
|
911
|
+
return this.contract.write.setFPIAddress([fpi_contract_address], options);
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* transfer
|
|
915
|
+
* nonpayable
|
|
916
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
917
|
+
*/
|
|
918
|
+
async transfer(to, amount, options) {
|
|
919
|
+
if (!this.contract.write) {
|
|
920
|
+
throw new Error('Wallet client is required for write operations');
|
|
921
|
+
}
|
|
922
|
+
return this.contract.write.transfer([to, amount], options);
|
|
923
|
+
}
|
|
924
|
+
/**
|
|
925
|
+
* transferFrom
|
|
926
|
+
* nonpayable
|
|
927
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
928
|
+
*/
|
|
929
|
+
async transferFrom(from, to, amount, options) {
|
|
930
|
+
if (!this.contract.write) {
|
|
931
|
+
throw new Error('Wallet client is required for write operations');
|
|
932
|
+
}
|
|
933
|
+
return this.contract.write.transferFrom([from, to, amount], options);
|
|
934
|
+
}
|
|
935
|
+
/**
|
|
936
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
937
|
+
*
|
|
938
|
+
* @example
|
|
939
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
940
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
941
|
+
* console.log('Would succeed:', result.result);
|
|
942
|
+
*/
|
|
943
|
+
get simulate() {
|
|
944
|
+
const contract = this.contract;
|
|
945
|
+
if (!contract.simulate) {
|
|
946
|
+
throw new Error('Public client is required for simulation');
|
|
947
|
+
}
|
|
948
|
+
return {
|
|
949
|
+
/**
|
|
950
|
+
* Simulate acceptOwnership
|
|
951
|
+
* Returns gas estimate and result without sending transaction
|
|
952
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
953
|
+
*/
|
|
954
|
+
async acceptOwnership(options) {
|
|
955
|
+
return contract.simulate.acceptOwnership(options);
|
|
956
|
+
},
|
|
957
|
+
/**
|
|
958
|
+
* Simulate addMinter
|
|
959
|
+
* Returns gas estimate and result without sending transaction
|
|
960
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
961
|
+
*/
|
|
962
|
+
async addMinter(minter_address, options) {
|
|
963
|
+
return contract.simulate.addMinter([minter_address], options);
|
|
964
|
+
},
|
|
965
|
+
/**
|
|
966
|
+
* Simulate approve
|
|
967
|
+
* Returns gas estimate and result without sending transaction
|
|
968
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
969
|
+
*/
|
|
970
|
+
async approve(spender, amount, options) {
|
|
971
|
+
return contract.simulate.approve([spender, amount], options);
|
|
972
|
+
},
|
|
973
|
+
/**
|
|
974
|
+
* Simulate burn
|
|
975
|
+
* Returns gas estimate and result without sending transaction
|
|
976
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
977
|
+
*/
|
|
978
|
+
async burn(amount, options) {
|
|
979
|
+
return contract.simulate.burn([amount], options);
|
|
980
|
+
},
|
|
981
|
+
/**
|
|
982
|
+
* Simulate burnFrom
|
|
983
|
+
* Returns gas estimate and result without sending transaction
|
|
984
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
985
|
+
*/
|
|
986
|
+
async burnFrom(account, amount, options) {
|
|
987
|
+
return contract.simulate.burnFrom([account, amount], options);
|
|
988
|
+
},
|
|
989
|
+
/**
|
|
990
|
+
* Simulate decreaseAllowance
|
|
991
|
+
* Returns gas estimate and result without sending transaction
|
|
992
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
993
|
+
*/
|
|
994
|
+
async decreaseAllowance(spender, subtractedValue, options) {
|
|
995
|
+
return contract.simulate.decreaseAllowance([spender, subtractedValue], options);
|
|
996
|
+
},
|
|
997
|
+
/**
|
|
998
|
+
* Simulate increaseAllowance
|
|
999
|
+
* Returns gas estimate and result without sending transaction
|
|
1000
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1001
|
+
*/
|
|
1002
|
+
async increaseAllowance(spender, addedValue, options) {
|
|
1003
|
+
return contract.simulate.increaseAllowance([spender, addedValue], options);
|
|
1004
|
+
},
|
|
1005
|
+
/**
|
|
1006
|
+
* Simulate minter_burn_from
|
|
1007
|
+
* Returns gas estimate and result without sending transaction
|
|
1008
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1009
|
+
*/
|
|
1010
|
+
async minter_burn_from(b_address, b_amount, options) {
|
|
1011
|
+
return contract.simulate.minter_burn_from([b_address, b_amount], options);
|
|
1012
|
+
},
|
|
1013
|
+
/**
|
|
1014
|
+
* Simulate minter_mint
|
|
1015
|
+
* Returns gas estimate and result without sending transaction
|
|
1016
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1017
|
+
*/
|
|
1018
|
+
async minter_mint(m_address, m_amount, options) {
|
|
1019
|
+
return contract.simulate.minter_mint([m_address, m_amount], options);
|
|
1020
|
+
},
|
|
1021
|
+
/**
|
|
1022
|
+
* Simulate nominateNewOwner
|
|
1023
|
+
* Returns gas estimate and result without sending transaction
|
|
1024
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1025
|
+
*/
|
|
1026
|
+
async nominateNewOwner(_owner, options) {
|
|
1027
|
+
return contract.simulate.nominateNewOwner([_owner], options);
|
|
1028
|
+
},
|
|
1029
|
+
/**
|
|
1030
|
+
* Simulate removeMinter
|
|
1031
|
+
* Returns gas estimate and result without sending transaction
|
|
1032
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1033
|
+
*/
|
|
1034
|
+
async removeMinter(minter_address, options) {
|
|
1035
|
+
return contract.simulate.removeMinter([minter_address], options);
|
|
1036
|
+
},
|
|
1037
|
+
/**
|
|
1038
|
+
* Simulate setFPIAddress
|
|
1039
|
+
* Returns gas estimate and result without sending transaction
|
|
1040
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1041
|
+
*/
|
|
1042
|
+
async setFPIAddress(fpi_contract_address, options) {
|
|
1043
|
+
return contract.simulate.setFPIAddress([fpi_contract_address], options);
|
|
1044
|
+
},
|
|
1045
|
+
/**
|
|
1046
|
+
* Simulate transfer
|
|
1047
|
+
* Returns gas estimate and result without sending transaction
|
|
1048
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1049
|
+
*/
|
|
1050
|
+
async transfer(to, amount, options) {
|
|
1051
|
+
return contract.simulate.transfer([to, amount], options);
|
|
1052
|
+
},
|
|
1053
|
+
/**
|
|
1054
|
+
* Simulate transferFrom
|
|
1055
|
+
* Returns gas estimate and result without sending transaction
|
|
1056
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1057
|
+
*/
|
|
1058
|
+
async transferFrom(from, to, amount, options) {
|
|
1059
|
+
return contract.simulate.transferFrom([from, to, amount], options);
|
|
1060
|
+
}
|
|
1061
|
+
};
|
|
1062
|
+
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Watch contract events
|
|
1065
|
+
*
|
|
1066
|
+
* @example
|
|
1067
|
+
* // Watch all Transfer events
|
|
1068
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1069
|
+
* console.log('Transfer:', event);
|
|
1070
|
+
* });
|
|
1071
|
+
*
|
|
1072
|
+
* // Stop watching
|
|
1073
|
+
* unwatch();
|
|
1074
|
+
*/
|
|
1075
|
+
get watch() {
|
|
1076
|
+
return {
|
|
1077
|
+
/**
|
|
1078
|
+
* Watch Approval events
|
|
1079
|
+
* @param callback Function to call when event is emitted
|
|
1080
|
+
* @param filter Optional filter for indexed parameters
|
|
1081
|
+
* @returns Unwatch function to stop listening
|
|
1082
|
+
*/
|
|
1083
|
+
Approval: (callback, filter) => {
|
|
1084
|
+
return this.publicClient.watchContractEvent({
|
|
1085
|
+
address: this.contractAddress,
|
|
1086
|
+
abi: exports.FPISAbi,
|
|
1087
|
+
eventName: 'Approval',
|
|
1088
|
+
args: filter,
|
|
1089
|
+
onLogs: (logs) => {
|
|
1090
|
+
logs.forEach((log) => {
|
|
1091
|
+
callback(log.args);
|
|
1092
|
+
});
|
|
1093
|
+
},
|
|
1094
|
+
});
|
|
1095
|
+
},
|
|
1096
|
+
/**
|
|
1097
|
+
* Watch FPIAddressSet events
|
|
1098
|
+
* @param callback Function to call when event is emitted
|
|
1099
|
+
* @param filter Optional filter for indexed parameters
|
|
1100
|
+
* @returns Unwatch function to stop listening
|
|
1101
|
+
*/
|
|
1102
|
+
FPIAddressSet: (callback) => {
|
|
1103
|
+
return this.publicClient.watchContractEvent({
|
|
1104
|
+
address: this.contractAddress,
|
|
1105
|
+
abi: exports.FPISAbi,
|
|
1106
|
+
eventName: 'FPIAddressSet',
|
|
1107
|
+
onLogs: (logs) => {
|
|
1108
|
+
logs.forEach((log) => {
|
|
1109
|
+
callback(log.args);
|
|
1110
|
+
});
|
|
1111
|
+
},
|
|
1112
|
+
});
|
|
1113
|
+
},
|
|
1114
|
+
/**
|
|
1115
|
+
* Watch MinterAdded events
|
|
1116
|
+
* @param callback Function to call when event is emitted
|
|
1117
|
+
* @param filter Optional filter for indexed parameters
|
|
1118
|
+
* @returns Unwatch function to stop listening
|
|
1119
|
+
*/
|
|
1120
|
+
MinterAdded: (callback) => {
|
|
1121
|
+
return this.publicClient.watchContractEvent({
|
|
1122
|
+
address: this.contractAddress,
|
|
1123
|
+
abi: exports.FPISAbi,
|
|
1124
|
+
eventName: 'MinterAdded',
|
|
1125
|
+
onLogs: (logs) => {
|
|
1126
|
+
logs.forEach((log) => {
|
|
1127
|
+
callback(log.args);
|
|
1128
|
+
});
|
|
1129
|
+
},
|
|
1130
|
+
});
|
|
1131
|
+
},
|
|
1132
|
+
/**
|
|
1133
|
+
* Watch MinterRemoved events
|
|
1134
|
+
* @param callback Function to call when event is emitted
|
|
1135
|
+
* @param filter Optional filter for indexed parameters
|
|
1136
|
+
* @returns Unwatch function to stop listening
|
|
1137
|
+
*/
|
|
1138
|
+
MinterRemoved: (callback) => {
|
|
1139
|
+
return this.publicClient.watchContractEvent({
|
|
1140
|
+
address: this.contractAddress,
|
|
1141
|
+
abi: exports.FPISAbi,
|
|
1142
|
+
eventName: 'MinterRemoved',
|
|
1143
|
+
onLogs: (logs) => {
|
|
1144
|
+
logs.forEach((log) => {
|
|
1145
|
+
callback(log.args);
|
|
1146
|
+
});
|
|
1147
|
+
},
|
|
1148
|
+
});
|
|
1149
|
+
},
|
|
1150
|
+
/**
|
|
1151
|
+
* Watch OwnerChanged events
|
|
1152
|
+
* @param callback Function to call when event is emitted
|
|
1153
|
+
* @param filter Optional filter for indexed parameters
|
|
1154
|
+
* @returns Unwatch function to stop listening
|
|
1155
|
+
*/
|
|
1156
|
+
OwnerChanged: (callback) => {
|
|
1157
|
+
return this.publicClient.watchContractEvent({
|
|
1158
|
+
address: this.contractAddress,
|
|
1159
|
+
abi: exports.FPISAbi,
|
|
1160
|
+
eventName: 'OwnerChanged',
|
|
1161
|
+
onLogs: (logs) => {
|
|
1162
|
+
logs.forEach((log) => {
|
|
1163
|
+
callback(log.args);
|
|
1164
|
+
});
|
|
1165
|
+
},
|
|
1166
|
+
});
|
|
1167
|
+
},
|
|
1168
|
+
/**
|
|
1169
|
+
* Watch OwnerNominated events
|
|
1170
|
+
* @param callback Function to call when event is emitted
|
|
1171
|
+
* @param filter Optional filter for indexed parameters
|
|
1172
|
+
* @returns Unwatch function to stop listening
|
|
1173
|
+
*/
|
|
1174
|
+
OwnerNominated: (callback) => {
|
|
1175
|
+
return this.publicClient.watchContractEvent({
|
|
1176
|
+
address: this.contractAddress,
|
|
1177
|
+
abi: exports.FPISAbi,
|
|
1178
|
+
eventName: 'OwnerNominated',
|
|
1179
|
+
onLogs: (logs) => {
|
|
1180
|
+
logs.forEach((log) => {
|
|
1181
|
+
callback(log.args);
|
|
1182
|
+
});
|
|
1183
|
+
},
|
|
1184
|
+
});
|
|
1185
|
+
},
|
|
1186
|
+
/**
|
|
1187
|
+
* Watch TokenMinterBurned events
|
|
1188
|
+
* @param callback Function to call when event is emitted
|
|
1189
|
+
* @param filter Optional filter for indexed parameters
|
|
1190
|
+
* @returns Unwatch function to stop listening
|
|
1191
|
+
*/
|
|
1192
|
+
TokenMinterBurned: (callback, filter) => {
|
|
1193
|
+
return this.publicClient.watchContractEvent({
|
|
1194
|
+
address: this.contractAddress,
|
|
1195
|
+
abi: exports.FPISAbi,
|
|
1196
|
+
eventName: 'TokenMinterBurned',
|
|
1197
|
+
args: filter,
|
|
1198
|
+
onLogs: (logs) => {
|
|
1199
|
+
logs.forEach((log) => {
|
|
1200
|
+
callback(log.args);
|
|
1201
|
+
});
|
|
1202
|
+
},
|
|
1203
|
+
});
|
|
1204
|
+
},
|
|
1205
|
+
/**
|
|
1206
|
+
* Watch TokenMinterMinted events
|
|
1207
|
+
* @param callback Function to call when event is emitted
|
|
1208
|
+
* @param filter Optional filter for indexed parameters
|
|
1209
|
+
* @returns Unwatch function to stop listening
|
|
1210
|
+
*/
|
|
1211
|
+
TokenMinterMinted: (callback, filter) => {
|
|
1212
|
+
return this.publicClient.watchContractEvent({
|
|
1213
|
+
address: this.contractAddress,
|
|
1214
|
+
abi: exports.FPISAbi,
|
|
1215
|
+
eventName: 'TokenMinterMinted',
|
|
1216
|
+
args: filter,
|
|
1217
|
+
onLogs: (logs) => {
|
|
1218
|
+
logs.forEach((log) => {
|
|
1219
|
+
callback(log.args);
|
|
1220
|
+
});
|
|
1221
|
+
},
|
|
1222
|
+
});
|
|
1223
|
+
},
|
|
1224
|
+
/**
|
|
1225
|
+
* Watch Transfer events
|
|
1226
|
+
* @param callback Function to call when event is emitted
|
|
1227
|
+
* @param filter Optional filter for indexed parameters
|
|
1228
|
+
* @returns Unwatch function to stop listening
|
|
1229
|
+
*/
|
|
1230
|
+
Transfer: (callback, filter) => {
|
|
1231
|
+
return this.publicClient.watchContractEvent({
|
|
1232
|
+
address: this.contractAddress,
|
|
1233
|
+
abi: exports.FPISAbi,
|
|
1234
|
+
eventName: 'Transfer',
|
|
1235
|
+
args: filter,
|
|
1236
|
+
onLogs: (logs) => {
|
|
1237
|
+
logs.forEach((log) => {
|
|
1238
|
+
callback(log.args);
|
|
1239
|
+
});
|
|
1240
|
+
},
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1243
|
+
};
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
exports.FPIS = FPIS;
|