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