@panoptic-eng/sdk 1.0.26 → 1.0.28

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.
Files changed (61) hide show
  1. package/dist/cow/index.d.ts +5 -4
  2. package/dist/cow/index.js +4 -3
  3. package/dist/cow/types.d.ts +2 -2
  4. package/dist/{cow-UR3yv8Wz.js → cow-Boc-39-Y.js} +2 -2
  5. package/dist/{cow-UR3yv8Wz.js.map → cow-Boc-39-Y.js.map} +1 -1
  6. package/dist/greeks-GysWXct-.js +1072 -0
  7. package/dist/greeks-GysWXct-.js.map +1 -0
  8. package/dist/index-B3JZRUNo.d.ts +9084 -0
  9. package/dist/index-B3JZRUNo.d.ts.map +1 -0
  10. package/dist/index-CDCAju5o.d.ts +261 -0
  11. package/dist/index-CDCAju5o.d.ts.map +1 -0
  12. package/dist/{index-CIlr4SNh.d.ts → index-DQS8Luef.d.ts} +4 -4
  13. package/dist/{index-CIlr4SNh.d.ts.map → index-DQS8Luef.d.ts.map} +1 -1
  14. package/dist/index.d.ts +14 -14
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +3 -2
  17. package/dist/index.js.map +1 -1
  18. package/dist/{irm-Dw6fa-DV.js → irm-B0Bgj0z8.js} +4 -3
  19. package/dist/{irm-Dw6fa-DV.js.map → irm-B0Bgj0z8.js.map} +1 -1
  20. package/dist/{irm-CSJX9BsU.d.ts → irm-BNtE1Dmg.d.ts} +2 -2
  21. package/dist/{irm-CSJX9BsU.d.ts.map → irm-BNtE1Dmg.d.ts.map} +1 -1
  22. package/dist/{types-CspUPolV.d.ts → oracle-BnpPVG8V.d.ts} +4 -244
  23. package/dist/oracle-BnpPVG8V.d.ts.map +1 -0
  24. package/dist/panoptic/v2/greeks/index.d.ts +3 -0
  25. package/dist/panoptic/v2/greeks/index.js +3 -0
  26. package/dist/panoptic/v2/index.d.ts +8 -10180
  27. package/dist/panoptic/v2/index.js +6 -11281
  28. package/dist/panoptic/v2/react-public.d.ts +886 -0
  29. package/dist/panoptic/v2/react-public.d.ts.map +1 -0
  30. package/dist/panoptic/v2/react-public.js +3854 -0
  31. package/dist/panoptic/v2/react-public.js.map +1 -0
  32. package/dist/position-Bmd_3nzI.d.ts +199 -0
  33. package/dist/position-Bmd_3nzI.d.ts.map +1 -0
  34. package/dist/{position-GYsTTl71.js → position-R0IGLpQS.js} +3 -1056
  35. package/dist/position-R0IGLpQS.js.map +1 -0
  36. package/dist/{router-DGUQo-8h.js → router-NPhQUNh4.js} +2 -2
  37. package/dist/{router-DGUQo-8h.js.map → router-NPhQUNh4.js.map} +1 -1
  38. package/dist/{simulation-4SzTI-xf.d.ts → simulation-CUqERC5Y.d.ts} +21 -198
  39. package/dist/simulation-CUqERC5Y.d.ts.map +1 -0
  40. package/dist/test/index.d.ts +2 -2
  41. package/dist/test/index.d.ts.map +1 -1
  42. package/dist/{tx-Banz1S18.d.ts → tx-BXXqhBHn.d.ts} +1 -1
  43. package/dist/{tx-Banz1S18.d.ts.map → tx-BXXqhBHn.d.ts.map} +1 -1
  44. package/dist/{types-Bzw_7NJv.d.ts → types-DgWfno7q.d.ts} +2 -2
  45. package/dist/{types-Bzw_7NJv.d.ts.map → types-DgWfno7q.d.ts.map} +1 -1
  46. package/dist/types-VeWdNN0j.d.ts +247 -0
  47. package/dist/types-VeWdNN0j.d.ts.map +1 -0
  48. package/dist/uniswap/index.d.ts +5 -3
  49. package/dist/uniswap/index.d.ts.map +1 -1
  50. package/dist/uniswap/index.js +4 -3
  51. package/dist/uniswap/index.js.map +1 -1
  52. package/dist/v2-CkOo7vW2.js +7438 -0
  53. package/dist/v2-CkOo7vW2.js.map +1 -0
  54. package/dist/{writes-h-IX3XQq.js → writes-Dhzpw0dq.js} +4 -3
  55. package/dist/{writes-h-IX3XQq.js.map → writes-Dhzpw0dq.js.map} +1 -1
  56. package/package.json +9 -1
  57. package/dist/panoptic/v2/index.d.ts.map +0 -1
  58. package/dist/panoptic/v2/index.js.map +0 -1
  59. package/dist/position-GYsTTl71.js.map +0 -1
  60. package/dist/simulation-4SzTI-xf.d.ts.map +0 -1
  61. package/dist/types-CspUPolV.d.ts.map +0 -1
@@ -0,0 +1,199 @@
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
+
194
+ /**
195
+ * Stored pool metadata (immutable fields fetched from chain).
196
+ * Does NOT include poolAddress/chainId as those are storage key components.
197
+ */
198
+ export { BlockMeta, ClosedPosition, LegGreeksParams, Position, PositionGreeks, RealizedPnL, StoredPositionData, TokenIdLeg };
199
+ //# sourceMappingURL=position-Bmd_3nzI.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position-Bmd_3nzI.d.ts","names":["BlockMeta","Address","BlockMeta","TokenIdLeg","Position","LegGreeksParams","PositionGreeks","ClosedPosition","RealizedPnL","StoredPositionData","StoredPoolMeta"],"sources":["../src/panoptic/v2/types/meta.d.ts","../src/panoptic/v2/types/position.d.ts"],"sourcesContent":null,"mappings":";;;;;;;;;;;;;;;;;;;UAQiBE,SAAAA;;;EAAAA;;;;;;;;;;;UCCAC,UAAAA;;EDDAD,KAAAA,EAAAA,MAAS;;;;;;;ECCTC;;;;EAyBAC;EAAQ,MAAA,EAAA,MAAA;EAAA;EAMP,KAEDH,EAAAA,MAAAA;EAAO;EAEJ,SAsBTC,EAAAA,MAAAA;EAAS;;;;AAKpB;;UArCiBE,QAAAA;;EAoDAE,OAAAA,EAAAA,MAAAA;;;;EAWAC,KAAAA,EAzDNN,OAyDMM;EAAc;EAAA,WAIpBN,EA3DMA,OA2DNA;EAAO;EAEM,IAAA,EA3DdE,UA2Dc,EAAA;;;;EA6BPK,sBAAW,EAAA,MAAA;;;;;EAgBXC;;;;;;;;;;;;;SAlFNP;;;;;UAKMG,eAAAA;;OAERF;;;;;;;;;;;;;UAaQG,cAAAA;;;;;;;;;;;UAWAC,cAAAA;;;;SAINN;;eAEMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA6BAO,WAAAA;;;;;;;;;;;;;;;;UAgBAC,kBAAAA;;;;;;QAMPN"}