@gitmyabi/curvegauge 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/CurveGauge_json.d.ts +1590 -0
- package/contracts/CurveGauge_json.js +1824 -0
- package/contracts/CurveGauge_json.ts +2184 -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,2184 @@
|
|
|
1
|
+
import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
|
|
2
|
+
import { getContract } from 'viem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* CurveGauge_json ABI
|
|
6
|
+
*
|
|
7
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
8
|
+
*/
|
|
9
|
+
export const CurveGauge_jsonAbi = [
|
|
10
|
+
{
|
|
11
|
+
"inputs": [],
|
|
12
|
+
"stateMutability": "nonpayable",
|
|
13
|
+
"type": "constructor"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"inputs": [
|
|
17
|
+
{
|
|
18
|
+
"internalType": "bytes32",
|
|
19
|
+
"name": "stateId",
|
|
20
|
+
"type": "bytes32"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"name": "AlreadyInState",
|
|
24
|
+
"type": "error"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"inputs": [],
|
|
28
|
+
"name": "ArrayLengthMismatch",
|
|
29
|
+
"type": "error"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"inputs": [
|
|
33
|
+
{
|
|
34
|
+
"internalType": "bytes32",
|
|
35
|
+
"name": "toStateId",
|
|
36
|
+
"type": "bytes32"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"internalType": "bytes32",
|
|
40
|
+
"name": "currentStateId",
|
|
41
|
+
"type": "bytes32"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"name": "CannotEnterStateWithLowerHeight",
|
|
45
|
+
"type": "error"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"inputs": [],
|
|
49
|
+
"name": "CannotExitFromNoAllocationState",
|
|
50
|
+
"type": "error"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"inputs": [
|
|
54
|
+
{
|
|
55
|
+
"internalType": "bytes32",
|
|
56
|
+
"name": "toStateId",
|
|
57
|
+
"type": "bytes32"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"internalType": "bytes32",
|
|
61
|
+
"name": "currentStateId",
|
|
62
|
+
"type": "bytes32"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"name": "CannotExitToStateWithHigherHeight",
|
|
66
|
+
"type": "error"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"inputs": [],
|
|
70
|
+
"name": "EmergencyExitUnavailable",
|
|
71
|
+
"type": "error"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"inputs": [],
|
|
75
|
+
"name": "EmergencyModeActivated",
|
|
76
|
+
"type": "error"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"inputs": [],
|
|
80
|
+
"name": "EnterUnavailable",
|
|
81
|
+
"type": "error"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"inputs": [],
|
|
85
|
+
"name": "InconsistentState",
|
|
86
|
+
"type": "error"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"inputs": [],
|
|
90
|
+
"name": "IncorrectAmount",
|
|
91
|
+
"type": "error"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"inputs": [
|
|
95
|
+
{
|
|
96
|
+
"internalType": "uint256",
|
|
97
|
+
"name": "navDelta",
|
|
98
|
+
"type": "uint256"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"internalType": "uint256",
|
|
102
|
+
"name": "maxSlippageCached",
|
|
103
|
+
"type": "uint256"
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"name": "IncorrectSlippage",
|
|
107
|
+
"type": "error"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"inputs": [
|
|
111
|
+
{
|
|
112
|
+
"internalType": "bytes32",
|
|
113
|
+
"name": "stateId",
|
|
114
|
+
"type": "bytes32"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"name": "IncorrectStateId",
|
|
118
|
+
"type": "error"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"inputs": [],
|
|
122
|
+
"name": "InvalidInitialization",
|
|
123
|
+
"type": "error"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"inputs": [],
|
|
127
|
+
"name": "NavResolutionModeActivated",
|
|
128
|
+
"type": "error"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"inputs": [],
|
|
132
|
+
"name": "NavResolutionModeNotActivated",
|
|
133
|
+
"type": "error"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"inputs": [
|
|
137
|
+
{
|
|
138
|
+
"internalType": "bytes32",
|
|
139
|
+
"name": "currentStateId",
|
|
140
|
+
"type": "bytes32"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"internalType": "uint256",
|
|
144
|
+
"name": "currentStateBitmask",
|
|
145
|
+
"type": "uint256"
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"name": "NotInTargetState",
|
|
149
|
+
"type": "error"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"inputs": [],
|
|
153
|
+
"name": "NotInitializing",
|
|
154
|
+
"type": "error"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"inputs": [
|
|
158
|
+
{
|
|
159
|
+
"internalType": "address",
|
|
160
|
+
"name": "token",
|
|
161
|
+
"type": "address"
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"name": "NotWhitelistedToken",
|
|
165
|
+
"type": "error"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"inputs": [],
|
|
169
|
+
"name": "ReentrancyGuardReentrantCall",
|
|
170
|
+
"type": "error"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"inputs": [],
|
|
174
|
+
"name": "ReshufflingModeDisabled",
|
|
175
|
+
"type": "error"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"inputs": [
|
|
179
|
+
{
|
|
180
|
+
"internalType": "address",
|
|
181
|
+
"name": "token",
|
|
182
|
+
"type": "address"
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
"name": "SafeERC20FailedOperation",
|
|
186
|
+
"type": "error"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"inputs": [
|
|
190
|
+
{
|
|
191
|
+
"internalType": "uint256",
|
|
192
|
+
"name": "navBefore",
|
|
193
|
+
"type": "uint256"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"internalType": "uint256",
|
|
197
|
+
"name": "navAfter",
|
|
198
|
+
"type": "uint256"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"internalType": "uint256",
|
|
202
|
+
"name": "minNavDelta",
|
|
203
|
+
"type": "uint256"
|
|
204
|
+
}
|
|
205
|
+
],
|
|
206
|
+
"name": "SlippageCheckFailed",
|
|
207
|
+
"type": "error"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"inputs": [
|
|
211
|
+
{
|
|
212
|
+
"internalType": "bytes32",
|
|
213
|
+
"name": "stateId",
|
|
214
|
+
"type": "bytes32"
|
|
215
|
+
}
|
|
216
|
+
],
|
|
217
|
+
"name": "StateAlreadyExists",
|
|
218
|
+
"type": "error"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"inputs": [
|
|
222
|
+
{
|
|
223
|
+
"internalType": "bytes32",
|
|
224
|
+
"name": "stateId",
|
|
225
|
+
"type": "bytes32"
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"name": "StateHasZeroBitmask",
|
|
229
|
+
"type": "error"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"inputs": [
|
|
233
|
+
{
|
|
234
|
+
"internalType": "bytes32",
|
|
235
|
+
"name": "stateId",
|
|
236
|
+
"type": "bytes32"
|
|
237
|
+
}
|
|
238
|
+
],
|
|
239
|
+
"name": "StateNotFound",
|
|
240
|
+
"type": "error"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"inputs": [],
|
|
244
|
+
"name": "TargetStateAlreadySet",
|
|
245
|
+
"type": "error"
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
"inputs": [
|
|
249
|
+
{
|
|
250
|
+
"internalType": "address",
|
|
251
|
+
"name": "value",
|
|
252
|
+
"type": "address"
|
|
253
|
+
}
|
|
254
|
+
],
|
|
255
|
+
"name": "TokenAlreadySet",
|
|
256
|
+
"type": "error"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"inputs": [
|
|
260
|
+
{
|
|
261
|
+
"internalType": "address",
|
|
262
|
+
"name": "token",
|
|
263
|
+
"type": "address"
|
|
264
|
+
}
|
|
265
|
+
],
|
|
266
|
+
"name": "TokenNotFound",
|
|
267
|
+
"type": "error"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"inputs": [],
|
|
271
|
+
"name": "TreasuryNotSet",
|
|
272
|
+
"type": "error"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"inputs": [],
|
|
276
|
+
"name": "Unauthorized",
|
|
277
|
+
"type": "error"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"inputs": [],
|
|
281
|
+
"name": "ZeroAddress",
|
|
282
|
+
"type": "error"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"inputs": [],
|
|
286
|
+
"name": "ZeroArrayLength",
|
|
287
|
+
"type": "error"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"inputs": [],
|
|
291
|
+
"name": "ZeroState",
|
|
292
|
+
"type": "error"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"anonymous": false,
|
|
296
|
+
"inputs": [
|
|
297
|
+
{
|
|
298
|
+
"indexed": false,
|
|
299
|
+
"internalType": "bytes32",
|
|
300
|
+
"name": "toStateId",
|
|
301
|
+
"type": "bytes32"
|
|
302
|
+
}
|
|
303
|
+
],
|
|
304
|
+
"name": "EmergencyExitFailed",
|
|
305
|
+
"type": "event"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"anonymous": false,
|
|
309
|
+
"inputs": [
|
|
310
|
+
{
|
|
311
|
+
"indexed": false,
|
|
312
|
+
"internalType": "uint256",
|
|
313
|
+
"name": "oldEmergencyExitMaxSlippage",
|
|
314
|
+
"type": "uint256"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"indexed": false,
|
|
318
|
+
"internalType": "uint256",
|
|
319
|
+
"name": "newEmergencyExitMaxSlippage",
|
|
320
|
+
"type": "uint256"
|
|
321
|
+
}
|
|
322
|
+
],
|
|
323
|
+
"name": "EmergencyExitMaxSlippageUpdated",
|
|
324
|
+
"type": "event"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"anonymous": false,
|
|
328
|
+
"inputs": [
|
|
329
|
+
{
|
|
330
|
+
"indexed": false,
|
|
331
|
+
"internalType": "bytes32",
|
|
332
|
+
"name": "toStateId",
|
|
333
|
+
"type": "bytes32"
|
|
334
|
+
}
|
|
335
|
+
],
|
|
336
|
+
"name": "EmergencyExitSucceeded",
|
|
337
|
+
"type": "event"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"anonymous": false,
|
|
341
|
+
"inputs": [
|
|
342
|
+
{
|
|
343
|
+
"indexed": false,
|
|
344
|
+
"internalType": "bytes32",
|
|
345
|
+
"name": "toStateId",
|
|
346
|
+
"type": "bytes32"
|
|
347
|
+
}
|
|
348
|
+
],
|
|
349
|
+
"name": "EmergencyExited",
|
|
350
|
+
"type": "event"
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"anonymous": false,
|
|
354
|
+
"inputs": [
|
|
355
|
+
{
|
|
356
|
+
"indexed": false,
|
|
357
|
+
"internalType": "bool",
|
|
358
|
+
"name": "isEmergencyMode",
|
|
359
|
+
"type": "bool"
|
|
360
|
+
}
|
|
361
|
+
],
|
|
362
|
+
"name": "EmergencyModeUpdated",
|
|
363
|
+
"type": "event"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"anonymous": false,
|
|
367
|
+
"inputs": [
|
|
368
|
+
{
|
|
369
|
+
"indexed": false,
|
|
370
|
+
"internalType": "uint256",
|
|
371
|
+
"name": "oldEnterMaxSlippage",
|
|
372
|
+
"type": "uint256"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"indexed": false,
|
|
376
|
+
"internalType": "uint256",
|
|
377
|
+
"name": "newEnterMaxSlippage",
|
|
378
|
+
"type": "uint256"
|
|
379
|
+
}
|
|
380
|
+
],
|
|
381
|
+
"name": "EnterMaxSlippageUpdated",
|
|
382
|
+
"type": "event"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"anonymous": false,
|
|
386
|
+
"inputs": [
|
|
387
|
+
{
|
|
388
|
+
"indexed": false,
|
|
389
|
+
"internalType": "uint256",
|
|
390
|
+
"name": "navBefore",
|
|
391
|
+
"type": "uint256"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"indexed": false,
|
|
395
|
+
"internalType": "uint256",
|
|
396
|
+
"name": "navAfter",
|
|
397
|
+
"type": "uint256"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"indexed": false,
|
|
401
|
+
"internalType": "bool",
|
|
402
|
+
"name": "hasRemainder",
|
|
403
|
+
"type": "bool"
|
|
404
|
+
}
|
|
405
|
+
],
|
|
406
|
+
"name": "Entered",
|
|
407
|
+
"type": "event"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"anonymous": false,
|
|
411
|
+
"inputs": [
|
|
412
|
+
{
|
|
413
|
+
"indexed": false,
|
|
414
|
+
"internalType": "uint256",
|
|
415
|
+
"name": "oldExitMaxSlippage",
|
|
416
|
+
"type": "uint256"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"indexed": false,
|
|
420
|
+
"internalType": "uint256",
|
|
421
|
+
"name": "newExitMaxSlippage",
|
|
422
|
+
"type": "uint256"
|
|
423
|
+
}
|
|
424
|
+
],
|
|
425
|
+
"name": "ExitMaxSlippageUpdated",
|
|
426
|
+
"type": "event"
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"anonymous": false,
|
|
430
|
+
"inputs": [
|
|
431
|
+
{
|
|
432
|
+
"indexed": false,
|
|
433
|
+
"internalType": "uint256",
|
|
434
|
+
"name": "navBefore",
|
|
435
|
+
"type": "uint256"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"indexed": false,
|
|
439
|
+
"internalType": "uint256",
|
|
440
|
+
"name": "navAfter",
|
|
441
|
+
"type": "uint256"
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
"indexed": false,
|
|
445
|
+
"internalType": "bytes32",
|
|
446
|
+
"name": "stateId",
|
|
447
|
+
"type": "bytes32"
|
|
448
|
+
}
|
|
449
|
+
],
|
|
450
|
+
"name": "Exited",
|
|
451
|
+
"type": "event"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"anonymous": false,
|
|
455
|
+
"inputs": [
|
|
456
|
+
{
|
|
457
|
+
"indexed": false,
|
|
458
|
+
"internalType": "bytes32",
|
|
459
|
+
"name": "stateId",
|
|
460
|
+
"type": "bytes32"
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"indexed": false,
|
|
464
|
+
"internalType": "uint256",
|
|
465
|
+
"name": "navAfter",
|
|
466
|
+
"type": "uint256"
|
|
467
|
+
}
|
|
468
|
+
],
|
|
469
|
+
"name": "Harvested",
|
|
470
|
+
"type": "event"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
"anonymous": false,
|
|
474
|
+
"inputs": [
|
|
475
|
+
{
|
|
476
|
+
"indexed": false,
|
|
477
|
+
"internalType": "uint64",
|
|
478
|
+
"name": "version",
|
|
479
|
+
"type": "uint64"
|
|
480
|
+
}
|
|
481
|
+
],
|
|
482
|
+
"name": "Initialized",
|
|
483
|
+
"type": "event"
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"anonymous": false,
|
|
487
|
+
"inputs": [
|
|
488
|
+
{
|
|
489
|
+
"indexed": false,
|
|
490
|
+
"internalType": "address",
|
|
491
|
+
"name": "",
|
|
492
|
+
"type": "address"
|
|
493
|
+
}
|
|
494
|
+
],
|
|
495
|
+
"name": "InputTokenSet",
|
|
496
|
+
"type": "event"
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
"anonymous": false,
|
|
500
|
+
"inputs": [
|
|
501
|
+
{
|
|
502
|
+
"indexed": false,
|
|
503
|
+
"internalType": "bool",
|
|
504
|
+
"name": "isNavResolutionMode",
|
|
505
|
+
"type": "bool"
|
|
506
|
+
}
|
|
507
|
+
],
|
|
508
|
+
"name": "NavResolutionModeUpdated",
|
|
509
|
+
"type": "event"
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
"anonymous": false,
|
|
513
|
+
"inputs": [
|
|
514
|
+
{
|
|
515
|
+
"indexed": false,
|
|
516
|
+
"internalType": "address",
|
|
517
|
+
"name": "",
|
|
518
|
+
"type": "address"
|
|
519
|
+
}
|
|
520
|
+
],
|
|
521
|
+
"name": "OutputTokenSet",
|
|
522
|
+
"type": "event"
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
"anonymous": false,
|
|
526
|
+
"inputs": [
|
|
527
|
+
{
|
|
528
|
+
"indexed": false,
|
|
529
|
+
"internalType": "bytes32",
|
|
530
|
+
"name": "stateId",
|
|
531
|
+
"type": "bytes32"
|
|
532
|
+
}
|
|
533
|
+
],
|
|
534
|
+
"name": "ReenteredToState",
|
|
535
|
+
"type": "event"
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
"anonymous": false,
|
|
539
|
+
"inputs": [
|
|
540
|
+
{
|
|
541
|
+
"indexed": false,
|
|
542
|
+
"internalType": "bytes32",
|
|
543
|
+
"name": "oldStateId",
|
|
544
|
+
"type": "bytes32"
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
"indexed": false,
|
|
548
|
+
"internalType": "bytes32",
|
|
549
|
+
"name": "newStateId",
|
|
550
|
+
"type": "bytes32"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
"indexed": false,
|
|
554
|
+
"internalType": "uint256",
|
|
555
|
+
"name": "newStateBitmask",
|
|
556
|
+
"type": "uint256"
|
|
557
|
+
}
|
|
558
|
+
],
|
|
559
|
+
"name": "StateUpdated",
|
|
560
|
+
"type": "event"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
"inputs": [
|
|
564
|
+
{
|
|
565
|
+
"internalType": "bytes32",
|
|
566
|
+
"name": "acceptedStateId",
|
|
567
|
+
"type": "bytes32"
|
|
568
|
+
}
|
|
569
|
+
],
|
|
570
|
+
"name": "acceptNav",
|
|
571
|
+
"outputs": [
|
|
572
|
+
{
|
|
573
|
+
"internalType": "uint256",
|
|
574
|
+
"name": "",
|
|
575
|
+
"type": "uint256"
|
|
576
|
+
}
|
|
577
|
+
],
|
|
578
|
+
"stateMutability": "nonpayable",
|
|
579
|
+
"type": "function"
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
"inputs": [],
|
|
583
|
+
"name": "currentStateId",
|
|
584
|
+
"outputs": [
|
|
585
|
+
{
|
|
586
|
+
"internalType": "bytes32",
|
|
587
|
+
"name": "",
|
|
588
|
+
"type": "bytes32"
|
|
589
|
+
}
|
|
590
|
+
],
|
|
591
|
+
"stateMutability": "view",
|
|
592
|
+
"type": "function"
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
"inputs": [],
|
|
596
|
+
"name": "currentStateNav",
|
|
597
|
+
"outputs": [
|
|
598
|
+
{
|
|
599
|
+
"internalType": "uint256",
|
|
600
|
+
"name": "",
|
|
601
|
+
"type": "uint256"
|
|
602
|
+
}
|
|
603
|
+
],
|
|
604
|
+
"stateMutability": "view",
|
|
605
|
+
"type": "function"
|
|
606
|
+
},
|
|
607
|
+
{
|
|
608
|
+
"inputs": [
|
|
609
|
+
{
|
|
610
|
+
"internalType": "bytes32",
|
|
611
|
+
"name": "toStateId",
|
|
612
|
+
"type": "bytes32"
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
"internalType": "uint256",
|
|
616
|
+
"name": "share",
|
|
617
|
+
"type": "uint256"
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
"internalType": "uint256",
|
|
621
|
+
"name": "minNavDelta",
|
|
622
|
+
"type": "uint256"
|
|
623
|
+
}
|
|
624
|
+
],
|
|
625
|
+
"name": "emergencyExit",
|
|
626
|
+
"outputs": [],
|
|
627
|
+
"stateMutability": "payable",
|
|
628
|
+
"type": "function"
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
"inputs": [],
|
|
632
|
+
"name": "emergencyExitMaxSlippage",
|
|
633
|
+
"outputs": [
|
|
634
|
+
{
|
|
635
|
+
"internalType": "uint256",
|
|
636
|
+
"name": "",
|
|
637
|
+
"type": "uint256"
|
|
638
|
+
}
|
|
639
|
+
],
|
|
640
|
+
"stateMutability": "view",
|
|
641
|
+
"type": "function"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
"inputs": [
|
|
645
|
+
{
|
|
646
|
+
"internalType": "uint256[]",
|
|
647
|
+
"name": "amounts",
|
|
648
|
+
"type": "uint256[]"
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
"internalType": "uint256",
|
|
652
|
+
"name": "minNavDelta",
|
|
653
|
+
"type": "uint256"
|
|
654
|
+
}
|
|
655
|
+
],
|
|
656
|
+
"name": "enter",
|
|
657
|
+
"outputs": [
|
|
658
|
+
{
|
|
659
|
+
"internalType": "uint256",
|
|
660
|
+
"name": "",
|
|
661
|
+
"type": "uint256"
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
"internalType": "bool",
|
|
665
|
+
"name": "",
|
|
666
|
+
"type": "bool"
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
"internalType": "uint256[]",
|
|
670
|
+
"name": "",
|
|
671
|
+
"type": "uint256[]"
|
|
672
|
+
}
|
|
673
|
+
],
|
|
674
|
+
"stateMutability": "payable",
|
|
675
|
+
"type": "function"
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
"inputs": [],
|
|
679
|
+
"name": "enterMaxSlippage",
|
|
680
|
+
"outputs": [
|
|
681
|
+
{
|
|
682
|
+
"internalType": "uint256",
|
|
683
|
+
"name": "",
|
|
684
|
+
"type": "uint256"
|
|
685
|
+
}
|
|
686
|
+
],
|
|
687
|
+
"stateMutability": "view",
|
|
688
|
+
"type": "function"
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
"inputs": [
|
|
692
|
+
{
|
|
693
|
+
"internalType": "uint256",
|
|
694
|
+
"name": "share",
|
|
695
|
+
"type": "uint256"
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
"internalType": "uint256",
|
|
699
|
+
"name": "maxNavDelta",
|
|
700
|
+
"type": "uint256"
|
|
701
|
+
}
|
|
702
|
+
],
|
|
703
|
+
"name": "exit",
|
|
704
|
+
"outputs": [
|
|
705
|
+
{
|
|
706
|
+
"internalType": "address[]",
|
|
707
|
+
"name": "",
|
|
708
|
+
"type": "address[]"
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
"internalType": "uint256[]",
|
|
712
|
+
"name": "",
|
|
713
|
+
"type": "uint256[]"
|
|
714
|
+
}
|
|
715
|
+
],
|
|
716
|
+
"stateMutability": "payable",
|
|
717
|
+
"type": "function"
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
"inputs": [],
|
|
721
|
+
"name": "exitMaxSlippage",
|
|
722
|
+
"outputs": [
|
|
723
|
+
{
|
|
724
|
+
"internalType": "uint256",
|
|
725
|
+
"name": "",
|
|
726
|
+
"type": "uint256"
|
|
727
|
+
}
|
|
728
|
+
],
|
|
729
|
+
"stateMutability": "view",
|
|
730
|
+
"type": "function"
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
"inputs": [],
|
|
734
|
+
"name": "gauge",
|
|
735
|
+
"outputs": [
|
|
736
|
+
{
|
|
737
|
+
"internalType": "address",
|
|
738
|
+
"name": "",
|
|
739
|
+
"type": "address"
|
|
740
|
+
}
|
|
741
|
+
],
|
|
742
|
+
"stateMutability": "view",
|
|
743
|
+
"type": "function"
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
"inputs": [],
|
|
747
|
+
"name": "getInputTokens",
|
|
748
|
+
"outputs": [
|
|
749
|
+
{
|
|
750
|
+
"internalType": "address[]",
|
|
751
|
+
"name": "",
|
|
752
|
+
"type": "address[]"
|
|
753
|
+
}
|
|
754
|
+
],
|
|
755
|
+
"stateMutability": "view",
|
|
756
|
+
"type": "function"
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
"inputs": [],
|
|
760
|
+
"name": "getOutputTokens",
|
|
761
|
+
"outputs": [
|
|
762
|
+
{
|
|
763
|
+
"internalType": "address[]",
|
|
764
|
+
"name": "",
|
|
765
|
+
"type": "address[]"
|
|
766
|
+
}
|
|
767
|
+
],
|
|
768
|
+
"stateMutability": "view",
|
|
769
|
+
"type": "function"
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
"inputs": [],
|
|
773
|
+
"name": "getStateIds",
|
|
774
|
+
"outputs": [
|
|
775
|
+
{
|
|
776
|
+
"internalType": "bytes32[]",
|
|
777
|
+
"name": "",
|
|
778
|
+
"type": "bytes32[]"
|
|
779
|
+
}
|
|
780
|
+
],
|
|
781
|
+
"stateMutability": "view",
|
|
782
|
+
"type": "function"
|
|
783
|
+
},
|
|
784
|
+
{
|
|
785
|
+
"inputs": [
|
|
786
|
+
{
|
|
787
|
+
"internalType": "address",
|
|
788
|
+
"name": "token",
|
|
789
|
+
"type": "address"
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
"internalType": "uint256",
|
|
793
|
+
"name": "amount",
|
|
794
|
+
"type": "uint256"
|
|
795
|
+
}
|
|
796
|
+
],
|
|
797
|
+
"name": "getTokenAmountInNotion",
|
|
798
|
+
"outputs": [
|
|
799
|
+
{
|
|
800
|
+
"internalType": "uint256",
|
|
801
|
+
"name": "",
|
|
802
|
+
"type": "uint256"
|
|
803
|
+
}
|
|
804
|
+
],
|
|
805
|
+
"stateMutability": "view",
|
|
806
|
+
"type": "function"
|
|
807
|
+
},
|
|
808
|
+
{
|
|
809
|
+
"inputs": [],
|
|
810
|
+
"name": "harvest",
|
|
811
|
+
"outputs": [
|
|
812
|
+
{
|
|
813
|
+
"internalType": "uint256",
|
|
814
|
+
"name": "",
|
|
815
|
+
"type": "uint256"
|
|
816
|
+
}
|
|
817
|
+
],
|
|
818
|
+
"stateMutability": "payable",
|
|
819
|
+
"type": "function"
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
"inputs": [
|
|
823
|
+
{
|
|
824
|
+
"internalType": "address",
|
|
825
|
+
"name": "strategyContainer",
|
|
826
|
+
"type": "address"
|
|
827
|
+
},
|
|
828
|
+
{
|
|
829
|
+
"internalType": "address",
|
|
830
|
+
"name": "_gauge",
|
|
831
|
+
"type": "address"
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
"internalType": "uint256",
|
|
835
|
+
"name": "_enterMaxSlippage",
|
|
836
|
+
"type": "uint256"
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
"internalType": "uint256",
|
|
840
|
+
"name": "_exitMaxSlippage",
|
|
841
|
+
"type": "uint256"
|
|
842
|
+
},
|
|
843
|
+
{
|
|
844
|
+
"internalType": "uint256",
|
|
845
|
+
"name": "_emergencyExitMaxSlippage",
|
|
846
|
+
"type": "uint256"
|
|
847
|
+
}
|
|
848
|
+
],
|
|
849
|
+
"name": "initialize",
|
|
850
|
+
"outputs": [],
|
|
851
|
+
"stateMutability": "nonpayable",
|
|
852
|
+
"type": "function"
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
"inputs": [],
|
|
856
|
+
"name": "isNavResolutionMode",
|
|
857
|
+
"outputs": [
|
|
858
|
+
{
|
|
859
|
+
"internalType": "bool",
|
|
860
|
+
"name": "",
|
|
861
|
+
"type": "bool"
|
|
862
|
+
}
|
|
863
|
+
],
|
|
864
|
+
"stateMutability": "view",
|
|
865
|
+
"type": "function"
|
|
866
|
+
},
|
|
867
|
+
{
|
|
868
|
+
"inputs": [],
|
|
869
|
+
"name": "lastStoredGaugeBalance",
|
|
870
|
+
"outputs": [
|
|
871
|
+
{
|
|
872
|
+
"internalType": "uint256",
|
|
873
|
+
"name": "",
|
|
874
|
+
"type": "uint256"
|
|
875
|
+
}
|
|
876
|
+
],
|
|
877
|
+
"stateMutability": "view",
|
|
878
|
+
"type": "function"
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
"inputs": [],
|
|
882
|
+
"name": "lastStoredVirtualPrice",
|
|
883
|
+
"outputs": [
|
|
884
|
+
{
|
|
885
|
+
"internalType": "uint256",
|
|
886
|
+
"name": "",
|
|
887
|
+
"type": "uint256"
|
|
888
|
+
}
|
|
889
|
+
],
|
|
890
|
+
"stateMutability": "view",
|
|
891
|
+
"type": "function"
|
|
892
|
+
},
|
|
893
|
+
{
|
|
894
|
+
"inputs": [],
|
|
895
|
+
"name": "lpToken",
|
|
896
|
+
"outputs": [
|
|
897
|
+
{
|
|
898
|
+
"internalType": "address",
|
|
899
|
+
"name": "",
|
|
900
|
+
"type": "address"
|
|
901
|
+
}
|
|
902
|
+
],
|
|
903
|
+
"stateMutability": "view",
|
|
904
|
+
"type": "function"
|
|
905
|
+
},
|
|
906
|
+
{
|
|
907
|
+
"inputs": [
|
|
908
|
+
{
|
|
909
|
+
"internalType": "bytes32",
|
|
910
|
+
"name": "stateId",
|
|
911
|
+
"type": "bytes32"
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
"internalType": "uint256",
|
|
915
|
+
"name": "minNavDelta",
|
|
916
|
+
"type": "uint256"
|
|
917
|
+
}
|
|
918
|
+
],
|
|
919
|
+
"name": "reenterToState",
|
|
920
|
+
"outputs": [],
|
|
921
|
+
"stateMutability": "payable",
|
|
922
|
+
"type": "function"
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
"inputs": [
|
|
926
|
+
{
|
|
927
|
+
"internalType": "uint256",
|
|
928
|
+
"name": "_emergencyExitMaxSlippage",
|
|
929
|
+
"type": "uint256"
|
|
930
|
+
}
|
|
931
|
+
],
|
|
932
|
+
"name": "setEmergencyExitMaxSlippage",
|
|
933
|
+
"outputs": [],
|
|
934
|
+
"stateMutability": "nonpayable",
|
|
935
|
+
"type": "function"
|
|
936
|
+
},
|
|
937
|
+
{
|
|
938
|
+
"inputs": [
|
|
939
|
+
{
|
|
940
|
+
"internalType": "uint256",
|
|
941
|
+
"name": "_enterMaxSlippage",
|
|
942
|
+
"type": "uint256"
|
|
943
|
+
}
|
|
944
|
+
],
|
|
945
|
+
"name": "setEnterMaxSlippage",
|
|
946
|
+
"outputs": [],
|
|
947
|
+
"stateMutability": "nonpayable",
|
|
948
|
+
"type": "function"
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
"inputs": [
|
|
952
|
+
{
|
|
953
|
+
"internalType": "uint256",
|
|
954
|
+
"name": "_exitMaxSlippage",
|
|
955
|
+
"type": "uint256"
|
|
956
|
+
}
|
|
957
|
+
],
|
|
958
|
+
"name": "setExitMaxSlippage",
|
|
959
|
+
"outputs": [],
|
|
960
|
+
"stateMutability": "nonpayable",
|
|
961
|
+
"type": "function"
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
"inputs": [
|
|
965
|
+
{
|
|
966
|
+
"internalType": "address[]",
|
|
967
|
+
"name": "inputTokens",
|
|
968
|
+
"type": "address[]"
|
|
969
|
+
}
|
|
970
|
+
],
|
|
971
|
+
"name": "setInputTokens",
|
|
972
|
+
"outputs": [],
|
|
973
|
+
"stateMutability": "nonpayable",
|
|
974
|
+
"type": "function"
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
"inputs": [
|
|
978
|
+
{
|
|
979
|
+
"internalType": "address[]",
|
|
980
|
+
"name": "outputTokens",
|
|
981
|
+
"type": "address[]"
|
|
982
|
+
}
|
|
983
|
+
],
|
|
984
|
+
"name": "setOutputTokens",
|
|
985
|
+
"outputs": [],
|
|
986
|
+
"stateMutability": "nonpayable",
|
|
987
|
+
"type": "function"
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
"inputs": [
|
|
991
|
+
{
|
|
992
|
+
"internalType": "bytes32",
|
|
993
|
+
"name": "stateId",
|
|
994
|
+
"type": "bytes32"
|
|
995
|
+
}
|
|
996
|
+
],
|
|
997
|
+
"name": "stateBitmask",
|
|
998
|
+
"outputs": [
|
|
999
|
+
{
|
|
1000
|
+
"internalType": "uint256",
|
|
1001
|
+
"name": "",
|
|
1002
|
+
"type": "uint256"
|
|
1003
|
+
}
|
|
1004
|
+
],
|
|
1005
|
+
"stateMutability": "view",
|
|
1006
|
+
"type": "function"
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
"inputs": [
|
|
1010
|
+
{
|
|
1011
|
+
"internalType": "bytes32",
|
|
1012
|
+
"name": "stateId",
|
|
1013
|
+
"type": "bytes32"
|
|
1014
|
+
}
|
|
1015
|
+
],
|
|
1016
|
+
"name": "stateNav",
|
|
1017
|
+
"outputs": [
|
|
1018
|
+
{
|
|
1019
|
+
"internalType": "uint256",
|
|
1020
|
+
"name": "",
|
|
1021
|
+
"type": "uint256"
|
|
1022
|
+
}
|
|
1023
|
+
],
|
|
1024
|
+
"stateMutability": "view",
|
|
1025
|
+
"type": "function"
|
|
1026
|
+
},
|
|
1027
|
+
{
|
|
1028
|
+
"inputs": [
|
|
1029
|
+
{
|
|
1030
|
+
"internalType": "bytes32",
|
|
1031
|
+
"name": "toStateId",
|
|
1032
|
+
"type": "bytes32"
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
"internalType": "uint256",
|
|
1036
|
+
"name": "share",
|
|
1037
|
+
"type": "uint256"
|
|
1038
|
+
}
|
|
1039
|
+
],
|
|
1040
|
+
"name": "tryEmergencyExit",
|
|
1041
|
+
"outputs": [],
|
|
1042
|
+
"stateMutability": "nonpayable",
|
|
1043
|
+
"type": "function"
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
"inputs": [],
|
|
1047
|
+
"name": "underlyingAsset0",
|
|
1048
|
+
"outputs": [
|
|
1049
|
+
{
|
|
1050
|
+
"internalType": "address",
|
|
1051
|
+
"name": "",
|
|
1052
|
+
"type": "address"
|
|
1053
|
+
}
|
|
1054
|
+
],
|
|
1055
|
+
"stateMutability": "view",
|
|
1056
|
+
"type": "function"
|
|
1057
|
+
},
|
|
1058
|
+
{
|
|
1059
|
+
"inputs": [],
|
|
1060
|
+
"name": "underlyingAsset1",
|
|
1061
|
+
"outputs": [
|
|
1062
|
+
{
|
|
1063
|
+
"internalType": "address",
|
|
1064
|
+
"name": "",
|
|
1065
|
+
"type": "address"
|
|
1066
|
+
}
|
|
1067
|
+
],
|
|
1068
|
+
"stateMutability": "view",
|
|
1069
|
+
"type": "function"
|
|
1070
|
+
}
|
|
1071
|
+
] as const satisfies Abi;
|
|
1072
|
+
|
|
1073
|
+
/**
|
|
1074
|
+
* Type-safe ABI for CurveGauge_json
|
|
1075
|
+
*/
|
|
1076
|
+
export type CurveGauge_jsonAbi = typeof CurveGauge_jsonAbi;
|
|
1077
|
+
|
|
1078
|
+
/**
|
|
1079
|
+
* Contract instance type for CurveGauge_json
|
|
1080
|
+
*/
|
|
1081
|
+
// Use any for contract type to avoid complex viem type issues
|
|
1082
|
+
// The runtime behavior is type-safe through viem's ABI typing
|
|
1083
|
+
export type CurveGauge_jsonContract = any;
|
|
1084
|
+
|
|
1085
|
+
/**
|
|
1086
|
+
* CurveGauge_json Contract Class
|
|
1087
|
+
*
|
|
1088
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
1089
|
+
*
|
|
1090
|
+
* @example
|
|
1091
|
+
* ```typescript
|
|
1092
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
1093
|
+
* import { mainnet } from 'viem/chains';
|
|
1094
|
+
* import { CurveGauge_json } from 'CurveGauge_json';
|
|
1095
|
+
*
|
|
1096
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
1097
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
1098
|
+
*
|
|
1099
|
+
* const contract = new CurveGauge_json('0x...', { publicClient, walletClient });
|
|
1100
|
+
*
|
|
1101
|
+
* // Read functions
|
|
1102
|
+
* const result = await contract.balanceOf('0x...');
|
|
1103
|
+
*
|
|
1104
|
+
* // Write functions
|
|
1105
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
1106
|
+
*
|
|
1107
|
+
* // Simulate transactions (dry-run)
|
|
1108
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
1109
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
1110
|
+
*
|
|
1111
|
+
* // Watch events
|
|
1112
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1113
|
+
* console.log('Transfer event:', event);
|
|
1114
|
+
* });
|
|
1115
|
+
* ```
|
|
1116
|
+
*/
|
|
1117
|
+
export class CurveGauge_json {
|
|
1118
|
+
private contract: CurveGauge_jsonContract;
|
|
1119
|
+
private contractAddress: Address;
|
|
1120
|
+
private publicClient: PublicClient;
|
|
1121
|
+
|
|
1122
|
+
constructor(
|
|
1123
|
+
address: Address,
|
|
1124
|
+
clients: {
|
|
1125
|
+
publicClient: PublicClient;
|
|
1126
|
+
walletClient?: WalletClient;
|
|
1127
|
+
}
|
|
1128
|
+
) {
|
|
1129
|
+
this.contractAddress = address;
|
|
1130
|
+
this.publicClient = clients.publicClient;
|
|
1131
|
+
this.contract = getContract({
|
|
1132
|
+
address,
|
|
1133
|
+
abi: CurveGauge_jsonAbi,
|
|
1134
|
+
client: {
|
|
1135
|
+
public: clients.publicClient,
|
|
1136
|
+
wallet: clients.walletClient,
|
|
1137
|
+
},
|
|
1138
|
+
});
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
/**
|
|
1142
|
+
* Get the contract address
|
|
1143
|
+
*/
|
|
1144
|
+
get address(): Address {
|
|
1145
|
+
return this.contractAddress;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
/**
|
|
1149
|
+
* Get the underlying viem contract instance
|
|
1150
|
+
*/
|
|
1151
|
+
getContract(): CurveGauge_jsonContract {
|
|
1152
|
+
return this.contract;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
/**
|
|
1156
|
+
* currentStateId
|
|
1157
|
+
* view
|
|
1158
|
+
*/
|
|
1159
|
+
async currentStateId(): Promise<`0x${string}`> {
|
|
1160
|
+
return this.contract.read.currentStateId() as Promise<`0x${string}`>;
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
/**
|
|
1164
|
+
* currentStateNav
|
|
1165
|
+
* view
|
|
1166
|
+
*/
|
|
1167
|
+
async currentStateNav(): Promise<bigint> {
|
|
1168
|
+
return this.contract.read.currentStateNav() as Promise<bigint>;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
/**
|
|
1172
|
+
* emergencyExitMaxSlippage
|
|
1173
|
+
* view
|
|
1174
|
+
*/
|
|
1175
|
+
async emergencyExitMaxSlippage(): Promise<bigint> {
|
|
1176
|
+
return this.contract.read.emergencyExitMaxSlippage() as Promise<bigint>;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
/**
|
|
1180
|
+
* enterMaxSlippage
|
|
1181
|
+
* view
|
|
1182
|
+
*/
|
|
1183
|
+
async enterMaxSlippage(): Promise<bigint> {
|
|
1184
|
+
return this.contract.read.enterMaxSlippage() as Promise<bigint>;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
/**
|
|
1188
|
+
* exitMaxSlippage
|
|
1189
|
+
* view
|
|
1190
|
+
*/
|
|
1191
|
+
async exitMaxSlippage(): Promise<bigint> {
|
|
1192
|
+
return this.contract.read.exitMaxSlippage() as Promise<bigint>;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
/**
|
|
1196
|
+
* gauge
|
|
1197
|
+
* view
|
|
1198
|
+
*/
|
|
1199
|
+
async gauge(): Promise<`0x${string}`> {
|
|
1200
|
+
return this.contract.read.gauge() as Promise<`0x${string}`>;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* getInputTokens
|
|
1205
|
+
* view
|
|
1206
|
+
*/
|
|
1207
|
+
async getInputTokens(): Promise<`0x${string}`[]> {
|
|
1208
|
+
return this.contract.read.getInputTokens() as Promise<`0x${string}`[]>;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
/**
|
|
1212
|
+
* getOutputTokens
|
|
1213
|
+
* view
|
|
1214
|
+
*/
|
|
1215
|
+
async getOutputTokens(): Promise<`0x${string}`[]> {
|
|
1216
|
+
return this.contract.read.getOutputTokens() as Promise<`0x${string}`[]>;
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
/**
|
|
1220
|
+
* getStateIds
|
|
1221
|
+
* view
|
|
1222
|
+
*/
|
|
1223
|
+
async getStateIds(): Promise<`0x${string}`[]> {
|
|
1224
|
+
return this.contract.read.getStateIds() as Promise<`0x${string}`[]>;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
/**
|
|
1228
|
+
* getTokenAmountInNotion
|
|
1229
|
+
* view
|
|
1230
|
+
*/
|
|
1231
|
+
async getTokenAmountInNotion(token: `0x${string}`, amount: bigint): Promise<bigint> {
|
|
1232
|
+
return this.contract.read.getTokenAmountInNotion([token, amount] as const) as Promise<bigint>;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
/**
|
|
1236
|
+
* isNavResolutionMode
|
|
1237
|
+
* view
|
|
1238
|
+
*/
|
|
1239
|
+
async isNavResolutionMode(): Promise<boolean> {
|
|
1240
|
+
return this.contract.read.isNavResolutionMode() as Promise<boolean>;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* lastStoredGaugeBalance
|
|
1245
|
+
* view
|
|
1246
|
+
*/
|
|
1247
|
+
async lastStoredGaugeBalance(): Promise<bigint> {
|
|
1248
|
+
return this.contract.read.lastStoredGaugeBalance() as Promise<bigint>;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
/**
|
|
1252
|
+
* lastStoredVirtualPrice
|
|
1253
|
+
* view
|
|
1254
|
+
*/
|
|
1255
|
+
async lastStoredVirtualPrice(): Promise<bigint> {
|
|
1256
|
+
return this.contract.read.lastStoredVirtualPrice() as Promise<bigint>;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
/**
|
|
1260
|
+
* lpToken
|
|
1261
|
+
* view
|
|
1262
|
+
*/
|
|
1263
|
+
async lpToken(): Promise<`0x${string}`> {
|
|
1264
|
+
return this.contract.read.lpToken() as Promise<`0x${string}`>;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
/**
|
|
1268
|
+
* stateBitmask
|
|
1269
|
+
* view
|
|
1270
|
+
*/
|
|
1271
|
+
async stateBitmask(stateId: `0x${string}`): Promise<bigint> {
|
|
1272
|
+
return this.contract.read.stateBitmask([stateId] as const) as Promise<bigint>;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
/**
|
|
1276
|
+
* stateNav
|
|
1277
|
+
* view
|
|
1278
|
+
*/
|
|
1279
|
+
async stateNav(stateId: `0x${string}`): Promise<bigint> {
|
|
1280
|
+
return this.contract.read.stateNav([stateId] as const) as Promise<bigint>;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
/**
|
|
1284
|
+
* underlyingAsset0
|
|
1285
|
+
* view
|
|
1286
|
+
*/
|
|
1287
|
+
async underlyingAsset0(): Promise<`0x${string}`> {
|
|
1288
|
+
return this.contract.read.underlyingAsset0() as Promise<`0x${string}`>;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
/**
|
|
1292
|
+
* underlyingAsset1
|
|
1293
|
+
* view
|
|
1294
|
+
*/
|
|
1295
|
+
async underlyingAsset1(): Promise<`0x${string}`> {
|
|
1296
|
+
return this.contract.read.underlyingAsset1() as Promise<`0x${string}`>;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
/**
|
|
1300
|
+
* acceptNav
|
|
1301
|
+
* nonpayable
|
|
1302
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1303
|
+
*/
|
|
1304
|
+
async acceptNav(acceptedStateId: `0x${string}`, options?: {
|
|
1305
|
+
accessList?: import('viem').AccessList;
|
|
1306
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1307
|
+
chain?: import('viem').Chain | null;
|
|
1308
|
+
dataSuffix?: `0x${string}`;
|
|
1309
|
+
gas?: bigint;
|
|
1310
|
+
gasPrice?: bigint;
|
|
1311
|
+
maxFeePerGas?: bigint;
|
|
1312
|
+
maxPriorityFeePerGas?: bigint;
|
|
1313
|
+
nonce?: number;
|
|
1314
|
+
value?: bigint;
|
|
1315
|
+
}): Promise<`0x${string}`> {
|
|
1316
|
+
if (!this.contract.write) {
|
|
1317
|
+
throw new Error('Wallet client is required for write operations');
|
|
1318
|
+
}
|
|
1319
|
+
return this.contract.write.acceptNav([acceptedStateId] as const, options) as Promise<`0x${string}`>;
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
/**
|
|
1323
|
+
* emergencyExit
|
|
1324
|
+
* payable
|
|
1325
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1326
|
+
*/
|
|
1327
|
+
async emergencyExit(toStateId: `0x${string}`, share: bigint, minNavDelta: bigint, options?: {
|
|
1328
|
+
accessList?: import('viem').AccessList;
|
|
1329
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1330
|
+
chain?: import('viem').Chain | null;
|
|
1331
|
+
dataSuffix?: `0x${string}`;
|
|
1332
|
+
gas?: bigint;
|
|
1333
|
+
gasPrice?: bigint;
|
|
1334
|
+
maxFeePerGas?: bigint;
|
|
1335
|
+
maxPriorityFeePerGas?: bigint;
|
|
1336
|
+
nonce?: number;
|
|
1337
|
+
value?: bigint;
|
|
1338
|
+
}): Promise<`0x${string}`> {
|
|
1339
|
+
if (!this.contract.write) {
|
|
1340
|
+
throw new Error('Wallet client is required for write operations');
|
|
1341
|
+
}
|
|
1342
|
+
return this.contract.write.emergencyExit([toStateId, share, minNavDelta] as const, options) as Promise<`0x${string}`>;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
/**
|
|
1346
|
+
* enter
|
|
1347
|
+
* payable
|
|
1348
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1349
|
+
*/
|
|
1350
|
+
async enter(amounts: bigint[], minNavDelta: bigint, options?: {
|
|
1351
|
+
accessList?: import('viem').AccessList;
|
|
1352
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1353
|
+
chain?: import('viem').Chain | null;
|
|
1354
|
+
dataSuffix?: `0x${string}`;
|
|
1355
|
+
gas?: bigint;
|
|
1356
|
+
gasPrice?: bigint;
|
|
1357
|
+
maxFeePerGas?: bigint;
|
|
1358
|
+
maxPriorityFeePerGas?: bigint;
|
|
1359
|
+
nonce?: number;
|
|
1360
|
+
value?: bigint;
|
|
1361
|
+
}): Promise<`0x${string}`> {
|
|
1362
|
+
if (!this.contract.write) {
|
|
1363
|
+
throw new Error('Wallet client is required for write operations');
|
|
1364
|
+
}
|
|
1365
|
+
return this.contract.write.enter([amounts, minNavDelta] as const, options) as Promise<`0x${string}`>;
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
/**
|
|
1369
|
+
* exit
|
|
1370
|
+
* payable
|
|
1371
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1372
|
+
*/
|
|
1373
|
+
async exit(share: bigint, maxNavDelta: bigint, options?: {
|
|
1374
|
+
accessList?: import('viem').AccessList;
|
|
1375
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1376
|
+
chain?: import('viem').Chain | null;
|
|
1377
|
+
dataSuffix?: `0x${string}`;
|
|
1378
|
+
gas?: bigint;
|
|
1379
|
+
gasPrice?: bigint;
|
|
1380
|
+
maxFeePerGas?: bigint;
|
|
1381
|
+
maxPriorityFeePerGas?: bigint;
|
|
1382
|
+
nonce?: number;
|
|
1383
|
+
value?: bigint;
|
|
1384
|
+
}): Promise<`0x${string}`> {
|
|
1385
|
+
if (!this.contract.write) {
|
|
1386
|
+
throw new Error('Wallet client is required for write operations');
|
|
1387
|
+
}
|
|
1388
|
+
return this.contract.write.exit([share, maxNavDelta] as const, options) as Promise<`0x${string}`>;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
/**
|
|
1392
|
+
* harvest
|
|
1393
|
+
* payable
|
|
1394
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1395
|
+
*/
|
|
1396
|
+
async harvest(options?: {
|
|
1397
|
+
accessList?: import('viem').AccessList;
|
|
1398
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1399
|
+
chain?: import('viem').Chain | null;
|
|
1400
|
+
dataSuffix?: `0x${string}`;
|
|
1401
|
+
gas?: bigint;
|
|
1402
|
+
gasPrice?: bigint;
|
|
1403
|
+
maxFeePerGas?: bigint;
|
|
1404
|
+
maxPriorityFeePerGas?: bigint;
|
|
1405
|
+
nonce?: number;
|
|
1406
|
+
value?: bigint;
|
|
1407
|
+
}): Promise<`0x${string}`> {
|
|
1408
|
+
if (!this.contract.write) {
|
|
1409
|
+
throw new Error('Wallet client is required for write operations');
|
|
1410
|
+
}
|
|
1411
|
+
return this.contract.write.harvest(options) as Promise<`0x${string}`>;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
/**
|
|
1415
|
+
* initialize
|
|
1416
|
+
* nonpayable
|
|
1417
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1418
|
+
*/
|
|
1419
|
+
async initialize(strategyContainer: `0x${string}`, _gauge: `0x${string}`, _enterMaxSlippage: bigint, _exitMaxSlippage: bigint, _emergencyExitMaxSlippage: bigint, options?: {
|
|
1420
|
+
accessList?: import('viem').AccessList;
|
|
1421
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1422
|
+
chain?: import('viem').Chain | null;
|
|
1423
|
+
dataSuffix?: `0x${string}`;
|
|
1424
|
+
gas?: bigint;
|
|
1425
|
+
gasPrice?: bigint;
|
|
1426
|
+
maxFeePerGas?: bigint;
|
|
1427
|
+
maxPriorityFeePerGas?: bigint;
|
|
1428
|
+
nonce?: number;
|
|
1429
|
+
value?: bigint;
|
|
1430
|
+
}): Promise<`0x${string}`> {
|
|
1431
|
+
if (!this.contract.write) {
|
|
1432
|
+
throw new Error('Wallet client is required for write operations');
|
|
1433
|
+
}
|
|
1434
|
+
return this.contract.write.initialize([strategyContainer, _gauge, _enterMaxSlippage, _exitMaxSlippage, _emergencyExitMaxSlippage] as const, options) as Promise<`0x${string}`>;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
/**
|
|
1438
|
+
* reenterToState
|
|
1439
|
+
* payable
|
|
1440
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1441
|
+
*/
|
|
1442
|
+
async reenterToState(stateId: `0x${string}`, minNavDelta: bigint, options?: {
|
|
1443
|
+
accessList?: import('viem').AccessList;
|
|
1444
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1445
|
+
chain?: import('viem').Chain | null;
|
|
1446
|
+
dataSuffix?: `0x${string}`;
|
|
1447
|
+
gas?: bigint;
|
|
1448
|
+
gasPrice?: bigint;
|
|
1449
|
+
maxFeePerGas?: bigint;
|
|
1450
|
+
maxPriorityFeePerGas?: bigint;
|
|
1451
|
+
nonce?: number;
|
|
1452
|
+
value?: bigint;
|
|
1453
|
+
}): Promise<`0x${string}`> {
|
|
1454
|
+
if (!this.contract.write) {
|
|
1455
|
+
throw new Error('Wallet client is required for write operations');
|
|
1456
|
+
}
|
|
1457
|
+
return this.contract.write.reenterToState([stateId, minNavDelta] as const, options) as Promise<`0x${string}`>;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
/**
|
|
1461
|
+
* setEmergencyExitMaxSlippage
|
|
1462
|
+
* nonpayable
|
|
1463
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1464
|
+
*/
|
|
1465
|
+
async setEmergencyExitMaxSlippage(_emergencyExitMaxSlippage: bigint, options?: {
|
|
1466
|
+
accessList?: import('viem').AccessList;
|
|
1467
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1468
|
+
chain?: import('viem').Chain | null;
|
|
1469
|
+
dataSuffix?: `0x${string}`;
|
|
1470
|
+
gas?: bigint;
|
|
1471
|
+
gasPrice?: bigint;
|
|
1472
|
+
maxFeePerGas?: bigint;
|
|
1473
|
+
maxPriorityFeePerGas?: bigint;
|
|
1474
|
+
nonce?: number;
|
|
1475
|
+
value?: bigint;
|
|
1476
|
+
}): Promise<`0x${string}`> {
|
|
1477
|
+
if (!this.contract.write) {
|
|
1478
|
+
throw new Error('Wallet client is required for write operations');
|
|
1479
|
+
}
|
|
1480
|
+
return this.contract.write.setEmergencyExitMaxSlippage([_emergencyExitMaxSlippage] as const, options) as Promise<`0x${string}`>;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
/**
|
|
1484
|
+
* setEnterMaxSlippage
|
|
1485
|
+
* nonpayable
|
|
1486
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1487
|
+
*/
|
|
1488
|
+
async setEnterMaxSlippage(_enterMaxSlippage: bigint, options?: {
|
|
1489
|
+
accessList?: import('viem').AccessList;
|
|
1490
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1491
|
+
chain?: import('viem').Chain | null;
|
|
1492
|
+
dataSuffix?: `0x${string}`;
|
|
1493
|
+
gas?: bigint;
|
|
1494
|
+
gasPrice?: bigint;
|
|
1495
|
+
maxFeePerGas?: bigint;
|
|
1496
|
+
maxPriorityFeePerGas?: bigint;
|
|
1497
|
+
nonce?: number;
|
|
1498
|
+
value?: bigint;
|
|
1499
|
+
}): Promise<`0x${string}`> {
|
|
1500
|
+
if (!this.contract.write) {
|
|
1501
|
+
throw new Error('Wallet client is required for write operations');
|
|
1502
|
+
}
|
|
1503
|
+
return this.contract.write.setEnterMaxSlippage([_enterMaxSlippage] as const, options) as Promise<`0x${string}`>;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
/**
|
|
1507
|
+
* setExitMaxSlippage
|
|
1508
|
+
* nonpayable
|
|
1509
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1510
|
+
*/
|
|
1511
|
+
async setExitMaxSlippage(_exitMaxSlippage: bigint, options?: {
|
|
1512
|
+
accessList?: import('viem').AccessList;
|
|
1513
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1514
|
+
chain?: import('viem').Chain | null;
|
|
1515
|
+
dataSuffix?: `0x${string}`;
|
|
1516
|
+
gas?: bigint;
|
|
1517
|
+
gasPrice?: bigint;
|
|
1518
|
+
maxFeePerGas?: bigint;
|
|
1519
|
+
maxPriorityFeePerGas?: bigint;
|
|
1520
|
+
nonce?: number;
|
|
1521
|
+
value?: bigint;
|
|
1522
|
+
}): Promise<`0x${string}`> {
|
|
1523
|
+
if (!this.contract.write) {
|
|
1524
|
+
throw new Error('Wallet client is required for write operations');
|
|
1525
|
+
}
|
|
1526
|
+
return this.contract.write.setExitMaxSlippage([_exitMaxSlippage] as const, options) as Promise<`0x${string}`>;
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
/**
|
|
1530
|
+
* setInputTokens
|
|
1531
|
+
* nonpayable
|
|
1532
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1533
|
+
*/
|
|
1534
|
+
async setInputTokens(inputTokens: `0x${string}`[], options?: {
|
|
1535
|
+
accessList?: import('viem').AccessList;
|
|
1536
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1537
|
+
chain?: import('viem').Chain | null;
|
|
1538
|
+
dataSuffix?: `0x${string}`;
|
|
1539
|
+
gas?: bigint;
|
|
1540
|
+
gasPrice?: bigint;
|
|
1541
|
+
maxFeePerGas?: bigint;
|
|
1542
|
+
maxPriorityFeePerGas?: bigint;
|
|
1543
|
+
nonce?: number;
|
|
1544
|
+
value?: bigint;
|
|
1545
|
+
}): Promise<`0x${string}`> {
|
|
1546
|
+
if (!this.contract.write) {
|
|
1547
|
+
throw new Error('Wallet client is required for write operations');
|
|
1548
|
+
}
|
|
1549
|
+
return this.contract.write.setInputTokens([inputTokens] as const, options) as Promise<`0x${string}`>;
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
/**
|
|
1553
|
+
* setOutputTokens
|
|
1554
|
+
* nonpayable
|
|
1555
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1556
|
+
*/
|
|
1557
|
+
async setOutputTokens(outputTokens: `0x${string}`[], options?: {
|
|
1558
|
+
accessList?: import('viem').AccessList;
|
|
1559
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1560
|
+
chain?: import('viem').Chain | null;
|
|
1561
|
+
dataSuffix?: `0x${string}`;
|
|
1562
|
+
gas?: bigint;
|
|
1563
|
+
gasPrice?: bigint;
|
|
1564
|
+
maxFeePerGas?: bigint;
|
|
1565
|
+
maxPriorityFeePerGas?: bigint;
|
|
1566
|
+
nonce?: number;
|
|
1567
|
+
value?: bigint;
|
|
1568
|
+
}): Promise<`0x${string}`> {
|
|
1569
|
+
if (!this.contract.write) {
|
|
1570
|
+
throw new Error('Wallet client is required for write operations');
|
|
1571
|
+
}
|
|
1572
|
+
return this.contract.write.setOutputTokens([outputTokens] as const, options) as Promise<`0x${string}`>;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
/**
|
|
1576
|
+
* tryEmergencyExit
|
|
1577
|
+
* nonpayable
|
|
1578
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1579
|
+
*/
|
|
1580
|
+
async tryEmergencyExit(toStateId: `0x${string}`, share: bigint, options?: {
|
|
1581
|
+
accessList?: import('viem').AccessList;
|
|
1582
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1583
|
+
chain?: import('viem').Chain | null;
|
|
1584
|
+
dataSuffix?: `0x${string}`;
|
|
1585
|
+
gas?: bigint;
|
|
1586
|
+
gasPrice?: bigint;
|
|
1587
|
+
maxFeePerGas?: bigint;
|
|
1588
|
+
maxPriorityFeePerGas?: bigint;
|
|
1589
|
+
nonce?: number;
|
|
1590
|
+
value?: bigint;
|
|
1591
|
+
}): Promise<`0x${string}`> {
|
|
1592
|
+
if (!this.contract.write) {
|
|
1593
|
+
throw new Error('Wallet client is required for write operations');
|
|
1594
|
+
}
|
|
1595
|
+
return this.contract.write.tryEmergencyExit([toStateId, share] as const, options) as Promise<`0x${string}`>;
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
|
|
1599
|
+
|
|
1600
|
+
/**
|
|
1601
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
1602
|
+
*
|
|
1603
|
+
* @example
|
|
1604
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
1605
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
1606
|
+
* console.log('Would succeed:', result.result);
|
|
1607
|
+
*/
|
|
1608
|
+
get simulate() {
|
|
1609
|
+
const contract = this.contract;
|
|
1610
|
+
if (!contract.simulate) {
|
|
1611
|
+
throw new Error('Public client is required for simulation');
|
|
1612
|
+
}
|
|
1613
|
+
return {
|
|
1614
|
+
/**
|
|
1615
|
+
* Simulate acceptNav
|
|
1616
|
+
* Returns gas estimate and result without sending transaction
|
|
1617
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1618
|
+
*/
|
|
1619
|
+
async acceptNav(acceptedStateId: `0x${string}`, options?: {
|
|
1620
|
+
accessList?: import('viem').AccessList;
|
|
1621
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1622
|
+
chain?: import('viem').Chain | null;
|
|
1623
|
+
dataSuffix?: `0x${string}`;
|
|
1624
|
+
gas?: bigint;
|
|
1625
|
+
gasPrice?: bigint;
|
|
1626
|
+
maxFeePerGas?: bigint;
|
|
1627
|
+
maxPriorityFeePerGas?: bigint;
|
|
1628
|
+
nonce?: number;
|
|
1629
|
+
value?: bigint;
|
|
1630
|
+
}): Promise<bigint> {
|
|
1631
|
+
return contract.simulate.acceptNav([acceptedStateId] as const, options) as Promise<bigint>;
|
|
1632
|
+
},
|
|
1633
|
+
/**
|
|
1634
|
+
* Simulate emergencyExit
|
|
1635
|
+
* Returns gas estimate and result without sending transaction
|
|
1636
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1637
|
+
*/
|
|
1638
|
+
async emergencyExit(toStateId: `0x${string}`, share: bigint, minNavDelta: bigint, options?: {
|
|
1639
|
+
accessList?: import('viem').AccessList;
|
|
1640
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1641
|
+
chain?: import('viem').Chain | null;
|
|
1642
|
+
dataSuffix?: `0x${string}`;
|
|
1643
|
+
gas?: bigint;
|
|
1644
|
+
gasPrice?: bigint;
|
|
1645
|
+
maxFeePerGas?: bigint;
|
|
1646
|
+
maxPriorityFeePerGas?: bigint;
|
|
1647
|
+
nonce?: number;
|
|
1648
|
+
value?: bigint;
|
|
1649
|
+
}): Promise<void> {
|
|
1650
|
+
return contract.simulate.emergencyExit([toStateId, share, minNavDelta] as const, options) as Promise<void>;
|
|
1651
|
+
},
|
|
1652
|
+
/**
|
|
1653
|
+
* Simulate enter
|
|
1654
|
+
* Returns gas estimate and result without sending transaction
|
|
1655
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1656
|
+
*/
|
|
1657
|
+
async enter(amounts: bigint[], minNavDelta: bigint, options?: {
|
|
1658
|
+
accessList?: import('viem').AccessList;
|
|
1659
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1660
|
+
chain?: import('viem').Chain | null;
|
|
1661
|
+
dataSuffix?: `0x${string}`;
|
|
1662
|
+
gas?: bigint;
|
|
1663
|
+
gasPrice?: bigint;
|
|
1664
|
+
maxFeePerGas?: bigint;
|
|
1665
|
+
maxPriorityFeePerGas?: bigint;
|
|
1666
|
+
nonce?: number;
|
|
1667
|
+
value?: bigint;
|
|
1668
|
+
}): Promise<[bigint, boolean, bigint[]]> {
|
|
1669
|
+
return contract.simulate.enter([amounts, minNavDelta] as const, options) as Promise<[bigint, boolean, bigint[]]>;
|
|
1670
|
+
},
|
|
1671
|
+
/**
|
|
1672
|
+
* Simulate exit
|
|
1673
|
+
* Returns gas estimate and result without sending transaction
|
|
1674
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1675
|
+
*/
|
|
1676
|
+
async exit(share: bigint, maxNavDelta: bigint, options?: {
|
|
1677
|
+
accessList?: import('viem').AccessList;
|
|
1678
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1679
|
+
chain?: import('viem').Chain | null;
|
|
1680
|
+
dataSuffix?: `0x${string}`;
|
|
1681
|
+
gas?: bigint;
|
|
1682
|
+
gasPrice?: bigint;
|
|
1683
|
+
maxFeePerGas?: bigint;
|
|
1684
|
+
maxPriorityFeePerGas?: bigint;
|
|
1685
|
+
nonce?: number;
|
|
1686
|
+
value?: bigint;
|
|
1687
|
+
}): Promise<[`0x${string}`[], bigint[]]> {
|
|
1688
|
+
return contract.simulate.exit([share, maxNavDelta] as const, options) as Promise<[`0x${string}`[], bigint[]]>;
|
|
1689
|
+
},
|
|
1690
|
+
/**
|
|
1691
|
+
* Simulate harvest
|
|
1692
|
+
* Returns gas estimate and result without sending transaction
|
|
1693
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1694
|
+
*/
|
|
1695
|
+
async harvest(options?: {
|
|
1696
|
+
accessList?: import('viem').AccessList;
|
|
1697
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1698
|
+
chain?: import('viem').Chain | null;
|
|
1699
|
+
dataSuffix?: `0x${string}`;
|
|
1700
|
+
gas?: bigint;
|
|
1701
|
+
gasPrice?: bigint;
|
|
1702
|
+
maxFeePerGas?: bigint;
|
|
1703
|
+
maxPriorityFeePerGas?: bigint;
|
|
1704
|
+
nonce?: number;
|
|
1705
|
+
value?: bigint;
|
|
1706
|
+
}): Promise<bigint> {
|
|
1707
|
+
return contract.simulate.harvest(options) as Promise<bigint>;
|
|
1708
|
+
},
|
|
1709
|
+
/**
|
|
1710
|
+
* Simulate initialize
|
|
1711
|
+
* Returns gas estimate and result without sending transaction
|
|
1712
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1713
|
+
*/
|
|
1714
|
+
async initialize(strategyContainer: `0x${string}`, _gauge: `0x${string}`, _enterMaxSlippage: bigint, _exitMaxSlippage: bigint, _emergencyExitMaxSlippage: bigint, options?: {
|
|
1715
|
+
accessList?: import('viem').AccessList;
|
|
1716
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1717
|
+
chain?: import('viem').Chain | null;
|
|
1718
|
+
dataSuffix?: `0x${string}`;
|
|
1719
|
+
gas?: bigint;
|
|
1720
|
+
gasPrice?: bigint;
|
|
1721
|
+
maxFeePerGas?: bigint;
|
|
1722
|
+
maxPriorityFeePerGas?: bigint;
|
|
1723
|
+
nonce?: number;
|
|
1724
|
+
value?: bigint;
|
|
1725
|
+
}): Promise<void> {
|
|
1726
|
+
return contract.simulate.initialize([strategyContainer, _gauge, _enterMaxSlippage, _exitMaxSlippage, _emergencyExitMaxSlippage] as const, options) as Promise<void>;
|
|
1727
|
+
},
|
|
1728
|
+
/**
|
|
1729
|
+
* Simulate reenterToState
|
|
1730
|
+
* Returns gas estimate and result without sending transaction
|
|
1731
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1732
|
+
*/
|
|
1733
|
+
async reenterToState(stateId: `0x${string}`, minNavDelta: bigint, options?: {
|
|
1734
|
+
accessList?: import('viem').AccessList;
|
|
1735
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1736
|
+
chain?: import('viem').Chain | null;
|
|
1737
|
+
dataSuffix?: `0x${string}`;
|
|
1738
|
+
gas?: bigint;
|
|
1739
|
+
gasPrice?: bigint;
|
|
1740
|
+
maxFeePerGas?: bigint;
|
|
1741
|
+
maxPriorityFeePerGas?: bigint;
|
|
1742
|
+
nonce?: number;
|
|
1743
|
+
value?: bigint;
|
|
1744
|
+
}): Promise<void> {
|
|
1745
|
+
return contract.simulate.reenterToState([stateId, minNavDelta] as const, options) as Promise<void>;
|
|
1746
|
+
},
|
|
1747
|
+
/**
|
|
1748
|
+
* Simulate setEmergencyExitMaxSlippage
|
|
1749
|
+
* Returns gas estimate and result without sending transaction
|
|
1750
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1751
|
+
*/
|
|
1752
|
+
async setEmergencyExitMaxSlippage(_emergencyExitMaxSlippage: bigint, options?: {
|
|
1753
|
+
accessList?: import('viem').AccessList;
|
|
1754
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1755
|
+
chain?: import('viem').Chain | null;
|
|
1756
|
+
dataSuffix?: `0x${string}`;
|
|
1757
|
+
gas?: bigint;
|
|
1758
|
+
gasPrice?: bigint;
|
|
1759
|
+
maxFeePerGas?: bigint;
|
|
1760
|
+
maxPriorityFeePerGas?: bigint;
|
|
1761
|
+
nonce?: number;
|
|
1762
|
+
value?: bigint;
|
|
1763
|
+
}): Promise<void> {
|
|
1764
|
+
return contract.simulate.setEmergencyExitMaxSlippage([_emergencyExitMaxSlippage] as const, options) as Promise<void>;
|
|
1765
|
+
},
|
|
1766
|
+
/**
|
|
1767
|
+
* Simulate setEnterMaxSlippage
|
|
1768
|
+
* Returns gas estimate and result without sending transaction
|
|
1769
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1770
|
+
*/
|
|
1771
|
+
async setEnterMaxSlippage(_enterMaxSlippage: bigint, options?: {
|
|
1772
|
+
accessList?: import('viem').AccessList;
|
|
1773
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1774
|
+
chain?: import('viem').Chain | null;
|
|
1775
|
+
dataSuffix?: `0x${string}`;
|
|
1776
|
+
gas?: bigint;
|
|
1777
|
+
gasPrice?: bigint;
|
|
1778
|
+
maxFeePerGas?: bigint;
|
|
1779
|
+
maxPriorityFeePerGas?: bigint;
|
|
1780
|
+
nonce?: number;
|
|
1781
|
+
value?: bigint;
|
|
1782
|
+
}): Promise<void> {
|
|
1783
|
+
return contract.simulate.setEnterMaxSlippage([_enterMaxSlippage] as const, options) as Promise<void>;
|
|
1784
|
+
},
|
|
1785
|
+
/**
|
|
1786
|
+
* Simulate setExitMaxSlippage
|
|
1787
|
+
* Returns gas estimate and result without sending transaction
|
|
1788
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1789
|
+
*/
|
|
1790
|
+
async setExitMaxSlippage(_exitMaxSlippage: bigint, options?: {
|
|
1791
|
+
accessList?: import('viem').AccessList;
|
|
1792
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1793
|
+
chain?: import('viem').Chain | null;
|
|
1794
|
+
dataSuffix?: `0x${string}`;
|
|
1795
|
+
gas?: bigint;
|
|
1796
|
+
gasPrice?: bigint;
|
|
1797
|
+
maxFeePerGas?: bigint;
|
|
1798
|
+
maxPriorityFeePerGas?: bigint;
|
|
1799
|
+
nonce?: number;
|
|
1800
|
+
value?: bigint;
|
|
1801
|
+
}): Promise<void> {
|
|
1802
|
+
return contract.simulate.setExitMaxSlippage([_exitMaxSlippage] as const, options) as Promise<void>;
|
|
1803
|
+
},
|
|
1804
|
+
/**
|
|
1805
|
+
* Simulate setInputTokens
|
|
1806
|
+
* Returns gas estimate and result without sending transaction
|
|
1807
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1808
|
+
*/
|
|
1809
|
+
async setInputTokens(inputTokens: `0x${string}`[], options?: {
|
|
1810
|
+
accessList?: import('viem').AccessList;
|
|
1811
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1812
|
+
chain?: import('viem').Chain | null;
|
|
1813
|
+
dataSuffix?: `0x${string}`;
|
|
1814
|
+
gas?: bigint;
|
|
1815
|
+
gasPrice?: bigint;
|
|
1816
|
+
maxFeePerGas?: bigint;
|
|
1817
|
+
maxPriorityFeePerGas?: bigint;
|
|
1818
|
+
nonce?: number;
|
|
1819
|
+
value?: bigint;
|
|
1820
|
+
}): Promise<void> {
|
|
1821
|
+
return contract.simulate.setInputTokens([inputTokens] as const, options) as Promise<void>;
|
|
1822
|
+
},
|
|
1823
|
+
/**
|
|
1824
|
+
* Simulate setOutputTokens
|
|
1825
|
+
* Returns gas estimate and result without sending transaction
|
|
1826
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1827
|
+
*/
|
|
1828
|
+
async setOutputTokens(outputTokens: `0x${string}`[], options?: {
|
|
1829
|
+
accessList?: import('viem').AccessList;
|
|
1830
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1831
|
+
chain?: import('viem').Chain | null;
|
|
1832
|
+
dataSuffix?: `0x${string}`;
|
|
1833
|
+
gas?: bigint;
|
|
1834
|
+
gasPrice?: bigint;
|
|
1835
|
+
maxFeePerGas?: bigint;
|
|
1836
|
+
maxPriorityFeePerGas?: bigint;
|
|
1837
|
+
nonce?: number;
|
|
1838
|
+
value?: bigint;
|
|
1839
|
+
}): Promise<void> {
|
|
1840
|
+
return contract.simulate.setOutputTokens([outputTokens] as const, options) as Promise<void>;
|
|
1841
|
+
},
|
|
1842
|
+
/**
|
|
1843
|
+
* Simulate tryEmergencyExit
|
|
1844
|
+
* Returns gas estimate and result without sending transaction
|
|
1845
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
1846
|
+
*/
|
|
1847
|
+
async tryEmergencyExit(toStateId: `0x${string}`, share: bigint, options?: {
|
|
1848
|
+
accessList?: import('viem').AccessList;
|
|
1849
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
1850
|
+
chain?: import('viem').Chain | null;
|
|
1851
|
+
dataSuffix?: `0x${string}`;
|
|
1852
|
+
gas?: bigint;
|
|
1853
|
+
gasPrice?: bigint;
|
|
1854
|
+
maxFeePerGas?: bigint;
|
|
1855
|
+
maxPriorityFeePerGas?: bigint;
|
|
1856
|
+
nonce?: number;
|
|
1857
|
+
value?: bigint;
|
|
1858
|
+
}): Promise<void> {
|
|
1859
|
+
return contract.simulate.tryEmergencyExit([toStateId, share] as const, options) as Promise<void>;
|
|
1860
|
+
}
|
|
1861
|
+
};
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1864
|
+
/**
|
|
1865
|
+
* Watch contract events
|
|
1866
|
+
*
|
|
1867
|
+
* @example
|
|
1868
|
+
* // Watch all Transfer events
|
|
1869
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
1870
|
+
* console.log('Transfer:', event);
|
|
1871
|
+
* });
|
|
1872
|
+
*
|
|
1873
|
+
* // Stop watching
|
|
1874
|
+
* unwatch();
|
|
1875
|
+
*/
|
|
1876
|
+
get watch() {
|
|
1877
|
+
return {
|
|
1878
|
+
/**
|
|
1879
|
+
* Watch EmergencyExitFailed events
|
|
1880
|
+
* @param callback Function to call when event is emitted
|
|
1881
|
+
* @param filter Optional filter for indexed parameters
|
|
1882
|
+
* @returns Unwatch function to stop listening
|
|
1883
|
+
*/
|
|
1884
|
+
EmergencyExitFailed: (callback: (event: { toStateId: `0x${string}` }) => void) => {
|
|
1885
|
+
return this.publicClient.watchContractEvent({
|
|
1886
|
+
address: this.contractAddress,
|
|
1887
|
+
abi: CurveGauge_jsonAbi,
|
|
1888
|
+
eventName: 'EmergencyExitFailed',
|
|
1889
|
+
|
|
1890
|
+
onLogs: (logs: any[]) => {
|
|
1891
|
+
logs.forEach((log: any) => {
|
|
1892
|
+
callback(log.args as any);
|
|
1893
|
+
});
|
|
1894
|
+
},
|
|
1895
|
+
}) as () => void;
|
|
1896
|
+
},
|
|
1897
|
+
/**
|
|
1898
|
+
* Watch EmergencyExitMaxSlippageUpdated events
|
|
1899
|
+
* @param callback Function to call when event is emitted
|
|
1900
|
+
* @param filter Optional filter for indexed parameters
|
|
1901
|
+
* @returns Unwatch function to stop listening
|
|
1902
|
+
*/
|
|
1903
|
+
EmergencyExitMaxSlippageUpdated: (callback: (event: { oldEmergencyExitMaxSlippage: bigint; newEmergencyExitMaxSlippage: bigint }) => void) => {
|
|
1904
|
+
return this.publicClient.watchContractEvent({
|
|
1905
|
+
address: this.contractAddress,
|
|
1906
|
+
abi: CurveGauge_jsonAbi,
|
|
1907
|
+
eventName: 'EmergencyExitMaxSlippageUpdated',
|
|
1908
|
+
|
|
1909
|
+
onLogs: (logs: any[]) => {
|
|
1910
|
+
logs.forEach((log: any) => {
|
|
1911
|
+
callback(log.args as any);
|
|
1912
|
+
});
|
|
1913
|
+
},
|
|
1914
|
+
}) as () => void;
|
|
1915
|
+
},
|
|
1916
|
+
/**
|
|
1917
|
+
* Watch EmergencyExitSucceeded events
|
|
1918
|
+
* @param callback Function to call when event is emitted
|
|
1919
|
+
* @param filter Optional filter for indexed parameters
|
|
1920
|
+
* @returns Unwatch function to stop listening
|
|
1921
|
+
*/
|
|
1922
|
+
EmergencyExitSucceeded: (callback: (event: { toStateId: `0x${string}` }) => void) => {
|
|
1923
|
+
return this.publicClient.watchContractEvent({
|
|
1924
|
+
address: this.contractAddress,
|
|
1925
|
+
abi: CurveGauge_jsonAbi,
|
|
1926
|
+
eventName: 'EmergencyExitSucceeded',
|
|
1927
|
+
|
|
1928
|
+
onLogs: (logs: any[]) => {
|
|
1929
|
+
logs.forEach((log: any) => {
|
|
1930
|
+
callback(log.args as any);
|
|
1931
|
+
});
|
|
1932
|
+
},
|
|
1933
|
+
}) as () => void;
|
|
1934
|
+
},
|
|
1935
|
+
/**
|
|
1936
|
+
* Watch EmergencyExited events
|
|
1937
|
+
* @param callback Function to call when event is emitted
|
|
1938
|
+
* @param filter Optional filter for indexed parameters
|
|
1939
|
+
* @returns Unwatch function to stop listening
|
|
1940
|
+
*/
|
|
1941
|
+
EmergencyExited: (callback: (event: { toStateId: `0x${string}` }) => void) => {
|
|
1942
|
+
return this.publicClient.watchContractEvent({
|
|
1943
|
+
address: this.contractAddress,
|
|
1944
|
+
abi: CurveGauge_jsonAbi,
|
|
1945
|
+
eventName: 'EmergencyExited',
|
|
1946
|
+
|
|
1947
|
+
onLogs: (logs: any[]) => {
|
|
1948
|
+
logs.forEach((log: any) => {
|
|
1949
|
+
callback(log.args as any);
|
|
1950
|
+
});
|
|
1951
|
+
},
|
|
1952
|
+
}) as () => void;
|
|
1953
|
+
},
|
|
1954
|
+
/**
|
|
1955
|
+
* Watch EmergencyModeUpdated events
|
|
1956
|
+
* @param callback Function to call when event is emitted
|
|
1957
|
+
* @param filter Optional filter for indexed parameters
|
|
1958
|
+
* @returns Unwatch function to stop listening
|
|
1959
|
+
*/
|
|
1960
|
+
EmergencyModeUpdated: (callback: (event: { isEmergencyMode: boolean }) => void) => {
|
|
1961
|
+
return this.publicClient.watchContractEvent({
|
|
1962
|
+
address: this.contractAddress,
|
|
1963
|
+
abi: CurveGauge_jsonAbi,
|
|
1964
|
+
eventName: 'EmergencyModeUpdated',
|
|
1965
|
+
|
|
1966
|
+
onLogs: (logs: any[]) => {
|
|
1967
|
+
logs.forEach((log: any) => {
|
|
1968
|
+
callback(log.args as any);
|
|
1969
|
+
});
|
|
1970
|
+
},
|
|
1971
|
+
}) as () => void;
|
|
1972
|
+
},
|
|
1973
|
+
/**
|
|
1974
|
+
* Watch EnterMaxSlippageUpdated events
|
|
1975
|
+
* @param callback Function to call when event is emitted
|
|
1976
|
+
* @param filter Optional filter for indexed parameters
|
|
1977
|
+
* @returns Unwatch function to stop listening
|
|
1978
|
+
*/
|
|
1979
|
+
EnterMaxSlippageUpdated: (callback: (event: { oldEnterMaxSlippage: bigint; newEnterMaxSlippage: bigint }) => void) => {
|
|
1980
|
+
return this.publicClient.watchContractEvent({
|
|
1981
|
+
address: this.contractAddress,
|
|
1982
|
+
abi: CurveGauge_jsonAbi,
|
|
1983
|
+
eventName: 'EnterMaxSlippageUpdated',
|
|
1984
|
+
|
|
1985
|
+
onLogs: (logs: any[]) => {
|
|
1986
|
+
logs.forEach((log: any) => {
|
|
1987
|
+
callback(log.args as any);
|
|
1988
|
+
});
|
|
1989
|
+
},
|
|
1990
|
+
}) as () => void;
|
|
1991
|
+
},
|
|
1992
|
+
/**
|
|
1993
|
+
* Watch Entered events
|
|
1994
|
+
* @param callback Function to call when event is emitted
|
|
1995
|
+
* @param filter Optional filter for indexed parameters
|
|
1996
|
+
* @returns Unwatch function to stop listening
|
|
1997
|
+
*/
|
|
1998
|
+
Entered: (callback: (event: { navBefore: bigint; navAfter: bigint; hasRemainder: boolean }) => void) => {
|
|
1999
|
+
return this.publicClient.watchContractEvent({
|
|
2000
|
+
address: this.contractAddress,
|
|
2001
|
+
abi: CurveGauge_jsonAbi,
|
|
2002
|
+
eventName: 'Entered',
|
|
2003
|
+
|
|
2004
|
+
onLogs: (logs: any[]) => {
|
|
2005
|
+
logs.forEach((log: any) => {
|
|
2006
|
+
callback(log.args as any);
|
|
2007
|
+
});
|
|
2008
|
+
},
|
|
2009
|
+
}) as () => void;
|
|
2010
|
+
},
|
|
2011
|
+
/**
|
|
2012
|
+
* Watch ExitMaxSlippageUpdated events
|
|
2013
|
+
* @param callback Function to call when event is emitted
|
|
2014
|
+
* @param filter Optional filter for indexed parameters
|
|
2015
|
+
* @returns Unwatch function to stop listening
|
|
2016
|
+
*/
|
|
2017
|
+
ExitMaxSlippageUpdated: (callback: (event: { oldExitMaxSlippage: bigint; newExitMaxSlippage: bigint }) => void) => {
|
|
2018
|
+
return this.publicClient.watchContractEvent({
|
|
2019
|
+
address: this.contractAddress,
|
|
2020
|
+
abi: CurveGauge_jsonAbi,
|
|
2021
|
+
eventName: 'ExitMaxSlippageUpdated',
|
|
2022
|
+
|
|
2023
|
+
onLogs: (logs: any[]) => {
|
|
2024
|
+
logs.forEach((log: any) => {
|
|
2025
|
+
callback(log.args as any);
|
|
2026
|
+
});
|
|
2027
|
+
},
|
|
2028
|
+
}) as () => void;
|
|
2029
|
+
},
|
|
2030
|
+
/**
|
|
2031
|
+
* Watch Exited events
|
|
2032
|
+
* @param callback Function to call when event is emitted
|
|
2033
|
+
* @param filter Optional filter for indexed parameters
|
|
2034
|
+
* @returns Unwatch function to stop listening
|
|
2035
|
+
*/
|
|
2036
|
+
Exited: (callback: (event: { navBefore: bigint; navAfter: bigint; stateId: `0x${string}` }) => void) => {
|
|
2037
|
+
return this.publicClient.watchContractEvent({
|
|
2038
|
+
address: this.contractAddress,
|
|
2039
|
+
abi: CurveGauge_jsonAbi,
|
|
2040
|
+
eventName: 'Exited',
|
|
2041
|
+
|
|
2042
|
+
onLogs: (logs: any[]) => {
|
|
2043
|
+
logs.forEach((log: any) => {
|
|
2044
|
+
callback(log.args as any);
|
|
2045
|
+
});
|
|
2046
|
+
},
|
|
2047
|
+
}) as () => void;
|
|
2048
|
+
},
|
|
2049
|
+
/**
|
|
2050
|
+
* Watch Harvested events
|
|
2051
|
+
* @param callback Function to call when event is emitted
|
|
2052
|
+
* @param filter Optional filter for indexed parameters
|
|
2053
|
+
* @returns Unwatch function to stop listening
|
|
2054
|
+
*/
|
|
2055
|
+
Harvested: (callback: (event: { stateId: `0x${string}`; navAfter: bigint }) => void) => {
|
|
2056
|
+
return this.publicClient.watchContractEvent({
|
|
2057
|
+
address: this.contractAddress,
|
|
2058
|
+
abi: CurveGauge_jsonAbi,
|
|
2059
|
+
eventName: 'Harvested',
|
|
2060
|
+
|
|
2061
|
+
onLogs: (logs: any[]) => {
|
|
2062
|
+
logs.forEach((log: any) => {
|
|
2063
|
+
callback(log.args as any);
|
|
2064
|
+
});
|
|
2065
|
+
},
|
|
2066
|
+
}) as () => void;
|
|
2067
|
+
},
|
|
2068
|
+
/**
|
|
2069
|
+
* Watch Initialized events
|
|
2070
|
+
* @param callback Function to call when event is emitted
|
|
2071
|
+
* @param filter Optional filter for indexed parameters
|
|
2072
|
+
* @returns Unwatch function to stop listening
|
|
2073
|
+
*/
|
|
2074
|
+
Initialized: (callback: (event: { version: bigint }) => void) => {
|
|
2075
|
+
return this.publicClient.watchContractEvent({
|
|
2076
|
+
address: this.contractAddress,
|
|
2077
|
+
abi: CurveGauge_jsonAbi,
|
|
2078
|
+
eventName: 'Initialized',
|
|
2079
|
+
|
|
2080
|
+
onLogs: (logs: any[]) => {
|
|
2081
|
+
logs.forEach((log: any) => {
|
|
2082
|
+
callback(log.args as any);
|
|
2083
|
+
});
|
|
2084
|
+
},
|
|
2085
|
+
}) as () => void;
|
|
2086
|
+
},
|
|
2087
|
+
/**
|
|
2088
|
+
* Watch InputTokenSet events
|
|
2089
|
+
* @param callback Function to call when event is emitted
|
|
2090
|
+
* @param filter Optional filter for indexed parameters
|
|
2091
|
+
* @returns Unwatch function to stop listening
|
|
2092
|
+
*/
|
|
2093
|
+
InputTokenSet: (callback: (event: { arg0: `0x${string}` }) => void) => {
|
|
2094
|
+
return this.publicClient.watchContractEvent({
|
|
2095
|
+
address: this.contractAddress,
|
|
2096
|
+
abi: CurveGauge_jsonAbi,
|
|
2097
|
+
eventName: 'InputTokenSet',
|
|
2098
|
+
|
|
2099
|
+
onLogs: (logs: any[]) => {
|
|
2100
|
+
logs.forEach((log: any) => {
|
|
2101
|
+
callback(log.args as any);
|
|
2102
|
+
});
|
|
2103
|
+
},
|
|
2104
|
+
}) as () => void;
|
|
2105
|
+
},
|
|
2106
|
+
/**
|
|
2107
|
+
* Watch NavResolutionModeUpdated events
|
|
2108
|
+
* @param callback Function to call when event is emitted
|
|
2109
|
+
* @param filter Optional filter for indexed parameters
|
|
2110
|
+
* @returns Unwatch function to stop listening
|
|
2111
|
+
*/
|
|
2112
|
+
NavResolutionModeUpdated: (callback: (event: { isNavResolutionMode: boolean }) => void) => {
|
|
2113
|
+
return this.publicClient.watchContractEvent({
|
|
2114
|
+
address: this.contractAddress,
|
|
2115
|
+
abi: CurveGauge_jsonAbi,
|
|
2116
|
+
eventName: 'NavResolutionModeUpdated',
|
|
2117
|
+
|
|
2118
|
+
onLogs: (logs: any[]) => {
|
|
2119
|
+
logs.forEach((log: any) => {
|
|
2120
|
+
callback(log.args as any);
|
|
2121
|
+
});
|
|
2122
|
+
},
|
|
2123
|
+
}) as () => void;
|
|
2124
|
+
},
|
|
2125
|
+
/**
|
|
2126
|
+
* Watch OutputTokenSet events
|
|
2127
|
+
* @param callback Function to call when event is emitted
|
|
2128
|
+
* @param filter Optional filter for indexed parameters
|
|
2129
|
+
* @returns Unwatch function to stop listening
|
|
2130
|
+
*/
|
|
2131
|
+
OutputTokenSet: (callback: (event: { arg0: `0x${string}` }) => void) => {
|
|
2132
|
+
return this.publicClient.watchContractEvent({
|
|
2133
|
+
address: this.contractAddress,
|
|
2134
|
+
abi: CurveGauge_jsonAbi,
|
|
2135
|
+
eventName: 'OutputTokenSet',
|
|
2136
|
+
|
|
2137
|
+
onLogs: (logs: any[]) => {
|
|
2138
|
+
logs.forEach((log: any) => {
|
|
2139
|
+
callback(log.args as any);
|
|
2140
|
+
});
|
|
2141
|
+
},
|
|
2142
|
+
}) as () => void;
|
|
2143
|
+
},
|
|
2144
|
+
/**
|
|
2145
|
+
* Watch ReenteredToState events
|
|
2146
|
+
* @param callback Function to call when event is emitted
|
|
2147
|
+
* @param filter Optional filter for indexed parameters
|
|
2148
|
+
* @returns Unwatch function to stop listening
|
|
2149
|
+
*/
|
|
2150
|
+
ReenteredToState: (callback: (event: { stateId: `0x${string}` }) => void) => {
|
|
2151
|
+
return this.publicClient.watchContractEvent({
|
|
2152
|
+
address: this.contractAddress,
|
|
2153
|
+
abi: CurveGauge_jsonAbi,
|
|
2154
|
+
eventName: 'ReenteredToState',
|
|
2155
|
+
|
|
2156
|
+
onLogs: (logs: any[]) => {
|
|
2157
|
+
logs.forEach((log: any) => {
|
|
2158
|
+
callback(log.args as any);
|
|
2159
|
+
});
|
|
2160
|
+
},
|
|
2161
|
+
}) as () => void;
|
|
2162
|
+
},
|
|
2163
|
+
/**
|
|
2164
|
+
* Watch StateUpdated events
|
|
2165
|
+
* @param callback Function to call when event is emitted
|
|
2166
|
+
* @param filter Optional filter for indexed parameters
|
|
2167
|
+
* @returns Unwatch function to stop listening
|
|
2168
|
+
*/
|
|
2169
|
+
StateUpdated: (callback: (event: { oldStateId: `0x${string}`; newStateId: `0x${string}`; newStateBitmask: bigint }) => void) => {
|
|
2170
|
+
return this.publicClient.watchContractEvent({
|
|
2171
|
+
address: this.contractAddress,
|
|
2172
|
+
abi: CurveGauge_jsonAbi,
|
|
2173
|
+
eventName: 'StateUpdated',
|
|
2174
|
+
|
|
2175
|
+
onLogs: (logs: any[]) => {
|
|
2176
|
+
logs.forEach((log: any) => {
|
|
2177
|
+
callback(log.args as any);
|
|
2178
|
+
});
|
|
2179
|
+
},
|
|
2180
|
+
}) as () => void;
|
|
2181
|
+
}
|
|
2182
|
+
};
|
|
2183
|
+
}
|
|
2184
|
+
}
|