@logswap/sdk 0.5.47 → 0.5.49

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/admin.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * admin — the protocol's (feeCollector's) writes: the protocol's cut of the mint fee on both
3
- * managers, the hooks a pool of each kind may be born with, the hooks' own numbers, and the
4
- * two-step collector handover. Plain writes to the managers and the hooks; no router.
3
+ * managers, the policies a pool of each kind may be born with, the policies' own numbers, and the
4
+ * two-step collector handover. Plain writes to the managers and the policies; no router.
5
5
  *
6
6
  * One vocabulary (decisions 040): both managers call the protocol's cut of the mint fee
7
7
  * `MINT_FEE_PROTOCOL_CUT` and set it through `setFeeParams(uint256)` — one cut each since C
8
- * version 4 / F version 14. The harvest's cut is the hook's answer at every harvest (decisions
9
- * 044), set on the hook (`setHarvestCut`) and capped by the manager (`HARVEST_CUT_MAX`); the
8
+ * version 4 / F version 14. The harvest's cut is the policy's answer at every harvest (decisions
9
+ * 044), set on the policy (`setHarvestCut`) and capped by the manager (`HARVEST_CUT_MAX`); the
10
10
  * release's protocol share likewise (`POT_CUT_MAX`).
11
11
  */
12
12
  import type { Address, Hash } from "viem";
