@loafmarkets/ui 0.1.266 → 0.1.268

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.mjs CHANGED
@@ -13781,362 +13781,364 @@ function PortfolioActivityPanel({
13781
13781
  /* @__PURE__ */ jsx(Tab, { $active: activeTab === "trades", onClick: () => handleTabChange("trades"), children: "Trade History" }),
13782
13782
  /* @__PURE__ */ jsx(Tab, { $active: activeTab === "transfers", onClick: () => handleTabChange("transfers"), children: "Transfers" })
13783
13783
  ] }),
13784
- activeTab === "positions" && showPositionsTab && /* @__PURE__ */ jsxs(Fragment, { children: [
13785
- positions.length === 0 && /* @__PURE__ */ jsx(EmptyState, { children: "No positions yet. Subscribe to an offering or buy on the secondary market." }),
13786
- positions.length > 0 && compactPositions && /* @__PURE__ */ jsxs(Fragment, { children: [
13787
- /* @__PURE__ */ jsxs(CToolbar, { children: [
13788
- /* @__PURE__ */ jsxs(CSortWrap, { children: [
13789
- /* @__PURE__ */ jsxs(CSortBtn, { onClick: () => setSortDropdownOpen((v) => !v), children: [
13790
- "Sort by: ",
13791
- sortKeyLabel(posSortKey),
13792
- " \u25BE"
13784
+ /* @__PURE__ */ jsxs(ContentScroll, { children: [
13785
+ activeTab === "positions" && showPositionsTab && /* @__PURE__ */ jsxs(Fragment, { children: [
13786
+ positions.length === 0 && /* @__PURE__ */ jsx(EmptyState, { children: "No positions yet. Subscribe to an offering or buy on the secondary market." }),
13787
+ positions.length > 0 && compactPositions && /* @__PURE__ */ jsxs(Fragment, { children: [
13788
+ /* @__PURE__ */ jsxs(CToolbar, { children: [
13789
+ /* @__PURE__ */ jsxs(CSortWrap, { children: [
13790
+ /* @__PURE__ */ jsxs(CSortBtn, { onClick: () => setSortDropdownOpen((v) => !v), children: [
13791
+ "Sort by: ",
13792
+ sortKeyLabel(posSortKey),
13793
+ " \u25BE"
13794
+ ] }),
13795
+ sortDropdownOpen && /* @__PURE__ */ jsx(CSortDropdown, { children: sortKeys.map((k) => /* @__PURE__ */ jsx(CSortOption, { $active: posSortKey === k, onClick: () => {
13796
+ setPosSortKey(k);
13797
+ setPosSortAsc(true);
13798
+ setSortDropdownOpen(false);
13799
+ }, children: sortKeyLabel(k) }, k)) })
13793
13800
  ] }),
13794
- sortDropdownOpen && /* @__PURE__ */ jsx(CSortDropdown, { children: sortKeys.map((k) => /* @__PURE__ */ jsx(CSortOption, { $active: posSortKey === k, onClick: () => {
13795
- setPosSortKey(k);
13796
- setPosSortAsc(true);
13797
- setSortDropdownOpen(false);
13798
- }, children: sortKeyLabel(k) }, k)) })
13801
+ /* @__PURE__ */ jsxs(CToolbarActions, { children: [
13802
+ /* @__PURE__ */ jsx(CToolbarLink, { onClick: toggleExpandAll, children: allExpanded ? "Collapse All" : "Expand All" }),
13803
+ onClosePosition && /* @__PURE__ */ jsx(CToolbarLink, { onClick: () => setCloseAllOpen(true), children: "Sell All" })
13804
+ ] })
13799
13805
  ] }),
13800
- /* @__PURE__ */ jsxs(CToolbarActions, { children: [
13801
- /* @__PURE__ */ jsx(CToolbarLink, { onClick: toggleExpandAll, children: allExpanded ? "Collapse All" : "Expand All" }),
13802
- onClosePosition && /* @__PURE__ */ jsx(CToolbarLink, { onClick: () => setCloseAllOpen(true), children: "Sell All" })
13803
- ] })
13804
- ] }),
13805
- pageSlice(sortedPositions).map((pos) => {
13806
- const currentValue = pos.quantity * pos.marketPrice;
13807
- const costBasis = pos.quantity * pos.averageEntryPrice;
13808
- const pnl = pos.propertyPnl ?? currentValue - costBasis;
13809
- const pnlPercent = pos.propertyPnlPercent ?? pos.percentChange ?? 0;
13810
- const isPositive = pnl >= 0;
13811
- const posExpanded = expandedPositions.has(pos.tokenName) || allExpanded;
13812
- const ticker = pos.tokenName.toUpperCase().slice(0, 7);
13813
- return /* @__PURE__ */ jsxs("div", { children: [
13814
- /* @__PURE__ */ jsxs(CRow, { $expanded: posExpanded, onClick: () => togglePosition(pos.tokenName), children: [
13815
- /* @__PURE__ */ jsxs(CAssetCell, { onClick: (e) => {
13816
- e.stopPropagation();
13817
- onPositionClick?.(pos.tokenName, pos.isIpoAllocation);
13818
- }, children: [
13819
- /* @__PURE__ */ jsx(CCellLabel, { children: "Asset" }),
13820
- /* @__PURE__ */ jsxs(CAssetName, { children: [
13821
- pos.imageUrl && /* @__PURE__ */ jsx(CAssetLogo, { src: pos.imageUrl, alt: "" }),
13822
- pos.tokenName
13823
- ] })
13806
+ pageSlice(sortedPositions).map((pos) => {
13807
+ const currentValue = pos.quantity * pos.marketPrice;
13808
+ const costBasis = pos.quantity * pos.averageEntryPrice;
13809
+ const pnl = pos.propertyPnl ?? currentValue - costBasis;
13810
+ const pnlPercent = pos.propertyPnlPercent ?? pos.percentChange ?? 0;
13811
+ const isPositive = pnl >= 0;
13812
+ const posExpanded = expandedPositions.has(pos.tokenName) || allExpanded;
13813
+ const ticker = pos.tokenName.toUpperCase().slice(0, 7);
13814
+ return /* @__PURE__ */ jsxs("div", { children: [
13815
+ /* @__PURE__ */ jsxs(CRow, { $expanded: posExpanded, onClick: () => togglePosition(pos.tokenName), children: [
13816
+ /* @__PURE__ */ jsxs(CAssetCell, { onClick: (e) => {
13817
+ e.stopPropagation();
13818
+ onPositionClick?.(pos.tokenName, pos.isIpoAllocation);
13819
+ }, children: [
13820
+ /* @__PURE__ */ jsx(CCellLabel, { children: "Asset" }),
13821
+ /* @__PURE__ */ jsxs(CAssetName, { children: [
13822
+ pos.imageUrl && /* @__PURE__ */ jsx(CAssetLogo, { src: pos.imageUrl, alt: "" }),
13823
+ pos.tokenName
13824
+ ] })
13825
+ ] }),
13826
+ /* @__PURE__ */ jsxs(CUnitsCell, { children: [
13827
+ /* @__PURE__ */ jsx(CCellLabel, { children: "Units" }),
13828
+ formatNumber2(pos.quantity, pos.quantity >= 100 ? 0 : 2),
13829
+ " ",
13830
+ ticker
13831
+ ] }),
13832
+ /* @__PURE__ */ jsxs(CPnlCell, { children: [
13833
+ /* @__PURE__ */ jsx(CCellLabel, { children: "PNL (%)" }),
13834
+ /* @__PURE__ */ jsxs(CPnlValue, { $positive: isPositive, children: [
13835
+ isPositive ? "+" : "-",
13836
+ formatCurrency4(Math.abs(pnl))
13837
+ ] }),
13838
+ /* @__PURE__ */ jsxs(CPnlPct, { $positive: isPositive, children: [
13839
+ "(",
13840
+ isPositive ? "+" : "",
13841
+ pnlPercent.toFixed(1),
13842
+ "%)"
13843
+ ] })
13844
+ ] }),
13845
+ /* @__PURE__ */ jsx(CChevronWrap, { $open: posExpanded, children: /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "rgba(255,255,255,0.5)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("polyline", { points: "6 9 12 15 18 9" }) }) })
13824
13846
  ] }),
13825
- /* @__PURE__ */ jsxs(CUnitsCell, { children: [
13826
- /* @__PURE__ */ jsx(CCellLabel, { children: "Units" }),
13827
- formatNumber2(pos.quantity, pos.quantity >= 100 ? 0 : 2),
13847
+ posExpanded && /* @__PURE__ */ jsxs(CExpandedWrap, { children: [
13848
+ /* @__PURE__ */ jsxs(CDetailGrid, { children: [
13849
+ /* @__PURE__ */ jsxs(CDetailItem, { children: [
13850
+ /* @__PURE__ */ jsx(CDLabel, { children: "Position Value" }),
13851
+ /* @__PURE__ */ jsx(CDValue, { children: formatCurrency4(currentValue, { minimumFractionDigits: 0, maximumFractionDigits: 0 }) })
13852
+ ] }),
13853
+ /* @__PURE__ */ jsxs(CDetailItem, { children: [
13854
+ /* @__PURE__ */ jsx(CDLabel, { children: "Avg Price" }),
13855
+ /* @__PURE__ */ jsx(CDValue, { children: formatCurrency4(pos.averageEntryPrice) })
13856
+ ] }),
13857
+ /* @__PURE__ */ jsxs(CDetailItem, { children: [
13858
+ /* @__PURE__ */ jsx(CDLabel, { children: "Current Price" }),
13859
+ /* @__PURE__ */ jsx(CDValue, { children: formatCurrency4(pos.marketPrice) })
13860
+ ] })
13861
+ ] }),
13862
+ onClosePosition && /* @__PURE__ */ jsxs(CActionRow, { children: [
13863
+ /* @__PURE__ */ jsx(CCloseBtn, { onClick: () => onClosePosition(pos.tokenName, "market", pos.quantity, pos.marketPrice), children: "Market Sell" }),
13864
+ /* @__PURE__ */ jsx(CCloseBtn, { onClick: () => onClosePosition(pos.tokenName, "limit", pos.quantity, pos.marketPrice), children: "Limit Sell" })
13865
+ ] })
13866
+ ] })
13867
+ ] }, pos.tokenName);
13868
+ })
13869
+ ] }),
13870
+ positions.length > 0 && !compactPositions && /* @__PURE__ */ jsxs(Fragment, { children: [
13871
+ /* @__PURE__ */ jsxs(PositionsHeader, { $hasClose: !!onClosePosition, children: [
13872
+ /* @__PURE__ */ jsxs(SortableHeaderCell, { $active: posSortKey === "asset", onClick: () => handlePosSort("asset"), children: [
13873
+ "Asset ",
13874
+ posSortKey === "asset" && (posSortAsc ? "\u2191" : "\u2193")
13875
+ ] }),
13876
+ /* @__PURE__ */ jsxs(SortableHeaderCell, { $active: posSortKey === "units", onClick: () => handlePosSort("units"), children: [
13877
+ "Units ",
13878
+ posSortKey === "units" && (posSortAsc ? "\u2191" : "\u2193")
13879
+ ] }),
13880
+ /* @__PURE__ */ jsxs(SortableHeaderCell, { $active: posSortKey === "value", onClick: () => handlePosSort("value"), children: [
13881
+ "Position Value ",
13882
+ posSortKey === "value" && (posSortAsc ? "\u2191" : "\u2193")
13883
+ ] }),
13884
+ /* @__PURE__ */ jsxs(SortableHeaderCell, { $active: posSortKey === "avgPrice", onClick: () => handlePosSort("avgPrice"), children: [
13885
+ "Avg Price ",
13886
+ posSortKey === "avgPrice" && (posSortAsc ? "\u2191" : "\u2193")
13887
+ ] }),
13888
+ /* @__PURE__ */ jsxs(SortableHeaderCell, { $active: posSortKey === "currentPrice", onClick: () => handlePosSort("currentPrice"), children: [
13889
+ "Current Price ",
13890
+ posSortKey === "currentPrice" && (posSortAsc ? "\u2191" : "\u2193")
13891
+ ] }),
13892
+ /* @__PURE__ */ jsxs(SortableHeaderCell, { $active: posSortKey === "pnl", onClick: () => handlePosSort("pnl"), children: [
13893
+ "PNL (%) ",
13894
+ posSortKey === "pnl" && (posSortAsc ? "\u2191" : "\u2193")
13895
+ ] }),
13896
+ onClosePosition && /* @__PURE__ */ jsx(PositionsHeaderCell, { children: /* @__PURE__ */ jsx(CloseAllHeaderBtn, { onClick: () => setCloseAllOpen(true), children: "Sell All" }) })
13897
+ ] }),
13898
+ pageSlice(sortedPositions).map((pos) => {
13899
+ const currentValue = pos.quantity * pos.marketPrice;
13900
+ const costBasis = pos.quantity * pos.averageEntryPrice;
13901
+ const pnl = pos.propertyPnl ?? currentValue - costBasis;
13902
+ const pnlPercent = pos.propertyPnlPercent ?? pos.percentChange ?? 0;
13903
+ const isPositive = pnl >= 0;
13904
+ return /* @__PURE__ */ jsxs(PositionsRow, { $hasClose: !!onClosePosition, children: [
13905
+ /* @__PURE__ */ jsx(PositionsCell, { children: /* @__PURE__ */ jsx(HoldingsPropertyLink, { onClick: () => onPositionClick?.(pos.tokenName, pos.isIpoAllocation), children: pos.tokenName }) }),
13906
+ /* @__PURE__ */ jsx(PositionsCell, { children: /* @__PURE__ */ jsxs("span", { style: { color: "#fff", fontSize: "0.8rem" }, children: [
13907
+ formatNumber2(pos.quantity),
13828
13908
  " ",
13829
- ticker
13830
- ] }),
13831
- /* @__PURE__ */ jsxs(CPnlCell, { children: [
13832
- /* @__PURE__ */ jsx(CCellLabel, { children: "PNL (%)" }),
13833
- /* @__PURE__ */ jsxs(CPnlValue, { $positive: isPositive, children: [
13909
+ /* @__PURE__ */ jsx("span", { style: { color: "rgba(255,255,255,0.4)", fontSize: "0.7rem" }, children: pos.tokenName.toUpperCase() })
13910
+ ] }) }),
13911
+ /* @__PURE__ */ jsx(PositionsCell, { children: /* @__PURE__ */ jsxs("span", { style: { color: "#fff", fontSize: "0.8rem" }, children: [
13912
+ formatCurrency4(currentValue, { minimumFractionDigits: 0, maximumFractionDigits: 0 }),
13913
+ " ",
13914
+ /* @__PURE__ */ jsx("span", { style: { color: "rgba(255,255,255,0.4)", fontSize: "0.7rem" }, children: "USD" })
13915
+ ] }) }),
13916
+ /* @__PURE__ */ jsx(PositionsCell, { children: /* @__PURE__ */ jsx("span", { style: { color: "rgba(255,255,255,0.7)", fontSize: "0.8rem" }, children: formatCurrency4(pos.averageEntryPrice) }) }),
13917
+ /* @__PURE__ */ jsx(PositionsCell, { children: /* @__PURE__ */ jsx("span", { style: { color: "#fff", fontSize: "0.8rem" }, children: formatCurrency4(pos.marketPrice) }) }),
13918
+ /* @__PURE__ */ jsxs(PositionsCell, { children: [
13919
+ /* @__PURE__ */ jsxs(PnLAmount, { $positive: isPositive, children: [
13834
13920
  isPositive ? "+" : "-",
13835
13921
  formatCurrency4(Math.abs(pnl))
13836
13922
  ] }),
13837
- /* @__PURE__ */ jsxs(CPnlPct, { $positive: isPositive, children: [
13838
- "(",
13923
+ /* @__PURE__ */ jsxs(PnLPercentage, { $positive: isPositive, children: [
13839
13924
  isPositive ? "+" : "",
13840
13925
  pnlPercent.toFixed(1),
13841
- "%)"
13842
- ] })
13843
- ] }),
13844
- /* @__PURE__ */ jsx(CChevronWrap, { $open: posExpanded, children: /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "rgba(255,255,255,0.5)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("polyline", { points: "6 9 12 15 18 9" }) }) })
13845
- ] }),
13846
- posExpanded && /* @__PURE__ */ jsxs(CExpandedWrap, { children: [
13847
- /* @__PURE__ */ jsxs(CDetailGrid, { children: [
13848
- /* @__PURE__ */ jsxs(CDetailItem, { children: [
13849
- /* @__PURE__ */ jsx(CDLabel, { children: "Position Value" }),
13850
- /* @__PURE__ */ jsx(CDValue, { children: formatCurrency4(currentValue, { minimumFractionDigits: 0, maximumFractionDigits: 0 }) })
13851
- ] }),
13852
- /* @__PURE__ */ jsxs(CDetailItem, { children: [
13853
- /* @__PURE__ */ jsx(CDLabel, { children: "Avg Price" }),
13854
- /* @__PURE__ */ jsx(CDValue, { children: formatCurrency4(pos.averageEntryPrice) })
13855
- ] }),
13856
- /* @__PURE__ */ jsxs(CDetailItem, { children: [
13857
- /* @__PURE__ */ jsx(CDLabel, { children: "Current Price" }),
13858
- /* @__PURE__ */ jsx(CDValue, { children: formatCurrency4(pos.marketPrice) })
13926
+ "%"
13859
13927
  ] })
13860
13928
  ] }),
13861
- onClosePosition && /* @__PURE__ */ jsxs(CActionRow, { children: [
13862
- /* @__PURE__ */ jsx(CCloseBtn, { onClick: () => onClosePosition(pos.tokenName, "market", pos.quantity, pos.marketPrice), children: "Market Sell" }),
13863
- /* @__PURE__ */ jsx(CCloseBtn, { onClick: () => onClosePosition(pos.tokenName, "limit", pos.quantity, pos.marketPrice), children: "Limit Sell" })
13864
- ] })
13865
- ] })
13866
- ] }, pos.tokenName);
13867
- })
13868
- ] }),
13869
- positions.length > 0 && !compactPositions && /* @__PURE__ */ jsxs(Fragment, { children: [
13870
- /* @__PURE__ */ jsxs(PositionsHeader, { $hasClose: !!onClosePosition, children: [
13871
- /* @__PURE__ */ jsxs(SortableHeaderCell, { $active: posSortKey === "asset", onClick: () => handlePosSort("asset"), children: [
13872
- "Asset ",
13873
- posSortKey === "asset" && (posSortAsc ? "\u2191" : "\u2193")
13874
- ] }),
13875
- /* @__PURE__ */ jsxs(SortableHeaderCell, { $active: posSortKey === "units", onClick: () => handlePosSort("units"), children: [
13876
- "Units ",
13877
- posSortKey === "units" && (posSortAsc ? "\u2191" : "\u2193")
13929
+ onClosePosition && /* @__PURE__ */ jsx(PositionsCell, { children: /* @__PURE__ */ jsxs(CloseActions, { children: [
13930
+ /* @__PURE__ */ jsx(CloseBtn2, { onClick: (e) => {
13931
+ e.stopPropagation();
13932
+ onClosePosition(pos.tokenName, "market", pos.quantity, pos.marketPrice);
13933
+ }, children: "Market Sell" }),
13934
+ /* @__PURE__ */ jsx(CloseBtn2, { onClick: (e) => {
13935
+ e.stopPropagation();
13936
+ onClosePosition(pos.tokenName, "limit", pos.quantity, pos.marketPrice);
13937
+ }, children: "Limit Sell" })
13938
+ ] }) })
13939
+ ] }, pos.tokenName);
13940
+ })
13941
+ ] }),
13942
+ positions.length > 0 && closeAllOpen && onClosePosition && /* @__PURE__ */ jsx(CloseAllOverlay, { onClick: () => setCloseAllOpen(false), children: /* @__PURE__ */ jsxs(CloseAllModal, { onClick: (e) => e.stopPropagation(), children: [
13943
+ /* @__PURE__ */ jsx(CloseAllModalX, { onClick: () => setCloseAllOpen(false), children: "\xD7" }),
13944
+ /* @__PURE__ */ jsx(CloseAllTitle, { children: "Confirm Sell All" }),
13945
+ /* @__PURE__ */ jsx(CloseAllDesc, { children: "This will sell all your positions and cancel their associated TP/SL orders." }),
13946
+ /* @__PURE__ */ jsxs(CloseAllOption, { onClick: () => setCloseAllType("market"), children: [
13947
+ /* @__PURE__ */ jsx(CloseAllRadio, { $selected: closeAllType === "market" }),
13948
+ /* @__PURE__ */ jsx("span", { children: "Market Sell" })
13878
13949
  ] }),
13879
- /* @__PURE__ */ jsxs(SortableHeaderCell, { $active: posSortKey === "value", onClick: () => handlePosSort("value"), children: [
13880
- "Position Value ",
13881
- posSortKey === "value" && (posSortAsc ? "\u2191" : "\u2193")
13950
+ /* @__PURE__ */ jsxs(CloseAllOption, { onClick: () => setCloseAllType("limit"), children: [
13951
+ /* @__PURE__ */ jsx(CloseAllRadio, { $selected: closeAllType === "limit" }),
13952
+ /* @__PURE__ */ jsx("span", { children: "Limit Sell at Mid Price" })
13882
13953
  ] }),
13883
- /* @__PURE__ */ jsxs(SortableHeaderCell, { $active: posSortKey === "avgPrice", onClick: () => handlePosSort("avgPrice"), children: [
13884
- "Avg Price ",
13885
- posSortKey === "avgPrice" && (posSortAsc ? "\u2191" : "\u2193")
13954
+ /* @__PURE__ */ jsxs(CloseAllConfirmBtn, { onClick: () => {
13955
+ positions.forEach((pos) => onClosePosition(pos.tokenName, closeAllType, pos.quantity, pos.marketPrice));
13956
+ setCloseAllOpen(false);
13957
+ }, children: [
13958
+ "Confirm ",
13959
+ closeAllType === "market" ? "Market" : "Limit",
13960
+ " Sell"
13961
+ ] })
13962
+ ] }) })
13963
+ ] }),
13964
+ activeTab === "subscriptions" && /* @__PURE__ */ jsxs(Fragment, { children: [
13965
+ offeringOrders.length === 0 && /* @__PURE__ */ jsx(EmptyState, { children: "IPO allocations will appear here once you subscribe." }),
13966
+ offeringOrders.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
13967
+ /* @__PURE__ */ jsxs(GridHeader, { $columns: "1.2fr 0.8fr 1fr 1fr 0.8fr 1fr", children: [
13968
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Asset" }),
13969
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Qty" }),
13970
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Price" }),
13971
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Total" }),
13972
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
13973
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
13886
13974
  ] }),
13887
- /* @__PURE__ */ jsxs(SortableHeaderCell, { $active: posSortKey === "currentPrice", onClick: () => handlePosSort("currentPrice"), children: [
13888
- "Current Price ",
13889
- posSortKey === "currentPrice" && (posSortAsc ? "\u2191" : "\u2193")
13975
+ pageSlice(offeringOrders).map((order) => {
13976
+ const meta = getOrderStatusMeta(order.status);
13977
+ return /* @__PURE__ */ jsxs(GridRow, { $columns: "1.2fr 0.8fr 1fr 1fr 0.8fr 1fr", children: [
13978
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $primary: true, children: order.tokenName }) }),
13979
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: formatNumber2(order.quantity) }) }),
13980
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: formatCurrency4(order.price) }) }),
13981
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: formatCurrency4(order.price * order.quantity) }) }),
13982
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(ActivityTag, { $color: meta.color, $bg: meta.bg, children: prettyLabel(order.status) }) }),
13983
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: formatTimestamp(order.createdAt) }) })
13984
+ ] }, `${order.tokenName}-${order.txHash}-${order.createdAt}`);
13985
+ })
13986
+ ] })
13987
+ ] }),
13988
+ activeTab === "open-orders" && /* @__PURE__ */ jsxs(Fragment, { children: [
13989
+ openOrders.length === 0 && /* @__PURE__ */ jsx(EmptyState, { children: "Open orders will appear here while they are working in the market." }),
13990
+ openOrders.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
13991
+ onCancelAllOrders && openOrdersCount > 1 && /* @__PURE__ */ jsx(CancelAllRow, { children: /* @__PURE__ */ jsx(CancelAllBtn, { type: "button", disabled: cancellingAll, onClick: () => setCancelAllConfirmOpen(true), children: "Cancel All" }) }),
13992
+ /* @__PURE__ */ jsxs(GridHeader, { $columns: onCancelOrder ? "1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr 70px" : "1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr", children: [
13993
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Asset" }),
13994
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Side" }),
13995
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Type" }),
13996
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Qty" }),
13997
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Price" }),
13998
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Filled" }),
13999
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
14000
+ onCancelOrder && /* @__PURE__ */ jsx(GridHeaderCell, {})
13890
14001
  ] }),
13891
- /* @__PURE__ */ jsxs(SortableHeaderCell, { $active: posSortKey === "pnl", onClick: () => handlePosSort("pnl"), children: [
13892
- "PNL (%) ",
13893
- posSortKey === "pnl" && (posSortAsc ? "\u2191" : "\u2193")
14002
+ pageSlice(openOrders).map((order) => {
14003
+ const meta = getOrderStatusMeta(order.status);
14004
+ const isMarket = order.type === "MARKET";
14005
+ const filledPercent = order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0;
14006
+ const isCancelling = cancellingOrderId === order.id;
14007
+ return /* @__PURE__ */ jsxs(GridRow, { $columns: onCancelOrder ? "1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr 70px" : "1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr", children: [
14008
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $primary: true, children: order.tokenName }) }),
14009
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(SideBadge, { $side: sideLabel(order.side), children: sideLabel(order.side) }) }),
14010
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: prettyLabel(order.type) }) }),
14011
+ /* @__PURE__ */ jsx(GridCell, { children: onAmendOrder ? /* @__PURE__ */ jsx(EditableField, { value: order.quantity, format: formatNumber2, onCommit: (v) => onAmendOrder(order.id, { quantity: v }) }) : /* @__PURE__ */ jsx(CellText, { children: formatNumber2(order.quantity) }) }),
14012
+ /* @__PURE__ */ jsx(GridCell, { children: !isMarket && order.price && onAmendOrder ? /* @__PURE__ */ jsx(EditableField, { value: order.price, format: (v) => formatCurrency4(v), onCommit: (v) => onAmendOrder(order.id, { price: v }) }) : /* @__PURE__ */ jsx(CellText, { children: isMarket || !order.price ? "Market" : formatCurrency4(order.price) }) }),
14013
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsxs(CellText, { $muted: true, children: [
14014
+ filledPercent,
14015
+ "%"
14016
+ ] }) }),
14017
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(ActivityTag, { $color: meta.color, $bg: meta.bg, children: prettyLabel(order.status) }) }),
14018
+ onCancelOrder && /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(
14019
+ CancelButton,
14020
+ {
14021
+ type: "button",
14022
+ disabled: isCancelling || cancellingOrderId != null,
14023
+ onClick: (e) => {
14024
+ e.stopPropagation();
14025
+ setPendingCancelOrderId(order.id);
14026
+ },
14027
+ children: isCancelling ? "\u2026" : "Cancel"
14028
+ }
14029
+ ) })
14030
+ ] }, `open-${order.id}`);
14031
+ })
14032
+ ] })
14033
+ ] }),
14034
+ activeTab === "orders" && /* @__PURE__ */ jsxs(Fragment, { children: [
14035
+ orderHistory.length === 0 && /* @__PURE__ */ jsx(EmptyState, { children: "No orders yet. Place a trade to see it appear here." }),
14036
+ orderHistory.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
14037
+ /* @__PURE__ */ jsxs(GridHeader, { $columns: "1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr 1fr", children: [
14038
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Asset" }),
14039
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Side" }),
14040
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Type" }),
14041
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Qty" }),
14042
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Price" }),
14043
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Filled" }),
14044
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
14045
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
13894
14046
  ] }),
13895
- onClosePosition && /* @__PURE__ */ jsx(PositionsHeaderCell, { children: /* @__PURE__ */ jsx(CloseAllHeaderBtn, { onClick: () => setCloseAllOpen(true), children: "Sell All" }) })
13896
- ] }),
13897
- pageSlice(sortedPositions).map((pos) => {
13898
- const currentValue = pos.quantity * pos.marketPrice;
13899
- const costBasis = pos.quantity * pos.averageEntryPrice;
13900
- const pnl = pos.propertyPnl ?? currentValue - costBasis;
13901
- const pnlPercent = pos.propertyPnlPercent ?? pos.percentChange ?? 0;
13902
- const isPositive = pnl >= 0;
13903
- return /* @__PURE__ */ jsxs(PositionsRow, { $hasClose: !!onClosePosition, children: [
13904
- /* @__PURE__ */ jsx(PositionsCell, { children: /* @__PURE__ */ jsx(HoldingsPropertyLink, { onClick: () => onPositionClick?.(pos.tokenName, pos.isIpoAllocation), children: pos.tokenName }) }),
13905
- /* @__PURE__ */ jsx(PositionsCell, { children: /* @__PURE__ */ jsxs("span", { style: { color: "#fff", fontSize: "0.8rem" }, children: [
13906
- formatNumber2(pos.quantity),
13907
- " ",
13908
- /* @__PURE__ */ jsx("span", { style: { color: "rgba(255,255,255,0.4)", fontSize: "0.7rem" }, children: pos.tokenName.toUpperCase() })
13909
- ] }) }),
13910
- /* @__PURE__ */ jsx(PositionsCell, { children: /* @__PURE__ */ jsxs("span", { style: { color: "#fff", fontSize: "0.8rem" }, children: [
13911
- formatCurrency4(currentValue, { minimumFractionDigits: 0, maximumFractionDigits: 0 }),
13912
- " ",
13913
- /* @__PURE__ */ jsx("span", { style: { color: "rgba(255,255,255,0.4)", fontSize: "0.7rem" }, children: "USD" })
13914
- ] }) }),
13915
- /* @__PURE__ */ jsx(PositionsCell, { children: /* @__PURE__ */ jsx("span", { style: { color: "rgba(255,255,255,0.7)", fontSize: "0.8rem" }, children: formatCurrency4(pos.averageEntryPrice) }) }),
13916
- /* @__PURE__ */ jsx(PositionsCell, { children: /* @__PURE__ */ jsx("span", { style: { color: "#fff", fontSize: "0.8rem" }, children: formatCurrency4(pos.marketPrice) }) }),
13917
- /* @__PURE__ */ jsxs(PositionsCell, { children: [
13918
- /* @__PURE__ */ jsxs(PnLAmount, { $positive: isPositive, children: [
13919
- isPositive ? "+" : "-",
13920
- formatCurrency4(Math.abs(pnl))
13921
- ] }),
13922
- /* @__PURE__ */ jsxs(PnLPercentage, { $positive: isPositive, children: [
13923
- isPositive ? "+" : "",
13924
- pnlPercent.toFixed(1),
14047
+ pageSlice(orderHistory).map((order) => {
14048
+ const meta = getOrderStatusMeta(order.status);
14049
+ const isMarket = order.type === "MARKET";
14050
+ const filledPercent = order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0;
14051
+ return /* @__PURE__ */ jsxs(GridRow, { $columns: "1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr 1fr", children: [
14052
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $primary: true, children: order.tokenName }) }),
14053
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(SideBadge, { $side: sideLabel(order.side), children: sideLabel(order.side) }) }),
14054
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: prettyLabel(order.type) }) }),
14055
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: formatNumber2(order.quantity) }) }),
14056
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: isMarket || !order.price ? "Market" : formatCurrency4(order.price) }) }),
14057
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsxs(CellText, { $muted: true, children: [
14058
+ filledPercent,
13925
14059
  "%"
13926
- ] })
13927
- ] }),
13928
- onClosePosition && /* @__PURE__ */ jsx(PositionsCell, { children: /* @__PURE__ */ jsxs(CloseActions, { children: [
13929
- /* @__PURE__ */ jsx(CloseBtn2, { onClick: (e) => {
13930
- e.stopPropagation();
13931
- onClosePosition(pos.tokenName, "market", pos.quantity, pos.marketPrice);
13932
- }, children: "Market Sell" }),
13933
- /* @__PURE__ */ jsx(CloseBtn2, { onClick: (e) => {
13934
- e.stopPropagation();
13935
- onClosePosition(pos.tokenName, "limit", pos.quantity, pos.marketPrice);
13936
- }, children: "Limit Sell" })
13937
- ] }) })
13938
- ] }, pos.tokenName);
13939
- })
14060
+ ] }) }),
14061
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(ActivityTag, { $color: meta.color, $bg: meta.bg, children: prettyLabel(order.status) }) }),
14062
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: formatTimestamp(order.createdAt) }) })
14063
+ ] }, order.id);
14064
+ })
14065
+ ] })
13940
14066
  ] }),
