@logswap/sdk 0.5.75 → 0.5.77
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/README.md +91 -1
- package/dist/admin.d.ts +116 -39
- package/dist/admin.js +151 -59
- package/dist/chains.d.ts +155 -0
- package/dist/chains.js +186 -0
- package/dist/client.d.ts +36 -5
- package/dist/client.js +47 -5
- package/dist/fees.d.ts +1 -1
- package/dist/fees.js +32 -7
- package/dist/fpool.d.ts +72 -46
- package/dist/fpool.js +91 -47
- package/dist/generated.d.ts +321 -271
- package/dist/generated.js +282 -243
- package/dist/history.d.ts +10 -1
- package/dist/history.js +35 -9
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/indexer.d.ts +1 -1
- package/dist/indexer.js +1 -1
- package/dist/pools.d.ts +5 -3
- package/dist/pools.js +5 -4
- package/dist/positions.d.ts +1 -1
- package/dist/positions.js +20 -4
- package/dist/tokencache.d.ts +2 -10
- package/dist/tokencache.js +14 -6
- package/dist/views.d.ts +285 -0
- package/dist/views.js +188 -0
- package/dist/write.d.ts +2 -1
- package/dist/write.js +4 -3
- package/package.json +1 -1
- package/src/admin.ts +182 -73
- package/src/chains.ts +259 -0
- package/src/client.ts +71 -8
- package/src/fees.ts +30 -8
- package/src/fpool.ts +129 -73
- package/src/generated.ts +282 -243
- package/src/history.ts +40 -12
- package/src/index.ts +2 -0
- package/src/indexer.ts +1 -1
- package/src/pools.ts +7 -5
- package/src/positions.ts +21 -4
- package/src/tokencache.ts +15 -6
- package/src/views.ts +485 -0
- package/src/write.ts +4 -3
package/README.md
CHANGED
|
@@ -66,8 +66,17 @@ Since logswap-contract #60 (decisions 064–065) creation is curated at launch,
|
|
|
66
66
|
- **C reads**: `getPool` reads the lens's `getPools`; `getPositionClass` reads the class through
|
|
67
67
|
`extsload` at `CPoolState`'s slot (the manager's typed views are gone).
|
|
68
68
|
- **Creators are curated on every kind** at launch (onboarding under a service agreement); the
|
|
69
|
-
|
|
69
|
+
LOG Authority's helpers: `policySetCreatorListed`, `policySetMintFeeListed`, `gateSetPairListed`,
|
|
70
70
|
`gateSetSpacingListed`, `gateSetForwarderTrusted`, `setCGate`.
|
|
71
|
+
- **Two roles (decision 066, C 8 / F 27).** `logAuthority()` reads the LOG Authority (the
|
|
72
|
+
registry's `logAuthority`; `proposeLogAuthority` / `acceptLogAuthority`), which administers the
|
|
73
|
+
registry, both managers and every policy. `logTreasury(side)` reads a manager's treasury, which
|
|
74
|
+
only receives; `proposeTreasury` is the authority's, `acceptTreasury` the incoming treasury's own
|
|
75
|
+
call. `collectCProtocolFees(key)` may be sent by anyone and pays the treasury. The C swap-fee tax is each
|
|
76
|
+
market's from birth (`getPool(key).swapFeeTax`, `cMarketSwapFeeTax`); `setCSwapFeeTax` sets the
|
|
77
|
+
gate's level for markets born after it; the C gate is fixed (`setCGate` throws). `registryOwner`,
|
|
78
|
+
`registryProposeOwner` / `registryAcceptOwner` and `proposeCollector` / `acceptCollector` remain
|
|
79
|
+
as deprecated aliases.
|
|
71
80
|
|
|
72
81
|
## History from the indexer (indexer phase 1)
|
|
73
82
|
|
|
@@ -84,6 +93,38 @@ answers only partly.
|
|
|
84
93
|
shared tables with `contract: indexedContractOf(kind, event)` (or `kind` on `getEventsLogs`).
|
|
85
94
|
- `tokensCreated` lists the factory's tokens (`addresses.tokenFactory`): the token list's provenance.
|
|
86
95
|
|
|
96
|
+
## Indexer views (indexing phase 2)
|
|
97
|
+
|
|
98
|
+
The indexer also serves derived views (logswap-be `devnet/VIEWS.md`), joining its event tables with
|
|
99
|
+
the snapshotter's state. `views.ts` reads each as typed rows: amounts as `bigint`, prices, APYs and
|
|
100
|
+
progress as `number`, times as unix seconds. Every reader takes the GraphQL endpoint and a
|
|
101
|
+
`{ condition, filter, orderBy, first, signal }` query, and pages by offset.
|
|
102
|
+
|
|
103
|
+
| Reader | View | What a row is |
|
|
104
|
+
| --- | --- | --- |
|
|
105
|
+
| `poolDirectory` | `allPoolDirectories` | a pool of either manager, its kind and birth |
|
|
106
|
+
| `eventUsers` | `allEventUsers` | a manager event and who did it (the router's caller when routed) |
|
|
107
|
+
| `poolHolders` | `allPoolHolders` | a current ERC-6909 balance, with C's backstop and F's dead shares flagged |
|
|
108
|
+
| `walletPositions` | `allWalletPositions` | a wallet's holding; F valued at the latest share value |
|
|
109
|
+
| `walletPoolFlows` | `allWalletPoolFlows` | a wallet's in/out, fees and dividends per pool |
|
|
110
|
+
| `swapFlows` | `allSwapFlows` | a swap's volume and fee in quote |
|
|
111
|
+
| `priceTicks` | `allPriceTicks` | a price point per (pool, base) |
|
|
112
|
+
| `candles(url, "minute" \| "hour" \| "day")` | `allCandle…s` | OHLC with volume and fees |
|
|
113
|
+
| `poolTvlHours` | `allPoolTvlHours` | the hour's last snapshot: TVL, liquidity |
|
|
114
|
+
| `poolSummaries` | `allPoolSummaries` | 24 h / 7 d volume, fees, APY; latest TVL |
|
|
115
|
+
| `generationSteps` | `allGenerationSteps` | a `regenerate` step and its pot split |
|
|
116
|
+
| `padStatuses` | `allPadStatuses` | each pad and POL now, with the next threshold and progress |
|
|
117
|
+
| `protocolRevenueDays` | `allProtocolRevenueDays` | protocol revenue per day and source |
|
|
118
|
+
|
|
119
|
+
Given an `indexer`, three functions now take their figure from a view and keep their previous path
|
|
120
|
+
as the fallback, with the same answer on the same data:
|
|
121
|
+
- `holdingsOf`: the owner's held class ids from `pool_holder`, then the lens as before;
|
|
122
|
+
- `fPoolShareHolders`: the holders from `pool_holder`;
|
|
123
|
+
- `swapFees`: the window from `swap_flow`.
|
|
124
|
+
|
|
125
|
+
What stays a live read: a C position's value and every unclaimed fee or dividend (the lens: `legsOf`,
|
|
126
|
+
`heldByIds`, `fDividendOf`). They accrue without events, so no view holds them.
|
|
127
|
+
|
|
87
128
|
## Capped F pools and the lien (F version 25)
|
|
88
129
|
|
|
89
130
|
- **The cap** (decisions 061) is a key field: `FPoolKey.cap` / `FPoolCreateArgs.cap`, d =
|
|
@@ -97,6 +138,55 @@ answers only partly.
|
|
|
97
138
|
now), `fPoolLienOf` (locker, amount, and the dividend the lien holds). The dividend the locked
|
|
98
139
|
amount earns is held by the lien: a repaid loan gets it back, a seizer takes it.
|
|
99
140
|
|
|
141
|
+
## Chains and deployments (F version 29)
|
|
142
|
+
|
|
143
|
+
log(swap) releases on Ethereum (1), Base (8453), Arbitrum One (42161) and Robinhood Chain (4663),
|
|
144
|
+
with Robinhood Chain Testnet (46630) for testing. The contracts are deployed through CreateX
|
|
145
|
+
(CREATE3, contracts decision 069) at the SAME addresses on every chain, so an address names a
|
|
146
|
+
contract only together with a chain id.
|
|
147
|
+
|
|
148
|
+
- **`LOGSWAP_CHAINS`** (`src/chains.ts`): one entry per chain — the viem `chain`, `network` (the
|
|
149
|
+
artifact's), `nativeCurrency`, `explorer`, `publicRpc` (rate-limited), `devnet`, `testnet`, the
|
|
150
|
+
verified `quotes` (symbol, address, decimals) and `padQuote`, and `maxLogRange`. Also 31337 (local
|
|
151
|
+
anvil) and 31339 (the devnet). `logswapChain(id)`, `quoteOf(id, "USDC")`, `RELEASE_CHAIN_IDS`.
|
|
152
|
+
- **`LogswapDeployment`** is the contracts' `deployments/<chainId>.json` (`DeployChain.s.sol`; the
|
|
153
|
+
local `DeployLocal` artifact has the same fields plus its devnet extras).
|
|
154
|
+
`deploymentFromArtifact(json, { chainId })` validates it and refuses an artifact for another chain;
|
|
155
|
+
`LOGSWAP_DEPLOYMENTS` / `deploymentFor(id)` hold the published ones (none yet: nothing is deployed
|
|
156
|
+
on the release chains).
|
|
157
|
+
- **`createLogswapClient({ public, deployment, indexerUrl })`** takes the addresses from the
|
|
158
|
+
deployment and keeps its `chainId` and `deployBlock`; `addresses` still works on its own.
|
|
159
|
+
|
|
160
|
+
```ts
|
|
161
|
+
import { createPublicClient, http } from "viem";
|
|
162
|
+
import { createLogswapClient, deploymentFromArtifact, logswapChain } from "@logswap/sdk";
|
|
163
|
+
|
|
164
|
+
const chain = logswapChain(8453)!;
|
|
165
|
+
const c = createLogswapClient({
|
|
166
|
+
public: createPublicClient({ chain: chain.chain, transport: http(process.env.BASE_RPC_URL) }),
|
|
167
|
+
deployment: deploymentFromArtifact(artifactJson, { chainId: 8453 }),
|
|
168
|
+
indexerUrl: "https://…/graphql", // this chain's indexer
|
|
169
|
+
});
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
What changes for readers:
|
|
173
|
+
|
|
174
|
+
- **Log scans start at `deployBlock`** where they started at block 0 (`discoverMarkets`,
|
|
175
|
+
`discoverFPools`, `fPoolKeyOfPool`, `holdingsOf`, `fPoolShareHolders`, `getEventLogs`,
|
|
176
|
+
`getEventsLogs`); an explicit `fromBlock` still wins.
|
|
177
|
+
- **The chain path is chunked**: `eth_getLogs` over spans of `maxLogRange` blocks (2 000 on the
|
|
178
|
+
release chains, per-client override), at most four in flight (`getLogsChunked`). Public RPCs refuse
|
|
179
|
+
an unbounded range.
|
|
180
|
+
- **The indexer is per chain**: `indexerUrl` on the client is the default `indexer` of every history
|
|
181
|
+
read and of `discoverMarketsBest`. Its rows are filtered by contract address, which is the same on
|
|
182
|
+
every chain, so one URL must serve one chain.
|
|
183
|
+
- **Caches key on the chain id**: the policy-kind cache asks the node for the chain id when the
|
|
184
|
+
client has none; `RESETTABLE_CHAINS` is every registry chain flagged `devnet` (plus 1337 and 31338),
|
|
185
|
+
extended with `addResettableChain`.
|
|
186
|
+
- **F version 29** (decision 068): `FPoolState.restructureTime` (unix seconds; was
|
|
187
|
+
`restructureBlock`), `registrySunset(c, policy, untilTime)` and `RegistryEntry.until` are
|
|
188
|
+
timestamps. `EXPECTED_F_VERSION` is 29.
|
|
189
|
+
|
|
100
190
|
## Conventions
|
|
101
191
|
|
|
102
192
|
- **The SDK hides the manager/router/lens split.** Which contract hosts which action is currently
|
package/dist/admin.d.ts
CHANGED
|
@@ -1,28 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* admin — the protocol's writes: the C swap-fee tax (decisions 060), the policies a pool may be
|
|
3
3
|
* born with (the registry's), the policies' own numbers (the quote list, the fee tiers, a pad's
|
|
4
|
-
* schedule, a POL's rules), and the two-step
|
|
4
|
+
* schedule, a POL's rules), and the two roles' two-step handovers (decision 066): the LOG Authority
|
|
5
|
+
* (the registry's `authority`) administers everything here; the LOG Treasury (`treasury` on each
|
|
6
|
+
* manager) only receives, and is replaced by the authority's `proposeTreasury`. Plain writes to the managers, the
|
|
5
7
|
* registry and the policies; no router.
|
|
6
8
|
*
|
|
7
9
|
* The mint fee has no cut to set since C version 6 / F version 24 (decisions 058): the whole fee
|
|
8
10
|
* is the protocol's on both managers. A harvest has no cut (056); a pad's protocol share of the pot
|
|
9
11
|
* is the policy's (`PadPolicy.setSchedule`), capped by the manager at `POT_CUT_MAX`.
|
|
10
12
|
*/
|
|
11
|
-
import type { Address, Hash } from "viem";
|
|
13
|
+
import type { Address, Hash, Hex } from "viem";
|
|
12
14
|
import type { PoolKey } from "./keys.js";
|
|
13
15
|
import type { LogswapClient } from "./client.js";
|
|
14
16
|
import { type FPoolKey, type FPoolKind } from "./fpool.js";
|
|
15
17
|
/**
|
|
16
|
-
* The C
|
|
17
|
-
*
|
|
18
|
+
* The C swap-fee tax (decisions 060, 066): the protocol's share of every swap fee a C position is
|
|
19
|
+
* paid (claims and the burn's auto-claim), WAD. `tax` is the level the gate (`PublicPolicy`) gives a
|
|
20
|
+
* market born NOW; each market keeps the level of its birth for life — read it with
|
|
21
|
+
* {@link cMarketSwapFeeTax} or `getPool(key).swapFeeTax`. `max` is the manager's bound.
|
|
18
22
|
*/
|
|
19
23
|
export declare function cSwapFeeTax(c: LogswapClient): Promise<{
|
|
20
24
|
tax: bigint;
|
|
21
25
|
max: bigint;
|
|
22
26
|
}>;
|
|
27
|
+
/** One C market's swap-fee tax, recorded at its birth (066). */
|
|
28
|
+
export declare function cMarketSwapFeeTax(c: LogswapClient, key: PoolKey): Promise<bigint>;
|
|
23
29
|
/**
|
|
24
|
-
* `
|
|
25
|
-
*
|
|
30
|
+
* `PublicPolicy.setSwapFeeTax`: the level a C market born after it is given (066), at most
|
|
31
|
+
* `SWAP_FEE_TAX_MAX` (25%). The LOG Authority's. A live market keeps the level of its birth.
|
|
26
32
|
*/
|
|
27
33
|
export declare function setCSwapFeeTax(c: LogswapClient, taxWad: bigint): Promise<Hash>;
|
|
28
34
|
/**
|
|
@@ -39,7 +45,7 @@ export interface RegistryEntry {
|
|
|
39
45
|
/** The policy's own `kind()` tag — what a pool born under it is. */
|
|
40
46
|
kind: FPoolKind;
|
|
41
47
|
name: string;
|
|
42
|
-
/** The
|
|
48
|
+
/** The time (unix seconds) it closes to new pools from; 0 = open. A block number before F version 29. */
|
|
43
49
|
until: bigint;
|
|
44
50
|
/** Approved now: listed and not yet sunset. */
|
|
45
51
|
approved: boolean;
|
|
@@ -50,27 +56,46 @@ export interface RegistryEntry {
|
|
|
50
56
|
* with no registry.
|
|
51
57
|
*/
|
|
52
58
|
export declare function registryPolicies(c: LogswapClient, kind?: FPoolKind): Promise<RegistryEntry[]>;
|
|
53
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* The LOG Authority (decision 066) — the registry's `logAuthority`, which administers the registry, both
|
|
61
|
+
* managers and every protocol policy — and the proposed next one. Zero with no registry: nothing on
|
|
62
|
+
* the deployment can be administered.
|
|
63
|
+
*/
|
|
64
|
+
export declare function logAuthority(c: LogswapClient): Promise<{
|
|
65
|
+
authority: Address;
|
|
66
|
+
pending: Address;
|
|
67
|
+
}>;
|
|
68
|
+
/** @deprecated F version 27 renamed the registry's `owner` to `authority`: use {@link logAuthority}. */
|
|
54
69
|
export declare function registryOwner(c: LogswapClient): Promise<{
|
|
55
70
|
owner: Address;
|
|
56
71
|
pending: Address;
|
|
57
72
|
}>;
|
|
58
|
-
/** `PolicyRegistry.approve`: list `policy` under `name` (at most 31 bytes). Again renames it and clears its sunset. The
|
|
73
|
+
/** `PolicyRegistry.approve`: list `policy` under `name` (at most 31 bytes). Again renames it and clears its sunset. The LOG Authority's. */
|
|
59
74
|
export declare function registryApprove(c: LogswapClient, policy: Address, name: string): Promise<Hash>;
|
|
60
|
-
/** `PolicyRegistry.sunset`: close `policy` to new pools from `
|
|
61
|
-
export declare function registrySunset(c: LogswapClient, policy: Address,
|
|
62
|
-
/** `PolicyRegistry.revoke`: remove `policy` from the list at once. Live pools are untouched. The
|
|
75
|
+
/** `PolicyRegistry.sunset`: close `policy` to new pools from `untilTime` (unix seconds, F version 29) on; 0 reopens. The LOG Authority's. */
|
|
76
|
+
export declare function registrySunset(c: LogswapClient, policy: Address, untilTime: bigint): Promise<Hash>;
|
|
77
|
+
/** `PolicyRegistry.revoke`: remove `policy` from the list at once. Live pools are untouched. The LOG Authority's. */
|
|
63
78
|
export declare function registryRevoke(c: LogswapClient, policy: Address): Promise<Hash>;
|
|
64
|
-
/**
|
|
65
|
-
|
|
66
|
-
|
|
79
|
+
/**
|
|
80
|
+
* The LOG Authority's two-step handover (066): the authority proposes, the proposed address accepts
|
|
81
|
+
* by its own call (a Safe or a timelock sends `acceptLogAuthority` itself). One handover moves the
|
|
82
|
+
* administration of the registry, both managers and every policy; the treasury is a separate role.
|
|
83
|
+
*/
|
|
84
|
+
export declare function proposeLogAuthority(c: LogswapClient, next: Address): Promise<Hash>;
|
|
85
|
+
export declare function acceptLogAuthority(c: LogswapClient): Promise<Hash>;
|
|
86
|
+
/** @deprecated use {@link proposeLogAuthority}. */
|
|
87
|
+
export declare const registryProposeOwner: typeof proposeLogAuthority;
|
|
88
|
+
/** @deprecated use {@link acceptLogAuthority}. */
|
|
89
|
+
export declare const registryAcceptOwner: typeof acceptLogAuthority;
|
|
67
90
|
/**
|
|
68
91
|
* Approve or revoke, the F version 15–16 shape kept for callers: `approved` true is
|
|
69
92
|
* {@link registryApprove} under the policy's own tag as its name, false is {@link registryRevoke}.
|
|
70
93
|
*/
|
|
71
94
|
export declare function setPolicyApproved(c: LogswapClient, policy: Address, approved: boolean): Promise<Hash>;
|
|
72
95
|
/**
|
|
73
|
-
* Move a pool to another approved policy of the same kind: the
|
|
96
|
+
* Move a pool to another approved policy of the same kind: the LOG Authority's alone, a forced move
|
|
97
|
+
* (adoption at regeneration by the pool authority's consent is specified, not built — logswap-docs
|
|
98
|
+
* `specs/governance/policy-adoption.md`),
|
|
74
99
|
* orchestrated on the registry — `migrate(manager, key, to)` since F version 20 (it took the
|
|
75
100
|
* pool's id before). The registry checks the key against the manager (`NoPool`), checks the
|
|
76
101
|
* manager is its own (`WrongManager`), and compares the two policies' tags recorded at approval
|
|
@@ -98,28 +123,49 @@ export declare function fPoolMigrate(c: LogswapClient, a: {
|
|
|
98
123
|
*/
|
|
99
124
|
export declare function registryKindOf(c: LogswapClient, policy: Address): Promise<FPoolKind | "">;
|
|
100
125
|
/**
|
|
101
|
-
* `PadPolicy.setSchedule` (decisions 056,
|
|
102
|
-
* recorded into each pad at birth), and the
|
|
103
|
-
*
|
|
104
|
-
*
|
|
126
|
+
* `PadPolicy.setSchedule` (decisions 056, 067, 070): the rung's growth, the protocol's share of the pot (≤ `POT_CUT_MAX`,
|
|
127
|
+
* recorded into each pad at birth), and the RANGE a creator chooses his cut of the pot inside at creation (its top ≤ the F
|
|
128
|
+
* manager's `PAYEE_CUT_MAX`). The creator's top plus the protocol's share is at most the pot; the rest deepens the bid — nothing
|
|
129
|
+
* is bought or burnt since F version 28. A change to the split applies to pads born after it; the growth moves every pad at its
|
|
130
|
+
* next rung. The rung is the pool's generation. `T(0)` is per quote since decision 070: {@link padSetThresholdBase}.
|
|
131
|
+
*/
|
|
132
|
+
export declare function padSetSchedule(c: LogswapClient, policy: Address, s: PadSchedule): Promise<Hash>;
|
|
133
|
+
/**
|
|
134
|
+
* `PadPolicy.setThresholdBase(quote, base)` (decision 070): `T(0)` for pads quoted in `quote`, in that quote's units. A pad is
|
|
135
|
+
* born (or moved in) only on a quote that has one (`NoThreshold`). It moves every pad in that quote at its next rung. The LOG
|
|
136
|
+
* Authority's.
|
|
105
137
|
*/
|
|
106
|
-
export declare function
|
|
107
|
-
|
|
138
|
+
export declare function padSetThresholdBase(c: LogswapClient, policy: Address, quote: Address, base: bigint): Promise<Hash>;
|
|
139
|
+
/** A pad policy's `T(0)` in one quote (decision 070): `set` false means no pad can be born on that quote. */
|
|
140
|
+
export interface PadThresholdBase {
|
|
141
|
+
quote: Address;
|
|
142
|
+
set: boolean;
|
|
143
|
+
/** In the quote's units; 0 when not set. */
|
|
144
|
+
base: bigint;
|
|
145
|
+
}
|
|
146
|
+
/** `PadPolicy.thresholdSet(quote)` and `thresholdBaseOf(quote)` for each quote asked (decision 070). */
|
|
147
|
+
export declare function padThresholdBases(c: LogswapClient, policy: Address, quotes: readonly Address[]): Promise<PadThresholdBase[]>;
|
|
148
|
+
/** `PadPolicy.thresholdOf(quote, rung)` (decision 070): the pot a pad quoted in `quote` must bank to climb `rung` (0 reads `T(0)`). */
|
|
149
|
+
export declare function padThresholdOf(c: LogswapClient, policy: Address, quote: Address, rung?: bigint | number): Promise<bigint>;
|
|
150
|
+
/** `PadPolicy.threshold(poolId, rung)` (decision 070): the pot pad `poolId` must bank to climb `rung`, in its own quote. */
|
|
151
|
+
export declare function padThreshold(c: LogswapClient, policy: Address, poolId: Hex, rung: bigint | number): Promise<bigint>;
|
|
152
|
+
/** A pad policy's schedule (decision 070: without `T(0)`, which is per quote — {@link padThresholdBases}). WAD numbers. */
|
|
153
|
+
export interface PadSchedule {
|
|
108
154
|
thresholdGrowth: bigint;
|
|
109
155
|
protocolShare: bigint;
|
|
110
156
|
creatorShareMin: bigint;
|
|
111
157
|
creatorShareMax: bigint;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
158
|
+
}
|
|
159
|
+
/** Read {@link PadSchedule} off a pad policy. */
|
|
160
|
+
export declare function padScheduleOf(c: LogswapClient, policy: Address): Promise<PadSchedule>;
|
|
115
161
|
/** `PolPolicy.setRules`: the reserve a harvest must leave in the bid (`may(Harvest)` refuses less) and what a relaunch's seed must bring, WAD fractions of the pool's L. */
|
|
116
162
|
export declare function polSetRules(c: LogswapClient, policy: Address, s: {
|
|
117
163
|
keepQuote: bigint;
|
|
118
164
|
minQuoteAtSeed: bigint;
|
|
119
165
|
}): Promise<Hash>;
|
|
120
|
-
/** `setQuoteListed` on any protocol policy: a quote a pool of that kind may be born against while it curates quotes. The
|
|
166
|
+
/** `setQuoteListed` on any protocol policy: a quote a pool of that kind may be born against while it curates quotes. The LOG Authority's. */
|
|
121
167
|
export declare function policySetQuoteListed(c: LogswapClient, policy: Address, quote: Address, listed: boolean): Promise<Hash>;
|
|
122
|
-
/** `setQuoteCurated` on any protocol policy: on, a birth against an unlisted quote is refused. The
|
|
168
|
+
/** `setQuoteCurated` on any protocol policy: on, a birth against an unlisted quote is refused. The LOG Authority's. */
|
|
123
169
|
export declare function policySetQuoteCurated(c: LogswapClient, policy: Address, curated: boolean): Promise<Hash>;
|
|
124
170
|
/** Whether `quote` passes `policy`'s birth check now: listed, or the policy does not curate quotes. */
|
|
125
171
|
export declare function policyQuoteAllowed(c: LogswapClient, policy: Address, quote: Address): Promise<{
|
|
@@ -130,10 +176,10 @@ export declare function policyQuoteAllowed(c: LogswapClient, policy: Address, qu
|
|
|
130
176
|
/**
|
|
131
177
|
* `setFeeListed` on any protocol policy (decisions 059): a swap-fee tier a pool of that kind may be
|
|
132
178
|
* born with while the policy curates fees. Within the family's domain (`FEE_MIN` ≤ fee ≤ `FEE_MAX`).
|
|
133
|
-
* The
|
|
179
|
+
* The LOG Authority's.
|
|
134
180
|
*/
|
|
135
181
|
export declare function policySetFeeListed(c: LogswapClient, policy: Address, fee: bigint, listed: boolean): Promise<Hash>;
|
|
136
|
-
/** `setFeeCurated` on any protocol policy: on, a birth with an unlisted swap fee is refused (`FeeNotListed`). The
|
|
182
|
+
/** `setFeeCurated` on any protocol policy: on, a birth with an unlisted swap fee is refused (`FeeNotListed`). The LOG Authority's. */
|
|
137
183
|
export declare function policySetFeeCurated(c: LogswapClient, policy: Address, curated: boolean): Promise<Hash>;
|
|
138
184
|
/** Whether `fee` passes `policy`'s birth check now: listed, or the policy does not curate fees (the desk's never does). */
|
|
139
185
|
export declare function policyFeeAllowed(c: LogswapClient, policy: Address, fee: bigint): Promise<{
|
|
@@ -141,7 +187,7 @@ export declare function policyFeeAllowed(c: LogswapClient, policy: Address, fee:
|
|
|
141
187
|
listed: boolean;
|
|
142
188
|
allowed: boolean;
|
|
143
189
|
}>;
|
|
144
|
-
/** `setMintFeeListed` on any protocol policy (065): an entry of its mint-fee menu. The
|
|
190
|
+
/** `setMintFeeListed` on any protocol policy (065): an entry of its mint-fee menu. The LOG Authority's. */
|
|
145
191
|
export declare function policySetMintFeeListed(c: LogswapClient, policy: Address, mintFee: bigint, listed: boolean): Promise<Hash>;
|
|
146
192
|
/** `setMintFeeCurated` on any protocol policy: on, a birth proposing an unlisted mint fee is refused (`MintFeeNotListed`). */
|
|
147
193
|
export declare function policySetMintFeeCurated(c: LogswapClient, policy: Address, curated: boolean): Promise<Hash>;
|
|
@@ -166,8 +212,11 @@ export declare function gateSetPairCurated(c: LogswapClient, policy: Address, cu
|
|
|
166
212
|
export declare function gateSetSpacingListed(c: LogswapClient, policy: Address, tickSpacing: bigint, listed: boolean): Promise<Hash>;
|
|
167
213
|
/** `PublicPolicy.setForwarderTrusted` (064): a router whose `user()` the gate takes as the creator. */
|
|
168
214
|
export declare function gateSetForwarderTrusted(c: LogswapClient, policy: Address, forwarder: Address, trusted: boolean): Promise<Hash>;
|
|
169
|
-
/**
|
|
170
|
-
|
|
215
|
+
/**
|
|
216
|
+
* @deprecated C version 8 fixes the gate at construction (066): there is no `setGate`. Open or close
|
|
217
|
+
* C through the gate's lists (`policySetCreatorCurated`, `gateSetPairCurated`, `gateSetSpacingListed`, …).
|
|
218
|
+
*/
|
|
219
|
+
export declare function setCGate(_c: LogswapClient, _gate: Address): Promise<Hash>;
|
|
171
220
|
/** The C manager's gate (`address(0)`: permissionless, a fee-free market then refused). */
|
|
172
221
|
export declare function cGate(c: LogswapClient): Promise<Address>;
|
|
173
222
|
export interface CGateRules {
|
|
@@ -196,9 +245,18 @@ export declare function cGateRules(c: LogswapClient, a: {
|
|
|
196
245
|
}): Promise<CGateRules>;
|
|
197
246
|
/**
|
|
198
247
|
* Every refusal a birth can meet at the gate or a policy (064, 065), for `decodeErrorResult` on a
|
|
199
|
-
* failed simulation: the public policy's errors plus the pad's `PadExists` (one pad per base)
|
|
248
|
+
* failed simulation: the public policy's errors plus the pad's `PadExists` (one pad per base) and `NoThreshold` (no `T(0)`
|
|
249
|
+
* in the pad's quote, decision 070).
|
|
200
250
|
*/
|
|
201
251
|
export declare const gateErrorAbi: readonly ({
|
|
252
|
+
readonly type: "error";
|
|
253
|
+
readonly inputs: readonly [{
|
|
254
|
+
readonly name: "quote";
|
|
255
|
+
readonly internalType: "address";
|
|
256
|
+
readonly type: "address";
|
|
257
|
+
}];
|
|
258
|
+
readonly name: "NoThreshold";
|
|
259
|
+
} | {
|
|
202
260
|
readonly type: "error";
|
|
203
261
|
readonly inputs: readonly [{
|
|
204
262
|
readonly name: "base";
|
|
@@ -278,10 +336,6 @@ export declare const gateErrorAbi: readonly ({
|
|
|
278
336
|
readonly type: "error";
|
|
279
337
|
readonly inputs: readonly [];
|
|
280
338
|
readonly name: "NotCanonical";
|
|
281
|
-
} | {
|
|
282
|
-
readonly type: "error";
|
|
283
|
-
readonly inputs: readonly [];
|
|
284
|
-
readonly name: "NotCollector";
|
|
285
339
|
} | {
|
|
286
340
|
readonly type: "error";
|
|
287
341
|
readonly inputs: readonly [{
|
|
@@ -290,6 +344,10 @@ export declare const gateErrorAbi: readonly ({
|
|
|
290
344
|
readonly type: "address";
|
|
291
345
|
}];
|
|
292
346
|
readonly name: "NotListed";
|
|
347
|
+
} | {
|
|
348
|
+
readonly type: "error";
|
|
349
|
+
readonly inputs: readonly [];
|
|
350
|
+
readonly name: "NotLogAuthority";
|
|
293
351
|
} | {
|
|
294
352
|
readonly type: "error";
|
|
295
353
|
readonly inputs: readonly [];
|
|
@@ -339,5 +397,24 @@ export declare const gateErrorAbi: readonly ({
|
|
|
339
397
|
export declare function publicSetListed(c: LogswapClient, policy: Address, token: Address, listed: boolean): Promise<Hash>;
|
|
340
398
|
/** `PublicPolicy.setCurated`: whether every public seed is checked against the list. */
|
|
341
399
|
export declare function publicSetCurated(c: LogswapClient, policy: Address, curated: boolean): Promise<Hash>;
|
|
342
|
-
|
|
343
|
-
export declare function
|
|
400
|
+
/** A manager's treasury — where its protocol revenue goes — and the proposed next one. */
|
|
401
|
+
export declare function logTreasury(c: LogswapClient, side: "C" | "F"): Promise<{
|
|
402
|
+
treasury: Address;
|
|
403
|
+
pending: Address;
|
|
404
|
+
}>;
|
|
405
|
+
/**
|
|
406
|
+
* Propose a manager's next treasury: the LOG Authority's call, never the treasury's own, so a
|
|
407
|
+
* treasury that can no longer act is replaced without it. Nothing the old treasury holds moves.
|
|
408
|
+
*/
|
|
409
|
+
export declare function proposeTreasury(c: LogswapClient, side: "C" | "F", next: Address): Promise<Hash>;
|
|
410
|
+
/** The proposed treasury takes the role, sending from its own address. */
|
|
411
|
+
export declare function acceptTreasury(c: LogswapClient, side: "C" | "F"): Promise<Hash>;
|
|
412
|
+
/** @deprecated the collector became the treasury (066), proposed by the LOG Authority: use {@link proposeTreasury}. */
|
|
413
|
+
export declare const proposeCollector: typeof proposeTreasury;
|
|
414
|
+
/** @deprecated use {@link acceptTreasury}. */
|
|
415
|
+
export declare const acceptCollector: typeof acceptTreasury;
|
|
416
|
+
/**
|
|
417
|
+
* `CPoolManager.collectProtocolFees(key)`: pay one market's `protocolOwed` (mint fees and swap-fee
|
|
418
|
+
* tax) to the treasury. Anyone may send it (066); the destination is fixed.
|
|
419
|
+
*/
|
|
420
|
+
export declare function collectCProtocolFees(c: LogswapClient, key: PoolKey): Promise<Hash>;
|