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