liquid-sdk 1.3.0 → 1.3.1

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.d.mts CHANGED
@@ -2311,6 +2311,38 @@ interface SniperAuctionConfig {
2311
2311
  * ```
2312
2312
  */
2313
2313
  declare function encodeSniperAuctionData(config: SniperAuctionConfig): Hex;
2314
+ /**
2315
+ * Fee preference for LP_LOCKER_FEE_CONVERSION.
2316
+ * Determines which token each reward recipient receives their fees in.
2317
+ *
2318
+ * - `Both` (0): No conversion, fees paid in whichever token accrues
2319
+ * - `Paired` (1): Convert fees to paired token (usually WETH)
2320
+ * - `Liquid` (2): Convert fees to the liquid token
2321
+ */
2322
+ declare enum FeePreference {
2323
+ Both = 0,
2324
+ Paired = 1,
2325
+ Liquid = 2
2326
+ }
2327
+ /**
2328
+ * Encode lockerData for LP_LOCKER_FEE_CONVERSION.
2329
+ *
2330
+ * The fee conversion locker requires a `FeeIn[]` array with one entry per
2331
+ * reward recipient, specifying how each recipient wants their fees.
2332
+ *
2333
+ * @param feePreferences - Array of FeePreference values, one per reward recipient
2334
+ * @returns Encoded lockerData hex string
2335
+ *
2336
+ * @example
2337
+ * ```ts
2338
+ * // Single recipient, fees converted to ETH
2339
+ * const lockerData = encodeFeeConversionLockerData([FeePreference.Paired]);
2340
+ *
2341
+ * // Two recipients: first gets ETH, second gets the token
2342
+ * const lockerData = encodeFeeConversionLockerData([FeePreference.Paired, FeePreference.Liquid]);
2343
+ * ```
2344
+ */
2345
+ declare function encodeFeeConversionLockerData(feePreferences: FeePreference[]): Hex;
2314
2346
 
2315
2347
  /** Provenance — who launched the token and from where. */
2316
2348
  interface LiquidContext {
@@ -2364,4 +2396,4 @@ declare function parseContext(contextString: string): LiquidContext | null;
2364
2396
  */
2365
2397
  declare function parseMetadata(metadataString: string): LiquidMetadata | null;
2366
2398
 
2367
- export { ADDRESSES, type AirdropInfo, 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, type GetTokensOptions, LiquidAirdropV2Abi, type LiquidContext, LiquidFactoryAbi, LiquidFeeLockerAbi, LiquidHookDynamicFeeV2Abi, LiquidLpLockerAbi, type LiquidMetadata, LiquidMevBlockDelayAbi, 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, buildContext, buildMetadata, createDefaultPositions, createPositions, createPositionsUSD, describePositions, encodeDynamicFeePoolData, encodeSniperAuctionData, encodeStaticFeePoolData, getTickFromMarketCapETH, getTickFromMarketCapStable, getTickFromMarketCapUSD, marketCapFromTickETH, marketCapFromTickUSD, parseContext, parseMetadata };
2399
+ export { ADDRESSES, type AirdropInfo, 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, 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, buildContext, buildMetadata, createDefaultPositions, createPositions, createPositionsUSD, describePositions, encodeDynamicFeePoolData, encodeFeeConversionLockerData, encodeSniperAuctionData, encodeStaticFeePoolData, getTickFromMarketCapETH, getTickFromMarketCapStable, getTickFromMarketCapUSD, marketCapFromTickETH, marketCapFromTickUSD, parseContext, parseMetadata };
package/dist/index.d.ts CHANGED
@@ -2311,6 +2311,38 @@ interface SniperAuctionConfig {
2311
2311
  * ```
2312
2312
  */
2313
2313
  declare function encodeSniperAuctionData(config: SniperAuctionConfig): Hex;
2314
+ /**
2315
+ * Fee preference for LP_LOCKER_FEE_CONVERSION.
2316
+ * Determines which token each reward recipient receives their fees in.
2317
+ *
2318
+ * - `Both` (0): No conversion, fees paid in whichever token accrues
2319
+ * - `Paired` (1): Convert fees to paired token (usually WETH)
2320
+ * - `Liquid` (2): Convert fees to the liquid token
2321
+ */
2322
+ declare enum FeePreference {
2323
+ Both = 0,
2324
+ Paired = 1,
2325
+ Liquid = 2
2326
+ }
2327
+ /**
2328
+ * Encode lockerData for LP_LOCKER_FEE_CONVERSION.
2329
+ *
2330
+ * The fee conversion locker requires a `FeeIn[]` array with one entry per
2331
+ * reward recipient, specifying how each recipient wants their fees.
2332
+ *
2333
+ * @param feePreferences - Array of FeePreference values, one per reward recipient
2334
+ * @returns Encoded lockerData hex string
2335
+ *
2336
+ * @example
2337
+ * ```ts
2338
+ * // Single recipient, fees converted to ETH
2339
+ * const lockerData = encodeFeeConversionLockerData([FeePreference.Paired]);
2340
+ *
2341
+ * // Two recipients: first gets ETH, second gets the token
2342
+ * const lockerData = encodeFeeConversionLockerData([FeePreference.Paired, FeePreference.Liquid]);
2343
+ * ```
2344
+ */
2345
+ declare function encodeFeeConversionLockerData(feePreferences: FeePreference[]): Hex;
2314
2346
 
2315
2347
  /** Provenance — who launched the token and from where. */
2316
2348
  interface LiquidContext {
@@ -2364,4 +2396,4 @@ declare function parseContext(contextString: string): LiquidContext | null;
2364
2396
  */
2365
2397
  declare function parseMetadata(metadataString: string): LiquidMetadata | null;
2366
2398
 
2367
- export { ADDRESSES, type AirdropInfo, 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, type GetTokensOptions, LiquidAirdropV2Abi, type LiquidContext, LiquidFactoryAbi, LiquidFeeLockerAbi, LiquidHookDynamicFeeV2Abi, LiquidLpLockerAbi, type LiquidMetadata, LiquidMevBlockDelayAbi, 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, buildContext, buildMetadata, createDefaultPositions, createPositions, createPositionsUSD, describePositions, encodeDynamicFeePoolData, encodeSniperAuctionData, encodeStaticFeePoolData, getTickFromMarketCapETH, getTickFromMarketCapStable, getTickFromMarketCapUSD, marketCapFromTickETH, marketCapFromTickUSD, parseContext, parseMetadata };
2399
+ export { ADDRESSES, type AirdropInfo, 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, 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, buildContext, buildMetadata, createDefaultPositions, createPositions, createPositionsUSD, describePositions, encodeDynamicFeePoolData, encodeFeeConversionLockerData, encodeSniperAuctionData, encodeStaticFeePoolData, getTickFromMarketCapETH, getTickFromMarketCapStable, getTickFromMarketCapUSD, marketCapFromTickETH, marketCapFromTickUSD, parseContext, parseMetadata };
package/dist/index.js CHANGED
@@ -29,6 +29,7 @@ __export(index_exports, {
29
29
  ERC20Abi: () => ERC20Abi,
30
30
  EXTERNAL: () => EXTERNAL,
31
31
  FEE: () => FEE,
32
+ FeePreference: () => FeePreference,
32
33
  LiquidAirdropV2Abi: () => LiquidAirdropV2Abi,
33
34
  LiquidFactoryAbi: () => LiquidFactoryAbi,
34
35
  LiquidFeeLockerAbi: () => LiquidFeeLockerAbi,
@@ -51,6 +52,7 @@ __export(index_exports, {
51
52
  createPositionsUSD: () => createPositionsUSD,
52
53
  describePositions: () => describePositions,
53
54
  encodeDynamicFeePoolData: () => encodeDynamicFeePoolData,
55
+ encodeFeeConversionLockerData: () => encodeFeeConversionLockerData,
54
56
  encodeSniperAuctionData: () => encodeSniperAuctionData,
55
57
  encodeStaticFeePoolData: () => encodeStaticFeePoolData,
56
58
  getTickFromMarketCapETH: () => getTickFromMarketCapETH,
@@ -260,6 +262,25 @@ function encodeSniperAuctionData(config) {
260
262
  }
261
263
  ]);
262
264
  }
265
+ var FeePreference = /* @__PURE__ */ ((FeePreference2) => {
266
+ FeePreference2[FeePreference2["Both"] = 0] = "Both";
267
+ FeePreference2[FeePreference2["Paired"] = 1] = "Paired";
268
+ FeePreference2[FeePreference2["Liquid"] = 2] = "Liquid";
269
+ return FeePreference2;
270
+ })(FeePreference || {});
271
+ function encodeFeeConversionLockerData(feePreferences) {
272
+ return (0, import_viem.encodeAbiParameters)(
273
+ [
274
+ {
275
+ type: "tuple",
276
+ components: [
277
+ { name: "feePreference", type: "uint8[]" }
278
+ ]
279
+ }
280
+ ],
281
+ [{ feePreference: feePreferences }]
282
+ );
283
+ }
263
284
 
264
285
  // src/utils/context.ts
265
286
  function buildContext(input) {
@@ -1235,16 +1256,27 @@ var LiquidSDK = class {
1235
1256
  DEFAULTS.PAIRED_FEE_BPS
1236
1257
  )
1237
1258
  },
1238
- lockerConfig: {
1239
- locker: params.locker ?? DEFAULTS.LOCKER,
1240
- rewardAdmins: params.rewardAdmins ?? [account],
1241
- rewardRecipients: params.rewardRecipients ?? [account],
1242
- rewardBps: params.rewardBps ?? [1e4],
1243
- tickLower: params.tickLower ?? POOL_POSITIONS.Liquid.map((p) => p.tickLower),
1244
- tickUpper: params.tickUpper ?? POOL_POSITIONS.Liquid.map((p) => p.tickUpper),
1245
- positionBps: params.positionBps ?? POOL_POSITIONS.Liquid.map((p) => p.positionBps),
1246
- lockerData: params.lockerData ?? "0x"
1247
- },
1259
+ lockerConfig: (() => {
1260
+ const locker = params.locker ?? DEFAULTS.LOCKER;
1261
+ const rewardRecipients = params.rewardRecipients ?? [account];
1262
+ const rewardBps = params.rewardBps ?? [1e4];
1263
+ let lockerData = params.lockerData ?? "0x";
1264
+ if (lockerData === "0x" && (0, import_viem2.getAddress)(locker) === (0, import_viem2.getAddress)(ADDRESSES.LP_LOCKER_FEE_CONVERSION)) {
1265
+ lockerData = encodeFeeConversionLockerData(
1266
+ rewardRecipients.map(() => 1 /* Paired */)
1267
+ );
1268
+ }
1269
+ return {
1270
+ locker,
1271
+ rewardAdmins: params.rewardAdmins ?? [account],
1272
+ rewardRecipients,
1273
+ rewardBps,
1274
+ tickLower: params.tickLower ?? POOL_POSITIONS.Liquid.map((p) => p.tickLower),
1275
+ tickUpper: params.tickUpper ?? POOL_POSITIONS.Liquid.map((p) => p.tickUpper),
1276
+ positionBps: params.positionBps ?? POOL_POSITIONS.Liquid.map((p) => p.positionBps),
1277
+ lockerData
1278
+ };
1279
+ })(),
1248
1280
  mevModuleConfig: {
1249
1281
  mevModule: params.mevModule ?? DEFAULTS.MEV_MODULE,
1250
1282
  mevModuleData: params.mevModuleData ?? encodeSniperAuctionData({
@@ -2125,6 +2157,7 @@ function describePositions(positions, ethPriceUSD) {
2125
2157
  ERC20Abi,
2126
2158
  EXTERNAL,
2127
2159
  FEE,
2160
+ FeePreference,
2128
2161
  LiquidAirdropV2Abi,
2129
2162
  LiquidFactoryAbi,
2130
2163
  LiquidFeeLockerAbi,
@@ -2147,6 +2180,7 @@ function describePositions(positions, ethPriceUSD) {
2147
2180
  createPositionsUSD,
2148
2181
  describePositions,
2149
2182
  encodeDynamicFeePoolData,
2183
+ encodeFeeConversionLockerData,
2150
2184
  encodeSniperAuctionData,
2151
2185
  encodeStaticFeePoolData,
2152
2186
  getTickFromMarketCapETH,