liquid-sdk 1.6.5 → 1.7.2
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 +79 -4
- package/dist/index.d.ts +79 -4
- package/dist/index.js +109 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +108 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -53,6 +53,16 @@ interface DevBuyParams {
|
|
|
53
53
|
/** Address to receive the purchased tokens */
|
|
54
54
|
recipient: Address;
|
|
55
55
|
}
|
|
56
|
+
interface VaultExtensionParams {
|
|
57
|
+
/** Address that can claim vested tokens */
|
|
58
|
+
admin: Address;
|
|
59
|
+
/** Percentage of supply to lock, in BPS (1–9000 = 0.01%–90%) */
|
|
60
|
+
allocationBps: number;
|
|
61
|
+
/** Lockup duration in seconds (minimum 604800 = 7 days). Tokens are fully locked during this period. */
|
|
62
|
+
lockupDuration: number;
|
|
63
|
+
/** Vesting duration in seconds after lockup ends (0 = no vesting, tokens unlock all at once) */
|
|
64
|
+
vestingDuration?: number;
|
|
65
|
+
}
|
|
56
66
|
interface DeployTokenParams {
|
|
57
67
|
name: string;
|
|
58
68
|
symbol: string;
|
|
@@ -236,6 +246,30 @@ declare class LiquidSDK {
|
|
|
236
246
|
* The paired token must be WETH for simple dev buys.
|
|
237
247
|
*/
|
|
238
248
|
buildDevBuyExtension(devBuy: DevBuyParams): ExtensionConfig;
|
|
249
|
+
/**
|
|
250
|
+
* Build a vault extension config for token deployment.
|
|
251
|
+
*
|
|
252
|
+
* Locks a percentage of the token supply with a lockup period
|
|
253
|
+
* followed by optional linear vesting.
|
|
254
|
+
*
|
|
255
|
+
* @param vault - Vault parameters
|
|
256
|
+
* @returns ExtensionConfig to include in `deployToken({ extensions })`
|
|
257
|
+
*
|
|
258
|
+
* @example
|
|
259
|
+
* ```typescript
|
|
260
|
+
* const vaultExt = sdk.buildVaultExtension({
|
|
261
|
+
* admin: account.address,
|
|
262
|
+
* allocationBps: 2000, // 20% of supply
|
|
263
|
+
* lockupDuration: 2592000, // 30 days in seconds
|
|
264
|
+
* vestingDuration: 7776000, // 90 days linear vesting after lockup
|
|
265
|
+
* });
|
|
266
|
+
* const result = await sdk.deployToken({
|
|
267
|
+
* name: "My Token", symbol: "MTK",
|
|
268
|
+
* extensions: [vaultExt],
|
|
269
|
+
* });
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
buildVaultExtension(vault: VaultExtensionParams): ExtensionConfig;
|
|
239
273
|
/**
|
|
240
274
|
* Validate a DeploymentConfig before sending to the contract.
|
|
241
275
|
* Catches common mistakes client-side with clear error messages.
|
|
@@ -255,9 +289,25 @@ declare class LiquidSDK {
|
|
|
255
289
|
getPoolFeeState(poolId: Hex, hookAddress?: Address): Promise<PoolDynamicFeeVars>;
|
|
256
290
|
getPoolCreationTimestamp(poolId: Hex, hookAddress?: Address): Promise<bigint>;
|
|
257
291
|
isLiquidToken0(poolId: Hex, hookAddress?: Address): Promise<boolean>;
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
292
|
+
/**
|
|
293
|
+
* Get uncollected fees for a fee owner.
|
|
294
|
+
* @param feeOwner - Address that receives fees (reward recipient)
|
|
295
|
+
* @param feeToken - The token fees are denominated in. Defaults to WETH
|
|
296
|
+
* (correct for all pools using LP_LOCKER_FEE_CONVERSION).
|
|
297
|
+
*/
|
|
298
|
+
getAvailableFees(feeOwner: Address, feeToken?: Address): Promise<bigint>;
|
|
299
|
+
/**
|
|
300
|
+
* Get collected, claimable fees for a fee owner.
|
|
301
|
+
* @param feeOwner - Address that receives fees (reward recipient)
|
|
302
|
+
* @param feeToken - The token fees are denominated in. Defaults to WETH.
|
|
303
|
+
*/
|
|
304
|
+
getFeesToClaim(feeOwner: Address, feeToken?: Address): Promise<bigint>;
|
|
305
|
+
/**
|
|
306
|
+
* Claim all accumulated fees for a fee owner.
|
|
307
|
+
* @param feeOwner - Address that receives fees (reward recipient)
|
|
308
|
+
* @param feeToken - The token fees are denominated in. Defaults to WETH.
|
|
309
|
+
*/
|
|
310
|
+
claimFees(feeOwner: Address, feeToken?: Address): Promise<Hash>;
|
|
261
311
|
getVaultAllocation(tokenAddress: Address): Promise<VaultAllocation>;
|
|
262
312
|
getVaultClaimable(tokenAddress: Address): Promise<bigint>;
|
|
263
313
|
claimVault(tokenAddress: Address): Promise<Hash>;
|
|
@@ -313,6 +363,8 @@ declare class LiquidSDK {
|
|
|
313
363
|
collectRewardsWithoutUnlock(tokenAddress: Address, lockerAddress?: Address): Promise<Hash>;
|
|
314
364
|
updateRewardRecipient(tokenAddress: Address, rewardIndex: bigint, newRecipient: Address, lockerAddress?: Address): Promise<Hash>;
|
|
315
365
|
isExtensionEnabled(extensionAddress: Address): Promise<boolean>;
|
|
366
|
+
getMevDescendingFeesBlockDelay(): Promise<bigint>;
|
|
367
|
+
/** @deprecated Use getMevDescendingFeesBlockDelay() */
|
|
316
368
|
getMevBlockDelay(): Promise<bigint>;
|
|
317
369
|
getPoolUnlockTime(poolId: Hex): Promise<bigint>;
|
|
318
370
|
/**
|
|
@@ -1603,6 +1655,29 @@ declare const LiquidPoolExtensionAllowlistAbi: readonly [{
|
|
|
1603
1655
|
readonly stateMutability: "view";
|
|
1604
1656
|
}];
|
|
1605
1657
|
|
|
1658
|
+
declare const LiquidMevDescendingFeesAbi: readonly [{
|
|
1659
|
+
readonly type: "function";
|
|
1660
|
+
readonly name: "blockDelay";
|
|
1661
|
+
readonly inputs: readonly [];
|
|
1662
|
+
readonly outputs: readonly [{
|
|
1663
|
+
readonly name: "";
|
|
1664
|
+
readonly type: "uint256";
|
|
1665
|
+
}];
|
|
1666
|
+
readonly stateMutability: "view";
|
|
1667
|
+
}, {
|
|
1668
|
+
readonly type: "function";
|
|
1669
|
+
readonly name: "poolUnlockTime";
|
|
1670
|
+
readonly inputs: readonly [{
|
|
1671
|
+
readonly name: "poolId";
|
|
1672
|
+
readonly type: "bytes32";
|
|
1673
|
+
}];
|
|
1674
|
+
readonly outputs: readonly [{
|
|
1675
|
+
readonly name: "";
|
|
1676
|
+
readonly type: "uint256";
|
|
1677
|
+
}];
|
|
1678
|
+
readonly stateMutability: "view";
|
|
1679
|
+
}];
|
|
1680
|
+
|
|
1606
1681
|
declare const LiquidMevBlockDelayAbi: readonly [{
|
|
1607
1682
|
readonly type: "function";
|
|
1608
1683
|
readonly name: "blockDelay";
|
|
@@ -2482,4 +2557,4 @@ declare function parseContext(contextString: string): LiquidContext | null;
|
|
|
2482
2557
|
*/
|
|
2483
2558
|
declare function parseMetadata(metadataString: string): LiquidMetadata | null;
|
|
2484
2559
|
|
|
2485
|
-
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, 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 };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -53,6 +53,16 @@ interface DevBuyParams {
|
|
|
53
53
|
/** Address to receive the purchased tokens */
|
|
54
54
|
recipient: Address;
|
|
55
55
|
}
|
|
56
|
+
interface VaultExtensionParams {
|
|
57
|
+
/** Address that can claim vested tokens */
|
|
58
|
+
admin: Address;
|
|
59
|
+
/** Percentage of supply to lock, in BPS (1–9000 = 0.01%–90%) */
|
|
60
|
+
allocationBps: number;
|
|
61
|
+
/** Lockup duration in seconds (minimum 604800 = 7 days). Tokens are fully locked during this period. */
|
|
62
|
+
lockupDuration: number;
|
|
63
|
+
/** Vesting duration in seconds after lockup ends (0 = no vesting, tokens unlock all at once) */
|
|
64
|
+
vestingDuration?: number;
|
|
65
|
+
}
|
|
56
66
|
interface DeployTokenParams {
|
|
57
67
|
name: string;
|
|
58
68
|
symbol: string;
|
|
@@ -236,6 +246,30 @@ declare class LiquidSDK {
|
|
|
236
246
|
* The paired token must be WETH for simple dev buys.
|
|
237
247
|
*/
|
|
238
248
|
buildDevBuyExtension(devBuy: DevBuyParams): ExtensionConfig;
|
|
249
|
+
/**
|
|
250
|
+
* Build a vault extension config for token deployment.
|
|
251
|
+
*
|
|
252
|
+
* Locks a percentage of the token supply with a lockup period
|
|
253
|
+
* followed by optional linear vesting.
|
|
254
|
+
*
|
|
255
|
+
* @param vault - Vault parameters
|
|
256
|
+
* @returns ExtensionConfig to include in `deployToken({ extensions })`
|
|
257
|
+
*
|
|
258
|
+
* @example
|
|
259
|
+
* ```typescript
|
|
260
|
+
* const vaultExt = sdk.buildVaultExtension({
|
|
261
|
+
* admin: account.address,
|
|
262
|
+
* allocationBps: 2000, // 20% of supply
|
|
263
|
+
* lockupDuration: 2592000, // 30 days in seconds
|
|
264
|
+
* vestingDuration: 7776000, // 90 days linear vesting after lockup
|
|
265
|
+
* });
|
|
266
|
+
* const result = await sdk.deployToken({
|
|
267
|
+
* name: "My Token", symbol: "MTK",
|
|
268
|
+
* extensions: [vaultExt],
|
|
269
|
+
* });
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
buildVaultExtension(vault: VaultExtensionParams): ExtensionConfig;
|
|
239
273
|
/**
|
|
240
274
|
* Validate a DeploymentConfig before sending to the contract.
|
|
241
275
|
* Catches common mistakes client-side with clear error messages.
|
|
@@ -255,9 +289,25 @@ declare class LiquidSDK {
|
|
|
255
289
|
getPoolFeeState(poolId: Hex, hookAddress?: Address): Promise<PoolDynamicFeeVars>;
|
|
256
290
|
getPoolCreationTimestamp(poolId: Hex, hookAddress?: Address): Promise<bigint>;
|
|
257
291
|
isLiquidToken0(poolId: Hex, hookAddress?: Address): Promise<boolean>;
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
292
|
+
/**
|
|
293
|
+
* Get uncollected fees for a fee owner.
|
|
294
|
+
* @param feeOwner - Address that receives fees (reward recipient)
|
|
295
|
+
* @param feeToken - The token fees are denominated in. Defaults to WETH
|
|
296
|
+
* (correct for all pools using LP_LOCKER_FEE_CONVERSION).
|
|
297
|
+
*/
|
|
298
|
+
getAvailableFees(feeOwner: Address, feeToken?: Address): Promise<bigint>;
|
|
299
|
+
/**
|
|
300
|
+
* Get collected, claimable fees for a fee owner.
|
|
301
|
+
* @param feeOwner - Address that receives fees (reward recipient)
|
|
302
|
+
* @param feeToken - The token fees are denominated in. Defaults to WETH.
|
|
303
|
+
*/
|
|
304
|
+
getFeesToClaim(feeOwner: Address, feeToken?: Address): Promise<bigint>;
|
|
305
|
+
/**
|
|
306
|
+
* Claim all accumulated fees for a fee owner.
|
|
307
|
+
* @param feeOwner - Address that receives fees (reward recipient)
|
|
308
|
+
* @param feeToken - The token fees are denominated in. Defaults to WETH.
|
|
309
|
+
*/
|
|
310
|
+
claimFees(feeOwner: Address, feeToken?: Address): Promise<Hash>;
|
|
261
311
|
getVaultAllocation(tokenAddress: Address): Promise<VaultAllocation>;
|
|
262
312
|
getVaultClaimable(tokenAddress: Address): Promise<bigint>;
|
|
263
313
|
claimVault(tokenAddress: Address): Promise<Hash>;
|
|
@@ -313,6 +363,8 @@ declare class LiquidSDK {
|
|
|
313
363
|
collectRewardsWithoutUnlock(tokenAddress: Address, lockerAddress?: Address): Promise<Hash>;
|
|
314
364
|
updateRewardRecipient(tokenAddress: Address, rewardIndex: bigint, newRecipient: Address, lockerAddress?: Address): Promise<Hash>;
|
|
315
365
|
isExtensionEnabled(extensionAddress: Address): Promise<boolean>;
|
|
366
|
+
getMevDescendingFeesBlockDelay(): Promise<bigint>;
|
|
367
|
+
/** @deprecated Use getMevDescendingFeesBlockDelay() */
|
|
316
368
|
getMevBlockDelay(): Promise<bigint>;
|
|
317
369
|
getPoolUnlockTime(poolId: Hex): Promise<bigint>;
|
|
318
370
|
/**
|
|
@@ -1603,6 +1655,29 @@ declare const LiquidPoolExtensionAllowlistAbi: readonly [{
|
|
|
1603
1655
|
readonly stateMutability: "view";
|
|
1604
1656
|
}];
|
|
1605
1657
|
|
|
1658
|
+
declare const LiquidMevDescendingFeesAbi: readonly [{
|
|
1659
|
+
readonly type: "function";
|
|
1660
|
+
readonly name: "blockDelay";
|
|
1661
|
+
readonly inputs: readonly [];
|
|
1662
|
+
readonly outputs: readonly [{
|
|
1663
|
+
readonly name: "";
|
|
1664
|
+
readonly type: "uint256";
|
|
1665
|
+
}];
|
|
1666
|
+
readonly stateMutability: "view";
|
|
1667
|
+
}, {
|
|
1668
|
+
readonly type: "function";
|
|
1669
|
+
readonly name: "poolUnlockTime";
|
|
1670
|
+
readonly inputs: readonly [{
|
|
1671
|
+
readonly name: "poolId";
|
|
1672
|
+
readonly type: "bytes32";
|
|
1673
|
+
}];
|
|
1674
|
+
readonly outputs: readonly [{
|
|
1675
|
+
readonly name: "";
|
|
1676
|
+
readonly type: "uint256";
|
|
1677
|
+
}];
|
|
1678
|
+
readonly stateMutability: "view";
|
|
1679
|
+
}];
|
|
1680
|
+
|
|
1606
1681
|
declare const LiquidMevBlockDelayAbi: readonly [{
|
|
1607
1682
|
readonly type: "function";
|
|
1608
1683
|
readonly name: "blockDelay";
|
|
@@ -2482,4 +2557,4 @@ declare function parseContext(contextString: string): LiquidContext | null;
|
|
|
2482
2557
|
*/
|
|
2483
2558
|
declare function parseMetadata(metadataString: string): LiquidMetadata | null;
|
|
2484
2559
|
|
|
2485
|
-
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, 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -36,6 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
LiquidHookDynamicFeeV2Abi: () => LiquidHookDynamicFeeV2Abi,
|
|
37
37
|
LiquidLpLockerAbi: () => LiquidLpLockerAbi,
|
|
38
38
|
LiquidMevBlockDelayAbi: () => LiquidMevBlockDelayAbi,
|
|
39
|
+
LiquidMevDescendingFeesAbi: () => LiquidMevDescendingFeesAbi,
|
|
39
40
|
LiquidPoolExtensionAllowlistAbi: () => LiquidPoolExtensionAllowlistAbi,
|
|
40
41
|
LiquidSDK: () => LiquidSDK,
|
|
41
42
|
LiquidSniperAuctionV2Abi: () => LiquidSniperAuctionV2Abi,
|
|
@@ -873,8 +874,8 @@ var LiquidPoolExtensionAllowlistAbi = [
|
|
|
873
874
|
}
|
|
874
875
|
];
|
|
875
876
|
|
|
876
|
-
// src/abis/
|
|
877
|
-
var
|
|
877
|
+
// src/abis/LiquidMevDescendingFees.ts
|
|
878
|
+
var LiquidMevDescendingFeesAbi = [
|
|
878
879
|
{
|
|
879
880
|
type: "function",
|
|
880
881
|
name: "blockDelay",
|
|
@@ -1143,6 +1144,63 @@ var LiquidSDK = class {
|
|
|
1143
1144
|
extensionData
|
|
1144
1145
|
};
|
|
1145
1146
|
}
|
|
1147
|
+
/**
|
|
1148
|
+
* Build a vault extension config for token deployment.
|
|
1149
|
+
*
|
|
1150
|
+
* Locks a percentage of the token supply with a lockup period
|
|
1151
|
+
* followed by optional linear vesting.
|
|
1152
|
+
*
|
|
1153
|
+
* @param vault - Vault parameters
|
|
1154
|
+
* @returns ExtensionConfig to include in `deployToken({ extensions })`
|
|
1155
|
+
*
|
|
1156
|
+
* @example
|
|
1157
|
+
* ```typescript
|
|
1158
|
+
* const vaultExt = sdk.buildVaultExtension({
|
|
1159
|
+
* admin: account.address,
|
|
1160
|
+
* allocationBps: 2000, // 20% of supply
|
|
1161
|
+
* lockupDuration: 2592000, // 30 days in seconds
|
|
1162
|
+
* vestingDuration: 7776000, // 90 days linear vesting after lockup
|
|
1163
|
+
* });
|
|
1164
|
+
* const result = await sdk.deployToken({
|
|
1165
|
+
* name: "My Token", symbol: "MTK",
|
|
1166
|
+
* extensions: [vaultExt],
|
|
1167
|
+
* });
|
|
1168
|
+
* ```
|
|
1169
|
+
*/
|
|
1170
|
+
buildVaultExtension(vault) {
|
|
1171
|
+
const MIN_LOCKUP = 604800;
|
|
1172
|
+
const MAX_BPS = 9e3;
|
|
1173
|
+
if (vault.allocationBps < 1 || vault.allocationBps > MAX_BPS) {
|
|
1174
|
+
throw new Error(`Vault allocationBps must be 1\u2013${MAX_BPS} (0.01%\u201390%). Got ${vault.allocationBps}.`);
|
|
1175
|
+
}
|
|
1176
|
+
if (vault.lockupDuration < MIN_LOCKUP) {
|
|
1177
|
+
throw new Error(`Vault lockupDuration must be \u2265 ${MIN_LOCKUP} seconds (7 days). Got ${vault.lockupDuration}.`);
|
|
1178
|
+
}
|
|
1179
|
+
if (vault.vestingDuration !== void 0 && vault.vestingDuration < 0) {
|
|
1180
|
+
throw new Error("Vault vestingDuration cannot be negative.");
|
|
1181
|
+
}
|
|
1182
|
+
const extensionData = (0, import_viem2.encodeAbiParameters)(
|
|
1183
|
+
[
|
|
1184
|
+
{ type: "address" },
|
|
1185
|
+
// admin
|
|
1186
|
+
{ type: "uint256" },
|
|
1187
|
+
// lockupDuration
|
|
1188
|
+
{ type: "uint256" }
|
|
1189
|
+
// vestingDuration
|
|
1190
|
+
],
|
|
1191
|
+
[
|
|
1192
|
+
vault.admin,
|
|
1193
|
+
BigInt(vault.lockupDuration),
|
|
1194
|
+
BigInt(vault.vestingDuration ?? 0)
|
|
1195
|
+
]
|
|
1196
|
+
);
|
|
1197
|
+
return {
|
|
1198
|
+
extension: ADDRESSES.VAULT,
|
|
1199
|
+
msgValue: 0n,
|
|
1200
|
+
extensionBps: vault.allocationBps,
|
|
1201
|
+
extensionData
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1146
1204
|
// ── Validation ─────────────────────────────────────────────────
|
|
1147
1205
|
/**
|
|
1148
1206
|
* Validate a DeploymentConfig before sending to the contract.
|
|
@@ -1470,23 +1528,39 @@ var LiquidSDK = class {
|
|
|
1470
1528
|
});
|
|
1471
1529
|
}
|
|
1472
1530
|
// ── Fee Claims ────────────────────────────────────────────────────
|
|
1473
|
-
|
|
1531
|
+
/**
|
|
1532
|
+
* Get uncollected fees for a fee owner.
|
|
1533
|
+
* @param feeOwner - Address that receives fees (reward recipient)
|
|
1534
|
+
* @param feeToken - The token fees are denominated in. Defaults to WETH
|
|
1535
|
+
* (correct for all pools using LP_LOCKER_FEE_CONVERSION).
|
|
1536
|
+
*/
|
|
1537
|
+
async getAvailableFees(feeOwner, feeToken = EXTERNAL.WETH) {
|
|
1474
1538
|
return await this.publicClient.readContract({
|
|
1475
1539
|
address: ADDRESSES.FEE_LOCKER,
|
|
1476
1540
|
abi: LiquidFeeLockerAbi,
|
|
1477
1541
|
functionName: "availableFees",
|
|
1478
|
-
args: [feeOwner,
|
|
1542
|
+
args: [feeOwner, feeToken]
|
|
1479
1543
|
});
|
|
1480
1544
|
}
|
|
1481
|
-
|
|
1545
|
+
/**
|
|
1546
|
+
* Get collected, claimable fees for a fee owner.
|
|
1547
|
+
* @param feeOwner - Address that receives fees (reward recipient)
|
|
1548
|
+
* @param feeToken - The token fees are denominated in. Defaults to WETH.
|
|
1549
|
+
*/
|
|
1550
|
+
async getFeesToClaim(feeOwner, feeToken = EXTERNAL.WETH) {
|
|
1482
1551
|
return await this.publicClient.readContract({
|
|
1483
1552
|
address: ADDRESSES.FEE_LOCKER,
|
|
1484
1553
|
abi: LiquidFeeLockerAbi,
|
|
1485
1554
|
functionName: "feesToClaim",
|
|
1486
|
-
args: [feeOwner,
|
|
1555
|
+
args: [feeOwner, feeToken]
|
|
1487
1556
|
});
|
|
1488
1557
|
}
|
|
1489
|
-
|
|
1558
|
+
/**
|
|
1559
|
+
* Claim all accumulated fees for a fee owner.
|
|
1560
|
+
* @param feeOwner - Address that receives fees (reward recipient)
|
|
1561
|
+
* @param feeToken - The token fees are denominated in. Defaults to WETH.
|
|
1562
|
+
*/
|
|
1563
|
+
async claimFees(feeOwner, feeToken = EXTERNAL.WETH) {
|
|
1490
1564
|
if (!this.walletClient?.account) {
|
|
1491
1565
|
throw new Error("walletClient with account required for claimFees");
|
|
1492
1566
|
}
|
|
@@ -1494,7 +1568,7 @@ var LiquidSDK = class {
|
|
|
1494
1568
|
address: ADDRESSES.FEE_LOCKER,
|
|
1495
1569
|
abi: LiquidFeeLockerAbi,
|
|
1496
1570
|
functionName: "claim",
|
|
1497
|
-
args: [feeOwner,
|
|
1571
|
+
args: [feeOwner, feeToken],
|
|
1498
1572
|
chain: import_chains2.base,
|
|
1499
1573
|
account: this.walletClient.account
|
|
1500
1574
|
});
|
|
@@ -1863,18 +1937,22 @@ var LiquidSDK = class {
|
|
|
1863
1937
|
args: [extensionAddress]
|
|
1864
1938
|
});
|
|
1865
1939
|
}
|
|
1866
|
-
// ── MEV
|
|
1867
|
-
async
|
|
1940
|
+
// ── MEV Descending Fees ─────────────────────────────────────────────
|
|
1941
|
+
async getMevDescendingFeesBlockDelay() {
|
|
1868
1942
|
return await this.publicClient.readContract({
|
|
1869
1943
|
address: ADDRESSES.MEV_DESCENDING_FEES,
|
|
1870
|
-
abi:
|
|
1944
|
+
abi: LiquidMevDescendingFeesAbi,
|
|
1871
1945
|
functionName: "blockDelay"
|
|
1872
1946
|
});
|
|
1873
1947
|
}
|
|
1948
|
+
/** @deprecated Use getMevDescendingFeesBlockDelay() */
|
|
1949
|
+
async getMevBlockDelay() {
|
|
1950
|
+
return this.getMevDescendingFeesBlockDelay();
|
|
1951
|
+
}
|
|
1874
1952
|
async getPoolUnlockTime(poolId) {
|
|
1875
1953
|
return await this.publicClient.readContract({
|
|
1876
1954
|
address: ADDRESSES.MEV_DESCENDING_FEES,
|
|
1877
|
-
abi:
|
|
1955
|
+
abi: LiquidMevDescendingFeesAbi,
|
|
1878
1956
|
functionName: "poolUnlockTime",
|
|
1879
1957
|
args: [poolId]
|
|
1880
1958
|
});
|
|
@@ -2021,6 +2099,24 @@ var LiquidSDK = class {
|
|
|
2021
2099
|
}
|
|
2022
2100
|
};
|
|
2023
2101
|
|
|
2102
|
+
// src/abis/LiquidMevBlockDelay.ts
|
|
2103
|
+
var LiquidMevBlockDelayAbi = [
|
|
2104
|
+
{
|
|
2105
|
+
type: "function",
|
|
2106
|
+
name: "blockDelay",
|
|
2107
|
+
inputs: [],
|
|
2108
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
2109
|
+
stateMutability: "view"
|
|
2110
|
+
},
|
|
2111
|
+
{
|
|
2112
|
+
type: "function",
|
|
2113
|
+
name: "poolUnlockTime",
|
|
2114
|
+
inputs: [{ name: "poolId", type: "bytes32" }],
|
|
2115
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
2116
|
+
stateMutability: "view"
|
|
2117
|
+
}
|
|
2118
|
+
];
|
|
2119
|
+
|
|
2024
2120
|
// src/abis/LiquidUniv4EthDevBuy.ts
|
|
2025
2121
|
var LiquidUniv4EthDevBuyAbi = [
|
|
2026
2122
|
{
|
|
@@ -2296,6 +2392,7 @@ function describePositions(positions, ethPriceUSD) {
|
|
|
2296
2392
|
LiquidHookDynamicFeeV2Abi,
|
|
2297
2393
|
LiquidLpLockerAbi,
|
|
2298
2394
|
LiquidMevBlockDelayAbi,
|
|
2395
|
+
LiquidMevDescendingFeesAbi,
|
|
2299
2396
|
LiquidPoolExtensionAllowlistAbi,
|
|
2300
2397
|
LiquidSDK,
|
|
2301
2398
|
LiquidSniperAuctionV2Abi,
|