@kodiak-finance/orderly-ui-positions 2.8.18-rc.1 → 2.8.19-rc.0

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/index.d.mts CHANGED
@@ -183,6 +183,106 @@ declare const MobileLiquidation: FC<LiquidationState & {
183
183
  onExport?: () => void;
184
184
  }>;
185
185
 
186
+ interface UseCloseAllPositionsScriptOptions {
187
+ symbol?: string;
188
+ onSuccess?: () => void;
189
+ }
190
+ declare const useCloseAllPositionsScript: (options?: UseCloseAllPositionsScriptOptions) => {
191
+ onCloseAll: () => void;
192
+ hasOpenPositions: boolean;
193
+ isClosing: boolean;
194
+ openPositionsCount: number;
195
+ symbol: string | undefined;
196
+ };
197
+ type CloseAllPositionsState = ReturnType<typeof useCloseAllPositionsScript>;
198
+
199
+ type CloseAllPositionsProps = CloseAllPositionsState & {
200
+ className?: string;
201
+ style?: React$1.CSSProperties;
202
+ };
203
+ declare const CloseAllPositions: FC<CloseAllPositionsProps>;
204
+
205
+ type CloseAllPositionsWidgetProps = Pick<CloseAllPositionsProps, "className" | "style"> & {
206
+ symbol?: string;
207
+ onSuccess?: () => void;
208
+ };
209
+ declare const CloseAllPositionsWidget: React$1.FC<CloseAllPositionsWidgetProps>;
210
+
211
+ interface UseReversePositionScriptOptions {
212
+ position: API.PositionExt | API.PositionTPSLExt;
213
+ onSuccess?: () => void;
214
+ onError?: (error: any) => void;
215
+ }
216
+ /**
217
+ * Hook for managing reverse position enabled state
218
+ * Separates desktop and mobile preferences internally
219
+ */
220
+ declare const useReversePositionEnabled: () => {
221
+ isEnabled: any;
222
+ setEnabled: (enabled: boolean) => void;
223
+ };
224
+ declare const useReversePositionScript: (options?: UseReversePositionScriptOptions) => {
225
+ isEnabled: any;
226
+ setEnabled: (enabled: boolean) => void;
227
+ reversePosition: () => Promise<boolean>;
228
+ isReversing: boolean;
229
+ displayInfo: {
230
+ symbol: string;
231
+ base: string;
232
+ quote: string;
233
+ baseDp: number;
234
+ quoteDp: number;
235
+ positionQty: string;
236
+ reverseQty: string;
237
+ markPrice: string;
238
+ leverage: number;
239
+ isLong: boolean;
240
+ } | null;
241
+ positionQty: number;
242
+ reverseQty: number;
243
+ isLong: boolean;
244
+ };
245
+ type ReversePositionState = ReturnType<typeof useReversePositionScript>;
246
+
247
+ type ReversePositionProps = ReversePositionState & {
248
+ className?: string;
249
+ style?: React$1.CSSProperties;
250
+ onConfirm?: () => Promise<void>;
251
+ onCancel?: () => void;
252
+ };
253
+ declare const ReversePosition: FC<ReversePositionProps>;
254
+
255
+ type ReversePositionWidgetProps = {
256
+ position: API.PositionExt | API.PositionTPSLExt;
257
+ close?: () => void;
258
+ resolve?: (value?: any) => void;
259
+ reject?: (reason?: any) => void;
260
+ };
261
+ declare const ReversePositionWidget: React$1.FC<ReversePositionWidgetProps>;
262
+ declare const ReversePositionDialogId = "ReversePositionDialogId";
263
+
264
+ interface OrderInfoCardProps {
265
+ /** Order title */
266
+ title: string;
267
+ /** Order side */
268
+ side: OrderSide;
269
+ /** Leverage multiplier */
270
+ leverage: number;
271
+ /** Quantity */
272
+ qty: string;
273
+ /** Base decimal places */
274
+ baseDp: number;
275
+ /** Price label, defaults to "Market" */
276
+ estLiqPrice?: React$1.ReactNode;
277
+ /** Custom class name */
278
+ className?: string;
279
+ }
280
+ /**
281
+ * Order info card component
282
+ * Displays detailed order information including title, side, leverage, quantity, and price
283
+ */
284
+ declare const OrderInfoCard: FC<OrderInfoCardProps>;
285
+
186
286
  declare const MarketCloseConfirmID = "MarketCloseConfirmID";
