liquid-sdk 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/dist/index.js ADDED
@@ -0,0 +1,1363 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ ADDRESSES: () => ADDRESSES,
24
+ DEFAULT_CHAIN: () => DEFAULT_CHAIN,
25
+ DEFAULT_CHAIN_ID: () => DEFAULT_CHAIN_ID,
26
+ ERC20Abi: () => ERC20Abi,
27
+ EXTERNAL: () => EXTERNAL,
28
+ FEE: () => FEE,
29
+ LiquidAirdropV2Abi: () => LiquidAirdropV2Abi,
30
+ LiquidFactoryAbi: () => LiquidFactoryAbi,
31
+ LiquidFeeLockerAbi: () => LiquidFeeLockerAbi,
32
+ LiquidHookDynamicFeeV2Abi: () => LiquidHookDynamicFeeV2Abi,
33
+ LiquidLpLockerAbi: () => LiquidLpLockerAbi,
34
+ LiquidMevBlockDelayAbi: () => LiquidMevBlockDelayAbi,
35
+ LiquidPoolExtensionAllowlistAbi: () => LiquidPoolExtensionAllowlistAbi,
36
+ LiquidSDK: () => LiquidSDK,
37
+ LiquidSniperAuctionV2Abi: () => LiquidSniperAuctionV2Abi,
38
+ LiquidSniperUtilV2Abi: () => LiquidSniperUtilV2Abi,
39
+ LiquidVaultAbi: () => LiquidVaultAbi,
40
+ TOKEN: () => TOKEN
41
+ });
42
+ module.exports = __toCommonJS(index_exports);
43
+
44
+ // src/client.ts
45
+ var import_viem = require("viem");
46
+ var import_chains2 = require("viem/chains");
47
+
48
+ // src/constants.ts
49
+ var import_chains = require("viem/chains");
50
+ var ADDRESSES = {
51
+ FACTORY: "0x0000003482fe299E72d4908368044A8A173BE576",
52
+ POOL_EXTENSION_ALLOWLIST: "0x000003Afb1b070F037D2871eE0A6b8c8f53F7B77",
53
+ FEE_LOCKER: "0x000008B9242b7e4432f6c4b1EeAD93562f9Cc94d",
54
+ LP_LOCKER: "0x00000548732DfA56Be1257cE44D0CFc3B46dDb2A",
55
+ LP_LOCKER_FEE_CONVERSION: "0x00000547518784420CEeF761fb18D884bb908102",
56
+ VAULT: "0x000001c5263F4d64CdC343cDA9C8bF961CF8376c",
57
+ HOOK_DYNAMIC_FEE_V2: "0x2A2F73CDDa098d639bd8Bbcd7dF2bf24E06728cC",
58
+ HOOK_STATIC_FEE_V2: "0xb2401c5369AaCF62F8d615623C7F68F84da428Cc",
59
+ SNIPER_AUCTION_V2: "0x000007b64003ee07a69576F98859a0a36b854260",
60
+ SNIPER_UTIL_V2: "0x000003Ee0cb9B0C82C6C7FCB7b81a9883F285270",
61
+ MEV_BLOCK_DELAY: "0x0000035D83588954F3c581c3A66251b3F06AD5e4",
62
+ AIRDROP_V2: "0x00000C222442512b08446D33dd9754a7F260BE79",
63
+ UNIV4_ETH_DEV_BUY: "0x00000d7DE1f0A3FA7957F5d8A2b97B0E24e5783D",
64
+ LIQUID_DEPLOYER_LIB: "0x00000f88b2d37A2006F2F0C8552d22E0b8945202"
65
+ };
66
+ var EXTERNAL = {
67
+ POOL_MANAGER: "0x498581fF718922c3f8e6A244956aF099B2652b2b",
68
+ WETH: "0x4200000000000000000000000000000000000006",
69
+ UNIVERSAL_ROUTER: "0x6fF5693b99212Da76ad316178A184AB56D299b43",
70
+ PERMIT2: "0x000000000022D473030F116dDEE9F6B43aC78BA3"
71
+ };
72
+ var FEE = {
73
+ /** Fee denominator used by Uniswap v4 (1,000,000 = 100%) */
74
+ DENOMINATOR: 1e6,
75
+ /** Protocol fee numerator: 200,000 / 1,000,000 = 20% of LP fees */
76
+ PROTOCOL_FEE_NUMERATOR: 2e5,
77
+ /** Max LP fee: 10% (100,000 / 1,000,000) */
78
+ MAX_LP_FEE: 1e5,
79
+ /** Max MEV fee: 80% (800,000 / 1,000,000) */
80
+ MAX_MEV_FEE: 8e5,
81
+ /** BPS denominator for token supply splits */
82
+ BPS: 1e4
83
+ };
84
+ var TOKEN = {
85
+ /** Total supply for every token: 100 billion with 18 decimals */
86
+ SUPPLY: 100000000000n * 10n ** 18n,
87
+ DECIMALS: 18,
88
+ MAX_EXTENSIONS: 10,
89
+ MAX_EXTENSION_BPS: 9e3
90
+ };
91
+ var DEFAULT_CHAIN = import_chains.base;
92
+ var DEFAULT_CHAIN_ID = 8453;
93
+
94
+ // src/abis/LiquidFactory.ts
95
+ var LiquidFactoryAbi = [
96
+ {
97
+ type: "function",
98
+ name: "deployToken",
99
+ inputs: [
100
+ {
101
+ name: "deploymentConfig",
102
+ type: "tuple",
103
+ components: [
104
+ {
105
+ name: "tokenConfig",
106
+ type: "tuple",
107
+ components: [
108
+ { name: "tokenAdmin", type: "address" },
109
+ { name: "name", type: "string" },
110
+ { name: "symbol", type: "string" },
111
+ { name: "salt", type: "bytes32" },
112
+ { name: "image", type: "string" },
113
+ { name: "metadata", type: "string" },
114
+ { name: "context", type: "string" },
115
+ { name: "originatingChainId", type: "uint256" }
116
+ ]
117
+ },
118
+ {
119
+ name: "poolConfig",
120
+ type: "tuple",
121
+ components: [
122
+ { name: "hook", type: "address" },
123
+ { name: "pairedToken", type: "address" },
124
+ { name: "tickIfToken0IsLiquid", type: "int24" },
125
+ { name: "tickSpacing", type: "int24" },
126
+ { name: "poolData", type: "bytes" }
127
+ ]
128
+ },
129
+ {
130
+ name: "lockerConfig",
131
+ type: "tuple",
132
+ components: [
133
+ { name: "locker", type: "address" },
134
+ { name: "rewardAdmins", type: "address[]" },
135
+ { name: "rewardRecipients", type: "address[]" },
136
+ { name: "rewardBps", type: "uint16[]" },
137
+ { name: "tickLower", type: "int24[]" },
138
+ { name: "tickUpper", type: "int24[]" },
139
+ { name: "positionBps", type: "uint16[]" },
140
+ { name: "lockerData", type: "bytes" }
141
+ ]
142
+ },
143
+ {
144
+ name: "mevModuleConfig",
145
+ type: "tuple",
146
+ components: [
147
+ { name: "mevModule", type: "address" },
148
+ { name: "mevModuleData", type: "bytes" }
149
+ ]
150
+ },
151
+ {
152
+ name: "extensionConfigs",
153
+ type: "tuple[]",
154
+ components: [
155
+ { name: "extension", type: "address" },
156
+ { name: "msgValue", type: "uint256" },
157
+ { name: "extensionBps", type: "uint16" },
158
+ { name: "extensionData", type: "bytes" }
159
+ ]
160
+ }
161
+ ]
162
+ }
163
+ ],
164
+ outputs: [{ name: "tokenAddress", type: "address" }],
165
+ stateMutability: "payable"
166
+ },
167
+ {
168
+ type: "function",
169
+ name: "tokenDeploymentInfo",
170
+ inputs: [{ name: "token", type: "address" }],
171
+ outputs: [
172
+ {
173
+ name: "",
174
+ type: "tuple",
175
+ components: [
176
+ { name: "token", type: "address" },
177
+ { name: "hook", type: "address" },
178
+ { name: "locker", type: "address" },
179
+ { name: "extensions", type: "address[]" }
180
+ ]
181
+ }
182
+ ],
183
+ stateMutability: "view"
184
+ },
185
+ {
186
+ type: "function",
187
+ name: "deploymentInfoForToken",
188
+ inputs: [{ name: "token", type: "address" }],
189
+ outputs: [
190
+ { name: "token", type: "address" },
191
+ { name: "hook", type: "address" },
192
+ { name: "locker", type: "address" }
193
+ ],
194
+ stateMutability: "view"
195
+ },
196
+ {
197
+ type: "function",
198
+ name: "deprecated",
199
+ inputs: [],
200
+ outputs: [{ name: "", type: "bool" }],
201
+ stateMutability: "view"
202
+ },
203
+ {
204
+ type: "function",
205
+ name: "TOKEN_SUPPLY",
206
+ inputs: [],
207
+ outputs: [{ name: "", type: "uint256" }],
208
+ stateMutability: "view"
209
+ },
210
+ {
211
+ type: "function",
212
+ name: "BPS",
213
+ inputs: [],
214
+ outputs: [{ name: "", type: "uint256" }],
215
+ stateMutability: "view"
216
+ },
217
+ {
218
+ type: "function",
219
+ name: "teamFeeRecipient",
220
+ inputs: [],
221
+ outputs: [{ name: "", type: "address" }],
222
+ stateMutability: "view"
223
+ },
224
+ {
225
+ type: "function",
226
+ name: "enabledLockers",
227
+ inputs: [
228
+ { name: "locker", type: "address" },
229
+ { name: "hook", type: "address" }
230
+ ],
231
+ outputs: [{ name: "enabled", type: "bool" }],
232
+ stateMutability: "view"
233
+ },
234
+ {
235
+ type: "event",
236
+ name: "TokenCreated",
237
+ inputs: [
238
+ { name: "msgSender", type: "address", indexed: false },
239
+ { name: "tokenAddress", type: "address", indexed: true },
240
+ { name: "tokenAdmin", type: "address", indexed: true },
241
+ { name: "tokenImage", type: "string", indexed: false },
242
+ { name: "tokenName", type: "string", indexed: false },
243
+ { name: "tokenSymbol", type: "string", indexed: false },
244
+ { name: "tokenMetadata", type: "string", indexed: false },
245
+ { name: "tokenContext", type: "string", indexed: false },
246
+ { name: "startingTick", type: "int24", indexed: false },
247
+ { name: "poolHook", type: "address", indexed: false },
248
+ { name: "poolId", type: "bytes32", indexed: false },
249
+ { name: "pairedToken", type: "address", indexed: false },
250
+ { name: "locker", type: "address", indexed: false },
251
+ { name: "mevModule", type: "address", indexed: false },
252
+ { name: "extensionsSupply", type: "uint256", indexed: false },
253
+ { name: "extensions", type: "address[]", indexed: false }
254
+ ],
255
+ anonymous: false
256
+ }
257
+ ];
258
+
259
+ // src/abis/LiquidFeeLocker.ts
260
+ var LiquidFeeLockerAbi = [
261
+ {
262
+ type: "function",
263
+ name: "availableFees",
264
+ inputs: [
265
+ { name: "feeOwner", type: "address" },
266
+ { name: "token", type: "address" }
267
+ ],
268
+ outputs: [{ name: "", type: "uint256" }],
269
+ stateMutability: "view"
270
+ },
271
+ {
272
+ type: "function",
273
+ name: "feesToClaim",
274
+ inputs: [
275
+ { name: "feeOwner", type: "address" },
276
+ { name: "token", type: "address" }
277
+ ],
278
+ outputs: [{ name: "balance", type: "uint256" }],
279
+ stateMutability: "view"
280
+ },
281
+ {
282
+ type: "function",
283
+ name: "claim",
284
+ inputs: [
285
+ { name: "feeOwner", type: "address" },
286
+ { name: "token", type: "address" }
287
+ ],
288
+ outputs: [],
289
+ stateMutability: "nonpayable"
290
+ }
291
+ ];
292
+
293
+ // src/abis/LiquidHookDynamicFeeV2.ts
294
+ var LiquidHookDynamicFeeV2Abi = [
295
+ {
296
+ type: "function",
297
+ name: "liquidIsToken0",
298
+ inputs: [{ name: "", type: "bytes32" }],
299
+ outputs: [{ name: "", type: "bool" }],
300
+ stateMutability: "view"
301
+ },
302
+ {
303
+ type: "function",
304
+ name: "poolConfigVars",
305
+ inputs: [{ name: "poolId", type: "bytes32" }],
306
+ outputs: [
307
+ {
308
+ name: "",
309
+ type: "tuple",
310
+ components: [
311
+ { name: "baseFee", type: "uint24" },
312
+ { name: "maxLpFee", type: "uint24" },
313
+ { name: "referenceTickFilterPeriod", type: "uint256" },
314
+ { name: "resetPeriod", type: "uint256" },
315
+ { name: "resetTickFilter", type: "int24" },
316
+ { name: "feeControlNumerator", type: "uint256" },
317
+ { name: "decayFilterBps", type: "uint24" }
318
+ ]
319
+ }
320
+ ],
321
+ stateMutability: "view"
322
+ },
323
+ {
324
+ type: "function",
325
+ name: "poolFeeVars",
326
+ inputs: [{ name: "poolId", type: "bytes32" }],
327
+ outputs: [
328
+ {
329
+ name: "",
330
+ type: "tuple",
331
+ components: [
332
+ { name: "referenceTick", type: "int24" },
333
+ { name: "resetTick", type: "int24" },
334
+ { name: "resetTickTimestamp", type: "uint256" },
335
+ { name: "lastSwapTimestamp", type: "uint256" },
336
+ { name: "appliedVR", type: "uint24" },
337
+ { name: "prevVA", type: "uint24" }
338
+ ]
339
+ }
340
+ ],
341
+ stateMutability: "view"
342
+ },
343
+ {
344
+ type: "function",
345
+ name: "poolCreationTimestamp",
346
+ inputs: [{ name: "", type: "bytes32" }],
347
+ outputs: [{ name: "", type: "uint256" }],
348
+ stateMutability: "view"
349
+ },
350
+ {
351
+ type: "function",
352
+ name: "protocolFee",
353
+ inputs: [],
354
+ outputs: [{ name: "", type: "uint24" }],
355
+ stateMutability: "view"
356
+ },
357
+ {
358
+ type: "function",
359
+ name: "factory",
360
+ inputs: [],
361
+ outputs: [{ name: "", type: "address" }],
362
+ stateMutability: "view"
363
+ },
364
+ {
365
+ type: "function",
366
+ name: "poolManager",
367
+ inputs: [],
368
+ outputs: [{ name: "", type: "address" }],
369
+ stateMutability: "view"
370
+ },
371
+ {
372
+ type: "function",
373
+ name: "locker",
374
+ inputs: [],
375
+ outputs: [{ name: "", type: "address" }],
376
+ stateMutability: "view"
377
+ },
378
+ {
379
+ type: "function",
380
+ name: "mevModule",
381
+ inputs: [{ name: "", type: "bytes32" }],
382
+ outputs: [{ name: "", type: "address" }],
383
+ stateMutability: "view"
384
+ },
385
+ {
386
+ type: "function",
387
+ name: "mevModuleEnabled",
388
+ inputs: [{ name: "", type: "bytes32" }],
389
+ outputs: [{ name: "", type: "bool" }],
390
+ stateMutability: "view"
391
+ }
392
+ ];
393
+
394
+ // src/abis/LiquidVault.ts
395
+ var LiquidVaultAbi = [
396
+ {
397
+ type: "function",
398
+ name: "allocation",
399
+ inputs: [{ name: "", type: "address" }],
400
+ outputs: [
401
+ { name: "token", type: "address" },
402
+ { name: "amountTotal", type: "uint256" },
403
+ { name: "amountClaimed", type: "uint256" },
404
+ { name: "lockupEndTime", type: "uint256" },
405
+ { name: "vestingEndTime", type: "uint256" },
406
+ { name: "admin", type: "address" }
407
+ ],
408
+ stateMutability: "view"
409
+ },
410
+ {
411
+ type: "function",
412
+ name: "amountAvailableToClaim",
413
+ inputs: [{ name: "token", type: "address" }],
414
+ outputs: [{ name: "", type: "uint256" }],
415
+ stateMutability: "view"
416
+ },
417
+ {
418
+ type: "function",
419
+ name: "claim",
420
+ inputs: [{ name: "token", type: "address" }],
421
+ outputs: [],
422
+ stateMutability: "nonpayable"
423
+ }
424
+ ];
425
+
426
+ // src/abis/LiquidSniperAuctionV2.ts
427
+ var LiquidSniperAuctionV2Abi = [
428
+ {
429
+ type: "function",
430
+ name: "nextAuctionBlock",
431
+ inputs: [{ name: "poolId", type: "bytes32" }],
432
+ outputs: [{ name: "nextAuctionBlock", type: "uint256" }],
433
+ stateMutability: "view"
434
+ },
435
+ {
436
+ type: "function",
437
+ name: "round",
438
+ inputs: [{ name: "poolId", type: "bytes32" }],
439
+ outputs: [{ name: "round", type: "uint256" }],
440
+ stateMutability: "view"
441
+ },
442
+ {
443
+ type: "function",
444
+ name: "gasPeg",
445
+ inputs: [{ name: "poolId", type: "bytes32" }],
446
+ outputs: [{ name: "gasPeg", type: "uint256" }],
447
+ stateMutability: "view"
448
+ },
449
+ {
450
+ type: "function",
451
+ name: "feeConfig",
452
+ inputs: [{ name: "poolId", type: "bytes32" }],
453
+ outputs: [
454
+ { name: "startingFee", type: "uint24" },
455
+ { name: "endingFee", type: "uint24" },
456
+ { name: "secondsToDecay", type: "uint256" }
457
+ ],
458
+ stateMutability: "view"
459
+ },
460
+ {
461
+ type: "function",
462
+ name: "getFee",
463
+ inputs: [{ name: "poolId", type: "bytes32" }],
464
+ outputs: [{ name: "", type: "uint24" }],
465
+ stateMutability: "view"
466
+ },
467
+ {
468
+ type: "function",
469
+ name: "poolDecayStartTime",
470
+ inputs: [{ name: "poolId", type: "bytes32" }],
471
+ outputs: [{ name: "poolDecayStartTime", type: "uint256" }],
472
+ stateMutability: "view"
473
+ },
474
+ {
475
+ type: "function",
476
+ name: "maxRounds",
477
+ inputs: [],
478
+ outputs: [{ name: "", type: "uint256" }],
479
+ stateMutability: "view"
480
+ },
481
+ {
482
+ type: "function",
483
+ name: "blocksBetweenAuction",
484
+ inputs: [],
485
+ outputs: [{ name: "", type: "uint256" }],
486
+ stateMutability: "view"
487
+ },
488
+ {
489
+ type: "function",
490
+ name: "blocksBetweenDeploymentAndFirstAuction",
491
+ inputs: [],
492
+ outputs: [{ name: "", type: "uint256" }],
493
+ stateMutability: "view"
494
+ },
495
+ {
496
+ type: "function",
497
+ name: "paymentPerGasUnit",
498
+ inputs: [],
499
+ outputs: [{ name: "", type: "uint256" }],
500
+ stateMutability: "view"
501
+ }
502
+ ];
503
+
504
+ // src/abis/LiquidSniperUtilV2.ts
505
+ var LiquidSniperUtilV2Abi = [
506
+ {
507
+ type: "function",
508
+ name: "bidInAuction",
509
+ inputs: [
510
+ {
511
+ name: "swapParams",
512
+ type: "tuple",
513
+ components: [
514
+ {
515
+ name: "poolKey",
516
+ type: "tuple",
517
+ components: [
518
+ { name: "currency0", type: "address" },
519
+ { name: "currency1", type: "address" },
520
+ { name: "fee", type: "uint24" },
521
+ { name: "tickSpacing", type: "int24" },
522
+ { name: "hooks", type: "address" }
523
+ ]
524
+ },
525
+ { name: "zeroForOne", type: "bool" },
526
+ { name: "amountIn", type: "uint128" },
527
+ { name: "amountOutMinimum", type: "uint128" },
528
+ { name: "hookData", type: "bytes" }
529
+ ]
530
+ },
531
+ { name: "round", type: "uint256" }
532
+ ],
533
+ outputs: [],
534
+ stateMutability: "payable"
535
+ },
536
+ {
537
+ type: "function",
538
+ name: "getTxGasPriceForBidAmount",
539
+ inputs: [
540
+ { name: "auctionGasPeg", type: "uint256" },
541
+ { name: "desiredBidAmount", type: "uint256" }
542
+ ],
543
+ outputs: [{ name: "txGasPrice", type: "uint256" }],
544
+ stateMutability: "view"
545
+ }
546
+ ];
547
+
548
+ // src/abis/LiquidAirdropV2.ts
549
+ var LiquidAirdropV2Abi = [
550
+ {
551
+ type: "function",
552
+ name: "airdrops",
553
+ inputs: [{ name: "token", type: "address" }],
554
+ outputs: [
555
+ { name: "admin", type: "address" },
556
+ { name: "merkleRoot", type: "bytes32" },
557
+ { name: "totalSupply", type: "uint256" },
558
+ { name: "totalClaimed", type: "uint256" },
559
+ { name: "lockupEndTime", type: "uint256" },
560
+ { name: "vestingEndTime", type: "uint256" },
561
+ { name: "adminClaimTime", type: "uint256" },
562
+ { name: "adminClaimed", type: "bool" }
563
+ ],
564
+ stateMutability: "view"
565
+ },
566
+ {
567
+ type: "function",
568
+ name: "amountAvailableToClaim",
569
+ inputs: [
570
+ { name: "token", type: "address" },
571
+ { name: "recipient", type: "address" },
572
+ { name: "allocatedAmount", type: "uint256" }
573
+ ],
574
+ outputs: [{ name: "", type: "uint256" }],
575
+ stateMutability: "view"
576
+ },
577
+ {
578
+ type: "function",
579
+ name: "claim",
580
+ inputs: [
581
+ { name: "token", type: "address" },
582
+ { name: "recipient", type: "address" },
583
+ { name: "allocatedAmount", type: "uint256" },
584
+ { name: "proof", type: "bytes32[]" }
585
+ ],
586
+ outputs: [],
587
+ stateMutability: "nonpayable"
588
+ },
589
+ {
590
+ type: "function",
591
+ name: "CLAIM_EXPIRATION_INTERVAL",
592
+ inputs: [],
593
+ outputs: [{ name: "", type: "uint256" }],
594
+ stateMutability: "view"
595
+ },
596
+ {
597
+ type: "function",
598
+ name: "MIN_LOCKUP_DURATION",
599
+ inputs: [],
600
+ outputs: [{ name: "", type: "uint256" }],
601
+ stateMutability: "view"
602
+ }
603
+ ];
604
+
605
+ // src/abis/LiquidPoolExtensionAllowlist.ts
606
+ var LiquidPoolExtensionAllowlistAbi = [
607
+ {
608
+ type: "function",
609
+ name: "enabledExtensions",
610
+ inputs: [{ name: "extension", type: "address" }],
611
+ outputs: [{ name: "enabled", type: "bool" }],
612
+ stateMutability: "view"
613
+ }
614
+ ];
615
+
616
+ // src/abis/LiquidMevBlockDelay.ts
617
+ var LiquidMevBlockDelayAbi = [
618
+ {
619
+ type: "function",
620
+ name: "blockDelay",
621
+ inputs: [],
622
+ outputs: [{ name: "", type: "uint256" }],
623
+ stateMutability: "view"
624
+ },
625
+ {
626
+ type: "function",
627
+ name: "poolUnlockTime",
628
+ inputs: [{ name: "poolId", type: "bytes32" }],
629
+ outputs: [{ name: "", type: "uint256" }],
630
+ stateMutability: "view"
631
+ }
632
+ ];
633
+
634
+ // src/abis/LiquidLpLocker.ts
635
+ var LiquidLpLockerAbi = [
636
+ {
637
+ type: "function",
638
+ name: "tokenRewards",
639
+ inputs: [{ name: "token", type: "address" }],
640
+ outputs: [
641
+ {
642
+ name: "",
643
+ type: "tuple",
644
+ components: [
645
+ { name: "token", type: "address" },
646
+ {
647
+ name: "poolKey",
648
+ type: "tuple",
649
+ components: [
650
+ { name: "currency0", type: "address" },
651
+ { name: "currency1", type: "address" },
652
+ { name: "fee", type: "uint24" },
653
+ { name: "tickSpacing", type: "int24" },
654
+ { name: "hooks", type: "address" }
655
+ ]
656
+ },
657
+ { name: "positionId", type: "uint256" },
658
+ { name: "numPositions", type: "uint256" },
659
+ { name: "rewardBps", type: "uint16[]" },
660
+ { name: "rewardAdmins", type: "address[]" },
661
+ { name: "rewardRecipients", type: "address[]" }
662
+ ]
663
+ }
664
+ ],
665
+ stateMutability: "view"
666
+ },
667
+ {
668
+ type: "function",
669
+ name: "collectRewards",
670
+ inputs: [{ name: "token", type: "address" }],
671
+ outputs: [],
672
+ stateMutability: "nonpayable"
673
+ },
674
+ {
675
+ type: "function",
676
+ name: "collectRewardsWithoutUnlock",
677
+ inputs: [{ name: "token", type: "address" }],
678
+ outputs: [],
679
+ stateMutability: "nonpayable"
680
+ },
681
+ {
682
+ type: "function",
683
+ name: "updateRewardAdmin",
684
+ inputs: [
685
+ { name: "token", type: "address" },
686
+ { name: "rewardIndex", type: "uint256" },
687
+ { name: "newAdmin", type: "address" }
688
+ ],
689
+ outputs: [],
690
+ stateMutability: "nonpayable"
691
+ },
692
+ {
693
+ type: "function",
694
+ name: "updateRewardRecipient",
695
+ inputs: [
696
+ { name: "token", type: "address" },
697
+ { name: "rewardIndex", type: "uint256" },
698
+ { name: "newRecipient", type: "address" }
699
+ ],
700
+ outputs: [],
701
+ stateMutability: "nonpayable"
702
+ },
703
+ {
704
+ type: "function",
705
+ name: "version",
706
+ inputs: [],
707
+ outputs: [{ name: "", type: "string" }],
708
+ stateMutability: "view"
709
+ }
710
+ ];
711
+
712
+ // src/abis/ERC20.ts
713
+ var ERC20Abi = [
714
+ {
715
+ type: "function",
716
+ name: "name",
717
+ inputs: [],
718
+ outputs: [{ name: "", type: "string" }],
719
+ stateMutability: "view"
720
+ },
721
+ {
722
+ type: "function",
723
+ name: "symbol",
724
+ inputs: [],
725
+ outputs: [{ name: "", type: "string" }],
726
+ stateMutability: "view"
727
+ },
728
+ {
729
+ type: "function",
730
+ name: "decimals",
731
+ inputs: [],
732
+ outputs: [{ name: "", type: "uint8" }],
733
+ stateMutability: "view"
734
+ },
735
+ {
736
+ type: "function",
737
+ name: "totalSupply",
738
+ inputs: [],
739
+ outputs: [{ name: "", type: "uint256" }],
740
+ stateMutability: "view"
741
+ },
742
+ {
743
+ type: "function",
744
+ name: "balanceOf",
745
+ inputs: [{ name: "account", type: "address" }],
746
+ outputs: [{ name: "", type: "uint256" }],
747
+ stateMutability: "view"
748
+ },
749
+ {
750
+ type: "function",
751
+ name: "allowance",
752
+ inputs: [
753
+ { name: "owner", type: "address" },
754
+ { name: "spender", type: "address" }
755
+ ],
756
+ outputs: [{ name: "", type: "uint256" }],
757
+ stateMutability: "view"
758
+ },
759
+ {
760
+ type: "function",
761
+ name: "approve",
762
+ inputs: [
763
+ { name: "spender", type: "address" },
764
+ { name: "value", type: "uint256" }
765
+ ],
766
+ outputs: [{ name: "", type: "bool" }],
767
+ stateMutability: "nonpayable"
768
+ },
769
+ {
770
+ type: "function",
771
+ name: "transfer",
772
+ inputs: [
773
+ { name: "to", type: "address" },
774
+ { name: "value", type: "uint256" }
775
+ ],
776
+ outputs: [{ name: "", type: "bool" }],
777
+ stateMutability: "nonpayable"
778
+ }
779
+ ];
780
+
781
+ // src/client.ts
782
+ var LiquidSDK = class {
783
+ publicClient;
784
+ walletClient;
785
+ constructor(config) {
786
+ this.publicClient = config.publicClient;
787
+ this.walletClient = config.walletClient;
788
+ }
789
+ // ── Dev Buy Helper ───────────────────────────────────────────────
790
+ /**
791
+ * Build an ExtensionConfig for a dev buy (buy tokens with ETH at launch).
792
+ * The paired token must be WETH for simple dev buys.
793
+ */
794
+ buildDevBuyExtension(devBuy) {
795
+ const extensionData = (0, import_viem.encodeAbiParameters)(
796
+ [
797
+ {
798
+ type: "tuple",
799
+ components: [
800
+ {
801
+ type: "tuple",
802
+ name: "pairedTokenPoolKey",
803
+ components: [
804
+ { type: "address", name: "currency0" },
805
+ { type: "address", name: "currency1" },
806
+ { type: "uint24", name: "fee" },
807
+ { type: "int24", name: "tickSpacing" },
808
+ { type: "address", name: "hooks" }
809
+ ]
810
+ },
811
+ { type: "uint128", name: "pairedTokenAmountOutMinimum" },
812
+ { type: "address", name: "recipient" }
813
+ ]
814
+ }
815
+ ],
816
+ [
817
+ {
818
+ pairedTokenPoolKey: {
819
+ currency0: import_viem.zeroAddress,
820
+ currency1: import_viem.zeroAddress,
821
+ fee: 0,
822
+ tickSpacing: 0,
823
+ hooks: import_viem.zeroAddress
824
+ },
825
+ pairedTokenAmountOutMinimum: 0n,
826
+ recipient: devBuy.recipient
827
+ }
828
+ ]
829
+ );
830
+ return {
831
+ extension: ADDRESSES.UNIV4_ETH_DEV_BUY,
832
+ msgValue: devBuy.ethAmount,
833
+ extensionBps: 0,
834
+ extensionData
835
+ };
836
+ }
837
+ // ── Token Deployment ─────────────────────────────────────────────
838
+ async deployToken(params) {
839
+ if (!this.walletClient?.account) {
840
+ throw new Error("walletClient with account required for deployToken");
841
+ }
842
+ const account = this.walletClient.account.address;
843
+ const deploymentConfig = {
844
+ tokenConfig: {
845
+ tokenAdmin: params.tokenAdmin ?? account,
846
+ name: params.name,
847
+ symbol: params.symbol,
848
+ salt: params.salt ?? (0, import_viem.keccak256)(
849
+ (0, import_viem.encodePacked)(
850
+ ["string", "string", "uint256"],
851
+ [params.name, params.symbol, BigInt(Date.now())]
852
+ )
853
+ ),
854
+ image: params.image ?? "",
855
+ metadata: params.metadata ?? "",
856
+ context: params.context ?? "",
857
+ originatingChainId: BigInt(DEFAULT_CHAIN_ID)
858
+ },
859
+ poolConfig: {
860
+ hook: params.hook ?? ADDRESSES.HOOK_DYNAMIC_FEE_V2,
861
+ pairedToken: params.pairedToken ?? EXTERNAL.WETH,
862
+ tickIfToken0IsLiquid: params.tickIfToken0IsLiquid ?? -198720,
863
+ tickSpacing: params.tickSpacing ?? 60,
864
+ poolData: params.poolData ?? "0x"
865
+ },
866
+ lockerConfig: {
867
+ locker: params.locker ?? ADDRESSES.LP_LOCKER,
868
+ rewardAdmins: params.rewardAdmins ?? [account],
869
+ rewardRecipients: params.rewardRecipients ?? [account],
870
+ rewardBps: params.rewardBps ?? [1e4],
871
+ tickLower: params.tickLower ?? [-887220],
872
+ tickUpper: params.tickUpper ?? [887220],
873
+ positionBps: params.positionBps ?? [1e4],
874
+ lockerData: params.lockerData ?? "0x"
875
+ },
876
+ mevModuleConfig: {
877
+ mevModule: params.mevModule ?? ADDRESSES.MEV_BLOCK_DELAY,
878
+ mevModuleData: params.mevModuleData ?? "0x"
879
+ },
880
+ extensionConfigs: [...params.extensions ?? []]
881
+ };
882
+ if (params.devBuy) {
883
+ deploymentConfig.extensionConfigs.push(
884
+ this.buildDevBuyExtension(params.devBuy)
885
+ );
886
+ }
887
+ const msgValue = deploymentConfig.extensionConfigs.reduce(
888
+ (sum, ext) => sum + ext.msgValue,
889
+ 0n
890
+ );
891
+ const txHash = await this.walletClient.writeContract({
892
+ address: ADDRESSES.FACTORY,
893
+ abi: LiquidFactoryAbi,
894
+ functionName: "deployToken",
895
+ args: [deploymentConfig],
896
+ value: msgValue,
897
+ chain: import_chains2.base,
898
+ account: this.walletClient.account
899
+ });
900
+ const receipt = await this.publicClient.waitForTransactionReceipt({
901
+ hash: txHash
902
+ });
903
+ const tokenCreatedLog = receipt.logs.find((log) => {
904
+ try {
905
+ const decoded2 = (0, import_viem.decodeEventLog)({
906
+ abi: LiquidFactoryAbi,
907
+ data: log.data,
908
+ topics: log.topics
909
+ });
910
+ return decoded2.eventName === "TokenCreated";
911
+ } catch {
912
+ return false;
913
+ }
914
+ });
915
+ if (!tokenCreatedLog) {
916
+ throw new Error("TokenCreated event not found in transaction receipt");
917
+ }
918
+ const decoded = (0, import_viem.decodeEventLog)({
919
+ abi: LiquidFactoryAbi,
920
+ data: tokenCreatedLog.data,
921
+ topics: tokenCreatedLog.topics
922
+ });
923
+ const args = decoded.args;
924
+ return {
925
+ tokenAddress: (0, import_viem.getAddress)(args.tokenAddress),
926
+ txHash,
927
+ event: {
928
+ msgSender: args.msgSender,
929
+ tokenAddress: args.tokenAddress,
930
+ tokenAdmin: args.tokenAdmin,
931
+ tokenImage: args.tokenImage,
932
+ tokenName: args.tokenName,
933
+ tokenSymbol: args.tokenSymbol,
934
+ tokenMetadata: args.tokenMetadata,
935
+ tokenContext: args.tokenContext,
936
+ startingTick: args.startingTick,
937
+ poolHook: args.poolHook,
938
+ poolId: args.poolId,
939
+ pairedToken: args.pairedToken,
940
+ locker: args.locker,
941
+ mevModule: args.mevModule,
942
+ extensionsSupply: args.extensionsSupply,
943
+ extensions: args.extensions
944
+ }
945
+ };
946
+ }
947
+ // ── Token Info ────────────────────────────────────────────────────
948
+ async getDeploymentInfo(tokenAddress) {
949
+ const result = await this.publicClient.readContract({
950
+ address: ADDRESSES.FACTORY,
951
+ abi: LiquidFactoryAbi,
952
+ functionName: "tokenDeploymentInfo",
953
+ args: [tokenAddress]
954
+ });
955
+ const data = result;
956
+ return {
957
+ token: data.token,
958
+ hook: data.hook,
959
+ locker: data.locker,
960
+ extensions: data.extensions
961
+ };
962
+ }
963
+ async getTokenInfo(tokenAddress) {
964
+ const [name, symbol, decimals, totalSupply] = await Promise.all([
965
+ this.publicClient.readContract({
966
+ address: tokenAddress,
967
+ abi: ERC20Abi,
968
+ functionName: "name"
969
+ }),
970
+ this.publicClient.readContract({
971
+ address: tokenAddress,
972
+ abi: ERC20Abi,
973
+ functionName: "symbol"
974
+ }),
975
+ this.publicClient.readContract({
976
+ address: tokenAddress,
977
+ abi: ERC20Abi,
978
+ functionName: "decimals"
979
+ }),
980
+ this.publicClient.readContract({
981
+ address: tokenAddress,
982
+ abi: ERC20Abi,
983
+ functionName: "totalSupply"
984
+ })
985
+ ]);
986
+ const deployment = await this.getDeploymentInfo(tokenAddress);
987
+ return {
988
+ address: tokenAddress,
989
+ name,
990
+ symbol,
991
+ decimals,
992
+ totalSupply,
993
+ deployment
994
+ };
995
+ }
996
+ // ── Pool Info ─────────────────────────────────────────────────────
997
+ async getPoolConfig(poolId, hookAddress) {
998
+ const hook = hookAddress ?? ADDRESSES.HOOK_DYNAMIC_FEE_V2;
999
+ const result = await this.publicClient.readContract({
1000
+ address: hook,
1001
+ abi: LiquidHookDynamicFeeV2Abi,
1002
+ functionName: "poolConfigVars",
1003
+ args: [poolId]
1004
+ });
1005
+ const data = result;
1006
+ return {
1007
+ baseFee: data.baseFee,
1008
+ maxLpFee: data.maxLpFee,
1009
+ referenceTickFilterPeriod: data.referenceTickFilterPeriod,
1010
+ resetPeriod: data.resetPeriod,
1011
+ resetTickFilter: data.resetTickFilter,
1012
+ feeControlNumerator: data.feeControlNumerator,
1013
+ decayFilterBps: data.decayFilterBps
1014
+ };
1015
+ }
1016
+ async getPoolFeeState(poolId, hookAddress) {
1017
+ const hook = hookAddress ?? ADDRESSES.HOOK_DYNAMIC_FEE_V2;
1018
+ const result = await this.publicClient.readContract({
1019
+ address: hook,
1020
+ abi: LiquidHookDynamicFeeV2Abi,
1021
+ functionName: "poolFeeVars",
1022
+ args: [poolId]
1023
+ });
1024
+ const data = result;
1025
+ return {
1026
+ referenceTick: data.referenceTick,
1027
+ resetTick: data.resetTick,
1028
+ resetTickTimestamp: data.resetTickTimestamp,
1029
+ lastSwapTimestamp: data.lastSwapTimestamp,
1030
+ appliedVR: data.appliedVR,
1031
+ prevVA: data.prevVA
1032
+ };
1033
+ }
1034
+ async getPoolCreationTimestamp(poolId, hookAddress) {
1035
+ const hook = hookAddress ?? ADDRESSES.HOOK_DYNAMIC_FEE_V2;
1036
+ return await this.publicClient.readContract({
1037
+ address: hook,
1038
+ abi: LiquidHookDynamicFeeV2Abi,
1039
+ functionName: "poolCreationTimestamp",
1040
+ args: [poolId]
1041
+ });
1042
+ }
1043
+ async isLiquidToken0(poolId, hookAddress) {
1044
+ const hook = hookAddress ?? ADDRESSES.HOOK_DYNAMIC_FEE_V2;
1045
+ return await this.publicClient.readContract({
1046
+ address: hook,
1047
+ abi: LiquidHookDynamicFeeV2Abi,
1048
+ functionName: "liquidIsToken0",
1049
+ args: [poolId]
1050
+ });
1051
+ }
1052
+ // ── Fee Claims ────────────────────────────────────────────────────
1053
+ async getAvailableFees(feeOwner, tokenAddress) {
1054
+ return await this.publicClient.readContract({
1055
+ address: ADDRESSES.FEE_LOCKER,
1056
+ abi: LiquidFeeLockerAbi,
1057
+ functionName: "availableFees",
1058
+ args: [feeOwner, tokenAddress]
1059
+ });
1060
+ }
1061
+ async getFeesToClaim(feeOwner, tokenAddress) {
1062
+ return await this.publicClient.readContract({
1063
+ address: ADDRESSES.FEE_LOCKER,
1064
+ abi: LiquidFeeLockerAbi,
1065
+ functionName: "feesToClaim",
1066
+ args: [feeOwner, tokenAddress]
1067
+ });
1068
+ }
1069
+ async claimFees(feeOwner, tokenAddress) {
1070
+ if (!this.walletClient?.account) {
1071
+ throw new Error("walletClient with account required for claimFees");
1072
+ }
1073
+ return this.walletClient.writeContract({
1074
+ address: ADDRESSES.FEE_LOCKER,
1075
+ abi: LiquidFeeLockerAbi,
1076
+ functionName: "claim",
1077
+ args: [feeOwner, tokenAddress],
1078
+ chain: import_chains2.base,
1079
+ account: this.walletClient.account
1080
+ });
1081
+ }
1082
+ // ── Vault ─────────────────────────────────────────────────────────
1083
+ async getVaultAllocation(tokenAddress) {
1084
+ const result = await this.publicClient.readContract({
1085
+ address: ADDRESSES.VAULT,
1086
+ abi: LiquidVaultAbi,
1087
+ functionName: "allocation",
1088
+ args: [tokenAddress]
1089
+ });
1090
+ const data = result;
1091
+ return {
1092
+ token: data[0] ?? data.token,
1093
+ amountTotal: data[1] ?? data.amountTotal,
1094
+ amountClaimed: data[2] ?? data.amountClaimed,
1095
+ lockupEndTime: data[3] ?? data.lockupEndTime,
1096
+ vestingEndTime: data[4] ?? data.vestingEndTime,
1097
+ admin: data[5] ?? data.admin
1098
+ };
1099
+ }
1100
+ async getVaultClaimable(tokenAddress) {
1101
+ return await this.publicClient.readContract({
1102
+ address: ADDRESSES.VAULT,
1103
+ abi: LiquidVaultAbi,
1104
+ functionName: "amountAvailableToClaim",
1105
+ args: [tokenAddress]
1106
+ });
1107
+ }
1108
+ async claimVault(tokenAddress) {
1109
+ if (!this.walletClient?.account) {
1110
+ throw new Error("walletClient with account required for claimVault");
1111
+ }
1112
+ return this.walletClient.writeContract({
1113
+ address: ADDRESSES.VAULT,
1114
+ abi: LiquidVaultAbi,
1115
+ functionName: "claim",
1116
+ args: [tokenAddress],
1117
+ chain: import_chains2.base,
1118
+ account: this.walletClient.account
1119
+ });
1120
+ }
1121
+ // ── Factory Status ────────────────────────────────────────────────
1122
+ async isFactoryDeprecated() {
1123
+ return await this.publicClient.readContract({
1124
+ address: ADDRESSES.FACTORY,
1125
+ abi: LiquidFactoryAbi,
1126
+ functionName: "deprecated"
1127
+ });
1128
+ }
1129
+ async isLockerEnabled(locker, hook) {
1130
+ return await this.publicClient.readContract({
1131
+ address: ADDRESSES.FACTORY,
1132
+ abi: LiquidFactoryAbi,
1133
+ functionName: "enabledLockers",
1134
+ args: [locker, hook]
1135
+ });
1136
+ }
1137
+ // ── Sniper Auction ─────────────────────────────────────────────────
1138
+ async getAuctionState(poolId) {
1139
+ const [nextAuctionBlock, round, gasPeg, currentFee] = await Promise.all([
1140
+ this.publicClient.readContract({
1141
+ address: ADDRESSES.SNIPER_AUCTION_V2,
1142
+ abi: LiquidSniperAuctionV2Abi,
1143
+ functionName: "nextAuctionBlock",
1144
+ args: [poolId]
1145
+ }),
1146
+ this.publicClient.readContract({
1147
+ address: ADDRESSES.SNIPER_AUCTION_V2,
1148
+ abi: LiquidSniperAuctionV2Abi,
1149
+ functionName: "round",
1150
+ args: [poolId]
1151
+ }),
1152
+ this.publicClient.readContract({
1153
+ address: ADDRESSES.SNIPER_AUCTION_V2,
1154
+ abi: LiquidSniperAuctionV2Abi,
1155
+ functionName: "gasPeg",
1156
+ args: [poolId]
1157
+ }),
1158
+ this.publicClient.readContract({
1159
+ address: ADDRESSES.SNIPER_AUCTION_V2,
1160
+ abi: LiquidSniperAuctionV2Abi,
1161
+ functionName: "getFee",
1162
+ args: [poolId]
1163
+ })
1164
+ ]);
1165
+ return {
1166
+ nextAuctionBlock,
1167
+ round,
1168
+ gasPeg,
1169
+ currentFee
1170
+ };
1171
+ }
1172
+ async getAuctionFeeConfig(poolId) {
1173
+ const result = await this.publicClient.readContract({
1174
+ address: ADDRESSES.SNIPER_AUCTION_V2,
1175
+ abi: LiquidSniperAuctionV2Abi,
1176
+ functionName: "feeConfig",
1177
+ args: [poolId]
1178
+ });
1179
+ const data = result;
1180
+ return {
1181
+ startingFee: Array.isArray(data) ? data[0] : data.startingFee,
1182
+ endingFee: Array.isArray(data) ? data[1] : data.endingFee,
1183
+ secondsToDecay: Array.isArray(data) ? data[2] : data.secondsToDecay
1184
+ };
1185
+ }
1186
+ async getAuctionDecayStartTime(poolId) {
1187
+ return await this.publicClient.readContract({
1188
+ address: ADDRESSES.SNIPER_AUCTION_V2,
1189
+ abi: LiquidSniperAuctionV2Abi,
1190
+ functionName: "poolDecayStartTime",
1191
+ args: [poolId]
1192
+ });
1193
+ }
1194
+ async getAuctionMaxRounds() {
1195
+ return await this.publicClient.readContract({
1196
+ address: ADDRESSES.SNIPER_AUCTION_V2,
1197
+ abi: LiquidSniperAuctionV2Abi,
1198
+ functionName: "maxRounds"
1199
+ });
1200
+ }
1201
+ async getAuctionGasPriceForBid(auctionGasPeg, desiredBidAmount) {
1202
+ return await this.publicClient.readContract({
1203
+ address: ADDRESSES.SNIPER_UTIL_V2,
1204
+ abi: LiquidSniperUtilV2Abi,
1205
+ functionName: "getTxGasPriceForBidAmount",
1206
+ args: [auctionGasPeg, desiredBidAmount]
1207
+ });
1208
+ }
1209
+ // ── Airdrop ─────────────────────────────────────────────────────────
1210
+ async getAirdropInfo(tokenAddress) {
1211
+ const result = await this.publicClient.readContract({
1212
+ address: ADDRESSES.AIRDROP_V2,
1213
+ abi: LiquidAirdropV2Abi,
1214
+ functionName: "airdrops",
1215
+ args: [tokenAddress]
1216
+ });
1217
+ const data = result;
1218
+ return {
1219
+ admin: Array.isArray(data) ? data[0] : data.admin,
1220
+ merkleRoot: Array.isArray(data) ? data[1] : data.merkleRoot,
1221
+ totalSupply: Array.isArray(data) ? data[2] : data.totalSupply,
1222
+ totalClaimed: Array.isArray(data) ? data[3] : data.totalClaimed,
1223
+ lockupEndTime: Array.isArray(data) ? data[4] : data.lockupEndTime,
1224
+ vestingEndTime: Array.isArray(data) ? data[5] : data.vestingEndTime,
1225
+ adminClaimTime: Array.isArray(data) ? data[6] : data.adminClaimTime,
1226
+ adminClaimed: Array.isArray(data) ? data[7] : data.adminClaimed
1227
+ };
1228
+ }
1229
+ async getAirdropClaimable(tokenAddress, recipient, allocatedAmount) {
1230
+ return await this.publicClient.readContract({
1231
+ address: ADDRESSES.AIRDROP_V2,
1232
+ abi: LiquidAirdropV2Abi,
1233
+ functionName: "amountAvailableToClaim",
1234
+ args: [tokenAddress, recipient, allocatedAmount]
1235
+ });
1236
+ }
1237
+ async claimAirdrop(tokenAddress, recipient, allocatedAmount, proof) {
1238
+ if (!this.walletClient?.account) {
1239
+ throw new Error("walletClient with account required for claimAirdrop");
1240
+ }
1241
+ return this.walletClient.writeContract({
1242
+ address: ADDRESSES.AIRDROP_V2,
1243
+ abi: LiquidAirdropV2Abi,
1244
+ functionName: "claim",
1245
+ args: [tokenAddress, recipient, allocatedAmount, proof],
1246
+ chain: import_chains2.base,
1247
+ account: this.walletClient.account
1248
+ });
1249
+ }
1250
+ // ── LP Locker ───────────────────────────────────────────────────────
1251
+ async getTokenRewards(tokenAddress, lockerAddress) {
1252
+ const locker = lockerAddress ?? ADDRESSES.LP_LOCKER;
1253
+ const result = await this.publicClient.readContract({
1254
+ address: locker,
1255
+ abi: LiquidLpLockerAbi,
1256
+ functionName: "tokenRewards",
1257
+ args: [tokenAddress]
1258
+ });
1259
+ const data = result;
1260
+ return {
1261
+ token: data.token,
1262
+ poolKey: data.poolKey,
1263
+ positionId: data.positionId,
1264
+ numPositions: data.numPositions,
1265
+ rewardBps: [...data.rewardBps],
1266
+ rewardAdmins: [...data.rewardAdmins],
1267
+ rewardRecipients: [...data.rewardRecipients]
1268
+ };
1269
+ }
1270
+ async collectRewards(tokenAddress, lockerAddress) {
1271
+ if (!this.walletClient?.account) {
1272
+ throw new Error("walletClient with account required for collectRewards");
1273
+ }
1274
+ const locker = lockerAddress ?? ADDRESSES.LP_LOCKER;
1275
+ return this.walletClient.writeContract({
1276
+ address: locker,
1277
+ abi: LiquidLpLockerAbi,
1278
+ functionName: "collectRewards",
1279
+ args: [tokenAddress],
1280
+ chain: import_chains2.base,
1281
+ account: this.walletClient.account
1282
+ });
1283
+ }
1284
+ async collectRewardsWithoutUnlock(tokenAddress, lockerAddress) {
1285
+ if (!this.walletClient?.account) {
1286
+ throw new Error(
1287
+ "walletClient with account required for collectRewardsWithoutUnlock"
1288
+ );
1289
+ }
1290
+ const locker = lockerAddress ?? ADDRESSES.LP_LOCKER;
1291
+ return this.walletClient.writeContract({
1292
+ address: locker,
1293
+ abi: LiquidLpLockerAbi,
1294
+ functionName: "collectRewardsWithoutUnlock",
1295
+ args: [tokenAddress],
1296
+ chain: import_chains2.base,
1297
+ account: this.walletClient.account
1298
+ });
1299
+ }
1300
+ async updateRewardRecipient(tokenAddress, rewardIndex, newRecipient, lockerAddress) {
1301
+ if (!this.walletClient?.account) {
1302
+ throw new Error(
1303
+ "walletClient with account required for updateRewardRecipient"
1304
+ );
1305
+ }
1306
+ const locker = lockerAddress ?? ADDRESSES.LP_LOCKER;
1307
+ return this.walletClient.writeContract({
1308
+ address: locker,
1309
+ abi: LiquidLpLockerAbi,
1310
+ functionName: "updateRewardRecipient",
1311
+ args: [tokenAddress, rewardIndex, newRecipient],
1312
+ chain: import_chains2.base,
1313
+ account: this.walletClient.account
1314
+ });
1315
+ }
1316
+ // ── Pool Extension Allowlist ────────────────────────────────────────
1317
+ async isExtensionEnabled(extensionAddress) {
1318
+ return await this.publicClient.readContract({
1319
+ address: ADDRESSES.POOL_EXTENSION_ALLOWLIST,
1320
+ abi: LiquidPoolExtensionAllowlistAbi,
1321
+ functionName: "enabledExtensions",
1322
+ args: [extensionAddress]
1323
+ });
1324
+ }
1325
+ // ── MEV Block Delay ─────────────────────────────────────────────────
1326
+ async getMevBlockDelay() {
1327
+ return await this.publicClient.readContract({
1328
+ address: ADDRESSES.MEV_BLOCK_DELAY,
1329
+ abi: LiquidMevBlockDelayAbi,
1330
+ functionName: "blockDelay"
1331
+ });
1332
+ }
1333
+ async getPoolUnlockTime(poolId) {
1334
+ return await this.publicClient.readContract({
1335
+ address: ADDRESSES.MEV_BLOCK_DELAY,
1336
+ abi: LiquidMevBlockDelayAbi,
1337
+ functionName: "poolUnlockTime",
1338
+ args: [poolId]
1339
+ });
1340
+ }
1341
+ };
1342
+ // Annotate the CommonJS export names for ESM import in node:
1343
+ 0 && (module.exports = {
1344
+ ADDRESSES,
1345
+ DEFAULT_CHAIN,
1346
+ DEFAULT_CHAIN_ID,
1347
+ ERC20Abi,
1348
+ EXTERNAL,
1349
+ FEE,
1350
+ LiquidAirdropV2Abi,
1351
+ LiquidFactoryAbi,
1352
+ LiquidFeeLockerAbi,
1353
+ LiquidHookDynamicFeeV2Abi,
1354
+ LiquidLpLockerAbi,
1355
+ LiquidMevBlockDelayAbi,
1356
+ LiquidPoolExtensionAllowlistAbi,
1357
+ LiquidSDK,
1358
+ LiquidSniperAuctionV2Abi,
1359
+ LiquidSniperUtilV2Abi,
1360
+ LiquidVaultAbi,
1361
+ TOKEN
1362
+ });
1363
+ //# sourceMappingURL=index.js.map