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