187
287
 
188
- export { CombinePositionsWidget, FundingFeeButton, FundingFeeHistoryUI, Liquidation, type LiquidationInstance, LiquidationWidget, MarketCloseConfirmID, MobileLiquidation, MobileLiquidationWidget, MobilePositionHistory, MobilePositionHistoryWidget, MobilePositionsWidget, PositionHistory, type PositionHistoryInstance, PositionHistoryWidget, type PositionsInstance, type PositionsProps, PositionsTabName, PositionsWidget, type SortType, sortList, useLiquidationScript, usePositionHistoryScript, usePositionsRowContext, useSort, useTabSort };
288
+ export { CloseAllPositions, type CloseAllPositionsProps, type CloseAllPositionsState, CloseAllPositionsWidget, CombinePositionsWidget, FundingFeeButton, FundingFeeHistoryUI, Liquidation, type LiquidationInstance, LiquidationWidget, MarketCloseConfirmID, MobileLiquidation, MobileLiquidationWidget, MobilePositionHistory, MobilePositionHistoryWidget, MobilePositionsWidget, OrderInfoCard, type OrderInfoCardProps, PositionHistory, type PositionHistoryInstance, PositionHistoryWidget, type PositionsInstance, type PositionsProps, PositionsTabName, PositionsWidget, ReversePosition, ReversePositionDialogId, type ReversePositionProps, type ReversePositionState, ReversePositionWidget, type ReversePositionWidgetProps, type SortType, sortList, useCloseAllPositionsScript, useLiquidationScript, usePositionHistoryScript, usePositionsRowContext, useReversePositionEnabled, useReversePositionScript, useSort, useTabSort };
package/dist/index.d.ts CHANGED
@@ -183,6 +183,106 @@ declare const MobileLiquidation: FC<LiquidationState & {
183
183
  onExport?: () => void;
184
184
  }>;
185
185
 
