@panoptic-eng/sdk 1.0.22 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cow/index.d.ts +4 -4
- package/dist/cow/index.js +3 -3
- package/dist/cow/types.d.ts +2 -3
- package/dist/{cow-C_SGXoWr.js → cow-DW6LjXES.js} +2 -2
- package/dist/{cow-C_SGXoWr.js.map → cow-DW6LjXES.js.map} +1 -1
- package/dist/{index-BuJcj5aO.d.ts → index-CIlr4SNh.d.ts} +4 -3
- package/dist/index-CIlr4SNh.d.ts.map +1 -0
- package/dist/index.d.ts +75 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +116 -3
- package/dist/index.js.map +1 -1
- package/dist/{irm-C7OUVANR.d.ts → irm-CSJX9BsU.d.ts} +56 -3
- package/dist/{irm-C7OUVANR.d.ts.map → irm-CSJX9BsU.d.ts.map} +1 -1
- package/dist/{irm-DNK3N7qk.js → irm-Dw6fa-DV.js} +34 -3
- package/dist/irm-Dw6fa-DV.js.map +1 -0
- package/dist/panoptic/v2/index.d.ts +569 -12
- package/dist/panoptic/v2/index.d.ts.map +1 -1
- package/dist/panoptic/v2/index.js +378 -21
- package/dist/panoptic/v2/index.js.map +1 -1
- package/dist/{position-BK4a-Yyu.js → position-GYsTTl71.js} +51 -2
- package/dist/position-GYsTTl71.js.map +1 -0
- package/dist/{router-BZvOeloX.js → router-_vB5ArjF.js} +2 -2
- package/dist/{router-BZvOeloX.js.map → router-_vB5ArjF.js.map} +1 -1
- package/dist/simulation-4SzTI-xf.d.ts +435 -0
- package/dist/simulation-4SzTI-xf.d.ts.map +1 -0
- package/dist/test/index.d.ts +2 -2
- package/dist/test/index.d.ts.map +1 -1
- package/dist/tx-Banz1S18.d.ts +367 -0
- package/dist/tx-Banz1S18.d.ts.map +1 -0
- package/dist/{types-CRvvn2ce.d.ts → types-Bzw_7NJv.d.ts} +2 -2
- package/dist/{types-CRvvn2ce.d.ts.map → types-Bzw_7NJv.d.ts.map} +1 -1
- package/dist/types-CspUPolV.d.ts +892 -0
- package/dist/types-CspUPolV.d.ts.map +1 -0
- package/dist/uniswap/index.d.ts +3 -3
- package/dist/uniswap/index.js +3 -3
- package/dist/{writes-DymnVbiE.js → writes-h-IX3XQq.js} +77 -12
- package/dist/writes-h-IX3XQq.js.map +1 -0
- package/dist/zodiac/index.d.ts +1 -6
- package/dist/zodiac/index.d.ts.map +1 -1
- package/dist/zodiac/index.js +1 -6
- package/dist/zodiac/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/index-BuJcj5aO.d.ts.map +0 -1
- package/dist/index-DVMjZi1E.d.ts +0 -1801
- package/dist/index-DVMjZi1E.d.ts.map +0 -1
- package/dist/irm-CGykVo3q.d.ts +0 -32
- package/dist/irm-CGykVo3q.d.ts.map +0 -1
- package/dist/irm-DNK3N7qk.js.map +0 -1
- package/dist/panoptic/v2/types/index.d.ts +0 -3
- package/dist/panoptic/v2/types/index.js +0 -0
- package/dist/position-BK4a-Yyu.js.map +0 -1
- package/dist/types-BQejAFnu.d.ts +0 -245
- package/dist/types-BQejAFnu.d.ts.map +0 -1
- package/dist/writes-DymnVbiE.js.map +0 -1
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
import { Address } from "viem";
|
|
2
|
+
|
|
3
|
+
//#region src/panoptic/v2/types/meta.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Block metadata types for the Panoptic v2 SDK.
|
|
6
|
+
* @module v2/types/meta
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Block metadata attached to all RPC responses.
|
|
10
|
+
* Used for freshness checks and reorg detection.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Block metadata types for the Panoptic v2 SDK.
|
|
14
|
+
* @module v2/types/meta
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Block metadata attached to all RPC responses.
|
|
18
|
+
* Used for freshness checks and reorg detection.
|
|
19
|
+
*/
|
|
20
|
+
interface BlockMeta {
|
|
21
|
+
/** Block number when the data was fetched */
|
|
22
|
+
blockNumber: bigint;
|
|
23
|
+
/** Block timestamp in Unix seconds */
|
|
24
|
+
blockTimestamp: bigint;
|
|
25
|
+
/** Block hash for reorg detection */
|
|
26
|
+
blockHash: `0x${string}`;
|
|
27
|
+
/** Whether the data is considered stale */
|
|
28
|
+
isStale?: boolean;
|
|
29
|
+
} //#endregion
|
|
30
|
+
//#region src/panoptic/v2/types/position.d.ts
|
|
31
|
+
/**
|
|
32
|
+
* A single leg of a TokenId.
|
|
33
|
+
*/
|
|
34
|
+
interface TokenIdLeg {
|
|
35
|
+
/** Leg index (0-3) */
|
|
36
|
+
index: bigint;
|
|
37
|
+
/** Asset index (0 or 1) */
|
|
38
|
+
asset: bigint;
|
|
39
|
+
/** Option ratio (1-127) */
|
|
40
|
+
optionRatio: bigint;
|
|
41
|
+
/** Whether this is a long position (true) or short (false) */
|
|
42
|
+
isLong: boolean;
|
|
43
|
+
/** Token type (0 or 1) - which token is being moved */
|
|
44
|
+
tokenType: bigint;
|
|
45
|
+
/** Risk partner leg index (for spreads) */
|
|
46
|
+
riskPartner: bigint;
|
|
47
|
+
/** Strike tick (center of the range) */
|
|
48
|
+
strike: bigint;
|
|
49
|
+
/** Width in tick spacing units */
|
|
50
|
+
width: bigint;
|
|
51
|
+
/** Lower tick of the range */
|
|
52
|
+
tickLower: bigint;
|
|
53
|
+
/** Upper tick of the range */
|
|
54
|
+
tickUpper: bigint;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Position data.
|
|
58
|
+
*/
|
|
59
|
+
interface Position {
|
|
60
|
+
/** The TokenId (256-bit identifier) */
|
|
61
|
+
tokenId: bigint;
|
|
62
|
+
/** Position size (number of contracts) */
|
|
63
|
+
positionSize: bigint;
|
|
64
|
+
/** Owner address */
|
|
65
|
+
owner: Address;
|
|
66
|
+
/** Pool address */
|
|
67
|
+
poolAddress: Address;
|
|
68
|
+
/** Decoded legs */
|
|
69
|
+
legs: TokenIdLeg[];
|
|
70
|
+
/** Pool utilization for token 0 at mint (0-10000 bps) */
|
|
71
|
+
poolUtilization0AtMint: bigint;
|
|
72
|
+
/** Pool utilization for token 1 at mint (0-10000 bps) */
|
|
73
|
+
poolUtilization1AtMint: bigint;
|
|
74
|
+
/** Tick at the time of minting */
|
|
75
|
+
tickAtMint: bigint;
|
|
76
|
+
/** Timestamp at the time of minting (Unix seconds) */
|
|
77
|
+
timestampAtMint: bigint;
|
|
78
|
+
/** Block number at the time of minting */
|
|
79
|
+
blockNumberAtMint: bigint;
|
|
80
|
+
/** Whether a swap occurred at mint */
|
|
81
|
+
swapAtMint: boolean;
|
|
82
|
+
/** Accumulated premia owed for token 0 */
|
|
83
|
+
premiaOwed0: bigint;
|
|
84
|
+
/** Accumulated premia owed for token 1 */
|
|
85
|
+
premiaOwed1: bigint;
|
|
86
|
+
/** Whether this is an optimistic pending position */
|
|
87
|
+
pending?: boolean;
|
|
88
|
+
/** Asset index used for greek calculations */
|
|
89
|
+
assetIndex: bigint;
|
|
90
|
+
/** Block metadata */
|
|
91
|
+
_meta: BlockMeta;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Parameters for client-side leg greek calculations.
|
|
95
|
+
*/
|
|
96
|
+
interface LegGreeksParams {
|
|
97
|
+
/** The leg to calculate greeks for */
|
|
98
|
+
leg: TokenIdLeg;
|
|
99
|
+
/** Current tick */
|
|
100
|
+
tick: bigint;
|
|
101
|
+
/** Tick at mint (for value calculation) */
|
|
102
|
+
mintTick?: bigint;
|
|
103
|
+
/** Asset index (0 or 1) */
|
|
104
|
+
assetIndex: bigint;
|
|
105
|
+
/** Whether this is a defined risk position */
|
|
106
|
+
definedRisk: boolean;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Position greeks (value, delta, gamma).
|
|
110
|
+
*/
|
|
111
|
+
interface PositionGreeks {
|
|
112
|
+
/** Position value in numeraire token units */
|
|
113
|
+
value: bigint;
|
|
114
|
+
/** Position delta in numeraire token units */
|
|
115
|
+
delta: bigint;
|
|
116
|
+
/** Position gamma in numeraire token units */
|
|
117
|
+
gamma: bigint;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Closed position data for trade history.
|
|
121
|
+
*/
|
|
122
|
+
interface ClosedPosition {
|
|
123
|
+
/** The TokenId */
|
|
124
|
+
tokenId: bigint;
|
|
125
|
+
/** Owner address */
|
|
126
|
+
owner: Address;
|
|
127
|
+
/** Pool address */
|
|
128
|
+
poolAddress: Address;
|
|
129
|
+
/** Position size at close */
|
|
130
|
+
positionSize: bigint;
|
|
131
|
+
/** Open block number */
|
|
132
|
+
openBlock: bigint;
|
|
133
|
+
/** Close block number */
|
|
134
|
+
closeBlock: bigint;
|
|
135
|
+
/** Open timestamp */
|
|
136
|
+
openTimestamp: bigint;
|
|
137
|
+
/** Close timestamp */
|
|
138
|
+
closeTimestamp: bigint;
|
|
139
|
+
/** Tick at open */
|
|
140
|
+
tickAtOpen: bigint;
|
|
141
|
+
/** Tick at close */
|
|
142
|
+
tickAtClose: bigint;
|
|
143
|
+
/** Realized PnL for token 0 */
|
|
144
|
+
realizedPnL0: bigint;
|
|
145
|
+
/** Realized PnL for token 1 */
|
|
146
|
+
realizedPnL1: bigint;
|
|
147
|
+
/** Total premia collected for token 0 */
|
|
148
|
+
premiaCollected0: bigint;
|
|
149
|
+
/** Total premia collected for token 1 */
|
|
150
|
+
premiaCollected1: bigint;
|
|
151
|
+
/** Closure reason */
|
|
152
|
+
closureReason: 'closed' | 'liquidated' | 'force_exercised';
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Realized PnL summary for an account.
|
|
156
|
+
*/
|
|
157
|
+
interface RealizedPnL {
|
|
158
|
+
/** Total realized PnL for token 0 */
|
|
159
|
+
total0: bigint;
|
|
160
|
+
/** Total realized PnL for token 1 */
|
|
161
|
+
total1: bigint;
|
|
162
|
+
/** Number of closed positions */
|
|
163
|
+
positionCount: bigint;
|
|
164
|
+
/** Number of winning positions */
|
|
165
|
+
winCount: bigint;
|
|
166
|
+
/** Number of losing positions */
|
|
167
|
+
lossCount: bigint;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Stored position data (immutable fields only, no block metadata).
|
|
171
|
+
* Used for caching position data in storage.
|
|
172
|
+
*/
|
|
173
|
+
interface StoredPositionData {
|
|
174
|
+
/** The TokenId (256-bit identifier) */
|
|
175
|
+
tokenId: bigint;
|
|
176
|
+
/** Position size (number of contracts) */
|
|
177
|
+
positionSize: bigint;
|
|
178
|
+
/** Decoded legs */
|
|
179
|
+
legs: TokenIdLeg[];
|
|
180
|
+
/** Tick at the time of minting */
|
|
181
|
+
tickAtMint: bigint;
|
|
182
|
+
/** Pool utilization for token 0 at mint (0-10000 bps) */
|
|
183
|
+
poolUtilization0AtMint: bigint;
|
|
184
|
+
/** Pool utilization for token 1 at mint (0-10000 bps) */
|
|
185
|
+
poolUtilization1AtMint: bigint;
|
|
186
|
+
/** Timestamp at the time of minting (Unix seconds) */
|
|
187
|
+
timestampAtMint: bigint;
|
|
188
|
+
/** Block number at the time of minting */
|
|
189
|
+
blockNumberAtMint: bigint;
|
|
190
|
+
/** Whether a swap occurred at mint */
|
|
191
|
+
swapAtMint: boolean;
|
|
192
|
+
} //#endregion
|
|
193
|
+
//#region src/panoptic/v2/errors/base.d.ts
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Stored pool metadata (immutable fields fetched from chain).
|
|
197
|
+
* Does NOT include poolAddress/chainId as those are storage key components.
|
|
198
|
+
*/
|
|
199
|
+
/**
|
|
200
|
+
* Base error class for the Panoptic v2 SDK.
|
|
201
|
+
* @module v2/errors/base
|
|
202
|
+
*/
|
|
203
|
+
/**
|
|
204
|
+
* Base error class for all Panoptic SDK errors.
|
|
205
|
+
* All errors thrown by the SDK extend this class.
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```typescript
|
|
209
|
+
* try {
|
|
210
|
+
* await openPosition(config, params)
|
|
211
|
+
* } catch (error) {
|
|
212
|
+
* if (error instanceof PanopticError) {
|
|
213
|
+
* console.log('Panoptic error:', error.name, error.message)
|
|
214
|
+
* console.log('Original cause:', error.cause)
|
|
215
|
+
* }
|
|
216
|
+
* }
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
declare class PanopticError extends Error {
|
|
220
|
+
readonly cause?: Error | undefined;
|
|
221
|
+
readonly name: string;
|
|
222
|
+
/** The Solidity error name (e.g. 'PriceBoundFail', 'InputListFail'). Set by the parser. */
|
|
223
|
+
errorName?: string;
|
|
224
|
+
/**
|
|
225
|
+
* Creates a new PanopticError.
|
|
226
|
+
*
|
|
227
|
+
* @param message - Human-readable error message
|
|
228
|
+
* @param cause - Optional underlying error that caused this error
|
|
229
|
+
*/
|
|
230
|
+
constructor(message: string, cause?: Error | undefined);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
//#endregion
|
|
234
|
+
//#region src/panoptic/v2/types/simulation.d.ts
|
|
235
|
+
/**
|
|
236
|
+
* Token flow data from simulation.
|
|
237
|
+
* Measures collateral asset changes via getAssetsOf-dispatch-getAssetsOf pattern
|
|
238
|
+
* using PanopticPool.multicall.
|
|
239
|
+
*/
|
|
240
|
+
interface TokenFlow {
|
|
241
|
+
/** Token 0 collateral change (negative = user deposits, positive = user receives) */
|
|
242
|
+
delta0: bigint;
|
|
243
|
+
/** Token 1 collateral change (negative = user deposits, positive = user receives) */
|
|
244
|
+
delta1: bigint;
|
|
245
|
+
/** Collateral assets in token 0 before the call */
|
|
246
|
+
balanceBefore0: bigint;
|
|
247
|
+
/** Collateral assets in token 1 before the call */
|
|
248
|
+
balanceBefore1: bigint;
|
|
249
|
+
/** Collateral assets in token 0 after the call */
|
|
250
|
+
balanceAfter0: bigint;
|
|
251
|
+
/** Collateral assets in token 1 after the call */
|
|
252
|
+
balanceAfter1: bigint;
|
|
253
|
+
/** Pool tick before the operation */
|
|
254
|
+
tickBefore: bigint | null;
|
|
255
|
+
/** Pool tick after the operation */
|
|
256
|
+
tickAfter: bigint | null;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Simulation result discriminated union.
|
|
260
|
+
* Success case returns data, failure case returns error.
|
|
261
|
+
*
|
|
262
|
+
* Note: tokenFlow is optional because some simulations (deposit/withdraw)
|
|
263
|
+
* don't use the PanopticPool.multicall token flow measurement.
|
|
264
|
+
*/
|
|
265
|
+
type SimulationResult<T> = {
|
|
266
|
+
success: true;
|
|
267
|
+
data: T;
|
|
268
|
+
gasEstimate: bigint;
|
|
269
|
+
tokenFlow?: TokenFlow;
|
|
270
|
+
_meta: BlockMeta;
|
|
271
|
+
} | {
|
|
272
|
+
success: false;
|
|
273
|
+
error: PanopticError;
|
|
274
|
+
_meta: BlockMeta;
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* Open position simulation result data.
|
|
278
|
+
*/
|
|
279
|
+
interface OpenPositionSimulation {
|
|
280
|
+
/** The position that would be created */
|
|
281
|
+
position: Position;
|
|
282
|
+
/** Post-trade greeks */
|
|
283
|
+
greeks: PositionGreeks;
|
|
284
|
+
/** Token 0 amount required */
|
|
285
|
+
amount0Required: bigint;
|
|
286
|
+
/** Token 1 amount required */
|
|
287
|
+
amount1Required: bigint;
|
|
288
|
+
/** Post-trade collateral for token 0 */
|
|
289
|
+
postCollateral0: bigint;
|
|
290
|
+
/** Post-trade collateral for token 1 */
|
|
291
|
+
postCollateral1: bigint;
|
|
292
|
+
/**
|
|
293
|
+
* Post-mint collateral requirement in token0, from getFullPositionsData.collateralRequirements[].
|
|
294
|
+
* Sum of per-position LeftRightUnsigned.right across all positions in finalPositionIdList.
|
|
295
|
+
*/
|
|
296
|
+
postMintCollateralReqToken0: bigint;
|
|
297
|
+
/**
|
|
298
|
+
* Post-mint collateral requirement in token1, from getFullPositionsData.collateralRequirements[].
|
|
299
|
+
* Sum of per-position LeftRightUnsigned.left across all positions in finalPositionIdList.
|
|
300
|
+
*/
|
|
301
|
+
postMintCollateralReqToken1: bigint;
|
|
302
|
+
/**
|
|
303
|
+
* Per-position collateral requirements from getFullPositionsData.collateralRequirements[].
|
|
304
|
+
* One entry per position in finalPositionIdList, in the same order.
|
|
305
|
+
*/
|
|
306
|
+
perPositionCollateralReqs: {
|
|
307
|
+
token0: bigint;
|
|
308
|
+
token1: bigint;
|
|
309
|
+
}[];
|
|
310
|
+
/** Commission paid for token 0 (null: embedded in contract logic, not extractable from token flow) */
|
|
311
|
+
commission0: bigint | null;
|
|
312
|
+
/** Commission paid for token 1 (null: embedded in contract logic, not extractable from token flow) */
|
|
313
|
+
commission1: bigint | null;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Close position simulation result data.
|
|
317
|
+
*/
|
|
318
|
+
interface ClosePositionSimulation {
|
|
319
|
+
/** Token 0 amount received */
|
|
320
|
+
amount0Received: bigint;
|
|
321
|
+
/** Token 1 amount received */
|
|
322
|
+
amount1Received: bigint;
|
|
323
|
+
/** Premia collected for token 0 (null: requires pre-close premia snapshot) */
|
|
324
|
+
premiaCollected0: bigint | null;
|
|
325
|
+
/** Premia collected for token 1 (null: requires pre-close premia snapshot) */
|
|
326
|
+
premiaCollected1: bigint | null;
|
|
327
|
+
/** Post-trade collateral for token 0 */
|
|
328
|
+
postCollateral0: bigint;
|
|
329
|
+
/** Post-trade collateral for token 1 */
|
|
330
|
+
postCollateral1: bigint;
|
|
331
|
+
/** Realized PnL for token 0 (null: requires open position cost basis) */
|
|
332
|
+
realizedPnL0: bigint | null;
|
|
333
|
+
/** Realized PnL for token 1 (null: requires open position cost basis) */
|
|
334
|
+
realizedPnL1: bigint | null;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Force exercise simulation result data.
|
|
338
|
+
*/
|
|
339
|
+
interface ForceExerciseSimulation {
|
|
340
|
+
/** Exercise fee for token 0 (positive = received, negative = paid) */
|
|
341
|
+
exerciseFee0: bigint;
|
|
342
|
+
/** Exercise fee for token 1 */
|
|
343
|
+
exerciseFee1: bigint;
|
|
344
|
+
/** Whether the exercise would succeed */
|
|
345
|
+
canExercise: boolean;
|
|
346
|
+
/** Reason if cannot exercise */
|
|
347
|
+
reason?: string;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Liquidation simulation result data.
|
|
351
|
+
*/
|
|
352
|
+
interface LiquidateSimulation {
|
|
353
|
+
/** Bonus received for token 0 */
|
|
354
|
+
bonus0: bigint;
|
|
355
|
+
/** Bonus received for token 1 */
|
|
356
|
+
bonus1: bigint;
|
|
357
|
+
/** Positions that would be closed */
|
|
358
|
+
positionsClosed: bigint[];
|
|
359
|
+
/** Whether the account is liquidatable */
|
|
360
|
+
isLiquidatable: boolean;
|
|
361
|
+
/** Shortfall for token 0 (if liquidatable) */
|
|
362
|
+
shortfall0: bigint;
|
|
363
|
+
/** Shortfall for token 1 (if liquidatable) */
|
|
364
|
+
shortfall1: bigint;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Settle premia simulation result data.
|
|
368
|
+
*/
|
|
369
|
+
interface SettleSimulation {
|
|
370
|
+
/** Premia received for token 0 */
|
|
371
|
+
premiaReceived0: bigint;
|
|
372
|
+
/** Premia received for token 1 */
|
|
373
|
+
premiaReceived1: bigint;
|
|
374
|
+
/** Post-settle collateral for token 0 */
|
|
375
|
+
postCollateral0: bigint;
|
|
376
|
+
/** Post-settle collateral for token 1 */
|
|
377
|
+
postCollateral1: bigint;
|
|
378
|
+
/** Forfeit amounts [token0, token1] — present when tokenId was provided */
|
|
379
|
+
forfeitAmounts?: [bigint, bigint];
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Deposit simulation result data.
|
|
383
|
+
*/
|
|
384
|
+
interface DepositSimulation {
|
|
385
|
+
/** Shares that would be minted */
|
|
386
|
+
sharesMinted: bigint;
|
|
387
|
+
/** Post-deposit assets */
|
|
388
|
+
postAssets: bigint;
|
|
389
|
+
/** Post-deposit shares */
|
|
390
|
+
postShares: bigint;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Withdraw simulation result data.
|
|
394
|
+
*/
|
|
395
|
+
interface WithdrawSimulation {
|
|
396
|
+
/** Shares that would be burned */
|
|
397
|
+
sharesBurned: bigint;
|
|
398
|
+
/** Assets that would be received */
|
|
399
|
+
assetsReceived: bigint;
|
|
400
|
+
/** Post-withdraw assets */
|
|
401
|
+
postAssets: bigint;
|
|
402
|
+
/** Post-withdraw shares */
|
|
403
|
+
postShares: bigint;
|
|
404
|
+
/** Whether the withdrawal is possible */
|
|
405
|
+
canWithdraw: boolean;
|
|
406
|
+
/** Reason if cannot withdraw */
|
|
407
|
+
reason?: string;
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Dispatch simulation result data.
|
|
411
|
+
*/
|
|
412
|
+
interface DispatchSimulation {
|
|
413
|
+
/** Token 0 net change */
|
|
414
|
+
netAmount0: bigint;
|
|
415
|
+
/** Token 1 net change */
|
|
416
|
+
netAmount1: bigint;
|
|
417
|
+
/** Positions created */
|
|
418
|
+
positionsCreated: bigint[];
|
|
419
|
+
/** Positions closed */
|
|
420
|
+
positionsClosed: bigint[];
|
|
421
|
+
/** Post-dispatch collateral for token 0 */
|
|
422
|
+
postCollateral0: bigint;
|
|
423
|
+
/** Post-dispatch collateral for token 1 */
|
|
424
|
+
postCollateral1: bigint;
|
|
425
|
+
/** Post-dispatch margin excess for token 0 (null if full positions decode/token-flow balances are unavailable or omitted; see simulateDispatch/getFullPositionsData). */
|
|
426
|
+
postMarginExcess0: bigint | null;
|
|
427
|
+
/** Post-dispatch margin excess for token 1 (null if full positions decode/token-flow balances are unavailable or omitted; see simulateDispatch/getFullPositionsData). */
|
|
428
|
+
postMarginExcess1: bigint | null;
|
|
429
|
+
/** Pre-dispatch margin excess for token 0 (null if full positions decode/token-flow balances are unavailable or omitted; see simulateDispatch/getFullPositionsData). */
|
|
430
|
+
preMarginExcess0: bigint | null;
|
|
431
|
+
/** Pre-dispatch margin excess for token 1 (null if full positions decode/token-flow balances are unavailable or omitted; see simulateDispatch/getFullPositionsData). */
|
|
432
|
+
preMarginExcess1: bigint | null;
|
|
433
|
+
} //#endregion
|
|
434
|
+
export { BlockMeta, ClosePositionSimulation, ClosedPosition, DepositSimulation, DispatchSimulation, ForceExerciseSimulation, LegGreeksParams, LiquidateSimulation, OpenPositionSimulation, PanopticError as PanopticError$1, Position, PositionGreeks, RealizedPnL, SettleSimulation, SimulationResult, StoredPositionData, TokenFlow, TokenIdLeg, WithdrawSimulation };
|
|
435
|
+
//# sourceMappingURL=simulation-4SzTI-xf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulation-4SzTI-xf.d.ts","names":["BlockMeta","Address","BlockMeta","TokenIdLeg","Position","LegGreeksParams","PositionGreeks","ClosedPosition","RealizedPnL","StoredPositionData","StoredPoolMeta","PanopticError","Error","PanopticError","BlockMeta","Position","PositionGreeks","TokenFlow","SimulationResult","T","OpenPositionSimulation","ClosePositionSimulation","ForceExerciseSimulation","LiquidateSimulation","SettleSimulation","DepositSimulation","WithdrawSimulation","DispatchSimulation"],"sources":["../src/panoptic/v2/types/meta.d.ts","../src/panoptic/v2/types/position.d.ts","../src/panoptic/v2/errors/base.d.ts","../src/panoptic/v2/types/simulation.d.ts"],"sourcesContent":null,"mappings":"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"}
|
package/dist/test/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Address } from "viem";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
import { Config } from "wagmi";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/test/test-utils.d.ts
|
|
7
7
|
declare const spawnAnvil: (args?: AnvilArgs) => Promise<void>;
|
|
@@ -236,7 +236,7 @@ declare const ReactTestWrapper: ({
|
|
|
236
236
|
}: {
|
|
237
237
|
children?: ReactNode;
|
|
238
238
|
wagmiConfig: Config;
|
|
239
|
-
}) =>
|
|
239
|
+
}) => react_jsx_runtime0.JSX.Element;
|
|
240
240
|
|
|
241
241
|
//#endregion
|
|
242
242
|
//#region src/test/test-accounts.d.ts
|
package/dist/test/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["spawnAnvil","AnvilArgs","Promise","killAnvilProcess","killAllAnvilProcesses","Record","ReactNode","Config","ReactTestWrapper","children","wagmiConfig","
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["spawnAnvil","AnvilArgs","Promise","killAnvilProcess","killAllAnvilProcesses","Record","ReactNode","Config","ReactTestWrapper","children","wagmiConfig","react_jsx_runtime0","JSX","Element","Address","alice","bob","charlie"],"sources":["../../src/test/test-utils.d.ts","../../src/test/react-test-utils.d.ts","../../src/test/test-accounts.d.ts"],"sourcesContent":null,"mappings":";;;;;;cAAqBA,oBAAoBC,cAAcC;cAClCC,oCAAoCD;cACpCE,6BAA6BF;KAC7CD,SAAAA;;;AAHL;;;EAAkD,QAAKC,CAAAA,EAAAA,MAAAA,GAAAA,SAAAA;EAAO;AAC9D;AACA;AAAgE;;;;ACAhE;;EAG6C,eAHHO,CAAAA,EAAAA,OAAAA,GAAAA,SAAAA;EAAQ;;;;AAGL;;;;ACJ7C;EACqBO,kBAAKF,CAAAA,EAAAA,MAAO,GAAA,MAAA,GAAA,SAAA;EACZG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eFkGJZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCnGIG;;;;aACNF;eACEC;MACiBI,kBAAAA,CAAAC,GAAAA,CAAIC;;;;cCJjBE,OAAOD;cACPE,KAAKF;cACLG,SAASH"}
|