@logswap/sdk 0.5.42 → 0.5.44
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 +7 -4
- package/dist/admin.js +9 -6
- package/dist/client.d.ts +1 -1
- package/dist/client.js +10 -1
- package/dist/fpool.d.ts +7 -3548
- package/dist/fpool.js +9 -9
- package/dist/generated.d.ts +212 -1613
- package/dist/generated.js +140 -1169
- package/package.json +1 -1
- package/src/admin.ts +9 -6
- package/src/client.ts +10 -1
- package/src/fpool.ts +9 -9
- package/src/generated.ts +140 -1171
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logswap/sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.44",
|
|
4
4
|
"description": "TypeScript SDK for Logswap, the liquidity primitive introducing the logarithmic invariant — typed wrappers over the CPoolManager / FPoolManager / Router / Lens surface.",
|
|
5
5
|
"license": "GPL-2.0-or-later",
|
|
6
6
|
"type": "module",
|
package/src/admin.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* admin — the protocol's (feeCollector's) writes: the
|
|
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): the C manager's `setProtocolFeeCut` / `PROTOCOL_FEE_CUT` are the
|
|
5
|
+
* same words as F's `setFeeParams` / `MINT_FEE_PROTOCOL_CUT` until C version 4 renames them.
|
|
4
6
|
*/
|
|
5
7
|
|
|
6
8
|
import type { Address, Hash, Hex } from "viem";
|
|
@@ -15,11 +17,12 @@ function wallet(c: LogswapClient) {
|
|
|
15
17
|
export async function setProtocolFeeCut(c: LogswapClient, cutWad: bigint): Promise<Hash> {
|
|
16
18
|
return wallet(c).writeContract({ address: c.addresses.cPoolManager, abi: cPoolManagerAbi, functionName: "setProtocolFeeCut", args: [cutWad], chain: c.wallet!.chain, account: c.wallet!.account! } as never);
|
|
17
19
|
}
|
|
18
|
-
export async function setFeeParams(c: LogswapClient, mintFeeProtocolCutWad: bigint,
|
|
19
|
-
return wallet(c).writeContract({ address: c.addresses.fPoolManager as Address, abi: fPoolManagerAbi, functionName: "setFeeParams", args: [mintFeeProtocolCutWad,
|
|
20
|
+
export async function setFeeParams(c: LogswapClient, mintFeeProtocolCutWad: bigint, harvestProtocolCutWad: bigint): Promise<Hash> {
|
|
21
|
+
return wallet(c).writeContract({ address: c.addresses.fPoolManager as Address, abi: fPoolManagerAbi, functionName: "setFeeParams", args: [mintFeeProtocolCutWad, harvestProtocolCutWad], chain: c.wallet!.chain, account: c.wallet!.account! } as never);
|
|
20
22
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
/** Waive the protocol's cut of harvested income for one pool (`HARVEST_PROTOCOL_CUT`; F version 13 — `setHarvestFeeExempt` before). */
|
|
24
|
+
export async function setHarvestCutExempt(c: LogswapClient, poolId: Hex, exempt: boolean): Promise<Hash> {
|
|
25
|
+
return wallet(c).writeContract({ address: c.addresses.fPoolManager as Address, abi: fPoolManagerAbi, functionName: "setHarvestCutExempt", args: [poolId, exempt], chain: c.wallet!.chain, account: c.wallet!.account! } as never);
|
|
23
26
|
}
|
|
24
27
|
export async function proposeCollector(c: LogswapClient, side: "C" | "F", next: Address): Promise<Hash> {
|
|
25
28
|
const address = side === "C" ? c.addresses.cPoolManager : (c.addresses.fPoolManager as Address);
|
package/src/client.ts
CHANGED
|
@@ -88,7 +88,16 @@ export const EXPECTED_VERSION = 3n;
|
|
|
88
88
|
// `Pool.pendingOperator`); `setLegL`/`admitLeg` are gone, `setLegs` edits the next generation's
|
|
89
89
|
// table while unseeded; `fPoolRelaunch` takes `legs`.
|
|
90
90
|
// `getPool` decodes one field fewer, so a 9 deployment's struct no longer matches this SDK.
|
|
91
|
-
|
|
91
|
+
// 12 (2026-09-17): one contract (decisions 039) — the sponsor facet is folded back into the
|
|
92
|
+
// manager; `sponsor()` and the fallback are gone, every entry, error and event unchanged, so
|
|
93
|
+
// `fPoolManagerAbi` is the manager's own ABI and no longer a union. Layout unchanged.
|
|
94
|
+
// 13 (2026-09-18): one vocabulary (decisions 040) — `HARVEST_FEE` is `HARVEST_PROTOCOL_CUT` (a
|
|
95
|
+
// cut of harvested income, not a fee on the harvest) and the exemption is `harvestCutExempt` /
|
|
96
|
+
// `setHarvestCutExempt`; `acceptAuthority` clears the operator, pending and accepted (a mandate
|
|
97
|
+
// is voided by the handover of the role that granted it); `setLegs` needs a generation to have
|
|
98
|
+
// lived (`gen > 0`); `initialize` refuses a codeless base and `mint` refuses `to = address(0)`
|
|
99
|
+
// on both managers. Layout unchanged.
|
|
100
|
+
export const EXPECTED_F_VERSION = 13n;
|
|
92
101
|
|
|
93
102
|
export async function assertVersion(c: LogswapClient, expected = EXPECTED_VERSION): Promise<void> {
|
|
94
103
|
const { cPoolManagerAbi } = await import("./generated.js");
|
package/src/fpool.ts
CHANGED
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
import { encodeFunctionData, toFunctionSelector, type Address, type Hash, type Hex } from "viem";
|
|
27
|
-
import { fPoolManagerAbi
|
|
27
|
+
import { fPoolManagerAbi, logswapRouterAbi } from "./generated.js";
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* and
|
|
30
|
+
* One contract, one ABI (decisions 039, F version 12): the sponsor surface — `harvest`, `claim`,
|
|
31
|
+
* `dissolve`, the handover, the gates, the operator, `setLegs`, the names, the fee parameters —
|
|
32
|
+
* is `FPoolManager`'s own code again. From 031 to 038 it was a delegatecall facet
|
|
33
|
+
* (`FPoolSponsor`) and this ABI was the union of the two compiled halves; the union is gone with
|
|
34
|
+
* the facet, and the generated ABI is the whole surface.
|
|
35
35
|
*/
|
|
36
|
-
export
|
|
36
|
+
export { fPoolManagerAbi };
|
|
37
37
|
import type { LogswapClient } from "./client.js";
|
|
38
38
|
|
|
39
39
|
const WAD = 10n ** 18n;
|
|
@@ -930,8 +930,8 @@ export async function fPoolEmptyingHarvests(c: LogswapClient, poolId: Hex): Prom
|
|
|
930
930
|
const [p, feePerL, fee, exempt, collector] = await Promise.all([
|
|
931
931
|
rd<{ Q: bigint; L: bigint; kind: number; incomeTaken: bigint }>("getPool", [poolId]),
|
|
932
932
|
rd<bigint>("feePerL", [poolId]),
|
|
933
|
-
rd<bigint>("
|
|
934
|
-
rd<boolean>("
|
|
933
|
+
rd<bigint>("HARVEST_PROTOCOL_CUT"),
|
|
934
|
+
rd<boolean>("harvestCutExempt", [poolId]),
|
|
935
935
|
rd<Address>("feeCollector"),
|
|
936
936
|
]);
|
|
937
937
|
if (p.Q === 0n) return [];
|