@logswap/sdk 0.5.47 → 0.5.48
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/fpool.d.ts
CHANGED
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
*
|
|
15
15
|
* **Two products, one contract.** The basket (n > 1) and the launch (n = 1, the creator alone on
|
|
16
16
|
* the lever) are the same bytecode under two key fields — the KIND (what the manager promises
|
|
17
|
-
* structurally) and the
|
|
17
|
+
* structurally) and the POLICY (the pool's policy: its roles, its gates, the terms of every harvest
|
|
18
18
|
* and release; decisions 041, 044) — and nothing in the maths. `describeFPool` below reports
|
|
19
19
|
* which shape a given pool is, because a UI has to decide what to render.
|
|
20
20
|
*
|
|
21
|
-
* **The roles are the
|
|
22
|
-
* authority, operator, gate or list: it asks the pool's
|
|
23
|
-
* answer. So `getFPool` carries the
|
|
24
|
-
* roles FROM the
|
|
25
|
-
* is a write to the
|
|
21
|
+
* **The roles are the policy's, not the manager's** (F version 15). The manager holds no
|
|
22
|
+
* authority, operator, gate or list: it asks the pool's policy `may(who, action)` and acts on the
|
|
23
|
+
* answer. So `getFPool` carries the policy and what it declared, {@link getFPoolRoles} reads the
|
|
24
|
+
* roles FROM the policy, and every role write — the handover, the operator, the gates, the list —
|
|
25
|
+
* is a write to the policy ({@link fPoolProposeAuthority}, {@link fPoolSetGates}, …).
|
|
26
26
|
*
|
|
27
27
|
* **Zaps live on the ROUTER, not here.** Permit2 is AllowanceTransfer mode, whose standing
|
|
28
28
|
* allowance is keyed by spender, so a second router would cost the user an allowance per token
|
|
@@ -30,21 +30,21 @@
|
|
|
30
30
|
* `addresses.router`.
|
|
31
31
|
*/
|
|
32
32
|
import { type Address, type Hash, type Hex } from "viem";
|
|
33
|
-
import { fPoolManagerAbi,
|
|
33
|
+
import { fPoolManagerAbi, padPolicyAbi, polPolicyAbi, privatePolicyAbi, publicPolicyAbi } from "./generated.js";
|
|
34
34
|
/**
|
|
35
35
|
* One contract, one ABI (decisions 039, F version 12): `harvest`, `claim`, `retire`, `regenerate`,
|
|
36
36
|
* `setLegs`, the names, the fee parameters are `FPoolManager`'s own code. The roles left it for
|
|
37
|
-
* the
|
|
38
|
-
* {@link
|
|
37
|
+
* the policies in F version 15 (decisions 044): {@link fPolicyBaseAbi} is what every policy shares,
|
|
38
|
+
* {@link privatePolicyAbi} the desk's, {@link padPolicyAbi} / {@link polPolicyAbi} / {@link publicPolicyAbi}
|
|
39
39
|
* the kinds'.
|
|
40
40
|
*/
|
|
41
|
-
export { fPoolManagerAbi,
|
|
41
|
+
export { fPoolManagerAbi, padPolicyAbi, polPolicyAbi, privatePolicyAbi, publicPolicyAbi };
|
|
42
42
|
/**
|
|
43
|
-
* What every protocol
|
|
44
|
-
* `maxHarvest`. `
|
|
45
|
-
* in for the base — a call through it to any of the four
|
|
43
|
+
* What every protocol policy shares (`FPolicyBase`): the roles and their handover, `harvestCut`,
|
|
44
|
+
* `maxHarvest`. `polPolicyAbi` is a superset of it and carries nothing that collides, so it stands
|
|
45
|
+
* in for the base — a call through it to any of the four policies decodes the base's functions.
|
|
46
46
|
*/
|
|
47
|
-
export declare const
|
|
47
|
+
export declare const fPolicyBaseAbi: readonly [{
|
|
48
48
|
readonly type: "constructor";
|
|
49
49
|
readonly inputs: readonly [{
|
|
50
50
|
readonly name: "_manager";
|
|
@@ -138,7 +138,7 @@ export declare const fHookBaseAbi: readonly [{
|
|
|
138
138
|
readonly type: "function";
|
|
139
139
|
readonly inputs: readonly [{
|
|
140
140
|
readonly name: "a";
|
|
141
|
-
readonly internalType: "struct
|
|
141
|
+
readonly internalType: "struct IFPolicy.Ask";
|
|
142
142
|
readonly type: "tuple";
|
|
143
143
|
readonly components: readonly [{
|
|
144
144
|
readonly name: "poolId";
|
|
@@ -150,7 +150,7 @@ export declare const fHookBaseAbi: readonly [{
|
|
|
150
150
|
readonly type: "uint256";
|
|
151
151
|
}, {
|
|
152
152
|
readonly name: "action";
|
|
153
|
-
readonly internalType: "enum
|
|
153
|
+
readonly internalType: "enum IFPolicy.Action";
|
|
154
154
|
readonly type: "uint8";
|
|
155
155
|
}, {
|
|
156
156
|
readonly name: "who";
|
|
@@ -199,7 +199,7 @@ export declare const fHookBaseAbi: readonly [{
|
|
|
199
199
|
readonly type: "function";
|
|
200
200
|
readonly inputs: readonly [{
|
|
201
201
|
readonly name: "a";
|
|
202
|
-
readonly internalType: "struct
|
|
202
|
+
readonly internalType: "struct IFPolicy.Ask";
|
|
203
203
|
readonly type: "tuple";
|
|
204
204
|
readonly components: readonly [{
|
|
205
205
|
readonly name: "poolId";
|
|
@@ -211,7 +211,7 @@ export declare const fHookBaseAbi: readonly [{
|
|
|
211
211
|
readonly type: "uint256";
|
|
212
212
|
}, {
|
|
213
213
|
readonly name: "action";
|
|
214
|
-
readonly internalType: "enum
|
|
214
|
+
readonly internalType: "enum IFPolicy.Action";
|
|
215
215
|
readonly type: "uint8";
|
|
216
216
|
}, {
|
|
217
217
|
readonly name: "who";
|
|
@@ -281,7 +281,7 @@ export declare const fHookBaseAbi: readonly [{
|
|
|
281
281
|
readonly internalType: "enum Kind";
|
|
282
282
|
readonly type: "uint8";
|
|
283
283
|
}, {
|
|
284
|
-
readonly name: "
|
|
284
|
+
readonly name: "policy";
|
|
285
285
|
readonly internalType: "address";
|
|
286
286
|
readonly type: "address";
|
|
287
287
|
}, {
|
|
@@ -305,7 +305,7 @@ export declare const fHookBaseAbi: readonly [{
|
|
|
305
305
|
readonly type: "function";
|
|
306
306
|
readonly inputs: readonly [{
|
|
307
307
|
readonly name: "a";
|
|
308
|
-
readonly internalType: "struct
|
|
308
|
+
readonly internalType: "struct IFPolicy.Ask";
|
|
309
309
|
readonly type: "tuple";
|
|
310
310
|
readonly components: readonly [{
|
|
311
311
|
readonly name: "poolId";
|
|
@@ -317,7 +317,7 @@ export declare const fHookBaseAbi: readonly [{
|
|
|
317
317
|
readonly type: "uint256";
|
|
318
318
|
}, {
|
|
319
319
|
readonly name: "action";
|
|
320
|
-
readonly internalType: "enum
|
|
320
|
+
readonly internalType: "enum IFPolicy.Action";
|
|
321
321
|
readonly type: "uint8";
|
|
322
322
|
}, {
|
|
323
323
|
readonly name: "who";
|
|
@@ -348,7 +348,7 @@ export declare const fHookBaseAbi: readonly [{
|
|
|
348
348
|
readonly name: "onRegenerate";
|
|
349
349
|
readonly outputs: readonly [{
|
|
350
350
|
readonly name: "t";
|
|
351
|
-
readonly internalType: "struct
|
|
351
|
+
readonly internalType: "struct IFPolicy.Terms";
|
|
352
352
|
readonly type: "tuple";
|
|
353
353
|
readonly components: readonly [{
|
|
354
354
|
readonly name: "payee";
|
|
@@ -418,7 +418,7 @@ export declare const fHookBaseAbi: readonly [{
|
|
|
418
418
|
readonly internalType: "uint256";
|
|
419
419
|
readonly type: "uint256";
|
|
420
420
|
}];
|
|
421
|
-
readonly name: "
|
|
421
|
+
readonly name: "setRules";
|
|
422
422
|
readonly outputs: readonly [];
|
|
423
423
|
readonly stateMutability: "nonpayable";
|
|
424
424
|
}, {
|
|
@@ -485,7 +485,7 @@ export declare const fHookBaseAbi: readonly [{
|
|
|
485
485
|
readonly type: "uint256";
|
|
486
486
|
readonly indexed: false;
|
|
487
487
|
}];
|
|
488
|
-
readonly name: "
|
|
488
|
+
readonly name: "RulesSet";
|
|
489
489
|
}, {
|
|
490
490
|
readonly type: "error";
|
|
491
491
|
readonly inputs: readonly [];
|
|
@@ -512,7 +512,7 @@ export declare const fHookBaseAbi: readonly [{
|
|
|
512
512
|
readonly name: "Refused";
|
|
513
513
|
}];
|
|
514
514
|
import type { LogswapClient } from "./client.js";
|
|
515
|
-
/** The optional questions a
|
|
515
|
+
/** The optional questions a policy declared at birth (decisions 044), as bits of `Pool.asks`. */
|
|
516
516
|
export declare const ASK_SWAP = 1;
|
|
517
517
|
export declare const ASK_MINT = 2;
|
|
518
518
|
/** Everything scalar about a basket pool, in one round trip's worth of reads. */
|
|
@@ -542,10 +542,10 @@ export interface FPoolState {
|
|
|
542
542
|
/**
|
|
543
543
|
* The pool's policy (decisions 041, 044): the contract the key names, holding the pool's roles
|
|
544
544
|
* and answering every question the manager does not decide itself. Read its roles with
|
|
545
|
-
* {@link getFPoolRoles}; one of the deployment's four ({@link
|
|
545
|
+
* {@link getFPoolRoles}; one of the deployment's four ({@link fPoolPolicyFor}) on every protocol pool.
|
|
546
546
|
*/
|
|
547
|
-
|
|
548
|
-
/** Whether the
|
|
547
|
+
policy: Address;
|
|
548
|
+
/** Whether the policy asked to be consulted on swaps ({@link ASK_SWAP}) and mints ({@link ASK_MINT}) — the desk's policy does, no other. */
|
|
549
549
|
asks: number;
|
|
550
550
|
/** The sponsor's own label for this pool, mutable and never identity. "" when unnamed. */
|
|
551
551
|
name: string;
|
|
@@ -569,13 +569,13 @@ export interface FPoolState {
|
|
|
569
569
|
export declare function getFPool(c: LogswapClient, poolId: Hex): Promise<FPoolState>;
|
|
570
570
|
/**
|
|
571
571
|
* The kind of pool (decisions 036, 038, 044) — what the manager promises structurally, whatever
|
|
572
|
-
* the pool's
|
|
573
|
-
* creator; no gate, no operator. `private`, the desk: the one kind whose
|
|
572
|
+
* the pool's policy answers. `public`: the protocol's own pool — its policy requires the collector as
|
|
573
|
+
* creator; no gate, no operator. `private`, the desk: the one kind whose policy may gate swaps and
|
|
574
574
|
* mints, with an operator that reshapes the legs between generations. `pol`, a treasury's pool
|
|
575
575
|
* or a basket: composition and access fixed at birth. `pad`, a launch: a POL whose harvest is
|
|
576
|
-
* income only whatever its
|
|
576
|
+
* income only whatever its policy says and whose seed the contract minted to 0xdead — one asset,
|
|
577
577
|
* open to all. private → pol → pad is the ladder of rigidity; public is a pol held by the
|
|
578
|
-
* protocol. Every rate, role and gate is the
|
|
578
|
+
* protocol. Every rate, role and gate is the policy's.
|
|
579
579
|
*/
|
|
580
580
|
export type FPoolKind = "public" | "private" | "pol" | "pad";
|
|
581
581
|
/** The key's enum values. */
|
|
@@ -586,19 +586,19 @@ export declare const F_KIND: {
|
|
|
586
586
|
readonly pad: 3;
|
|
587
587
|
};
|
|
588
588
|
export declare function fPoolKindOf(n: number | bigint): FPoolKind;
|
|
589
|
-
/** The deployment's
|
|
590
|
-
export declare function
|
|
591
|
-
/** The
|
|
592
|
-
export declare function
|
|
589
|
+
/** The deployment's policy for a kind (decisions 044): what a key of that kind names. */
|
|
590
|
+
export declare function fPoolPolicyFor(c: LogswapClient, kind: FPoolKind): Address;
|
|
591
|
+
/** The policy a pool named in its key — one read; {@link getFPool} carries it too. */
|
|
592
|
+
export declare function fPoolPolicyOf(c: LogswapClient, poolId: Hex): Promise<Address>;
|
|
593
593
|
/**
|
|
594
|
-
* A pool's roles, as its
|
|
594
|
+
* A pool's roles, as its POLICY holds them (decisions 044). `creator` is immutable identity —
|
|
595
595
|
* who was born holding the pool; `authority` is the cold key that owns it now, the creator until
|
|
596
596
|
* a two-step handover; on the desk's kind the `operator` runs it (zero = the authority itself,
|
|
597
597
|
* {@link fPoolOperatorOf}) and the two gates and the list are its. Every other kind has no
|
|
598
598
|
* operator and no gate: those fields read zero / false.
|
|
599
599
|
*/
|
|
600
600
|
export interface FPoolRoles {
|
|
601
|
-
|
|
601
|
+
policy: Address;
|
|
602
602
|
creator: Address;
|
|
603
603
|
authority: Address;
|
|
604
604
|
/** The proposed next authority, until it accepts — zero when nothing is pending (decisions 020). */
|
|
@@ -607,11 +607,11 @@ export interface FPoolRoles {
|
|
|
607
607
|
pendingOperator: Address;
|
|
608
608
|
gateMint: boolean;
|
|
609
609
|
gateSwap: boolean;
|
|
610
|
-
/** The
|
|
610
|
+
/** The policy's own ceiling on a harvest now — the manager's `harvestable` narrowed by the policy's rule. */
|
|
611
611
|
maxHarvest: bigint;
|
|
612
612
|
}
|
|
613
|
-
/** Read a pool's roles from its
|
|
614
|
-
export declare function getFPoolRoles(c: LogswapClient, poolId: Hex, state?: Pick<FPoolState, "
|
|
613
|
+
/** Read a pool's roles from its policy. `state` saves the `getPool` round trip when already in hand. */
|
|
614
|
+
export declare function getFPoolRoles(c: LogswapClient, poolId: Hex, state?: Pick<FPoolState, "policy" | "kind">): Promise<FPoolRoles>;
|
|
615
615
|
/** Which of the two products a pool is configured as — a pad is a launch, anything else a basket/pool. A UI has to choose what to render. */
|
|
616
616
|
export type FPoolShape = "launch" | "basket";
|
|
617
617
|
export interface FPoolDescription {
|
|
@@ -626,7 +626,7 @@ export interface FPoolDescription {
|
|
|
626
626
|
* from the first wei after it.
|
|
627
627
|
*/
|
|
628
628
|
unharvested: bigint;
|
|
629
|
-
/** The most a harvest may take now by the KIND's promise: the bid, and on a pad the income. The
|
|
629
|
+
/** The most a harvest may take now by the KIND's promise: the bid, and on a pad the income. The policy may allow less — {@link FPoolRoles.maxHarvest}. */
|
|
630
630
|
harvestable: bigint;
|
|
631
631
|
/** The dead shares' banked dividend — a pad's pot, the creator's income until a rung is climbed (decisions 041). */
|
|
632
632
|
pot: bigint;
|
|
@@ -861,11 +861,11 @@ export interface FPoolCreateArgs {
|
|
|
861
861
|
kind: FPoolKind;
|
|
862
862
|
/**
|
|
863
863
|
* The pool's policy (decisions 041, 044): the contract the key names, approved by the protocol
|
|
864
|
-
* for the kind. Defaults to the deployment's
|
|
864
|
+
* for the kind. Defaults to the deployment's policy for `kind` ({@link fPoolPolicyFor}) — the one
|
|
865
865
|
* every protocol pool names.
|
|
866
866
|
*/
|
|
867
|
-
|
|
868
|
-
/** Who is born holding the pool: immutable identity, the pool's first authority (the
|
|
867
|
+
policy?: Address;
|
|
868
|
+
/** Who is born holding the pool: immutable identity, the pool's first authority (the policy records it). */
|
|
869
869
|
creator: Address;
|
|
870
870
|
/**
|
|
871
871
|
* The differentiator, and nothing else. Identity is the key's hash, so one sponsor cannot run
|
|
@@ -884,14 +884,14 @@ export declare function sortFPoolLegs<T>(bases: Address[], ...companions: T[][])
|
|
|
884
884
|
bases: Address[];
|
|
885
885
|
companions: T[][];
|
|
886
886
|
};
|
|
887
|
-
/** The key as the manager hashes it: legs sorted, the kind's
|
|
887
|
+
/** The key as the manager hashes it: legs sorted, the kind's policy filled in when none is named. */
|
|
888
888
|
export declare function fPoolKeyOf(c: LogswapClient, a: Omit<FPoolCreateArgs, "account">): {
|
|
889
889
|
quote: `0x${string}`;
|
|
890
890
|
bases: `0x${string}`[];
|
|
891
891
|
weights: bigint[];
|
|
892
892
|
phi: bigint;
|
|
893
893
|
kind: 0 | 1 | 3 | 2;
|
|
894
|
-
|
|
894
|
+
policy: `0x${string}`;
|
|
895
895
|
creator: `0x${string}`;
|
|
896
896
|
salt: `0x${string}`;
|
|
897
897
|
};
|
|
@@ -931,7 +931,7 @@ export declare function fPoolSeed(c: LogswapClient, a: {
|
|
|
931
931
|
* operator harvested it out first ({@link fPoolRetire} does both in one transaction). The live
|
|
932
932
|
* (S, Q, R_j) become a frozen bundle every share of this generation redeems ({@link fPoolRedeem})
|
|
933
933
|
* or rolls ({@link fPoolRollIn}), forever; the pool is unseeded until the next {@link fPoolSeed},
|
|
934
|
-
* which opens generation `gen + 1` under the same id,
|
|
934
|
+
* which opens generation `gen + 1` under the same id, policy, roles, gates and lists.
|
|
935
935
|
*/
|
|
936
936
|
export declare function fPoolRetireRaw(c: LogswapClient, a: {
|
|
937
937
|
poolId: Hex;
|
|
@@ -952,17 +952,17 @@ export declare function fPoolRetire(c: LogswapClient, a: {
|
|
|
952
952
|
* `retire` (decisions 035: a retire needs an empty bid on every pool). Since F version 14 one
|
|
953
953
|
* `harvest(Q)` does it: the protocol's cut leaves the pool with the amount (with no collector
|
|
954
954
|
* there is no cut). `[]` when the bid is already empty. Throws on a pad that still bids (its bid
|
|
955
|
-
* empties only as the market sells it down), and when the pool's
|
|
956
|
-
* (`
|
|
955
|
+
* empties only as the market sells it down), and when the pool's policy keeps a floor on the bid
|
|
956
|
+
* (`PolPolicy.keepQuote`, decisions 044): a `retire` under that policy waits for the market.
|
|
957
957
|
*/
|
|
958
958
|
export declare function fPoolEmptyingHarvests(c: LogswapClient, poolId: Hex): Promise<bigint[]>;
|
|
959
959
|
/**
|
|
960
|
-
* Release the dead shares' pot under the
|
|
960
|
+
* Release the dead shares' pot under the policy's terms (decisions 041, 044) — a pad's graduation.
|
|
961
961
|
* The manager harvests the generation's income first (the pot then holds everything the dead
|
|
962
|
-
* shares earned), asks the
|
|
962
|
+
* shares earned), asks the policy, and applies its answer: a share to the payee it names (the pad's
|
|
963
963
|
* creator — the pool's authority), a cut to the collector, the rest bought in as more of the
|
|
964
|
-
* float the pool owns, a slice of every reserve burned. The
|
|
965
|
-
* threshold (`
|
|
964
|
+
* float the pool owns, a slice of every reserve burned. The policy refuses under its rung's
|
|
965
|
+
* threshold (`PadPolicy.NotGraduated`). Whoever runs the pool.
|
|
966
966
|
*/
|
|
967
967
|
export declare function fPoolRegenerate(c: LogswapClient, a: {
|
|
968
968
|
poolId: Hex;
|
|
@@ -976,7 +976,7 @@ export declare function fPoolRegenerate(c: LogswapClient, a: {
|
|
|
976
976
|
* next generation's composition (`legs`: a private pool's reshape — retire, admit, reweight), and
|
|
977
977
|
* `seed` it with what came back — the manager's `multicall`, one sender throughout, the same
|
|
978
978
|
* pool. The operator's when one is appointed and the seed's inventory is its own; by default the
|
|
979
|
-
* authority's. The
|
|
979
|
+
* authority's. The policy, its roles, gates, allowlist and the name carry over; anything else goes
|
|
980
980
|
* in `extra`, pre-encoded against {@link fPoolManagerAbi}. The seed names reserves (decisions
|
|
981
981
|
* 029): `r0` outright — one per leg of the NEXT table, 0 for a retired leg — or `x0` marks
|
|
982
982
|
* against the next table's `weights`.
|
|
@@ -1044,14 +1044,14 @@ export declare function fPoolLaunchCalls(poolId: Hex, a: FPoolLaunchArgs & ({
|
|
|
1044
1044
|
x0: bigint[];
|
|
1045
1045
|
})): Hex[];
|
|
1046
1046
|
/**
|
|
1047
|
-
* The desk's opening posture, on its
|
|
1047
|
+
* The desk's opening posture, on its policy (decisions 044): gated minting, the creator listed. No
|
|
1048
1048
|
* appointment: the authority is the operator until one is appointed (decisions 037). Two writes
|
|
1049
|
-
* to `
|
|
1049
|
+
* to `PrivatePolicy`; the launch batch cannot carry them (they are not manager calls).
|
|
1050
1050
|
*/
|
|
1051
1051
|
export declare function fPoolDeskOpening(c: LogswapClient, a: {
|
|
1052
1052
|
poolId: Hex;
|
|
1053
1053
|
account: Address;
|
|
1054
|
-
|
|
1054
|
+
policy?: Address;
|
|
1055
1055
|
}): Promise<Hash[]>;
|
|
1056
1056
|
/**
|
|
1057
1057
|
* Create a pool as ONE transaction: `initialize`, `seed`, the seed lock, the opening buy, the
|
|
@@ -1079,36 +1079,36 @@ export declare function fPoolLaunch(c: LogswapClient, a: FPoolLaunchArgs & ({
|
|
|
1079
1079
|
poolId: Hex;
|
|
1080
1080
|
}>;
|
|
1081
1081
|
/**
|
|
1082
|
-
* Propose the next authority — step one of two (decisions 020), on the pool's
|
|
1082
|
+
* Propose the next authority — step one of two (decisions 020), on the pool's policy. Nothing moves
|
|
1083
1083
|
* until `next` accepts; proposing again (the zero address included) cancels a pending proposal.
|
|
1084
|
-
* Indexed on-chain via the
|
|
1084
|
+
* Indexed on-chain via the policy's AuthorityProposed.
|
|
1085
1085
|
*/
|
|
1086
1086
|
export declare function fPoolProposeAuthority(c: LogswapClient, a: {
|
|
1087
1087
|
poolId: Hex;
|
|
1088
1088
|
next: Address;
|
|
1089
1089
|
account: Address;
|
|
1090
|
-
|
|
1090
|
+
policy?: Address;
|
|
1091
1091
|
}): Promise<`0x${string}`>;
|
|
1092
1092
|
/**
|
|
1093
|
-
* Accept a pending proposal — step two; only the proposed address can. Indexed via the
|
|
1094
|
-
* AuthoritySet. On the desk's
|
|
1093
|
+
* Accept a pending proposal — step two; only the proposed address can. Indexed via the policy's
|
|
1094
|
+
* AuthoritySet. On the desk's policy this clears the operator (pending and accepted) and voids the
|
|
1095
1095
|
* seller's list (decisions 040, 044).
|
|
1096
1096
|
*/
|
|
1097
1097
|
export declare function fPoolAcceptAuthority(c: LogswapClient, a: {
|
|
1098
1098
|
poolId: Hex;
|
|
1099
1099
|
account: Address;
|
|
1100
|
-
|
|
1100
|
+
policy?: Address;
|
|
1101
1101
|
}): Promise<`0x${string}`>;
|
|
1102
|
-
/** Turn the mint / swap gates on or off (the authority, on the desk's
|
|
1102
|
+
/** Turn the mint / swap gates on or off (the authority, on the desk's policy). `burn` is never gated. */
|
|
1103
1103
|
export declare function fPoolSetGates(c: LogswapClient, a: {
|
|
1104
1104
|
poolId: Hex;
|
|
1105
1105
|
gateMint: boolean;
|
|
1106
1106
|
gateSwap: boolean;
|
|
1107
1107
|
account: Address;
|
|
1108
|
-
|
|
1108
|
+
policy?: Address;
|
|
1109
1109
|
}): Promise<`0x${string}`>;
|
|
1110
1110
|
/**
|
|
1111
|
-
* Add to or remove from the pool's list, in one call (the authority, on the desk's
|
|
1111
|
+
* Add to or remove from the pool's list, in one call (the authority, on the desk's policy). The list
|
|
1112
1112
|
* is keyed by the authority that granted it: a handover starts the buyer with an empty one.
|
|
1113
1113
|
*/
|
|
1114
1114
|
export declare function fPoolSetAllowed(c: LogswapClient, a: {
|
|
@@ -1116,10 +1116,10 @@ export declare function fPoolSetAllowed(c: LogswapClient, a: {
|
|
|
1116
1116
|
who: readonly Address[];
|
|
1117
1117
|
allowed: boolean;
|
|
1118
1118
|
account: Address;
|
|
1119
|
-
|
|
1119
|
+
policy?: Address;
|
|
1120
1120
|
}): Promise<`0x${string}`>;
|
|
1121
1121
|
/** Whether `who` is on the pool's list under its current authority (consulted only while a gate is on). */
|
|
1122
|
-
export declare function fPoolIsAllowed(c: LogswapClient, poolId: Hex, who: Address,
|
|
1122
|
+
export declare function fPoolIsAllowed(c: LogswapClient, poolId: Hex, who: Address, policy?: Address): Promise<boolean>;
|
|
1123
1123
|
/** Label the pool — the sponsor's own words, mutable, never identity. At most 31 bytes of UTF-8. */
|
|
1124
1124
|
export declare function fPoolSetName(c: LogswapClient, a: {
|
|
1125
1125
|
poolId: Hex;
|
|
@@ -1140,7 +1140,7 @@ export declare function fPoolSponsorName(c: LogswapClient, who: Address): Promis
|
|
|
1140
1140
|
/** Who runs the pool (decisions 037): the appointed operator, or the authority until one is. */
|
|
1141
1141
|
export declare function fPoolOperatorOf(s: Pick<FPoolRoles, "authority" | "operator">): Address;
|
|
1142
1142
|
/**
|
|
1143
|
-
* Propose the operator (the authority, on the desk's
|
|
1143
|
+
* Propose the operator (the authority, on the desk's policy) — the hot key that runs the pool:
|
|
1144
1144
|
* `harvest`, `retire`, `regenerate`, `setLegs`. Two-step: the proposed address takes the role with
|
|
1145
1145
|
* {@link fPoolAcceptOperator}. The zero address clears at once — the role returns to the authority.
|
|
1146
1146
|
*/
|
|
@@ -1148,13 +1148,13 @@ export declare function fPoolAppointOperator(c: LogswapClient, a: {
|
|
|
1148
1148
|
poolId: Hex;
|
|
1149
1149
|
operator: Address;
|
|
1150
1150
|
account: Address;
|
|
1151
|
-
|
|
1151
|
+
policy?: Address;
|
|
1152
1152
|
}): Promise<`0x${string}`>;
|
|
1153
1153
|
/** The proposed operator takes the role. */
|
|
1154
1154
|
export declare function fPoolAcceptOperator(c: LogswapClient, a: {
|
|
1155
1155
|
poolId: Hex;
|
|
1156
1156
|
account: Address;
|
|
1157
|
-
|
|
1157
|
+
policy?: Address;
|
|
1158
1158
|
}): Promise<`0x${string}`>;
|
|
1159
1159
|
/**
|
|
1160
1160
|
* The next generation's composition (operator; private pools only; ONLY while the pool is
|
|
@@ -1189,9 +1189,9 @@ export interface DiscoveredFPool {
|
|
|
1189
1189
|
weights: bigint[];
|
|
1190
1190
|
phi: bigint;
|
|
1191
1191
|
kind: FPoolKind;
|
|
1192
|
-
/** The pool's policy — the
|
|
1193
|
-
|
|
1194
|
-
/** Who was born holding the pool (immutable). The LIVE authority is the
|
|
1192
|
+
/** The pool's policy — the contract the key names (decisions 041, 044, 045). */
|
|
1193
|
+
policy: Address;
|
|
1194
|
+
/** Who was born holding the pool (immutable). The LIVE authority is the policy's — {@link getFPoolRoles}. */
|
|
1195
1195
|
creator: Address;
|
|
1196
1196
|
/** The block the pool was initialized in — its age, for annualising realized income. */
|
|
1197
1197
|
block: bigint;
|
|
@@ -1221,11 +1221,11 @@ export interface FPoolControlled {
|
|
|
1221
1221
|
pool: DiscoveredFPool;
|
|
1222
1222
|
roles: FPoolRoles;
|
|
1223
1223
|
state: FPoolState;
|
|
1224
|
-
/** The
|
|
1225
|
-
|
|
1224
|
+
/** The policy's numbers for this pool's kind — a pad's rung and threshold, a POL's floors, the desk's list flags. */
|
|
1225
|
+
rules: FPoolRules;
|
|
1226
1226
|
}
|
|
1227
|
-
/** What a pool's
|
|
1228
|
-
export type
|
|
1227
|
+
/** What a pool's policy says about it, by kind: the terms a buyer reads before entering. */
|
|
1228
|
+
export type FPoolRules = {
|
|
1229
1229
|
kind: "pad";
|
|
1230
1230
|
harvestCut: bigint;
|
|
1231
1231
|
rung: number;
|
|
@@ -1250,10 +1250,10 @@ export type FPoolPolicy = {
|
|
|
1250
1250
|
gateSwap: boolean;
|
|
1251
1251
|
operator: Address;
|
|
1252
1252
|
};
|
|
1253
|
-
/** The
|
|
1254
|
-
export declare function
|
|
1253
|
+
/** The policy's terms for one pool, by its kind. */
|
|
1254
|
+
export declare function getFPoolRules(c: LogswapClient, s: Pick<FPoolState, "poolId" | "policy" | "kind" | "gen">, roles?: FPoolRoles): Promise<FPoolRules>;
|
|
1255
1255
|
/**
|
|
1256
|
-
* Every F pool `who` is the AUTHORITY of, across the four
|
|
1256
|
+
* Every F pool `who` is the AUTHORITY of, across the four policies — the policy page's list. Pools
|
|
1257
1257
|
* `who` created and handed over are not here (the buyer's page shows them); pools handed TO
|
|
1258
1258
|
* `who` are. `pools` may be passed (from the indexer, say) to skip the log scan.
|
|
1259
1259
|
*/
|