13941
- positions.length > 0 && closeAllOpen && onClosePosition && /* @__PURE__ */ jsx(CloseAllOverlay, { onClick: () => setCloseAllOpen(false), children: /* @__PURE__ */ jsxs(CloseAllModal, { onClick: (e) => e.stopPropagation(), children: [
13942
- /* @__PURE__ */ jsx(CloseAllModalX, { onClick: () => setCloseAllOpen(false), children: "\xD7" }),
13943
- /* @__PURE__ */ jsx(CloseAllTitle, { children: "Confirm Sell All" }),
13944
- /* @__PURE__ */ jsx(CloseAllDesc, { children: "This will sell all your positions and cancel their associated TP/SL orders." }),
13945
- /* @__PURE__ */ jsxs(CloseAllOption, { onClick: () => setCloseAllType("market"), children: [
13946
- /* @__PURE__ */ jsx(CloseAllRadio, { $selected: closeAllType === "market" }),
13947
- /* @__PURE__ */ jsx("span", { children: "Market Sell" })
13948
- ] }),
13949
- /* @__PURE__ */ jsxs(CloseAllOption, { onClick: () => setCloseAllType("limit"), children: [
13950
- /* @__PURE__ */ jsx(CloseAllRadio, { $selected: closeAllType === "limit" }),
13951
- /* @__PURE__ */ jsx("span", { children: "Limit Sell at Mid Price" })
13952
- ] }),
13953
- /* @__PURE__ */ jsxs(CloseAllConfirmBtn, { onClick: () => {
13954
- positions.forEach((pos) => onClosePosition(pos.tokenName, closeAllType, pos.quantity, pos.marketPrice));
13955
- setCloseAllOpen(false);
13956
- }, children: [
13957
- "Confirm ",
13958
- closeAllType === "market" ? "Market" : "Limit",
13959
- " Sell"
14067
+ activeTab === "trades" && /* @__PURE__ */ jsxs(Fragment, { children: [
14068
+ tradeHistory.length === 0 && /* @__PURE__ */ jsx(EmptyState, { children: "Completed trades will appear here." }),
14069
+ tradeHistory.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
14070
+ /* @__PURE__ */ jsxs(GridHeader, { $columns: "1.2fr 0.6fr 0.8fr 1fr 1fr 0.8fr 1fr", children: [
14071
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Asset" }),
14072
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Side" }),
14073
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Qty" }),
14074
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Price" }),
14075
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Total" }),
14076
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Fee" }),
14077
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
14078
+ ] }),
14079
+ pageSlice(tradeHistory).map((trade) => /* @__PURE__ */ jsxs(GridRow, { $columns: "1.2fr 0.6fr 0.8fr 1fr 1fr 0.8fr 1fr", children: [
14080
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $primary: true, children: trade.tokenName }) }),
14081
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(SideBadge, { $side: sideLabel(trade.side), children: sideLabel(trade.side) }) }),
14082
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: formatNumber2(trade.quantity) }) }),
14083
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: formatCurrency4(trade.price) }) }),
14084
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: formatCurrency4(trade.price * trade.quantity) }) }),
14085
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: formatCurrency4(trade.fee) }) }),
14086
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: formatTimestamp(trade.executedAt) }) })
14087
+ ] }, trade.tradeId))
13960
14088
  ] })
