@panoptic-eng/sdk 1.0.26 → 1.0.27
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 +5 -4
- package/dist/cow/index.js +4 -3
- package/dist/cow/types.d.ts +2 -2
- package/dist/{cow-UR3yv8Wz.js → cow-CbyBBJa8.js} +2 -2
- package/dist/{cow-UR3yv8Wz.js.map → cow-CbyBBJa8.js.map} +1 -1
- package/dist/greeks-GysWXct-.js +1072 -0
- package/dist/greeks-GysWXct-.js.map +1 -0
- package/dist/index-Bs35Gs9h.d.ts +261 -0
- package/dist/index-Bs35Gs9h.d.ts.map +1 -0
- package/dist/{index-CIlr4SNh.d.ts → index-cqnrR3RH.d.ts} +4 -4
- package/dist/{index-CIlr4SNh.d.ts.map → index-cqnrR3RH.d.ts.map} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/{irm-Dw6fa-DV.js → irm-CUQhUGHI.js} +3 -2
- package/dist/{irm-Dw6fa-DV.js.map → irm-CUQhUGHI.js.map} +1 -1
- package/dist/{irm-CSJX9BsU.d.ts → irm-DsuOZAXj.d.ts} +1 -1
- package/dist/{irm-CSJX9BsU.d.ts.map → irm-DsuOZAXj.d.ts.map} +1 -1
- package/dist/panoptic/v2/greeks/index.d.ts +3 -0
- package/dist/panoptic/v2/greeks/index.js +3 -0
- package/dist/panoptic/v2/index.d.ts +9 -233
- package/dist/panoptic/v2/index.d.ts.map +1 -1
- package/dist/panoptic/v2/index.js +7 -6
- package/dist/panoptic/v2/index.js.map +1 -1
- package/dist/{position-GYsTTl71.js → position-B7cJsaOz.js} +3 -1056
- package/dist/position-B7cJsaOz.js.map +1 -0
- package/dist/position-C8du80mE.d.ts +199 -0
- package/dist/position-C8du80mE.d.ts.map +1 -0
- package/dist/{router-DGUQo-8h.js → router-CFs84CaF.js} +2 -2
- package/dist/{router-DGUQo-8h.js.map → router-CFs84CaF.js.map} +1 -1
- package/dist/{simulation-4SzTI-xf.d.ts → simulation-DMPUACvp.d.ts} +21 -198
- package/dist/simulation-DMPUACvp.d.ts.map +1 -0
- package/dist/{tx-Banz1S18.d.ts → tx-D4uNr1_K.d.ts} +1 -1
- package/dist/{tx-Banz1S18.d.ts.map → tx-D4uNr1_K.d.ts.map} +1 -1
- package/dist/{types-Bzw_7NJv.d.ts → types-CRev1pDq.d.ts} +2 -2
- package/dist/{types-Bzw_7NJv.d.ts.map → types-CRev1pDq.d.ts.map} +1 -1
- package/dist/{types-CspUPolV.d.ts → types-CnfCBl2B.d.ts} +3 -3
- package/dist/{types-CspUPolV.d.ts.map → types-CnfCBl2B.d.ts.map} +1 -1
- package/dist/uniswap/index.d.ts +4 -3
- package/dist/uniswap/index.d.ts.map +1 -1
- package/dist/uniswap/index.js +4 -3
- package/dist/uniswap/index.js.map +1 -1
- package/dist/{writes-h-IX3XQq.js → writes-GvVYh9PQ.js} +3 -2
- package/dist/{writes-h-IX3XQq.js.map → writes-GvVYh9PQ.js.map} +1 -1
- package/package.json +5 -1
- package/dist/position-GYsTTl71.js.map +0 -1
- package/dist/simulation-4SzTI-xf.d.ts.map +0 -1
|
@@ -1,201 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BlockMeta, Position, PositionGreeks } from "./position-C8du80mE.js";
|
|
2
2
|
|
|
3
|
-
//#region src/panoptic/v2/
|
|
3
|
+
//#region src/panoptic/v2/errors/base.d.ts
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
* @module v2/
|
|
5
|
+
* Base error class for the Panoptic v2 SDK.
|
|
6
|
+
* @module v2/errors/base
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* Base error class for all Panoptic SDK errors.
|
|
10
|
+
* All errors thrown by the SDK extend this class.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* try {
|
|
15
|
+
* await openPosition(config, params)
|
|
16
|
+
* } catch (error) {
|
|
17
|
+
* if (error instanceof PanopticError) {
|
|
18
|
+
* console.log('Panoptic error:', error.name, error.message)
|
|
19
|
+
* console.log('Original cause:', error.cause)
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
11
23
|
*/
|
|
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
24
|
/**
|
|
200
25
|
* Base error class for the Panoptic v2 SDK.
|
|
201
26
|
* @module v2/errors/base
|
|
@@ -228,9 +53,7 @@ declare class PanopticError extends Error {
|
|
|
228
53
|
* @param cause - Optional underlying error that caused this error
|
|
229
54
|
*/
|
|
230
55
|
constructor(message: string, cause?: Error | undefined);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
//#endregion
|
|
56
|
+
} //#endregion
|
|
234
57
|
//#region src/panoptic/v2/types/simulation.d.ts
|
|
235
58
|
/**
|
|
236
59
|
* Token flow data from simulation.
|
|
@@ -431,5 +254,5 @@ interface DispatchSimulation {
|
|
|
431
254
|
/** Pre-dispatch margin excess for token 1 (null if full positions decode/token-flow balances are unavailable or omitted; see simulateDispatch/getFullPositionsData). */
|
|
432
255
|
preMarginExcess1: bigint | null;
|
|
433
256
|
} //#endregion
|
|
434
|
-
export {
|
|
435
|
-
//# sourceMappingURL=simulation-
|
|
257
|
+
export { ClosePositionSimulation, DepositSimulation, DispatchSimulation, ForceExerciseSimulation, LiquidateSimulation, OpenPositionSimulation, PanopticError as PanopticError$1, SettleSimulation, SimulationResult, TokenFlow, WithdrawSimulation };
|
|
258
|
+
//# sourceMappingURL=simulation-DMPUACvp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulation-DMPUACvp.d.ts","names":["PanopticError","Error","PanopticError","BlockMeta","Position","PositionGreeks","TokenFlow","SimulationResult","T","OpenPositionSimulation","ClosePositionSimulation","ForceExerciseSimulation","LiquidateSimulation","SettleSimulation","DepositSimulation","WithdrawSimulation","DispatchSimulation"],"sources":["../src/panoptic/v2/errors/base.d.ts","../src/panoptic/v2/types/simulation.d.ts"],"sourcesContent":null,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAoBqBE,aAAAA,SAAsBD,KAAAA;mBACtBA;;EADAC;EAAa,SAAA,CAAA,EAAA,MAAA;EAAA;;;AAAc;;;uCAWPD;;;;;;;;UCnBxBK,SAAAA;;;;;;;;;;;EDQIJ;EAAa,aAAA,EAAA,MAAA;EAAA;EACR,UAUeD,EAAAA,MAAAA,GAAAA,IAAAA;EAAK;EAXE,SAAA,EAAA,MAAA,GAAA,IAAA;;;;;;;;;ACR/BK,KAyBLC,gBAzBc,CAAA,CAAA,CAAA,GAAA;;QA2BhBC;;cAEMF;SACLH;;;EALCI,KAAAA,EAQDL,aARiB;EAAA,KAAA,EASjBC,SATiB;CAAA;;;;AASjBA,UAKMM,sBAAAA,CALNN;EAAS;YAONC;;UAEFC;EAJKI;EAAsB,eAAA,EAAA,MAAA;EAAA;EAEjB,eAEVJ,EAAAA,MAAAA;EAAc;;;;EAmCTK;;;;EAqBAC,2BAAuB,EAAA,MAAA;;;;AAaxC;;;;AAiBA;;;;IAeiBG,MAAAA,EAAAA,MAAAA;;;;EAWAC;;;;AAiBjB;;UA9FiBL,uBAAAA;;;;;;;;;;;;;;;;;;;;;UAqBAC,uBAAAA;;;;;;;;;;;;;UAaAC,mBAAAA;;;;;;;;;;;;;;;;;UAiBAC,gBAAAA;;;;;;;;;;;;;;;UAeAC,iBAAAA;;;;;;;;;;;UAWAC,kBAAAA;;;;;;;;;;;;;;;;;UAiBAC,kBAAAA"}
|
|
@@ -364,4 +364,4 @@ interface DispatchCall {
|
|
|
364
364
|
|
|
365
365
|
//#endregion
|
|
366
366
|
export { AccountLiquidatedEvent, BaseEvent, DepositEvent, DispatchCall, EventSubscription, ForcedExercisedEvent, LegUpdate, NonceManager, OptionBurntEvent, OptionMintedEvent, PanopticEvent, PanopticEventType, PremiumSettledEvent, SyncEvent, TxBroadcaster, TxOverrides, TxReceipt, TxResult, TxResultWithReceipt, WithdrawEvent };
|
|
367
|
-
//# sourceMappingURL=tx-
|
|
367
|
+
//# sourceMappingURL=tx-D4uNr1_K.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx-
|
|
1
|
+
{"version":3,"file":"tx-D4uNr1_K.d.ts","names":["Address","Hash","PanopticEventType","BaseEvent","OptionMintedEvent","OptionBurntEvent","AccountLiquidatedEvent","ForcedExercisedEvent","PremiumSettledEvent","DepositEvent","WithdrawEvent","BorrowRateUpdatedEvent","LiquidityChunkUpdatedEvent","ProtocolLossRealizedEvent","ModifyLiquidityEvent","SwapEvent","DonateEvent","PanopticEvent","LegUpdate","EventSubscription","SyncEvent","Address","Hash","PanopticEvent","TxResult","TxReceipt","Promise","TxResultWithReceipt","TxBroadcaster","TxOverrides","NonceManager","DispatchCall"],"sources":["../src/panoptic/v2/types/events.d.ts","../src/panoptic/v2/types/tx.d.ts"],"sourcesContent":null,"mappings":";;;;;;;;AAQA;;KAAYE,iBAAAA;;AAIZ;;AAEUA,UAFOC,SAAAA,CAEPD;EAAiB;EAEF,IAIVoB,EANLpB,iBAMKoB;EAAI;mBAJEA;;;EAWJlB;EAAiB,SAAA,EAPnBkB,IAOmB;EAAA;EAGZ,QAHqBnB,EAAAA,MAAAA;AAAS;;;;AAwBnCE,UAxBAD,iBAAAA,SAA0BD,SAwBV,CAAA;EAAA,IAAA,EAAA,cAAA;EAAA;EAGX,SAHoBA,EArB3BkB,OAqB2BlB;EAAS;;;;EAclCG;EAAsB,gBAAA,EAAA,MAAA;EAAA;EAGhB,gBAEPe,EAAAA,MAAAA;EAAO;EALkC,UAAA,EAAA,MAAA;;;;EAcxCd,WAAAA,EAAAA,MAAAA;EAAoB;EAAA,UAGtBc,EAAAA,OAAAA;;;AAHwC;;UA5BtChB,gBAAAA,SAAyBF;;EA4CzBK;EAAmB,SAAA,EAzCrBa,OAyCqB;EAAA;EAGnB,OAH4BlB,EAAAA,MAAAA;EAAS;;;;AAgBtD;;;;AAAs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,UCxBAoB,SAAAA,CDwBgB;EAAA;EAAA,IAGlBJ,ECzBLC,IDyBKD;EAAO;EAH6B,WAAA,EAAA,MAAA;;aClBpCC;;EDgCEhB,OAAAA,EAAAA,MAAAA;EAAsB;EAAA,MAGvBe,EAAAA,SAAAA,GAAAA,UAAAA;EAAO;EAEA,MALyBlB,EC1BpCoB,aD0BoCpB,EAAAA;AAAS;;;;AAczD;AAAqC,UClCpByB,aAAAA,CDkCoB;EAAA;;;AAAkB;;0CC5BXF,QAAQJ;;AD4CpD;;;;AAAsD,UCtCrCO,WAAAA,CDsCqC;;;;EAgBrCpB,oBAAY,CAAA,EAAA,MAAA;EAAA;EAAA,GAGjBY,CAAAA,EAAAA,MAAAA;EAAO;EAED,KALoBlB,CAAAA,EAAAA,MAAAA;EAAS;gBC5C7ByB;;;AD0DlB;;AAGYP,UCxDKS,YAAAA,CDwDLT;EAAO;EAEE,YAEVA,EAAAA,CAAAA,OAAAA,EC1DiBA,OD0DjBA,EAAAA,GC1D6BK,OD0D7BL,CAAAA,MAAAA,CAAAA;EAAO;EAP8B,KAAA,EAAA,CAAA,OAAA,ECjD3BA,ODiD2B,EAAA,GAAA,IAAA;;;;AAgBhD;AAAuC,UC5DtBU,YAAAA,CD4DsB;EAAA;EAGX,OAHoB5B,EAAAA,MAAAA;EAAS;;;;EAYxCS;EAA0B,SAAA,CAAA,EChE3BS,ODgE2B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TxOverrides } from "./tx-
|
|
1
|
+
import { TxOverrides } from "./tx-D4uNr1_K.js";
|
|
2
2
|
import { Address, Hex, PublicClient, WalletClient } from "viem";
|
|
3
3
|
|
|
4
4
|
//#region src/cow/types.d.ts
|
|
@@ -125,4 +125,4 @@ interface ApproveErc20ForCowParams {
|
|
|
125
125
|
txOverrides?: TxOverrides;
|
|
126
126
|
} //#endregion
|
|
127
127
|
export { ApproveErc20ForCowParams, CancelCowOrderParams, CheckCowApprovalParams, CowApprovalStatus, CowOrderKind, CowOrderResult, CowOrderState, CowOrderStatus, CowQuote, GetCowOrderStatusParams, QuoteCowSwapParams, SignAndSubmitCowOrderParams };
|
|
128
|
-
//# sourceMappingURL=types-
|
|
128
|
+
//# sourceMappingURL=types-CRev1pDq.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-CRev1pDq.d.ts","names":["Address","Hex","PublicClient","WalletClient","TxOverrides","CowOrderKind","CowOrderStatus","QuoteCowSwapParams","CowQuote","SignAndSubmitCowOrderParams","CowOrderResult","CancelCowOrderParams","GetCowOrderStatusParams","CowOrderState","CheckCowApprovalParams","CowApprovalStatus","ApproveErc20ForCowParams"],"sources":["../src/cow/types.d.ts"],"sourcesContent":null,"mappings":";;;;;;;AASYM,KAFAD,YAAAA,GAEc,MAAA,GAAA,KAAA;;AAETE,KAFLD,cAAAA,GAEuB,qBAAA,GAAA,MAAA,GAAA,WAAA,GAAA,WAAA,GAAA,SAAA;;AAIpBN,UAJEO,kBAAAA,CAIFP;EAAO;EAED,OAEXK,EAAAA,MAAAA;EAAY;EAIL,SAAA,EARFL,OAQE;;YANHA;;QAEJK;;;;EAmBOG,IAAAA,EAfPR,OAee;EAAA;EAAA,WACfK,EAAAA,MAAAA;EAAY;EACA,eACRL,CAAAA,EAAAA,MAAAA;EAAO;;AAmBrB;;;;;;AAQsB;;AAKLU,UAnCAF,QAAAA,CAmCc;QAlCrBH;EAsCOM,SAAAA,EArCFX,OAqCEW;EAAoB,QAAA,EApCvBX,OAoCuB;EAAA;EACP,UACjBA,EAAAA,MAAAA;EAAO;EAEH,SAAA,EAAA,MAAA;;EAIAY,SAAAA,EAAAA,MAAAA;;EAMAC,eAAAA,EAAa,MAAA;EAAA;EAAA,eAClBP,EAAAA,MAAAA;EAAc;EAKA,cAAA,EAAA,MAAA;;EAGTQ,OAAAA,EAAAA,MAAAA;EAAsB;EAAA,OAC3BZ,EAAAA,MAAAA,GAAAA,IAAAA;;;AAIM,UA7CDO,2BAAAA,CA6CC;gBA5CAN;EAiDDY;WA/CJf;EAqDIgB,OAAAA,EAAAA,MAAAA;EAAwB;EAAA,KAC7Bd,EAnDDM,QAmDCN;EAAY;EACM,QACjBF,CAAAA,EAnDEA,OAmDFA;EAAO;EAEE,MAGJI,CAAAA,EAAAA,MAAAA;AAAW;;UAnDZM,cAAAA;YACHT;;;UAGGU,oBAAAA;gBACCR;WACLH;;YAECC;;;;UAIGW,uBAAAA;;YAEHX;;;;UAIGY,aAAAA;UACLP;;;;;qBAKWL;;;UAGNa,sBAAAA;UACLZ;;aAEGF;;SAEJA;;;;;UAKMe,iBAAAA;;;;;;UAMAC,wBAAAA;UACLd;gBACMC;WACLH;;aAEEA;;;gBAGGI"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BlockMeta } from "./
|
|
2
|
-
import { TxOverrides } from "./tx-
|
|
1
|
+
import { BlockMeta } from "./position-C8du80mE.js";
|
|
2
|
+
import { TxOverrides } from "./tx-D4uNr1_K.js";
|
|
3
3
|
import { Address, PublicClient, WalletClient } from "viem";
|
|
4
4
|
|
|
5
5
|
//#region src/panoptic/v2/formatters/tick.d.ts
|
|
@@ -889,4 +889,4 @@ interface ApproveRouterViaPermit2Params {
|
|
|
889
889
|
|
|
890
890
|
//#endregion
|
|
891
891
|
export { ApproveErc20ForPermit2Params, ApproveRouterViaPermit2Params, CheckRouterApprovalParams, CollateralTracker, CurrentRates, FetchPoolIdParams, FetchPoolIdResult, GetOracleStateParams, GetPoolMetadataParams, GetPoolParams, GetRiskParametersParams, GetUtilizationParams, OracleState, PERMIT2_ADDRESS as PERMIT2_ADDRESS$1, Pool, PoolHealthStatus, PoolKey, PoolMetadata, QuoteSwapExactInViaRouterParams, QuoteSwapExactOutViaRouterParams, RiskEngine, RiskParameters, RouterApprovalStatus, SafeMode, SafeModeState, SwapExactInQuote, SwapExactInViaRouterParams, SwapExactOutQuote, SwapExactOutViaRouterParams, TickLimitsResult, UNISWAP_V4_ADDRESSES as UNISWAP_V4_ADDRESSES$1, UniswapV4Addresses, Utilization, fetchPoolId as fetchPoolId$1, formatPriceRange as formatPriceRange$1, formatTick as formatTick$1, formatTickRange as formatTickRange$1, getOracleState as getOracleState$1, getPool as getPool$1, getPoolMetadata as getPoolMetadata$1, getPricesAtTick as getPricesAtTick$1, getRiskParameters as getRiskParameters$1, getTickSpacing as getTickSpacing$1, getUniswapV4Addresses as getUniswapV4Addresses$1, getUtilization as getUtilization$1, priceToTick as priceToTick$1, roundToTickSpacing as roundToTickSpacing$1, sqrtPriceX96ToPriceDecimalScaled as sqrtPriceX96ToPriceDecimalScaled$1, sqrtPriceX96ToTick as sqrtPriceX96ToTick$1, tickLimits as tickLimits$1, tickToPrice as tickToPrice$1, tickToPriceDecimalScaled as tickToPriceDecimalScaled$1, tickToSqrtPriceX96 as tickToSqrtPriceX96$1, validateBuilderCode as validateBuilderCode$1 };
|
|
892
|
-
//# sourceMappingURL=types-
|
|
892
|
+
//# sourceMappingURL=types-CnfCBl2B.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-CnfCBl2B.d.ts","names":["tickToSqrtPriceX96","tickToPrice","tickToPriceDecimalScaled","sqrtPriceX96ToPriceDecimalScaled","priceToTick","sqrtPriceX96ToTick","formatTick","getPricesAtTick","formatTickRange","formatPriceRange","getTickSpacing","roundToTickSpacing","TickLimitsResult","tickLimits","Address","PublicClient","tickToSqrtPriceX96","BlockMeta","OracleState","Pool","RiskParameters","Utilization","PoolMetadata","GetPoolMetadataParams","getPoolMetadata","Promise","GetPoolParams","getPool","GetUtilizationParams","getUtilization","GetOracleStateParams","getOracleState","GetRiskParametersParams","getRiskParameters","validateBuilderCode","FetchPoolIdParams","FetchPoolIdResult","fetchPoolId","Address","PoolMetadata","BlockMeta","PoolHealthStatus","CollateralTracker","RiskEngine","PoolKey","Pool","Utilization","BlockMeta","SafeMode","OracleState","SafeModeState","RiskParameters","CurrentRates","Address","UniswapV4Addresses","PERMIT2_ADDRESS","UNISWAP_V4_ADDRESSES","Record","getUniswapV4Addresses","Partial","Address","PublicClient","WalletClient","PoolKey","TxOverrides","UniswapV4Addresses","SwapExactInViaRouterParams","Partial","QuoteSwapExactInViaRouterParams","SwapExactInQuote","SwapExactOutViaRouterParams","QuoteSwapExactOutViaRouterParams","SwapExactOutQuote","CheckRouterApprovalParams","RouterApprovalStatus","ApproveErc20ForPermit2Params","ApproveRouterViaPermit2Params"],"sources":["../src/panoptic/v2/formatters/tick.d.ts","../src/panoptic/v2/reads/pool.d.ts","../src/panoptic/v2/types/pool.d.ts","../src/panoptic/v2/types/oracle.d.ts","../src/uniswap/v4/addresses.d.ts","../src/uniswap/v4/router/types.d.ts"],"sourcesContent":null,"mappings":";;;;;;;;;;;;;;;;;;;iBAOwBgB,kBAAAA;;;;;AAAxB;;;;;;;;;;;;;;iBAmBwBf,WAAAA;;;;;AAAxB;;;;;;;;;;;;;;;;;;iBAuBwBC,wBAAAA;;;;;AAAxB;;;;;;;;;;;;iBAiBwBC,gCAAAA;;;;;AAAxB;;;;;;;;;;;;;iBAkBwBC,WAAAA;;;;;AAAxB;;;;;;;iBAYwBC,kBAAAA;;;;;AAAxB;;;;;;;;iBAawBC,UAAAA;;;;;AAAxB;;;;;;;;;;;;iBAiBwBC,eAAAA;;;;;AAAxB;;;;;;;;;;;iBAgBwBC,eAAAA;;AAAxB;;;;;;;;;;;;;;iBAgBwBC,gBAAAA;;AAAxB;;;;;;;;;;;;;iBAewBC,cAAAA;;AAAxB;;;;;;;;;;;;;iBAewBC,kBAAAA;;AAAxB;;UAIiBC,gBAAAA;;EAAAA,GAAAA,EAAAA,MAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BjB;;;iBAAwBC,UAAAA,6CAAuDD;;;;;;;UCxM9D2B,YAAAA;;;;;;2BAMYqB;;EDHL3D,uBAAW,ECKN2D,ODLM;;qBCOZA;;eAENA;;eAEAA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,EAAAA,MAAe;;;;YKSzBqD;;WAEDG;;;;;;;ALKWvD,UKEPiE,yBAAAA,CLFsB;;UKI3BZ;;;;WAICD;;SAEFA;;;;cAIKO,QAAQF;;;;ALExB;UKGiBS,oBAAAA;;;;;;;;;;;;;;ALYjB;UKGiBC,4BAAAA;UACLd;gBACMC;WACLF;;;WAGAA;;;gBAGKI;cACFG,QAAQF;;;;ALExB;UKGiBW,6BAAAA;UACLf;gBACMC;ELDDlD,OAAAA,EKEJgD,OLFIhD;;;WKKJgD;;;;;gBAKKI;cACFG,QAAQF"}
|
package/dist/uniswap/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ApproveErc20ForPermit2Params, ApproveRouterViaPermit2Params, CheckRouterApprovalParams, PERMIT2_ADDRESS$1 as PERMIT2_ADDRESS, PoolKey, QuoteSwapExactInViaRouterParams, QuoteSwapExactOutViaRouterParams, RouterApprovalStatus, SwapExactInQuote, SwapExactInViaRouterParams, SwapExactOutQuote, SwapExactOutViaRouterParams, UNISWAP_V4_ADDRESSES$1 as UNISWAP_V4_ADDRESSES, UniswapV4Addresses, getUniswapV4Addresses$1 as getUniswapV4Addresses } from "../types-
|
|
3
|
-
import { TxReceipt, TxResult } from "../tx-
|
|
1
|
+
import "../position-C8du80mE.js";
|
|
2
|
+
import { ApproveErc20ForPermit2Params, ApproveRouterViaPermit2Params, CheckRouterApprovalParams, PERMIT2_ADDRESS$1 as PERMIT2_ADDRESS, PoolKey, QuoteSwapExactInViaRouterParams, QuoteSwapExactOutViaRouterParams, RouterApprovalStatus, SwapExactInQuote, SwapExactInViaRouterParams, SwapExactOutQuote, SwapExactOutViaRouterParams, UNISWAP_V4_ADDRESSES$1 as UNISWAP_V4_ADDRESSES, UniswapV4Addresses, getUniswapV4Addresses$1 as getUniswapV4Addresses } from "../types-CnfCBl2B.js";
|
|
3
|
+
import { TxReceipt, TxResult } from "../tx-D4uNr1_K.js";
|
|
4
|
+
import { PanopticError$1 as PanopticError, SimulationResult } from "../simulation-DMPUACvp.js";
|
|
4
5
|
import { Address, Hex, PublicClient } from "viem";
|
|
5
6
|
|
|
6
7
|
//#region src/uniswap/v4/router/encodeSwap.d.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["Address","Hex","PoolKey","V4_SWAP","SWAP_EXACT_IN_SINGLE","SETTLE_ALL","TAKE_ALL","TAKE","SWAP_EXACT_OUT_SINGLE","SWEEP","BuildV4SwapCalldataArgs","buildV4SwapExecuteArgs","buildV4SwapExecuteCalldata","BuildV4ExactOutSwapCalldataArgs","buildV4ExactOutSwapExecuteArgs","buildV4ExactOutSwapExecuteCalldata","Address","PanopticError","UnsupportedChainError","Error","InvalidSwapTokenError","AmountExceedsUint128Error","MissingSweepRecipientError","QuoterUnavailableError","TxReceipt","TxResult","ApproveErc20ForPermit2Params","ApproveRouterViaPermit2Params","CheckRouterApprovalParams","RouterApprovalStatus","checkRouterApproval","Promise","approveErc20ForPermit2","approveErc20ForPermit2AndWait","approveRouterViaPermit2","approveRouterViaPermit2AndWait","SimulationResult","QuoteSwapExactInViaRouterParams","QuoteSwapExactOutViaRouterParams","SwapExactInQuote","SwapExactOutQuote","quoteSwapExactInViaRouter","Promise","quoteSwapExactOutViaRouter","PublicClient","PoolKey","UniswapV4Addresses","QuoteV4ExactInByPoolKeyParams","Partial","V4ExactInQuote","quoteV4ExactInByPoolKey","Promise","Address","PublicClient","PoolKey","ResolvedSwapRoute","ResolveSwapRouteParams","resolveSwapRoute","Promise","TxReceipt","TxResult","SwapExactInViaRouterParams","SwapExactOutViaRouterParams","swapExactInViaRouter","Promise","swapExactInViaRouterAndWait","swapExactOutViaRouter","swapExactOutViaRouterAndWait","Address","UniswapV3Addresses","UNISWAP_V3_ADDRESSES","Record","getUniswapV3Addresses","Partial","Address","Hex","V3_SWAP_EXACT_IN","MSG_SENDER","BuildV3SwapCalldataArgs","encodeV3Path","buildV3SwapExecuteArgs","buildV3SwapExecuteCalldata","Address","PublicClient","UniswapV3Addresses","QuoteV3ExactInParams","Partial","V3ExactInQuote","quoteV3ExactIn","Promise"],"sources":["../../src/uniswap/v4/router/encodeSwap.d.ts","../../src/uniswap/v4/router/errors.d.ts","../../src/uniswap/v4/router/permit2.d.ts","../../src/uniswap/v4/router/quote.d.ts","../../src/uniswap/v4/router/quoteByPoolKey.d.ts","../../src/uniswap/v4/router/resolvePoolKey.d.ts","../../src/uniswap/v4/router/swap.d.ts","../../src/uniswap/v3/addresses.d.ts","../../src/uniswap/v3/router/encodeSwap.d.ts","../../src/uniswap/v3/router/quote.d.ts"],"sourcesContent":null,"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["Address","Hex","PoolKey","V4_SWAP","SWAP_EXACT_IN_SINGLE","SETTLE_ALL","TAKE_ALL","TAKE","SWAP_EXACT_OUT_SINGLE","SWEEP","BuildV4SwapCalldataArgs","buildV4SwapExecuteArgs","buildV4SwapExecuteCalldata","BuildV4ExactOutSwapCalldataArgs","buildV4ExactOutSwapExecuteArgs","buildV4ExactOutSwapExecuteCalldata","Address","PanopticError","UnsupportedChainError","Error","InvalidSwapTokenError","AmountExceedsUint128Error","MissingSweepRecipientError","QuoterUnavailableError","TxReceipt","TxResult","ApproveErc20ForPermit2Params","ApproveRouterViaPermit2Params","CheckRouterApprovalParams","RouterApprovalStatus","checkRouterApproval","Promise","approveErc20ForPermit2","approveErc20ForPermit2AndWait","approveRouterViaPermit2","approveRouterViaPermit2AndWait","SimulationResult","QuoteSwapExactInViaRouterParams","QuoteSwapExactOutViaRouterParams","SwapExactInQuote","SwapExactOutQuote","quoteSwapExactInViaRouter","Promise","quoteSwapExactOutViaRouter","PublicClient","PoolKey","UniswapV4Addresses","QuoteV4ExactInByPoolKeyParams","Partial","V4ExactInQuote","quoteV4ExactInByPoolKey","Promise","Address","PublicClient","PoolKey","ResolvedSwapRoute","ResolveSwapRouteParams","resolveSwapRoute","Promise","TxReceipt","TxResult","SwapExactInViaRouterParams","SwapExactOutViaRouterParams","swapExactInViaRouter","Promise","swapExactInViaRouterAndWait","swapExactOutViaRouter","swapExactOutViaRouterAndWait","Address","UniswapV3Addresses","UNISWAP_V3_ADDRESSES","Record","getUniswapV3Addresses","Partial","Address","Hex","V3_SWAP_EXACT_IN","MSG_SENDER","BuildV3SwapCalldataArgs","encodeV3Path","buildV3SwapExecuteArgs","buildV3SwapExecuteCalldata","Address","PublicClient","UniswapV3Addresses","QuoteV3ExactInParams","Partial","V3ExactInQuote","quoteV3ExactIn","Promise"],"sources":["../../src/uniswap/v4/router/encodeSwap.d.ts","../../src/uniswap/v4/router/errors.d.ts","../../src/uniswap/v4/router/permit2.d.ts","../../src/uniswap/v4/router/quote.d.ts","../../src/uniswap/v4/router/quoteByPoolKey.d.ts","../../src/uniswap/v4/router/resolvePoolKey.d.ts","../../src/uniswap/v4/router/swap.d.ts","../../src/uniswap/v3/addresses.d.ts","../../src/uniswap/v3/router/encodeSwap.d.ts","../../src/uniswap/v3/router/quote.d.ts"],"sourcesContent":null,"mappings":";;;;;;;;;;AA+DgBkF,cApCK/E,OAAAA,GAoCL+E,EAAAA;;AAEE,cApCG9E,oBAAAA,GAoCH,CAAA;;cAlCGC,UAAAA;;cAEAC,QAAAA;;;;cAIAE,qBAAAA;;cAEAC,KAAAA;AAsCrB;;;AACoBkE,UAnCHjE,uBAAAA,CAmCGiE;EAAG;EAAc,OAAA,EAjCxBrB,OAiCwB;;;;;;;EASb1C;EAA0B,OAAA,EAlCrCsE,OAkCqC;EAAA;EAA8B,QACtEP,EAjCIO,OAiCJP;EAAG;;;;AAMb;;;EAEoB,SAQPO,CAAAA,EAzCGA,OAyCHA;EAAO;EAEC,QAQNA,CAAAA,EAjDAP,GAiDAO;;AAEG;;;;;;;;;;iBAvCMvE,sBAAAA,OAA6BD;EAmD7BI,IAAAA,EAAAA,SAAAA,CAlDJ6D,GAkDI7D,EAAAA,SAlDU6D,GAkDoB,EAAA,EAAA,MAAA,CAAA;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AAA,EQlC4BA,ORkC5B,CAAA,EQlCsCP,GRkCtC;;;AACrC;;iBQ9BWK,sBAAAA,OAA6BF;kBACjCH,cAAcA;ERmCjB9D,KAAAA,EAAAA,MAAAA;CAA+B;;;;;AAsBjC8D,iBQlDSM,0BAAAA,CRkDTN,IAAAA,EQlD0CG,uBRkD1CH,CAAAA,EAAAA;EAAG,IAAA,EQjDRA,GRiDQ;;;;;;US9GDU,oBAAAA;UACLF;EToBShF,OAAAA,EAAAA,MAAO;WSlBf+E;EToBQ9E,QAAAA,ESnBP8E,OTmBO9E;;EAEAC,QAAAA,EAAAA,MAAU;;EAEVC,WAAQ,EAAA,MAAA;;EAIRE,SAAAA,CAAAA,ESrBL8E,OTqBK9E,CSrBG4E,kBTqBkB,CAAA;;AAErB3E,USrBJ8E,cAAAA,CTqBS;;;;AAI1B;;;;;;AAsBeZ,iBSrCSa,cAAAA,CTqCTb,MAAAA,ESrCgCU,oBTqChCV,CAAAA,ESrCuDc,OTqCvDd,CSrC+DY,cTqC/DZ,GAAAA,IAAAA,CAAAA"}
|
package/dist/uniswap/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { PanopticError } from "../position-
|
|
2
|
-
import
|
|
3
|
-
import "../writes-
|
|
1
|
+
import { PanopticError } from "../position-B7cJsaOz.js";
|
|
2
|
+
import "../greeks-GysWXct-.js";
|
|
3
|
+
import "../writes-GvVYh9PQ.js";
|
|
4
|
+
import { AmountExceedsUint128Error, InvalidSwapTokenError, MissingSweepRecipientError, PERMIT2_ADDRESS, QuoterUnavailableError, SETTLE_ALL, SWAP_EXACT_IN_SINGLE, SWAP_EXACT_OUT_SINGLE, SWEEP, TAKE_ALL, UNISWAP_V4_ADDRESSES, UnsupportedChainError, V4_SWAP, approveErc20ForPermit2, approveErc20ForPermit2AndWait, approveRouterViaPermit2, approveRouterViaPermit2AndWait, buildV4ExactOutSwapExecuteArgs, buildV4ExactOutSwapExecuteCalldata, buildV4SwapExecuteArgs, buildV4SwapExecuteCalldata, checkRouterApproval, getUniswapV4Addresses, quoteSwapExactInViaRouter, quoteSwapExactOutViaRouter, quoteV4ExactInByPoolKey, resolveSwapRoute, swapExactInViaRouter, swapExactInViaRouterAndWait, swapExactOutViaRouter, swapExactOutViaRouterAndWait, universalRouterAbi } from "../router-CFs84CaF.js";
|
|
4
5
|
import { BaseError, ContractFunctionRevertedError, encodeAbiParameters, encodeFunctionData, encodePacked, zeroAddress } from "viem";
|
|
5
6
|
|
|
6
7
|
//#region src/uniswap/v3/addresses.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["UNISWAP_V3_ADDRESSES: Record<number, UniswapV3Addresses>","chainId: number | bigint","overrides?: Partial<UniswapV3Addresses>","MSG_SENDER: Address","UINT128_MAX","amount: bigint","tokenIn: Address","fee: bigint","tokenOut: Address","args: BuildV3SwapCalldataArgs","params: QuoteV3ExactInParams","err: unknown"],"sources":["../../src/uniswap/v3/addresses.ts","../../src/uniswap/v3/router/encodeSwap.ts","../../src/uniswap/v3/abis/quoterV2.ts","../../src/uniswap/v3/router/quote.ts"],"sourcesContent":["/**\n * Per-chain Uniswap v3 addresses needed for spot quoting via the Universal\n * Router. The Universal Router itself is shared with v4 (see\n * `uniswap/v4/addresses`); only the v3 QuoterV2 is specific to v3.\n *\n * v1 supports mainnet only; other chains throw {@link UnsupportedChainError}\n * unless the address is supplied via overrides (fork tests / new chains).\n *\n * @module uniswap/v3/addresses\n */\n\nimport type { Address } from 'viem'\n\nimport { UnsupportedChainError } from '../v4/router/errors'\n\nexport interface UniswapV3Addresses {\n /** Uniswap v3 QuoterV2 — `quoteExactInputSingle` (revert/staticcall-based). */\n quoterV2: Address\n}\n\n/**\n * Verified Uniswap v3 QuoterV2 addresses keyed by chainId. Add a chain only\n * after verifying against the canonical Uniswap v3 deployment listing.\n */\nexport const UNISWAP_V3_ADDRESSES: Record<number, UniswapV3Addresses> = {\n // Ethereum mainnet\n 1: { quoterV2: '0x61fFE014bA17989E743c5F6cB21bF9697530B21e' },\n}\n\n/**\n * Resolve Uniswap v3 addresses for a chain, applying optional overrides.\n *\n * @throws {UnsupportedChainError} when the chain is not listed and overrides do\n * not supply every required address.\n */\nexport function getUniswapV3Addresses(\n chainId: number | bigint,\n overrides?: Partial<UniswapV3Addresses>,\n): UniswapV3Addresses {\n const id = Number(chainId)\n const base = UNISWAP_V3_ADDRESSES[id]\n const merged = { ...base, ...overrides }\n if (!merged.quoterV2) {\n throw new UnsupportedChainError(BigInt(id))\n }\n return merged as UniswapV3Addresses\n}\n","/**\n * Pure calldata builder for an exact-in single-hop swap through a Uniswap **v3**\n * pool via the Universal Router.\n *\n * Opcodes verified against `@uniswap/universal-router` `Commands.sol`:\n * - Universal Router command `V3_SWAP_EXACT_IN = 0x00`.\n *\n * The v3 command input is (unlike the v4 action list) a single flat tuple:\n * `(address recipient, uint256 amountIn, uint256 amountOutMinimum,\n * bytes path, bool payerIsUser)`\n * where:\n * - `recipient` is an EXPLICIT field. We encode the Universal Router sentinel\n * `MSG_SENDER = address(1)`, which the router maps to the `execute` caller —\n * so the output is delivered to the caller (e.g. a Safe) with no literal\n * address in the calldata to redirect.\n * - `path` is `abi.encodePacked(tokenIn, fee (uint24), tokenOut)` for a single\n * hop (43 bytes). The direction lives in the path ordering, not a bool.\n * - `payerIsUser = true`: the router pulls `tokenIn` from the caller via Permit2.\n *\n * ERC20-only: native ETH is intentionally unsupported here (the native paths\n * need WRAP/UNWRAP/SWEEP commands with explicit recipients).\n *\n * @module uniswap/v3/router/encodeSwap\n */\n\nimport type { Address, Hex } from 'viem'\nimport { encodeAbiParameters, encodeFunctionData, encodePacked, zeroAddress } from 'viem'\n\nimport { PanopticError } from '../../../panoptic/v2/errors'\nimport { universalRouterAbi } from '../../v4/abis/universalRouter'\nimport { AmountExceedsUint128Error } from '../../v4/router/errors'\n\n/** Universal Router command byte for a v3 exact-in swap. */\nexport const V3_SWAP_EXACT_IN = 0x00\n\n/**\n * Universal Router recipient sentinel: the router maps `address(1)` to\n * `msg.sender` (the `execute` caller). Uniswap `Constants.MSG_SENDER`.\n */\nexport const MSG_SENDER: Address = '0x0000000000000000000000000000000000000001'\n\nconst UINT128_MAX = (1n << 128n) - 1n\n\nconst v3ExactInInputAbi = [\n { name: 'recipient', type: 'address' },\n { name: 'amountIn', type: 'uint256' },\n { name: 'amountOutMinimum', type: 'uint256' },\n { name: 'path', type: 'bytes' },\n { name: 'payerIsUser', type: 'bool' },\n] as const\n\nfunction assertUint128(amount: bigint): void {\n if (amount < 0n || amount > UINT128_MAX) {\n throw new AmountExceedsUint128Error(amount)\n }\n}\n\n/** Arguments for {@link buildV3SwapExecuteCalldata}. */\nexport interface BuildV3SwapCalldataArgs {\n /** Input token (funds pulled from the caller via Permit2). */\n tokenIn: Address\n /** Output token. */\n tokenOut: Address\n /** v3 pool fee tier (e.g. 500, 3000). */\n fee: bigint\n /** Exact input amount (uint128). */\n amountIn: bigint\n /** Minimum acceptable output (uint128). */\n amountOutMinimum: bigint\n /**\n * Absolute deadline (unix seconds) — the `execute(commands, inputs, deadline)`\n * argument, enforced by the Universal Router.\n */\n deadline: bigint\n}\n\n/**\n * Encode the packed v3 single-hop path `tokenIn ++ fee(uint24) ++ tokenOut`.\n */\nexport function encodeV3Path(tokenIn: Address, fee: bigint, tokenOut: Address): Hex {\n if (fee < 0n || fee > 0xffffffn) {\n throw new PanopticError(`v3 fee ${fee} exceeds uint24`)\n }\n return encodePacked(['address', 'uint24', 'address'], [tokenIn, Number(fee), tokenOut])\n}\n\n/**\n * Build the typed `execute(...)` args for an exact-in single-hop v3 swap whose\n * output is delivered to the `execute` caller (recipient = MSG_SENDER).\n */\nexport function buildV3SwapExecuteArgs(args: BuildV3SwapCalldataArgs): {\n args: readonly [Hex, readonly Hex[], bigint]\n value: bigint\n} {\n const { tokenIn, tokenOut, fee, amountIn, amountOutMinimum, deadline } = args\n\n if (tokenIn === zeroAddress || tokenOut === zeroAddress) {\n throw new PanopticError('native ETH is not supported by the v3 exact-in router builder')\n }\n assertUint128(amountIn)\n assertUint128(amountOutMinimum)\n\n const path = encodeV3Path(tokenIn, fee, tokenOut)\n const input = encodeAbiParameters(v3ExactInInputAbi, [\n MSG_SENDER,\n amountIn,\n amountOutMinimum,\n path,\n true, // payerIsUser: pull tokenIn from the caller via Permit2\n ])\n\n const commands = encodePacked(['uint8'], [V3_SWAP_EXACT_IN])\n return { args: [commands, [input], deadline] as const, value: 0n }\n}\n\n/**\n * Build the `execute(commands, inputs, deadline)` calldata for an exact-in\n * single-hop v3 swap.\n */\nexport function buildV3SwapExecuteCalldata(args: BuildV3SwapCalldataArgs): {\n data: Hex\n value: bigint\n} {\n const { args: executeArgs, value } = buildV3SwapExecuteArgs(args)\n const data = encodeFunctionData({\n abi: universalRouterAbi,\n functionName: 'execute',\n args: executeArgs,\n })\n return { data, value }\n}\n","/**\n * Minimal Uniswap v3 QuoterV2 ABI (`quoteExactInputSingle`).\n *\n * QuoterV2 is revert/staticcall-based (nonpayable but intended for `eth_call` /\n * `simulateContract`), so it must be simulated, not read.\n * @module uniswap/v3/abis/quoterV2\n */\n\nexport const quoterV2Abi = [\n {\n type: 'function',\n name: 'quoteExactInputSingle',\n stateMutability: 'nonpayable',\n inputs: [\n {\n name: 'params',\n type: 'tuple',\n components: [\n { name: 'tokenIn', type: 'address' },\n { name: 'tokenOut', type: 'address' },\n { name: 'amountIn', type: 'uint256' },\n { name: 'fee', type: 'uint24' },\n { name: 'sqrtPriceLimitX96', type: 'uint160' },\n ],\n },\n ],\n outputs: [\n { name: 'amountOut', type: 'uint256' },\n { name: 'sqrtPriceX96After', type: 'uint160' },\n { name: 'initializedTicksCrossed', type: 'uint32' },\n { name: 'gasEstimate', type: 'uint256' },\n ],\n },\n] as const\n","/**\n * Quote an exact-in single-hop swap against a Uniswap v3 pool via QuoterV2.\n * @module uniswap/v3/router/quote\n */\n\nimport type { Address, PublicClient } from 'viem'\nimport { BaseError, ContractFunctionRevertedError } from 'viem'\n\nimport { PanopticError } from '../../../panoptic/v2/errors'\nimport { quoterV2Abi } from '../abis/quoterV2'\nimport { type UniswapV3Addresses, getUniswapV3Addresses } from '../addresses'\n\nconst BPS_DENOMINATOR = 10_000n\nconst UINT128_MAX = (1n << 128n) - 1n\n\nexport interface QuoteV3ExactInParams {\n client: PublicClient\n chainId: bigint\n tokenIn: Address\n tokenOut: Address\n fee: bigint\n amountIn: bigint\n /** Slippage tolerance in bps, used to compute `amountOutMinimum`. */\n slippageBps: bigint\n blockNumber?: bigint\n addresses?: Partial<UniswapV3Addresses>\n}\n\nexport interface V3ExactInQuote {\n amountOut: bigint\n amountOutMinimum: bigint\n gasEstimate: bigint\n}\n\n/**\n * Quote an exact-in v3 swap. Returns `null` when the quote reverts (e.g. the\n * pool does not exist / has no liquidity) so callers can skip that pool when\n * ranking venues, rather than aborting the whole cycle.\n */\nexport async function quoteV3ExactIn(params: QuoteV3ExactInParams): Promise<V3ExactInQuote | null> {\n const { client, chainId, tokenIn, tokenOut, fee, amountIn, slippageBps, blockNumber } = params\n if (amountIn < 0n || amountIn > UINT128_MAX) {\n throw new PanopticError(`amountIn ${amountIn} exceeds uint128 maximum`)\n }\n if (slippageBps < 0n || slippageBps > BPS_DENOMINATOR) {\n throw new PanopticError(`invalid slippageBps ${slippageBps}, must be 0..10000`)\n }\n\n const { quoterV2 } = getUniswapV3Addresses(chainId, params.addresses)\n\n try {\n const { result } = await client.simulateContract({\n address: quoterV2,\n abi: quoterV2Abi,\n functionName: 'quoteExactInputSingle',\n blockNumber,\n args: [{ tokenIn, tokenOut, amountIn, fee: Number(fee), sqrtPriceLimitX96: 0n }],\n })\n const [amountOut, , , gasEstimate] = result\n const amountOutMinimum = (amountOut * (BPS_DENOMINATOR - slippageBps)) / BPS_DENOMINATOR\n return { amountOut, amountOutMinimum, gasEstimate }\n } catch (err) {\n if (isRevert(err)) return null\n // Transport/RPC/timeout errors are NOT \"no liquidity\" — rethrow so routing\n // doesn't silently treat an unreachable node as an empty pool.\n throw err\n }\n}\n\n/** True only for genuine contract reverts (missing pool / no liquidity). */\nfunction isRevert(err: unknown): boolean {\n return (\n err instanceof BaseError &&\n err.walk((e) => e instanceof ContractFunctionRevertedError) instanceof\n ContractFunctionRevertedError\n )\n}\n"],"mappings":";;;;;;;;;;AAwBA,MAAaA,uBAA2D,EAEtE,GAAG,EAAE,UAAU,6CAA8C,EAC9D;;;;;;;AAQD,SAAgB,sBACdC,SACAC,WACoB;CACpB,MAAM,KAAK,OAAO,QAAQ;CAC1B,MAAM,OAAO,qBAAqB;CAClC,MAAM,SAAS;EAAE,GAAG;EAAM,GAAG;CAAW;AACxC,MAAK,OAAO,SACV,OAAM,IAAI,sBAAsB,OAAO,GAAG;AAE5C,QAAO;AACR;;;;;ACbD,MAAa,mBAAmB;;;;;AAMhC,MAAaC,aAAsB;AAEnC,MAAMC,iBAAe,MAAM,QAAQ;AAEnC,MAAM,oBAAoB;CACxB;EAAE,MAAM;EAAa,MAAM;CAAW;CACtC;EAAE,MAAM;EAAY,MAAM;CAAW;CACrC;EAAE,MAAM;EAAoB,MAAM;CAAW;CAC7C;EAAE,MAAM;EAAQ,MAAM;CAAS;CAC/B;EAAE,MAAM;EAAe,MAAM;CAAQ;AACtC;AAED,SAAS,cAAcC,QAAsB;AAC3C,KAAI,SAAS,MAAM,SAASD,cAC1B,OAAM,IAAI,0BAA0B;AAEvC;;;;AAwBD,SAAgB,aAAaE,SAAkBC,KAAaC,UAAwB;AAClF,KAAI,MAAM,MAAM,MAAM,UACpB,OAAM,IAAI,eAAe,SAAS,IAAI;AAExC,QAAO,aAAa;EAAC;EAAW;EAAU;CAAU,GAAE;EAAC;EAAS,OAAO,IAAI;EAAE;CAAS,EAAC;AACxF;;;;;AAMD,SAAgB,uBAAuBC,MAGrC;CACA,MAAM,EAAE,SAAS,UAAU,KAAK,UAAU,kBAAkB,UAAU,GAAG;AAEzE,KAAI,YAAY,eAAe,aAAa,YAC1C,OAAM,IAAI,cAAc;AAE1B,eAAc,SAAS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AAM,cAAc,gBACpC,OAAM,IAAI,eAAe,sBAAsB,YAAY;CAG7D,MAAM,EAAE,UAAU,GAAG,sBAAsB,SAAS,OAAO,UAAU;AAErE,KAAI;EACF,MAAM,EAAE,QAAQ,GAAG,MAAM,OAAO,iBAAiB;GAC/C,SAAS;GACT,KAAK;GACL,cAAc;GACd;GACA,MAAM,CAAC;IAAE;IAAS;IAAU;IAAU,KAAK,OAAO,IAAI;IAAE,mBAAmB;GAAI,CAAC;EACjF,EAAC;EACF,MAAM,CAAC,eAAe,YAAY,GAAG;EACrC,MAAM,mBAAoB,aAAa,kBAAkB,eAAgB;AACzE,SAAO;GAAE;GAAW;GAAkB;EAAa;CACpD,SAAQ,KAAK;AACZ,MAAI,SAAS,IAAI,CAAE,QAAO;AAG1B,QAAM;CACP;AACF;;AAGD,SAAS,SAASC,KAAuB;AACvC,QACE,eAAe,aACf,IAAI,KAAK,CAAC,MAAM,aAAa,8BAA8B,YACzD;AAEL"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["UNISWAP_V3_ADDRESSES: Record<number, UniswapV3Addresses>","chainId: number | bigint","overrides?: Partial<UniswapV3Addresses>","MSG_SENDER: Address","UINT128_MAX","amount: bigint","tokenIn: Address","fee: bigint","tokenOut: Address","args: BuildV3SwapCalldataArgs","params: QuoteV3ExactInParams","err: unknown"],"sources":["../../src/uniswap/v3/addresses.ts","../../src/uniswap/v3/router/encodeSwap.ts","../../src/uniswap/v3/abis/quoterV2.ts","../../src/uniswap/v3/router/quote.ts"],"sourcesContent":["/**\n * Per-chain Uniswap v3 addresses needed for spot quoting via the Universal\n * Router. The Universal Router itself is shared with v4 (see\n * `uniswap/v4/addresses`); only the v3 QuoterV2 is specific to v3.\n *\n * v1 supports mainnet only; other chains throw {@link UnsupportedChainError}\n * unless the address is supplied via overrides (fork tests / new chains).\n *\n * @module uniswap/v3/addresses\n */\n\nimport type { Address } from 'viem'\n\nimport { UnsupportedChainError } from '../v4/router/errors'\n\nexport interface UniswapV3Addresses {\n /** Uniswap v3 QuoterV2 — `quoteExactInputSingle` (revert/staticcall-based). */\n quoterV2: Address\n}\n\n/**\n * Verified Uniswap v3 QuoterV2 addresses keyed by chainId. Add a chain only\n * after verifying against the canonical Uniswap v3 deployment listing.\n */\nexport const UNISWAP_V3_ADDRESSES: Record<number, UniswapV3Addresses> = {\n // Ethereum mainnet\n 1: { quoterV2: '0x61fFE014bA17989E743c5F6cB21bF9697530B21e' },\n}\n\n/**\n * Resolve Uniswap v3 addresses for a chain, applying optional overrides.\n *\n * @throws {UnsupportedChainError} when the chain is not listed and overrides do\n * not supply every required address.\n */\nexport function getUniswapV3Addresses(\n chainId: number | bigint,\n overrides?: Partial<UniswapV3Addresses>,\n): UniswapV3Addresses {\n const id = Number(chainId)\n const base = UNISWAP_V3_ADDRESSES[id]\n const merged = { ...base, ...overrides }\n if (!merged.quoterV2) {\n throw new UnsupportedChainError(BigInt(id))\n }\n return merged as UniswapV3Addresses\n}\n","/**\n * Pure calldata builder for an exact-in single-hop swap through a Uniswap **v3**\n * pool via the Universal Router.\n *\n * Opcodes verified against `@uniswap/universal-router` `Commands.sol`:\n * - Universal Router command `V3_SWAP_EXACT_IN = 0x00`.\n *\n * The v3 command input is (unlike the v4 action list) a single flat tuple:\n * `(address recipient, uint256 amountIn, uint256 amountOutMinimum,\n * bytes path, bool payerIsUser)`\n * where:\n * - `recipient` is an EXPLICIT field. We encode the Universal Router sentinel\n * `MSG_SENDER = address(1)`, which the router maps to the `execute` caller —\n * so the output is delivered to the caller (e.g. a Safe) with no literal\n * address in the calldata to redirect.\n * - `path` is `abi.encodePacked(tokenIn, fee (uint24), tokenOut)` for a single\n * hop (43 bytes). The direction lives in the path ordering, not a bool.\n * - `payerIsUser = true`: the router pulls `tokenIn` from the caller via Permit2.\n *\n * ERC20-only: native ETH is intentionally unsupported here (the native paths\n * need WRAP/UNWRAP/SWEEP commands with explicit recipients).\n *\n * @module uniswap/v3/router/encodeSwap\n */\n\nimport type { Address, Hex } from 'viem'\nimport { encodeAbiParameters, encodeFunctionData, encodePacked, zeroAddress } from 'viem'\n\nimport { PanopticError } from '../../../panoptic/v2/errors'\nimport { universalRouterAbi } from '../../v4/abis/universalRouter'\nimport { AmountExceedsUint128Error } from '../../v4/router/errors'\n\n/** Universal Router command byte for a v3 exact-in swap. */\nexport const V3_SWAP_EXACT_IN = 0x00\n\n/**\n * Universal Router recipient sentinel: the router maps `address(1)` to\n * `msg.sender` (the `execute` caller). Uniswap `Constants.MSG_SENDER`.\n */\nexport const MSG_SENDER: Address = '0x0000000000000000000000000000000000000001'\n\nconst UINT128_MAX = (1n << 128n) - 1n\n\nconst v3ExactInInputAbi = [\n { name: 'recipient', type: 'address' },\n { name: 'amountIn', type: 'uint256' },\n { name: 'amountOutMinimum', type: 'uint256' },\n { name: 'path', type: 'bytes' },\n { name: 'payerIsUser', type: 'bool' },\n] as const\n\nfunction assertUint128(amount: bigint): void {\n if (amount < 0n || amount > UINT128_MAX) {\n throw new AmountExceedsUint128Error(amount)\n }\n}\n\n/** Arguments for {@link buildV3SwapExecuteCalldata}. */\nexport interface BuildV3SwapCalldataArgs {\n /** Input token (funds pulled from the caller via Permit2). */\n tokenIn: Address\n /** Output token. */\n tokenOut: Address\n /** v3 pool fee tier (e.g. 500, 3000). */\n fee: bigint\n /** Exact input amount (uint128). */\n amountIn: bigint\n /** Minimum acceptable output (uint128). */\n amountOutMinimum: bigint\n /**\n * Absolute deadline (unix seconds) — the `execute(commands, inputs, deadline)`\n * argument, enforced by the Universal Router.\n */\n deadline: bigint\n}\n\n/**\n * Encode the packed v3 single-hop path `tokenIn ++ fee(uint24) ++ tokenOut`.\n */\nexport function encodeV3Path(tokenIn: Address, fee: bigint, tokenOut: Address): Hex {\n if (fee < 0n || fee > 0xffffffn) {\n throw new PanopticError(`v3 fee ${fee} exceeds uint24`)\n }\n return encodePacked(['address', 'uint24', 'address'], [tokenIn, Number(fee), tokenOut])\n}\n\n/**\n * Build the typed `execute(...)` args for an exact-in single-hop v3 swap whose\n * output is delivered to the `execute` caller (recipient = MSG_SENDER).\n */\nexport function buildV3SwapExecuteArgs(args: BuildV3SwapCalldataArgs): {\n args: readonly [Hex, readonly Hex[], bigint]\n value: bigint\n} {\n const { tokenIn, tokenOut, fee, amountIn, amountOutMinimum, deadline } = args\n\n if (tokenIn === zeroAddress || tokenOut === zeroAddress) {\n throw new PanopticError('native ETH is not supported by the v3 exact-in router builder')\n }\n assertUint128(amountIn)\n assertUint128(amountOutMinimum)\n\n const path = encodeV3Path(tokenIn, fee, tokenOut)\n const input = encodeAbiParameters(v3ExactInInputAbi, [\n MSG_SENDER,\n amountIn,\n amountOutMinimum,\n path,\n true, // payerIsUser: pull tokenIn from the caller via Permit2\n ])\n\n const commands = encodePacked(['uint8'], [V3_SWAP_EXACT_IN])\n return { args: [commands, [input], deadline] as const, value: 0n }\n}\n\n/**\n * Build the `execute(commands, inputs, deadline)` calldata for an exact-in\n * single-hop v3 swap.\n */\nexport function buildV3SwapExecuteCalldata(args: BuildV3SwapCalldataArgs): {\n data: Hex\n value: bigint\n} {\n const { args: executeArgs, value } = buildV3SwapExecuteArgs(args)\n const data = encodeFunctionData({\n abi: universalRouterAbi,\n functionName: 'execute',\n args: executeArgs,\n })\n return { data, value }\n}\n","/**\n * Minimal Uniswap v3 QuoterV2 ABI (`quoteExactInputSingle`).\n *\n * QuoterV2 is revert/staticcall-based (nonpayable but intended for `eth_call` /\n * `simulateContract`), so it must be simulated, not read.\n * @module uniswap/v3/abis/quoterV2\n */\n\nexport const quoterV2Abi = [\n {\n type: 'function',\n name: 'quoteExactInputSingle',\n stateMutability: 'nonpayable',\n inputs: [\n {\n name: 'params',\n type: 'tuple',\n components: [\n { name: 'tokenIn', type: 'address' },\n { name: 'tokenOut', type: 'address' },\n { name: 'amountIn', type: 'uint256' },\n { name: 'fee', type: 'uint24' },\n { name: 'sqrtPriceLimitX96', type: 'uint160' },\n ],\n },\n ],\n outputs: [\n { name: 'amountOut', type: 'uint256' },\n { name: 'sqrtPriceX96After', type: 'uint160' },\n { name: 'initializedTicksCrossed', type: 'uint32' },\n { name: 'gasEstimate', type: 'uint256' },\n ],\n },\n] as const\n","/**\n * Quote an exact-in single-hop swap against a Uniswap v3 pool via QuoterV2.\n * @module uniswap/v3/router/quote\n */\n\nimport type { Address, PublicClient } from 'viem'\nimport { BaseError, ContractFunctionRevertedError } from 'viem'\n\nimport { PanopticError } from '../../../panoptic/v2/errors'\nimport { quoterV2Abi } from '../abis/quoterV2'\nimport { type UniswapV3Addresses, getUniswapV3Addresses } from '../addresses'\n\nconst BPS_DENOMINATOR = 10_000n\nconst UINT128_MAX = (1n << 128n) - 1n\n\nexport interface QuoteV3ExactInParams {\n client: PublicClient\n chainId: bigint\n tokenIn: Address\n tokenOut: Address\n fee: bigint\n amountIn: bigint\n /** Slippage tolerance in bps, used to compute `amountOutMinimum`. */\n slippageBps: bigint\n blockNumber?: bigint\n addresses?: Partial<UniswapV3Addresses>\n}\n\nexport interface V3ExactInQuote {\n amountOut: bigint\n amountOutMinimum: bigint\n gasEstimate: bigint\n}\n\n/**\n * Quote an exact-in v3 swap. Returns `null` when the quote reverts (e.g. the\n * pool does not exist / has no liquidity) so callers can skip that pool when\n * ranking venues, rather than aborting the whole cycle.\n */\nexport async function quoteV3ExactIn(params: QuoteV3ExactInParams): Promise<V3ExactInQuote | null> {\n const { client, chainId, tokenIn, tokenOut, fee, amountIn, slippageBps, blockNumber } = params\n if (amountIn < 0n || amountIn > UINT128_MAX) {\n throw new PanopticError(`amountIn ${amountIn} exceeds uint128 maximum`)\n }\n if (slippageBps < 0n || slippageBps > BPS_DENOMINATOR) {\n throw new PanopticError(`invalid slippageBps ${slippageBps}, must be 0..10000`)\n }\n\n const { quoterV2 } = getUniswapV3Addresses(chainId, params.addresses)\n\n try {\n const { result } = await client.simulateContract({\n address: quoterV2,\n abi: quoterV2Abi,\n functionName: 'quoteExactInputSingle',\n blockNumber,\n args: [{ tokenIn, tokenOut, amountIn, fee: Number(fee), sqrtPriceLimitX96: 0n }],\n })\n const [amountOut, , , gasEstimate] = result\n const amountOutMinimum = (amountOut * (BPS_DENOMINATOR - slippageBps)) / BPS_DENOMINATOR\n return { amountOut, amountOutMinimum, gasEstimate }\n } catch (err) {\n if (isRevert(err)) return null\n // Transport/RPC/timeout errors are NOT \"no liquidity\" — rethrow so routing\n // doesn't silently treat an unreachable node as an empty pool.\n throw err\n }\n}\n\n/** True only for genuine contract reverts (missing pool / no liquidity). */\nfunction isRevert(err: unknown): boolean {\n return (\n err instanceof BaseError &&\n err.walk((e) => e instanceof ContractFunctionRevertedError) instanceof\n ContractFunctionRevertedError\n )\n}\n"],"mappings":";;;;;;;;;;;AAwBA,MAAaA,uBAA2D,EAEtE,GAAG,EAAE,UAAU,6CAA8C,EAC9D;;;;;;;AAQD,SAAgB,sBACdC,SACAC,WACoB;CACpB,MAAM,KAAK,OAAO,QAAQ;CAC1B,MAAM,OAAO,qBAAqB;CAClC,MAAM,SAAS;EAAE,GAAG;EAAM,GAAG;CAAW;AACxC,MAAK,OAAO,SACV,OAAM,IAAI,sBAAsB,OAAO,GAAG;AAE5C,QAAO;AACR;;;;;ACbD,MAAa,mBAAmB;;;;;AAMhC,MAAaC,aAAsB;AAEnC,MAAMC,iBAAe,MAAM,QAAQ;AAEnC,MAAM,oBAAoB;CACxB;EAAE,MAAM;EAAa,MAAM;CAAW;CACtC;EAAE,MAAM;EAAY,MAAM;CAAW;CACrC;EAAE,MAAM;EAAoB,MAAM;CAAW;CAC7C;EAAE,MAAM;EAAQ,MAAM;CAAS;CAC/B;EAAE,MAAM;EAAe,MAAM;CAAQ;AACtC;AAED,SAAS,cAAcC,QAAsB;AAC3C,KAAI,SAAS,MAAM,SAASD,cAC1B,OAAM,IAAI,0BAA0B;AAEvC;;;;AAwBD,SAAgB,aAAaE,SAAkBC,KAAaC,UAAwB;AAClF,KAAI,MAAM,MAAM,MAAM,UACpB,OAAM,IAAI,eAAe,SAAS,IAAI;AAExC,QAAO,aAAa;EA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BD,MAAM,kBAAkB;AACxB,MAAM,eAAe,MAAM,QAAQ;;;;;;AA0BnC,eAAsB,eAAeC,QAA8D;CACjG,MAAM,EAAE,QAAQ,SAAS,SAAS,UAAU,KAAK,UAAU,aAAa,aAAa,GAAG;AACxF,KAAI,WAAW,MAAM,WAAW,YAC9B,OAAM,IAAI,eAAe,WAAW,SAAS;AAE/C,KAAI,cAAc,MAAM,cAAc,gBACpC,OAAM,IAAI,eAAe,sBAAsB,YAAY;CAG7D,MAAM,EAAE,UAAU,GAAG,sBAAsB,SAAS,OAAO,UAAU;AAErE,KAAI;EACF,MAAM,EAAE,QAAQ,GAAG,MAAM,OAAO,iBAAiB;GAC/C,SAAS;GACT,KAAK;GACL,cAAc;GACd;GACA,MAAM,CAAC;IAAE;IAAS;IAAU;IAAU,KAAK,OAAO,IAAI;IAAE,mBAAmB;GAAI,CAAC;EACjF,EAAC;EACF,MAAM,CAAC,eAAe,YAAY,GAAG;EACrC,MAAM,mBAAoB,aAAa,kBAAkB,eAAgB;AACzE,SAAO;GAAE;GAAW;GAAkB;EAAa;CACpD,SAAQ,KAAK;AACZ,MAAI,SAAS,IAAI,CAAE,QAAO;AAG1B,QAAM;CACP;AACF;;AAGD,SAAS,SAASC,KAAuB;AACvC,QACE,eAAe,aACf,IAAI,KAAK,CAAC,MAAM,aAAa,8BAA8B,YACzD;AAEL"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { BatchValidationError, DEFAULT_VEGOID, InputListFailError, InvalidTickLimitsError, InvalidTokenIdParameterError, LEG_BITS, LEG_LIMITS, LEG_MASKS, LoanSlotExhaustedError, MaxRetriesExceededError, MissingPositionIdsError, NoLoanPositionsError, OracleRateLimitedError, PanopticError, ProviderLagError,
|
|
1
|
+
import { BatchValidationError, DEFAULT_VEGOID, InputListFailError, InvalidTickLimitsError, InvalidTokenIdParameterError, LEG_BITS, LEG_LIMITS, LEG_MASKS, LoanSlotExhaustedError, MaxRetriesExceededError, MissingPositionIdsError, NoLoanPositionsError, OracleRateLimitedError, PanopticError, ProviderLagError, STRIKE_CONVERSION_FACTOR, SafeModeError, StaleDataError, SwapTokenMismatchError, SyncTimeoutError, TOKEN_ID_BITS, UnhealthyPoolError, collateralTrackerV2Abi, createTxResult, decodeLeftRightUnsigned, getBlockMeta, getPool, getPoolMetadata, getPositions, panopticErrorsAbi, panopticFactoryV3Abi, panopticFactoryV4Abi, panopticPoolV2Abi, parsePanopticError, submitWrite } from "./position-B7cJsaOz.js";
|
|
2
|
+
import { REORG_DEPTH, SCHEMA_VERSION, STORAGE_PREFIX, calculatePositionGreeks, tickLimits } from "./greeks-GysWXct-.js";
|
|
2
3
|
import { decodeFunctionData, decodeFunctionResult, encodeFunctionData, erc20Abi, getAddress, parseAbi, toFunctionSelector } from "viem";
|
|
3
4
|
|
|
4
5
|
//#region src/panoptic/v2/writes/broadcaster.ts
|
|
@@ -4548,4 +4549,4 @@ async function smartRepayAndWait(params) {
|
|
|
4548
4549
|
|
|
4549
4550
|
//#endregion
|
|
4550
4551
|
export { addLegToTokenId, approve, approveAndWait, approvePool, assertCanBurn, assertCanForceExercise, assertCanLiquidate, assertCanMint, assertFresh, assertHealthy, assertTradeable, borrow, borrowAndWait, buildBatchDispatchArgs, buildOpenPositionCalldata, buildUniqueLoan, calculateResyncBlock, cancelTransaction, checkApproval, clearCheckpoint, clearTrackedPositions, closePosition, closePositionAndWait, countLegs, createFileStorage, createMemoryStorage, createNonceManager, createTokenIdBuilder, decodeAllDispatchCalldata, decodeAllLegs, decodeDispatchCalldata, decodeLeg, decodePoolId, decodeTickSpacing as decodeTickSpacing$1, decodeTokenId, decodeVegoid, deployNewPool, deployNewPoolAndWait, deposit, depositAndWait, detectReorg, dispatch, dispatchAndWait, encodeLeg, encodePoolId, encodeV4PoolId, executeBatchDispatch, executeBatchDispatchAndWait, forceExercise, forceExerciseAndWait, getAssetIndex, getClosedPositionsKey, getOpenPositionIds, getPendingPositionsKey, getPoolMetaKey, getPoolPrefix, getPositionMetaKey, getPositionsKey, getSchemaVersionKey, getSyncCheckpointKey, getTrackedChunksKey, getTrackedPositionIds, hasLoanOrCredit, hasLongLeg, isCredit, isCreditLeg, isGasError, isInputListFailError, isLoan, isLoanLeg, isNonceError, isPositionTracked, isRetryableRpcError, isShortOnly, isSpread, jsonSerializer, liquidate, liquidateAndWait, loadCheckpoint, mint, mintAndWait, openPosition, openPositionAndWait, pokeOracle, pokeOracleAndWait, previewBorrow, previewUnwrap, previewWrap, publicBroadcaster, recoverSnapshot, recoverSnapshotFromTx, redeem, redeemAndWait, repay, repayAndWait, resolveTokenIndex, rollPosition, rollPositionAndWait, saveCheckpoint, selectDispatchForAccount, settleAccumulatedPremia, settleAccumulatedPremiaAndWait, simulateOpenPosition, simulateWithTokenFlow, smartRepay, smartRepayAndWait, speedUpTransaction, supply, supplyAndWait, swapExactIn, swapExactInAndWait, swapExactOut, swapExactOutAndWait, syncPositions, unsupply, unsupplyAndWait, unwrapWeth, unwrapWethAndWait, unwrapXstock, unwrapXstockAndWait, validateBatch, validatePoolId, verifyBlockContinuity, wethWrapAbi, withdraw, withdrawAndWait, withdrawWithPositions, withdrawWithPositionsAndWait, wrapEth, wrapEthAndWait, wrapXstock, wrapXstockAndWait, xstockWrapperAbi };
|
|
4551
|
-
//# sourceMappingURL=writes-
|
|
4552
|
+
//# sourceMappingURL=writes-GvVYh9PQ.js.map
|