@logswap/sdk 0.5.89 → 0.5.91
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 +80 -13
- package/dist/actions.js +6 -5
- package/dist/admin.d.ts +213 -219
- package/dist/admin.js +118 -144
- package/dist/chains.d.ts +13 -4
- package/dist/chains.js +23 -9
- package/dist/claims.d.ts +1 -1
- package/dist/claims.js +11 -9
- package/dist/client.d.ts +43 -20
- package/dist/client.js +75 -26
- package/dist/fees.d.ts +1 -1
- package/dist/fees.js +5 -4
- package/dist/fpool.d.ts +170 -460
- package/dist/fpool.js +175 -218
- package/dist/generated.d.ts +5753 -6227
- package/dist/generated.js +3097 -3664
- package/dist/history.js +13 -11
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/indexer.d.ts +2 -2
- package/dist/indexer.js +12 -9
- package/dist/keys.d.ts +15 -3
- package/dist/keys.js +5 -1
- package/dist/liquidity.d.ts +1 -1
- package/dist/liquidity.js +16 -9
- package/dist/onboard.d.ts +16 -11
- package/dist/onboard.js +27 -21
- package/dist/pools.d.ts +2 -0
- package/dist/pools.js +21 -13
- package/dist/positions.d.ts +1 -1
- package/dist/positions.js +18 -17
- package/dist/quote.d.ts +15 -0
- package/dist/quote.js +36 -0
- package/dist/swap.d.ts +7 -9
- package/dist/swap.js +40 -25
- package/dist/views.d.ts +1 -1
- package/dist/write.d.ts +7 -2
- package/dist/write.js +10 -7
- package/package.json +3 -3
- package/src/actions.ts +6 -5
- package/src/admin.ts +168 -171
- package/src/chains.ts +33 -13
- package/src/claims.ts +11 -10
- package/src/client.ts +101 -39
- package/src/fees.ts +6 -6
- package/src/fpool.ts +240 -272
- package/src/generated.ts +3110 -3671
- package/src/history.ts +11 -9
- package/src/index.ts +5 -5
- package/src/indexer.ts +13 -11
- package/src/keys.ts +19 -3
- package/src/liquidity.ts +16 -10
- package/src/onboard.ts +29 -21
- package/src/pools.ts +23 -15
- package/src/positions.ts +18 -18
- package/src/quote.ts +36 -0
- package/src/swap.ts +46 -25
- package/src/views.ts +1 -2
- package/src/write.ts +11 -10
package/dist/admin.d.ts
CHANGED
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* admin — the protocol's writes: the
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
2
|
+
* admin — the protocol's writes: the policies a pool may be born with and moved to (the registry's), the registry's
|
|
3
|
+
* creation modes and orphan move, the two roles' two-step handovers (decision 066): the LOG Authority (the registry's
|
|
4
|
+
* `logAuthority`) administers the registry and both managers; the LOG Treasury (`treasury` on each manager) only receives,
|
|
5
|
+
* and is replaced by the authority's `proposeTreasury`. Plain writes to the managers and the registry; no router.
|
|
6
|
+
*
|
|
7
|
+
* Since decision 098 the policies are immutable and the LOG's: a policy has no setter (its fee tiers, quotes, spacings, swap-fee tax, schedule and
|
|
8
|
+
* rates are constructor immutables), so there is no wrapper that writes one — a change is a new policy, approved ({@link registryApprove})
|
|
9
|
+
* and moved to ({@link fPoolMigrate}). What remains here for the policies is reading their numbers.
|
|
8
10
|
*
|
|
9
11
|
* The mint fee has no cut to set since C version 6 / F version 24 (decisions 058): the whole fee
|
|
10
12
|
* is the protocol's on both managers. A harvest has no cut (056); a pad's protocol share of the income
|
|
11
|
-
* is the policy's
|
|
13
|
+
* is the policy's `incomeTaxRate` (an immutable), capped by the manager at `INCOME_TAX_MAX`.
|
|
12
14
|
*/
|
|
13
15
|
import type { Address, Hash, Hex } from "viem";
|
|
14
|
-
import type
|
|
15
|
-
import type
|
|
16
|
-
import { type FPoolKey, type FPoolKind } from "./fpool.js";
|
|
16
|
+
import { type PoolKey } from "./keys.js";
|
|
17
|
+
import { type LogswapClient, type Side } from "./client.js";
|
|
18
|
+
import { type FPoolKey, type FPoolKind, type FPoolSwapMode } from "./fpool.js";
|
|
17
19
|
/**
|
|
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
|
|
20
|
-
*
|
|
21
|
-
* {@link cMarketSwapFeeTax} or `getPool(key).swapFeeTax`.
|
|
20
|
+
* The C swap-fee tax (decisions 060, 066, 098): the protocol's share of every swap fee a C position is
|
|
21
|
+
* paid (claims and the burn's auto-claim), WAD. `tax` is the level a market born under `policy` (default: the deployment's
|
|
22
|
+
* `publicPolicyC`) is given — the policy's immutable `swapFeeTax`; each market keeps the level of its birth for
|
|
23
|
+
* life — read it with {@link cMarketSwapFeeTax} or `getPool(key).swapFeeTax`. A different level is a different policy.
|
|
24
|
+
* `max` is the manager's bound.
|
|
22
25
|
*/
|
|
23
|
-
export declare function cSwapFeeTax(c: LogswapClient): Promise<{
|
|
26
|
+
export declare function cSwapFeeTax(c: LogswapClient, policy?: Address): Promise<{
|
|
24
27
|
tax: bigint;
|
|
25
28
|
max: bigint;
|
|
26
29
|
}>;
|
|
27
30
|
/** One C market's swap-fee tax, recorded at its birth (066). */
|
|
28
31
|
export declare function cMarketSwapFeeTax(c: LogswapClient, key: PoolKey): Promise<bigint>;
|
|
29
|
-
/**
|
|
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.
|
|
32
|
-
*/
|
|
33
|
-
export declare function setCSwapFeeTax(c: LogswapClient, taxWad: bigint): Promise<Hash>;
|
|
34
32
|
/**
|
|
35
33
|
* The policy registry the F manager asks at every birth — `addresses.policyRegistry` when the
|
|
36
34
|
* deployment carries it, else read once from the manager. The zero address is a deployment with
|
|
@@ -92,16 +90,31 @@ export declare const registryAcceptOwner: typeof acceptLogAuthority;
|
|
|
92
90
|
* {@link registryApprove} under the policy's own tag as its name, false is {@link registryRevoke}.
|
|
93
91
|
*/
|
|
94
92
|
export declare function setPolicyApproved(c: LogswapClient, policy: Address, approved: boolean): Promise<Hash>;
|
|
93
|
+
/**
|
|
94
|
+
* What the LOG installs for a pool in the same transaction as its move to a SPONSORED policy (decision 098): the old policy's gates, operator and whitelist never
|
|
95
|
+
* carry, so a gated pool never passes through an open block. Every field defaults to the open, ungated, operator-less pool. The target
|
|
96
|
+
* policy must offer gates (`gatesAvailable`) for anything but the default; a move onto a pad or a POL carries none (`PermissionsNotApplicable`).
|
|
97
|
+
*/
|
|
98
|
+
export interface MigrationPermissions {
|
|
99
|
+
swapMode?: FPoolSwapMode;
|
|
100
|
+
/** The pool's operator under the new policy; zero (the default) appoints none. Required for `operator` mode. */
|
|
101
|
+
operator?: Address;
|
|
102
|
+
/** The mint gate: only the authority and the operator mint. */
|
|
103
|
+
mintGated?: boolean;
|
|
104
|
+
/** Accounts added to the swap whitelist. */
|
|
105
|
+
listed?: readonly Address[];
|
|
106
|
+
}
|
|
95
107
|
/**
|
|
96
108
|
* Move a pool to another approved policy of the same kind: the LOG Authority's alone, a forced move
|
|
97
109
|
* (adoption at regeneration by the pool authority's consent is specified, not built — logswap-docs
|
|
98
|
-
* `specs/governance/policy-adoption.md`),
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* the name (read off the old policy defensively, the key's creator standing in when it cannot
|
|
104
|
-
* answer); the operator
|
|
110
|
+
* `specs/governance/policy-adoption.md`), orchestrated on the registry — `migrate(manager, key, to, permissions)`
|
|
111
|
+
* (decision 098; `migratePrivate` is gone). The registry checks the key against the manager (`NoPool`), the manager is its
|
|
112
|
+
* own (`WrongManager`), the two policies' tags recorded at approval ({@link registryKindOf}; every sponsored policy shares
|
|
113
|
+
* `"sponsor"`), the creation mode against the pool's authority (`SponsorOnly`: a sponsor's pool moves only under a policy of
|
|
114
|
+
* the same sponsor, or one open to anyone) and that the pool never held the target (`AlreadyHeld`). The new policy is
|
|
115
|
+
* brought the authority and the name (read off the old policy defensively, the key's creator standing in when it cannot
|
|
116
|
+
* answer); `permissions` installs the pool's swap mode, operator, mint gate and whitelist under it in the same transaction ({@link MigrationPermissions});
|
|
117
|
+
* the key, its fees and its id are untouched; no swap lands in the block. F only until C ships a `setPolicy`.
|
|
105
118
|
*
|
|
106
119
|
* Pass the pool's `key` when in hand. Given only `poolId`, the key is rebuilt from the pool's
|
|
107
120
|
* `PoolCreated` log ({@link fPoolKeyOfPool}) with `salt` (zero by default) and checked against
|
|
@@ -109,6 +122,7 @@ export declare function setPolicyApproved(c: LogswapClient, policy: Address, app
|
|
|
109
122
|
*/
|
|
110
123
|
export declare function fPoolMigrate(c: LogswapClient, a: {
|
|
111
124
|
to: Address;
|
|
125
|
+
permissions?: MigrationPermissions;
|
|
112
126
|
} & ({
|
|
113
127
|
key: FPoolKey;
|
|
114
128
|
} | {
|
|
@@ -116,26 +130,29 @@ export declare function fPoolMigrate(c: LogswapClient, a: {
|
|
|
116
130
|
salt?: `0x${string}`;
|
|
117
131
|
fromBlock?: bigint;
|
|
118
132
|
})): Promise<Hash>;
|
|
133
|
+
/**
|
|
134
|
+
* `PolicyRegistry.orphan(manager, key)` (decision 098): move a pool whose sponsor went rogue or lost its key to the manager's orphan policy
|
|
135
|
+
* ({@link registryOrphanPolicyOf}) — no owner and no setting; swap and mint open; `deployLiquidity`, `harvest`, `close` and the generation
|
|
136
|
+
* step refused; income tax zero. The LOG Authority's alone, needing no consent, and FINAL: a pool never leaves the orphan policy (`Orphaned`).
|
|
137
|
+
* `key` as in {@link fPoolMigrate}.
|
|
138
|
+
*/
|
|
139
|
+
export declare function fPoolOrphan(c: LogswapClient, a: {
|
|
140
|
+
key: FPoolKey;
|
|
141
|
+
} | {
|
|
142
|
+
poolId: `0x${string}`;
|
|
143
|
+
salt?: `0x${string}`;
|
|
144
|
+
fromBlock?: bigint;
|
|
145
|
+
}): Promise<Hash>;
|
|
146
|
+
/** The orphan policy registered for a manager (`orphanPolicy(manager)`): F's by default; zero when none is registered or the deployment has no registry. */
|
|
147
|
+
export declare function registryOrphanPolicyOf(c: LogswapClient, side?: Side): Promise<Address>;
|
|
148
|
+
/** `PolicyRegistry.setOrphanPolicy(manager, policy)`: register the approved policy tagged `"orphan"` that answers `manager` (F's by default). The LOG Authority's. */
|
|
149
|
+
export declare function registrySetOrphanPolicy(c: LogswapClient, policy: Address, side?: Side): Promise<Hash>;
|
|
119
150
|
/**
|
|
120
151
|
* The kind tag the registry recorded for `policy` at approval (`kindOf`, F version 20) — refreshed
|
|
121
152
|
* on re-approval and kept after a revoke; what `migrate` compares, never the policy's live
|
|
122
153
|
* answer. "" for a policy the registry never approved (or a deployment with no registry).
|
|
123
154
|
*/
|
|
124
155
|
export declare function registryKindOf(c: LogswapClient, policy: Address): Promise<FPoolKind | "">;
|
|
125
|
-
/**
|
|
126
|
-
* `PadPolicy.setSchedule` (decisions 056, 067, 070, 073): the rung's growth and the RANGE inside which a creator chooses their cut of the income
|
|
127
|
-
* at creation (its top ≤ the F manager's `PAYEE_CUT_MAX`). The rest of the income deepens the bid — nothing is bought or
|
|
128
|
-
* burnt since F version 28, and the protocol takes no cut of the income since F version 33 (its revenue is the income tax,
|
|
129
|
-
* {@link padSetIncomeTaxRate}). A change to the range 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.
|
|
137
|
-
*/
|
|
138
|
-
export declare function padSetThresholdBase(c: LogswapClient, policy: Address, quote: Address, base: bigint): Promise<Hash>;
|
|
139
156
|
/** A pad policy's `T(0)` in one quote (decision 070): `set` false means no pad can be born on that quote. */
|
|
140
157
|
export interface PadThresholdBase {
|
|
141
158
|
quote: Address;
|
|
@@ -157,86 +174,79 @@ export interface PadSchedule {
|
|
|
157
174
|
}
|
|
158
175
|
/** Read {@link PadSchedule} off a pad policy. */
|
|
159
176
|
export declare function padScheduleOf(c: LogswapClient, policy: Address): Promise<PadSchedule>;
|
|
160
|
-
/** `
|
|
161
|
-
export declare function polSetMinQuoteRatio(c: LogswapClient, policy: Address, ratio: bigint): Promise<Hash>;
|
|
162
|
-
/** `PadPolicy.setIncomeTaxRate` (decision 073): the share of its new income dividend the dead shares pay LOG Treasury as income tax, WAD, at most 50%. The policy sponsor's. */
|
|
163
|
-
export declare function padSetIncomeTaxRate(c: LogswapClient, policy: Address, rate: bigint): Promise<Hash>;
|
|
164
|
-
/** `PolPolicy.setIncomeTaxRate` (decision 073): the share of its new income dividend the pool's authority pays LOG Treasury, WAD, at most 50%. Paid on the authority's own shares only: an authority that holds through another address pays nothing. The policy sponsor's. */
|
|
165
|
-
export declare function polSetIncomeTaxRate(c: LogswapClient, policy: Address, rate: bigint): Promise<Hash>;
|
|
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. */
|
|
167
|
-
export declare function policySetQuoteListed(c: LogswapClient, policy: Address, quote: Address, listed: boolean): Promise<Hash>;
|
|
168
|
-
/** `setQuoteCurated` on any protocol policy: on, a birth against an unlisted quote is refused. The LOG Authority's. */
|
|
169
|
-
export declare function policySetQuoteCurated(c: LogswapClient, policy: Address, curated: boolean): Promise<Hash>;
|
|
170
|
-
/** Whether `quote` passes `policy`'s birth check now: listed, or the policy does not curate quotes. */
|
|
177
|
+
/** Whether `quote` passes a sponsored `policy`'s birth check now: it curates quotes (`quoteCurated`, a non-empty list set in the constructor) and lists it, or it does not curate. */
|
|
171
178
|
export declare function policyQuoteAllowed(c: LogswapClient, policy: Address, quote: Address): Promise<{
|
|
172
179
|
curated: boolean;
|
|
173
180
|
listed: boolean;
|
|
174
181
|
allowed: boolean;
|
|
175
182
|
}>;
|
|
176
183
|
/**
|
|
177
|
-
* `
|
|
178
|
-
*
|
|
179
|
-
* The LOG Authority's.
|
|
184
|
+
* Whether `fee` passes a sponsored `policy`'s birth check now: on its swap tiers (`swapFeeListed`) or, with `kind: "mint"`, its mint tiers
|
|
185
|
+
* (`mintFeeListed`). `curated` is true when the policy lists tiers (a non-zero mask); with none, any fee in the manager's domain is allowed.
|
|
180
186
|
*/
|
|
181
|
-
export declare function
|
|
182
|
-
/** `setFeeCurated` on any protocol policy: on, a birth with an unlisted swap fee is refused (`FeeNotListed`). The LOG Authority's. */
|
|
183
|
-
export declare function policySetFeeCurated(c: LogswapClient, policy: Address, curated: boolean): Promise<Hash>;
|
|
184
|
-
/** Whether `fee` passes `policy`'s birth check now: listed, or the policy does not curate fees (the desk's never does). */
|
|
185
|
-
export declare function policyFeeAllowed(c: LogswapClient, policy: Address, fee: bigint): Promise<{
|
|
187
|
+
export declare function policyFeeAllowed(c: LogswapClient, policy: Address, fee: bigint, kind?: "swap" | "mint"): Promise<{
|
|
186
188
|
curated: boolean;
|
|
187
189
|
listed: boolean;
|
|
188
190
|
allowed: boolean;
|
|
189
191
|
}>;
|
|
190
|
-
/** `PolicyRegistry.CreationMode` (
|
|
191
|
-
export type CreationMode = "open" | "
|
|
192
|
-
/** `PolicyRegistry.setCreationMode(policy, mode)` (the LOG Authority)
|
|
192
|
+
/** `PolicyRegistry.CreationMode` (decisions 073, 098): who may create under a policy. Open = 0, SponsorOnly = 1 (the policy's own immutable sponsor, who must also be the key's creator). `Restricted` and the initializer list are gone. */
|
|
193
|
+
export type CreationMode = "open" | "sponsorOnly";
|
|
194
|
+
/** `PolicyRegistry.setCreationMode(policy, mode)` (the LOG Authority). A sponsored policy is approved `sponsorOnly`. */
|
|
193
195
|
export declare function registrySetCreationMode(c: LogswapClient, policy: Address, mode: CreationMode): Promise<Hash>;
|
|
194
|
-
/** `PolicyRegistry.setInitializerListed(policy, who, allowed)` (the LOG Authority): who may create under a `restricted` policy, authenticated as the caller or a trusted forwarder's user. */
|
|
195
|
-
export declare function registrySetInitializerListed(c: LogswapClient, policy: Address, who: Address, allowed: boolean): Promise<Hash>;
|
|
196
196
|
/** `PolicyRegistry.setForwarderTrusted` (the LOG Authority): a router whose `user()` names the creator. Moved off the public policy in F version 33. */
|
|
197
197
|
export declare function registrySetForwarderTrusted(c: LogswapClient, forwarder: Address, trusted: boolean): Promise<Hash>;
|
|
198
198
|
/** `PolicyRegistry.creationMode(policy)`. */
|
|
199
|
-
export declare function registryCreationMode(c: LogswapClient, policy: Address): Promise<CreationMode>;
|
|
200
|
-
/** `PublicPolicy.setPairListed` (064): a C pair a market may be born on while pairs are curated. Directional (base, quote). */
|
|
201
|
-
export declare function gateSetPairListed(c: LogswapClient, policy: Address, base: Address, quote: Address, listed: boolean): Promise<Hash>;
|
|
202
|
-
/** `PublicPolicy.setPairCurated` (064). */
|
|
203
|
-
export declare function gateSetPairCurated(c: LogswapClient, policy: Address, curated: boolean): Promise<Hash>;
|
|
204
|
-
/** `PublicPolicy.setSpacingListed` (064): a C tick spacing, WAD (10 bp = 1e15, 100 bp = 1e16). Always consulted. */
|
|
205
|
-
export declare function gateSetSpacingListed(c: LogswapClient, policy: Address, tickSpacing: bigint, listed: boolean): Promise<Hash>;
|
|
206
199
|
/**
|
|
207
|
-
*
|
|
208
|
-
*
|
|
200
|
+
* `PolicyRegistry.userOf(caller)` (C 15, decision 097): the account a caller acts for — the user a trusted forwarder
|
|
201
|
+
* (a router) names, else the caller itself. The account the managers authenticate as a market's creator and as the
|
|
202
|
+
* first minter; what a create form compares to the key's `creator`.
|
|
209
203
|
*/
|
|
210
|
-
export declare function
|
|
204
|
+
export declare function registryUserOf(c: LogswapClient, caller: Address): Promise<Address>;
|
|
205
|
+
export declare function registryCreationMode(c: LogswapClient, policy: Address): Promise<CreationMode>;
|
|
206
|
+
/** Whether `policy` (a `SponsorPolicyC`) admits C tick spacing `tickSpacing`: it curates spacings (`spacingCurated`) and lists it, or it does not curate. */
|
|
207
|
+
export declare function policySpacingAllowed(c: LogswapClient, policy: Address, tickSpacing: bigint): Promise<{
|
|
208
|
+
curated: boolean;
|
|
209
|
+
listed: boolean;
|
|
210
|
+
allowed: boolean;
|
|
211
|
+
}>;
|
|
211
212
|
export interface CGateRules {
|
|
212
|
-
/**
|
|
213
|
+
/**
|
|
214
|
+
* The registry admits `creator` to create under `key.policy` (creation mode and sponsor binding; decisions 073, 097, 098):
|
|
215
|
+
* `admit(policy, creator, creator)` resolves to `creator`. Both managers then require the initializer to BE the key's creator (`NotCreator`).
|
|
216
|
+
*/
|
|
213
217
|
creatorOk: boolean;
|
|
218
|
+
/** The quote is on the policy's list, or the policy lists none (`quoteCurated`). */
|
|
214
219
|
quoteOk: boolean;
|
|
215
|
-
|
|
220
|
+
/** The swap fee is on the policy's swap tiers, or it lists none. */
|
|
216
221
|
feeOk: boolean;
|
|
222
|
+
/** The mint fee is on the policy's mint tiers, or it lists none. */
|
|
223
|
+
mintFeeOk: boolean;
|
|
224
|
+
/** The tick spacing is on the policy's list, or it lists none (`spacingCurated`). */
|
|
217
225
|
spacingOk: boolean;
|
|
218
|
-
/** A
|
|
226
|
+
/** A canonical policy (the LOG's open instance) needs `salt` zero (`NotCanonical`); a desk's may run several markets of one shape. */
|
|
227
|
+
saltOk: boolean;
|
|
228
|
+
/** This exact market (the key's id) is already initialized: another is a different key. */
|
|
219
229
|
exists: boolean;
|
|
220
230
|
/** Whether `router` is a trusted forwarder on the registry — `createMarket` through it is then checked against `creator`. */
|
|
221
231
|
routerTrusted: boolean;
|
|
222
|
-
/** Every check passes: the policy would admit this market from this creator (the
|
|
232
|
+
/** Every check passes: the policy would admit this market from this creator (the manager checks the fee domain, `BadParam`). */
|
|
223
233
|
admitted: boolean;
|
|
224
234
|
}
|
|
225
235
|
/**
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
* is
|
|
229
|
-
*
|
|
236
|
+
* A sponsored C policy's checks for one candidate market and creator, in one round of reads — what the create form shows before a wallet
|
|
237
|
+
* is asked (064, 073, 097, 098). The policy is `key.policy` (a `SponsorPolicyC`); the registry is asked `admit(policy, creator, creator)`: the
|
|
238
|
+
* account that starts a market is its creator, so the key's `creator` is the connected account (a router call resolves to it through the
|
|
239
|
+
* trusted forwarder's `user()`). The policy's pair list is gone (098).
|
|
230
240
|
*/
|
|
231
241
|
export declare function cGateRules(c: LogswapClient, a: {
|
|
232
242
|
key: PoolKey;
|
|
233
|
-
creator
|
|
243
|
+
creator?: Address;
|
|
234
244
|
router?: Address;
|
|
235
245
|
gate?: Address;
|
|
236
246
|
}): Promise<CGateRules>;
|
|
237
247
|
/**
|
|
238
|
-
* Every refusal a birth can meet at
|
|
239
|
-
* failed simulation: the
|
|
248
|
+
* Every refusal a birth can meet at a sponsored policy or the registry (064, 065, 098), for `decodeErrorResult` on a
|
|
249
|
+
* failed simulation: the sponsored C policy's errors (a superset of F's) plus the pad's `PadExists` (one pad per base) and `NoThreshold` (no `T(0)`
|
|
240
250
|
* in the pad's quote, decision 070).
|
|
241
251
|
*/
|
|
242
252
|
export declare const gateErrorAbi: readonly ({
|
|
@@ -309,20 +319,6 @@ export declare const gateErrorAbi: readonly ({
|
|
|
309
319
|
readonly name: "approve";
|
|
310
320
|
readonly outputs: readonly [];
|
|
311
321
|
readonly stateMutability: "nonpayable";
|
|
312
|
-
} | {
|
|
313
|
-
readonly type: "function";
|
|
314
|
-
readonly inputs: readonly [{
|
|
315
|
-
readonly name: "policy";
|
|
316
|
-
readonly internalType: "address";
|
|
317
|
-
readonly type: "address";
|
|
318
|
-
}, {
|
|
319
|
-
readonly name: "sponsor";
|
|
320
|
-
readonly internalType: "address";
|
|
321
|
-
readonly type: "address";
|
|
322
|
-
}];
|
|
323
|
-
readonly name: "bindSponsor";
|
|
324
|
-
readonly outputs: readonly [];
|
|
325
|
-
readonly stateMutability: "nonpayable";
|
|
326
322
|
} | {
|
|
327
323
|
readonly type: "function";
|
|
328
324
|
readonly inputs: readonly [{
|
|
@@ -377,24 +373,6 @@ export declare const gateErrorAbi: readonly ({
|
|
|
377
373
|
readonly type: "bool";
|
|
378
374
|
}];
|
|
379
375
|
readonly stateMutability: "view";
|
|
380
|
-
} | {
|
|
381
|
-
readonly type: "function";
|
|
382
|
-
readonly inputs: readonly [{
|
|
383
|
-
readonly name: "";
|
|
384
|
-
readonly internalType: "address";
|
|
385
|
-
readonly type: "address";
|
|
386
|
-
}, {
|
|
387
|
-
readonly name: "";
|
|
388
|
-
readonly internalType: "address";
|
|
389
|
-
readonly type: "address";
|
|
390
|
-
}];
|
|
391
|
-
readonly name: "initializerListed";
|
|
392
|
-
readonly outputs: readonly [{
|
|
393
|
-
readonly name: "";
|
|
394
|
-
readonly internalType: "bool";
|
|
395
|
-
readonly type: "bool";
|
|
396
|
-
}];
|
|
397
|
-
readonly stateMutability: "view";
|
|
398
376
|
} | {
|
|
399
377
|
readonly type: "function";
|
|
400
378
|
readonly inputs: readonly [{
|
|
@@ -441,7 +419,7 @@ export declare const gateErrorAbi: readonly ({
|
|
|
441
419
|
readonly type: "address";
|
|
442
420
|
}, {
|
|
443
421
|
readonly name: "key";
|
|
444
|
-
readonly internalType: "struct
|
|
422
|
+
readonly internalType: "struct PoolKeyF";
|
|
445
423
|
readonly type: "tuple";
|
|
446
424
|
readonly components: readonly [{
|
|
447
425
|
readonly name: "quote";
|
|
@@ -476,6 +454,27 @@ export declare const gateErrorAbi: readonly ({
|
|
|
476
454
|
readonly name: "to";
|
|
477
455
|
readonly internalType: "address";
|
|
478
456
|
readonly type: "address";
|
|
457
|
+
}, {
|
|
458
|
+
readonly name: "permissions";
|
|
459
|
+
readonly internalType: "struct ISponsorMigration.Permissions";
|
|
460
|
+
readonly type: "tuple";
|
|
461
|
+
readonly components: readonly [{
|
|
462
|
+
readonly name: "swapMode";
|
|
463
|
+
readonly internalType: "uint8";
|
|
464
|
+
readonly type: "uint8";
|
|
465
|
+
}, {
|
|
466
|
+
readonly name: "operator";
|
|
467
|
+
readonly internalType: "address";
|
|
468
|
+
readonly type: "address";
|
|
469
|
+
}, {
|
|
470
|
+
readonly name: "mintGated";
|
|
471
|
+
readonly internalType: "bool";
|
|
472
|
+
readonly type: "bool";
|
|
473
|
+
}, {
|
|
474
|
+
readonly name: "listed";
|
|
475
|
+
readonly internalType: "address[]";
|
|
476
|
+
readonly type: "address[]";
|
|
477
|
+
}];
|
|
479
478
|
}];
|
|
480
479
|
readonly name: "migrate";
|
|
481
480
|
readonly outputs: readonly [];
|
|
@@ -488,7 +487,7 @@ export declare const gateErrorAbi: readonly ({
|
|
|
488
487
|
readonly type: "address";
|
|
489
488
|
}, {
|
|
490
489
|
readonly name: "key";
|
|
491
|
-
readonly internalType: "struct
|
|
490
|
+
readonly internalType: "struct PoolKeyF";
|
|
492
491
|
readonly type: "tuple";
|
|
493
492
|
readonly components: readonly [{
|
|
494
493
|
readonly name: "quote";
|
|
@@ -519,39 +518,24 @@ export declare const gateErrorAbi: readonly ({
|
|
|
519
518
|
readonly internalType: "uint256";
|
|
520
519
|
readonly type: "uint256";
|
|
521
520
|
}];
|
|
522
|
-
}, {
|
|
523
|
-
readonly name: "to";
|
|
524
|
-
readonly internalType: "address";
|
|
525
|
-
readonly type: "address";
|
|
526
|
-
}, {
|
|
527
|
-
readonly name: "permissions";
|
|
528
|
-
readonly internalType: "struct IPrivatePolicyMigration.Permissions";
|
|
529
|
-
readonly type: "tuple";
|
|
530
|
-
readonly components: readonly [{
|
|
531
|
-
readonly name: "swapMode";
|
|
532
|
-
readonly internalType: "uint8";
|
|
533
|
-
readonly type: "uint8";
|
|
534
|
-
}, {
|
|
535
|
-
readonly name: "executor";
|
|
536
|
-
readonly internalType: "address";
|
|
537
|
-
readonly type: "address";
|
|
538
|
-
}, {
|
|
539
|
-
readonly name: "mintGated";
|
|
540
|
-
readonly internalType: "bool";
|
|
541
|
-
readonly type: "bool";
|
|
542
|
-
}, {
|
|
543
|
-
readonly name: "minters";
|
|
544
|
-
readonly internalType: "address[]";
|
|
545
|
-
readonly type: "address[]";
|
|
546
|
-
}, {
|
|
547
|
-
readonly name: "takers";
|
|
548
|
-
readonly internalType: "address[]";
|
|
549
|
-
readonly type: "address[]";
|
|
550
|
-
}];
|
|
551
521
|
}];
|
|
552
|
-
readonly name: "
|
|
522
|
+
readonly name: "orphan";
|
|
553
523
|
readonly outputs: readonly [];
|
|
554
524
|
readonly stateMutability: "nonpayable";
|
|
525
|
+
} | {
|
|
526
|
+
readonly type: "function";
|
|
527
|
+
readonly inputs: readonly [{
|
|
528
|
+
readonly name: "";
|
|
529
|
+
readonly internalType: "address";
|
|
530
|
+
readonly type: "address";
|
|
531
|
+
}];
|
|
532
|
+
readonly name: "orphanPolicy";
|
|
533
|
+
readonly outputs: readonly [{
|
|
534
|
+
readonly name: "";
|
|
535
|
+
readonly internalType: "address";
|
|
536
|
+
readonly type: "address";
|
|
537
|
+
}];
|
|
538
|
+
readonly stateMutability: "view";
|
|
555
539
|
} | {
|
|
556
540
|
readonly type: "function";
|
|
557
541
|
readonly inputs: readonly [];
|
|
@@ -623,19 +607,15 @@ export declare const gateErrorAbi: readonly ({
|
|
|
623
607
|
} | {
|
|
624
608
|
readonly type: "function";
|
|
625
609
|
readonly inputs: readonly [{
|
|
626
|
-
readonly name: "
|
|
610
|
+
readonly name: "manager";
|
|
627
611
|
readonly internalType: "address";
|
|
628
612
|
readonly type: "address";
|
|
629
613
|
}, {
|
|
630
|
-
readonly name: "
|
|
614
|
+
readonly name: "policy";
|
|
631
615
|
readonly internalType: "address";
|
|
632
616
|
readonly type: "address";
|
|
633
|
-
}, {
|
|
634
|
-
readonly name: "allowed";
|
|
635
|
-
readonly internalType: "bool";
|
|
636
|
-
readonly type: "bool";
|
|
637
617
|
}];
|
|
638
|
-
readonly name: "
|
|
618
|
+
readonly name: "setOrphanPolicy";
|
|
639
619
|
readonly outputs: readonly [];
|
|
640
620
|
readonly stateMutability: "nonpayable";
|
|
641
621
|
} | {
|
|
@@ -694,6 +674,20 @@ export declare const gateErrorAbi: readonly ({
|
|
|
694
674
|
readonly name: "sunset";
|
|
695
675
|
readonly outputs: readonly [];
|
|
696
676
|
readonly stateMutability: "nonpayable";
|
|
677
|
+
} | {
|
|
678
|
+
readonly type: "function";
|
|
679
|
+
readonly inputs: readonly [{
|
|
680
|
+
readonly name: "caller";
|
|
681
|
+
readonly internalType: "address";
|
|
682
|
+
readonly type: "address";
|
|
683
|
+
}];
|
|
684
|
+
readonly name: "userOf";
|
|
685
|
+
readonly outputs: readonly [{
|
|
686
|
+
readonly name: "";
|
|
687
|
+
readonly internalType: "address";
|
|
688
|
+
readonly type: "address";
|
|
689
|
+
}];
|
|
690
|
+
readonly stateMutability: "view";
|
|
697
691
|
} | {
|
|
698
692
|
readonly type: "event";
|
|
699
693
|
readonly anonymous: false;
|
|
@@ -739,26 +733,6 @@ export declare const gateErrorAbi: readonly ({
|
|
|
739
733
|
readonly indexed: false;
|
|
740
734
|
}];
|
|
741
735
|
readonly name: "ForwarderTrusted";
|
|
742
|
-
} | {
|
|
743
|
-
readonly type: "event";
|
|
744
|
-
readonly anonymous: false;
|
|
745
|
-
readonly inputs: readonly [{
|
|
746
|
-
readonly name: "policy";
|
|
747
|
-
readonly internalType: "address";
|
|
748
|
-
readonly type: "address";
|
|
749
|
-
readonly indexed: true;
|
|
750
|
-
}, {
|
|
751
|
-
readonly name: "who";
|
|
752
|
-
readonly internalType: "address";
|
|
753
|
-
readonly type: "address";
|
|
754
|
-
readonly indexed: true;
|
|
755
|
-
}, {
|
|
756
|
-
readonly name: "allowed";
|
|
757
|
-
readonly internalType: "bool";
|
|
758
|
-
readonly type: "bool";
|
|
759
|
-
readonly indexed: false;
|
|
760
|
-
}];
|
|
761
|
-
readonly name: "InitializerListed";
|
|
762
736
|
} | {
|
|
763
737
|
readonly type: "event";
|
|
764
738
|
readonly anonymous: false;
|
|
@@ -823,27 +797,47 @@ export declare const gateErrorAbi: readonly ({
|
|
|
823
797
|
readonly type: "event";
|
|
824
798
|
readonly anonymous: false;
|
|
825
799
|
readonly inputs: readonly [{
|
|
800
|
+
readonly name: "manager";
|
|
801
|
+
readonly internalType: "address";
|
|
802
|
+
readonly type: "address";
|
|
803
|
+
readonly indexed: true;
|
|
804
|
+
}, {
|
|
826
805
|
readonly name: "policy";
|
|
827
806
|
readonly internalType: "address";
|
|
828
807
|
readonly type: "address";
|
|
829
808
|
readonly indexed: true;
|
|
830
809
|
}];
|
|
831
|
-
readonly name: "
|
|
810
|
+
readonly name: "OrphanPolicySet";
|
|
832
811
|
} | {
|
|
833
812
|
readonly type: "event";
|
|
834
813
|
readonly anonymous: false;
|
|
835
814
|
readonly inputs: readonly [{
|
|
836
|
-
readonly name: "
|
|
815
|
+
readonly name: "manager";
|
|
837
816
|
readonly internalType: "address";
|
|
838
817
|
readonly type: "address";
|
|
839
818
|
readonly indexed: true;
|
|
840
819
|
}, {
|
|
841
|
-
readonly name: "
|
|
820
|
+
readonly name: "poolId";
|
|
821
|
+
readonly internalType: "bytes32";
|
|
822
|
+
readonly type: "bytes32";
|
|
823
|
+
readonly indexed: true;
|
|
824
|
+
}, {
|
|
825
|
+
readonly name: "from";
|
|
826
|
+
readonly internalType: "address";
|
|
827
|
+
readonly type: "address";
|
|
828
|
+
readonly indexed: true;
|
|
829
|
+
}];
|
|
830
|
+
readonly name: "PoolOrphaned";
|
|
831
|
+
} | {
|
|
832
|
+
readonly type: "event";
|
|
833
|
+
readonly anonymous: false;
|
|
834
|
+
readonly inputs: readonly [{
|
|
835
|
+
readonly name: "policy";
|
|
842
836
|
readonly internalType: "address";
|
|
843
837
|
readonly type: "address";
|
|
844
838
|
readonly indexed: true;
|
|
845
839
|
}];
|
|
846
|
-
readonly name: "
|
|
840
|
+
readonly name: "Revoked";
|
|
847
841
|
} | {
|
|
848
842
|
readonly type: "event";
|
|
849
843
|
readonly anonymous: false;
|
|
@@ -881,15 +875,15 @@ export declare const gateErrorAbi: readonly ({
|
|
|
881
875
|
} | {
|
|
882
876
|
readonly type: "error";
|
|
883
877
|
readonly inputs: readonly [];
|
|
884
|
-
readonly name: "
|
|
878
|
+
readonly name: "InvalidForwardedUser";
|
|
885
879
|
} | {
|
|
886
880
|
readonly type: "error";
|
|
887
881
|
readonly inputs: readonly [];
|
|
888
|
-
readonly name: "
|
|
882
|
+
readonly name: "KindMismatch";
|
|
889
883
|
} | {
|
|
890
884
|
readonly type: "error";
|
|
891
885
|
readonly inputs: readonly [];
|
|
892
|
-
readonly name: "
|
|
886
|
+
readonly name: "NoOrphanPolicy";
|
|
893
887
|
} | {
|
|
894
888
|
readonly type: "error";
|
|
895
889
|
readonly inputs: readonly [];
|
|
@@ -909,7 +903,15 @@ export declare const gateErrorAbi: readonly ({
|
|
|
909
903
|
} | {
|
|
910
904
|
readonly type: "error";
|
|
911
905
|
readonly inputs: readonly [];
|
|
912
|
-
readonly name: "
|
|
906
|
+
readonly name: "NotOrphanPolicy";
|
|
907
|
+
} | {
|
|
908
|
+
readonly type: "error";
|
|
909
|
+
readonly inputs: readonly [];
|
|
910
|
+
readonly name: "Orphaned";
|
|
911
|
+
} | {
|
|
912
|
+
readonly type: "error";
|
|
913
|
+
readonly inputs: readonly [];
|
|
914
|
+
readonly name: "PermissionsNotApplicable";
|
|
913
915
|
} | {
|
|
914
916
|
readonly type: "error";
|
|
915
917
|
readonly inputs: readonly [];
|
|
@@ -925,11 +927,23 @@ export declare const gateErrorAbi: readonly ({
|
|
|
925
927
|
} | {
|
|
926
928
|
readonly type: "error";
|
|
927
929
|
readonly inputs: readonly [];
|
|
928
|
-
readonly name: "
|
|
930
|
+
readonly name: "AlreadyHeld";
|
|
931
|
+
} | {
|
|
932
|
+
readonly type: "error";
|
|
933
|
+
readonly inputs: readonly [];
|
|
934
|
+
readonly name: "BadParams";
|
|
929
935
|
} | {
|
|
930
936
|
readonly type: "error";
|
|
931
937
|
readonly inputs: readonly [];
|
|
932
938
|
readonly name: "BadRate";
|
|
939
|
+
} | {
|
|
940
|
+
readonly type: "error";
|
|
941
|
+
readonly inputs: readonly [];
|
|
942
|
+
readonly name: "BadSwapMode";
|
|
943
|
+
} | {
|
|
944
|
+
readonly type: "error";
|
|
945
|
+
readonly inputs: readonly [];
|
|
946
|
+
readonly name: "BadTax";
|
|
933
947
|
} | {
|
|
934
948
|
readonly type: "error";
|
|
935
949
|
readonly inputs: readonly [{
|
|
@@ -938,22 +952,22 @@ export declare const gateErrorAbi: readonly ({
|
|
|
938
952
|
readonly type: "uint256";
|
|
939
953
|
}];
|
|
940
954
|
readonly name: "FeeNotListed";
|
|
955
|
+
} | {
|
|
956
|
+
readonly type: "error";
|
|
957
|
+
readonly inputs: readonly [];
|
|
958
|
+
readonly name: "GatesUnavailable";
|
|
959
|
+
} | {
|
|
960
|
+
readonly type: "error";
|
|
961
|
+
readonly inputs: readonly [];
|
|
962
|
+
readonly name: "InactivePool";
|
|
941
963
|
} | {
|
|
942
964
|
readonly type: "error";
|
|
943
965
|
readonly inputs: readonly [{
|
|
944
|
-
readonly name: "base";
|
|
945
|
-
readonly internalType: "address";
|
|
946
|
-
readonly type: "address";
|
|
947
|
-
}, {
|
|
948
|
-
readonly name: "quote";
|
|
949
|
-
readonly internalType: "address";
|
|
950
|
-
readonly type: "address";
|
|
951
|
-
}, {
|
|
952
966
|
readonly name: "fee";
|
|
953
967
|
readonly internalType: "uint256";
|
|
954
968
|
readonly type: "uint256";
|
|
955
969
|
}];
|
|
956
|
-
readonly name: "
|
|
970
|
+
readonly name: "MintFeeNotListed";
|
|
957
971
|
} | {
|
|
958
972
|
readonly type: "error";
|
|
959
973
|
readonly inputs: readonly [];
|
|
@@ -966,10 +980,6 @@ export declare const gateErrorAbi: readonly ({
|
|
|
966
980
|
readonly type: "error";
|
|
967
981
|
readonly inputs: readonly [];
|
|
968
982
|
readonly name: "NotCanonical";
|
|
969
|
-
} | {
|
|
970
|
-
readonly type: "error";
|
|
971
|
-
readonly inputs: readonly [];
|
|
972
|
-
readonly name: "NotLogAuthority";
|
|
973
983
|
} | {
|
|
974
984
|
readonly type: "error";
|
|
975
985
|
readonly inputs: readonly [];
|
|
@@ -978,26 +988,10 @@ export declare const gateErrorAbi: readonly ({
|
|
|
978
988
|
readonly type: "error";
|
|
979
989
|
readonly inputs: readonly [];
|
|
980
990
|
readonly name: "NotRegistry";
|
|
981
|
-
} | {
|
|
982
|
-
readonly type: "error";
|
|
983
|
-
readonly inputs: readonly [];
|
|
984
|
-
readonly name: "NotSponsor";
|
|
985
991
|
} | {
|
|
986
992
|
readonly type: "error";
|
|
987
993
|
readonly inputs: readonly [];
|
|
988
994
|
readonly name: "OneBase";
|
|
989
|
-
} | {
|
|
990
|
-
readonly type: "error";
|
|
991
|
-
readonly inputs: readonly [{
|
|
992
|
-
readonly name: "base";
|
|
993
|
-
readonly internalType: "address";
|
|
994
|
-
readonly type: "address";
|
|
995
|
-
}, {
|
|
996
|
-
readonly name: "quote";
|
|
997
|
-
readonly internalType: "address";
|
|
998
|
-
readonly type: "address";
|
|
999
|
-
}];
|
|
1000
|
-
readonly name: "PairNotListed";
|
|
1001
995
|
} | {
|
|
1002
996
|
readonly type: "error";
|
|
1003
997
|
readonly inputs: readonly [{
|
|
@@ -1020,7 +1014,7 @@ export declare const gateErrorAbi: readonly ({
|
|
|
1020
1014
|
readonly name: "SpacingNotListed";
|
|
1021
1015
|
})[];
|
|
1022
1016
|
/** A manager's treasury — where its protocol revenue goes — and the proposed next one. */
|
|
1023
|
-
export declare function logTreasury(c: LogswapClient, side:
|
|
1017
|
+
export declare function logTreasury(c: LogswapClient, side: Side): Promise<{
|
|
1024
1018
|
treasury: Address;
|
|
1025
1019
|
pending: Address;
|
|
1026
1020
|
}>;
|
|
@@ -1028,15 +1022,15 @@ export declare function logTreasury(c: LogswapClient, side: "C" | "F"): Promise<
|
|
|
1028
1022
|
* Propose a manager's next treasury: the LOG Authority's call, never the treasury's own, so a
|
|
1029
1023
|
* treasury that can no longer act is replaced without it. Nothing the old treasury holds moves.
|
|
1030
1024
|
*/
|
|
1031
|
-
export declare function proposeTreasury(c: LogswapClient, side:
|
|
1025
|
+
export declare function proposeTreasury(c: LogswapClient, side: Side, next: Address): Promise<Hash>;
|
|
1032
1026
|
/** The proposed treasury takes the role, sending from its own address. */
|
|
1033
|
-
export declare function acceptTreasury(c: LogswapClient, side:
|
|
1027
|
+
export declare function acceptTreasury(c: LogswapClient, side: Side): Promise<Hash>;
|
|
1034
1028
|
/** @deprecated the collector became the treasury (066), proposed by the LOG Authority: use {@link proposeTreasury}. */
|
|
1035
1029
|
export declare const proposeCollector: typeof proposeTreasury;
|
|
1036
1030
|
/** @deprecated use {@link acceptTreasury}. */
|
|
1037
1031
|
export declare const acceptCollector: typeof acceptTreasury;
|
|
1038
1032
|
/**
|
|
1039
|
-
* `
|
|
1033
|
+
* `ManagerC.collectProtocolFees(poolId)`: pay one market's `protocolOwed` (mint fees and swap-fee
|
|
1040
1034
|
* tax) to the treasury. Anyone may send it (066); the destination is fixed.
|
|
1041
1035
|
*/
|
|
1042
1036
|
export declare function collectCProtocolFees(c: LogswapClient, key: PoolKey): Promise<Hash>;
|