liquid-sdk 1.7.2 → 1.7.3

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 CHANGED
@@ -2,79 +2,34 @@
2
2
 
3
3
  TypeScript SDK for the Liquid Protocol token launcher on Base. Deploy tokens, manage pools, and claim fees using [viem](https://viem.sh).
4
4
 
5
- ## Agent Skills
6
-
7
- The SDK ships with **agent skill files** — self-contained markdown guides that AI agents can load into their context to autonomously interact with Liquid Protocol on Base.
8
-
9
- | Skill | File | What it teaches |
10
- |-------|------|-----------------|
11
- | **SDK Overview** | `skills/sdk-overview.md` | Full capabilities, data schemas (metadata, context, rewards, vault, airdrop), default config — load this first |
12
- | **Deploy Token** | `skills/deploy-token.md` | Deployment workflows — minimal deploy, dev buy, custom fees, custom positions, reward splits |
13
- | **Bid in Auction** | `skills/bid-in-auction.md` | MEV sniper auction — WETH handling, gas price encoding, block timing, automated sniper example |
14
- | **Index Tokens** | `skills/index-tokens.md` | Token discovery — bulk queries, single lookup, pagination, real-time monitoring |
15
-
16
- ### Using Skills with Your Agent
17
-
18
- ```python
19
- # Python — load a skill into your agent's context
20
- with open("node_modules/liquid-sdk/skills/deploy-token.md") as f:
21
- agent.system_prompt += f.read()
22
- ```
23
-
24
- ```typescript
25
- // TypeScript — read skill for an MCP server or agent framework
26
- import { readFileSync } from "fs";
27
- const skill = readFileSync("node_modules/liquid-sdk/skills/bid-in-auction.md", "utf-8");
28
- ```
29
-
30
- For Claude Code, reference skills in your `CLAUDE.md`:
31
- ```
32
- For token deployment, follow the instructions in node_modules/liquid-sdk/skills/deploy-token.md
33
- ```
34
-
35
- ### Additional Agent Docs
36
-
37
- | File | Purpose |
38
- |------|---------|
39
- | `AGENT_README.md` | Complete API reference with every method, type, and default (700+ lines) |
40
- | `llms.txt` | Compact summary for LLM context windows |
41
- | `CLAUDE.md` | Agent guide with architecture, defaults, and invariants |
42
-
43
5
  ## Installation
44
6
 
45
7
  ```bash
46
- npm install liquid-sdk viem
8
+ npm install liquid-protocol-sdk viem
47
9
  ```
48
10
 
49
- > **Defaults**: Static 1% fee (both buy and sell), 5-position Liquid layout, Sniper Auction MEV (80%→40% over 20s, 5 rounds), tick spacing 200, starting tick -230400 (~10 ETH market cap). All fees converted to ETH before distribution.
50
-
51
- ### Default Liquidity Positions
52
-
53
- | # | Supply | Tick Range | Market Cap Range (@$2,000/ETH) |
54
- |---|--------|-----------|-------------------------------|
55
- | 1 | 10% | -230,400 → -216,000 | ~$20K → ~$83K |
56
- | 2 | 50% | -216,000 → -155,000 | ~$83K → ~$37M |
57
- | 3 | 15% | -202,000 → -155,000 | ~$338K → ~$37M |
58
- | 4 | 20% | -155,000 → -120,000 | ~$37M → ~$1.2B |
59
- | 5 | 5% | -141,000 → -120,000 | ~$151M → ~$1.2B |
60
-
61
11
  ## Quick Start
62
12
 
63
13
  ```typescript
64
- import { createWalletClient, http } from "viem";
14
+ import { createPublicClient, createWalletClient, http } from "viem";
65
15
  import { privateKeyToAccount } from "viem/accounts";
66
16
  import { base } from "viem/chains";
67
- import { LiquidSDK } from "liquid-sdk";
17
+ import { LiquidSDK } from "liquid-protocol-sdk";
68
18
 
69
19
  const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
70
20
 
21
+ const publicClient = createPublicClient({
22
+ chain: base,
23
+ transport: http(),
24
+ });
25
+
71
26
  const walletClient = createWalletClient({
72
27
  account,
73
28
  chain: base,
74
29
  transport: http(),
75
30
  });
76
31
 
77
- const liquid = new LiquidSDK({ walletClient });
32
+ const liquid = new LiquidSDK({ publicClient, walletClient });
78
33
  ```
79
34
 
80
35
  ## Deploy a Token
@@ -92,126 +47,110 @@ console.log("Pool ID:", result.event.poolId);
92
47
  console.log("Tx:", result.txHash);
93
48
  ```
94
49
 
95
- ### Deploy with Custom Market Cap Positions
50
+ ### Deploy with Custom Configuration
96
51
 
97
52
  ```typescript
98
- import { createDefaultPositions, createPositionsUSD } from "liquid-sdk";
99
-
100
- // Use default 3-tranche split ($500K / $10M / $1B) at current ETH price
101
- const positions = createDefaultPositions(20_000, 2070); // $20K start, $2070/ETH
53
+ import { ADDRESSES, EXTERNAL } from "liquid-protocol-sdk";
102
54
 
103
55
  const result = await liquid.deployToken({
104
- name: "My Token",
105
- symbol: "MTK",
106
- ...positions, // tickLower, tickUpper, positionBps, tickIfToken0IsLiquid
56
+ name: "Custom Token",
57
+ symbol: "CTK",
58
+
59
+ // Pool config
60
+ hook: ADDRESSES.HOOK_STATIC_FEE_V2, // use static fee hook
61
+ pairedToken: EXTERNAL.WETH,
62
+ tickSpacing: 60,
63
+ tickIfToken0IsLiquid: -198720,
64
+
65
+ // LP rewards: split 70/30 between creator and platform
66
+ rewardAdmins: [creatorAddress, platformAddress],
67
+ rewardRecipients: [creatorAddress, platformAddress],
68
+ rewardBps: [7000, 3000],
69
+
70
+ // Full-range single position
71
+ tickLower: [-887220],
72
+ tickUpper: [887220],
73
+ positionBps: [10000],
74
+
75
+ // MEV protection
76
+ mevModule: ADDRESSES.MEV_BLOCK_DELAY,
107
77
  });
108
-
109
- // Or define fully custom tranches
110
- const custom = createPositionsUSD(50_000, 2070, [
111
- { upperMarketCapUSD: 1_000_000, supplyPct: 30 },
112
- { upperMarketCapUSD: 50_000_000, supplyPct: 50 },
113
- { upperMarketCapUSD: 500_000_000, supplyPct: 20 },
114
- ]);
115
78
  ```
116
79
 
117
- ### Deploy with Custom Fees
80
+ ## Read Token Info
118
81
 
119
82
  ```typescript
120
- import { ADDRESSES, encodeStaticFeePoolData, encodeDynamicFeePoolData } from "liquid-sdk";
121
-
122
- // Static 2% fee
123
- const result = await liquid.deployToken({
124
- name: "Custom Fee Token",
125
- symbol: "CFT",
126
- poolData: encodeStaticFeePoolData(200, 200), // 2% both directions
127
- });
128
-
129
- // Dynamic fee (1%-5% range)
130
- const result2 = await liquid.deployToken({
131
- name: "Dynamic Token",
132
- symbol: "DYN",
133
- hook: ADDRESSES.HOOK_DYNAMIC_FEE_V2,
134
- poolData: encodeDynamicFeePoolData({
135
- baseFeeBps: 100,
136
- maxFeeBps: 500,
137
- referenceTickFilterPeriod: 30,
138
- resetPeriod: 120,
139
- resetTickFilter: 200,
140
- feeControlNumerator: 500000000n,
141
- decayFilterBps: 7500,
142
- }),
143
- });
144
- ```
145
-
146
- ## Sniper Auction (MEV Bidding)
147
-
148
- Bid for early access to newly launched tokens. The SDK handles WETH wrapping, approvals, gas price encoding, and timing automatically.
83
+ // Get ERC20 info + deployment details
84
+ const info = await liquid.getTokenInfo(tokenAddress);
85
+ console.log(info.name, info.symbol, info.decimals);
86
+ console.log("Hook:", info.deployment.hook);
87
+ console.log("Locker:", info.deployment.locker);
149
88
 
150
- ```typescript
151
- import { LiquidSDK, EXTERNAL } from "liquid-sdk";
152
-
153
- // 1. Get auction state & pool key
154
- const auction = await liquid.getAuctionState(poolId);
155
- const rewards = await liquid.getTokenRewards(tokenAddress);
156
- const zeroForOne = rewards.poolKey.currency0.toLowerCase() === EXTERNAL.WETH.toLowerCase();
157
-
158
- // 2. Calculate gas price for your bid
159
- const gasPrice = await liquid.getAuctionGasPriceForBid(auction.gasPeg, parseEther("0.001"));
160
-
161
- // 3. Wait for auction block, then fire
162
- const result = await liquid.bidInAuction({
163
- poolKey: rewards.poolKey,
164
- zeroForOne,
165
- amountIn: parseEther("0.001"), // WETH to swap (auto-wrapped)
166
- amountOutMinimum: 0n,
167
- round: auction.round,
168
- bidAmount: parseEther("0.0005"), // ETH bid (msg.value)
169
- }, gasPrice);
89
+ // Get deployment info only
90
+ const deployment = await liquid.getDeploymentInfo(tokenAddress);
170
91
  ```
171
92
 
172
- ## Token Discovery
93
+ ## Pool Information
173
94
 
174
95
  ```typescript
175
- // Get all tokens
176
- const allTokens = await liquid.getTokens();
96
+ // Get pool fee configuration (dynamic fee hook)
97
+ const config = await liquid.getPoolConfig(poolId);
98
+ console.log("Base fee:", config.baseFee);
99
+ console.log("Max LP fee:", config.maxLpFee);
177
100
 
178
- // Get tokens by deployer
179
- const myTokens = await liquid.getTokens({ deployer: myAddress });
101
+ // Get current fee state
102
+ const feeState = await liquid.getPoolFeeState(poolId);
103
+ console.log("Reference tick:", feeState.referenceTick);
104
+ console.log("Last swap:", feeState.lastSwapTimestamp);
180
105
 
181
- // Look up a single token (fast, indexed)
182
- const token = await liquid.getTokenEvent(tokenAddress);
106
+ // Check pool creation time
107
+ const created = await liquid.getPoolCreationTimestamp(poolId);
183
108
 
184
- // Paginate with block ranges
185
- const page = await liquid.getTokens({ fromBlock: 20000000n, toBlock: 20100000n });
109
+ // Check token ordering
110
+ const isToken0 = await liquid.isLiquidToken0(poolId);
186
111
  ```
187
112
 
188
- ## Read Token Info
113
+ ## Claim Fees
189
114
 
190
115
  ```typescript
191
- const info = await liquid.getTokenInfo(tokenAddress);
192
- console.log(info.name, info.symbol, info.decimals);
193
- console.log("Hook:", info.deployment.hook);
194
- console.log("Locker:", info.deployment.locker);
195
- ```
116
+ // Check available fees
117
+ const available = await liquid.getAvailableFees(ownerAddress);
118
+ const claimable = await liquid.getFeesToClaim(ownerAddress);
196
119
 
197
- ## Claim Fees & Rewards
120
+ console.log("Available:", available);
121
+ console.log("Claimable:", claimable);
198
122
 
199
- ```typescript
200
- // LP Rewards
201
- const rewards = await liquid.getTokenRewards(tokenAddress);
202
- await liquid.collectRewards(tokenAddress);
123
+ // Claim fees (defaults to WETH)
124
+ const txHash = await liquid.claimFees(ownerAddress);
203
125
 
204
- // Fee claims (all fees converted to ETH by default)
205
- const claimable = await liquid.getFeesToClaim(ownerAddress, tokenAddress);
206
- await liquid.claimFees(ownerAddress, tokenAddress);
126
+ // Optional: override the fee token explicitly
127
+ const tokenClaimable = await liquid.getFeesToClaim(ownerAddress, tokenAddress);
207
128
  ```
208
129
 
209
130
  ## Vault (Token Vesting)
210
131
 
211
132
  ```typescript
133
+ // Check vault allocation
212
134
  const allocation = await liquid.getVaultAllocation(tokenAddress);
135
+ console.log("Total:", allocation.amountTotal);
136
+ console.log("Claimed:", allocation.amountClaimed);
137
+ console.log("Lockup ends:", new Date(Number(allocation.lockupEndTime) * 1000));
138
+
139
+ // Check claimable amount
213
140
  const claimable = await liquid.getVaultClaimable(tokenAddress);
214
- await liquid.claimVault(tokenAddress);
141
+
142
+ // Claim vested tokens
143
+ const txHash = await liquid.claimVault(tokenAddress);
144
+ ```
145
+
146
+ ## Factory Status
147
+
148
+ ```typescript
149
+ // Check if factory is accepting new deployments
150
+ const deprecated = await liquid.isFactoryDeprecated();
151
+
152
+ // Check if a locker/hook pair is enabled
153
+ const enabled = await liquid.isLockerEnabled(lockerAddress, hookAddress);
215
154
  ```
216
155
 
217
156
  ## Constants & ABIs
@@ -220,45 +159,20 @@ All production addresses, fee parameters, and contract ABIs are exported:
220
159
 
221
160
  ```typescript
222
161
  import {
223
- ADDRESSES, // Liquid Protocol contract addresses
224
- EXTERNAL, // External protocol addresses (PoolManager, WETH, etc.)
225
- FEE, // Fee constants (denominator, protocol fee, max fees)
226
- TOKEN, // Token constants (supply, decimals, max extensions)
227
- DEFAULTS, // Default deploy config (hook, fees, MEV, ticks)
228
- POOL_POSITIONS, // Position presets (Standard, Liquid)
229
- DEFAULT_CHAIN, // base chain object
162
+ ADDRESSES, // Liquid Protocol contract addresses
163
+ EXTERNAL, // External protocol addresses (PoolManager, WETH, etc.)
164
+ FEE, // Fee constants (denominator, protocol fee, max fees)
165
+ TOKEN, // Token constants (supply, decimals, max extensions)
166
+ DEFAULT_CHAIN, // base chain object
230
167
  DEFAULT_CHAIN_ID, // 8453
231
168
 
232
- // Tick math & positions
233
- getTickFromMarketCapETH,
234
- getTickFromMarketCapUSD,
235
- marketCapFromTickETH,
236
- marketCapFromTickUSD,
237
- createPositions,
238
- createPositionsUSD,
239
- createDefaultPositions,
240
- describePositions,
241
-
242
- // Encoding helpers
243
- encodeStaticFeePoolData,
244
- encodeDynamicFeePoolData,
245
- encodeSniperAuctionData,
246
-
247
169
  // ABIs for direct contract interaction
248
170
  LiquidFactoryAbi,
249
171
  LiquidFeeLockerAbi,
250
172
  LiquidHookDynamicFeeV2Abi,
251
- LiquidLpLockerAbi,
252
173
  LiquidVaultAbi,
253
- LiquidSniperAuctionV2Abi,
254
- LiquidSniperUtilV2Abi,
255
- LiquidAirdropV2Abi,
256
- LiquidTokenAbi,
257
- LiquidUniv4EthDevBuyAbi,
258
- LiquidPoolExtensionAllowlistAbi,
259
- LiquidMevBlockDelayAbi,
260
174
  ERC20Abi,
261
- } from "liquid-sdk";
175
+ } from "liquid-protocol-sdk";
262
176
  ```
263
177
 
264
178
  ## API Reference
@@ -268,65 +182,31 @@ import {
268
182
  #### Constructor
269
183
 
270
184
  ```typescript
