@logswap/sdk 0.5.43 → 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 +7 -1
- package/dist/fpool.js +2 -2
- package/dist/generated.d.ts +6 -6
- package/dist/generated.js +6 -6
- package/package.json +1 -1
- package/src/admin.ts +9 -6
- package/src/client.ts +7 -1
- package/src/fpool.ts +2 -2
- package/src/generated.ts +6 -6
package/dist/admin.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
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
|
import type { Address, Hash, Hex } from "viem";
|
|
6
8
|
import type { LogswapClient } from "./client.js";
|
|
7
9
|
export declare function setProtocolFeeCut(c: LogswapClient, cutWad: bigint): Promise<Hash>;
|
|
8
|
-
export declare function setFeeParams(c: LogswapClient, mintFeeProtocolCutWad: bigint,
|
|
9
|
-
|
|
10
|
+
export declare function setFeeParams(c: LogswapClient, mintFeeProtocolCutWad: bigint, harvestProtocolCutWad: bigint): Promise<Hash>;
|
|
11
|
+
/** Waive the protocol's cut of harvested income for one pool (`HARVEST_PROTOCOL_CUT`; F version 13 — `setHarvestFeeExempt` before). */
|
|
12
|
+
export declare function setHarvestCutExempt(c: LogswapClient, poolId: Hex, exempt: boolean): Promise<Hash>;
|
|
10
13
|
export declare function proposeCollector(c: LogswapClient, side: "C" | "F", next: Address): Promise<Hash>;
|
|
11
14
|
export declare function acceptCollector(c: LogswapClient, side: "C" | "F"): Promise<Hash>;
|
package/dist/admin.js
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
|
import { cPoolManagerAbi, fPoolManagerAbi } from "./generated.js";
|
|
6
8
|
function wallet(c) {
|
|
@@ -11,11 +13,12 @@ function wallet(c) {
|
|
|
11
13
|
export async function setProtocolFeeCut(c, cutWad) {
|
|
12
14
|
return wallet(c).writeContract({ address: c.addresses.cPoolManager, abi: cPoolManagerAbi, functionName: "setProtocolFeeCut", args: [cutWad], chain: c.wallet.chain, account: c.wallet.account });
|
|
13
15
|
}
|
|
14
|
-
export async function setFeeParams(c, mintFeeProtocolCutWad,
|
|
15
|
-
return wallet(c).writeContract({ address: c.addresses.fPoolManager, abi: fPoolManagerAbi, functionName: "setFeeParams", args: [mintFeeProtocolCutWad,
|
|
16
|
+
export async function setFeeParams(c, mintFeeProtocolCutWad, harvestProtocolCutWad) {
|
|
17
|
+
return wallet(c).writeContract({ address: c.addresses.fPoolManager, abi: fPoolManagerAbi, functionName: "setFeeParams", args: [mintFeeProtocolCutWad, harvestProtocolCutWad], chain: c.wallet.chain, account: c.wallet.account });
|
|
16
18
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
/** Waive the protocol's cut of harvested income for one pool (`HARVEST_PROTOCOL_CUT`; F version 13 — `setHarvestFeeExempt` before). */
|
|
20
|
+
export async function setHarvestCutExempt(c, poolId, exempt) {
|
|
21
|
+
return wallet(c).writeContract({ address: c.addresses.fPoolManager, abi: fPoolManagerAbi, functionName: "setHarvestCutExempt", args: [poolId, exempt], chain: c.wallet.chain, account: c.wallet.account });
|
|
19
22
|
}
|
|
20
23
|
export async function proposeCollector(c, side, next) {
|
|
21
24
|
const address = side === "C" ? c.addresses.cPoolManager : c.addresses.fPoolManager;
|
package/dist/client.d.ts
CHANGED
|
@@ -64,5 +64,5 @@ export declare const EXPECTED_VERSION = 3n;
|
|
|
64
64
|
* passes it; when one lands, raise this constant in the same change, which is the discipline
|
|
65
65
|
* `EXPECTED_VERSION` enforces mechanically and this one asks for.
|
|
66
66
|
*/
|
|
67
|
-
export declare const EXPECTED_F_VERSION =
|
|
67
|
+
export declare const EXPECTED_F_VERSION = 13n;
|
|
68
68
|
export declare function assertVersion(c: LogswapClient, expected?: bigint): Promise<void>;
|
package/dist/client.js
CHANGED
|
@@ -60,7 +60,13 @@ export const EXPECTED_VERSION = 3n;
|
|
|
60
60
|
// 12 (2026-09-17): one contract (decisions 039) — the sponsor facet is folded back into the
|
|
61
61
|
// manager; `sponsor()` and the fallback are gone, every entry, error and event unchanged, so
|
|
62
62
|
// `fPoolManagerAbi` is the manager's own ABI and no longer a union. Layout unchanged.
|
|
63
|
-
|
|
63
|
+
// 13 (2026-09-18): one vocabulary (decisions 040) — `HARVEST_FEE` is `HARVEST_PROTOCOL_CUT` (a
|
|
64
|
+
// cut of harvested income, not a fee on the harvest) and the exemption is `harvestCutExempt` /
|
|
65
|
+
// `setHarvestCutExempt`; `acceptAuthority` clears the operator, pending and accepted (a mandate
|
|
66
|
+
// is voided by the handover of the role that granted it); `setLegs` needs a generation to have
|
|
67
|
+
// lived (`gen > 0`); `initialize` refuses a codeless base and `mint` refuses `to = address(0)`
|
|
68
|
+
// on both managers. Layout unchanged.
|
|
69
|
+
export const EXPECTED_F_VERSION = 13n;
|
|
64
70
|
export async function assertVersion(c, expected = EXPECTED_VERSION) {
|
|
65
71
|
const { cPoolManagerAbi } = await import("./generated.js");
|
|
66
72
|
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("
|
|
646
|
-
rd("
|
|
645
|
+
rd("HARVEST_PROTOCOL_CUT"),
|
|
646
|
+
rd("harvestCutExempt", [poolId]),
|
|
647
647
|
rd("feeCollector"),
|
|
648
648
|
]);
|
|
649
649
|
if (p.Q === 0n)
|
package/dist/generated.d.ts
CHANGED
|
@@ -1810,7 +1810,7 @@ export declare const fPoolManagerAbi: readonly [{
|
|
|
1810
1810
|
}, {
|
|
1811
1811
|
readonly type: "function";
|
|
1812
1812
|
readonly inputs: readonly [];
|
|
1813
|
-
readonly name: "
|
|
1813
|
+
readonly name: "HARVEST_PROTOCOL_CUT";
|
|
1814
1814
|
readonly outputs: readonly [{
|
|
1815
1815
|
readonly name: "";
|
|
1816
1816
|
readonly internalType: "uint256";
|
|
@@ -2327,7 +2327,7 @@ export declare const fPoolManagerAbi: readonly [{
|
|
|
2327
2327
|
readonly internalType: "bytes32";
|
|
2328
2328
|
readonly type: "bytes32";
|
|
2329
2329
|
}];
|
|
2330
|
-
readonly name: "
|
|
2330
|
+
readonly name: "harvestCutExempt";
|
|
2331
2331
|
readonly outputs: readonly [{
|
|
2332
2332
|
readonly name: "";
|
|
2333
2333
|
readonly internalType: "bool";
|
|
@@ -2761,7 +2761,7 @@ export declare const fPoolManagerAbi: readonly [{
|
|
|
2761
2761
|
readonly internalType: "uint256";
|
|
2762
2762
|
readonly type: "uint256";
|
|
2763
2763
|
}, {
|
|
2764
|
-
readonly name: "
|
|
2764
|
+
readonly name: "harvestProtocolCut";
|
|
2765
2765
|
readonly internalType: "uint256";
|
|
2766
2766
|
readonly type: "uint256";
|
|
2767
2767
|
}];
|
|
@@ -2797,7 +2797,7 @@ export declare const fPoolManagerAbi: readonly [{
|
|
|
2797
2797
|
readonly internalType: "bool";
|
|
2798
2798
|
readonly type: "bool";
|
|
2799
2799
|
}];
|
|
2800
|
-
readonly name: "
|
|
2800
|
+
readonly name: "setHarvestCutExempt";
|
|
2801
2801
|
readonly outputs: readonly [];
|
|
2802
2802
|
readonly stateMutability: "nonpayable";
|
|
2803
2803
|
}, {
|
|
@@ -3360,7 +3360,7 @@ export declare const fPoolManagerAbi: readonly [{
|
|
|
3360
3360
|
readonly type: "uint256";
|
|
3361
3361
|
readonly indexed: false;
|
|
3362
3362
|
}, {
|
|
3363
|
-
readonly name: "
|
|
3363
|
+
readonly name: "harvestProtocolCut";
|
|
3364
3364
|
readonly internalType: "uint256";
|
|
3365
3365
|
readonly type: "uint256";
|
|
3366
3366
|
readonly indexed: false;
|
|
@@ -3425,7 +3425,7 @@ export declare const fPoolManagerAbi: readonly [{
|
|
|
3425
3425
|
readonly type: "bool";
|
|
3426
3426
|
readonly indexed: false;
|
|
3427
3427
|
}];
|
|
3428
|
-
readonly name: "
|
|
3428
|
+
readonly name: "HarvestCutExemptSet";
|
|
3429
3429
|
}, {
|
|
3430
3430
|
readonly type: "event";
|
|
3431
3431
|
readonly anonymous: false;
|
package/dist/generated.js
CHANGED
|
@@ -1086,7 +1086,7 @@ export const fPoolManagerAbi = [
|
|
|
1086
1086
|
{
|
|
1087
1087
|
type: 'function',
|
|
1088
1088
|
inputs: [],
|
|
1089
|
-
name: '
|
|
1089
|
+
name: 'HARVEST_PROTOCOL_CUT',
|
|
1090
1090
|
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
1091
1091
|
stateMutability: 'view',
|
|
1092
1092
|
},
|
|
@@ -1362,7 +1362,7 @@ export const fPoolManagerAbi = [
|
|
|
1362
1362
|
{
|
|
1363
1363
|
type: 'function',
|
|
1364
1364
|
inputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
|
|
1365
|
-
name: '
|
|
1365
|
+
name: 'harvestCutExempt',
|
|
1366
1366
|
outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
|
|
1367
1367
|
stateMutability: 'view',
|
|
1368
1368
|
},
|
|
@@ -1598,7 +1598,7 @@ export const fPoolManagerAbi = [
|
|
|
1598
1598
|
type: 'function',
|
|
1599
1599
|
inputs: [
|
|
1600
1600
|
{ name: 'mintFeeProtocolCut', internalType: 'uint256', type: 'uint256' },
|
|
1601
|
-
{ name: '
|
|
1601
|
+
{ name: 'harvestProtocolCut', internalType: 'uint256', type: 'uint256' },
|
|
1602
1602
|
],
|
|
1603
1603
|
name: 'setFeeParams',
|
|
1604
1604
|
outputs: [],
|
|
@@ -1621,7 +1621,7 @@ export const fPoolManagerAbi = [
|
|
|
1621
1621
|
{ name: 'poolId', internalType: 'bytes32', type: 'bytes32' },
|
|
1622
1622
|
{ name: 'exempt', internalType: 'bool', type: 'bool' },
|
|
1623
1623
|
],
|
|
1624
|
-
name: '
|
|
1624
|
+
name: 'setHarvestCutExempt',
|
|
1625
1625
|
outputs: [],
|
|
1626
1626
|
stateMutability: 'nonpayable',
|
|
1627
1627
|
},
|
|
@@ -2027,7 +2027,7 @@ export const fPoolManagerAbi = [
|
|
|
2027
2027
|
indexed: false,
|
|
2028
2028
|
},
|
|
2029
2029
|
{
|
|
2030
|
-
name: '
|
|
2030
|
+
name: 'harvestProtocolCut',
|
|
2031
2031
|
internalType: 'uint256',
|
|
2032
2032
|
type: 'uint256',
|
|
2033
2033
|
indexed: false,
|
|
@@ -2088,7 +2088,7 @@ export const fPoolManagerAbi = [
|
|
|
2088
2088
|
},
|
|
2089
2089
|
{ name: 'exempt', internalType: 'bool', type: 'bool', indexed: false },
|
|
2090
2090
|
],
|
|
2091
|
-
name: '
|
|
2091
|
+
name: 'HarvestCutExemptSet',
|
|
2092
2092
|
},
|
|
2093
2093
|
{
|
|
2094
2094
|
type: 'event',
|
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
|
@@ -91,7 +91,13 @@ export const EXPECTED_VERSION = 3n;
|
|
|
91
91
|
// 12 (2026-09-17): one contract (decisions 039) — the sponsor facet is folded back into the
|
|
92
92
|
// manager; `sponsor()` and the fallback are gone, every entry, error and event unchanged, so
|
|
93
93
|
// `fPoolManagerAbi` is the manager's own ABI and no longer a union. Layout unchanged.
|
|
94
|
-
|
|
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;
|
|
95
101
|
|
|
96
102
|
export async function assertVersion(c: LogswapClient, expected = EXPECTED_VERSION): Promise<void> {
|
|
97
103
|
const { cPoolManagerAbi } = await import("./generated.js");
|
package/src/fpool.ts
CHANGED
|
@@ -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 [];
|
package/src/generated.ts
CHANGED
|
@@ -1089,7 +1089,7 @@ export const fPoolManagerAbi = [
|
|
|
1089
1089
|
{
|
|
1090
1090
|
type: 'function',
|
|
1091
1091
|
inputs: [],
|
|
1092
|
-
name: '
|
|
1092
|
+
name: 'HARVEST_PROTOCOL_CUT',
|
|
1093
1093
|
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
|
|
1094
1094
|
stateMutability: 'view',
|
|
1095
1095
|
},
|
|
@@ -1365,7 +1365,7 @@ export const fPoolManagerAbi = [
|
|
|
1365
1365
|
{
|
|
1366
1366
|
type: 'function',
|
|
1367
1367
|
inputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }],
|
|
1368
|
-
name: '
|
|
1368
|
+
name: 'harvestCutExempt',
|
|
1369
1369
|
outputs: [{ name: '', internalType: 'bool', type: 'bool' }],
|
|
1370
1370
|
stateMutability: 'view',
|
|
1371
1371
|
},
|
|
@@ -1601,7 +1601,7 @@ export const fPoolManagerAbi = [
|
|
|
1601
1601
|
type: 'function',
|
|
1602
1602
|
inputs: [
|
|
1603
1603
|
{ name: 'mintFeeProtocolCut', internalType: 'uint256', type: 'uint256' },
|
|
1604
|
-
{ name: '
|
|
1604
|
+
{ name: 'harvestProtocolCut', internalType: 'uint256', type: 'uint256' },
|
|
1605
1605
|
],
|
|
1606
1606
|
name: 'setFeeParams',
|
|
1607
1607
|
outputs: [],
|
|
@@ -1624,7 +1624,7 @@ export const fPoolManagerAbi = [
|
|
|
1624
1624
|
{ name: 'poolId', internalType: 'bytes32', type: 'bytes32' },
|
|
1625
1625
|
{ name: 'exempt', internalType: 'bool', type: 'bool' },
|
|
1626
1626
|
],
|
|
1627
|
-
name: '
|
|
1627
|
+
name: 'setHarvestCutExempt',
|
|
1628
1628
|
outputs: [],
|
|
1629
1629
|
stateMutability: 'nonpayable',
|
|
1630
1630
|
},
|
|
@@ -2030,7 +2030,7 @@ export const fPoolManagerAbi = [
|
|
|
2030
2030
|
indexed: false,
|
|
2031
2031
|
},
|
|
2032
2032
|
{
|
|
2033
|
-
name: '
|
|
2033
|
+
name: 'harvestProtocolCut',
|
|
2034
2034
|
internalType: 'uint256',
|
|
2035
2035
|
type: 'uint256',
|
|
2036
2036
|
indexed: false,
|
|
@@ -2091,7 +2091,7 @@ export const fPoolManagerAbi = [
|
|
|
2091
2091
|
},
|
|
2092
2092
|
{ name: 'exempt', internalType: 'bool', type: 'bool', indexed: false },
|
|
2093
2093
|
],
|
|
2094
|
-
name: '
|
|
2094
|
+
name: 'HarvestCutExemptSet',
|
|
2095
2095
|
},
|
|
2096
2096
|
{
|
|
2097
2097
|
type: 'event',
|