@@ -17,30 +17,30 @@ export declare function setFeeParamsC(c: LogswapClient, mintFeeProtocolCutWad: b
17
17
  /** The F manager's `setFeeParams(mintFeeProtocolCut)` — one cut, the C manager's shape (F version 14). */
18
18
  export declare function setFeeParams(c: LogswapClient, mintFeeProtocolCutWad: bigint): Promise<Hash>;
19
19
  /**
20
- * Approve a hook for pools of `kind` to be born with, or withdraw the approval (decisions 041,
21
- * 044). Read at `initialize` and never again: a live pool keeps its hook.
20
+ * Approve a policy for pools of `kind` to be born with, or withdraw the approval (decisions 041,
21
+ * 044). Read at `initialize` and never again: a live pool keeps its policy.
22
22
  */
23
- export declare function setHookApproved(c: LogswapClient, kind: FPoolKind, hook: Address, approved: boolean): Promise<Hash>;
24
- /** Whether `hook` is approved for pools of `kind`. */
25
- export declare function hookApproved(c: LogswapClient, kind: FPoolKind, hook: Address): Promise<boolean>;
26
- /** The protocol's rate on the income part of every harvest under `hook`, WAD ≤ `HARVEST_CUT_MAX`. */
27
- export declare function setHarvestCut(c: LogswapClient, hook: Address, rateWad: bigint): Promise<Hash>;
28
- /** `PadHook.setSchedule`: `T(0)`, the rung's growth, the creator's and the protocol's shares of the pot (≤ `POT_CUT_MAX`), the burn per rung (≤ `BURN_MAX`). */
29
- export declare function padSetSchedule(c: LogswapClient, hook: Address, s: {
23
+ export declare function setPolicyApproved(c: LogswapClient, kind: FPoolKind, policy: Address, approved: boolean): Promise<Hash>;
24
+ /** Whether `policy` is approved for pools of `kind`. */
25
+ export declare function policyApproved(c: LogswapClient, kind: FPoolKind, policy: Address): Promise<boolean>;
26
+ /** The protocol's rate on the income part of every harvest under `policy`, WAD ≤ `HARVEST_CUT_MAX`. */
27
+ export declare function setHarvestCut(c: LogswapClient, policy: Address, rateWad: bigint): Promise<Hash>;
28
+ /** `PadPolicy.setSchedule`: `T(0)`, the rung's growth, the creator's and the protocol's shares of the pot (≤ `POT_CUT_MAX`), the burn per rung (≤ `BURN_MAX`). */
29
+ export declare function padSetSchedule(c: LogswapClient, policy: Address, s: {
30
30
  thresholdBase: bigint;
31
31
  thresholdGrowth: bigint;
32
32
  creatorShare: bigint;
33
33
  protocolShare: bigint;
34
34
  burnPerRung: bigint;
35
35
  }): Promise<Hash>;
36
- /** `PolHook.setPolicy`: what every harvest leaves in the bid and what a relaunch's seed must bring, WAD fractions of L. */
37
- export declare function polSetPolicy(c: LogswapClient, hook: Address, s: {
36
+ /** `PolPolicy.setRules`: what every harvest leaves in the bid and what a relaunch's seed must bring, WAD fractions of L. */
37
+ export declare function polSetRules(c: LogswapClient, policy: Address, s: {
38
38
  keepQuote: bigint;
39
39
  minQuoteAtSeed: bigint;
40
40
  }): Promise<Hash>;
41
- /** `PublicHook.setListed`: an asset a curated seed may hold. */
42
- export declare function publicSetListed(c: LogswapClient, hook: Address, token: Address, listed: boolean): Promise<Hash>;
43
- /** `PublicHook.setCurated`: whether every public seed is checked against the list. */
44
- export declare function publicSetCurated(c: LogswapClient, hook: Address, curated: boolean): Promise<Hash>;
41
+ /** `PublicPolicy.setListed`: an asset a curated seed may hold. */
42
+ export declare function publicSetListed(c: LogswapClient, policy: Address, token: Address, listed: boolean): Promise<Hash>;
43
+ /** `PublicPolicy.setCurated`: whether every public seed is checked against the list. */
44
+ export declare function publicSetCurated(c: LogswapClient, policy: Address, curated: boolean): Promise<Hash>;
45
45
  export declare function proposeCollector(c: LogswapClient, side: "C" | "F", next: Address): Promise<Hash>;
46
46
  export declare function acceptCollector(c: LogswapClient, side: "C" | "F"): Promise<Hash>;
package/dist/admin.js CHANGED
@@ -1,16 +1,16 @@
1
1
  /**
2
2
  * admin — the protocol's (feeCollector's) writes: the protocol's cut of the mint fee on both
3
- * managers, the hooks a pool of each kind may be born with, the hooks' own numbers, and the
4
- * two-step collector handover. Plain writes to the managers and the hooks; no router.
3
+ * managers, the policies a pool of each kind may be born with, the policies' own numbers, and the
4
+ * two-step collector handover. Plain writes to the managers and the policies; no router.
5
5
  *
6
6
  * One vocabulary (decisions 040): both managers call the protocol's cut of the mint fee
7
7
  * `MINT_FEE_PROTOCOL_CUT` and set it through `setFeeParams(uint256)` — one cut each since C
8
- * version 4 / F version 14. The harvest's cut is the hook's answer at every harvest (decisions
9
- * 044), set on the hook (`setHarvestCut`) and capped by the manager (`HARVEST_CUT_MAX`); the
8
+ * version 4 / F version 14. The harvest's cut is the policy's answer at every harvest (decisions
9
+ * 044), set on the policy (`setHarvestCut`) and capped by the manager (`HARVEST_CUT_MAX`); the
10
10
  * release's protocol share likewise (`POT_CUT_MAX`).
11
11
  */
12
- import { cPoolManagerAbi, fPoolManagerAbi, padHookAbi, polHookAbi, publicHookAbi } from "./generated.js";
13
- import { F_KIND, fHookBaseAbi } from "./fpool.js";
12
+ import { cPoolManagerAbi, fPoolManagerAbi, padPolicyAbi, polPolicyAbi, publicPolicyAbi } from "./generated.js";
13
+ import { F_KIND, fPolicyBaseAbi } from "./fpool.js";
14
14
  function wallet(c) {
15
15
  if (!c.wallet)
16
16
  throw new Error("a wallet client is required");
@@ -28,36 +28,36 @@ export async function setFeeParams(c, mintFeeProtocolCutWad) {
28
28
  return write(c, c.addresses.fPoolManager, fPoolManagerAbi, "setFeeParams", [mintFeeProtocolCutWad]);
29
29
  }
30
30
  /**
31
- * Approve a hook for pools of `kind` to be born with, or withdraw the approval (decisions 041,
32
- * 044). Read at `initialize` and never again: a live pool keeps its hook.
31
+ * Approve a policy for pools of `kind` to be born with, or withdraw the approval (decisions 041,
32
+ * 044). Read at `initialize` and never again: a live pool keeps its policy.
33
33
  */
34
- export async function setHookApproved(c, kind, hook, approved) {
35
- return write(c, c.addresses.fPoolManager, fPoolManagerAbi, "setHookApproved", [F_KIND[kind], hook, approved]);
34
+ export async function setPolicyApproved(c, kind, policy, approved) {
35
+ return write(c, c.addresses.fPoolManager, fPoolManagerAbi, "setPolicyApproved", [F_KIND[kind], policy, approved]);
36
36
  }
37
- /** Whether `hook` is approved for pools of `kind`. */
38
- export async function hookApproved(c, kind, hook) {
39
- return c.public.readContract({ address: c.addresses.fPoolManager, abi: fPoolManagerAbi, functionName: "hookApproved", args: [F_KIND[kind], hook] });
37
+ /** Whether `policy` is approved for pools of `kind`. */
38
+ export async function policyApproved(c, kind, policy) {
39
+ return c.public.readContract({ address: c.addresses.fPoolManager, abi: fPoolManagerAbi, functionName: "policyApproved", args: [F_KIND[kind], policy] });
40
40
  }
41
- // ─── the hooks' numbers (the collector's; each bounded where it reaches the manager) ─────
42
- /** The protocol's rate on the income part of every harvest under `hook`, WAD ≤ `HARVEST_CUT_MAX`. */
43
- export async function setHarvestCut(c, hook, rateWad) {
44
- return write(c, hook, fHookBaseAbi, "setHarvestCut", [rateWad]);
41
+ // ─── the policies' numbers (the collector's; each bounded where it reaches the manager) ─────
42
+ /** The protocol's rate on the income part of every harvest under `policy`, WAD ≤ `HARVEST_CUT_MAX`. */
43
+ export async function setHarvestCut(c, policy, rateWad) {
44
+ return write(c, policy, fPolicyBaseAbi, "setHarvestCut", [rateWad]);
45
45
  }
46
- /** `PadHook.setSchedule`: `T(0)`, the rung's growth, the creator's and the protocol's shares of the pot (≤ `POT_CUT_MAX`), the burn per rung (≤ `BURN_MAX`). */
47
- export async function padSetSchedule(c, hook, s) {
48
- return write(c, hook, padHookAbi, "setSchedule", [s.thresholdBase, s.thresholdGrowth, s.creatorShare, s.protocolShare, s.burnPerRung]);
46
+ /** `PadPolicy.setSchedule`: `T(0)`, the rung's growth, the creator's and the protocol's shares of the pot (≤ `POT_CUT_MAX`), the burn per rung (≤ `BURN_MAX`). */
47
+ export async function padSetSchedule(c, policy, s) {
48
+ return write(c, policy, padPolicyAbi, "setSchedule", [s.thresholdBase, s.thresholdGrowth, s.creatorShare, s.protocolShare, s.burnPerRung]);
49
49
  }
50
- /** `PolHook.setPolicy`: what every harvest leaves in the bid and what a relaunch's seed must bring, WAD fractions of L. */
51
- export async function polSetPolicy(c, hook, s) {
52
- return write(c, hook, polHookAbi, "setPolicy", [s.keepQuote, s.minQuoteAtSeed]);
50
+ /** `PolPolicy.setRules`: what every harvest leaves in the bid and what a relaunch's seed must bring, WAD fractions of L. */
51
+ export async function polSetRules(c, policy, s) {
52
+ return write(c, policy, polPolicyAbi, "setRules", [s.keepQuote, s.minQuoteAtSeed]);
53
53
  }
54
- /** `PublicHook.setListed`: an asset a curated seed may hold. */
55
- export async function publicSetListed(c, hook, token, listed) {
56
- return write(c, hook, publicHookAbi, "setListed", [token, listed]);
54
+ /** `PublicPolicy.setListed`: an asset a curated seed may hold. */
55
+ export async function publicSetListed(c, policy, token, listed) {
56
+ return write(c, policy, publicPolicyAbi, "setListed", [token, listed]);
57
57
  }
58
- /** `PublicHook.setCurated`: whether every public seed is checked against the list. */
59
- export async function publicSetCurated(c, hook, curated) {
60
- return write(c, hook, publicHookAbi, "setCurated", [curated]);
58
+ /** `PublicPolicy.setCurated`: whether every public seed is checked against the list. */
59
+ export async function publicSetCurated(c, policy, curated) {
60
+ return write(c, policy, publicPolicyAbi, "setCurated", [curated]);
61
61
  }
62
62
  export async function proposeCollector(c, side, next) {
63
63
  const address = side === "C" ? c.addresses.cPoolManager : c.addresses.fPoolManager;
package/dist/client.d.ts CHANGED
@@ -22,13 +22,13 @@ export interface LogswapAddresses {
22
22
  */
23
23
  fPoolManager?: Address;
24
24
  /**
25
- * The protocol's four F hooks, one per kind (decisions 044): every F pool names one in its key,
25
+ * The protocol's four F policies, one per kind (decisions 044): every F pool names one in its key,
26
26
  * and the pool's roles, gates and terms live on it. A deployment predating them carries none.
27
27
  */
28
- publicHook?: Address;
29
- privateHook?: Address;
30
- polHook?: Address;
31
- padHook?: Address;
28
+ publicPolicy?: Address;
29
+ privatePolicy?: Address;
30
+ polPolicy?: Address;
31
+ padPolicy?: Address;
32
32
  /** Optional — the router falls back to plain approvals when absent. */
33
33
  permit2?: Address;
34
34
  }
@@ -77,5 +77,5 @@ export declare const EXPECTED_VERSION = 4n;
77
77
  * passes it; when one lands, raise this constant in the same change, which is the discipline
78
78
  * `EXPECTED_VERSION` enforces mechanically and this one asks for.
79
79
  */
80
- export declare const EXPECTED_F_VERSION = 15n;
80
+ export declare const EXPECTED_F_VERSION = 16n;
81
81
  export declare function assertVersion(c: LogswapClient, expected?: bigint): Promise<void>;
package/dist/client.js CHANGED
@@ -71,16 +71,19 @@ export const EXPECTED_VERSION = 4n;
71
71
  // is voided by the handover of the role that granted it); `setLegs` needs a generation to have
72
72
  // lived (`gen > 0`); `initialize` refuses a codeless base and `mint` refuses `to = address(0)`
73
73
  // on both managers. Layout unchanged.
74
- // 14 (2026-09-20): the hook (decisions 041) — `FPoolKey.hook`, every pool id moves; `dissolve` is
74
+ // 14 (2026-09-20): the policy (decisions 041) — `FPoolKey.policy`, every pool id moves; `dissolve` is
75
75
  // `retire`, `regenerate` releases the dead shares' pot, `harvestable`/`unharvested` are the
76
76
  // readouts; `feePerL`, `edgePerL`, `HARVEST_PROTOCOL_CUT`, `harvestCutExempt` are gone.
77
- // 15 (2026-09-20): the hook answers every question (decisions 044) — `FPoolKey.authority` is
78
- // `creator` (every pool id moves again); the roles, gates and list are the pool's HOOK's
79
- // (`FHookBase` / `PrivateHook`), not the manager's: `getPool` has `hook` and `asks` and no
80
- // role; `proposeAuthority`, `appointOperator`, `setGates`, `setAllowed` are hook writes;
81
- // `hookApproved(kind, hook)` / `setHookApproved(kind, hook, ok)`; `Regenerated` names the payee;
82
- // `HARVEST_CUT_MAX` / `POT_CUT_MAX` cap what a hook may route to the protocol.
83
- export const EXPECTED_F_VERSION = 15n;
77
+ // 15 (2026-09-20): the policy answers every question (decisions 044) — `FPoolKey.authority` is
78
+ // `creator` (every pool id moves again); the roles, gates and list are the pool's POLICY's
79
+ // (`FPolicyBase` / `PrivatePolicy`), not the manager's: `getPool` has `policy` and `asks` and no
80
+ // role; `proposeAuthority`, `appointOperator`, `setGates`, `setAllowed` are policy writes;
81
+ // `policyApproved(kind, policy)` / `setPolicyApproved(kind, policy, ok)`; `Regenerated` names the payee;
82
+ // `HARVEST_CUT_MAX` / `POT_CUT_MAX` cap what a policy may route to the protocol.
83
+ // 16 (2026-09-21): the word is POLICY (decisions 045) — a rename, no pool id moves: `FPoolKey.policy`,
84
+ // `IFPolicy`, `FPolicyBase`, `PublicPolicy` … `PadPolicy`, `policyApproved` / `setPolicyApproved`,
85
+ // `PolicyApproved`; `PolPolicy.setPolicy` / `PolicySet` are `setRules` / `RulesSet`.
86
+ export const EXPECTED_F_VERSION = 16n;
84
87
  export async function assertVersion(c, expected = EXPECTED_VERSION) {
85
88
  const { cPoolManagerAbi } = await import("./generated.js");
86
89
  const got = await c.public.readContract({