@gitmyabi/rolesauthority 0.0.0-stage → 1.0.3
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 +107 -2
- package/contracts/RolesAuthority.d.ts +685 -0
- package/contracts/RolesAuthority.js +758 -0
- package/contracts/RolesAuthority.ts +908 -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 +40 -3
|
@@ -0,0 +1,685 @@
|
|
|
1
|
+
import type { Address, PublicClient, WalletClient } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* RolesAuthority ABI
|
|
4
|
+
*
|
|
5
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RolesAuthorityAbi: readonly [{
|
|
8
|
+
readonly inputs: readonly [{
|
|
9
|
+
readonly internalType: "address";
|
|
10
|
+
readonly name: "_owner";
|
|
11
|
+
readonly type: "address";
|
|
12
|
+
}, {
|
|
13
|
+
readonly internalType: "contract Authority";
|
|
14
|
+
readonly name: "_authority";
|
|
15
|
+
readonly type: "address";
|
|
16
|
+
}];
|
|
17
|
+
readonly stateMutability: "nonpayable";
|
|
18
|
+
readonly type: "constructor";
|
|
19
|
+
}, {
|
|
20
|
+
readonly anonymous: false;
|
|
21
|
+
readonly inputs: readonly [{
|
|
22
|
+
readonly indexed: true;
|
|
23
|
+
readonly internalType: "address";
|
|
24
|
+
readonly name: "user";
|
|
25
|
+
readonly type: "address";
|
|
26
|
+
}, {
|
|
27
|
+
readonly indexed: true;
|
|
28
|
+
readonly internalType: "contract Authority";
|
|
29
|
+
readonly name: "newAuthority";
|
|
30
|
+
readonly type: "address";
|
|
31
|
+
}];
|
|
32
|
+
readonly name: "AuthorityUpdated";
|
|
33
|
+
readonly type: "event";
|
|
34
|
+
}, {
|
|
35
|
+
readonly anonymous: false;
|
|
36
|
+
readonly inputs: readonly [{
|
|
37
|
+
readonly indexed: true;
|
|
38
|
+
readonly internalType: "address";
|
|
39
|
+
readonly name: "user";
|
|
40
|
+
readonly type: "address";
|
|
41
|
+
}, {
|
|
42
|
+
readonly indexed: true;
|
|
43
|
+
readonly internalType: "address";
|
|
44
|
+
readonly name: "newOwner";
|
|
45
|
+
readonly type: "address";
|
|
46
|
+
}];
|
|
47
|
+
readonly name: "OwnershipTransferred";
|
|
48
|
+
readonly type: "event";
|
|
49
|
+
}, {
|
|
50
|
+
readonly anonymous: false;
|
|
51
|
+
readonly inputs: readonly [{
|
|
52
|
+
readonly indexed: true;
|
|
53
|
+
readonly internalType: "address";
|
|
54
|
+
readonly name: "target";
|
|
55
|
+
readonly type: "address";
|
|
56
|
+
}, {
|
|
57
|
+
readonly indexed: true;
|
|
58
|
+
readonly internalType: "bytes4";
|
|
59
|
+
readonly name: "functionSig";
|
|
60
|
+
readonly type: "bytes4";
|
|
61
|
+
}, {
|
|
62
|
+
readonly indexed: false;
|
|
63
|
+
readonly internalType: "bool";
|
|
64
|
+
readonly name: "enabled";
|
|
65
|
+
readonly type: "bool";
|
|
66
|
+
}];
|
|
67
|
+
readonly name: "PublicCapabilityUpdated";
|
|
68
|
+
readonly type: "event";
|
|
69
|
+
}, {
|
|
70
|
+
readonly anonymous: false;
|
|
71
|
+
readonly inputs: readonly [{
|
|
72
|
+
readonly indexed: true;
|
|
73
|
+
readonly internalType: "uint8";
|
|
74
|
+
readonly name: "role";
|
|
75
|
+
readonly type: "uint8";
|
|
76
|
+
}, {
|
|
77
|
+
readonly indexed: true;
|
|
78
|
+
readonly internalType: "address";
|
|
79
|
+
readonly name: "target";
|
|
80
|
+
readonly type: "address";
|
|
81
|
+
}, {
|
|
82
|
+
readonly indexed: true;
|
|
83
|
+
readonly internalType: "bytes4";
|
|
84
|
+
readonly name: "functionSig";
|
|
85
|
+
readonly type: "bytes4";
|
|
86
|
+
}, {
|
|
87
|
+
readonly indexed: false;
|
|
88
|
+
readonly internalType: "bool";
|
|
89
|
+
readonly name: "enabled";
|
|
90
|
+
readonly type: "bool";
|
|
91
|
+
}];
|
|
92
|
+
readonly name: "RoleCapabilityUpdated";
|
|
93
|
+
readonly type: "event";
|
|
94
|
+
}, {
|
|
95
|
+
readonly anonymous: false;
|
|
96
|
+
readonly inputs: readonly [{
|
|
97
|
+
readonly indexed: true;
|
|
98
|
+
readonly internalType: "address";
|
|
99
|
+
readonly name: "user";
|
|
100
|
+
readonly type: "address";
|
|
101
|
+
}, {
|
|
102
|
+
readonly indexed: true;
|
|
103
|
+
readonly internalType: "uint8";
|
|
104
|
+
readonly name: "role";
|
|
105
|
+
readonly type: "uint8";
|
|
106
|
+
}, {
|
|
107
|
+
readonly indexed: false;
|
|
108
|
+
readonly internalType: "bool";
|
|
109
|
+
readonly name: "enabled";
|
|
110
|
+
readonly type: "bool";
|
|
111
|
+
}];
|
|
112
|
+
readonly name: "UserRoleUpdated";
|
|
113
|
+
readonly type: "event";
|
|
114
|
+
}, {
|
|
115
|
+
readonly inputs: readonly [];
|
|
116
|
+
readonly name: "authority";
|
|
117
|
+
readonly outputs: readonly [{
|
|
118
|
+
readonly internalType: "contract Authority";
|
|
119
|
+
readonly name: "";
|
|
120
|
+
readonly type: "address";
|
|
121
|
+
}];
|
|
122
|
+
readonly stateMutability: "view";
|
|
123
|
+
readonly type: "function";
|
|
124
|
+
}, {
|
|
125
|
+
readonly inputs: readonly [{
|
|
126
|
+
readonly internalType: "address";
|
|
127
|
+
readonly name: "user";
|
|
128
|
+
readonly type: "address";
|
|
129
|
+
}, {
|
|
130
|
+
readonly internalType: "address";
|
|
131
|
+
readonly name: "target";
|
|
132
|
+
readonly type: "address";
|
|
133
|
+
}, {
|
|
134
|
+
readonly internalType: "bytes4";
|
|
135
|
+
readonly name: "functionSig";
|
|
136
|
+
readonly type: "bytes4";
|
|
137
|
+
}];
|
|
138
|
+
readonly name: "canCall";
|
|
139
|
+
readonly outputs: readonly [{
|
|
140
|
+
readonly internalType: "bool";
|
|
141
|
+
readonly name: "";
|
|
142
|
+
readonly type: "bool";
|
|
143
|
+
}];
|
|
144
|
+
readonly stateMutability: "view";
|
|
145
|
+
readonly type: "function";
|
|
146
|
+
}, {
|
|
147
|
+
readonly inputs: readonly [{
|
|
148
|
+
readonly internalType: "uint8";
|
|
149
|
+
readonly name: "role";
|
|
150
|
+
readonly type: "uint8";
|
|
151
|
+
}, {
|
|
152
|
+
readonly internalType: "address";
|
|
153
|
+
readonly name: "target";
|
|
154
|
+
readonly type: "address";
|
|
155
|
+
}, {
|
|
156
|
+
readonly internalType: "bytes4";
|
|
157
|
+
readonly name: "functionSig";
|
|
158
|
+
readonly type: "bytes4";
|
|
159
|
+
}];
|
|
160
|
+
readonly name: "doesRoleHaveCapability";
|
|
161
|
+
readonly outputs: readonly [{
|
|
162
|
+
readonly internalType: "bool";
|
|
163
|
+
readonly name: "";
|
|
164
|
+
readonly type: "bool";
|
|
165
|
+
}];
|
|
166
|
+
readonly stateMutability: "view";
|
|
167
|
+
readonly type: "function";
|
|
168
|
+
}, {
|
|
169
|
+
readonly inputs: readonly [{
|
|
170
|
+
readonly internalType: "address";
|
|
171
|
+
readonly name: "user";
|
|
172
|
+
readonly type: "address";
|
|
173
|
+
}, {
|
|
174
|
+
readonly internalType: "uint8";
|
|
175
|
+
readonly name: "role";
|
|
176
|
+
readonly type: "uint8";
|
|
177
|
+
}];
|
|
178
|
+
readonly name: "doesUserHaveRole";
|
|
179
|
+
readonly outputs: readonly [{
|
|
180
|
+
readonly internalType: "bool";
|
|
181
|
+
readonly name: "";
|
|
182
|
+
readonly type: "bool";
|
|
183
|
+
}];
|
|
184
|
+
readonly stateMutability: "view";
|
|
185
|
+
readonly type: "function";
|
|
186
|
+
}, {
|
|
187
|
+
readonly inputs: readonly [{
|
|
188
|
+
readonly internalType: "address";
|
|
189
|
+
readonly name: "";
|
|
190
|
+
readonly type: "address";
|
|
191
|
+
}, {
|
|
192
|
+
readonly internalType: "bytes4";
|
|
193
|
+
readonly name: "";
|
|
194
|
+
readonly type: "bytes4";
|
|
195
|
+
}];
|
|
196
|
+
readonly name: "getRolesWithCapability";
|
|
197
|
+
readonly outputs: readonly [{
|
|
198
|
+
readonly internalType: "bytes32";
|
|
199
|
+
readonly name: "";
|
|
200
|
+
readonly type: "bytes32";
|
|
201
|
+
}];
|
|
202
|
+
readonly stateMutability: "view";
|
|
203
|
+
readonly type: "function";
|
|
204
|
+
}, {
|
|
205
|
+
readonly inputs: readonly [{
|
|
206
|
+
readonly internalType: "address";
|
|
207
|
+
readonly name: "";
|
|
208
|
+
readonly type: "address";
|
|
209
|
+
}];
|
|
210
|
+
readonly name: "getUserRoles";
|
|
211
|
+
readonly outputs: readonly [{
|
|
212
|
+
readonly internalType: "bytes32";
|
|
213
|
+
readonly name: "";
|
|
214
|
+
readonly type: "bytes32";
|
|
215
|
+
}];
|
|
216
|
+
readonly stateMutability: "view";
|
|
217
|
+
readonly type: "function";
|
|
218
|
+
}, {
|
|
219
|
+
readonly inputs: readonly [{
|
|
220
|
+
readonly internalType: "address";
|
|
221
|
+
readonly name: "";
|
|
222
|
+
readonly type: "address";
|
|
223
|
+
}, {
|
|
224
|
+
readonly internalType: "bytes4";
|
|
225
|
+
readonly name: "";
|
|
226
|
+
readonly type: "bytes4";
|
|
227
|
+
}];
|
|
228
|
+
readonly name: "isCapabilityPublic";
|
|
229
|
+
readonly outputs: readonly [{
|
|
230
|
+
readonly internalType: "bool";
|
|
231
|
+
readonly name: "";
|
|
232
|
+
readonly type: "bool";
|
|
233
|
+
}];
|
|
234
|
+
readonly stateMutability: "view";
|
|
235
|
+
readonly type: "function";
|
|
236
|
+
}, {
|
|
237
|
+
readonly inputs: readonly [];
|
|
238
|
+
readonly name: "owner";
|
|
239
|
+
readonly outputs: readonly [{
|
|
240
|
+
readonly internalType: "address";
|
|
241
|
+
readonly name: "";
|
|
242
|
+
readonly type: "address";
|
|
243
|
+
}];
|
|
244
|
+
readonly stateMutability: "view";
|
|
245
|
+
readonly type: "function";
|
|
246
|
+
}, {
|
|
247
|
+
readonly inputs: readonly [{
|
|
248
|
+
readonly internalType: "contract Authority";
|
|
249
|
+
readonly name: "newAuthority";
|
|
250
|
+
readonly type: "address";
|
|
251
|
+
}];
|
|
252
|
+
readonly name: "setAuthority";
|
|
253
|
+
readonly outputs: readonly [];
|
|
254
|
+
readonly stateMutability: "nonpayable";
|
|
255
|
+
readonly type: "function";
|
|
256
|
+
}, {
|
|
257
|
+
readonly inputs: readonly [{
|
|
258
|
+
readonly internalType: "address";
|
|
259
|
+
readonly name: "target";
|
|
260
|
+
readonly type: "address";
|
|
261
|
+
}, {
|
|
262
|
+
readonly internalType: "bytes4";
|
|
263
|
+
readonly name: "functionSig";
|
|
264
|
+
readonly type: "bytes4";
|
|
265
|
+
}, {
|
|
266
|
+
readonly internalType: "bool";
|
|
267
|
+
readonly name: "enabled";
|
|
268
|
+
readonly type: "bool";
|
|
269
|
+
}];
|
|
270
|
+
readonly name: "setPublicCapability";
|
|
271
|
+
readonly outputs: readonly [];
|
|
272
|
+
readonly stateMutability: "nonpayable";
|
|
273
|
+
readonly type: "function";
|
|
274
|
+
}, {
|
|
275
|
+
readonly inputs: readonly [{
|
|
276
|
+
readonly internalType: "uint8";
|
|
277
|
+
readonly name: "role";
|
|
278
|
+
readonly type: "uint8";
|
|
279
|
+
}, {
|
|
280
|
+
readonly internalType: "address";
|
|
281
|
+
readonly name: "target";
|
|
282
|
+
readonly type: "address";
|
|
283
|
+
}, {
|
|
284
|
+
readonly internalType: "bytes4";
|
|
285
|
+
readonly name: "functionSig";
|
|
286
|
+
readonly type: "bytes4";
|
|
287
|
+
}, {
|
|
288
|
+
readonly internalType: "bool";
|
|
289
|
+
readonly name: "enabled";
|
|
290
|
+
readonly type: "bool";
|
|
291
|
+
}];
|
|
292
|
+
readonly name: "setRoleCapability";
|
|
293
|
+
readonly outputs: readonly [];
|
|
294
|
+
readonly stateMutability: "nonpayable";
|
|
295
|
+
readonly type: "function";
|
|
296
|
+
}, {
|
|
297
|
+
readonly inputs: readonly [{
|
|
298
|
+
readonly internalType: "address";
|
|
299
|
+
readonly name: "user";
|
|
300
|
+
readonly type: "address";
|
|
301
|
+
}, {
|
|
302
|
+
readonly internalType: "uint8";
|
|
303
|
+
readonly name: "role";
|
|
304
|
+
readonly type: "uint8";
|
|
305
|
+
}, {
|
|
306
|
+
readonly internalType: "bool";
|
|
307
|
+
readonly name: "enabled";
|
|
308
|
+
readonly type: "bool";
|
|
309
|
+
}];
|
|
310
|
+
readonly name: "setUserRole";
|
|
311
|
+
readonly outputs: readonly [];
|
|
312
|
+
readonly stateMutability: "nonpayable";
|
|
313
|
+
readonly type: "function";
|
|
314
|
+
}, {
|
|
315
|
+
readonly inputs: readonly [{
|
|
316
|
+
readonly internalType: "address";
|
|
317
|
+
readonly name: "newOwner";
|
|
318
|
+
readonly type: "address";
|
|
319
|
+
}];
|
|
320
|
+
readonly name: "transferOwnership";
|
|
321
|
+
readonly outputs: readonly [];
|
|
322
|
+
readonly stateMutability: "nonpayable";
|
|
323
|
+
readonly type: "function";
|
|
324
|
+
}];
|
|
325
|
+
/**
|
|
326
|
+
* Type-safe ABI for RolesAuthority
|
|
327
|
+
*/
|
|
328
|
+
export type RolesAuthorityAbi = typeof RolesAuthorityAbi;
|
|
329
|
+
/**
|
|
330
|
+
* Contract instance type for RolesAuthority
|
|
331
|
+
*/
|
|
332
|
+
export type RolesAuthorityContract = any;
|
|
333
|
+
/**
|
|
334
|
+
* RolesAuthority Contract Class
|
|
335
|
+
*
|
|
336
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
337
|
+
*
|
|
338
|
+
* @example
|
|
339
|
+
* ```typescript
|
|
340
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
341
|
+
* import { mainnet } from 'viem/chains';
|
|
342
|
+
* import { RolesAuthority } from 'RolesAuthority';
|
|
343
|
+
*
|
|
344
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
345
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
346
|
+
*
|
|
347
|
+
* const contract = new RolesAuthority('0x...', { publicClient, walletClient });
|
|
348
|
+
*
|
|
349
|
+
* // Read functions
|
|
350
|
+
* const result = await contract.balanceOf('0x...');
|
|
351
|
+
*
|
|
352
|
+
* // Write functions
|
|
353
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
354
|
+
*
|
|
355
|
+
* // Simulate transactions (dry-run)
|
|
356
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
357
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
358
|
+
*
|
|
359
|
+
* // Watch events
|
|
360
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
361
|
+
* console.log('Transfer event:', event);
|
|
362
|
+
* });
|
|
363
|
+
* ```
|
|
364
|
+
*/
|
|
365
|
+
export declare class RolesAuthority {
|
|
366
|
+
private contract;
|
|
367
|
+
private contractAddress;
|
|
368
|
+
private publicClient;
|
|
369
|
+
constructor(address: Address, clients: {
|
|
370
|
+
publicClient: PublicClient;
|
|
371
|
+
walletClient?: WalletClient;
|
|
372
|
+
});
|
|
373
|
+
/**
|
|
374
|
+
* Get the contract address
|
|
375
|
+
*/
|
|
376
|
+
get address(): Address;
|
|
377
|
+
/**
|
|
378
|
+
* Get the underlying viem contract instance.
|
|
379
|
+
*/
|
|
380
|
+
getContract(): RolesAuthorityContract;
|
|
381
|
+
/**
|
|
382
|
+
* authority
|
|
383
|
+
* view
|
|
384
|
+
*/
|
|
385
|
+
authority(): Promise<`0x${string}`>;
|
|
386
|
+
/**
|
|
387
|
+
* canCall
|
|
388
|
+
* view
|
|
389
|
+
*/
|
|
390
|
+
canCall(user: `0x${string}`, target: `0x${string}`, functionSig: `0x${string}`): Promise<boolean>;
|
|
391
|
+
/**
|
|
392
|
+
* doesRoleHaveCapability
|
|
393
|
+
* view
|
|
394
|
+
*/
|
|
395
|
+
doesRoleHaveCapability(role: bigint, target: `0x${string}`, functionSig: `0x${string}`): Promise<boolean>;
|
|
396
|
+
/**
|
|
397
|
+
* doesUserHaveRole
|
|
398
|
+
* view
|
|
399
|
+
*/
|
|
400
|
+
doesUserHaveRole(user: `0x${string}`, role: bigint): Promise<boolean>;
|
|
401
|
+
/**
|
|
402
|
+
* getRolesWithCapability
|
|
403
|
+
* view
|
|
404
|
+
*/
|
|
405
|
+
getRolesWithCapability(arg0: `0x${string}`, arg1: `0x${string}`): Promise<`0x${string}`>;
|
|
406
|
+
/**
|
|
407
|
+
* getUserRoles
|
|
408
|
+
* view
|
|
409
|
+
*/
|
|
410
|
+
getUserRoles(arg0: `0x${string}`): Promise<`0x${string}`>;
|
|
411
|
+
/**
|
|
412
|
+
* isCapabilityPublic
|
|
413
|
+
* view
|
|
414
|
+
*/
|
|
415
|
+
isCapabilityPublic(arg0: `0x${string}`, arg1: `0x${string}`): Promise<boolean>;
|
|
416
|
+
/**
|
|
417
|
+
* owner
|
|
418
|
+
* view
|
|
419
|
+
*/
|
|
420
|
+
owner(): Promise<`0x${string}`>;
|
|
421
|
+
/**
|
|
422
|
+
* setAuthority
|
|
423
|
+
* nonpayable
|
|
424
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
425
|
+
*/
|
|
426
|
+
setAuthority(newAuthority: `0x${string}`, options?: {
|
|
427
|
+
accessList?: import('viem').AccessList;
|
|
428
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
429
|
+
chain?: import('viem').Chain | null;
|
|
430
|
+
dataSuffix?: `0x${string}`;
|
|
431
|
+
gas?: bigint;
|
|
432
|
+
gasPrice?: bigint;
|
|
433
|
+
maxFeePerGas?: bigint;
|
|
434
|
+
maxPriorityFeePerGas?: bigint;
|
|
435
|
+
nonce?: number;
|
|
436
|
+
value?: bigint;
|
|
437
|
+
}): Promise<`0x${string}`>;
|
|
438
|
+
/**
|
|
439
|
+
* setPublicCapability
|
|
440
|
+
* nonpayable
|
|
441
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
442
|
+
*/
|
|
443
|
+
setPublicCapability(target: `0x${string}`, functionSig: `0x${string}`, enabled: boolean, options?: {
|
|
444
|
+
accessList?: import('viem').AccessList;
|
|
445
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
446
|
+
chain?: import('viem').Chain | null;
|
|
447
|
+
dataSuffix?: `0x${string}`;
|
|
448
|
+
gas?: bigint;
|
|
449
|
+
gasPrice?: bigint;
|
|
450
|
+
maxFeePerGas?: bigint;
|
|
451
|
+
maxPriorityFeePerGas?: bigint;
|
|
452
|
+
nonce?: number;
|
|
453
|
+
value?: bigint;
|
|
454
|
+
}): Promise<`0x${string}`>;
|
|
455
|
+
/**
|
|
456
|
+
* setRoleCapability
|
|
457
|
+
* nonpayable
|
|
458
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
459
|
+
*/
|
|
460
|
+
setRoleCapability(role: bigint, target: `0x${string}`, functionSig: `0x${string}`, enabled: boolean, options?: {
|
|
461
|
+
accessList?: import('viem').AccessList;
|
|
462
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
463
|
+
chain?: import('viem').Chain | null;
|
|
464
|
+
dataSuffix?: `0x${string}`;
|
|
465
|
+
gas?: bigint;
|
|
466
|
+
gasPrice?: bigint;
|
|
467
|
+
maxFeePerGas?: bigint;
|
|
468
|
+
maxPriorityFeePerGas?: bigint;
|
|
469
|
+
nonce?: number;
|
|
470
|
+
value?: bigint;
|
|
471
|
+
}): Promise<`0x${string}`>;
|
|
472
|
+
/**
|
|
473
|
+
* setUserRole
|
|
474
|
+
* nonpayable
|
|
475
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
476
|
+
*/
|
|
477
|
+
setUserRole(user: `0x${string}`, role: bigint, enabled: boolean, options?: {
|
|
478
|
+
accessList?: import('viem').AccessList;
|
|
479
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
480
|
+
chain?: import('viem').Chain | null;
|
|
481
|
+
dataSuffix?: `0x${string}`;
|
|
482
|
+
gas?: bigint;
|
|
483
|
+
gasPrice?: bigint;
|
|
484
|
+
maxFeePerGas?: bigint;
|
|
485
|
+
maxPriorityFeePerGas?: bigint;
|
|
486
|
+
nonce?: number;
|
|
487
|
+
value?: bigint;
|
|
488
|
+
}): Promise<`0x${string}`>;
|
|
489
|
+
/**
|
|
490
|
+
* transferOwnership
|
|
491
|
+
* nonpayable
|
|
492
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
493
|
+
*/
|
|
494
|
+
transferOwnership(newOwner: `0x${string}`, options?: {
|
|
495
|
+
accessList?: import('viem').AccessList;
|
|
496
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
497
|
+
chain?: import('viem').Chain | null;
|
|
498
|
+
dataSuffix?: `0x${string}`;
|
|
499
|
+
gas?: bigint;
|
|
500
|
+
gasPrice?: bigint;
|
|
501
|
+
maxFeePerGas?: bigint;
|
|
502
|
+
maxPriorityFeePerGas?: bigint;
|
|
503
|
+
nonce?: number;
|
|
504
|
+
value?: bigint;
|
|
505
|
+
}): Promise<`0x${string}`>;
|
|
506
|
+
/**
|
|
507
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
508
|
+
*
|
|
509
|
+
* @example
|
|
510
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
511
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
512
|
+
* console.log('Would succeed:', result.result);
|
|
513
|
+
*/
|
|
514
|
+
get simulate(): {
|
|
515
|
+
/**
|
|
516
|
+
* Simulate setAuthority
|
|
517
|
+
* Returns gas estimate and result without sending transaction
|
|
518
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
519
|
+
*/
|
|
520
|
+
setAuthority(newAuthority: `0x${string}`, options?: {
|
|
521
|
+
accessList?: import("viem").AccessList;
|
|
522
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
523
|
+
chain?: import("viem").Chain | null;
|
|
524
|
+
dataSuffix?: `0x${string}`;
|
|
525
|
+
gas?: bigint;
|
|
526
|
+
gasPrice?: bigint;
|
|
527
|
+
maxFeePerGas?: bigint;
|
|
528
|
+
maxPriorityFeePerGas?: bigint;
|
|
529
|
+
nonce?: number;
|
|
530
|
+
value?: bigint;
|
|
531
|
+
}): Promise<void>;
|
|
532
|
+
/**
|
|
533
|
+
* Simulate setPublicCapability
|
|
534
|
+
* Returns gas estimate and result without sending transaction
|
|
535
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
536
|
+
*/
|
|
537
|
+
setPublicCapability(target: `0x${string}`, functionSig: `0x${string}`, enabled: boolean, options?: {
|
|
538
|
+
accessList?: import("viem").AccessList;
|
|
539
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
540
|
+
chain?: import("viem").Chain | null;
|
|
541
|
+
dataSuffix?: `0x${string}`;
|
|
542
|
+
gas?: bigint;
|
|
543
|
+
gasPrice?: bigint;
|
|
544
|
+
maxFeePerGas?: bigint;
|
|
545
|
+
maxPriorityFeePerGas?: bigint;
|
|
546
|
+
nonce?: number;
|
|
547
|
+
value?: bigint;
|
|
548
|
+
}): Promise<void>;
|
|
549
|
+
/**
|
|
550
|
+
* Simulate setRoleCapability
|
|
551
|
+
* Returns gas estimate and result without sending transaction
|
|
552
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
553
|
+
*/
|
|
554
|
+
setRoleCapability(role: bigint, target: `0x${string}`, functionSig: `0x${string}`, enabled: boolean, options?: {
|
|
555
|
+
accessList?: import("viem").AccessList;
|
|
556
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
557
|
+
chain?: import("viem").Chain | null;
|
|
558
|
+
dataSuffix?: `0x${string}`;
|
|
559
|
+
gas?: bigint;
|
|
560
|
+
gasPrice?: bigint;
|
|
561
|
+
maxFeePerGas?: bigint;
|
|
562
|
+
maxPriorityFeePerGas?: bigint;
|
|
563
|
+
nonce?: number;
|
|
564
|
+
value?: bigint;
|
|
565
|
+
}): Promise<void>;
|
|
566
|
+
/**
|
|
567
|
+
* Simulate setUserRole
|
|
568
|
+
* Returns gas estimate and result without sending transaction
|
|
569
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
570
|
+
*/
|
|
571
|
+
setUserRole(user: `0x${string}`, role: bigint, enabled: boolean, options?: {
|
|
572
|
+
accessList?: import("viem").AccessList;
|
|
573
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
574
|
+
chain?: import("viem").Chain | null;
|
|
575
|
+
dataSuffix?: `0x${string}`;
|
|
576
|
+
gas?: bigint;
|
|
577
|
+
gasPrice?: bigint;
|
|
578
|
+
maxFeePerGas?: bigint;
|
|
579
|
+
maxPriorityFeePerGas?: bigint;
|
|
580
|
+
nonce?: number;
|
|
581
|
+
value?: bigint;
|
|
582
|
+
}): Promise<void>;
|
|
583
|
+
/**
|
|
584
|
+
* Simulate transferOwnership
|
|
585
|
+
* Returns gas estimate and result without sending transaction
|
|
586
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
587
|
+
*/
|
|
588
|
+
transferOwnership(newOwner: `0x${string}`, options?: {
|
|
589
|
+
accessList?: import("viem").AccessList;
|
|
590
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
591
|
+
chain?: import("viem").Chain | null;
|
|
592
|
+
dataSuffix?: `0x${string}`;
|
|
593
|
+
gas?: bigint;
|
|
594
|
+
gasPrice?: bigint;
|
|
595
|
+
maxFeePerGas?: bigint;
|
|
596
|
+
maxPriorityFeePerGas?: bigint;
|
|
597
|
+
nonce?: number;
|
|
598
|
+
value?: bigint;
|
|
599
|
+
}): Promise<void>;
|
|
600
|
+
};
|
|
601
|
+
/**
|
|
602
|
+
* Watch contract events
|
|
603
|
+
*
|
|
604
|
+
* @example
|
|
605
|
+
* // Watch all Transfer events
|
|
606
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
607
|
+
* console.log('Transfer:', event);
|
|
608
|
+
* });
|
|
609
|
+
*
|
|
610
|
+
* // Stop watching
|
|
611
|
+
* unwatch();
|
|
612
|
+
*/
|
|
613
|
+
get watch(): {
|
|
614
|
+
/**
|
|
615
|
+
* Watch AuthorityUpdated events
|
|
616
|
+
* @param callback Function to call when event is emitted
|
|
617
|
+
* @param filter Optional filter for indexed parameters
|
|
618
|
+
* @returns Unwatch function to stop listening
|
|
619
|
+
*/
|
|
620
|
+
AuthorityUpdated: (callback: (event: {
|
|
621
|
+
user: `0x${string}`;
|
|
622
|
+
newAuthority: `0x${string}`;
|
|
623
|
+
}) => void, filter?: {
|
|
624
|
+
user?: `0x${string}` | `0x${string}`[] | null;
|
|
625
|
+
newAuthority?: `0x${string}` | `0x${string}`[] | null;
|
|
626
|
+
}) => () => void;
|
|
627
|
+
/**
|
|
628
|
+
* Watch OwnershipTransferred events
|
|
629
|
+
* @param callback Function to call when event is emitted
|
|
630
|
+
* @param filter Optional filter for indexed parameters
|
|
631
|
+
* @returns Unwatch function to stop listening
|
|
632
|
+
*/
|
|
633
|
+
OwnershipTransferred: (callback: (event: {
|
|
634
|
+
user: `0x${string}`;
|
|
635
|
+
newOwner: `0x${string}`;
|
|
636
|
+
}) => void, filter?: {
|
|
637
|
+
user?: `0x${string}` | `0x${string}`[] | null;
|
|
638
|
+
newOwner?: `0x${string}` | `0x${string}`[] | null;
|
|
639
|
+
}) => () => void;
|
|
640
|
+
/**
|
|
641
|
+
* Watch PublicCapabilityUpdated events
|
|
642
|
+
* @param callback Function to call when event is emitted
|
|
643
|
+
* @param filter Optional filter for indexed parameters
|
|
644
|
+
* @returns Unwatch function to stop listening
|
|
645
|
+
*/
|
|
646
|
+
PublicCapabilityUpdated: (callback: (event: {
|
|
647
|
+
target: `0x${string}`;
|
|
648
|
+
functionSig: `0x${string}`;
|
|
649
|
+
enabled: boolean;
|
|
650
|
+
}) => void, filter?: {
|
|
651
|
+
target?: `0x${string}` | `0x${string}`[] | null;
|
|
652
|
+
functionSig?: `0x${string}` | `0x${string}`[] | null;
|
|
653
|
+
}) => () => void;
|
|
654
|
+
/**
|
|
655
|
+
* Watch RoleCapabilityUpdated events
|
|
656
|
+
* @param callback Function to call when event is emitted
|
|
657
|
+
* @param filter Optional filter for indexed parameters
|
|
658
|
+
* @returns Unwatch function to stop listening
|
|
659
|
+
*/
|
|
660
|
+
RoleCapabilityUpdated: (callback: (event: {
|
|
661
|
+
role: bigint;
|
|
662
|
+
target: `0x${string}`;
|
|
663
|
+
functionSig: `0x${string}`;
|
|
664
|
+
enabled: boolean;
|
|
665
|
+
}) => void, filter?: {
|
|
666
|
+
role?: number | number[] | null;
|
|
667
|
+
target?: `0x${string}` | `0x${string}`[] | null;
|
|
668
|
+
functionSig?: `0x${string}` | `0x${string}`[] | null;
|
|
669
|
+
}) => () => void;
|
|
670
|
+
/**
|
|
671
|
+
* Watch UserRoleUpdated events
|
|
672
|
+
* @param callback Function to call when event is emitted
|
|
673
|
+
* @param filter Optional filter for indexed parameters
|
|
674
|
+
* @returns Unwatch function to stop listening
|
|
675
|
+
*/
|
|
676
|
+
UserRoleUpdated: (callback: (event: {
|
|
677
|
+
user: `0x${string}`;
|
|
678
|
+
role: bigint;
|
|
679
|
+
enabled: boolean;
|
|
680
|
+
}) => void, filter?: {
|
|
681
|
+
user?: `0x${string}` | `0x${string}`[] | null;
|
|
682
|
+
role?: number | number[] | null;
|
|
683
|
+
}) => () => void;
|
|
684
|
+
};
|
|
685
|
+
}
|