@ilalv3/cli 0.2.8 → 0.2.9
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/commands/liquidity.js +5 -1
- package/dist/index.js +3 -3
- package/package.json +1 -1
|
@@ -122,6 +122,9 @@ function allowanceLabel(raw, decimals, symbol) {
|
|
|
122
122
|
function secondsSince(startMs) {
|
|
123
123
|
return `${((Date.now() - startMs) / 1000).toFixed(1)}s`;
|
|
124
124
|
}
|
|
125
|
+
function defaultUserSalt(address) {
|
|
126
|
+
return `0x000000000000000000000000${address.slice(2)}`;
|
|
127
|
+
}
|
|
125
128
|
// ─── Shared core ──────────────────────────────────────────────────────────────
|
|
126
129
|
async function executeLiquidity(action, opts) {
|
|
127
130
|
const cfg = withConfig(opts);
|
|
@@ -161,7 +164,7 @@ async function executeLiquidity(action, opts) {
|
|
|
161
164
|
const liquidity = BigInt(opts.liquidity);
|
|
162
165
|
const fee = parseInt(cfg.fee ?? "3000");
|
|
163
166
|
const tickSpacing = parseInt(cfg.tickSpacing ?? "60");
|
|
164
|
-
const salt = (opts.salt ??
|
|
167
|
+
const salt = (opts.salt ?? defaultUserSalt(account.address));
|
|
165
168
|
const verb = action === "add" ? "Add" : "Remove";
|
|
166
169
|
header(`ILAL ${verb} Liquidity`, chain.name);
|
|
167
170
|
log.kv("router", fmt.cyan(cfg.router));
|
|
@@ -170,6 +173,7 @@ async function executeLiquidity(action, opts) {
|
|
|
170
173
|
log.kv("tickLower", tickLower.toString());
|
|
171
174
|
log.kv("tickUpper", tickUpper.toString());
|
|
172
175
|
log.kv("liquidity", liquidity.toString());
|
|
176
|
+
log.kv("salt", opts.salt ? fmt.hash(salt) : `${fmt.hash(salt)} ${fmt.gray("user-scoped default")}`);
|
|
173
177
|
log.line();
|
|
174
178
|
if (liquidity <= 0n) {
|
|
175
179
|
die("liquidity must be greater than 0. No approval or liquidity transaction was sent.");
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ const program = new Command();
|
|
|
19
19
|
program
|
|
20
20
|
.name("ilal")
|
|
21
21
|
.description("ILAL Protocol CLI — Uniswap v4 compliance hook toolkit")
|
|
22
|
-
.version("0.2.
|
|
22
|
+
.version("0.2.9")
|
|
23
23
|
.addHelpText("before", `\n ${fmt.bold(fmt.cyan("◆"))} ${fmt.bold("ILAL Protocol")} ${fmt.gray("Uniswap v4 Compliance Hook")}\n`);
|
|
24
24
|
// ─── init ─────────────────────────────────────────────────────────────────────
|
|
25
25
|
program
|
|
@@ -228,7 +228,7 @@ pool
|
|
|
228
228
|
.requiredOption("--tick-lower <int24>", "Lower tick of position")
|
|
229
229
|
.requiredOption("--tick-upper <int24>", "Upper tick of position")
|
|
230
230
|
.requiredOption("--liquidity <uint128>", "Liquidity amount to add (in raw units)")
|
|
231
|
-
.option("--salt <bytes32>", "Position salt for multiple positions at the same range
|
|
231
|
+
.option("--salt <bytes32>", "Position salt for multiple positions at the same range (defaults to user-scoped salt)")
|
|
232
232
|
.option("--pool-id <bytes32>", "Pool ID (or set in .ilal.json)")
|
|
233
233
|
.option("--router <address>", "ILALRouter address (or set in .ilal.json)")
|
|
234
234
|
.option("-H, --hook <address>", "ComplianceHook address (or set in .ilal.json)")
|
|
@@ -250,7 +250,7 @@ pool
|
|
|
250
250
|
.requiredOption("--tick-lower <int24>", "Lower tick of position")
|
|
251
251
|
.requiredOption("--tick-upper <int24>", "Upper tick of position")
|
|
252
252
|
.requiredOption("--liquidity <uint128>", "Liquidity amount to remove (in raw units)")
|
|
253
|
-
.option("--salt <bytes32>", "Position salt
|
|
253
|
+
.option("--salt <bytes32>", "Position salt (defaults to user-scoped salt)")
|
|
254
254
|
.option("--pool-id <bytes32>", "Pool ID (or set in .ilal.json)")
|
|
255
255
|
.option("--router <address>", "ILALRouter address (or set in .ilal.json)")
|
|
256
256
|
.option("-H, --hook <address>", "ComplianceHook address (or set in .ilal.json)")
|