@logswap/sdk 0.5.43 → 0.5.45

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
@@ -85,9 +85,9 @@ runs once and explicitly rather than being chained into both.
85
85
  - **The SDK hides the manager/router/lens split.** Which contract hosts which action is currently
86
86
  decided by EIP-170 headroom, not by design — so a future re-homing must be an SDK patch, not a
87
87
  breaking change for consumers.
88
- - **Zero is not the default.** `phiMin` and `alpha` of `0n` resolve to their defaults at *read* time,
89
- so a key carrying `0n` and one carrying the resolved value are **different markets with different
90
- ids**. Always address a market by the key it was initialized with.
88
+ - **Zero is not the default.** A `phi` of `0n` resolves to `DEFAULT_FEE` at *read* time, so a key
89
+ carrying `0n` and one carrying the resolved value are **different markets with different ids**.
90
+ Always address a market by the key it was initialized with.
91
91
  - **Split every ERC-6909 `Transfer` on bit 255.** Clear means a token claim, not a position; an
92
92
  indexer that ignores this reports phantom LP positions for market makers parking inventory.
93
93
 
package/dist/admin.d.ts CHANGED
@@ -1,11 +1,17 @@
1
1
  /**
2
- * admin — the protocol's (feeCollector's) writes: the fee rates, the harvest-fee exemption, and
3
- * the two-step collector handover, on both managers. Plain writes to the managers; no router.
2
+ * admin — the protocol's (feeCollector's) writes: the protocol's cuts, the harvest-cut exemption,
3
+ * and the two-step collector handover, on both managers. Plain writes to the managers; no router.
4
+ * One vocabulary (decisions 040): both managers call the protocol's cut of the mint fee
5
+ * `MINT_FEE_PROTOCOL_CUT` and set it through `setFeeParams` — one cut on C (since version 4,
6
+ * decisions 042; `setProtocolFeeCut` / `PROTOCOL_FEE_CUT` before), two on F.
4
7
  */
5
8
  import type { Address, Hash, Hex } from "viem";
6
9
  import type { LogswapClient } from "./client.js";
7
- export declare function setProtocolFeeCut(c: LogswapClient, cutWad: bigint): Promise<Hash>;
8
- export declare function setFeeParams(c: LogswapClient, mintFeeProtocolCutWad: bigint, harvestFeeWad: bigint): Promise<Hash>;
9
- export declare function setHarvestFeeExempt(c: LogswapClient, poolId: Hex, exempt: boolean): Promise<Hash>;
10
+ /** The C manager's `setFeeParams(mintFeeProtocolCut)` — one cut. */
11
+ export declare function setFeeParamsC(c: LogswapClient, mintFeeProtocolCutWad: bigint): Promise<Hash>;
12
+ /** The F manager's `setFeeParams(mintFeeProtocolCut, harvestProtocolCut)` — two cuts. */
13
+ export declare function setFeeParams(c: LogswapClient, mintFeeProtocolCutWad: bigint, harvestProtocolCutWad: bigint): Promise<Hash>;
14
+ /** Waive the protocol's cut of harvested income for one pool (`HARVEST_PROTOCOL_CUT`; F version 13 — `setHarvestFeeExempt` before). */
15
+ export declare function setHarvestCutExempt(c: LogswapClient, poolId: Hex, exempt: boolean): Promise<Hash>;
10
16
  export declare function proposeCollector(c: LogswapClient, side: "C" | "F", next: Address): Promise<Hash>;
11
17
  export declare function acceptCollector(c: LogswapClient, side: "C" | "F"): Promise<Hash>;
package/dist/admin.js CHANGED
@@ -1,6 +1,9 @@
1
1
  /**
2
- * admin — the protocol's (feeCollector's) writes: the fee rates, the harvest-fee exemption, and
3
- * the two-step collector handover, on both managers. Plain writes to the managers; no router.
2
+ * admin — the protocol's (feeCollector's) writes: the protocol's cuts, the harvest-cut exemption,
3
+ * and the two-step collector handover, on both managers. Plain writes to the managers; no router.
4
+ * One vocabulary (decisions 040): both managers call the protocol's cut of the mint fee
5
+ * `MINT_FEE_PROTOCOL_CUT` and set it through `setFeeParams` — one cut on C (since version 4,
6
+ * decisions 042; `setProtocolFeeCut` / `PROTOCOL_FEE_CUT` before), two on F.
4
7
  */
