liquid-sdk 1.6.4 → 1.7.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 +60 -1
- package/dist/index.d.ts +60 -1
- package/dist/index.js +88 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +87 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -816,8 +816,8 @@ var LiquidPoolExtensionAllowlistAbi = [
|
|
|
816
816
|
}
|
|
817
817
|
];
|
|
818
818
|
|
|
819
|
-
// src/abis/
|
|
820
|
-
var
|
|
819
|
+
// src/abis/LiquidMevDescendingFees.ts
|
|
820
|
+
var LiquidMevDescendingFeesAbi = [
|
|
821
821
|
{
|
|
822
822
|
type: "function",
|
|
823
823
|
name: "blockDelay",
|
|
@@ -1086,6 +1086,63 @@ var LiquidSDK = class {
|
|
|
1086
1086
|
extensionData
|
|
1087
1087
|
};
|
|
1088
1088
|
}
|
|
1089
|
+
/**
|
|
1090
|
+
* Build a vault extension config for token deployment.
|
|
1091
|
+
*
|
|
1092
|
+
* Locks a percentage of the token supply with a lockup period
|
|
1093
|
+
* followed by optional linear vesting.
|
|
1094
|
+
*
|
|
1095
|
+
* @param vault - Vault parameters
|
|
1096
|
+
* @returns ExtensionConfig to include in `deployToken({ extensions })`
|
|
1097
|
+
*
|
|
1098
|
+
* @example
|
|
1099
|
+
* ```typescript
|
|
1100
|
+
* const vaultExt = sdk.buildVaultExtension({
|
|
1101
|
+
* admin: account.address,
|
|
1102
|
+
* allocationBps: 2000, // 20% of supply
|
|
1103
|
+
* lockupDuration: 2592000, // 30 days in seconds
|
|
1104
|
+
* vestingDuration: 7776000, // 90 days linear vesting after lockup
|
|
1105
|
+
* });
|
|
1106
|
+
* const result = await sdk.deployToken({
|
|
1107
|
+
* name: "My Token", symbol: "MTK",
|
|
1108
|
+
* extensions: [vaultExt],
|
|
1109
|
+
* });
|
|
1110
|
+
* ```
|
|
1111
|
+
*/
|
|
1112
|
+
buildVaultExtension(vault) {
|
|
1113
|
+
const MIN_LOCKUP = 604800;
|
|
1114
|
+
const MAX_BPS = 9e3;
|
|
1115
|
+
if (vault.allocationBps < 1 || vault.allocationBps > MAX_BPS) {
|
|
1116
|
+
throw new Error(`Vault allocationBps must be 1\u2013${MAX_BPS} (0.01%\u201390%). Got ${vault.allocationBps}.`);
|
|
1117
|
+
}
|
|
1118
|
+
if (vault.lockupDuration < MIN_LOCKUP) {
|
|
1119
|
+
throw new Error(`Vault lockupDuration must be \u2265 ${MIN_LOCKUP} seconds (7 days). Got ${vault.lockupDuration}.`);
|
|
1120
|
+
}
|
|
1121
|
+
if (vault.vestingDuration !== void 0 && vault.vestingDuration < 0) {
|
|
1122
|
+
throw new Error("Vault vestingDuration cannot be negative.");
|
|
1123
|
+
}
|
|
1124
|
+
const extensionData = encodeAbiParameters2(
|
|
1125
|
+
[
|
|
1126
|
+
{ type: "address" },
|
|
1127
|
+
// admin
|
|
1128
|
+
{ type: "uint256" },
|
|
1129
|
+
// lockupDuration
|
|
1130
|
+
{ type: "uint256" }
|
|
1131
|
+
// vestingDuration
|
|
1132
|
+
],
|
|
1133
|
+
[
|
|
1134
|
+
vault.admin,
|
|
1135
|
+
BigInt(vault.lockupDuration),
|
|
1136
|
+
BigInt(vault.vestingDuration ?? 0)
|
|
1137
|
+
]
|
|
1138
|
+
);
|
|
1139
|
+
return {
|
|
1140
|
+
extension: ADDRESSES.VAULT,
|
|
1141
|
+
msgValue: 0n,
|
|
1142
|
+
extensionBps: vault.allocationBps,
|
|
1143
|
+
extensionData
|
|
1144
|
+
};
|
|
1145
|
+
}
|
|
1089
1146
|
// ── Validation ─────────────────────────────────────────────────
|
|
1090
1147
|
/**
|
|
1091
1148
|
* Validate a DeploymentConfig before sending to the contract.
|
|
@@ -1256,7 +1313,7 @@ var LiquidSDK = class {
|
|
|
1256
1313
|
functionName: "deployToken",
|
|
1257
1314
|
args: [deploymentConfig],
|
|
1258
1315
|
value: msgValue,
|
|
1259
|
-
gas:
|
|
1316
|
+
gas: 5000000n,
|
|
1260
1317
|
chain: base2,
|
|
1261
1318
|
account: this.walletClient.account
|
|
1262
1319
|
});
|
|
@@ -1806,18 +1863,22 @@ var LiquidSDK = class {
|
|
|
1806
1863
|
args: [extensionAddress]
|
|
1807
1864
|
});
|
|
1808
1865
|
}
|
|
1809
|
-
// ── MEV
|
|
1810
|
-
async
|
|
1866
|
+
// ── MEV Descending Fees ─────────────────────────────────────────────
|
|
1867
|
+
async getMevDescendingFeesBlockDelay() {
|
|
1811
1868
|
return await this.publicClient.readContract({
|
|
1812
1869
|
address: ADDRESSES.MEV_DESCENDING_FEES,
|
|
1813
|
-
abi:
|
|
1870
|
+
abi: LiquidMevDescendingFeesAbi,
|
|
1814
1871
|
functionName: "blockDelay"
|
|
1815
1872
|
});
|
|
1816
1873
|
}
|
|
1874
|
+
/** @deprecated Use getMevDescendingFeesBlockDelay() */
|
|
1875
|
+
async getMevBlockDelay() {
|
|
1876
|
+
return this.getMevDescendingFeesBlockDelay();
|
|
1877
|
+
}
|
|
1817
1878
|
async getPoolUnlockTime(poolId) {
|
|
1818
1879
|
return await this.publicClient.readContract({
|
|
1819
1880
|
address: ADDRESSES.MEV_DESCENDING_FEES,
|
|
1820
|
-
abi:
|
|
1881
|
+
abi: LiquidMevDescendingFeesAbi,
|
|
1821
1882
|
functionName: "poolUnlockTime",
|
|
1822
1883
|
args: [poolId]
|
|
1823
1884
|
});
|
|
@@ -1964,6 +2025,24 @@ var LiquidSDK = class {
|
|
|
1964
2025
|
}
|
|
1965
2026
|
};
|
|
1966
2027
|
|
|
2028
|
+
// src/abis/LiquidMevBlockDelay.ts
|
|
2029
|
+
var LiquidMevBlockDelayAbi = [
|
|
2030
|
+
{
|
|
2031
|
+
type: "function",
|
|
2032
|
+
name: "blockDelay",
|
|
2033
|
+
inputs: [],
|
|
2034
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
2035
|
+
stateMutability: "view"
|
|
2036
|
+
},
|
|
2037
|
+
{
|
|
2038
|
+
type: "function",
|
|
2039
|
+
name: "poolUnlockTime",
|
|
2040
|
+
inputs: [{ name: "poolId", type: "bytes32" }],
|
|
2041
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
2042
|
+
stateMutability: "view"
|
|
2043
|
+
}
|
|
2044
|
+
];
|
|
2045
|
+
|
|
1967
2046
|
// src/abis/LiquidUniv4EthDevBuy.ts
|
|
1968
2047
|
var LiquidUniv4EthDevBuyAbi = [
|
|
1969
2048
|
{
|
|
@@ -2238,6 +2317,7 @@ export {
|
|
|
2238
2317
|
LiquidHookDynamicFeeV2Abi,
|
|
2239
2318
|
LiquidLpLockerAbi,
|
|
2240
2319
|
LiquidMevBlockDelayAbi,
|
|
2320
|
+
LiquidMevDescendingFeesAbi,
|
|
2241
2321
|
LiquidPoolExtensionAllowlistAbi,
|
|
2242
2322
|
LiquidSDK,
|
|
2243
2323
|
LiquidSniperAuctionV2Abi,
|