@gitmyabi/cap 1.0.0 → 1.0.1
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 +6 -6
- package/contracts/{Token_json.d.ts → CAPToken.d.ts} +520 -368
- package/contracts/{Token_json.js → CAPToken.js} +517 -459
- package/contracts/{Token_json.ts → CAPToken.ts} +631 -455
- package/contracts/index.d.ts +2 -4
- package/contracts/index.js +4 -7
- package/contracts/index.ts +2 -4
- package/package.json +4 -4
- package/contracts/ERC1967Proxy_json.d.ts +0 -144
- package/contracts/ERC1967Proxy_json.js +0 -180
- package/contracts/ERC1967Proxy_json.ts +0 -209
|
@@ -2,313 +2,143 @@ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType }
|
|
|
2
2
|
import { getContract } from 'viem';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* CAPToken ABI
|
|
6
6
|
*
|
|
7
7
|
* This ABI is typed using viem's type system for full type safety.
|
|
8
8
|
*/
|
|
9
|
-
export const
|
|
10
|
-
{
|
|
11
|
-
"inputs": [],
|
|
12
|
-
"stateMutability": "nonpayable",
|
|
13
|
-
"type": "constructor"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"inputs": [
|
|
17
|
-
{
|
|
18
|
-
"internalType": "address",
|
|
19
|
-
"name": "target",
|
|
20
|
-
"type": "address"
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
"name": "AddressEmptyCode",
|
|
24
|
-
"type": "error"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"inputs": [],
|
|
28
|
-
"name": "ECDSAInvalidSignature",
|
|
29
|
-
"type": "error"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"inputs": [
|
|
33
|
-
{
|
|
34
|
-
"internalType": "uint256",
|
|
35
|
-
"name": "length",
|
|
36
|
-
"type": "uint256"
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
"name": "ECDSAInvalidSignatureLength",
|
|
40
|
-
"type": "error"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"inputs": [
|
|
44
|
-
{
|
|
45
|
-
"internalType": "bytes32",
|
|
46
|
-
"name": "s",
|
|
47
|
-
"type": "bytes32"
|
|
48
|
-
}
|
|
49
|
-
],
|
|
50
|
-
"name": "ECDSAInvalidSignatureS",
|
|
51
|
-
"type": "error"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"inputs": [
|
|
55
|
-
{
|
|
56
|
-
"internalType": "address",
|
|
57
|
-
"name": "implementation",
|
|
58
|
-
"type": "address"
|
|
59
|
-
}
|
|
60
|
-
],
|
|
61
|
-
"name": "ERC1967InvalidImplementation",
|
|
62
|
-
"type": "error"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
"inputs": [],
|
|
66
|
-
"name": "ERC1967NonPayable",
|
|
67
|
-
"type": "error"
|
|
68
|
-
},
|
|
9
|
+
export const CAPTokenAbi = [
|
|
69
10
|
{
|
|
70
11
|
"inputs": [
|
|
71
12
|
{
|
|
72
|
-
"internalType": "
|
|
73
|
-
"name": "
|
|
74
|
-
"type": "
|
|
13
|
+
"internalType": "string",
|
|
14
|
+
"name": "name",
|
|
15
|
+
"type": "string"
|
|
75
16
|
},
|
|
76
17
|
{
|
|
77
|
-
"internalType": "
|
|
78
|
-
"name": "
|
|
79
|
-
"type": "
|
|
18
|
+
"internalType": "string",
|
|
19
|
+
"name": "symbol",
|
|
20
|
+
"type": "string"
|
|
80
21
|
},
|
|
81
22
|
{
|
|
82
23
|
"internalType": "uint256",
|
|
83
|
-
"name": "
|
|
24
|
+
"name": "cap",
|
|
84
25
|
"type": "uint256"
|
|
85
26
|
}
|
|
86
27
|
],
|
|
87
|
-
"
|
|
88
|
-
"type": "
|
|
28
|
+
"stateMutability": "nonpayable",
|
|
29
|
+
"type": "constructor"
|
|
89
30
|
},
|
|
90
31
|
{
|
|
32
|
+
"anonymous": false,
|
|
91
33
|
"inputs": [
|
|
92
34
|
{
|
|
35
|
+
"indexed": true,
|
|
93
36
|
"internalType": "address",
|
|
94
|
-
"name": "
|
|
37
|
+
"name": "owner",
|
|
95
38
|
"type": "address"
|
|
96
39
|
},
|
|
97
40
|
{
|
|
98
|
-
"
|
|
99
|
-
"name": "balance",
|
|
100
|
-
"type": "uint256"
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"internalType": "uint256",
|
|
104
|
-
"name": "needed",
|
|
105
|
-
"type": "uint256"
|
|
106
|
-
}
|
|
107
|
-
],
|
|
108
|
-
"name": "ERC20InsufficientBalance",
|
|
109
|
-
"type": "error"
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
"inputs": [
|
|
113
|
-
{
|
|
114
|
-
"internalType": "address",
|
|
115
|
-
"name": "approver",
|
|
116
|
-
"type": "address"
|
|
117
|
-
}
|
|
118
|
-
],
|
|
119
|
-
"name": "ERC20InvalidApprover",
|
|
120
|
-
"type": "error"
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
"inputs": [
|
|
124
|
-
{
|
|
125
|
-
"internalType": "address",
|
|
126
|
-
"name": "receiver",
|
|
127
|
-
"type": "address"
|
|
128
|
-
}
|
|
129
|
-
],
|
|
130
|
-
"name": "ERC20InvalidReceiver",
|
|
131
|
-
"type": "error"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"inputs": [
|
|
135
|
-
{
|
|
136
|
-
"internalType": "address",
|
|
137
|
-
"name": "sender",
|
|
138
|
-
"type": "address"
|
|
139
|
-
}
|
|
140
|
-
],
|
|
141
|
-
"name": "ERC20InvalidSender",
|
|
142
|
-
"type": "error"
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"inputs": [
|
|
146
|
-
{
|
|
41
|
+
"indexed": true,
|
|
147
42
|
"internalType": "address",
|
|
148
43
|
"name": "spender",
|
|
149
44
|
"type": "address"
|
|
150
|
-
}
|
|
151
|
-
],
|
|
152
|
-
"name": "ERC20InvalidSpender",
|
|
153
|
-
"type": "error"
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
"inputs": [
|
|
45
|
+
},
|
|
157
46
|
{
|
|
47
|
+
"indexed": false,
|
|
158
48
|
"internalType": "uint256",
|
|
159
|
-
"name": "
|
|
49
|
+
"name": "value",
|
|
160
50
|
"type": "uint256"
|
|
161
51
|
}
|
|
162
52
|
],
|
|
163
|
-
"name": "
|
|
164
|
-
"type": "
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"inputs": [
|
|
168
|
-
{
|
|
169
|
-
"internalType": "address",
|
|
170
|
-
"name": "signer",
|
|
171
|
-
"type": "address"
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
"internalType": "address",
|
|
175
|
-
"name": "owner",
|
|
176
|
-
"type": "address"
|
|
177
|
-
}
|
|
178
|
-
],
|
|
179
|
-
"name": "ERC2612InvalidSigner",
|
|
180
|
-
"type": "error"
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
"inputs": [],
|
|
184
|
-
"name": "FailedCall",
|
|
185
|
-
"type": "error"
|
|
53
|
+
"name": "Approval",
|
|
54
|
+
"type": "event"
|
|
186
55
|
},
|
|
187
56
|
{
|
|
57
|
+
"anonymous": false,
|
|
188
58
|
"inputs": [
|
|
189
59
|
{
|
|
60
|
+
"indexed": false,
|
|
190
61
|
"internalType": "address",
|
|
191
62
|
"name": "account",
|
|
192
63
|
"type": "address"
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
"internalType": "uint256",
|
|
196
|
-
"name": "currentNonce",
|
|
197
|
-
"type": "uint256"
|
|
198
64
|
}
|
|
199
65
|
],
|
|
200
|
-
"name": "
|
|
201
|
-
"type": "
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
"inputs": [],
|
|
205
|
-
"name": "InvalidInitialization",
|
|
206
|
-
"type": "error"
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
"inputs": [],
|
|
210
|
-
"name": "NotInitializing",
|
|
211
|
-
"type": "error"
|
|
66
|
+
"name": "Paused",
|
|
67
|
+
"type": "event"
|
|
212
68
|
},
|
|
213
69
|
{
|
|
70
|
+
"anonymous": false,
|
|
214
71
|
"inputs": [
|
|
215
72
|
{
|
|
216
|
-
"
|
|
217
|
-
"
|
|
218
|
-
"
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
"name": "OwnableInvalidOwner",
|
|
222
|
-
"type": "error"
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
"inputs": [
|
|
73
|
+
"indexed": true,
|
|
74
|
+
"internalType": "bytes32",
|
|
75
|
+
"name": "role",
|
|
76
|
+
"type": "bytes32"
|
|
77
|
+
},
|
|
226
78
|
{
|
|
227
|
-
"
|
|
228
|
-
"
|
|
229
|
-
"
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
"name": "OwnableUnauthorizedAccount",
|
|
233
|
-
"type": "error"
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
"inputs": [],
|
|
237
|
-
"name": "UUPSUnauthorizedCallContext",
|
|
238
|
-
"type": "error"
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
"inputs": [
|
|
79
|
+
"indexed": true,
|
|
80
|
+
"internalType": "bytes32",
|
|
81
|
+
"name": "previousAdminRole",
|
|
82
|
+
"type": "bytes32"
|
|
83
|
+
},
|
|
242
84
|
{
|
|
85
|
+
"indexed": true,
|
|
243
86
|
"internalType": "bytes32",
|
|
244
|
-
"name": "
|
|
87
|
+
"name": "newAdminRole",
|
|
245
88
|
"type": "bytes32"
|
|
246
89
|
}
|
|
247
90
|
],
|
|
248
|
-
"name": "
|
|
249
|
-
"type": "
|
|
91
|
+
"name": "RoleAdminChanged",
|
|
92
|
+
"type": "event"
|
|
250
93
|
},
|
|
251
94
|
{
|
|
252
95
|
"anonymous": false,
|
|
253
96
|
"inputs": [
|
|
254
97
|
{
|
|
255
98
|
"indexed": true,
|
|
256
|
-
"internalType": "
|
|
257
|
-
"name": "
|
|
258
|
-
"type": "
|
|
99
|
+
"internalType": "bytes32",
|
|
100
|
+
"name": "role",
|
|
101
|
+
"type": "bytes32"
|
|
259
102
|
},
|
|
260
103
|
{
|
|
261
104
|
"indexed": true,
|
|
262
105
|
"internalType": "address",
|
|
263
|
-
"name": "
|
|
106
|
+
"name": "account",
|
|
264
107
|
"type": "address"
|
|
265
108
|
},
|
|
266
109
|
{
|
|
267
|
-
"indexed":
|
|
268
|
-
"internalType": "
|
|
269
|
-
"name": "
|
|
270
|
-
"type": "
|
|
110
|
+
"indexed": true,
|
|
111
|
+
"internalType": "address",
|
|
112
|
+
"name": "sender",
|
|
113
|
+
"type": "address"
|
|
271
114
|
}
|
|
272
115
|
],
|
|
273
|
-
"name": "
|
|
274
|
-
"type": "event"
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
"anonymous": false,
|
|
278
|
-
"inputs": [],
|
|
279
|
-
"name": "EIP712DomainChanged",
|
|
116
|
+
"name": "RoleGranted",
|
|
280
117
|
"type": "event"
|
|
281
118
|
},
|
|
282
119
|
{
|
|
283
120
|
"anonymous": false,
|
|
284
121
|
"inputs": [
|
|
285
122
|
{
|
|
286
|
-
"indexed":
|
|
287
|
-
"internalType": "
|
|
288
|
-
"name": "
|
|
289
|
-
"type": "
|
|
290
|
-
}
|
|
291
|
-
],
|
|
292
|
-
"name": "Initialized",
|
|
293
|
-
"type": "event"
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
"anonymous": false,
|
|
297
|
-
"inputs": [
|
|
123
|
+
"indexed": true,
|
|
124
|
+
"internalType": "bytes32",
|
|
125
|
+
"name": "role",
|
|
126
|
+
"type": "bytes32"
|
|
127
|
+
},
|
|
298
128
|
{
|
|
299
129
|
"indexed": true,
|
|
300
130
|
"internalType": "address",
|
|
301
|
-
"name": "
|
|
131
|
+
"name": "account",
|
|
302
132
|
"type": "address"
|
|
303
133
|
},
|
|
304
134
|
{
|
|
305
135
|
"indexed": true,
|
|
306
136
|
"internalType": "address",
|
|
307
|
-
"name": "
|
|
137
|
+
"name": "sender",
|
|
308
138
|
"type": "address"
|
|
309
139
|
}
|
|
310
140
|
],
|
|
311
|
-
"name": "
|
|
141
|
+
"name": "RoleRevoked",
|
|
312
142
|
"type": "event"
|
|
313
143
|
},
|
|
314
144
|
{
|
|
@@ -340,18 +170,18 @@ export const Token_jsonAbi = [
|
|
|
340
170
|
"anonymous": false,
|
|
341
171
|
"inputs": [
|
|
342
172
|
{
|
|
343
|
-
"indexed":
|
|
173
|
+
"indexed": false,
|
|
344
174
|
"internalType": "address",
|
|
345
|
-
"name": "
|
|
175
|
+
"name": "account",
|
|
346
176
|
"type": "address"
|
|
347
177
|
}
|
|
348
178
|
],
|
|
349
|
-
"name": "
|
|
179
|
+
"name": "Unpaused",
|
|
350
180
|
"type": "event"
|
|
351
181
|
},
|
|
352
182
|
{
|
|
353
183
|
"inputs": [],
|
|
354
|
-
"name": "
|
|
184
|
+
"name": "DEFAULT_ADMIN_ROLE",
|
|
355
185
|
"outputs": [
|
|
356
186
|
{
|
|
357
187
|
"internalType": "bytes32",
|
|
@@ -364,12 +194,25 @@ export const Token_jsonAbi = [
|
|
|
364
194
|
},
|
|
365
195
|
{
|
|
366
196
|
"inputs": [],
|
|
367
|
-
"name": "
|
|
197
|
+
"name": "MINTER_ROLE",
|
|
368
198
|
"outputs": [
|
|
369
199
|
{
|
|
370
|
-
"internalType": "
|
|
200
|
+
"internalType": "bytes32",
|
|
371
201
|
"name": "",
|
|
372
|
-
"type": "
|
|
202
|
+
"type": "bytes32"
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"stateMutability": "view",
|
|
206
|
+
"type": "function"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"inputs": [],
|
|
210
|
+
"name": "PAUSER_ROLE",
|
|
211
|
+
"outputs": [
|
|
212
|
+
{
|
|
213
|
+
"internalType": "bytes32",
|
|
214
|
+
"name": "",
|
|
215
|
+
"type": "bytes32"
|
|
373
216
|
}
|
|
374
217
|
],
|
|
375
218
|
"stateMutability": "view",
|
|
@@ -408,7 +251,7 @@ export const Token_jsonAbi = [
|
|
|
408
251
|
},
|
|
409
252
|
{
|
|
410
253
|
"internalType": "uint256",
|
|
411
|
-
"name": "
|
|
254
|
+
"name": "amount",
|
|
412
255
|
"type": "uint256"
|
|
413
256
|
}
|
|
414
257
|
],
|
|
@@ -442,14 +285,45 @@ export const Token_jsonAbi = [
|
|
|
442
285
|
"stateMutability": "view",
|
|
443
286
|
"type": "function"
|
|
444
287
|
},
|
|
288
|
+
{
|
|
289
|
+
"inputs": [
|
|
290
|
+
{
|
|
291
|
+
"internalType": "uint256",
|
|
292
|
+
"name": "amount",
|
|
293
|
+
"type": "uint256"
|
|
294
|
+
}
|
|
295
|
+
],
|
|
296
|
+
"name": "burn",
|
|
297
|
+
"outputs": [],
|
|
298
|
+
"stateMutability": "nonpayable",
|
|
299
|
+
"type": "function"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"inputs": [
|
|
303
|
+
{
|
|
304
|
+
"internalType": "address",
|
|
305
|
+
"name": "account",
|
|
306
|
+
"type": "address"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"internalType": "uint256",
|
|
310
|
+
"name": "amount",
|
|
311
|
+
"type": "uint256"
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
"name": "burnFrom",
|
|
315
|
+
"outputs": [],
|
|
316
|
+
"stateMutability": "nonpayable",
|
|
317
|
+
"type": "function"
|
|
318
|
+
},
|
|
445
319
|
{
|
|
446
320
|
"inputs": [],
|
|
447
|
-
"name": "
|
|
321
|
+
"name": "cap",
|
|
448
322
|
"outputs": [
|
|
449
323
|
{
|
|
450
|
-
"internalType": "
|
|
324
|
+
"internalType": "uint256",
|
|
451
325
|
"name": "",
|
|
452
|
-
"type": "
|
|
326
|
+
"type": "uint256"
|
|
453
327
|
}
|
|
454
328
|
],
|
|
455
329
|
"stateMutability": "view",
|
|
@@ -457,42 +331,55 @@ export const Token_jsonAbi = [
|
|
|
457
331
|
},
|
|
458
332
|
{
|
|
459
333
|
"inputs": [],
|
|
460
|
-
"name": "
|
|
334
|
+
"name": "decimals",
|
|
461
335
|
"outputs": [
|
|
462
336
|
{
|
|
463
|
-
"internalType": "
|
|
464
|
-
"name": "
|
|
465
|
-
"type": "
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
337
|
+
"internalType": "uint8",
|
|
338
|
+
"name": "",
|
|
339
|
+
"type": "uint8"
|
|
340
|
+
}
|
|
341
|
+
],
|
|
342
|
+
"stateMutability": "view",
|
|
343
|
+
"type": "function"
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"inputs": [
|
|
472
347
|
{
|
|
473
|
-
"internalType": "
|
|
474
|
-
"name": "
|
|
475
|
-
"type": "
|
|
348
|
+
"internalType": "address",
|
|
349
|
+
"name": "spender",
|
|
350
|
+
"type": "address"
|
|
476
351
|
},
|
|
477
352
|
{
|
|
478
353
|
"internalType": "uint256",
|
|
479
|
-
"name": "
|
|
354
|
+
"name": "subtractedValue",
|
|
480
355
|
"type": "uint256"
|
|
481
|
-
}
|
|
356
|
+
}
|
|
357
|
+
],
|
|
358
|
+
"name": "decreaseAllowance",
|
|
359
|
+
"outputs": [
|
|
482
360
|
{
|
|
483
|
-
"internalType": "
|
|
484
|
-
"name": "
|
|
485
|
-
"type": "
|
|
486
|
-
}
|
|
361
|
+
"internalType": "bool",
|
|
362
|
+
"name": "",
|
|
363
|
+
"type": "bool"
|
|
364
|
+
}
|
|
365
|
+
],
|
|
366
|
+
"stateMutability": "nonpayable",
|
|
367
|
+
"type": "function"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"inputs": [
|
|
487
371
|
{
|
|
488
372
|
"internalType": "bytes32",
|
|
489
|
-
"name": "
|
|
373
|
+
"name": "role",
|
|
490
374
|
"type": "bytes32"
|
|
491
|
-
}
|
|
375
|
+
}
|
|
376
|
+
],
|
|
377
|
+
"name": "getRoleAdmin",
|
|
378
|
+
"outputs": [
|
|
492
379
|
{
|
|
493
|
-
"internalType": "
|
|
494
|
-
"name": "
|
|
495
|
-
"type": "
|
|
380
|
+
"internalType": "bytes32",
|
|
381
|
+
"name": "",
|
|
382
|
+
"type": "bytes32"
|
|
496
383
|
}
|
|
497
384
|
],
|
|
498
385
|
"stateMutability": "view",
|
|
@@ -501,39 +388,22 @@ export const Token_jsonAbi = [
|
|
|
501
388
|
{
|
|
502
389
|
"inputs": [
|
|
503
390
|
{
|
|
504
|
-
"internalType": "
|
|
505
|
-
"name": "
|
|
506
|
-
"type": "
|
|
507
|
-
},
|
|
508
|
-
{
|
|
509
|
-
"internalType": "string",
|
|
510
|
-
"name": "symbol",
|
|
511
|
-
"type": "string"
|
|
512
|
-
},
|
|
513
|
-
{
|
|
514
|
-
"internalType": "address",
|
|
515
|
-
"name": "owner",
|
|
516
|
-
"type": "address"
|
|
391
|
+
"internalType": "bytes32",
|
|
392
|
+
"name": "role",
|
|
393
|
+
"type": "bytes32"
|
|
517
394
|
},
|
|
518
395
|
{
|
|
519
396
|
"internalType": "uint256",
|
|
520
|
-
"name": "
|
|
397
|
+
"name": "index",
|
|
521
398
|
"type": "uint256"
|
|
522
399
|
}
|
|
523
400
|
],
|
|
524
|
-
"name": "
|
|
525
|
-
"outputs": [],
|
|
526
|
-
"stateMutability": "nonpayable",
|
|
527
|
-
"type": "function"
|
|
528
|
-
},
|
|
529
|
-
{
|
|
530
|
-
"inputs": [],
|
|
531
|
-
"name": "name",
|
|
401
|
+
"name": "getRoleMember",
|
|
532
402
|
"outputs": [
|
|
533
403
|
{
|
|
534
|
-
"internalType": "
|
|
404
|
+
"internalType": "address",
|
|
535
405
|
"name": "",
|
|
536
|
-
"type": "
|
|
406
|
+
"type": "address"
|
|
537
407
|
}
|
|
538
408
|
],
|
|
539
409
|
"stateMutability": "view",
|
|
@@ -542,12 +412,12 @@ export const Token_jsonAbi = [
|
|
|
542
412
|
{
|
|
543
413
|
"inputs": [
|
|
544
414
|
{
|
|
545
|
-
"internalType": "
|
|
546
|
-
"name": "
|
|
547
|
-
"type": "
|
|
415
|
+
"internalType": "bytes32",
|
|
416
|
+
"name": "role",
|
|
417
|
+
"type": "bytes32"
|
|
548
418
|
}
|
|
549
419
|
],
|
|
550
|
-
"name": "
|
|
420
|
+
"name": "getRoleMemberCount",
|
|
551
421
|
"outputs": [
|
|
552
422
|
{
|
|
553
423
|
"internalType": "uint256",
|
|
@@ -559,25 +429,49 @@ export const Token_jsonAbi = [
|
|
|
559
429
|
"type": "function"
|
|
560
430
|
},
|
|
561
431
|
{
|
|
562
|
-
"inputs": [
|
|
563
|
-
|
|
564
|
-
|
|
432
|
+
"inputs": [
|
|
433
|
+
{
|
|
434
|
+
"internalType": "bytes32",
|
|
435
|
+
"name": "role",
|
|
436
|
+
"type": "bytes32"
|
|
437
|
+
},
|
|
565
438
|
{
|
|
566
439
|
"internalType": "address",
|
|
567
|
-
"name": "",
|
|
440
|
+
"name": "account",
|
|
568
441
|
"type": "address"
|
|
569
442
|
}
|
|
570
443
|
],
|
|
571
|
-
"
|
|
444
|
+
"name": "grantRole",
|
|
445
|
+
"outputs": [],
|
|
446
|
+
"stateMutability": "nonpayable",
|
|
572
447
|
"type": "function"
|
|
573
448
|
},
|
|
574
449
|
{
|
|
575
450
|
"inputs": [
|
|
451
|
+
{
|
|
452
|
+
"internalType": "bytes32",
|
|
453
|
+
"name": "role",
|
|
454
|
+
"type": "bytes32"
|
|
455
|
+
},
|
|
576
456
|
{
|
|
577
457
|
"internalType": "address",
|
|
578
|
-
"name": "
|
|
458
|
+
"name": "account",
|
|
579
459
|
"type": "address"
|
|
580
|
-
}
|
|
460
|
+
}
|
|
461
|
+
],
|
|
462
|
+
"name": "hasRole",
|
|
463
|
+
"outputs": [
|
|
464
|
+
{
|
|
465
|
+
"internalType": "bool",
|
|
466
|
+
"name": "",
|
|
467
|
+
"type": "bool"
|
|
468
|
+
}
|
|
469
|
+
],
|
|
470
|
+
"stateMutability": "view",
|
|
471
|
+
"type": "function"
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"inputs": [
|
|
581
475
|
{
|
|
582
476
|
"internalType": "address",
|
|
583
477
|
"name": "spender",
|
|
@@ -585,43 +479,47 @@ export const Token_jsonAbi = [
|
|
|
585
479
|
},
|
|
586
480
|
{
|
|
587
481
|
"internalType": "uint256",
|
|
588
|
-
"name": "
|
|
589
|
-
"type": "uint256"
|
|
590
|
-
},
|
|
591
|
-
{
|
|
592
|
-
"internalType": "uint256",
|
|
593
|
-
"name": "deadline",
|
|
482
|
+
"name": "addedValue",
|
|
594
483
|
"type": "uint256"
|
|
595
|
-
}
|
|
484
|
+
}
|
|
485
|
+
],
|
|
486
|
+
"name": "increaseAllowance",
|
|
487
|
+
"outputs": [
|
|
596
488
|
{
|
|
597
|
-
"internalType": "
|
|
598
|
-
"name": "
|
|
599
|
-
"type": "
|
|
600
|
-
}
|
|
489
|
+
"internalType": "bool",
|
|
490
|
+
"name": "",
|
|
491
|
+
"type": "bool"
|
|
492
|
+
}
|
|
493
|
+
],
|
|
494
|
+
"stateMutability": "nonpayable",
|
|
495
|
+
"type": "function"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"inputs": [
|
|
601
499
|
{
|
|
602
|
-
"internalType": "
|
|
603
|
-
"name": "
|
|
604
|
-
"type": "
|
|
500
|
+
"internalType": "address",
|
|
501
|
+
"name": "to",
|
|
502
|
+
"type": "address"
|
|
605
503
|
},
|
|
606
504
|
{
|
|
607
|
-
"internalType": "
|
|
608
|
-
"name": "
|
|
609
|
-
"type": "
|
|
505
|
+
"internalType": "uint256",
|
|
506
|
+
"name": "amount",
|
|
507
|
+
"type": "uint256"
|
|
610
508
|
}
|
|
611
509
|
],
|
|
612
|
-
"name": "
|
|
510
|
+
"name": "mint",
|
|
613
511
|
"outputs": [],
|
|
614
512
|
"stateMutability": "nonpayable",
|
|
615
513
|
"type": "function"
|
|
616
514
|
},
|
|
617
515
|
{
|
|
618
516
|
"inputs": [],
|
|
619
|
-
"name": "
|
|
517
|
+
"name": "name",
|
|
620
518
|
"outputs": [
|
|
621
519
|
{
|
|
622
|
-
"internalType": "
|
|
520
|
+
"internalType": "string",
|
|
623
521
|
"name": "",
|
|
624
|
-
"type": "
|
|
522
|
+
"type": "string"
|
|
625
523
|
}
|
|
626
524
|
],
|
|
627
525
|
"stateMutability": "view",
|
|
@@ -629,7 +527,56 @@ export const Token_jsonAbi = [
|
|
|
629
527
|
},
|
|
630
528
|
{
|
|
631
529
|
"inputs": [],
|
|
632
|
-
"name": "
|
|
530
|
+
"name": "pause",
|
|
531
|
+
"outputs": [],
|
|
532
|
+
"stateMutability": "nonpayable",
|
|
533
|
+
"type": "function"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"inputs": [],
|
|
537
|
+
"name": "paused",
|
|
538
|
+
"outputs": [
|
|
539
|
+
{
|
|
540
|
+
"internalType": "bool",
|
|
541
|
+
"name": "",
|
|
542
|
+
"type": "bool"
|
|
543
|
+
}
|
|
544
|
+
],
|
|
545
|
+
"stateMutability": "view",
|
|
546
|
+
"type": "function"
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"inputs": [
|
|
550
|
+
{
|
|
551
|
+
"internalType": "bytes32",
|
|
552
|
+
"name": "role",
|
|
553
|
+
"type": "bytes32"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
"internalType": "address",
|
|
557
|
+
"name": "account",
|
|
558
|
+
"type": "address"
|
|
559
|
+
}
|
|
560
|
+
],
|
|
561
|
+
"name": "renounceRole",
|
|
562
|
+
"outputs": [],
|
|
563
|
+
"stateMutability": "nonpayable",
|
|
564
|
+
"type": "function"
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
"inputs": [
|
|
568
|
+
{
|
|
569
|
+
"internalType": "bytes32",
|
|
570
|
+
"name": "role",
|
|
571
|
+
"type": "bytes32"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
"internalType": "address",
|
|
575
|
+
"name": "account",
|
|
576
|
+
"type": "address"
|
|
577
|
+
}
|
|
578
|
+
],
|
|
579
|
+
"name": "revokeRole",
|
|
633
580
|
"outputs": [],
|
|
634
581
|
"stateMutability": "nonpayable",
|
|
635
582
|
"type": "function"
|
|
@@ -664,12 +611,12 @@ export const Token_jsonAbi = [
|
|
|
664
611
|
"inputs": [
|
|
665
612
|
{
|
|
666
613
|
"internalType": "address",
|
|
667
|
-
"name": "
|
|
614
|
+
"name": "recipient",
|
|
668
615
|
"type": "address"
|
|
669
616
|
},
|
|
670
617
|
{
|
|
671
618
|
"internalType": "uint256",
|
|
672
|
-
"name": "
|
|
619
|
+
"name": "amount",
|
|
673
620
|
"type": "uint256"
|
|
674
621
|
}
|
|
675
622
|
],
|
|
@@ -688,17 +635,17 @@ export const Token_jsonAbi = [
|
|
|
688
635
|
"inputs": [
|
|
689
636
|
{
|
|
690
637
|
"internalType": "address",
|
|
691
|
-
"name": "
|
|
638
|
+
"name": "sender",
|
|
692
639
|
"type": "address"
|
|
693
640
|
},
|
|
694
641
|
{
|
|
695
642
|
"internalType": "address",
|
|
696
|
-
"name": "
|
|
643
|
+
"name": "recipient",
|
|
697
644
|
"type": "address"
|
|
698
645
|
},
|
|
699
646
|
{
|
|
700
647
|
"internalType": "uint256",
|
|
701
|
-
"name": "
|
|
648
|
+
"name": "amount",
|
|
702
649
|
"type": "uint256"
|
|
703
650
|
}
|
|
704
651
|
],
|
|
@@ -714,52 +661,28 @@ export const Token_jsonAbi = [
|
|
|
714
661
|
"type": "function"
|
|
715
662
|
},
|
|
716
663
|
{
|
|
717
|
-
"inputs": [
|
|
718
|
-
|
|
719
|
-
"internalType": "address",
|
|
720
|
-
"name": "newOwner",
|
|
721
|
-
"type": "address"
|
|
722
|
-
}
|
|
723
|
-
],
|
|
724
|
-
"name": "transferOwnership",
|
|
664
|
+
"inputs": [],
|
|
665
|
+
"name": "unpause",
|
|
725
666
|
"outputs": [],
|
|
726
667
|
"stateMutability": "nonpayable",
|
|
727
668
|
"type": "function"
|
|
728
|
-
},
|
|
729
|
-
{
|
|
730
|
-
"inputs": [
|
|
731
|
-
{
|
|
732
|
-
"internalType": "address",
|
|
733
|
-
"name": "newImplementation",
|
|
734
|
-
"type": "address"
|
|
735
|
-
},
|
|
736
|
-
{
|
|
737
|
-
"internalType": "bytes",
|
|
738
|
-
"name": "data",
|
|
739
|
-
"type": "bytes"
|
|
740
|
-
}
|
|
741
|
-
],
|
|
742
|
-
"name": "upgradeToAndCall",
|
|
743
|
-
"outputs": [],
|
|
744
|
-
"stateMutability": "payable",
|
|
745
|
-
"type": "function"
|
|
746
669
|
}
|
|
747
670
|
] as const satisfies Abi;
|
|
748
671
|
|
|
749
672
|
/**
|
|
750
|
-
* Type-safe ABI for
|
|
673
|
+
* Type-safe ABI for CAPToken
|
|
751
674
|
*/
|
|
752
|
-
export type
|
|
675
|
+
export type CAPTokenAbi = typeof CAPTokenAbi;
|
|
753
676
|
|
|
754
677
|
/**
|
|
755
|
-
* Contract instance type for
|
|
678
|
+
* Contract instance type for CAPToken
|
|
756
679
|
*/
|
|
757
680
|
// Use any for contract type to avoid complex viem type issues
|
|
758
681
|
// The runtime behavior is type-safe through viem's ABI typing
|
|
759
|
-
export type
|
|
682
|
+
export type CAPTokenContract = any;
|
|
760
683
|
|
|
761
684
|
/**
|
|
762
|
-
*
|
|
685
|
+
* CAPToken Contract Class
|
|
763
686
|
*
|
|
764
687
|
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
765
688
|
*
|
|
@@ -767,12 +690,12 @@ export type Token_jsonContract = any;
|
|
|
767
690
|
* ```typescript
|
|
768
691
|
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
769
692
|
* import { mainnet } from 'viem/chains';
|
|
770
|
-
* import {
|
|
693
|
+
* import { CAPToken } from 'CAPToken';
|
|
771
694
|
*
|
|
772
695
|
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
773
696
|
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
774
697
|
*
|
|
775
|
-
* const contract = new
|
|
698
|
+
* const contract = new CAPToken('0x...', { publicClient, walletClient });
|
|
776
699
|
*
|
|
777
700
|
* // Read functions
|
|
778
701
|
* const result = await contract.balanceOf('0x...');
|
|
@@ -790,8 +713,8 @@ export type Token_jsonContract = any;
|
|
|
790
713
|
* });
|
|
791
714
|
* ```
|
|
792
715
|
*/
|
|
793
|
-
export class
|
|
794
|
-
private contract:
|
|
716
|
+
export class CAPToken {
|
|
717
|
+
private contract: CAPTokenContract;
|
|
795
718
|
private contractAddress: Address;
|
|
796
719
|
private publicClient: PublicClient;
|
|
797
720
|
|
|
@@ -806,7 +729,7 @@ export class Token_json {
|
|
|
806
729
|
this.publicClient = clients.publicClient;
|
|
807
730
|
this.contract = getContract({
|
|
808
731
|
address,
|
|
809
|
-
abi:
|
|
732
|
+
abi: CAPTokenAbi,
|
|
810
733
|
client: {
|
|
811
734
|
public: clients.publicClient,
|
|
812
735
|
wallet: clients.walletClient,
|
|
@@ -822,26 +745,34 @@ export class Token_json {
|
|
|
822
745
|
}
|
|
823
746
|
|
|
824
747
|
/**
|
|
825
|
-
* Get the underlying viem contract instance
|
|
748
|
+
* Get the underlying viem contract instance.
|
|
826
749
|
*/
|
|
827
|
-
getContract():
|
|
750
|
+
getContract(): CAPTokenContract {
|
|
828
751
|
return this.contract;
|
|
829
752
|
}
|
|
830
753
|
|
|
831
754
|
/**
|
|
832
|
-
*
|
|
755
|
+
* DEFAULT_ADMIN_ROLE
|
|
756
|
+
* view
|
|
757
|
+
*/
|
|
758
|
+
async DEFAULT_ADMIN_ROLE(): Promise<`0x${string}`> {
|
|
759
|
+
return this.contract.read.DEFAULT_ADMIN_ROLE() as Promise<`0x${string}`>;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* MINTER_ROLE
|
|
833
764
|
* view
|
|
834
765
|
*/
|
|
835
|
-
async
|
|
836
|
-
return this.contract.read.
|
|
766
|
+
async MINTER_ROLE(): Promise<`0x${string}`> {
|
|
767
|
+
return this.contract.read.MINTER_ROLE() as Promise<`0x${string}`>;
|
|
837
768
|
}
|
|
838
769
|
|
|
839
770
|
/**
|
|
840
|
-
*
|
|
771
|
+
* PAUSER_ROLE
|
|
841
772
|
* view
|
|
842
773
|
*/
|
|
843
|
-
async
|
|
844
|
-
return this.contract.read.
|
|
774
|
+
async PAUSER_ROLE(): Promise<`0x${string}`> {
|
|
775
|
+
return this.contract.read.PAUSER_ROLE() as Promise<`0x${string}`>;
|
|
845
776
|
}
|
|
846
777
|
|
|
847
778
|
/**
|
|
@@ -860,6 +791,14 @@ export class Token_json {
|
|
|
860
791
|
return this.contract.read.balanceOf([account] as const) as Promise<bigint>;
|
|
861
792
|
}
|
|
862
793
|
|
|
794
|
+
/**
|
|
795
|
+
* cap
|
|
796
|
+
* view
|
|
797
|
+
*/
|
|
798
|
+
async cap(): Promise<bigint> {
|
|
799
|
+
return this.contract.read.cap() as Promise<bigint>;
|
|
800
|
+
}
|
|
801
|
+
|
|
863
802
|
/**
|
|
864
803
|
* decimals
|
|
865
804
|
* view
|
|
@@ -869,43 +808,51 @@ export class Token_json {
|
|
|
869
808
|
}
|
|
870
809
|
|
|
871
810
|
/**
|
|
872
|
-
*
|
|
811
|
+
* getRoleAdmin
|
|
873
812
|
* view
|
|
874
813
|
*/
|
|
875
|
-
async
|
|
876
|
-
return this.contract.read.
|
|
814
|
+
async getRoleAdmin(role: `0x${string}`): Promise<`0x${string}`> {
|
|
815
|
+
return this.contract.read.getRoleAdmin([role] as const) as Promise<`0x${string}`>;
|
|
877
816
|
}
|
|
878
817
|
|
|
879
818
|
/**
|
|
880
|
-
*
|
|
819
|
+
* getRoleMember
|
|
881
820
|
* view
|
|
882
821
|
*/
|
|
883
|
-
async
|
|
884
|
-
return this.contract.read.
|
|
822
|
+
async getRoleMember(role: `0x${string}`, index: bigint): Promise<`0x${string}`> {
|
|
823
|
+
return this.contract.read.getRoleMember([role, index] as const) as Promise<`0x${string}`>;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* getRoleMemberCount
|
|
828
|
+
* view
|
|
829
|
+
*/
|
|
830
|
+
async getRoleMemberCount(role: `0x${string}`): Promise<bigint> {
|
|
831
|
+
return this.contract.read.getRoleMemberCount([role] as const) as Promise<bigint>;
|
|
885
832
|
}
|
|
886
833
|
|
|
887
834
|
/**
|
|
888
|
-
*
|
|
835
|
+
* hasRole
|
|
889
836
|
* view
|
|
890
837
|
*/
|
|
891
|
-
async
|
|
892
|
-
return this.contract.read.
|
|
838
|
+
async hasRole(role: `0x${string}`, account: `0x${string}`): Promise<boolean> {
|
|
839
|
+
return this.contract.read.hasRole([role, account] as const) as Promise<boolean>;
|
|
893
840
|
}
|
|
894
841
|
|
|
895
842
|
/**
|
|
896
|
-
*
|
|
843
|
+
* name
|
|
897
844
|
* view
|
|
898
845
|
*/
|
|
899
|
-
async
|
|
900
|
-
return this.contract.read.
|
|
846
|
+
async name(): Promise<string> {
|
|
847
|
+
return this.contract.read.name() as Promise<string>;
|
|
901
848
|
}
|
|
902
849
|
|
|
903
850
|
/**
|
|
904
|
-
*
|
|
851
|
+
* paused
|
|
905
852
|
* view
|
|
906
853
|
*/
|
|
907
|
-
async
|
|
908
|
-
return this.contract.read.
|
|
854
|
+
async paused(): Promise<boolean> {
|
|
855
|
+
return this.contract.read.paused() as Promise<boolean>;
|
|
909
856
|
}
|
|
910
857
|
|
|
911
858
|
/**
|
|
@@ -929,7 +876,7 @@ export class Token_json {
|
|
|
929
876
|
* nonpayable
|
|
930
877
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
931
878
|
*/
|
|
932
|
-
async approve(spender: `0x${string}`,
|
|
879
|
+
async approve(spender: `0x${string}`, amount: bigint, options?: {
|
|
933
880
|
accessList?: import('viem').AccessList;
|
|
934
881
|
authorizationList?: import('viem').AuthorizationList;
|
|
935
882
|
chain?: import('viem').Chain | null;
|
|
@@ -944,15 +891,15 @@ export class Token_json {
|
|
|
944
891
|
if (!this.contract.write) {
|
|
945
892
|
throw new Error('Wallet client is required for write operations');
|
|
946
893
|
}
|
|
947
|
-
return this.contract.write.approve([spender,
|
|
894
|
+
return this.contract.write.approve([spender, amount] as const, options) as Promise<`0x${string}`>;
|
|
948
895
|
}
|
|
949
896
|
|
|
950
897
|
/**
|
|
951
|
-
*
|
|
898
|
+
* burn
|
|
952
899
|
* nonpayable
|
|
953
900
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
954
901
|
*/
|
|
955
|
-
async
|
|
902
|
+
async burn(amount: bigint, options?: {
|
|
956
903
|
accessList?: import('viem').AccessList;
|
|
957
904
|
authorizationList?: import('viem').AuthorizationList;
|
|
958
905
|
chain?: import('viem').Chain | null;
|
|
@@ -967,15 +914,15 @@ export class Token_json {
|
|
|
967
914
|
if (!this.contract.write) {
|
|
968
915
|
throw new Error('Wallet client is required for write operations');
|
|
969
916
|
}
|
|
970
|
-
return this.contract.write.
|
|
917
|
+
return this.contract.write.burn([amount] as const, options) as Promise<`0x${string}`>;
|
|
971
918
|
}
|
|
972
919
|
|
|
973
920
|
/**
|
|
974
|
-
*
|
|
921
|
+
* burnFrom
|
|
975
922
|
* nonpayable
|
|
976
923
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
977
924
|
*/
|
|
978
|
-
async
|
|
925
|
+
async burnFrom(account: `0x${string}`, amount: bigint, options?: {
|
|
979
926
|
accessList?: import('viem').AccessList;
|
|
980
927
|
authorizationList?: import('viem').AuthorizationList;
|
|
981
928
|
chain?: import('viem').Chain | null;
|
|
@@ -990,15 +937,15 @@ export class Token_json {
|
|
|
990
937
|
if (!this.contract.write) {
|
|
991
938
|
throw new Error('Wallet client is required for write operations');
|
|
992
939
|
}
|
|
993
|
-
return this.contract.write.
|
|
940
|
+
return this.contract.write.burnFrom([account, amount] as const, options) as Promise<`0x${string}`>;
|
|
994
941
|
}
|
|
995
942
|
|
|
996
943
|
/**
|
|
997
|
-
*
|
|
944
|
+
* decreaseAllowance
|
|
998
945
|
* nonpayable
|
|
999
946
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1000
947
|
*/
|
|
1001
|
-
async
|
|
948
|
+
async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
|
|
1002
949
|
accessList?: import('viem').AccessList;
|
|
1003
950
|
authorizationList?: import('viem').AuthorizationList;
|
|
1004
951
|
chain?: import('viem').Chain | null;
|
|
@@ -1013,15 +960,15 @@ export class Token_json {
|
|
|
1013
960
|
if (!this.contract.write) {
|
|
1014
961
|
throw new Error('Wallet client is required for write operations');
|
|
1015
962
|
}
|
|
1016
|
-
return this.contract.write.
|
|
963
|
+
return this.contract.write.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<`0x${string}`>;
|
|
1017
964
|
}
|
|
1018
965
|
|
|
1019
966
|
/**
|
|
1020
|
-
*
|
|
967
|
+
* grantRole
|
|
1021
968
|
* nonpayable
|
|
1022
969
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1023
970
|
*/
|
|
1024
|
-
async
|
|
971
|
+
async grantRole(role: `0x${string}`, account: `0x${string}`, options?: {
|
|
1025
972
|
accessList?: import('viem').AccessList;
|
|
1026
973
|
authorizationList?: import('viem').AuthorizationList;
|
|
1027
974
|
chain?: import('viem').Chain | null;
|
|
@@ -1036,15 +983,130 @@ export class Token_json {
|
|
|
1036
983
|
if (!this.contract.write) {
|
|
1037
984
|
throw new Error('Wallet client is required for write operations');
|
|
1038
985
|
}
|
|
1039
|
-
return this.contract.write.
|
|
986
|
+
return this.contract.write.grantRole([role, account] as const, options) as Promise<`0x${string}`>;
|
|
1040
987
|
}
|
|
1041
988
|
|
|
1042
989
|
/**
|
|
1043
|
-
*
|
|
990
|
+
* increaseAllowance
|
|
991
|
+
* nonpayable
|
|
992
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
993
|
+
*/
|
|
994
|
+
async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
|
|
995
|
+
accessList?: import('viem').AccessList;
|
|
996
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
997
|
+
chain?: import('viem').Chain | null;
|
|
998
|
+
dataSuffix?: `0x${string}`;
|
|
999
|
+
gas?: bigint;
|
|
1000
|
+
gasPrice?: bigint;
|
|
1001
|
+
maxFeePerGas?: bigint;
|
|
1002
|
+
maxPriorityFeePerGas?: bigint;
|
|
1003
|
+
nonce?: number;
|
|
1004
|
+
value?: bigint;
|
|
1005
|
+
}): Promise<`0x${string}`> {
|
|
1006
|
+
if (!this.contract.write) {
|
|
1007
|
+
throw new Error('Wallet client is required for write operations');
|
|
1008
|
+
}
|
|
1009
|
+
return this.contract.write.increaseAllowance([spender, addedValue] as const, options) as Promise<`0x${string}`>;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* mint
|
|
1014
|
+
* nonpayable
|
|
1015
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1016
|
+
*/
|
|
1017
|
+
async mint(to: `0x${string}`, amount: bigint, options?: {
|
|
1018
|
+
accessList?: import('viem').AccessList;
|
|
1019
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1020
|
+
chain?: import('viem').Chain | null;
|
|
1021
|
+
dataSuffix?: `0x${string}`;
|
|
1022
|
+
gas?: bigint;
|
|
1023
|
+
gasPrice?: bigint;
|
|
1024
|
+
maxFeePerGas?: bigint;
|
|
1025
|
+
maxPriorityFeePerGas?: bigint;
|
|
1026
|
+
nonce?: number;
|
|
1027
|
+
value?: bigint;
|
|
1028
|
+
}): Promise<`0x${string}`> {
|
|
1029
|
+
if (!this.contract.write) {
|
|
1030
|
+
throw new Error('Wallet client is required for write operations');
|
|
1031
|
+
}
|
|
1032
|
+
return this.contract.write.mint([to, amount] as const, options) as Promise<`0x${string}`>;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* pause
|
|
1037
|
+
* nonpayable
|
|
1038
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1039
|
+
*/
|
|
1040
|
+
async pause(options?: {
|
|
1041
|
+
accessList?: import('viem').AccessList;
|
|
1042
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1043
|
+
chain?: import('viem').Chain | null;
|
|
1044
|
+
dataSuffix?: `0x${string}`;
|
|
1045
|
+
gas?: bigint;
|
|
1046
|
+
gasPrice?: bigint;
|
|
1047
|
+
maxFeePerGas?: bigint;
|
|
1048
|
+
maxPriorityFeePerGas?: bigint;
|
|
1049
|
+
nonce?: number;
|
|
1050
|
+
value?: bigint;
|
|
1051
|
+
}): Promise<`0x${string}`> {
|
|
1052
|
+
if (!this.contract.write) {
|
|
1053
|
+
throw new Error('Wallet client is required for write operations');
|
|
1054
|
+
}
|
|
1055
|
+
return this.contract.write.pause(options) as Promise<`0x${string}`>;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
/**
|
|
1059
|
+
* renounceRole
|
|
1060
|
+
* nonpayable
|
|
1061
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1062
|
+
*/
|
|
1063
|
+
async renounceRole(role: `0x${string}`, account: `0x${string}`, options?: {
|
|
1064
|
+
accessList?: import('viem').AccessList;
|
|
1065
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1066
|
+
chain?: import('viem').Chain | null;
|
|
1067
|
+
dataSuffix?: `0x${string}`;
|
|
1068
|
+
gas?: bigint;
|
|
1069
|
+
gasPrice?: bigint;
|
|
1070
|
+
maxFeePerGas?: bigint;
|
|
1071
|
+
maxPriorityFeePerGas?: bigint;
|
|
1072
|
+
nonce?: number;
|
|
1073
|
+
value?: bigint;
|
|
1074
|
+
}): Promise<`0x${string}`> {
|
|
1075
|
+
if (!this.contract.write) {
|
|
1076
|
+
throw new Error('Wallet client is required for write operations');
|
|
1077
|
+
}
|
|
1078
|
+
return this.contract.write.renounceRole([role, account] as const, options) as Promise<`0x${string}`>;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
/**
|
|
1082
|
+
* revokeRole
|
|
1083
|
+
* nonpayable
|
|
1084
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1085
|
+
*/
|
|
1086
|
+
async revokeRole(role: `0x${string}`, account: `0x${string}`, options?: {
|
|
1087
|
+
accessList?: import('viem').AccessList;
|
|
1088
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1089
|
+
chain?: import('viem').Chain | null;
|
|
1090
|
+
dataSuffix?: `0x${string}`;
|
|
1091
|
+
gas?: bigint;
|
|
1092
|
+
gasPrice?: bigint;
|
|
1093
|
+
maxFeePerGas?: bigint;
|
|
1094
|
+
maxPriorityFeePerGas?: bigint;
|
|
1095
|
+
nonce?: number;
|
|
1096
|
+
value?: bigint;
|
|
1097
|
+
}): Promise<`0x${string}`> {
|
|
1098
|
+
if (!this.contract.write) {
|
|
1099
|
+
throw new Error('Wallet client is required for write operations');
|
|
1100
|
+
}
|
|
1101
|
+
return this.contract.write.revokeRole([role, account] as const, options) as Promise<`0x${string}`>;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
/**
|
|
1105
|
+
* transfer
|
|
1044
1106
|
* nonpayable
|
|
1045
1107
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1046
1108
|
*/
|
|
1047
|
-
async
|
|
1109
|
+
async transfer(recipient: `0x${string}`, amount: bigint, options?: {
|
|
1048
1110
|
accessList?: import('viem').AccessList;
|
|
1049
1111
|
authorizationList?: import('viem').AuthorizationList;
|
|
1050
1112
|
chain?: import('viem').Chain | null;
|
|
@@ -1059,15 +1121,15 @@ export class Token_json {
|
|
|
1059
1121
|
if (!this.contract.write) {
|
|
1060
1122
|
throw new Error('Wallet client is required for write operations');
|
|
1061
1123
|
}
|
|
1062
|
-
return this.contract.write.
|
|
1124
|
+
return this.contract.write.transfer([recipient, amount] as const, options) as Promise<`0x${string}`>;
|
|
1063
1125
|
}
|
|
1064
1126
|
|
|
1065
1127
|
/**
|
|
1066
|
-
*
|
|
1128
|
+
* transferFrom
|
|
1067
1129
|
* nonpayable
|
|
1068
1130
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1069
1131
|
*/
|
|
1070
|
-
async
|
|
1132
|
+
async transferFrom(sender: `0x${string}`, recipient: `0x${string}`, amount: bigint, options?: {
|
|
1071
1133
|
accessList?: import('viem').AccessList;
|
|
1072
1134
|
authorizationList?: import('viem').AuthorizationList;
|
|
1073
1135
|
chain?: import('viem').Chain | null;
|
|
@@ -1082,15 +1144,15 @@ export class Token_json {
|
|
|
1082
1144
|
if (!this.contract.write) {
|
|
1083
1145
|
throw new Error('Wallet client is required for write operations');
|
|
1084
1146
|
}
|
|
1085
|
-
return this.contract.write.
|
|
1147
|
+
return this.contract.write.transferFrom([sender, recipient, amount] as const, options) as Promise<`0x${string}`>;
|
|
1086
1148
|
}
|
|
1087
1149
|
|
|
1088
1150
|
/**
|
|
1089
|
-
*
|
|
1090
|
-
*
|
|
1151
|
+
* unpause
|
|
1152
|
+
* nonpayable
|
|
1091
1153
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1092
1154
|
*/
|
|
1093
|
-
async
|
|
1155
|
+
async unpause(options?: {
|
|
1094
1156
|
accessList?: import('viem').AccessList;
|
|
1095
1157
|
authorizationList?: import('viem').AuthorizationList;
|
|
1096
1158
|
chain?: import('viem').Chain | null;
|
|
@@ -1105,7 +1167,7 @@ export class Token_json {
|
|
|
1105
1167
|
if (!this.contract.write) {
|
|
1106
1168
|
throw new Error('Wallet client is required for write operations');
|
|
1107
1169
|
}
|
|
1108
|
-
return this.contract.write.
|
|
1170
|
+
return this.contract.write.unpause(options) as Promise<`0x${string}`>;
|
|
1109
1171
|
}
|
|
1110
1172
|
|
|
1111
1173
|
|
|
@@ -1129,7 +1191,7 @@ export class Token_json {
|
|
|
1129
1191
|
* Returns gas estimate and result without sending transaction
|
|
1130
1192
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1131
1193
|
*/
|
|
1132
|
-
async approve(spender: `0x${string}`,
|
|
1194
|
+
async approve(spender: `0x${string}`, amount: bigint, options?: {
|
|
1133
1195
|
accessList?: import('viem').AccessList;
|
|
1134
1196
|
authorizationList?: import('viem').AuthorizationList;
|
|
1135
1197
|
chain?: import('viem').Chain | null;
|
|
@@ -1141,14 +1203,14 @@ export class Token_json {
|
|
|
1141
1203
|
nonce?: number;
|
|
1142
1204
|
value?: bigint;
|
|
1143
1205
|
}): Promise<boolean> {
|
|
1144
|
-
return contract.simulate.approve([spender,
|
|
1206
|
+
return contract.simulate.approve([spender, amount] as const, options) as Promise<boolean>;
|
|
1145
1207
|
},
|
|
1146
1208
|
/**
|
|
1147
|
-
* Simulate
|
|
1209
|
+
* Simulate burn
|
|
1148
1210
|
* Returns gas estimate and result without sending transaction
|
|
1149
1211
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1150
1212
|
*/
|
|
1151
|
-
async
|
|
1213
|
+
async burn(amount: bigint, options?: {
|
|
1152
1214
|
accessList?: import('viem').AccessList;
|
|
1153
1215
|
authorizationList?: import('viem').AuthorizationList;
|
|
1154
1216
|
chain?: import('viem').Chain | null;
|
|
@@ -1160,14 +1222,14 @@ export class Token_json {
|
|
|
1160
1222
|
nonce?: number;
|
|
1161
1223
|
value?: bigint;
|
|
1162
1224
|
}): Promise<void> {
|
|
1163
|
-
return contract.simulate.
|
|
1225
|
+
return contract.simulate.burn([amount] as const, options) as Promise<void>;
|
|
1164
1226
|
},
|
|
1165
1227
|
/**
|
|
1166
|
-
* Simulate
|
|
1228
|
+
* Simulate burnFrom
|
|
1167
1229
|
* Returns gas estimate and result without sending transaction
|
|
1168
1230
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1169
1231
|
*/
|
|
1170
|
-
async
|
|
1232
|
+
async burnFrom(account: `0x${string}`, amount: bigint, options?: {
|
|
1171
1233
|
accessList?: import('viem').AccessList;
|
|
1172
1234
|
authorizationList?: import('viem').AuthorizationList;
|
|
1173
1235
|
chain?: import('viem').Chain | null;
|
|
@@ -1179,14 +1241,33 @@ export class Token_json {
|
|
|
1179
1241
|
nonce?: number;
|
|
1180
1242
|
value?: bigint;
|
|
1181
1243
|
}): Promise<void> {
|
|
1182
|
-
return contract.simulate.
|
|
1244
|
+
return contract.simulate.burnFrom([account, amount] as const, options) as Promise<void>;
|
|
1245
|
+
},
|
|
1246
|
+
/**
|
|
1247
|
+
* Simulate decreaseAllowance
|
|
1248
|
+
* Returns gas estimate and result without sending transaction
|
|
1249
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1250
|
+
*/
|
|
1251
|
+
async decreaseAllowance(spender: `0x${string}`, subtractedValue: bigint, options?: {
|
|
1252
|
+
accessList?: import('viem').AccessList;
|
|
1253
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1254
|
+
chain?: import('viem').Chain | null;
|
|
1255
|
+
dataSuffix?: `0x${string}`;
|
|
1256
|
+
gas?: bigint;
|
|
1257
|
+
gasPrice?: bigint;
|
|
1258
|
+
maxFeePerGas?: bigint;
|
|
1259
|
+
maxPriorityFeePerGas?: bigint;
|
|
1260
|
+
nonce?: number;
|
|
1261
|
+
value?: bigint;
|
|
1262
|
+
}): Promise<boolean> {
|
|
1263
|
+
return contract.simulate.decreaseAllowance([spender, subtractedValue] as const, options) as Promise<boolean>;
|
|
1183
1264
|
},
|
|
1184
1265
|
/**
|
|
1185
|
-
* Simulate
|
|
1266
|
+
* Simulate grantRole
|
|
1186
1267
|
* Returns gas estimate and result without sending transaction
|
|
1187
1268
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1188
1269
|
*/
|
|
1189
|
-
async
|
|
1270
|
+
async grantRole(role: `0x${string}`, account: `0x${string}`, options?: {
|
|
1190
1271
|
accessList?: import('viem').AccessList;
|
|
1191
1272
|
authorizationList?: import('viem').AuthorizationList;
|
|
1192
1273
|
chain?: import('viem').Chain | null;
|
|
@@ -1198,14 +1279,14 @@ export class Token_json {
|
|
|
1198
1279
|
nonce?: number;
|
|
1199
1280
|
value?: bigint;
|
|
1200
1281
|
}): Promise<void> {
|
|
1201
|
-
return contract.simulate.
|
|
1282
|
+
return contract.simulate.grantRole([role, account] as const, options) as Promise<void>;
|
|
1202
1283
|
},
|
|
1203
1284
|
/**
|
|
1204
|
-
* Simulate
|
|
1285
|
+
* Simulate increaseAllowance
|
|
1205
1286
|
* Returns gas estimate and result without sending transaction
|
|
1206
1287
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1207
1288
|
*/
|
|
1208
|
-
async
|
|
1289
|
+
async increaseAllowance(spender: `0x${string}`, addedValue: bigint, options?: {
|
|
1209
1290
|
accessList?: import('viem').AccessList;
|
|
1210
1291
|
authorizationList?: import('viem').AuthorizationList;
|
|
1211
1292
|
chain?: import('viem').Chain | null;
|
|
@@ -1217,14 +1298,14 @@ export class Token_json {
|
|
|
1217
1298
|
nonce?: number;
|
|
1218
1299
|
value?: bigint;
|
|
1219
1300
|
}): Promise<boolean> {
|
|
1220
|
-
return contract.simulate.
|
|
1301
|
+
return contract.simulate.increaseAllowance([spender, addedValue] as const, options) as Promise<boolean>;
|
|
1221
1302
|
},
|
|
1222
1303
|
/**
|
|
1223
|
-
* Simulate
|
|
1304
|
+
* Simulate mint
|
|
1224
1305
|
* Returns gas estimate and result without sending transaction
|
|
1225
1306
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1226
1307
|
*/
|
|
1227
|
-
async
|
|
1308
|
+
async mint(to: `0x${string}`, amount: bigint, options?: {
|
|
1228
1309
|
accessList?: import('viem').AccessList;
|
|
1229
1310
|
authorizationList?: import('viem').AuthorizationList;
|
|
1230
1311
|
chain?: import('viem').Chain | null;
|
|
@@ -1235,15 +1316,53 @@ export class Token_json {
|
|
|
1235
1316
|
maxPriorityFeePerGas?: bigint;
|
|
1236
1317
|
nonce?: number;
|
|
1237
1318
|
value?: bigint;
|
|
1238
|
-
}): Promise<
|
|
1239
|
-
return contract.simulate.
|
|
1319
|
+
}): Promise<void> {
|
|
1320
|
+
return contract.simulate.mint([to, amount] as const, options) as Promise<void>;
|
|
1321
|
+
},
|
|
1322
|
+
/**
|
|
1323
|
+
* Simulate pause
|
|
1324
|
+
* Returns gas estimate and result without sending transaction
|
|
1325
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1326
|
+
*/
|
|
1327
|
+
async pause(options?: {
|
|
1328
|
+
accessList?: import('viem').AccessList;
|
|
1329
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1330
|
+
chain?: import('viem').Chain | null;
|
|
1331
|
+
dataSuffix?: `0x${string}`;
|
|
1332
|
+
gas?: bigint;
|
|
1333
|
+
gasPrice?: bigint;
|
|
1334
|
+
maxFeePerGas?: bigint;
|
|
1335
|
+
maxPriorityFeePerGas?: bigint;
|
|
1336
|
+
nonce?: number;
|
|
1337
|
+
value?: bigint;
|
|
1338
|
+
}): Promise<void> {
|
|
1339
|
+
return contract.simulate.pause(options) as Promise<void>;
|
|
1340
|
+
},
|
|
1341
|
+
/**
|
|
1342
|
+
* Simulate renounceRole
|
|
1343
|
+
* Returns gas estimate and result without sending transaction
|
|
1344
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1345
|
+
*/
|
|
1346
|
+
async renounceRole(role: `0x${string}`, account: `0x${string}`, options?: {
|
|
1347
|
+
accessList?: import('viem').AccessList;
|
|
1348
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1349
|
+
chain?: import('viem').Chain | null;
|
|
1350
|
+
dataSuffix?: `0x${string}`;
|
|
1351
|
+
gas?: bigint;
|
|
1352
|
+
gasPrice?: bigint;
|
|
1353
|
+
maxFeePerGas?: bigint;
|
|
1354
|
+
maxPriorityFeePerGas?: bigint;
|
|
1355
|
+
nonce?: number;
|
|
1356
|
+
value?: bigint;
|
|
1357
|
+
}): Promise<void> {
|
|
1358
|
+
return contract.simulate.renounceRole([role, account] as const, options) as Promise<void>;
|
|
1240
1359
|
},
|
|
1241
1360
|
/**
|
|
1242
|
-
* Simulate
|
|
1361
|
+
* Simulate revokeRole
|
|
1243
1362
|
* Returns gas estimate and result without sending transaction
|
|
1244
1363
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1245
1364
|
*/
|
|
1246
|
-
async
|
|
1365
|
+
async revokeRole(role: `0x${string}`, account: `0x${string}`, options?: {
|
|
1247
1366
|
accessList?: import('viem').AccessList;
|
|
1248
1367
|
authorizationList?: import('viem').AuthorizationList;
|
|
1249
1368
|
chain?: import('viem').Chain | null;
|
|
@@ -1255,14 +1374,52 @@ export class Token_json {
|
|
|
1255
1374
|
nonce?: number;
|
|
1256
1375
|
value?: bigint;
|
|
1257
1376
|
}): Promise<void> {
|
|
1258
|
-
return contract.simulate.
|
|
1377
|
+
return contract.simulate.revokeRole([role, account] as const, options) as Promise<void>;
|
|
1378
|
+
},
|
|
1379
|
+
/**
|
|
1380
|
+
* Simulate transfer
|
|
1381
|
+
* Returns gas estimate and result without sending transaction
|
|
1382
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1383
|
+
*/
|
|
1384
|
+
async transfer(recipient: `0x${string}`, amount: 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<boolean> {
|
|
1396
|
+
return contract.simulate.transfer([recipient, amount] as const, options) as Promise<boolean>;
|
|
1397
|
+
},
|
|
1398
|
+
/**
|
|
1399
|
+
* Simulate transferFrom
|
|
1400
|
+
* Returns gas estimate and result without sending transaction
|
|
1401
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1402
|
+
*/
|
|
1403
|
+
async transferFrom(sender: `0x${string}`, recipient: `0x${string}`, amount: bigint, options?: {
|
|
1404
|
+
accessList?: import('viem').AccessList;
|
|
1405
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1406
|
+
chain?: import('viem').Chain | null;
|
|
1407
|
+
dataSuffix?: `0x${string}`;
|
|
1408
|
+
gas?: bigint;
|
|
1409
|
+
gasPrice?: bigint;
|
|
1410
|
+
maxFeePerGas?: bigint;
|
|
1411
|
+
maxPriorityFeePerGas?: bigint;
|
|
1412
|
+
nonce?: number;
|
|
1413
|
+
value?: bigint;
|
|
1414
|
+
}): Promise<boolean> {
|
|
1415
|
+
return contract.simulate.transferFrom([sender, recipient, amount] as const, options) as Promise<boolean>;
|
|
1259
1416
|
},
|
|
1260
1417
|
/**
|
|
1261
|
-
* Simulate
|
|
1418
|
+
* Simulate unpause
|
|
1262
1419
|
* Returns gas estimate and result without sending transaction
|
|
1263
1420
|
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1264
1421
|
*/
|
|
1265
|
-
async
|
|
1422
|
+
async unpause(options?: {
|
|
1266
1423
|
accessList?: import('viem').AccessList;
|
|
1267
1424
|
authorizationList?: import('viem').AuthorizationList;
|
|
1268
1425
|
chain?: import('viem').Chain | null;
|
|
@@ -1274,7 +1431,7 @@ export class Token_json {
|
|
|
1274
1431
|
nonce?: number;
|
|
1275
1432
|
value?: bigint;
|
|
1276
1433
|
}): Promise<void> {
|
|
1277
|
-
return contract.simulate.
|
|
1434
|
+
return contract.simulate.unpause(options) as Promise<void>;
|
|
1278
1435
|
}
|
|
1279
1436
|
};
|
|
1280
1437
|
}
|
|
@@ -1299,12 +1456,12 @@ export class Token_json {
|
|
|
1299
1456
|
* @param filter Optional filter for indexed parameters
|
|
1300
1457
|
* @returns Unwatch function to stop listening
|
|
1301
1458
|
*/
|
|
1302
|
-
Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner
|
|
1459
|
+
Approval: (callback: (event: { owner: `0x${string}`; spender: `0x${string}`; value: bigint }) => void, filter?: { owner?: `0x${string}` | `0x${string}`[] | null; spender?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
1303
1460
|
return this.publicClient.watchContractEvent({
|
|
1304
1461
|
address: this.contractAddress,
|
|
1305
|
-
abi:
|
|
1462
|
+
abi: CAPTokenAbi,
|
|
1306
1463
|
eventName: 'Approval',
|
|
1307
|
-
args: filter,
|
|
1464
|
+
args: filter as any,
|
|
1308
1465
|
onLogs: (logs: any[]) => {
|
|
1309
1466
|
logs.forEach((log: any) => {
|
|
1310
1467
|
callback(log.args as any);
|
|
@@ -1313,16 +1470,16 @@ export class Token_json {
|
|
|
1313
1470
|
}) as () => void;
|
|
1314
1471
|
},
|
|
1315
1472
|
/**
|
|
1316
|
-
* Watch
|
|
1473
|
+
* Watch Paused events
|
|
1317
1474
|
* @param callback Function to call when event is emitted
|
|
1318
1475
|
* @param filter Optional filter for indexed parameters
|
|
1319
1476
|
* @returns Unwatch function to stop listening
|
|
1320
1477
|
*/
|
|
1321
|
-
|
|
1478
|
+
Paused: (callback: (event: { account: `0x${string}` }) => void) => {
|
|
1322
1479
|
return this.publicClient.watchContractEvent({
|
|
1323
1480
|
address: this.contractAddress,
|
|
1324
|
-
abi:
|
|
1325
|
-
eventName: '
|
|
1481
|
+
abi: CAPTokenAbi,
|
|
1482
|
+
eventName: 'Paused',
|
|
1326
1483
|
|
|
1327
1484
|
onLogs: (logs: any[]) => {
|
|
1328
1485
|
logs.forEach((log: any) => {
|
|
@@ -1332,17 +1489,36 @@ export class Token_json {
|
|
|
1332
1489
|
}) as () => void;
|
|
1333
1490
|
},
|
|
1334
1491
|
/**
|
|
1335
|
-
* Watch
|
|
1492
|
+
* Watch RoleAdminChanged events
|
|
1336
1493
|
* @param callback Function to call when event is emitted
|
|
1337
1494
|
* @param filter Optional filter for indexed parameters
|
|
1338
1495
|
* @returns Unwatch function to stop listening
|
|
1339
1496
|
*/
|
|
1340
|
-
|
|
1497
|
+
RoleAdminChanged: (callback: (event: { role: `0x${string}`; previousAdminRole: `0x${string}`; newAdminRole: `0x${string}` }) => void, filter?: { role?: `0x${string}` | `0x${string}`[] | null; previousAdminRole?: `0x${string}` | `0x${string}`[] | null; newAdminRole?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
1341
1498
|
return this.publicClient.watchContractEvent({
|
|
1342
1499
|
address: this.contractAddress,
|
|
1343
|
-
abi:
|
|
1344
|
-
eventName: '
|
|
1345
|
-
|
|
1500
|
+
abi: CAPTokenAbi,
|
|
1501
|
+
eventName: 'RoleAdminChanged',
|
|
1502
|
+
args: filter as any,
|
|
1503
|
+
onLogs: (logs: any[]) => {
|
|
1504
|
+
logs.forEach((log: any) => {
|
|
1505
|
+
callback(log.args as any);
|
|
1506
|
+
});
|
|
1507
|
+
},
|
|
1508
|
+
}) as () => void;
|
|
1509
|
+
},
|
|
1510
|
+
/**
|
|
1511
|
+
* Watch RoleGranted events
|
|
1512
|
+
* @param callback Function to call when event is emitted
|
|
1513
|
+
* @param filter Optional filter for indexed parameters
|
|
1514
|
+
* @returns Unwatch function to stop listening
|
|
1515
|
+
*/
|
|
1516
|
+
RoleGranted: (callback: (event: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => void, filter?: { role?: `0x${string}` | `0x${string}`[] | null; account?: `0x${string}` | `0x${string}`[] | null; sender?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
1517
|
+
return this.publicClient.watchContractEvent({
|
|
1518
|
+
address: this.contractAddress,
|
|
1519
|
+
abi: CAPTokenAbi,
|
|
1520
|
+
eventName: 'RoleGranted',
|
|
1521
|
+
args: filter as any,
|
|
1346
1522
|
onLogs: (logs: any[]) => {
|
|
1347
1523
|
logs.forEach((log: any) => {
|
|
1348
1524
|
callback(log.args as any);
|
|
@@ -1351,17 +1527,17 @@ export class Token_json {
|
|
|
1351
1527
|
}) as () => void;
|
|
1352
1528
|
},
|
|
1353
1529
|
/**
|
|
1354
|
-
* Watch
|
|
1530
|
+
* Watch RoleRevoked events
|
|
1355
1531
|
* @param callback Function to call when event is emitted
|
|
1356
1532
|
* @param filter Optional filter for indexed parameters
|
|
1357
1533
|
* @returns Unwatch function to stop listening
|
|
1358
1534
|
*/
|
|
1359
|
-
|
|
1535
|
+
RoleRevoked: (callback: (event: { role: `0x${string}`; account: `0x${string}`; sender: `0x${string}` }) => void, filter?: { role?: `0x${string}` | `0x${string}`[] | null; account?: `0x${string}` | `0x${string}`[] | null; sender?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
1360
1536
|
return this.publicClient.watchContractEvent({
|
|
1361
1537
|
address: this.contractAddress,
|
|
1362
|
-
abi:
|
|
1363
|
-
eventName: '
|
|
1364
|
-
args: filter,
|
|
1538
|
+
abi: CAPTokenAbi,
|
|
1539
|
+
eventName: 'RoleRevoked',
|
|
1540
|
+
args: filter as any,
|
|
1365
1541
|
onLogs: (logs: any[]) => {
|
|
1366
1542
|
logs.forEach((log: any) => {
|
|
1367
1543
|
callback(log.args as any);
|
|
@@ -1375,12 +1551,12 @@ export class Token_json {
|
|
|
1375
1551
|
* @param filter Optional filter for indexed parameters
|
|
1376
1552
|
* @returns Unwatch function to stop listening
|
|
1377
1553
|
*/
|
|
1378
|
-
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from
|
|
1554
|
+
Transfer: (callback: (event: { from: `0x${string}`; to: `0x${string}`; value: bigint }) => void, filter?: { from?: `0x${string}` | `0x${string}`[] | null; to?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
1379
1555
|
return this.publicClient.watchContractEvent({
|
|
1380
1556
|
address: this.contractAddress,
|
|
1381
|
-
abi:
|
|
1557
|
+
abi: CAPTokenAbi,
|
|
1382
1558
|
eventName: 'Transfer',
|
|
1383
|
-
args: filter,
|
|
1559
|
+
args: filter as any,
|
|
1384
1560
|
onLogs: (logs: any[]) => {
|
|
1385
1561
|
logs.forEach((log: any) => {
|
|
1386
1562
|
callback(log.args as any);
|
|
@@ -1389,17 +1565,17 @@ export class Token_json {
|
|
|
1389
1565
|
}) as () => void;
|
|
1390
1566
|
},
|
|
1391
1567
|
/**
|
|
1392
|
-
* Watch
|
|
1568
|
+
* Watch Unpaused events
|
|
1393
1569
|
* @param callback Function to call when event is emitted
|
|
1394
1570
|
* @param filter Optional filter for indexed parameters
|
|
1395
1571
|
* @returns Unwatch function to stop listening
|
|
1396
1572
|
*/
|
|
1397
|
-
|
|
1573
|
+
Unpaused: (callback: (event: { account: `0x${string}` }) => void) => {
|
|
1398
1574
|
return this.publicClient.watchContractEvent({
|
|
1399
1575
|
address: this.contractAddress,
|
|
1400
|
-
abi:
|
|
1401
|
-
eventName: '
|
|
1402
|
-
|
|
1576
|
+
abi: CAPTokenAbi,
|
|
1577
|
+
eventName: 'Unpaused',
|
|
1578
|
+
|
|
1403
1579
|
onLogs: (logs: any[]) => {
|
|
1404
1580
|
logs.forEach((log: any) => {
|
|
1405
1581
|
callback(log.args as any);
|