271
- new LiquidSDK({ walletClient, publicClient? })
185
+ new LiquidSDK({ publicClient, walletClient? })
272
186
  ```
273
187
 
188
+ - `publicClient` (required) - viem `PublicClient` connected to Base
274
189
  - `walletClient` (optional) - viem `WalletClient` for write operations
275
- - `publicClient` (optional) - viem `PublicClient` connected to Base (auto-created if omitted)
276
190
 
277
191
  #### Methods
278
192
 
279
- | Method | Description | Wallet |
280
- |--------|-------------|:------:|
281
- | **Deployment** | | |
282
- | `deployToken(params)` | Deploy token + Uniswap V4 pool | Yes |
283
- | `buildDevBuyExtension(devBuy)` | Build dev buy extension config | No |
284
- | **Token Discovery** | | |
285
- | `getTokens(options?)` | Query deployed tokens with filters | No |
286
- | `getTokenEvent(token)` | Look up single token (indexed, fast) | No |
287
- | `getDeployedTokens(deployer)` | Get tokens by deployer | No |
288
- | **Token Info** | | |
289
- | `getDeploymentInfo(token)` | Hook, locker, extensions | No |
290
- | `getTokenInfo(token)` | ERC20 info + deployment details | No |
291
- | **Token Updates** | | |
292
- | `updateImage(token, url)` | Update token image (admin) | Yes |
293
- | `updateMetadata(token, json)` | Update token metadata (admin) | Yes |
294
- | **Pool State** | | |
295
- | `getPoolConfig(poolId)` | Dynamic fee pool configuration | No |
296
- | `getPoolFeeState(poolId)` | Current fee state variables | No |
297
- | `getPoolCreationTimestamp(poolId)` | Pool creation timestamp | No |
298
- | `isLiquidToken0(poolId)` | Token sort order in pool | No |
299
- | **Fee Claims** | | |
300
- | `getAvailableFees(owner, token)` | Total unlocked fees | No |
301
- | `getFeesToClaim(owner, token)` | Claimable fee balance | No |
302
- | `claimFees(owner, token)` | Claim accumulated fees | Yes |
303
- | **LP Rewards** | | |
304
- | `getTokenRewards(token)` | Reward config (recipients, bps, poolKey) | No |
305
- | `collectRewards(token)` | Collect + unlock LP fees | Yes |
306
- | `collectRewardsWithoutUnlock(token)` | Collect fees only | Yes |
307
- | `updateRewardRecipient(token, idx, addr)` | Change reward recipient | Yes |
308
- | **Vault** | | |
309
- | `getVaultAllocation(token)` | Vault vesting state | No |
310
- | `getVaultClaimable(token)` | Vested amount available | No |
311
- | `claimVault(token)` | Claim vested tokens | Yes |
312
- | **Airdrop** | | |
313
- | `getAirdropInfo(token)` | Airdrop state | No |
314
- | `getAirdropClaimable(token, recipient, amount)` | Claimable for recipient | No |
315
- | `claimAirdrop(token, recipient, amount, proof)` | Claim airdrop | Yes |
316
- | **Sniper Auction** | | |
317
- | `getAuctionState(poolId)` | Round, gasPeg, fee, nextBlock | No |
318
- | `getAuctionFeeConfig(poolId)` | Fee decay parameters | No |
319
- | `getAuctionDecayStartTime(poolId)` | When fee decay started | No |
320
- | `getAuctionMaxRounds()` | Max auction rounds | No |
321
- | `getAuctionGasPriceForBid(gasPeg, bid)` | Calculate gas price for bid | No |
322
- | `bidInAuction(params, gasPrice)` | Bid + swap (auto-wraps WETH) | Yes |
323
- | **MEV Protection** | | |
324
- | `getMevBlockDelay()` | Configured block delay | No |
325
- | `getPoolUnlockTime(poolId)` | When MEV lock expires | No |
326
- | **Factory** | | |
327
- | `isFactoryDeprecated()` | Factory still active? | No |
328
- | `isLockerEnabled(locker, hook)` | Locker/hook pair enabled? | No |
329
- | `isExtensionEnabled(extension)` | Extension on allowlist? | No |
193
+ | Method | Description | Requires Wallet |
194
+ |--------|-------------|:-:|
195
+ | `deployToken(params)` | Deploy a new token + pool | Yes |
196
+ | `getDeploymentInfo(token)` | Get deployment info (hook, locker, extensions) | No |
197
+ | `getTokenInfo(token)` | Get ERC20 info + deployment details | No |
198
+ | `getPoolConfig(poolId, hook?)` | Get dynamic fee pool configuration | No |
199
+ | `getPoolFeeState(poolId, hook?)` | Get current fee state variables | No |
200
+ | `getPoolCreationTimestamp(poolId, hook?)` | Get pool creation timestamp | No |
201
+ | `isLiquidToken0(poolId, hook?)` | Check if Liquid token is currency0 | No |
202
+ | `getAvailableFees(owner, feeToken?)` | Get available fee balance (defaults to WETH) | No |
203
+ | `getFeesToClaim(owner, feeToken?)` | Get claimable fee balance (defaults to WETH) | No |
204
+ | `claimFees(owner, feeToken?)` | Claim accumulated fees (defaults to WETH) | Yes |
205
+ | `getVaultAllocation(token)` | Get vault vesting allocation | No |
206
+ | `getVaultClaimable(token)` | Get vested amount available to claim | No |
207
+ | `claimVault(token)` | Claim vested tokens from vault | Yes |
208
+ | `isFactoryDeprecated()` | Check if factory is deprecated | No |
209
+ | `isLockerEnabled(locker, hook)` | Check if locker/hook pair is enabled | No |
330
210
 
331
211
  ## Production Addresses
332
212
 
@@ -334,18 +214,18 @@ All contracts are deployed on **Base** (chain ID 8453):
334
214
 
335
215
  | Contract | Address |
336
216
  |----------|---------|
337
- | Factory | `0x04F1a284168743759BE6554f607a10CEBdB77760` |
338
- | Hook Dynamic Fee V2 | `0x80E2F7dC8C2C880BbC4BDF80A5Fb0eB8B1DB68CC` |
339
- | Hook Static Fee V2 | `0x9811f10Cd549c754Fa9E5785989c422A762c28cc` |
340
- | Fee Locker | `0xF7d3BE3FC0de76fA5550C29A8F6fa53667B876FF` |
341
- | LP Locker Fee Conversion | `0x77247fCD1d5e34A3703AcA898A591Dc7422435f3` |
342
- | Vault | `0xdFCCC93257c20519A9005A2281CFBdF84836d50E` |
343
- | Sniper Auction V2 | `0x187e8627c02c58F31831953C1268e157d3BfCefd` |
344
- | Sniper Util V2 | `0x2B6cd5Be183c388Dd0074d53c52317df1414cd9f` |
345
- | MEV Descending Fees | `0x8D6B080e48756A99F3893491D556B5d6907b6910` |
346
- | Airdrop V2 | `0x1423974d48f525462f1c087cBFdCC20BDBc33CdD` |
347
- | Pool Extension Allowlist | `0xb614167d79aDBaA9BA35d05fE1d5542d7316Ccaa` |
348
- | Univ4 ETH Dev Buy | `0x5934097864dC487D21A7B4e4EEe201A39ceF728D` |
217
+ | Factory | `0x0000003482fe299E72d4908368044A8A173BE576` |
218
+ | Hook Dynamic Fee V2 | `0x2A2F73CDDa098d639bd8Bbcd7dF2bf24E06728cC` |
219
+ | Hook Static Fee V2 | `0xb2401c5369AaCF62F8d615623C7F68F84da428Cc` |
220
+ | Fee Locker | `0x000008B9242b7e4432f6c4b1EeAD93562f9Cc94d` |
221
+ | LP Locker | `0x00000548732DfA56Be1257cE44D0CFc3B46dDb2A` |
222
+ | LP Locker Fee Conversion | `0x00000547518784420CEeF761fb18D884bb908102` |
223
+ | Vault | `0x000001c5263F4d64CdC343cDA9C8bF961CF8376c` |
224
+ | Sniper Auction V2 | `0x000007b64003ee07a69576F98859a0a36b854260` |
225
+ | Sniper Util V2 | `0x000003Ee0cb9B0C82C6C7FCB7b81a9883F285270` |
226
+ | MEV Block Delay | `0x0000035D83588954F3c581c3A66251b3F06AD5e4` |
227
+ | Airdrop V2 | `0x00000C222442512b08446D33dd9754a7F260BE79` |
228
+ | Pool Extension Allowlist | `0x000003Afb1b070F037D2871eE0A6b8c8f53F7B77` |
349
229
 
350
230
  ## License
351
231
 
package/dist/index.d.mts CHANGED
@@ -63,6 +63,21 @@ interface VaultExtensionParams {
63
63
  /** Vesting duration in seconds after lockup ends (0 = no vesting, tokens unlock all at once) */
64
64
  vestingDuration?: number;
65
65
  }
66
+ interface AirdropExtensionParams {
67
+ /** Address allowed to `updateAdmin`, `updateMerkleRoot` (under conditions),
68
+ * and `adminClaim` the remainder after claim expiration. */
69
+ admin: Address;
70
+ /** Merkle root over leaves `keccak256(bytes.concat(keccak256(abi.encode(
71
+ * recipient, allocatedAmount))))`. Double-hashed per OZ convention. */
72
+ merkleRoot: Hex;
73
+ /** Percentage of supply to reserve for the airdrop, in BPS (1–9000). */
74
+ allocationBps: number;
75
+ /** Lockup in seconds before any recipient can claim. Min 86400 (1 day). */
76
+ lockupDuration: number;
77
+ /** Linear vesting after lockup. 0 = instant claim of full entitlement at
78
+ * lockup end. */
79
+ vestingDuration?: number;
80
+ }
66
81
  interface DeployTokenParams {
67
82
  name: string;
68
83
  symbol: string;
@@ -270,6 +285,29 @@ declare class LiquidSDK {
270
285
  * ```