5
8
  import { cPoolManagerAbi, fPoolManagerAbi } from "./generated.js";
6
9
  function wallet(c) {
@@ -8,14 +11,17 @@ function wallet(c) {
8
11
  throw new Error("a wallet client is required");
9
12
  return c.wallet;
10
13
  }
11
- export async function setProtocolFeeCut(c, cutWad) {
12
- return wallet(c).writeContract({ address: c.addresses.cPoolManager, abi: cPoolManagerAbi, functionName: "setProtocolFeeCut", args: [cutWad], chain: c.wallet.chain, account: c.wallet.account });
14
+ /** The C manager's `setFeeParams(mintFeeProtocolCut)` — one cut. */
15
+ export async function setFeeParamsC(c, mintFeeProtocolCutWad) {
16
+ return wallet(c).writeContract({ address: c.addresses.cPoolManager, abi: cPoolManagerAbi, functionName: "setFeeParams", args: [mintFeeProtocolCutWad], chain: c.wallet.chain, account: c.wallet.account });
13
17
  }
14
- export async function setFeeParams(c, mintFeeProtocolCutWad, harvestFeeWad) {
15
- return wallet(c).writeContract({ address: c.addresses.fPoolManager, abi: fPoolManagerAbi, functionName: "setFeeParams", args: [mintFeeProtocolCutWad, harvestFeeWad], chain: c.wallet.chain, account: c.wallet.account });
18
+ /** The F manager's `setFeeParams(mintFeeProtocolCut, harvestProtocolCut)` — two cuts. */
19
+ export async function setFeeParams(c, mintFeeProtocolCutWad, harvestProtocolCutWad) {
20
+ return wallet(c).writeContract({ address: c.addresses.fPoolManager, abi: fPoolManagerAbi, functionName: "setFeeParams", args: [mintFeeProtocolCutWad, harvestProtocolCutWad], chain: c.wallet.chain, account: c.wallet.account });
16
21
  }
17
- export async function setHarvestFeeExempt(c, poolId, exempt) {
18
- return wallet(c).writeContract({ address: c.addresses.fPoolManager, abi: fPoolManagerAbi, functionName: "setHarvestFeeExempt", args: [poolId, exempt], chain: c.wallet.chain, account: c.wallet.account });
22
+ /** Waive the protocol's cut of harvested income for one pool (`HARVEST_PROTOCOL_CUT`; F version 13 — `setHarvestFeeExempt` before). */
23
+ export async function setHarvestCutExempt(c, poolId, exempt) {
24
+ return wallet(c).writeContract({ address: c.addresses.fPoolManager, abi: fPoolManagerAbi, functionName: "setHarvestCutExempt", args: [poolId, exempt], chain: c.wallet.chain, account: c.wallet.account });
19
25
  }
20
26
  export async function proposeCollector(c, side, next) {
21
27
  const address = side === "C" ? c.addresses.cPoolManager : c.addresses.fPoolManager;
package/dist/client.d.ts CHANGED
@@ -51,8 +51,13 @@ export declare function createLogswapClient(args: {
51
51
  * **3** since 2026-09-03 (contracts `d8406fb`): `burnById` and `update` take an `owner`, `update`
52
52
  * mints to `to`, `positions()` returns `aps` as uint128 — and a returned quote flow now carries the
53
53
  * swept fees (decisions 018), which is why `exit`'s settle-to-one-asset math changed with it.
54
+ *
55
+ * **4** since 2026-09-18 (decisions 042 + 040): `PoolKey` is `(base, quote, tickSpacing, phi)` —
56
+ * the variance kernel and its two key fields are gone, so every pool id changed; `phiEff` is
57
+ * `phiOf`; `getPool` lost `sigma2Ema`; `Initialize` lost two fields; the cut is
58
+ * `MINT_FEE_PROTOCOL_CUT` / `setFeeParams`.
54
59
  */
55
- export declare const EXPECTED_VERSION = 3n;
60
+ export declare const EXPECTED_VERSION = 4n;
56
61
  /**
57
62
  * The F manager's own tag (contracts 25a7bcf: 5 — the key's salt, pool names, the sponsor registry;
58
63
  * 4 was the income-only harvest cut).
@@ -64,5 +69,5 @@ export declare const EXPECTED_VERSION = 3n;
64
69
  * passes it; when one lands, raise this constant in the same change, which is the discipline
65
70
  * `EXPECTED_VERSION` enforces mechanically and this one asks for.
66
71
  */
67
- export declare const EXPECTED_F_VERSION = 12n;
72
+ export declare const EXPECTED_F_VERSION = 13n;
68
73
  export declare function assertVersion(c: LogswapClient, expected?: bigint): Promise<void>;
package/dist/client.js CHANGED
@@ -27,8 +27,13 @@ export function createLogswapClient(args) {
27
27
  * **3** since 2026-09-03 (contracts `d8406fb`): `burnById` and `update` take an `owner`, `update`
28
28
  * mints to `to`, `positions()` returns `aps` as uint128 — and a returned quote flow now carries the
29
29
  * swept fees (decisions 018), which is why `exit`'s settle-to-one-asset math changed with it.
30
+ *
31
+ * **4** since 2026-09-18 (decisions 042 + 040): `PoolKey` is `(base, quote, tickSpacing, phi)` —
32
+ * the variance kernel and its two key fields are gone, so every pool id changed; `phiEff` is
33
+ * `phiOf`; `getPool` lost `sigma2Ema`; `Initialize` lost two fields; the cut is
34
+ * `MINT_FEE_PROTOCOL_CUT` / `setFeeParams`.
30
35
  */
31
- export const EXPECTED_VERSION = 3n;
36
+ export const EXPECTED_VERSION = 4n;
32
37
  /**
33
38
  * The F manager's own tag (contracts 25a7bcf: 5 — the key's salt, pool names, the sponsor registry;
34
39
  * 4 was the income-only harvest cut).
@@ -60,7 +65,13 @@ export const EXPECTED_VERSION = 3n;
60
65
  // 12 (2026-09-17): one contract (decisions 039) — the sponsor facet is folded back into the
61
66
  // manager; `sponsor()` and the fallback are gone, every entry, error and event unchanged, so
62
67
  // `fPoolManagerAbi` is the manager's own ABI and no longer a union. Layout unchanged.
63
- export const EXPECTED_F_VERSION = 12n;
68
+ // 13 (2026-09-18): one vocabulary (decisions 040) — `HARVEST_FEE` is `HARVEST_PROTOCOL_CUT` (a
69
+ // cut of harvested income, not a fee on the harvest) and the exemption is `harvestCutExempt` /
70
+ // `setHarvestCutExempt`; `acceptAuthority` clears the operator, pending and accepted (a mandate
71
+ // is voided by the handover of the role that granted it); `setLegs` needs a generation to have
72
+ // lived (`gen > 0`); `initialize` refuses a codeless base and `mint` refuses `to = address(0)`
73
+ // on both managers. Layout unchanged.
74
+ export const EXPECTED_F_VERSION = 13n;
64
75
  export async function assertVersion(c, expected = EXPECTED_VERSION) {
65
76
  const { cPoolManagerAbi } = await import("./generated.js");
66
77
  const got = await c.public.readContract({
package/dist/fpool.js CHANGED
@@ -642,8 +642,8 @@ export async function fPoolEmptyingHarvests(c, poolId) {
642
642
  const [p, feePerL, fee, exempt, collector] = await Promise.all([
643
643
  rd("getPool", [poolId]),
644
644
  rd("feePerL", [poolId]),
645
- rd("HARVEST_FEE"),
646
- rd("harvestFeeExempt", [poolId]),
645
+ rd("HARVEST_PROTOCOL_CUT"),
646
+ rd("harvestCutExempt", [poolId]),
647
647
  rd("feeCollector"),
648
648
  ]);
649
649
  if (p.Q === 0n)