13961
- ] }) })
13962
- ] }),
13963
- activeTab === "subscriptions" && /* @__PURE__ */ jsxs(Fragment, { children: [
13964
- offeringOrders.length === 0 && /* @__PURE__ */ jsx(EmptyState, { children: "IPO allocations will appear here once you subscribe." }),
13965
- offeringOrders.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
13966
- /* @__PURE__ */ jsxs(GridHeader, { $columns: "1.2fr 0.8fr 1fr 1fr 0.8fr 1fr", children: [
13967
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Asset" }),
13968
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Qty" }),
13969
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Price" }),
13970
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Total" }),
13971
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
13972
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
13973
- ] }),
13974
- pageSlice(offeringOrders).map((order) => {
13975
- const meta = getOrderStatusMeta(order.status);
13976
- return /* @__PURE__ */ jsxs(GridRow, { $columns: "1.2fr 0.8fr 1fr 1fr 0.8fr 1fr", children: [
13977
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $primary: true, children: order.tokenName }) }),
13978
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: formatNumber2(order.quantity) }) }),
13979
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: formatCurrency4(order.price) }) }),
13980
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: formatCurrency4(order.price * order.quantity) }) }),
13981
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(ActivityTag, { $color: meta.color, $bg: meta.bg, children: prettyLabel(order.status) }) }),
13982
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: formatTimestamp(order.createdAt) }) })
13983
- ] }, `${order.tokenName}-${order.txHash}-${order.createdAt}`);
13984
- })
13985
- ] })
13986
- ] }),
13987
- activeTab === "open-orders" && /* @__PURE__ */ jsxs(Fragment, { children: [
13988
- openOrders.length === 0 && /* @__PURE__ */ jsx(EmptyState, { children: "Open orders will appear here while they are working in the market." }),
13989
- openOrders.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
13990
- onCancelAllOrders && openOrdersCount > 1 && /* @__PURE__ */ jsx(CancelAllRow, { children: /* @__PURE__ */ jsx(CancelAllBtn, { type: "button", disabled: cancellingAll, onClick: () => setCancelAllConfirmOpen(true), children: "Cancel All" }) }),
13991
- /* @__PURE__ */ jsxs(GridHeader, { $columns: onCancelOrder ? "1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr 70px" : "1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr", children: [
13992
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Asset" }),
13993
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Side" }),
13994
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Type" }),
13995
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Qty" }),
13996
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Price" }),
13997
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Filled" }),
13998
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
13999
- onCancelOrder && /* @__PURE__ */ jsx(GridHeaderCell, {})
14000
- ] }),
14001
- pageSlice(openOrders).map((order) => {
14002
- const meta = getOrderStatusMeta(order.status);
14003
- const isMarket = order.type === "MARKET";
14004
- const filledPercent = order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0;
14005
- const isCancelling = cancellingOrderId === order.id;
14006
- return /* @__PURE__ */ jsxs(GridRow, { $columns: onCancelOrder ? "1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr 70px" : "1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr", children: [
14007
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $primary: true, children: order.tokenName }) }),
14008
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(SideBadge, { $side: sideLabel(order.side), children: sideLabel(order.side) }) }),
14009
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: prettyLabel(order.type) }) }),
14010
- /* @__PURE__ */ jsx(GridCell, { children: onAmendOrder ? /* @__PURE__ */ jsx(EditableField, { value: order.quantity, format: formatNumber2, onCommit: (v) => onAmendOrder(order.id, { quantity: v }) }) : /* @__PURE__ */ jsx(CellText, { children: formatNumber2(order.quantity) }) }),
14011
- /* @__PURE__ */ jsx(GridCell, { children: !isMarket && order.price && onAmendOrder ? /* @__PURE__ */ jsx(EditableField, { value: order.price, format: (v) => formatCurrency4(v), onCommit: (v) => onAmendOrder(order.id, { price: v }) }) : /* @__PURE__ */ jsx(CellText, { children: isMarket || !order.price ? "Market" : formatCurrency4(order.price) }) }),
14012
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsxs(CellText, { $muted: true, children: [
14013
- filledPercent,
14014
- "%"
14015
- ] }) }),
14016
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(ActivityTag, { $color: meta.color, $bg: meta.bg, children: prettyLabel(order.status) }) }),
14017
- onCancelOrder && /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(
14018
- CancelButton,
14019
- {
14020
- type: "button",
14021
- disabled: isCancelling || cancellingOrderId != null,
14022
- onClick: (e) => {
14023
- e.stopPropagation();
14024
- setPendingCancelOrderId(order.id);
14025
- },
14026
- children: isCancelling ? "\u2026" : "Cancel"
14027
- }
14028
- ) })
14029
- ] }, `open-${order.id}`);
14030
- })
14031
- ] })
14032
- ] }),
14033
- activeTab === "orders" && /* @__PURE__ */ jsxs(Fragment, { children: [
14034
- orderHistory.length === 0 && /* @__PURE__ */ jsx(EmptyState, { children: "No orders yet. Place a trade to see it appear here." }),
14035
- orderHistory.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
14036
- /* @__PURE__ */ jsxs(GridHeader, { $columns: "1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr 1fr", children: [
14037
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Asset" }),
14038
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Side" }),
14039
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Type" }),
14040
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Qty" }),
14041
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Price" }),
14042
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Filled" }),
14043
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
14044
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
14045
- ] }),
14046
- pageSlice(orderHistory).map((order) => {
14047
- const meta = getOrderStatusMeta(order.status);
14048
- const isMarket = order.type === "MARKET";
14049
- const filledPercent = order.quantity > 0 ? Math.round(order.filledQuantity / order.quantity * 100) : 0;
14050
- return /* @__PURE__ */ jsxs(GridRow, { $columns: "1.2fr 0.6fr 0.7fr 0.8fr 1fr 0.8fr 0.8fr 1fr", children: [
14051
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $primary: true, children: order.tokenName }) }),
14052
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(SideBadge, { $side: sideLabel(order.side), children: sideLabel(order.side) }) }),
14053
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: prettyLabel(order.type) }) }),
14054
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: formatNumber2(order.quantity) }) }),
14055
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: isMarket || !order.price ? "Market" : formatCurrency4(order.price) }) }),
14056
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsxs(CellText, { $muted: true, children: [
14057
- filledPercent,
14058
- "%"
14059
- ] }) }),
14060
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(ActivityTag, { $color: meta.color, $bg: meta.bg, children: prettyLabel(order.status) }) }),
14061
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: formatTimestamp(order.createdAt) }) })
14062
- ] }, order.id);
14063
- })
14064
- ] })
14065
- ] }),
14066
- activeTab === "trades" && /* @__PURE__ */ jsxs(Fragment, { children: [
14067
- tradeHistory.length === 0 && /* @__PURE__ */ jsx(EmptyState, { children: "Completed trades will appear here." }),
14068
- tradeHistory.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
14069
- /* @__PURE__ */ jsxs(GridHeader, { $columns: "1.2fr 0.6fr 0.8fr 1fr 1fr 0.8fr 1fr", children: [
14070
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Asset" }),
14071
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Side" }),
14072
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Qty" }),
14073
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Price" }),
14074
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Total" }),
14075
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Fee" }),
14076
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
14077
- ] }),
14078
- pageSlice(tradeHistory).map((trade) => /* @__PURE__ */ jsxs(GridRow, { $columns: "1.2fr 0.6fr 0.8fr 1fr 1fr 0.8fr 1fr", children: [
14079
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $primary: true, children: trade.tokenName }) }),
14080
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(SideBadge, { $side: sideLabel(trade.side), children: sideLabel(trade.side) }) }),
14081
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: formatNumber2(trade.quantity) }) }),
14082
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: formatCurrency4(trade.price) }) }),
14083
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { children: formatCurrency4(trade.price * trade.quantity) }) }),
14084
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: formatCurrency4(trade.fee) }) }),
14085
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: formatTimestamp(trade.executedAt) }) })
14086
- ] }, trade.tradeId))
14087
- ] })
14088
- ] }),
14089
- activeTab === "transfers" && /* @__PURE__ */ jsxs(Fragment, { children: [
14090
- transfers.length === 0 && /* @__PURE__ */ jsx(EmptyState, { children: "Deposits and withdrawals will appear here." }),
14091
- transfers.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
14092
- /* @__PURE__ */ jsxs(GridHeader, { $columns: "0.8fr 1fr 1.5fr 0.8fr 1fr", children: [
14093
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Type" }),
14094
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Amount" }),
14095
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Address" }),
14096
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
14097
- /* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
14089
+ ] }),
14090
+ activeTab === "transfers" && /* @__PURE__ */ jsxs(Fragment, { children: [
14091
+ transfers.length === 0 && /* @__PURE__ */ jsx(EmptyState, { children: "Deposits and withdrawals will appear here." }),
14092
+ transfers.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
14093
+ /* @__PURE__ */ jsxs(GridHeader, { $columns: "0.8fr 1fr 1.5fr 0.8fr 1fr", children: [
14094
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Type" }),
14095
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Amount" }),
14096
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Address" }),
14097
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Status" }),
14098
+ /* @__PURE__ */ jsx(GridHeaderCell, { children: "Date" })
14099
+ ] }),
14100
+ pageSlice(transfers).map((t, idx) => {
14101
+ const isDeposit = t.type === "DEPOSIT";
14102
+ const statusMeta = getOrderStatusMeta(t.status);
14103
+ return /* @__PURE__ */ jsxs(GridRow, { $columns: "0.8fr 1fr 1.5fr 0.8fr 1fr", children: [
14104
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(SideBadge, { $side: isDeposit ? "Buy" : "Sell", children: isDeposit ? "Deposit" : "Withdraw" }) }),
14105
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsxs(CellText, { $color: isDeposit ? "#0ecb81" : "#f6465d", children: [
14106
+ isDeposit ? "+" : "-",
14107
+ formatCurrency4(t.amount)
14108
+ ] }) }),
14109
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: formatAddress(t.address) }) }),
14110
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(ActivityTag, { $color: statusMeta.color, $bg: statusMeta.bg, children: prettyLabel(t.status) }) }),
14111
+ /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: formatTimestamp(t.createdAt) }) })
14112
+ ] }, t.blockchainTxHash ?? `transfer-${idx}`);
14113
+ })
14114
+ ] })
14115
+ ] }),
14116
+ activityTotalPages > 1 && /* @__PURE__ */ jsxs(PaginationRow, { children: [
14117
+ /* @__PURE__ */ jsx(
14118
+ PaginationButton,
14119
+ {
14120
+ type: "button",
14121
+ onClick: () => setActivityPage((p) => p - 1),
14122
+ disabled: activityPage === 0,
14123
+ children: "\u2190 Prev"
14124
+ }
14125
+ ),
14126
+ /* @__PURE__ */ jsxs(PaginationLabel, { children: [
14127
+ activityPage + 1,
14128
+ " / ",
14129
+ activityTotalPages
14098
14130
  ] }),
14099
- pageSlice(transfers).map((t, idx) => {
14100
- const isDeposit = t.type === "DEPOSIT";
14101
- const statusMeta = getOrderStatusMeta(t.status);
14102
- return /* @__PURE__ */ jsxs(GridRow, { $columns: "0.8fr 1fr 1.5fr 0.8fr 1fr", children: [
14103
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(SideBadge, { $side: isDeposit ? "Buy" : "Sell", children: isDeposit ? "Deposit" : "Withdraw" }) }),
14104
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsxs(CellText, { $color: isDeposit ? "#0ecb81" : "#f6465d", children: [
14105
- isDeposit ? "+" : "-",
14106
- formatCurrency4(t.amount)
14107
- ] }) }),
14108
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: formatAddress(t.address) }) }),
14109
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(ActivityTag, { $color: statusMeta.color, $bg: statusMeta.bg, children: prettyLabel(t.status) }) }),
14110
- /* @__PURE__ */ jsx(GridCell, { children: /* @__PURE__ */ jsx(CellText, { $muted: true, children: formatTimestamp(t.createdAt) }) })
14111
- ] }, t.blockchainTxHash ?? `transfer-${idx}`);
14112
- })
14131
+ /* @__PURE__ */ jsx(
14132
+ PaginationButton,
14133
+ {
14134
+ type: "button",
14135
+ onClick: () => setActivityPage((p) => p + 1),
14136
+ disabled: activityPage >= activityTotalPages - 1,
14137
+ children: "Next \u2192"
14138
+ }
14139
+ )
14113
14140
  ] })