271
286
  */
272
287
  buildVaultExtension(vault: VaultExtensionParams): ExtensionConfig;
288
+ /**
289
+ * Build an ExtensionConfig that reserves a percentage of supply into
290
+ * the LiquidAirdropV2 contract for merkle-tree-based distribution.
291
+ *
292
+ * The airdrop contract expects `AirdropV2ExtensionData`:
293
+ * { address admin, bytes32 merkleRoot, uint256 lockupDuration, uint256 vestingDuration }
294
+ *
295
+ * Leaf encoding used by LiquidAirdropV2.claim (note: **double hashed**
296
+ * — OZ's standard 2nd-preimage-resistant pattern):
297
+ * leaf = keccak256(bytes.concat(keccak256(abi.encode(recipient, allocatedAmount))))
298
+ *
299
+ * @example
300
+ * ```typescript
301
+ * const airdropExt = sdk.buildAirdropExtension({
302
+ * admin: account.address,
303
+ * merkleRoot: "0x…",
304
+ * allocationBps: 2000, // 20%
305
+ * lockupDuration: 86400, // 1 day (minimum)
306
+ * vestingDuration: 0, // instant claim after lockup
307
+ * });
308
+ * ```
309
+ */
310
+ buildAirdropExtension(airdrop: AirdropExtensionParams): ExtensionConfig;
273
311
  /**
274
312
  * Validate a DeploymentConfig before sending to the contract.
275
313
  * Catches common mistakes client-side with clear error messages.
@@ -489,7 +527,7 @@ declare const POOL_POSITIONS: {
489
527
  */