186
+ interface UseCloseAllPositionsScriptOptions {
187
+ symbol?: string;
188
+ onSuccess?: () => void;
189
+ }
190
+ declare const useCloseAllPositionsScript: (options?: UseCloseAllPositionsScriptOptions) => {
191
+ onCloseAll: () => void;
192
+ hasOpenPositions: boolean;
193
+ isClosing: boolean;
194
+ openPositionsCount: number;
195
+ symbol: string | undefined;
196
+ };
197
+ type CloseAllPositionsState = ReturnType<typeof useCloseAllPositionsScript>;
198
+
199
+ type CloseAllPositionsProps = CloseAllPositionsState & {
200
+ className?: string;
201
+ style?: React$1.CSSProperties;
202
+ };
203
+ declare const CloseAllPositions: FC<CloseAllPositionsProps>;
204
+
205
+ type CloseAllPositionsWidgetProps = Pick<CloseAllPositionsProps, "className" | "style"> & {
206
+ symbol?: string;
207
+ onSuccess?: () => void;
208
+ };
209
+ declare const CloseAllPositionsWidget: React$1.FC<CloseAllPositionsWidgetProps>;
210
+
211
+ interface UseReversePositionScriptOptions {
212
+ position: API.PositionExt | API.PositionTPSLExt;
213
+ onSuccess?: () => void;
214
+ onError?: (error: any) => void;
215
+ }
216
+ /**
217
+ * Hook for managing reverse position enabled state
218
+ * Separates desktop and mobile preferences internally
219
+ */
220
+ declare const useReversePositionEnabled: () => {
221
+ isEnabled: any;
222
+ setEnabled: (enabled: boolean) => void;
223
+ };
224
+ declare const useReversePositionScript: (options?: UseReversePositionScriptOptions) => {
225
+ isEnabled: any;
226
+ setEnabled: (enabled: boolean) => void;
227
+ reversePosition: () => Promise<boolean>;
228
+ isReversing: boolean;
229
+ displayInfo: {
230
+ symbol: string;
231
+ base: string;
232
+ quote: string;
233
+ baseDp: number;
234
+ quoteDp: number;
235
+ positionQty: string;
236
+ reverseQty: string;
237
+ markPrice: string;
238
+ leverage: number;
239
+ isLong: boolean;
240
+ } | null;
241
+ positionQty: number;
242
+ reverseQty: number;
243
+ isLong: boolean;
244
+ };
245
+ type ReversePositionState = ReturnType<typeof useReversePositionScript>;
246
+
247
+ type ReversePositionProps = ReversePositionState & {
248
+ className?: string;
249
+ style?: React$1.CSSProperties;
250
+ onConfirm?: () => Promise<void>;
251
+ onCancel?: () => void;
252
+ };
253
+ declare const ReversePosition: FC<ReversePositionProps>;
254
+
255
+ type ReversePositionWidgetProps = {
256
+ position: API.PositionExt | API.PositionTPSLExt;
257
+ close?: () => void;
258
+ resolve?: (value?: any) => void;
259
+ reject?: (reason?: any) => void;
260
+ };
261
+ declare const ReversePositionWidget: React$1.FC<ReversePositionWidgetProps>;
262
+ declare const ReversePositionDialogId = "ReversePositionDialogId";
263
+
264
+ interface OrderInfoCardProps {
265
+ /** Order title */
266
+ title: string;
267
+ /** Order side */
268
+ side: OrderSide;
269
+ /** Leverage multiplier */
270
+ leverage: number;
271
+ /** Quantity */
272
+ qty: string;
273
+ /** Base decimal places */
274
+ baseDp: number;
275
+ /** Price label, defaults to "Market" */
276
+ estLiqPrice?: React$1.ReactNode;
277
+ /** Custom class name */
278
+ className?: string;
279
+ }
280
+ /**
281
+ * Order info card component
282
+ * Displays detailed order information including title, side, leverage, quantity, and price
283
+ */
284
+ declare const OrderInfoCard: FC<OrderInfoCardProps>;
285
+
186
286
  declare const MarketCloseConfirmID = "MarketCloseConfirmID";
187
287
 
188
- export { CombinePositionsWidget, FundingFeeButton, FundingFeeHistoryUI, Liquidation, type LiquidationInstance, LiquidationWidget, MarketCloseConfirmID, MobileLiquidation, MobileLiquidationWidget, MobilePositionHistory, MobilePositionHistoryWidget, MobilePositionsWidget, PositionHistory, type PositionHistoryInstance, PositionHistoryWidget, type PositionsInstance, type PositionsProps, PositionsTabName, PositionsWidget, type SortType, sortList, useLiquidationScript, usePositionHistoryScript, usePositionsRowContext, useSort, useTabSort };
288
+ export { CloseAllPositions, type CloseAllPositionsProps, type CloseAllPositionsState, CloseAllPositionsWidget, CombinePositionsWidget, FundingFeeButton, FundingFeeHistoryUI, Liquidation, type LiquidationInstance, LiquidationWidget, MarketCloseConfirmID, MobileLiquidation, MobileLiquidationWidget, MobilePositionHistory, MobilePositionHistoryWidget, MobilePositionsWidget, OrderInfoCard, type OrderInfoCardProps, PositionHistory, type PositionHistoryInstance, PositionHistoryWidget, type PositionsInstance, type PositionsProps, PositionsTabName, PositionsWidget, ReversePosition, ReversePositionDialogId, type ReversePositionProps, type ReversePositionState, ReversePositionWidget, type ReversePositionWidgetProps, type SortType, sortList, useCloseAllPositionsScript, useLiquidationScript, usePositionHistoryScript, usePositionsRowContext, useReversePositionEnabled, useReversePositionScript, useSort, useTabSort };