@liberfi.io/ui-perpetuals 0.2.19 → 0.2.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -3
- package/dist/index.d.mts +715 -16
- package/dist/index.d.ts +715 -16
- package/dist/index.js +18 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -8
package/README.md
CHANGED
|
@@ -38,8 +38,8 @@ Required peer dependencies:
|
|
|
38
38
|
- `TradesUI(props: TradesUIProps)`
|
|
39
39
|
- `PlaceOrderFormWidget(props: PlaceOrderFormWidgetProps)`
|
|
40
40
|
- `PlaceOrderFormUI(props: PlaceOrderFormUIProps)` (uses `react-hook-form` `UseFormReturn`)
|
|
41
|
-
- `PositionsWidget(props: PositionsWidgetProps)`
|
|
42
|
-
- `PositionsUI(props: PositionsUIProps)`
|
|
41
|
+
- `PositionsWidget(props: PositionsWidgetProps)` — wires `usePositionsScript` to `PositionsUI`; owns sort state and the close-position mutation
|
|
42
|
+
- `PositionsUI(props: PositionsUIProps)` — controlled, presentational positions table (div+flex layout, 9 columns, sortable headers, header tooltips, zebra striping, `min-w-[1000px]` + horizontal scroll). The `Mark Price`, `Margin Used (PNL)`, and `TP / SL` columns are kept live by `useAccountStateSubscription` (webData2): each push re-marks every position against the venue's `markPx`, recomputes PnL, and re-derives the closing-side TP/SL trigger prices client-side, so the table updates at the same cadence as the order book — no extra subscription needed at the widget level.
|
|
43
43
|
- `PositionsSkeleton()`
|
|
44
44
|
- `PositionsEmpty()`
|
|
45
45
|
- `OpenOrdersWidget(props: OpenOrdersWidgetProps)`
|
|
@@ -122,6 +122,9 @@ Required peer dependencies:
|
|
|
122
122
|
- `PlaceOrderResult`, `CancelOrderResult`, `GetPositionsResult`, `GetOpenOrdersResult`, `GetTradesResult`
|
|
123
123
|
- UI and script props/result types:
|
|
124
124
|
- All `*Props`, `Use*Params`, `Use*Result` types re-exported by each component/hook index.
|
|
125
|
+
- Positions table sort:
|
|
126
|
+
- `PositionSortKey` — discriminated string union of the seven sortable columns (`asset`, `position`, `value`, `entry`, `mark`, `liq`, `marginPnl`)
|
|
127
|
+
- `SortDirection` — `"asc" | "desc"`
|
|
125
128
|
|
|
126
129
|
### Constants
|
|
127
130
|
|
|
@@ -265,7 +268,9 @@ checklist UI without reimplementing the transition rules.
|
|
|
265
268
|
## Future Improvements
|
|
266
269
|
|
|
267
270
|
- Add integration tests for order submit/cancel and subscription lifecycle.
|
|
268
|
-
-
|
|
271
|
+
- Finish i18n wiring across the remaining widgets (`OpenOrdersUI`, `TradesUI`, `TradeHistoryUI`); positions table is fully translated under the `perpetuals.positions.*` namespace.
|
|
272
|
+
- Surface a **per-position TP/SL editor** behind the small `Edit` icon Axiom shows in the TP/SL cell. The data plumbing already lands the active trigger prices on each `Position` (`takeProfitPrice` / `stopLossPrice`); a popover that calls `useCreateOrderMutation` with `reduceOnly: true` triggers would complete the loop.
|
|
273
|
+
- Wire a **Limit close** action in the positions row's `Close` cell. Today only the `Market` close button is rendered; reusing the place-order form's limit-price input from a popover would close the gap.
|
|
269
274
|
- Replace placeholder account/margin values in place-order script with real account sources.
|
|
270
275
|
- Surface deposit status updates over a push channel (SSE/WebSocket) once the perpetuals-server exposes one — today the client polls.
|
|
271
276
|
- Ship a first-party `HyperliquidSetupAdapter` implementation via a dedicated `@liberfi.io/wallet-connector-hyperliquid` package so consumers don’t need to write their own.
|