14114
14141
  ] }),
14115
- activityTotalPages > 1 && /* @__PURE__ */ jsxs(PaginationRow, { children: [
14116
- /* @__PURE__ */ jsx(
14117
- PaginationButton,
14118
- {
14119
- type: "button",
14120
- onClick: () => setActivityPage((p) => p - 1),
14121
- disabled: activityPage === 0,
14122
- children: "\u2190 Prev"
14123
- }
14124
- ),
14125
- /* @__PURE__ */ jsxs(PaginationLabel, { children: [
14126
- activityPage + 1,
14127
- " / ",
14128
- activityTotalPages
14129
- ] }),
14130
- /* @__PURE__ */ jsx(
14131
- PaginationButton,
14132
- {
14133
- type: "button",
14134
- onClick: () => setActivityPage((p) => p + 1),
14135
- disabled: activityPage >= activityTotalPages - 1,
14136
- children: "Next \u2192"
14137
- }
14138
- )
14139
- ] }),
14140
14142
  cancelAllConfirmOpen && /* @__PURE__ */ jsx(CancelConfirmOverlay, { onClick: () => setCancelAllConfirmOpen(false), children: /* @__PURE__ */ jsxs(CancelConfirmModal, { onClick: (e) => e.stopPropagation(), children: [
14141
14143
  /* @__PURE__ */ jsx(CancelConfirmTitle, { children: "Cancel All Orders" }),
14142
14144
  /* @__PURE__ */ jsxs(CancelConfirmBody, { children: [
@@ -14191,6 +14193,14 @@ function PortfolioActivityPanel({
14191
14193
  ] });
14192
14194
  }
14193
14195
  var Container3 = styled9.div`
14196
+ display: flex;
14197
+ flex-direction: column;
14198
+ overflow: hidden;
14199
+ `;
14200
+ var ContentScroll = styled9.div`
14201
+ flex: 1;
14202
+ overflow-y: auto;
14203
+ min-height: 0;
14194
14204
  scrollbar-width: thin;
14195
14205
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
14196
14206
  &::-webkit-scrollbar { width: 4px; }
@@ -14852,7 +14862,7 @@ var CRow = styled9.button`
14852
14862
  var CCellLabel = styled9.div`
14853
14863
  font-size: 0.6rem;
14854
14864
  font-weight: 500;
14855
- color: rgba(255, 255, 255, 0.3);
14865
+ color: rgba(255, 255, 255, 0.5);
14856
14866
  margin-bottom: 1px;
14857
14867
  `;
14858
14868
  var CAssetCell = styled9.div``;
@@ -14911,7 +14921,7 @@ var CDetailGrid = styled9.div`
14911
14921
  var CDetailItem = styled9.div``;
14912
14922
  var CDLabel = styled9.div`
14913
14923
  font-size: 0.6rem;
14914
- color: rgba(255, 255, 255, 0.3);
14924
+ color: rgba(255, 255, 255, 0.5);
14915
14925
  margin-bottom: 1px;
14916
14926
  `;
14917
14927
  var CDValue = styled9.div`