@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 +19 -19
- package/dist/admin.js +29 -29
- package/dist/client.d.ts +6 -6
- package/dist/client.js +11 -8
- package/dist/fpool.d.ts +82 -82
- package/dist/fpool.js +99 -99
- package/dist/generated.d.ts +103 -103
- package/dist/generated.js +132 -79
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/admin.ts +29 -29
- package/src/client.ts +16 -13
- package/src/fpool.ts +133 -133
- package/src/generated.ts +132 -79
- package/src/index.ts +1 -1
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
|
|
4
|
-
* two-step collector handover. Plain writes to the managers and the
|
|
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
|
|
9
|
-
* 044), set on 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
|
|
21
|
-
* 044). Read at `initialize` and never again: a live pool keeps its
|
|
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
|
|
24
|
-
/** Whether `
|
|
25
|
-
export declare function
|
|
26
|
-
/** The protocol's rate on the income part of every harvest under `
|
|
27
|
-
export declare function setHarvestCut(c: LogswapClient,
|
|
28
|
-
/** `
|
|
29
|
-
export declare function padSetSchedule(c: LogswapClient,
|
|
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
|
-
/** `
|
|
37
|
-
export declare function
|
|
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
|
-
/** `
|
|
42
|
-
export declare function publicSetListed(c: LogswapClient,
|
|
43
|
-
/** `
|
|
44
|
-
export declare function publicSetCurated(c: LogswapClient,
|
|
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
|
|
4
|
-
* two-step collector handover. Plain writes to the managers and the
|
|
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
|
|
9
|
-
* 044), set on 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,
|
|
13
|
-
import { F_KIND,
|
|
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
|
|
32
|
-
* 044). Read at `initialize` and never again: a live pool keeps its
|
|
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
|
|
35
|
-
return write(c, c.addresses.fPoolManager, fPoolManagerAbi, "
|
|
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 `
|
|
38
|
-
export async function
|
|
39
|
-
return c.public.readContract({ address: c.addresses.fPoolManager, abi: fPoolManagerAbi, functionName: "
|
|
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
|
|
42
|
-
/** The protocol's rate on the income part of every harvest under `
|
|
43
|
-
export async function setHarvestCut(c,
|
|
44
|
-
return write(c,
|
|
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
|
-
/** `
|
|
47
|
-
export async function padSetSchedule(c,
|
|
48
|
-
return write(c,
|
|
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
|
-
/** `
|
|
51
|
-
export async function
|
|
52
|
-
return write(c,
|
|
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
|
-
/** `
|
|
55
|
-
export async function publicSetListed(c,
|
|
56
|
-
return write(c,
|
|
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
|
-
/** `
|
|
59
|
-
export async function publicSetCurated(c,
|
|
60
|
-
return write(c,
|
|
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
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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 =
|
|
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
|
|
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
|
|
78
|
-
// `creator` (every pool id moves again); the roles, gates and list are the pool's
|
|
79
|
-
// (`
|
|
80
|
-
// role; `proposeAuthority`, `appointOperator`, `setGates`, `setAllowed` are
|
|
81
|
-
// `
|
|
82
|
-
// `HARVEST_CUT_MAX` / `POT_CUT_MAX` cap what a
|
|
83
|
-
|
|
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({
|