@masterpeach/market-sdk 0.2.0-beta.20260930.1
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 +109 -0
- package/README.zh-CN.md +155 -0
- package/THIRD_PARTY_NOTICES.md +14 -0
- package/dist/abi/index.cjs +14051 -0
- package/dist/abi/index.cjs.map +1 -0
- package/dist/abi/index.d.cts +10882 -0
- package/dist/abi/index.d.ts +10882 -0
- package/dist/abi/index.js +27 -0
- package/dist/abi/index.js.map +1 -0
- package/dist/chunk-TMU4HSZR.js +231 -0
- package/dist/chunk-TMU4HSZR.js.map +1 -0
- package/dist/chunk-TTVBOGKZ.js +14015 -0
- package/dist/chunk-TTVBOGKZ.js.map +1 -0
- package/dist/core.cjs +271 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.d.cts +99 -0
- package/dist/core.d.ts +99 -0
- package/dist/core.js +35 -0
- package/dist/core.js.map +1 -0
- package/dist/index.cjs +13327 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +840 -0
- package/dist/index.d.ts +840 -0
- package/dist/index.js +2705 -0
- package/dist/index.js.map +1 -0
- package/docs/earnings.md +71 -0
- package/docs/frontend.md +153 -0
- package/docs/latest-contract.md +38 -0
- package/docs/liquidity.md +87 -0
- package/docs/management.md +73 -0
- package/docs/pool-state.md +30 -0
- package/docs/pools.md +118 -0
- package/docs/positions.md +94 -0
- package/docs/variants.md +24 -0
- package/package.json +82 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,840 @@
|
|
|
1
|
+
import * as viem from 'viem';
|
|
2
|
+
import { Address, Hex, PublicClient, TransactionReceipt, WalletClient } from 'viem';
|
|
3
|
+
|
|
4
|
+
/** Expected runtime hash must come from reviewed deployment evidence, not a fresh RPC read. */
|
|
5
|
+
interface MarketContractDeployment {
|
|
6
|
+
readonly address: Address;
|
|
7
|
+
readonly runtimeCodeHash: Hex;
|
|
8
|
+
}
|
|
9
|
+
type MarketHookKind = "ramp" | "ramp-eth" | "rwa-ramp";
|
|
10
|
+
/** Caller-supplied acceptance evidence. Code identity checks never promote this status. */
|
|
11
|
+
type MarketCapabilityStatus = "disabled" | "unverified" | "verified";
|
|
12
|
+
interface MarketHookCapabilities {
|
|
13
|
+
readonly liquidity: MarketCapabilityStatus;
|
|
14
|
+
readonly nativeLiquidity: MarketCapabilityStatus;
|
|
15
|
+
readonly claimOperator: MarketCapabilityStatus;
|
|
16
|
+
readonly management: MarketCapabilityStatus;
|
|
17
|
+
}
|
|
18
|
+
interface MarketHookDeployment extends MarketContractDeployment {
|
|
19
|
+
readonly kind: MarketHookKind;
|
|
20
|
+
readonly implementation: "ramp-v1";
|
|
21
|
+
readonly claimFeePolicy: MarketContractDeployment;
|
|
22
|
+
/** Required for rwa-ramp, forbidden for other kinds. */
|
|
23
|
+
readonly calendar?: MarketContractDeployment;
|
|
24
|
+
readonly capabilities: MarketHookCapabilities;
|
|
25
|
+
}
|
|
26
|
+
interface MarketDeployment {
|
|
27
|
+
readonly chainId: number;
|
|
28
|
+
readonly deploymentId: string;
|
|
29
|
+
readonly poolManager: MarketContractDeployment;
|
|
30
|
+
readonly registry: MarketContractDeployment;
|
|
31
|
+
readonly authority: MarketContractDeployment;
|
|
32
|
+
readonly reader?: MarketContractDeployment;
|
|
33
|
+
/** No implicit storage layout or StateView address is assumed. */
|
|
34
|
+
readonly poolStateReader?: {
|
|
35
|
+
readonly kind: "state-view";
|
|
36
|
+
readonly contract: MarketContractDeployment;
|
|
37
|
+
} | {
|
|
38
|
+
readonly kind: "extsload";
|
|
39
|
+
readonly layout: "uniswap-v4-v1";
|
|
40
|
+
};
|
|
41
|
+
readonly hooks: readonly MarketHookDeployment[];
|
|
42
|
+
}
|
|
43
|
+
interface MarketChainConfig {
|
|
44
|
+
readonly chainId: number;
|
|
45
|
+
readonly deployment: MarketDeployment;
|
|
46
|
+
readonly confirmations: number;
|
|
47
|
+
}
|
|
48
|
+
/** Raw v4 coordinates. Pool IDs are not token-pair IDs. */
|
|
49
|
+
interface MarketPoolKey {
|
|
50
|
+
readonly currency0: Address;
|
|
51
|
+
readonly currency1: Address;
|
|
52
|
+
readonly fee: number;
|
|
53
|
+
readonly tickSpacing: number;
|
|
54
|
+
readonly hooks: Address;
|
|
55
|
+
}
|
|
56
|
+
interface MarketDeploymentVerification {
|
|
57
|
+
readonly chainId: number;
|
|
58
|
+
readonly deploymentId: string;
|
|
59
|
+
readonly blockNumber: bigint;
|
|
60
|
+
readonly blockHash: Hex;
|
|
61
|
+
/** Code and wiring only; does not certify liquidity actions or future state. */
|
|
62
|
+
readonly scope: "code-and-wiring";
|
|
63
|
+
readonly checkedContracts: number;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface MarketReadContext {
|
|
67
|
+
readonly publicClient: PublicClient;
|
|
68
|
+
readonly deployment: MarketDeployment;
|
|
69
|
+
}
|
|
70
|
+
interface MarketReadOptions {
|
|
71
|
+
readonly blockNumber?: bigint;
|
|
72
|
+
/** For continuing pagination or composing multiple reads across exactly the same snapshot. */
|
|
73
|
+
readonly blockHash?: Hex;
|
|
74
|
+
}
|
|
75
|
+
interface MarketBlock {
|
|
76
|
+
readonly chainId: number;
|
|
77
|
+
readonly deploymentId: string;
|
|
78
|
+
readonly blockNumber: bigint;
|
|
79
|
+
readonly blockHash: Hex;
|
|
80
|
+
readonly timestamp: bigint;
|
|
81
|
+
}
|
|
82
|
+
interface MarketSnapshot<T> {
|
|
83
|
+
readonly block: MarketBlock;
|
|
84
|
+
readonly data: T;
|
|
85
|
+
}
|
|
86
|
+
interface MarketPool {
|
|
87
|
+
readonly key: MarketPoolKey;
|
|
88
|
+
readonly poolId: Hex;
|
|
89
|
+
readonly active: boolean;
|
|
90
|
+
/** Registry discovery alone does not establish SDK support or readiness to trade. */
|
|
91
|
+
readonly hookKind: MarketHookKind | null;
|
|
92
|
+
}
|
|
93
|
+
interface MarketListPoolsParams extends MarketReadOptions {
|
|
94
|
+
readonly offset?: bigint;
|
|
95
|
+
/** Number of registry entries scanned, not the number of active results; maximum 100. */
|
|
96
|
+
readonly limit?: number;
|
|
97
|
+
readonly activeOnly?: boolean;
|
|
98
|
+
}
|
|
99
|
+
interface MarketPoolPage {
|
|
100
|
+
readonly pools: readonly MarketPool[];
|
|
101
|
+
readonly totalCount: bigint;
|
|
102
|
+
readonly nextOffset: bigint | null;
|
|
103
|
+
}
|
|
104
|
+
type MarketSession = "open" | "overnight" | "closed";
|
|
105
|
+
interface MarketFeeBreakdown {
|
|
106
|
+
readonly pool: MarketPool;
|
|
107
|
+
readonly zeroForOne: boolean;
|
|
108
|
+
readonly timestamp: bigint;
|
|
109
|
+
readonly mode: "current" | "preview";
|
|
110
|
+
readonly session: MarketSession | null;
|
|
111
|
+
readonly baseFeePips: bigint;
|
|
112
|
+
readonly directionalPremiumPips: number;
|
|
113
|
+
readonly cappedAutonomousFeePips: number;
|
|
114
|
+
readonly overrideActive: boolean;
|
|
115
|
+
readonly overrideFeePips: number;
|
|
116
|
+
readonly overrideExpiry: bigint;
|
|
117
|
+
readonly overrideMinFeePips: number;
|
|
118
|
+
readonly maxFeePips: number;
|
|
119
|
+
readonly finalFeePips: number;
|
|
120
|
+
}
|
|
121
|
+
interface MarketCurrentFees {
|
|
122
|
+
readonly pool: MarketPool;
|
|
123
|
+
readonly fee0For1Pips: number;
|
|
124
|
+
readonly fee1For0Pips: number;
|
|
125
|
+
readonly globalPaused: boolean;
|
|
126
|
+
readonly poolPaused: boolean;
|
|
127
|
+
}
|
|
128
|
+
interface MarketSessionState {
|
|
129
|
+
readonly pool: MarketPool;
|
|
130
|
+
readonly session: MarketSession | null;
|
|
131
|
+
readonly timestamp: bigint;
|
|
132
|
+
readonly mode: "current" | "preview";
|
|
133
|
+
}
|
|
134
|
+
interface MarketRangeParams extends MarketReadOptions {
|
|
135
|
+
readonly hook: Address;
|
|
136
|
+
readonly rangeId: bigint;
|
|
137
|
+
}
|
|
138
|
+
interface MarketPositionParams extends MarketRangeParams {
|
|
139
|
+
readonly owner: Address;
|
|
140
|
+
}
|
|
141
|
+
interface MarketRangeState {
|
|
142
|
+
readonly totalShares: bigint;
|
|
143
|
+
readonly accFee0X128: bigint;
|
|
144
|
+
readonly accFee1X128: bigint;
|
|
145
|
+
readonly collectionSeq: bigint;
|
|
146
|
+
readonly resetSeq: bigint;
|
|
147
|
+
}
|
|
148
|
+
type MarketRange = {
|
|
149
|
+
readonly status: "unset";
|
|
150
|
+
readonly hook: Address;
|
|
151
|
+
readonly rangeId: bigint;
|
|
152
|
+
} | {
|
|
153
|
+
readonly status: "set";
|
|
154
|
+
readonly hook: Address;
|
|
155
|
+
readonly rangeId: bigint;
|
|
156
|
+
readonly poolId: Hex;
|
|
157
|
+
readonly key: MarketPoolKey;
|
|
158
|
+
readonly tickLower: number;
|
|
159
|
+
readonly tickUpper: number;
|
|
160
|
+
readonly state: MarketRangeState;
|
|
161
|
+
readonly globalPaused: boolean;
|
|
162
|
+
readonly poolPaused: boolean;
|
|
163
|
+
readonly effectiveClaimFeeBps: number;
|
|
164
|
+
};
|
|
165
|
+
interface MarketPosition {
|
|
166
|
+
readonly range: MarketRange;
|
|
167
|
+
readonly owner: Address;
|
|
168
|
+
readonly shares: bigint;
|
|
169
|
+
/** Already settled net token base units only; NOT total live claimable earnings. */
|
|
170
|
+
readonly settledOwed0: bigint;
|
|
171
|
+
readonly settledOwed1: bigint;
|
|
172
|
+
readonly checkpoint0X128: bigint;
|
|
173
|
+
readonly checkpoint1X128: bigint;
|
|
174
|
+
readonly remainder0X128: bigint;
|
|
175
|
+
readonly remainder1X128: bigint;
|
|
176
|
+
}
|
|
177
|
+
interface MarketPoolState {
|
|
178
|
+
readonly pool: MarketPool;
|
|
179
|
+
readonly source: "state-view" | "extsload";
|
|
180
|
+
readonly initialized: boolean;
|
|
181
|
+
readonly sqrtPriceX96: bigint;
|
|
182
|
+
readonly tick: number;
|
|
183
|
+
readonly protocolFeePacked: number;
|
|
184
|
+
/** Stored v4 fee, not the directional Hook fee used for an actual swap. */
|
|
185
|
+
readonly storedLpFeePips: number;
|
|
186
|
+
readonly activeLiquidity: bigint;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
interface MarketFeeLedger {
|
|
190
|
+
readonly position: MarketPosition & {
|
|
191
|
+
readonly range: Extract<MarketPosition["range"], {
|
|
192
|
+
status: "set";
|
|
193
|
+
}>;
|
|
194
|
+
};
|
|
195
|
+
readonly managerLiquidity: bigint;
|
|
196
|
+
readonly growth0X128: bigint;
|
|
197
|
+
readonly growth1X128: bigint;
|
|
198
|
+
readonly lastGrowth0X128: bigint;
|
|
199
|
+
readonly lastGrowth1X128: bigint;
|
|
200
|
+
readonly claimFeeSyncIndex: bigint;
|
|
201
|
+
readonly policyHistoryLength: bigint;
|
|
202
|
+
readonly currentClaimFeeBps: number;
|
|
203
|
+
readonly allTimeMinClaimFeeBps: number;
|
|
204
|
+
}
|
|
205
|
+
interface MarketTokenEarnings {
|
|
206
|
+
readonly settled: bigint;
|
|
207
|
+
/** Net earnings already accumulated by the Hook but not checkpointed to this owner. */
|
|
208
|
+
readonly synchronized: bigint;
|
|
209
|
+
/** Additional whole base units this owner would earn after collecting manager fees now. */
|
|
210
|
+
readonly pending: bigint;
|
|
211
|
+
readonly claimable: bigint;
|
|
212
|
+
readonly remainderX128: bigint;
|
|
213
|
+
readonly pendingRangeGross: bigint;
|
|
214
|
+
readonly pendingRangeProtocolFee: bigint;
|
|
215
|
+
}
|
|
216
|
+
interface MarketClaimableFees {
|
|
217
|
+
readonly ledger: MarketFeeLedger;
|
|
218
|
+
readonly token0: MarketTokenEarnings;
|
|
219
|
+
readonly token1: MarketTokenEarnings;
|
|
220
|
+
/** Accounting estimate, even if paused or no whole units can currently be claimed. */
|
|
221
|
+
readonly paused: boolean;
|
|
222
|
+
readonly hasClaimableAmount: boolean;
|
|
223
|
+
}
|
|
224
|
+
interface MarketShareAuthorization {
|
|
225
|
+
readonly hook: Address;
|
|
226
|
+
readonly rangeId: bigint;
|
|
227
|
+
readonly owner: Address;
|
|
228
|
+
readonly operator: Address;
|
|
229
|
+
readonly shares: bigint;
|
|
230
|
+
readonly allowance: bigint;
|
|
231
|
+
readonly isShareOperator: boolean;
|
|
232
|
+
/** Independently authorized fee payouts for this one range. */
|
|
233
|
+
readonly isClaimOperator: boolean;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
declare function getMarketShareAuthorization(context: MarketReadContext, params: MarketReadOptions & {
|
|
237
|
+
readonly hook: Address;
|
|
238
|
+
readonly rangeId: bigint;
|
|
239
|
+
readonly owner: Address;
|
|
240
|
+
readonly operator: Address;
|
|
241
|
+
}): Promise<MarketSnapshot<MarketShareAuthorization>>;
|
|
242
|
+
declare function getMarketClaimOperator(context: MarketReadContext, params: Parameters<typeof getMarketShareAuthorization>[1]): Promise<MarketSnapshot<{
|
|
243
|
+
hook: `0x${string}`;
|
|
244
|
+
owner: `0x${string}`;
|
|
245
|
+
operator: `0x${string}`;
|
|
246
|
+
rangeId: bigint;
|
|
247
|
+
approved: boolean;
|
|
248
|
+
}>>;
|
|
249
|
+
|
|
250
|
+
declare function getMarketFeeSnapshot(context: MarketReadContext, input: MarketPositionParams): Promise<MarketSnapshot<MarketFeeLedger>>;
|
|
251
|
+
declare function estimateMarketClaimableFees(context: MarketReadContext, params: MarketPositionParams): Promise<{
|
|
252
|
+
block: MarketBlock;
|
|
253
|
+
data: MarketClaimableFees;
|
|
254
|
+
}>;
|
|
255
|
+
|
|
256
|
+
declare function getMarketCurrentFees(context: MarketReadContext, poolId: Hex, options?: MarketReadOptions): Promise<MarketSnapshot<MarketCurrentFees>>;
|
|
257
|
+
declare function getMarketFeeBreakdown(context: MarketReadContext, poolId: Hex, zeroForOne: boolean, options?: MarketReadOptions): Promise<MarketSnapshot<MarketFeeBreakdown>>;
|
|
258
|
+
/** Uses the selected block's configuration, not historical configuration at the requested timestamp. */
|
|
259
|
+
declare function previewMarketFeeAt(context: MarketReadContext, poolId: Hex, zeroForOne: boolean, timestamp: bigint, options?: MarketReadOptions): Promise<MarketSnapshot<MarketFeeBreakdown>>;
|
|
260
|
+
declare function getMarketSession(context: MarketReadContext, poolId: Hex, options?: MarketReadOptions & {
|
|
261
|
+
readonly timestamp?: bigint;
|
|
262
|
+
}): Promise<MarketSnapshot<MarketSessionState>>;
|
|
263
|
+
|
|
264
|
+
declare function getMarketPoolState(context: MarketReadContext, poolId: Hex, options?: MarketReadOptions): Promise<MarketSnapshot<MarketPoolState>>;
|
|
265
|
+
|
|
266
|
+
declare function getMarketPool(context: MarketReadContext, poolId: Hex, options?: MarketReadOptions): Promise<MarketSnapshot<MarketPool>>;
|
|
267
|
+
declare function listMarketPools(context: MarketReadContext, params?: MarketListPoolsParams): Promise<MarketSnapshot<MarketPoolPage>>;
|
|
268
|
+
|
|
269
|
+
declare function getMarketRange(context: MarketReadContext, params: MarketRangeParams): Promise<MarketSnapshot<MarketRange>>;
|
|
270
|
+
declare function getMarketPosition(context: MarketReadContext, params: MarketPositionParams): Promise<MarketSnapshot<MarketPosition>>;
|
|
271
|
+
|
|
272
|
+
interface MarketRwaFloorConfig {
|
|
273
|
+
readonly openFloor: number;
|
|
274
|
+
readonly overnightFloor: number;
|
|
275
|
+
readonly closedFloor: number;
|
|
276
|
+
readonly spikeMult: number;
|
|
277
|
+
readonly closedSpike: number;
|
|
278
|
+
readonly descentWindow: number;
|
|
279
|
+
readonly closeFloor: number;
|
|
280
|
+
readonly closeBefore: number;
|
|
281
|
+
readonly closeAfter: number;
|
|
282
|
+
}
|
|
283
|
+
interface MarketDayOverride {
|
|
284
|
+
readonly day: number;
|
|
285
|
+
readonly status: "closed" | "open";
|
|
286
|
+
}
|
|
287
|
+
/** key selects an audited Hook even for Hook-wide operations. settleFirst is intentionally required. */
|
|
288
|
+
type MarketManagementAction = {
|
|
289
|
+
readonly key: MarketPoolKey;
|
|
290
|
+
} & ({
|
|
291
|
+
readonly kind: "pokeFee";
|
|
292
|
+
readonly fee0For1: number;
|
|
293
|
+
readonly fee1For0: number;
|
|
294
|
+
readonly ttl: number;
|
|
295
|
+
} | {
|
|
296
|
+
readonly kind: "clearPoke";
|
|
297
|
+
} | {
|
|
298
|
+
readonly kind: "setPoolAsymmetry";
|
|
299
|
+
readonly premiumPips: number;
|
|
300
|
+
readonly premiumZeroForOne: boolean;
|
|
301
|
+
} | {
|
|
302
|
+
readonly kind: "setCryptoPoolConfig";
|
|
303
|
+
readonly floorPips: number;
|
|
304
|
+
readonly flatPips: number;
|
|
305
|
+
readonly cap: number;
|
|
306
|
+
} | {
|
|
307
|
+
readonly kind: "setRwaPoolConfig";
|
|
308
|
+
readonly config: MarketRwaFloorConfig;
|
|
309
|
+
readonly cap: number;
|
|
310
|
+
} | {
|
|
311
|
+
readonly kind: "setSessionHours";
|
|
312
|
+
readonly openSec: number;
|
|
313
|
+
readonly closeSec: number;
|
|
314
|
+
} | {
|
|
315
|
+
readonly kind: "setDayOverrides";
|
|
316
|
+
readonly year: number;
|
|
317
|
+
readonly month: number;
|
|
318
|
+
readonly days: readonly MarketDayOverride[];
|
|
319
|
+
} | {
|
|
320
|
+
readonly kind: "setDstMode";
|
|
321
|
+
readonly mode: "auto" | "est" | "edt";
|
|
322
|
+
} | {
|
|
323
|
+
readonly kind: "setEarlyClose";
|
|
324
|
+
readonly year: number;
|
|
325
|
+
readonly month: number;
|
|
326
|
+
readonly day: number;
|
|
327
|
+
readonly closeSec: number;
|
|
328
|
+
} | {
|
|
329
|
+
readonly kind: "setPaused" | "setPoolPaused";
|
|
330
|
+
readonly duration: number;
|
|
331
|
+
} | {
|
|
332
|
+
readonly kind: "setClaimFee";
|
|
333
|
+
readonly bps: number;
|
|
334
|
+
readonly recipient: Address;
|
|
335
|
+
readonly settleFirst: readonly Address[];
|
|
336
|
+
} | {
|
|
337
|
+
readonly kind: "setClaimFeeBps";
|
|
338
|
+
readonly bps: number;
|
|
339
|
+
} | {
|
|
340
|
+
readonly kind: "sweepClaimFee";
|
|
341
|
+
readonly currency: Address;
|
|
342
|
+
} | {
|
|
343
|
+
readonly kind: "register" | "deregister" | "reregister";
|
|
344
|
+
} | {
|
|
345
|
+
readonly kind: "disableHook";
|
|
346
|
+
} | {
|
|
347
|
+
readonly kind: "setHook";
|
|
348
|
+
readonly expectedCodeHash: Hex;
|
|
349
|
+
});
|
|
350
|
+
type MarketManagementExecution = {
|
|
351
|
+
readonly mode: "direct";
|
|
352
|
+
} | {
|
|
353
|
+
readonly mode: "schedule" /** Zero lets AccessManager choose block.timestamp + delay. */;
|
|
354
|
+
readonly when?: number;
|
|
355
|
+
} | {
|
|
356
|
+
readonly mode: "execute";
|
|
357
|
+
};
|
|
358
|
+
interface MarketManagementAuthorization {
|
|
359
|
+
readonly permission: "immediate" | "delayed" | "denied";
|
|
360
|
+
readonly delay: number;
|
|
361
|
+
readonly operationId: Hex;
|
|
362
|
+
readonly scheduledAt: number;
|
|
363
|
+
readonly direct: {
|
|
364
|
+
readonly to: Address;
|
|
365
|
+
readonly data: Hex;
|
|
366
|
+
readonly value: 0n;
|
|
367
|
+
};
|
|
368
|
+
readonly schedule: {
|
|
369
|
+
readonly to: Address;
|
|
370
|
+
readonly data: Hex;
|
|
371
|
+
readonly value: 0n;
|
|
372
|
+
};
|
|
373
|
+
readonly execute: {
|
|
374
|
+
readonly to: Address;
|
|
375
|
+
readonly data: Hex;
|
|
376
|
+
readonly value: 0n;
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
interface MarketManagementContext {
|
|
380
|
+
readonly action: MarketManagementAction;
|
|
381
|
+
readonly execution: MarketManagementExecution;
|
|
382
|
+
readonly target: Address;
|
|
383
|
+
readonly operationId: Hex;
|
|
384
|
+
}
|
|
385
|
+
interface MarketManagementEvent {
|
|
386
|
+
readonly address: Address;
|
|
387
|
+
readonly eventName: string;
|
|
388
|
+
readonly args: Readonly<Record<string, unknown>>;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
interface MarketLiquidityParams {
|
|
392
|
+
readonly key: MarketPoolKey;
|
|
393
|
+
readonly tickLower: number;
|
|
394
|
+
readonly tickUpper: number;
|
|
395
|
+
readonly liquidity: bigint;
|
|
396
|
+
/** Token amount tolerance, not a tick or price tolerance. 0..9999. */
|
|
397
|
+
readonly slippageBps: number;
|
|
398
|
+
readonly deadline: bigint;
|
|
399
|
+
/** Snapshot lifetime; default 60 seconds, maximum 300. */
|
|
400
|
+
readonly validForSeconds?: number;
|
|
401
|
+
}
|
|
402
|
+
interface MarketLiquidityQuote extends MarketLiquidityParams {
|
|
403
|
+
readonly action: "deposit" | "withdraw";
|
|
404
|
+
readonly rangeId: bigint;
|
|
405
|
+
readonly sqrtPriceX96: bigint;
|
|
406
|
+
readonly amount0: bigint;
|
|
407
|
+
readonly amount1: bigint;
|
|
408
|
+
/** Maximum spend for deposit, minimum principal returned for withdrawal. */
|
|
409
|
+
readonly limit0: bigint;
|
|
410
|
+
readonly limit1: bigint;
|
|
411
|
+
/** Exact prepaid native maximum; refund is an estimate at the preview price. */
|
|
412
|
+
readonly nativeValue: bigint;
|
|
413
|
+
readonly estimatedNativeRefund: bigint;
|
|
414
|
+
readonly expiresAt: bigint;
|
|
415
|
+
}
|
|
416
|
+
type MarketLiquidityPreview = MarketSnapshot<MarketLiquidityQuote>;
|
|
417
|
+
interface MarketClaimParams {
|
|
418
|
+
readonly key: MarketPoolKey;
|
|
419
|
+
readonly tickLower: number;
|
|
420
|
+
readonly tickUpper: number;
|
|
421
|
+
readonly to: Address;
|
|
422
|
+
readonly maxFeeBps: number;
|
|
423
|
+
/** Local prepared-request expiry; claimFees has no on-chain deadline parameter. */
|
|
424
|
+
readonly validForSeconds?: number;
|
|
425
|
+
}
|
|
426
|
+
interface MarketApprovalParams {
|
|
427
|
+
readonly key: MarketPoolKey;
|
|
428
|
+
readonly currency: 0 | 1;
|
|
429
|
+
/** Exact replacement allowance, not the missing delta. Zero explicitly revokes/resets. */
|
|
430
|
+
readonly amount: bigint;
|
|
431
|
+
readonly validForSeconds?: number;
|
|
432
|
+
}
|
|
433
|
+
interface MarketSpendStatus {
|
|
434
|
+
readonly owner: Address;
|
|
435
|
+
readonly spender: Address;
|
|
436
|
+
readonly tokens: readonly {
|
|
437
|
+
readonly token: Address;
|
|
438
|
+
readonly balance: bigint;
|
|
439
|
+
readonly kind: "native" | "erc20";
|
|
440
|
+
/** Native currency has no allowance. Balance sufficiency excludes gas. */
|
|
441
|
+
readonly allowance: bigint | null;
|
|
442
|
+
readonly requiredAmount: bigint;
|
|
443
|
+
readonly needsApproval: boolean;
|
|
444
|
+
readonly sufficientBalance: boolean;
|
|
445
|
+
}[];
|
|
446
|
+
}
|
|
447
|
+
interface MarketTransactionRequest {
|
|
448
|
+
readonly account: Address;
|
|
449
|
+
readonly to: Address;
|
|
450
|
+
readonly data: Hex;
|
|
451
|
+
readonly value: bigint;
|
|
452
|
+
/** Native-pool transactions bind an EIP-1559 gas budget during preparation. */
|
|
453
|
+
readonly gas?: bigint;
|
|
454
|
+
readonly maxFeePerGas?: bigint;
|
|
455
|
+
readonly maxPriorityFeePerGas?: bigint;
|
|
456
|
+
readonly chainId: number;
|
|
457
|
+
}
|
|
458
|
+
type MarketWriteAction = "approve" | "deposit" | "withdraw" | "claim" | "withdrawAndClaim" | "transferShares" | "transferSharesFrom" | "approveShares" | "setShareOperator" | "setClaimOperator" | "claimFor" | "management";
|
|
459
|
+
interface MarketPreparedTransaction {
|
|
460
|
+
readonly request: MarketTransactionRequest;
|
|
461
|
+
readonly preview: MarketLiquidityPreview | null;
|
|
462
|
+
readonly context: {
|
|
463
|
+
readonly action: MarketWriteAction;
|
|
464
|
+
readonly management?: MarketManagementContext;
|
|
465
|
+
readonly key: MarketPoolKey;
|
|
466
|
+
readonly rangeId: bigint | null;
|
|
467
|
+
readonly block: MarketBlock;
|
|
468
|
+
readonly expiresAt: bigint;
|
|
469
|
+
readonly recipient: Address;
|
|
470
|
+
/** Beneficiary / share owner; may differ from the wallet performing delegated actions. */
|
|
471
|
+
readonly owner: Address;
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
interface MarketLiquidityEvent {
|
|
475
|
+
readonly eventName: "Deposited" | "Withdrawn" | "FeesClaimed";
|
|
476
|
+
readonly owner: Address;
|
|
477
|
+
readonly rangeId: bigint;
|
|
478
|
+
readonly amount0: bigint;
|
|
479
|
+
readonly amount1: bigint;
|
|
480
|
+
readonly liquidity: bigint | null;
|
|
481
|
+
readonly to: Address;
|
|
482
|
+
}
|
|
483
|
+
interface MarketTransactionResult {
|
|
484
|
+
readonly hash: Hex;
|
|
485
|
+
readonly status: "confirmed" | "reverted";
|
|
486
|
+
readonly receipt: TransactionReceipt;
|
|
487
|
+
/** Only matching Hook, owner, range and recipient logs. Claim may succeed with no payout. */
|
|
488
|
+
readonly events: readonly MarketLiquidityEvent[];
|
|
489
|
+
readonly shareEvents: readonly MarketShareEvent[];
|
|
490
|
+
readonly managementEvents: readonly MarketManagementEvent[];
|
|
491
|
+
}
|
|
492
|
+
interface MarketShareRangeParams {
|
|
493
|
+
readonly key: MarketPoolKey;
|
|
494
|
+
readonly tickLower: number;
|
|
495
|
+
readonly tickUpper: number;
|
|
496
|
+
readonly validForSeconds?: number;
|
|
497
|
+
}
|
|
498
|
+
interface MarketShareTransferParams extends MarketShareRangeParams {
|
|
499
|
+
readonly to: Address;
|
|
500
|
+
readonly amount: bigint;
|
|
501
|
+
}
|
|
502
|
+
type MarketShareEvent = {
|
|
503
|
+
readonly eventName: "Transfer";
|
|
504
|
+
readonly caller: Address;
|
|
505
|
+
readonly from: Address;
|
|
506
|
+
readonly to: Address;
|
|
507
|
+
readonly rangeId: bigint;
|
|
508
|
+
readonly amount: bigint;
|
|
509
|
+
} | {
|
|
510
|
+
readonly eventName: "Approval";
|
|
511
|
+
readonly owner: Address;
|
|
512
|
+
readonly spender: Address;
|
|
513
|
+
readonly rangeId: bigint;
|
|
514
|
+
readonly amount: bigint;
|
|
515
|
+
} | {
|
|
516
|
+
readonly eventName: "OperatorSet";
|
|
517
|
+
readonly owner: Address;
|
|
518
|
+
readonly operator: Address;
|
|
519
|
+
readonly approved: boolean;
|
|
520
|
+
} | {
|
|
521
|
+
readonly eventName: "ClaimOperatorSet";
|
|
522
|
+
readonly owner: Address;
|
|
523
|
+
readonly operator: Address;
|
|
524
|
+
readonly rangeId: bigint;
|
|
525
|
+
readonly approved: boolean;
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
declare function getMarketSpendStatus(context: MarketReadContext, params: {
|
|
529
|
+
readonly key: MarketLiquidityParams["key"];
|
|
530
|
+
readonly owner: Address;
|
|
531
|
+
readonly amount0: bigint;
|
|
532
|
+
readonly amount1: bigint;
|
|
533
|
+
} & MarketReadOptions): Promise<MarketSnapshot<MarketSpendStatus>>;
|
|
534
|
+
|
|
535
|
+
declare function defineMarketChain(input: MarketChainConfig): MarketChainConfig;
|
|
536
|
+
|
|
537
|
+
interface MarketClientOptions {
|
|
538
|
+
readonly publicClient: PublicClient;
|
|
539
|
+
readonly chain: MarketChainConfig;
|
|
540
|
+
readonly walletClient?: WalletClient;
|
|
541
|
+
}
|
|
542
|
+
/** Construction does not issue RPC requests or certify the deployment. Wallet is optional for reads. */
|
|
543
|
+
declare function createMarketClient(options: MarketClientOptions): Readonly<{
|
|
544
|
+
verifyDeployment: (readOptions?: {
|
|
545
|
+
readonly blockNumber?: bigint;
|
|
546
|
+
}) => Promise<MarketDeploymentVerification>;
|
|
547
|
+
getPool: (poolId: Hex, readOptions?: MarketReadOptions) => Promise<MarketSnapshot<MarketPool>>;
|
|
548
|
+
listPools: (params?: MarketListPoolsParams) => Promise<MarketSnapshot<MarketPoolPage>>;
|
|
549
|
+
getCurrentFees: (poolId: Hex, readOptions?: MarketReadOptions) => Promise<MarketSnapshot<MarketCurrentFees>>;
|
|
550
|
+
getFeeBreakdown: (poolId: Hex, zeroForOne: boolean, readOptions?: MarketReadOptions) => Promise<MarketSnapshot<MarketFeeBreakdown>>;
|
|
551
|
+
previewFeeAt: (poolId: Hex, zeroForOne: boolean, timestamp: bigint, readOptions?: MarketReadOptions) => Promise<MarketSnapshot<MarketFeeBreakdown>>;
|
|
552
|
+
getSession: (poolId: Hex, readOptions?: MarketReadOptions & {
|
|
553
|
+
readonly timestamp?: bigint;
|
|
554
|
+
}) => Promise<MarketSnapshot<MarketSessionState>>;
|
|
555
|
+
getRange: (params: MarketRangeParams) => Promise<MarketSnapshot<MarketRange>>;
|
|
556
|
+
getPosition: (params: MarketPositionParams) => Promise<MarketSnapshot<MarketPosition>>;
|
|
557
|
+
getPoolState: (poolId: Hex, readOptions?: MarketReadOptions) => Promise<MarketSnapshot<MarketPoolState>>;
|
|
558
|
+
getManagementAuthorization: (input: MarketManagementAction, owner: viem.Address, options?: {
|
|
559
|
+
readonly when?: number;
|
|
560
|
+
}) => Promise<MarketSnapshot<MarketManagementAuthorization>>;
|
|
561
|
+
prepareManagement: (input: MarketManagementAction, options?: {
|
|
562
|
+
readonly execution?: MarketManagementExecution;
|
|
563
|
+
readonly validForSeconds?: number;
|
|
564
|
+
}) => Promise<MarketPreparedTransaction>;
|
|
565
|
+
previewDeposit: (params: MarketLiquidityParams) => Promise<MarketLiquidityPreview>;
|
|
566
|
+
previewWithdraw: (params: MarketLiquidityParams) => Promise<MarketLiquidityPreview>;
|
|
567
|
+
getSpendStatus: (params: Parameters<typeof getMarketSpendStatus>[1]) => Promise<MarketSnapshot<MarketSpendStatus>>;
|
|
568
|
+
prepareApproval: (input: MarketApprovalParams) => Promise<MarketPreparedTransaction>;
|
|
569
|
+
prepareDeposit: (value: MarketLiquidityPreview) => Promise<MarketPreparedTransaction>;
|
|
570
|
+
prepareWithdraw: (value: MarketLiquidityPreview, to: viem.Address) => Promise<MarketPreparedTransaction>;
|
|
571
|
+
prepareWithdrawAndClaim: (value: MarketLiquidityPreview, to: viem.Address, maxFeeBps: number) => Promise<MarketPreparedTransaction>;
|
|
572
|
+
prepareClaim: (input: MarketClaimParams) => Promise<MarketPreparedTransaction>;
|
|
573
|
+
prepareTransferShares: (params: MarketShareTransferParams) => Promise<MarketPreparedTransaction>;
|
|
574
|
+
prepareTransferSharesFrom: (params: MarketShareTransferParams & {
|
|
575
|
+
readonly owner: viem.Address;
|
|
576
|
+
}) => Promise<MarketPreparedTransaction>;
|
|
577
|
+
prepareApproveShares: (input: MarketShareRangeParams & {
|
|
578
|
+
readonly spender: viem.Address;
|
|
579
|
+
readonly amount: bigint;
|
|
580
|
+
}) => Promise<MarketPreparedTransaction>;
|
|
581
|
+
prepareSetShareOperator: (input: {
|
|
582
|
+
readonly key: MarketPoolKey;
|
|
583
|
+
readonly operator: viem.Address;
|
|
584
|
+
readonly approved: boolean;
|
|
585
|
+
readonly validForSeconds?: number;
|
|
586
|
+
}) => Promise<MarketPreparedTransaction>;
|
|
587
|
+
prepareSetClaimOperator: (input: MarketShareRangeParams & {
|
|
588
|
+
readonly operator: viem.Address;
|
|
589
|
+
readonly approved: boolean;
|
|
590
|
+
}) => Promise<MarketPreparedTransaction>;
|
|
591
|
+
prepareClaimFeesFor: (input: MarketClaimParams & {
|
|
592
|
+
readonly owner: viem.Address;
|
|
593
|
+
}) => Promise<MarketPreparedTransaction>;
|
|
594
|
+
send: (prepared: MarketPreparedTransaction) => Promise<Hex>;
|
|
595
|
+
waitForTransaction: (hash: Hex, options?: {
|
|
596
|
+
readonly timeout?: number;
|
|
597
|
+
}) => Promise<MarketTransactionResult>;
|
|
598
|
+
chain: MarketChainConfig;
|
|
599
|
+
getClaimOperator: (params: Parameters<typeof getMarketClaimOperator>[1]) => Promise<MarketSnapshot<{
|
|
600
|
+
hook: `0x${string}`;
|
|
601
|
+
owner: `0x${string}`;
|
|
602
|
+
operator: `0x${string}`;
|
|
603
|
+
rangeId: bigint;
|
|
604
|
+
approved: boolean;
|
|
605
|
+
}>>;
|
|
606
|
+
getShareAuthorization: (params: Parameters<typeof getMarketShareAuthorization>[1]) => Promise<MarketSnapshot<MarketShareAuthorization>>;
|
|
607
|
+
getFeeSnapshot: (params: MarketPositionParams) => Promise<MarketSnapshot<MarketFeeLedger>>;
|
|
608
|
+
estimateClaimableFees: (params: MarketPositionParams) => Promise<{
|
|
609
|
+
block: MarketBlock;
|
|
610
|
+
data: MarketClaimableFees;
|
|
611
|
+
}>;
|
|
612
|
+
}>;
|
|
613
|
+
type MarketClient = ReturnType<typeof createMarketClient>;
|
|
614
|
+
|
|
615
|
+
/** Validates and copies configuration. Does not claim that the supplied contracts are deployed. */
|
|
616
|
+
declare function defineMarketDeployment(input: MarketDeployment): MarketDeployment;
|
|
617
|
+
|
|
618
|
+
declare class InvalidMarketConfigError extends Error {
|
|
619
|
+
readonly field: string;
|
|
620
|
+
constructor(field: string, message: string);
|
|
621
|
+
}
|
|
622
|
+
declare class MarketDeploymentVerificationError extends Error {
|
|
623
|
+
readonly field: string;
|
|
624
|
+
readonly expected: unknown;
|
|
625
|
+
readonly actual: unknown;
|
|
626
|
+
constructor(field: string, expected: unknown, actual: unknown);
|
|
627
|
+
}
|
|
628
|
+
declare class MarketReadError extends Error {
|
|
629
|
+
constructor(cause: unknown);
|
|
630
|
+
}
|
|
631
|
+
declare class MarketFeatureUnavailableError extends Error {
|
|
632
|
+
readonly feature: string;
|
|
633
|
+
constructor(feature: string);
|
|
634
|
+
}
|
|
635
|
+
declare class MarketSettlingError extends Error {
|
|
636
|
+
readonly hook: `0x${string}`;
|
|
637
|
+
constructor(hook: `0x${string}`);
|
|
638
|
+
}
|
|
639
|
+
declare class MarketTransactionError extends Error {
|
|
640
|
+
readonly stage: "simulate" | "send" | "receipt";
|
|
641
|
+
constructor(stage: "simulate" | "send" | "receipt", cause: unknown);
|
|
642
|
+
}
|
|
643
|
+
declare class MarketTransactionReplacedError extends Error {
|
|
644
|
+
readonly originalHash: `0x${string}`;
|
|
645
|
+
readonly replacementHash: `0x${string}`;
|
|
646
|
+
readonly reason: string;
|
|
647
|
+
constructor(originalHash: `0x${string}`, replacementHash: `0x${string}`, reason: string);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/** Gregorian input domain for the SDK calendar helpers: years 1970..9999. */
|
|
651
|
+
declare function marketDaysInMonth(year: number, month: number): number;
|
|
652
|
+
/** Replaces the whole month's overrides. Empty days clears the month; at most ten distinct dates. */
|
|
653
|
+
declare function packMarketDayOverrides(year: number, month: number, days: readonly MarketDayOverride[]): bigint;
|
|
654
|
+
|
|
655
|
+
/** Only v4 gross growth wraps. Ramp net accumulators and debts use checked arithmetic. */
|
|
656
|
+
declare function calculateMarketClaimableFees(ledger: MarketFeeLedger): MarketClaimableFees;
|
|
657
|
+
|
|
658
|
+
/** Keeps caller direction intact: rejects unsorted currencies rather than silently swapping them. */
|
|
659
|
+
declare function defineMarketPoolKey(key: MarketPoolKey): MarketPoolKey;
|
|
660
|
+
declare function getMarketPoolId(input: MarketPoolKey): Hex;
|
|
661
|
+
declare function getMarketRangeId(poolId: Hex, tickLower: number, tickUpper: number, tickSpacing?: number): bigint;
|
|
662
|
+
/** Buy means quote -> base; sell means base -> quote. Labels never depend on token symbols. */
|
|
663
|
+
declare function getMarketSwapDirection(key: MarketPoolKey, base: Address, quote: Address, side: "buy" | "sell"): boolean;
|
|
664
|
+
|
|
665
|
+
declare function getMarketSqrtPriceAtTick(tick: number): bigint;
|
|
666
|
+
declare function getMarketTickAtSqrtPrice(sqrtPriceX96: bigint): number;
|
|
667
|
+
/** Exact currency1/currency0 human-unit price; no floating point conversion. */
|
|
668
|
+
declare function getMarketPriceRatio(sqrtPriceX96: bigint, decimals0: number, decimals1: number): {
|
|
669
|
+
numerator: bigint;
|
|
670
|
+
denominator: bigint;
|
|
671
|
+
};
|
|
672
|
+
/** Principal only. Round up for deposits, down for withdrawals. */
|
|
673
|
+
declare function getMarketAmountsForLiquidity(params: {
|
|
674
|
+
readonly sqrtPriceX96: bigint;
|
|
675
|
+
readonly tickLower: number;
|
|
676
|
+
readonly tickUpper: number;
|
|
677
|
+
readonly liquidity: bigint;
|
|
678
|
+
readonly rounding: "up" | "down";
|
|
679
|
+
}): {
|
|
680
|
+
amount0: bigint;
|
|
681
|
+
amount1: bigint;
|
|
682
|
+
};
|
|
683
|
+
/** Same intermediate floor and uint128 casts as v4 LiquidityAmounts. */
|
|
684
|
+
declare function getMarketLiquidityForAmounts(params: {
|
|
685
|
+
readonly sqrtPriceX96: bigint;
|
|
686
|
+
readonly tickLower: number;
|
|
687
|
+
readonly tickUpper: number;
|
|
688
|
+
readonly amount0: bigint;
|
|
689
|
+
readonly amount1: bigint;
|
|
690
|
+
}): bigint;
|
|
691
|
+
|
|
692
|
+
/** Historical discovery data, not a verified deployment or a write-capability grant. */
|
|
693
|
+
interface MarketTestPool {
|
|
694
|
+
readonly chainId: number;
|
|
695
|
+
readonly name: string;
|
|
696
|
+
readonly testAssets: true;
|
|
697
|
+
readonly permissionlessMint: true;
|
|
698
|
+
readonly hookKind: MarketHookKind;
|
|
699
|
+
readonly poolId: Hex;
|
|
700
|
+
readonly key: Readonly<MarketPoolKey>;
|
|
701
|
+
readonly base: {
|
|
702
|
+
readonly symbol: string;
|
|
703
|
+
readonly address: Address;
|
|
704
|
+
readonly decimals: number;
|
|
705
|
+
};
|
|
706
|
+
readonly quote: {
|
|
707
|
+
readonly symbol: string;
|
|
708
|
+
readonly address: Address;
|
|
709
|
+
readonly decimals: number;
|
|
710
|
+
};
|
|
711
|
+
readonly components: {
|
|
712
|
+
readonly poolManager: Address;
|
|
713
|
+
readonly registry: Address;
|
|
714
|
+
readonly reader: Address;
|
|
715
|
+
readonly accessManager: Address;
|
|
716
|
+
};
|
|
717
|
+
readonly source: {
|
|
718
|
+
readonly commit: string;
|
|
719
|
+
readonly path: string;
|
|
720
|
+
readonly blockNumber: number;
|
|
721
|
+
readonly blockHash: Hex;
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
/** Valueless, openly mintable ERC-20 pools on mainnets; tBNB is not native BNB. */
|
|
725
|
+
declare const marketTestPools: readonly [{
|
|
726
|
+
readonly chainId: 5042;
|
|
727
|
+
readonly name: "tBTC/tUSDC";
|
|
728
|
+
readonly testAssets: true;
|
|
729
|
+
readonly permissionlessMint: true;
|
|
730
|
+
readonly hookKind: "ramp";
|
|
731
|
+
readonly poolId: "0x1a325fe4671d6584778464cbe5ea68b111c2a72718f128a9427717298e85e2cd";
|
|
732
|
+
readonly key: {
|
|
733
|
+
readonly currency0: "0x442fc5b4d43fb7ec18ff8ac0a8fb9fdd2efec0db";
|
|
734
|
+
readonly currency1: "0x44e90eb500868af9b0b16406f3ce165c90e1e85e";
|
|
735
|
+
readonly fee: 8388608;
|
|
736
|
+
readonly tickSpacing: 1;
|
|
737
|
+
readonly hooks: "0x928f4c9b7f80dcbe95b606867e76336a956fa080";
|
|
738
|
+
};
|
|
739
|
+
readonly base: {
|
|
740
|
+
readonly symbol: "tBTC";
|
|
741
|
+
readonly address: "0x442fc5b4d43fb7ec18ff8ac0a8fb9fdd2efec0db";
|
|
742
|
+
readonly decimals: 8;
|
|
743
|
+
};
|
|
744
|
+
readonly quote: {
|
|
745
|
+
readonly symbol: "tUSDC";
|
|
746
|
+
readonly address: "0x44e90eb500868af9b0b16406f3ce165c90e1e85e";
|
|
747
|
+
readonly decimals: 6;
|
|
748
|
+
};
|
|
749
|
+
readonly components: {
|
|
750
|
+
readonly poolManager: "0x8366a39cc670b4001a1121b8f6a443a643e40951";
|
|
751
|
+
readonly registry: "0x3386feb5016983790ef05410e888a8b7bf5a722d";
|
|
752
|
+
readonly reader: "0xbd782f3de07f2c8f27ef3a2cb165f36c5a505e45";
|
|
753
|
+
readonly accessManager: "0x005710955b542c11fa2259721840329cddf44914";
|
|
754
|
+
};
|
|
755
|
+
readonly source: {
|
|
756
|
+
readonly commit: "cf16bd9376c12ea50de04658b279176d8d56e4f5";
|
|
757
|
+
readonly path: "docs/test-pools/arc.json";
|
|
758
|
+
readonly blockNumber: 23523593;
|
|
759
|
+
readonly blockHash: "0xea3eb1e8cd308955ad999df48212f3b839e3eec7b55cf7702aba213d548f847d";
|
|
760
|
+
};
|
|
761
|
+
}, {
|
|
762
|
+
readonly chainId: 56;
|
|
763
|
+
readonly name: "tBNB/tUSDT";
|
|
764
|
+
readonly testAssets: true;
|
|
765
|
+
readonly permissionlessMint: true;
|
|
766
|
+
readonly hookKind: "ramp";
|
|
767
|
+
readonly poolId: "0xb1cf54cb728bb02bb40def7d4f088a7274f35ef05b6257cb518d5f10be438bee";
|
|
768
|
+
readonly key: {
|
|
769
|
+
readonly currency0: "0x78e708f1f8fe842abaaeaf23ade31e524e153980";
|
|
770
|
+
readonly currency1: "0x8a5218b1b296ced5c88cd55c256fcb58c32f227d";
|
|
771
|
+
readonly fee: 8388608;
|
|
772
|
+
readonly tickSpacing: 1;
|
|
773
|
+
readonly hooks: "0xa6a75d930f7a920391c4afffe744069233c4e080";
|
|
774
|
+
};
|
|
775
|
+
readonly base: {
|
|
776
|
+
readonly symbol: "tBNB";
|
|
777
|
+
readonly address: "0x78e708f1f8fe842abaaeaf23ade31e524e153980";
|
|
778
|
+
readonly decimals: 18;
|
|
779
|
+
};
|
|
780
|
+
readonly quote: {
|
|
781
|
+
readonly symbol: "tUSDT";
|
|
782
|
+
readonly address: "0x8a5218b1b296ced5c88cd55c256fcb58c32f227d";
|
|
783
|
+
readonly decimals: 18;
|
|
784
|
+
};
|
|
785
|
+
readonly components: {
|
|
786
|
+
readonly poolManager: "0x28e2Ea090877bF75740558f6BFB36A5ffeE9e9dF";
|
|
787
|
+
readonly registry: "0xe75be888ae3d92be2f962f62f78775228eb3cbc9";
|
|
788
|
+
readonly reader: "0x2fd8d887a67bf61166e5aacae375cda0ad72d292";
|
|
789
|
+
readonly accessManager: "0x09e9f944a86c5c239eb0dceac85e1f4805d61256";
|
|
790
|
+
};
|
|
791
|
+
readonly source: {
|
|
792
|
+
readonly commit: "cf16bd9376c12ea50de04658b279176d8d56e4f5";
|
|
793
|
+
readonly path: "docs/test-pools/bsc.json";
|
|
794
|
+
readonly blockNumber: 124890195;
|
|
795
|
+
readonly blockHash: "0xba1ae7df7b719fc6d0cf4b49a2278926fc6c62aaf12e2bc49c9788579bba948e";
|
|
796
|
+
};
|
|
797
|
+
}, {
|
|
798
|
+
readonly chainId: 56;
|
|
799
|
+
readonly name: "tQQQ/tUSDT";
|
|
800
|
+
readonly testAssets: true;
|
|
801
|
+
readonly permissionlessMint: true;
|
|
802
|
+
readonly hookKind: "rwa-ramp";
|
|
803
|
+
readonly poolId: "0x9ccf485776611256dd717db8c53808e370160d8c90668a75c6d456dd07f21423";
|
|
804
|
+
readonly key: {
|
|
805
|
+
readonly currency0: "0x51984c455a78c072f9a23453e236bd3729dc3efd";
|
|
806
|
+
readonly currency1: "0x8a5218b1b296ced5c88cd55c256fcb58c32f227d";
|
|
807
|
+
readonly fee: 8388608;
|
|
808
|
+
readonly tickSpacing: 1;
|
|
809
|
+
readonly hooks: "0x7b144d9583c71a1b20cb26954d2ccd330af46080";
|
|
810
|
+
};
|
|
811
|
+
readonly base: {
|
|
812
|
+
readonly symbol: "tQQQ";
|
|
813
|
+
readonly address: "0x51984c455a78c072f9a23453e236bd3729dc3efd";
|
|
814
|
+
readonly decimals: 18;
|
|
815
|
+
};
|
|
816
|
+
readonly quote: {
|
|
817
|
+
readonly symbol: "tUSDT";
|
|
818
|
+
readonly address: "0x8a5218b1b296ced5c88cd55c256fcb58c32f227d";
|
|
819
|
+
readonly decimals: 18;
|
|
820
|
+
};
|
|
821
|
+
readonly components: {
|
|
822
|
+
readonly poolManager: "0x28e2Ea090877bF75740558f6BFB36A5ffeE9e9dF";
|
|
823
|
+
readonly registry: "0xe75be888ae3d92be2f962f62f78775228eb3cbc9";
|
|
824
|
+
readonly reader: "0x2fd8d887a67bf61166e5aacae375cda0ad72d292";
|
|
825
|
+
readonly accessManager: "0x09e9f944a86c5c239eb0dceac85e1f4805d61256";
|
|
826
|
+
};
|
|
827
|
+
readonly source: {
|
|
828
|
+
readonly commit: "cf16bd9376c12ea50de04658b279176d8d56e4f5";
|
|
829
|
+
readonly path: "docs/test-pools/bsc.json";
|
|
830
|
+
readonly blockNumber: 124890195;
|
|
831
|
+
readonly blockHash: "0xba1ae7df7b719fc6d0cf4b49a2278926fc6c62aaf12e2bc49c9788579bba948e";
|
|
832
|
+
};
|
|
833
|
+
}];
|
|
834
|
+
|
|
835
|
+
/** Pins all reads to one block and rejects a reorg before returning a code-and-wiring report. */
|
|
836
|
+
declare function verifyMarketDeployment(publicClient: PublicClient, input: MarketDeployment, options?: {
|
|
837
|
+
readonly blockNumber?: bigint;
|
|
838
|
+
}): Promise<MarketDeploymentVerification>;
|
|
839
|
+
|
|
840
|
+
export { InvalidMarketConfigError, type MarketApprovalParams, type MarketBlock, type MarketCapabilityStatus, type MarketChainConfig, type MarketClaimParams, type MarketClaimableFees, type MarketClient, type MarketClientOptions, type MarketContractDeployment, type MarketCurrentFees, type MarketDayOverride, type MarketDeployment, type MarketDeploymentVerification, MarketDeploymentVerificationError, MarketFeatureUnavailableError, type MarketFeeBreakdown, type MarketFeeLedger, type MarketHookCapabilities, type MarketHookDeployment, type MarketHookKind, type MarketLiquidityEvent, type MarketLiquidityParams, type MarketLiquidityPreview, type MarketLiquidityQuote, type MarketListPoolsParams, type MarketManagementAction, type MarketManagementAuthorization, type MarketManagementContext, type MarketManagementEvent, type MarketManagementExecution, type MarketPool, type MarketPoolKey, type MarketPoolPage, type MarketPoolState, type MarketPosition, type MarketPositionParams, type MarketPreparedTransaction, type MarketRange, type MarketRangeParams, type MarketRangeState, type MarketReadContext, MarketReadError, type MarketReadOptions, type MarketRwaFloorConfig, type MarketSession, type MarketSessionState, MarketSettlingError, type MarketShareAuthorization, type MarketShareEvent, type MarketShareRangeParams, type MarketShareTransferParams, type MarketSnapshot, type MarketSpendStatus, type MarketTestPool, type MarketTokenEarnings, MarketTransactionError, MarketTransactionReplacedError, type MarketTransactionRequest, type MarketTransactionResult, type MarketWriteAction, calculateMarketClaimableFees, createMarketClient, defineMarketChain, defineMarketDeployment, defineMarketPoolKey, estimateMarketClaimableFees, getMarketAmountsForLiquidity, getMarketClaimOperator, getMarketCurrentFees, getMarketFeeBreakdown, getMarketFeeSnapshot, getMarketLiquidityForAmounts, getMarketPool, getMarketPoolId, getMarketPoolState, getMarketPosition, getMarketPriceRatio, getMarketRange, getMarketRangeId, getMarketSession, getMarketShareAuthorization, getMarketSpendStatus, getMarketSqrtPriceAtTick, getMarketSwapDirection, getMarketTickAtSqrtPrice, listMarketPools, marketDaysInMonth, marketTestPools, packMarketDayOverrides, previewMarketFeeAt, verifyMarketDeployment };
|