490
528
  declare const DEFAULTS: {
491
529
  readonly HOOK: `0x${string}`;
492
- /** LP Locker with fee conversion (converts fees to ETH before distributing) */
530
+ /** LP Locker with fee conversion (converts fees to WETH before distributing) */
493
531
  readonly LOCKER: `0x${string}`;
494
532
  readonly TICK_SPACING: 200;
495
533
  readonly TICK_IF_TOKEN0_IS_LIQUID: -230400;
@@ -2496,7 +2534,7 @@ declare enum FeePreference {
2496
2534
  *
2497
2535
  * @example
2498
2536
  * ```ts
2499
- * // Single recipient, fees converted to ETH
2537
+ * // Single recipient, fees converted to WETH
2500
2538
  * const lockerData = encodeFeeConversionLockerData([FeePreference.Paired]);
2501
2539
  *
2502
2540
  * // Two recipients: first gets ETH, second gets the token
@@ -2557,4 +2595,4 @@ declare function parseContext(contextString: string): LiquidContext | null;
2557
2595
  */
2558
2596
  declare function parseMetadata(metadataString: string): LiquidMetadata | null;
2559
2597
 
2560
- export { ADDRESSES, type AirdropInfo, type BidInAuctionParams, type BidInAuctionResult, DEFAULTS, DEFAULT_CHAIN, DEFAULT_CHAIN_ID, DEFAULT_RPC_URL, DEFAULT_TRANCHES_USD, type DeployTokenParams, type DeployTokenResult, type DeploymentConfig, type DeploymentInfo, type DevBuyParams, type DynamicFeeConfig, ERC20Abi, EXTERNAL, type ExtensionConfig, FEE, FeePreference, type GetTokensOptions, LiquidAirdropV2Abi, type LiquidContext, LiquidFactoryAbi, LiquidFeeLockerAbi, LiquidHookDynamicFeeV2Abi, LiquidLpLockerAbi, type LiquidMetadata, LiquidMevBlockDelayAbi, LiquidMevDescendingFeesAbi, LiquidPoolExtensionAllowlistAbi, LiquidSDK, type LiquidSDKConfig, LiquidSniperAuctionV2Abi, LiquidSniperUtilV2Abi, LiquidTokenAbi, LiquidUniv4EthDevBuyAbi, LiquidVaultAbi, type LockerConfig, type MarketCapTranche, type MarketCapTrancheUSD, type MevModuleConfig, POOL_POSITIONS, type PoolConfig, type PoolDynamicConfigVars, type PoolDynamicFeeVars, type PoolKey, type PoolPosition, type PositionArrays, type PositionConfig, type SniperAuctionConfig, type SniperAuctionFeeConfig, type SniperAuctionState, type SocialMediaUrl, TOKEN, type TokenConfig, type TokenCreatedEvent, type TokenRewardInfo, type VaultAllocation, type VaultExtensionParams, buildContext, buildMetadata, createDefaultPositions, createPositions, createPositionsUSD, describePositions, encodeDynamicFeePoolData, encodeFeeConversionLockerData, encodeSniperAuctionData, encodeStaticFeePoolData, getTickFromMarketCapETH, getTickFromMarketCapStable, getTickFromMarketCapUSD, marketCapFromTickETH, marketCapFromTickUSD, parseContext, parseMetadata };
2598
+ export { ADDRESSES, type AirdropExtensionParams, type AirdropInfo, type BidInAuctionParams, type BidInAuctionResult, DEFAULTS, DEFAULT_CHAIN, DEFAULT_CHAIN_ID, DEFAULT_RPC_URL, DEFAULT_TRANCHES_USD, type DeployTokenParams, type DeployTokenResult, type DeploymentConfig, type DeploymentInfo, type DevBuyParams, type DynamicFeeConfig, ERC20Abi, EXTERNAL, type ExtensionConfig, FEE, FeePreference, type GetTokensOptions, LiquidAirdropV2Abi, type LiquidContext, LiquidFactoryAbi, LiquidFeeLockerAbi, LiquidHookDynamicFeeV2Abi, LiquidLpLockerAbi, type LiquidMetadata, LiquidMevBlockDelayAbi, LiquidMevDescendingFeesAbi, LiquidPoolExtensionAllowlistAbi, LiquidSDK, type LiquidSDKConfig, LiquidSniperAuctionV2Abi, LiquidSniperUtilV2Abi, LiquidTokenAbi, LiquidUniv4EthDevBuyAbi, LiquidVaultAbi, type LockerConfig, type MarketCapTranche, type MarketCapTrancheUSD, type MevModuleConfig, POOL_POSITIONS, type PoolConfig, type PoolDynamicConfigVars, type PoolDynamicFeeVars, type PoolKey, type PoolPosition, type PositionArrays, type PositionConfig, type SniperAuctionConfig, type SniperAuctionFeeConfig, type SniperAuctionState, type SocialMediaUrl, TOKEN, type TokenConfig, type TokenCreatedEvent, type TokenRewardInfo, type VaultAllocation, type VaultExtensionParams, buildContext, buildMetadata, createDefaultPositions, createPositions, createPositionsUSD, describePositions, encodeDynamicFeePoolData, encodeFeeConversionLockerData, encodeSniperAuctionData, encodeStaticFeePoolData, getTickFromMarketCapETH, getTickFromMarketCapStable, getTickFromMarketCapUSD, marketCapFromTickETH, marketCapFromTickUSD, parseContext, parseMetadata };
package/dist/index.d.ts CHANGED
@@ -63,6 +63,21 @@ interface VaultExtensionParams {
63
63
  /** Vesting duration in seconds after lockup ends (0 = no vesting, tokens unlock all at once) */
64
64
  vestingDuration?: number;
65
65
  }
66
+ interface AirdropExtensionParams {
67
+ /** Address allowed to `updateAdmin`, `updateMerkleRoot` (under conditions),
68
+ * and `adminClaim` the remainder after claim expiration. */
69
+ admin: Address;
70
+ /** Merkle root over leaves `keccak256(bytes.concat(keccak256(abi.encode(
71
+ * recipient, allocatedAmount))))`. Double-hashed per OZ convention. */
72
+ merkleRoot: Hex;
73
+ /** Percentage of supply to reserve for the airdrop, in BPS (1–9000). */
74
+ allocationBps: number;
75
+ /** Lockup in seconds before any recipient can claim. Min 86400 (1 day). */
76
+ lockupDuration: number;
77
+ /** Linear vesting after lockup. 0 = instant claim of full entitlement at
78
+ * lockup end. */
79
+ vestingDuration?: number;
80
+ }
66
81
  interface DeployTokenParams {
67
82
  name: string;
68
83
  symbol: string;
@@ -270,6 +285,29 @@ declare class LiquidSDK {
270
285
  * ```
271
286
  */
272
287
  buildVaultExtension(vault: VaultExtensionParams): ExtensionConfig;
288
+ /**
289
+ * Build an ExtensionConfig that reserves a percentage of supply into
290
+ * the LiquidAirdropV2 contract for merkle-tree-based distribution.
291
+ *
292
+ * The airdrop contract expects `AirdropV2ExtensionData`:
293
+ * { address admin, bytes32 merkleRoot, uint256 lockupDuration, uint256 vestingDuration }
294
+ *
295
+ * Leaf encoding used by LiquidAirdropV2.claim (note: **double hashed**
296
+ * — OZ's standard 2nd-preimage-resistant pattern):
297
+ * leaf = keccak256(bytes.concat(keccak256(abi.encode(recipient, allocatedAmount))))
298
+ *
299
+ * @example
300
+ * ```typescript
301
+ * const airdropExt = sdk.buildAirdropExtension({
302
+ * admin: account.address,
303
+ * merkleRoot: "0x…",
304
+ * allocationBps: 2000, // 20%
305
+ * lockupDuration: 86400, // 1 day (minimum)
306
+ * vestingDuration: 0, // instant claim after lockup
307
+ * });
308
+ * ```
309
+ */
310
+ buildAirdropExtension(airdrop: AirdropExtensionParams): ExtensionConfig;
273
311
  /**
274
312
  * Validate a DeploymentConfig before sending to the contract.
275
313
  * Catches common mistakes client-side with clear error messages.
@@ -489,7 +527,7 @@ declare const POOL_POSITIONS: {
489
527
  */
490
528
  declare const DEFAULTS: {
491
529
  readonly HOOK: `0x${string}`;
492
- /** LP Locker with fee conversion (converts fees to ETH before distributing) */
530
+ /** LP Locker with fee conversion (converts fees to WETH before distributing) */
493
531
  readonly LOCKER: `0x${string}`;
494
532
  readonly TICK_SPACING: 200;
495
533
  readonly TICK_IF_TOKEN0_IS_LIQUID: -230400;
@@ -2496,7 +2534,7 @@ declare enum FeePreference {
2496
2534
  *
2497
2535
  * @example
2498
2536
  * ```ts
2499
- * // Single recipient, fees converted to ETH
2537
+ * // Single recipient, fees converted to WETH
2500
2538
  * const lockerData = encodeFeeConversionLockerData([FeePreference.Paired]);
2501
2539
  *
2502
2540
  * // Two recipients: first gets ETH, second gets the token
@@ -2557,4 +2595,4 @@ declare function parseContext(contextString: string): LiquidContext | null;
2557
2595
  */
2558
2596
  declare function parseMetadata(metadataString: string): LiquidMetadata | null;
2559
2597
 
2560
- export { ADDRESSES, type AirdropInfo, type BidInAuctionParams, type BidInAuctionResult, DEFAULTS, DEFAULT_CHAIN, DEFAULT_CHAIN_ID, DEFAULT_RPC_URL, DEFAULT_TRANCHES_USD, type DeployTokenParams, type DeployTokenResult, type DeploymentConfig, type DeploymentInfo, type DevBuyParams, type DynamicFeeConfig, ERC20Abi, EXTERNAL, type ExtensionConfig, FEE, FeePreference, type GetTokensOptions, LiquidAirdropV2Abi, type LiquidContext, LiquidFactoryAbi, LiquidFeeLockerAbi, LiquidHookDynamicFeeV2Abi, LiquidLpLockerAbi, type LiquidMetadata, LiquidMevBlockDelayAbi, LiquidMevDescendingFeesAbi, LiquidPoolExtensionAllowlistAbi, LiquidSDK, type LiquidSDKConfig, LiquidSniperAuctionV2Abi, LiquidSniperUtilV2Abi, LiquidTokenAbi, LiquidUniv4EthDevBuyAbi, LiquidVaultAbi, type LockerConfig, type MarketCapTranche, type MarketCapTrancheUSD, type MevModuleConfig, POOL_POSITIONS, type PoolConfig, type PoolDynamicConfigVars, type PoolDynamicFeeVars, type PoolKey, type PoolPosition, type PositionArrays, type PositionConfig, type SniperAuctionConfig, type SniperAuctionFeeConfig, type SniperAuctionState, type SocialMediaUrl, TOKEN, type TokenConfig, type TokenCreatedEvent, type TokenRewardInfo, type VaultAllocation, type VaultExtensionParams, buildContext, buildMetadata, createDefaultPositions, createPositions, createPositionsUSD, describePositions, encodeDynamicFeePoolData, encodeFeeConversionLockerData, encodeSniperAuctionData, encodeStaticFeePoolData, getTickFromMarketCapETH, getTickFromMarketCapStable, getTickFromMarketCapUSD, marketCapFromTickETH, marketCapFromTickUSD, parseContext, parseMetadata };
2598
+ export { ADDRESSES, type AirdropExtensionParams, type AirdropInfo, type BidInAuctionParams, type BidInAuctionResult, DEFAULTS, DEFAULT_CHAIN, DEFAULT_CHAIN_ID, DEFAULT_RPC_URL, DEFAULT_TRANCHES_USD, type DeployTokenParams, type DeployTokenResult, type DeploymentConfig, type DeploymentInfo, type DevBuyParams, type DynamicFeeConfig, ERC20Abi, EXTERNAL, type ExtensionConfig, FEE, FeePreference, type GetTokensOptions, LiquidAirdropV2Abi, type LiquidContext, LiquidFactoryAbi, LiquidFeeLockerAbi, LiquidHookDynamicFeeV2Abi, LiquidLpLockerAbi, type LiquidMetadata, LiquidMevBlockDelayAbi, LiquidMevDescendingFeesAbi, LiquidPoolExtensionAllowlistAbi, LiquidSDK, type LiquidSDKConfig, LiquidSniperAuctionV2Abi, LiquidSniperUtilV2Abi, LiquidTokenAbi, LiquidUniv4EthDevBuyAbi, LiquidVaultAbi, type LockerConfig, type MarketCapTranche, type MarketCapTrancheUSD, type MevModuleConfig, POOL_POSITIONS, type PoolConfig, type PoolDynamicConfigVars, type PoolDynamicFeeVars, type PoolKey, type PoolPosition, type PositionArrays, type PositionConfig, type SniperAuctionConfig, type SniperAuctionFeeConfig, type SniperAuctionState, type SocialMediaUrl, TOKEN, type TokenConfig, type TokenCreatedEvent, type TokenRewardInfo, type VaultAllocation, type VaultExtensionParams, buildContext, buildMetadata, createDefaultPositions, createPositions, createPositionsUSD, describePositions, encodeDynamicFeePoolData, encodeFeeConversionLockerData, encodeSniperAuctionData, encodeStaticFeePoolData, getTickFromMarketCapETH, getTickFromMarketCapStable, getTickFromMarketCapUSD, marketCapFromTickETH, marketCapFromTickUSD, parseContext, parseMetadata };