liquid-sdk 1.3.1 → 1.4.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 CHANGED
@@ -13,25 +13,20 @@ npm install liquid-sdk viem
13
13
  ## Quick Start
14
14
 
15
15
  ```typescript
16
- import { createPublicClient, createWalletClient, http } from "viem";
16
+ import { createWalletClient, http } from "viem";
17
17
  import { privateKeyToAccount } from "viem/accounts";
18
18
  import { base } from "viem/chains";
19
19
  import { LiquidSDK } from "liquid-sdk";
20
20
 
21
21
  const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
22
22
 
23
- const publicClient = createPublicClient({
24
- chain: base,
25
- transport: http(),
26
- });
27
-
28
23
  const walletClient = createWalletClient({
29
24
  account,
30
25
  chain: base,
31
26
  transport: http(),
32
27
  });
33
28
 
34
- const liquid = new LiquidSDK({ publicClient, walletClient });
29
+ const liquid = new LiquidSDK({ walletClient });
35
30
  ```
36
31
 
37
32
  ## Deploy a Token
@@ -219,11 +214,11 @@ import {
219
214
  #### Constructor
220
215
 
221
216
  ```typescript
222
- new LiquidSDK({ publicClient, walletClient? })
217
+ new LiquidSDK({ walletClient, publicClient? })
223
218
  ```
224
219
 
225
- - `publicClient` (required) - viem `PublicClient` connected to Base
226
220
  - `walletClient` (optional) - viem `WalletClient` for write operations
221
+ - `publicClient` (optional) - viem `PublicClient` connected to Base (auto-created if omitted)
227
222
 
228
223
  #### Methods
229
224
 
package/dist/index.d.mts CHANGED
@@ -194,7 +194,7 @@ interface TokenRewardInfo {
194
194
  rewardRecipients: Address[];
195
195
  }
196
196
  interface LiquidSDKConfig {
197
- publicClient: any;
197
+ publicClient?: any;
198
198
  walletClient?: any;
199
199
  }
200
200
  interface DeployTokenResult {
@@ -304,17 +304,18 @@ declare const ADDRESSES: {
304
304
  readonly FACTORY: Address;
305
305
  readonly POOL_EXTENSION_ALLOWLIST: Address;
306
306
  readonly FEE_LOCKER: Address;
307
- readonly LP_LOCKER: Address;
308
307
  readonly LP_LOCKER_FEE_CONVERSION: Address;
309
308
  readonly VAULT: Address;
310
309
  readonly HOOK_DYNAMIC_FEE_V2: Address;
311
310
  readonly HOOK_STATIC_FEE_V2: Address;
312
311
  readonly SNIPER_AUCTION_V2: Address;
313
312
  readonly SNIPER_UTIL_V2: Address;
314
- readonly MEV_BLOCK_DELAY: Address;
313
+ readonly MEV_DESCENDING_FEES: Address;
315
314
  readonly AIRDROP_V2: Address;
316
315
  readonly UNIV4_ETH_DEV_BUY: Address;
317
- readonly LIQUID_DEPLOYER_LIB: Address;
316
+ readonly UNIV3_ETH_DEV_BUY: Address;
317
+ readonly PRESALE_ETH_TO_CREATOR: Address;
318
+ readonly PRESALE_ALLOWLIST: Address;
318
319
  };
319
320
  declare const EXTERNAL: {
320
321
  readonly POOL_MANAGER: Address;
@@ -469,7 +470,31 @@ declare const DEFAULT_CHAIN: {
469
470
  formatters: {
470
471
  readonly block: {
471
472
  exclude: [] | undefined;
472
- format: (args: viem_chains.OpStackRpcBlock, action?: string | undefined) => {
473
+ format: (args: viem_chains.OpStackRpcBlock, action
474
+ /**
475
+ * Pre-built position configurations.
476
+ *
477
+ * - **Standard**: Single position covering full range (~$20K → $1.5B).
478
+ * Default starting tick -230400 (≈10 ETH market cap).
479
+ *
480
+ * - **Liquid**: 3-tranche default for Liquid Protocol.
481
+ * Hardcoded for ≈10 ETH start at ~$2070/ETH.
482
+ * For dynamic market cap targets, use `createPositionsUSD()` instead.
483
+ *
484
+ * Note: positionBps must sum to 10,000 (100%).
485
+ */
486
+ ? /**
487
+ * Pre-built position configurations.
488
+ *
489
+ * - **Standard**: Single position covering full range (~$20K → $1.5B).
490
+ * Default starting tick -230400 (≈10 ETH market cap).
491
+ *
492
+ * - **Liquid**: 3-tranche default for Liquid Protocol.
493
+ * Hardcoded for ≈10 ETH start at ~$2070/ETH.
494
+ * For dynamic market cap targets, use `createPositionsUSD()` instead.
495
+ *
496
+ * Note: positionBps must sum to 10,000 (100%).
497
+ */: string | undefined) => {
473
498
  baseFeePerGas: bigint | null;
474
499
  blobGasUsed: bigint;
475
500
  difficulty: bigint;
package/dist/index.d.ts CHANGED
@@ -194,7 +194,7 @@ interface TokenRewardInfo {
194
194
  rewardRecipients: Address[];
195
195
  }
196
196
  interface LiquidSDKConfig {
197
- publicClient: any;
197
+ publicClient?: any;
198
198
  walletClient?: any;
199
199
  }
200
200
  interface DeployTokenResult {
@@ -304,17 +304,18 @@ declare const ADDRESSES: {
304
304
  readonly FACTORY: Address;
305
305
  readonly POOL_EXTENSION_ALLOWLIST: Address;
306
306
  readonly FEE_LOCKER: Address;
307
- readonly LP_LOCKER: Address;
308
307
  readonly LP_LOCKER_FEE_CONVERSION: Address;
309
308
  readonly VAULT: Address;
310
309
  readonly HOOK_DYNAMIC_FEE_V2: Address;
311
310
  readonly HOOK_STATIC_FEE_V2: Address;
312
311
  readonly SNIPER_AUCTION_V2: Address;
313
312
  readonly SNIPER_UTIL_V2: Address;
314
- readonly MEV_BLOCK_DELAY: Address;
313
+ readonly MEV_DESCENDING_FEES: Address;
315
314
  readonly AIRDROP_V2: Address;
316
315
  readonly UNIV4_ETH_DEV_BUY: Address;
317
- readonly LIQUID_DEPLOYER_LIB: Address;
316
+ readonly UNIV3_ETH_DEV_BUY: Address;
317
+ readonly PRESALE_ETH_TO_CREATOR: Address;
318
+ readonly PRESALE_ALLOWLIST: Address;
318
319
  };
319
320
  declare const EXTERNAL: {
320
321
  readonly POOL_MANAGER: Address;
@@ -469,7 +470,31 @@ declare const DEFAULT_CHAIN: {
469
470
  formatters: {
470
471
  readonly block: {
471
472
  exclude: [] | undefined;
472
- format: (args: viem_chains.OpStackRpcBlock, action?: string | undefined) => {
473
+ format: (args: viem_chains.OpStackRpcBlock, action
474
+ /**
475
+ * Pre-built position configurations.
476
+ *
477
+ * - **Standard**: Single position covering full range (~$20K → $1.5B).
478
+ * Default starting tick -230400 (≈10 ETH market cap).
479
+ *
480
+ * - **Liquid**: 3-tranche default for Liquid Protocol.
481
+ * Hardcoded for ≈10 ETH start at ~$2070/ETH.
482
+ * For dynamic market cap targets, use `createPositionsUSD()` instead.
483
+ *
484
+ * Note: positionBps must sum to 10,000 (100%).
485
+ */
486
+ ? /**
487
+ * Pre-built position configurations.
488
+ *
489
+ * - **Standard**: Single position covering full range (~$20K → $1.5B).
490
+ * Default starting tick -230400 (≈10 ETH market cap).
491
+ *
492
+ * - **Liquid**: 3-tranche default for Liquid Protocol.
493
+ * Hardcoded for ≈10 ETH start at ~$2070/ETH.
494
+ * For dynamic market cap targets, use `createPositionsUSD()` instead.
495
+ *
496
+ * Note: positionBps must sum to 10,000 (100%).
497
+ */: string | undefined) => {
473
498
  baseFeePerGas: bigint | null;
474
499
  blobGasUsed: bigint;
475
500
  difficulty: bigint;
package/dist/index.js CHANGED
@@ -72,20 +72,21 @@ var import_chains2 = require("viem/chains");
72
72
  // src/constants.ts
73
73
  var import_chains = require("viem/chains");
74
74
  var ADDRESSES = {
75
- FACTORY: "0x0000003482fe299E72d4908368044A8A173BE576",
76
- POOL_EXTENSION_ALLOWLIST: "0x000003Afb1b070F037D2871eE0A6b8c8f53F7B77",
77
- FEE_LOCKER: "0x000008B9242b7e4432f6c4b1EeAD93562f9Cc94d",
78
- LP_LOCKER: "0x00000548732DfA56Be1257cE44D0CFc3B46dDb2A",
79
- LP_LOCKER_FEE_CONVERSION: "0x00000547518784420CEeF761fb18D884bb908102",
80
- VAULT: "0x000001c5263F4d64CdC343cDA9C8bF961CF8376c",
81
- HOOK_DYNAMIC_FEE_V2: "0x2A2F73CDDa098d639bd8Bbcd7dF2bf24E06728cC",
82
- HOOK_STATIC_FEE_V2: "0xb2401c5369AaCF62F8d615623C7F68F84da428Cc",
83
- SNIPER_AUCTION_V2: "0x000007b64003ee07a69576F98859a0a36b854260",
84
- SNIPER_UTIL_V2: "0x000003Ee0cb9B0C82C6C7FCB7b81a9883F285270",
85
- MEV_BLOCK_DELAY: "0x0000035D83588954F3c581c3A66251b3F06AD5e4",
86
- AIRDROP_V2: "0x00000C222442512b08446D33dd9754a7F260BE79",
87
- UNIV4_ETH_DEV_BUY: "0x00000d7DE1f0A3FA7957F5d8A2b97B0E24e5783D",
88
- LIQUID_DEPLOYER_LIB: "0x00000f88b2d37A2006F2F0C8552d22E0b8945202"
75
+ FACTORY: "0x04F1a284168743759BE6554f607a10CEBdB77760",
76
+ POOL_EXTENSION_ALLOWLIST: "0xb614167d79aDBaA9BA35d05fE1d5542d7316Ccaa",
77
+ FEE_LOCKER: "0xF7d3BE3FC0de76fA5550C29A8F6fa53667B876FF",
78
+ LP_LOCKER_FEE_CONVERSION: "0x77247fCD1d5e34A3703AcA898A591Dc7422435f3",
79
+ VAULT: "0xdFCCC93257c20519A9005A2281CFBdF84836d50E",
80
+ HOOK_DYNAMIC_FEE_V2: "0x80E2F7dC8C2C880BbC4BDF80A5Fb0eB8B1DB68CC",
81
+ HOOK_STATIC_FEE_V2: "0x9811f10Cd549c754Fa9E5785989c422A762c28cc",
82
+ SNIPER_AUCTION_V2: "0x187e8627c02c58F31831953C1268e157d3BfCefd",
83
+ SNIPER_UTIL_V2: "0x2B6cd5Be183c388Dd0074d53c52317df1414cd9f",
84
+ MEV_DESCENDING_FEES: "0x8D6B080e48756A99F3893491D556B5d6907b6910",
85
+ AIRDROP_V2: "0x1423974d48f525462f1c087cBFdCC20BDBc33CdD",
86
+ UNIV4_ETH_DEV_BUY: "0x5934097864dC487D21A7B4e4EEe201A39ceF728D",
87
+ UNIV3_ETH_DEV_BUY: "0x376028cfb6b9A120E24Aa14c3FAc4205179c0025",
88
+ PRESALE_ETH_TO_CREATOR: "0x3bca63EcB49d5f917092d10fA879Fdb422740163",
89
+ PRESALE_ALLOWLIST: "0xCBb4ccC4B94E23233c14759f4F9629F7dD01f10B"
89
90
  };
90
91
  var EXTERNAL = {
91
92
  POOL_MANAGER: "0x498581fF718922c3f8e6A244956aF099B2652b2b",
@@ -1082,7 +1083,10 @@ var LiquidSDK = class {
1082
1083
  publicClient;
1083
1084
  walletClient;
1084
1085
  constructor(config) {
1085
- this.publicClient = config.publicClient;
1086
+ this.publicClient = config.publicClient ?? (0, import_viem2.createPublicClient)({
1087
+ chain: import_chains2.base,
1088
+ transport: (0, import_viem2.http)()
1089
+ });
1086
1090
  this.walletClient = config.walletClient;
1087
1091
  }
1088
1092
  // ── Dev Buy Helper ───────────────────────────────────────────────
@@ -1734,14 +1738,14 @@ var LiquidSDK = class {
1734
1738
  // ── MEV Block Delay ─────────────────────────────────────────────────
1735
1739
  async getMevBlockDelay() {
1736
1740
  return await this.publicClient.readContract({
1737
- address: ADDRESSES.MEV_BLOCK_DELAY,
1741
+ address: ADDRESSES.MEV_DESCENDING_FEES,
1738
1742
  abi: LiquidMevBlockDelayAbi,
1739
1743
  functionName: "blockDelay"
1740
1744
  });
1741
1745
  }
1742
1746
  async getPoolUnlockTime(poolId) {
1743
1747
  return await this.publicClient.readContract({
1744
- address: ADDRESSES.MEV_BLOCK_DELAY,
1748
+ address: ADDRESSES.MEV_DESCENDING_FEES,
1745
1749
  abi: LiquidMevBlockDelayAbi,
1746
1750
  functionName: "poolUnlockTime",
1747
1751
  args: [poolId]