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/AGENT_README.md +36 -99
- package/CHANGELOG.md +12 -0
- package/README.md +119 -239
- package/dist/index.d.mts +41 -3
- package/dist/index.d.ts +41 -3
- package/dist/index.js +83 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +83 -2
- package/dist/index.mjs.map +1 -1
- package/llms.txt +3 -3
- package/package.json +1 -1
- package/skills/deploy-token.md +1 -1
- package/skills/index-tokens.md +2 -2
- package/skills/sdk-overview.md +8 -8
package/AGENT_README.md
CHANGED
|
@@ -54,7 +54,7 @@ Requires wallet. Creates the token, pool, locks LP, and optionally buys tokens a
|
|
|
54
54
|
const result = await sdk.deployToken({
|
|
55
55
|
name: "My Token",
|
|
56
56
|
symbol: "MTK",
|
|
57
|
-
image: "
|
|
57
|
+
image: "https://example.com/logo.png", // optional
|
|
58
58
|
metadata: '{"description":"A cool token"}', // optional, JSON string
|
|
59
59
|
context: '{"platform":"my-app"}', // optional, tracking/attribution
|
|
60
60
|
|
|
@@ -100,27 +100,27 @@ const ext = sdk.buildDevBuyExtension({
|
|
|
100
100
|
|
|
101
101
|
Tokens generate LP fees from Uniswap V4 trading. These accrue in the Fee Locker and can be claimed by the fee owner.
|
|
102
102
|
|
|
103
|
-
#### `sdk.getAvailableFees(feeOwner,
|
|
103
|
+
#### `sdk.getAvailableFees(feeOwner, feeToken?)` — Check total unlocked fees
|
|
104
104
|
|
|
105
105
|
```typescript
|
|
106
|
-
const fees = await sdk.getAvailableFees(ownerAddress
|
|
107
|
-
// fees: bigint — total fees available
|
|
106
|
+
const fees = await sdk.getAvailableFees(ownerAddress);
|
|
107
|
+
// fees: bigint — total fees available, defaulting to WETH-denominated claims
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
-
#### `sdk.getFeesToClaim(feeOwner,
|
|
110
|
+
#### `sdk.getFeesToClaim(feeOwner, feeToken?)` — Check claimable fees
|
|
111
111
|
|
|
112
112
|
```typescript
|
|
113
|
-
const claimable = await sdk.getFeesToClaim(ownerAddress
|
|
114
|
-
// claimable: bigint — fees ready to claim right now
|
|
113
|
+
const claimable = await sdk.getFeesToClaim(ownerAddress);
|
|
114
|
+
// claimable: bigint — fees ready to claim right now (WETH by default)
|
|
115
115
|
```
|
|
116
116
|
|
|
117
|
-
#### `sdk.claimFees(feeOwner,
|
|
117
|
+
#### `sdk.claimFees(feeOwner, feeToken?)` — Claim fees
|
|
118
118
|
|
|
119
119
|
Requires wallet.
|
|
120
120
|
|
|
121
121
|
```typescript
|
|
122
122
|
if (claimable > 0n) {
|
|
123
|
-
const txHash = await sdk.claimFees(ownerAddress
|
|
123
|
+
const txHash = await sdk.claimFees(ownerAddress);
|
|
124
124
|
await publicClient.waitForTransactionReceipt({ hash: txHash });
|
|
125
125
|
}
|
|
126
126
|
```
|
|
@@ -284,49 +284,6 @@ const deploy = await sdk.getDeploymentInfo(tokenAddress);
|
|
|
284
284
|
|
|
285
285
|
---
|
|
286
286
|
|
|
287
|
-
### Token Discovery
|
|
288
|
-
|
|
289
|
-
#### `sdk.getTokens(options?)` — Query all deployed tokens
|
|
290
|
-
|
|
291
|
-
Query TokenCreated events with optional filtering. For wallet integrations, token listings, and indexing.
|
|
292
|
-
|
|
293
|
-
```typescript
|
|
294
|
-
// Get all tokens
|
|
295
|
-
const allTokens = await sdk.getTokens();
|
|
296
|
-
|
|
297
|
-
// Get tokens by deployer
|
|
298
|
-
const myTokens = await sdk.getTokens({ deployer: myAddress });
|
|
299
|
-
|
|
300
|
-
// Paginate with block ranges
|
|
301
|
-
const page1 = await sdk.getTokens({ fromBlock: 20000000n, toBlock: 20100000n });
|
|
302
|
-
const page2 = await sdk.getTokens({ fromBlock: 20100001n });
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
Each result includes full on-chain event data: name, symbol, image, metadata, context, poolId, hook, locker, extensions, and `blockNumber` for cursor-based pagination.
|
|
306
|
-
|
|
307
|
-
#### `sdk.getTokenEvent(tokenAddress)` — Look up a single token's event data
|
|
308
|
-
|
|
309
|
-
Fast lookup by contract address (tokenAddress is indexed on-chain = single RPC call).
|
|
310
|
-
|
|
311
|
-
```typescript
|
|
312
|
-
const event = await sdk.getTokenEvent(tokenAddress);
|
|
313
|
-
// event.tokenName, event.tokenSymbol, event.tokenImage
|
|
314
|
-
// event.tokenMetadata — parse with parseMetadata()
|
|
315
|
-
// event.tokenContext — parse with parseContext()
|
|
316
|
-
// event.poolId, event.poolHook, event.locker, event.extensions
|
|
317
|
-
// event.blockNumber
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
#### `sdk.getDeployedTokens(deployer, fromBlock?, toBlock?)` — Get tokens by deployer
|
|
321
|
-
|
|
322
|
-
Convenience wrapper around `getTokens({ deployer })`.
|
|
323
|
-
|
|
324
|
-
```typescript
|
|
325
|
-
const tokens = await sdk.getDeployedTokens(deployerAddress);
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
---
|
|
329
|
-
|
|
330
287
|
### Token Metadata Updates
|
|
331
288
|
|
|
332
289
|
#### `sdk.updateImage(tokenAddress, newImageUrl)` — Update token image
|
|
@@ -428,31 +385,10 @@ const maxRounds = await sdk.getAuctionMaxRounds();
|
|
|
428
385
|
```typescript
|
|
429
386
|
const gasPrice = await sdk.getAuctionGasPriceForBid(
|
|
430
387
|
auction.gasPeg,
|
|
431
|
-
parseEther("
|
|
388
|
+
parseEther("1"), // desired bid
|
|
432
389
|
);
|
|
433
390
|
```
|
|
434
391
|
|
|
435
|
-
#### `sdk.bidInAuction(params, gasPrice)` — Bid in auction and swap tokens
|
|
436
|
-
|
|
437
|
-
Requires wallet. Auto-wraps ETH → WETH and approves SniperUtilV2 if needed. Sets gas manually (800K) and both `maxFeePerGas`/`maxPriorityFeePerGas` to the auction gas price.
|
|
438
|
-
|
|
439
|
-
```typescript
|
|
440
|
-
const rewards = await sdk.getTokenRewards(tokenAddress);
|
|
441
|
-
const zeroForOne = rewards.poolKey.currency0.toLowerCase() === EXTERNAL.WETH.toLowerCase();
|
|
442
|
-
|
|
443
|
-
const result = await sdk.bidInAuction({
|
|
444
|
-
poolKey: rewards.poolKey,
|
|
445
|
-
zeroForOne, // depends on token sort order vs WETH
|
|
446
|
-
amountIn: parseEther("0.001"), // WETH to swap (auto-wrapped from ETH)
|
|
447
|
-
amountOutMinimum: 0n, // set slippage in production
|
|
448
|
-
round: auction.round, // must match current on-chain round
|
|
449
|
-
bidAmount: parseEther("0.0005"), // ETH bid (sent as msg.value)
|
|
450
|
-
}, gasPrice);
|
|
451
|
-
// result.txHash — transaction hash
|
|
452
|
-
```
|
|
453
|
-
|
|
454
|
-
**Important:** The bid is valid only at `nextAuctionBlock`. Submit when `currentBlock === nextAuctionBlock - 1`. The `amountIn` is pulled from your WETH balance (separate from the bid's `msg.value`). Auction runs 5 rounds, every 2 blocks, starting 2 blocks after deployment.
|
|
455
|
-
|
|
456
392
|
---
|
|
457
393
|
|
|
458
394
|
### MEV Protection
|
|
@@ -506,20 +442,20 @@ When calling `deployToken`, all fields except `name` and `symbol` are optional.
|
|
|
506
442
|
| `salt` | `keccak256(name + symbol + timestamp)` | Unique per deploy |
|
|
507
443
|
| `image` | `""` | Empty string |
|
|
508
444
|
| `metadata` | `""` | Empty string |
|
|
509
|
-
| `context` | `
|
|
510
|
-
| `hook` | `ADDRESSES.
|
|
445
|
+
| `context` | `""` | Empty string |
|
|
446
|
+
| `hook` | `ADDRESSES.HOOK_DYNAMIC_FEE_V2` | Dynamic fee model |
|
|
511
447
|
| `pairedToken` | `EXTERNAL.WETH` | Base WETH |
|
|
512
|
-
| `tickIfToken0IsLiquid` | `-
|
|
513
|
-
| `tickSpacing` | `
|
|
514
|
-
| `poolData` | `
|
|
515
|
-
| `locker` | `ADDRESSES.
|
|
448
|
+
| `tickIfToken0IsLiquid` | `-198720` | Starting price tick |
|
|
449
|
+
| `tickSpacing` | `60` | Uniswap V4 tick spacing |
|
|
450
|
+
| `poolData` | `"0x"` | Hook uses its default fee config |
|
|
451
|
+
| `locker` | `ADDRESSES.LP_LOCKER` | Standard LP locker |
|
|
516
452
|
| `rewardAdmins` | `[walletAddress]` | Deployer is admin |
|
|
517
453
|
| `rewardRecipients` | `[walletAddress]` | Deployer gets rewards |
|
|
518
454
|
| `rewardBps` | `[10000]` | 100% to deployer |
|
|
519
|
-
| `tickLower` | `[-
|
|
520
|
-
| `tickUpper` | `[
|
|
521
|
-
| `positionBps` | `[
|
|
522
|
-
| `mevModule` | `ADDRESSES.
|
|
455
|
+
| `tickLower` | `[-887220]` | Full-range lower |
|
|
456
|
+
| `tickUpper` | `[887220]` | Full-range upper |
|
|
457
|
+
| `positionBps` | `[10000]` | Single position, 100% |
|
|
458
|
+
| `mevModule` | `ADDRESSES.MEV_BLOCK_DELAY` | MEV protection on |
|
|
523
459
|
| `extensions` | `[]` | No extensions |
|
|
524
460
|
|
|
525
461
|
---
|
|
@@ -532,18 +468,19 @@ All addresses are exported as `ADDRESSES` and `EXTERNAL`:
|
|
|
532
468
|
import { ADDRESSES, EXTERNAL } from "liquid-sdk";
|
|
533
469
|
|
|
534
470
|
// Liquid Protocol contracts
|
|
535
|
-
ADDRESSES.FACTORY //
|
|
536
|
-
ADDRESSES.
|
|
537
|
-
ADDRESSES.FEE_LOCKER //
|
|
538
|
-
ADDRESSES.VAULT //
|
|
539
|
-
ADDRESSES.HOOK_DYNAMIC_FEE_V2 //
|
|
540
|
-
ADDRESSES.HOOK_STATIC_FEE_V2 //
|
|
541
|
-
ADDRESSES.AIRDROP_V2 //
|
|
542
|
-
ADDRESSES.SNIPER_AUCTION_V2 //
|
|
543
|
-
ADDRESSES.SNIPER_UTIL_V2 //
|
|
544
|
-
ADDRESSES.
|
|
545
|
-
ADDRESSES.UNIV4_ETH_DEV_BUY //
|
|
546
|
-
ADDRESSES.POOL_EXTENSION_ALLOWLIST //
|
|
471
|
+
ADDRESSES.FACTORY // 0x0000003482fe299E72d4908368044A8A173BE576
|
|
472
|
+
ADDRESSES.LP_LOCKER // 0x00000548732DfA56Be1257cE44D0CFc3B46dDb2A
|
|
473
|
+
ADDRESSES.FEE_LOCKER // 0x000008B9242b7e4432f6c4b1EeAD93562f9Cc94d
|
|
474
|
+
ADDRESSES.VAULT // 0x000001c5263F4d64CdC343cDA9C8bF961CF8376c
|
|
475
|
+
ADDRESSES.HOOK_DYNAMIC_FEE_V2 // 0x2A2F73CDDa098d639bd8Bbcd7dF2bf24E06728cC
|
|
476
|
+
ADDRESSES.HOOK_STATIC_FEE_V2 // 0xb2401c5369AaCF62F8d615623C7F68F84da428Cc
|
|
477
|
+
ADDRESSES.AIRDROP_V2 // 0x00000C222442512b08446D33dd9754a7F260BE79
|
|
478
|
+
ADDRESSES.SNIPER_AUCTION_V2 // 0x000007b64003ee07a69576F98859a0a36b854260
|
|
479
|
+
ADDRESSES.SNIPER_UTIL_V2 // 0x000003Ee0cb9B0C82C6C7FCB7b81a9883F285270
|
|
480
|
+
ADDRESSES.MEV_BLOCK_DELAY // 0x0000035D83588954F3c581c3A66251b3F06AD5e4
|
|
481
|
+
ADDRESSES.UNIV4_ETH_DEV_BUY // 0x00000d7DE1f0A3FA7957F5d8A2b97B0E24e5783D
|
|
482
|
+
ADDRESSES.POOL_EXTENSION_ALLOWLIST // 0x000003Afb1b070F037D2871eE0A6b8c8f53F7B77
|
|
483
|
+
ADDRESSES.LIQUID_DEPLOYER_LIB // 0x00000f88b2d37A2006F2F0C8552d22E0b8945202
|
|
547
484
|
|
|
548
485
|
// External (Uniswap V4 / Base)
|
|
549
486
|
EXTERNAL.POOL_MANAGER // 0x498581fF718922c3f8e6A244956aF099B2652b2b
|
|
@@ -642,7 +579,7 @@ const sdk = new LiquidSDK({ publicClient, walletClient });
|
|
|
642
579
|
const result = await sdk.deployToken({
|
|
643
580
|
name: "Agent Token",
|
|
644
581
|
symbol: "AGENT",
|
|
645
|
-
image: "
|
|
582
|
+
image: "https://example.com/logo.png",
|
|
646
583
|
metadata: JSON.stringify({ description: "Deployed by an AI agent" }),
|
|
647
584
|
devBuy: {
|
|
648
585
|
ethAmount: parseEther("0.01"),
|
|
@@ -681,11 +618,11 @@ if (now < unlockTime) {
|
|
|
681
618
|
### 3. Check and claim fees
|
|
682
619
|
|
|
683
620
|
```typescript
|
|
684
|
-
const fees = await sdk.getFeesToClaim(ownerAddress
|
|
621
|
+
const fees = await sdk.getFeesToClaim(ownerAddress);
|
|
685
622
|
console.log("Claimable fees:", fees);
|
|
686
623
|
|
|
687
624
|
if (fees > 0n) {
|
|
688
|
-
const txHash = await sdk.claimFees(ownerAddress
|
|
625
|
+
const txHash = await sdk.claimFees(ownerAddress);
|
|
689
626
|
const receipt = await publicClient.waitForTransactionReceipt({ hash: txHash });
|
|
690
627
|
console.log("Fees claimed in tx:", receipt.transactionHash);
|
|
691
628
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `liquid-sdk` will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.7.3] - 2026-04-22
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- `buildAirdropExtension({ admin, merkleRoot, allocationBps, lockupDuration, vestingDuration })` — creates a `LiquidAirdropV2` extension config for use in `deployToken({ extensions: [...] })`. Double-hashed leaf format compatible with OpenZeppelin `MerkleProof`. Contract minimums enforced (1-day lockup, ≤90% allocation).
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- `deployToken` no longer uses a hard-coded `gas: 5_000_000n` — real mainnet deploys currently require ~5.04M gas. Now uses `estimateContractGas * 1.2` with a 6M fallback so the SDK auto-adjusts as the factory evolves. Previous versions could OOG on mainnet.
|
|
12
|
+
|
|
13
|
+
### Verified
|
|
14
|
+
- End-to-end airdrop flow fork-tested against Base mainnet (real `LiquidAirdropV2` at `0x1423974d48f525462f1c087cBFdCC20BDBc33CdD`): deploy → state register → claim with single-leaf proof all confirmed.
|
|
15
|
+
- Mainnet dry-run deploy confirmed on-chain state encoding: [basescan tx](https://basescan.org/tx/0x1807c1e3eb92ccb0c32779855cd35d5581e6143d4232f4ab66d39517ee86e3d0).
|
|
16
|
+
|
|
5
17
|
## [1.2.0] - 2025-03-10
|
|
6
18
|
|
|
7
19
|
### Added
|