@orderly.network/portfolio 2.8.6 → 2.8.7-alpha.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.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import React7, { createContext, useMemo, useId, useContext, useState, useCallback, useRef, createElement, useEffect } from 'react';
1
+ import React12, { createContext, useMemo, useId, useContext, useState, useCallback, useRef, createElement, useEffect } from 'react';
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import { useLocalStorage, useAccount, useIndexPricesStream, useCollateral, usePrivateQuery, useStatisticsDaily, useBalanceTopic, useAssetsHistory, useFeeState, useMediaQuery, useAccountInfo, useGetClaimed, DistributionId, TWType, useCurEpochEstimate, useAllBrokers, noCacheConfig, useEpochInfo, useConfig, useGetEnv, useMutation, useOrderlyContext, useDebouncedCallback, useWalletConnector, useAppStore, parseJSON, usePositionStream, useChains, useLeverage, useTransferHistory, useChainInfo, useSymbolsInfo, useFundingFeeHistory, useSubAccountQuery, useApiKeyManager, useDistributionHistory, useVaultsHistory } from '@orderly.network/hooks';
4
4
  import { useAppContext, useDataTap, useCanTrade } from '@orderly.network/react-app';
@@ -1084,6 +1084,21 @@ var init_fundingHistory_ui_mobile = __esm({
1084
1084
  }
1085
1085
  );
1086
1086
  };
1087
+ const options = useMemo(() => {
1088
+ return [
1089
+ {
1090
+ label: t("common.all"),
1091
+ value: "All"
1092
+ },
1093
+ ...Object.keys(symbols).map((symbol2) => {
1094
+ const s = symbol2.split("_")[1];
1095
+ return {
1096
+ label: s,
1097
+ value: symbol2
1098
+ };
1099
+ })
1100
+ ];
1101
+ }, [t, symbols]);
1087
1102
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1088
1103
  /* @__PURE__ */ jsx(
1089
1104
  DataFilter,
@@ -1093,25 +1108,11 @@ var init_fundingHistory_ui_mobile = __esm({
1093
1108
  type: "select",
1094
1109
  name: "symbol",
1095
1110
  isCombine: true,
1096
- options: [
1097
- {
1098
- label: "All",
1099
- value: "All"
1100
- },
1101
- ...Object.keys(symbols).map((symbol2) => {
1102
- const s = symbol2.split("_")[1];
1103
- return {
1104
- label: s,
1105
- value: symbol2
1106
- };
1107
- })
1108
- ],
1111
+ options,
1109
1112
  value: symbol,
1110
1113
  valueFormatter: (value) => {
1111
- if (value === "All") {
1112
- return "All";
1113
- }
1114
- return value.split("_")[1];
1114
+ const option = options.find((item) => item.value === value);
1115
+ return option?.label || value;
1115
1116
  }
1116
1117
  },
1117
1118
  {
@@ -1608,6 +1609,202 @@ var init_distribution = __esm({
1608
1609
  init_distribution_ui();
1609
1610
  }
1610
1611
  });
1612
+ var TransferHistoryMobileUI;
1613
+ var init_transfer_mobile_ui = __esm({
1614
+ "src/pages/overview/TransferHistory/transfer.mobile.ui.tsx"() {
1615
+ TransferHistoryMobileUI = (props) => {
1616
+ const {
1617
+ dataSource: dataSource2,
1618
+ queryParameter,
1619
+ state,
1620
+ isMainAccount,
1621
+ isLoading,
1622
+ selectedAccount,
1623
+ onFilter,
1624
+ pagination
1625
+ } = props;
1626
+ const { side, dateRange } = queryParameter;
1627
+ const { t } = useTranslation();
1628
+ const ALL_ACCOUNTS = {
1629
+ label: t("common.allAccount"),
1630
+ value: "All accounts" /* ALL */
1631
+ };
1632
+ const MAIN_ACCOUNT = {
1633
+ label: t("common.mainAccount"),
1634
+ value: "Main accounts" /* MAIN */
1635
+ };
1636
+ const subAccounts = state.subAccounts ?? [];
1637
+ const memoizedOptions = useMemo(() => {
1638
+ if (Array.isArray(subAccounts) && subAccounts.length) {
1639
+ return [
1640
+ ALL_ACCOUNTS,
1641
+ MAIN_ACCOUNT,
1642
+ ...subAccounts.map((value) => ({
1643
+ value: value.id,
1644
+ label: value?.description || formatAddress(value?.id)
1645
+ }))
1646
+ ];
1647
+ }
1648
+ return [ALL_ACCOUNTS, MAIN_ACCOUNT];
1649
+ }, [subAccounts]);
1650
+ const loadMore = () => {
1651
+ if (dataSource2 && dataSource2.length < (pagination?.count || 0)) {
1652
+ pagination?.onPageSizeChange?.(pagination?.pageSize + 50);
1653
+ }
1654
+ };
1655
+ const onCopy = () => {
1656
+ toast.success(t("common.copy.copied"));
1657
+ };
1658
+ const renderHistoryItem = (item) => {
1659
+ const isFromMainAccount = item.from_account_id === state.mainAccountId;
1660
+ const isToMainAccount = item.to_account_id === state.mainAccountId;
1661
+ const fromSubAccount = subAccounts.find(
1662
+ (acc) => acc.id === item.from_account_id
1663
+ );
1664
+ const toSubAccount = subAccounts.find(
1665
+ (acc) => acc.id === item.to_account_id
1666
+ );
1667
+ return /* @__PURE__ */ jsxs(
1668
+ Flex,
1669
+ {
1670
+ p: 2,
1671
+ direction: "column",
1672
+ gapY: 2,
1673
+ className: "oui-rounded-xl oui-bg-base-9 oui-font-semibold",
1674
+ children: [
1675
+ /* @__PURE__ */ jsxs(Flex, { direction: "row", justify: "between", width: "100%", children: [
1676
+ /* @__PURE__ */ jsx(
1677
+ Text.formatted,
1678
+ {
1679
+ rule: "date",
1680
+ className: "oui-text-base-contrast-36 oui-text-2xs",
1681
+ children: item.updated_time
1682
+ }
1683
+ ),
1684
+ /* @__PURE__ */ jsx(Text, { size: "sm", className: "oui-text-base-contrast-80", children: capitalizeString(item.status) })
1685
+ ] }),
1686
+ /* @__PURE__ */ jsx("div", { className: "oui-w-full oui-h-[1px] oui-bg-base-6" }),
1687
+ /* @__PURE__ */ jsxs(Flex, { direction: "row", justify: "between", width: "100%", children: [
1688
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "start", children: [
1689
+ /* @__PURE__ */ jsx(Text, { className: "oui-text-base-contrast-36 oui-text-2xs", children: t("common.token") }),
1690
+ /* @__PURE__ */ jsxs(Flex, { direction: "row", itemAlign: "center", gap: 1, children: [
1691
+ /* @__PURE__ */ jsx(TokenIcon, { name: item.token, size: "2xs" }),
1692
+ /* @__PURE__ */ jsx(Text, { size: "xs", className: "oui-text-base-contrast-80", children: item.token })
1693
+ ] })
1694
+ ] }),
1695
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "end", children: [
1696
+ /* @__PURE__ */ jsx(Text, { className: "oui-text-base-contrast-36 oui-text-2xs", children: t("common.amount") }),
1697
+ /* @__PURE__ */ jsx(
1698
+ Text.numeral,
1699
+ {
1700
+ dp: 6,
1701
+ className: "oui-text-base-contrast-80 oui-text-xs",
1702
+ children: item.amount
1703
+ }
1704
+ )
1705
+ ] })
1706
+ ] }),
1707
+ /* @__PURE__ */ jsxs(Flex, { direction: "row", justify: "between", width: "100%", children: [
1708
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, children: [
1709
+ /* @__PURE__ */ jsxs(Text, { className: "oui-text-base-contrast-36 oui-text-2xs", children: [
1710
+ t("transfer.internalTransfer.from"),
1711
+ " (",
1712
+ t("common.accountId"),
1713
+ ")"
1714
+ ] }),
1715
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, itemAlign: "start", children: [
1716
+ /* @__PURE__ */ jsx(Flex, { direction: "row", itemAlign: "center", gap: 1, children: /* @__PURE__ */ jsx(
1717
+ Text.formatted,
1718
+ {
1719
+ rule: "address",
1720
+ copyable: true,
1721
+ onCopy,
1722
+ className: "oui-text-base-contrast-80 oui-text-xs",
1723
+ children: item.from_account_id
1724
+ }
1725
+ ) }),
1726
+ /* @__PURE__ */ jsx(Badge, { color: "neutral", size: "xs", children: isFromMainAccount ? t("common.mainAccount") : fromSubAccount?.description || t("common.subAccount") })
1727
+ ] })
1728
+ ] }),
1729
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "end", gap: 1, children: [
1730
+ /* @__PURE__ */ jsxs(Text, { className: "oui-text-base-contrast-36 oui-text-2xs", children: [
1731
+ t("transfer.internalTransfer.to"),
1732
+ " (",
1733
+ t("common.accountId"),
1734
+ ")"
1735
+ ] }),
1736
+ /* @__PURE__ */ jsxs(Flex, { direction: "column", itemAlign: "end", gap: 1, children: [
1737
+ /* @__PURE__ */ jsx(Flex, { direction: "row", itemAlign: "center", gap: 1, children: /* @__PURE__ */ jsx(
1738
+ Text.formatted,
1739
+ {
1740
+ rule: "address",
1741
+ copyable: true,
1742
+ onCopy,
1743
+ className: "oui-text-base-contrast-80 oui-text-xs",
1744
+ children: item.to_account_id
1745
+ }
1746
+ ) }),
1747
+ /* @__PURE__ */ jsx(Badge, { color: "neutral", size: "xs", children: isToMainAccount ? t("common.mainAccount") : toSubAccount?.description || t("common.subAccount") })
1748
+ ] })
1749
+ ] })
1750
+ ] })
1751
+ ]
1752
+ }
1753
+ );
1754
+ };
1755
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1756
+ /* @__PURE__ */ jsx("div", { className: "oui-px-3", children: /* @__PURE__ */ jsx(
1757
+ DataFilter,
1758
+ {
1759
+ onFilter,
1760
+ items: produce(
1761
+ [
1762
+ {
1763
+ type: "select",
1764
+ name: "side",
1765
+ value: side,
1766
+ options: [
1767
+ { value: "OUT", label: t("common.outflow") },
1768
+ { value: "IN", label: t("common.inflow") }
1769
+ ]
1770
+ },
1771
+ {
1772
+ type: "range",
1773
+ name: "dateRange",
1774
+ value: {
1775
+ from: dateRange[0],
1776
+ to: dateRange[1]
1777
+ }
1778
+ }
1779
+ ],
1780
+ (draft) => {
1781
+ if (isMainAccount) {
1782
+ draft.unshift({
1783
+ type: "select",
1784
+ name: "account",
1785
+ value: selectedAccount,
1786
+ options: memoizedOptions
1787
+ });
1788
+ }
1789
+ }
1790
+ )
1791
+ }
1792
+ ) }),
1793
+ /* @__PURE__ */ jsx(
1794
+ ListView,
1795
+ {
1796
+ dataSource: dataSource2,
1797
+ renderItem: renderHistoryItem,
1798
+ contentClassName: "!oui-space-y-1",
1799
+ loadMore,
1800
+ isLoading,
1801
+ className: "oui-px-1"
1802
+ }
1803
+ )
1804
+ ] });
1805
+ };
1806
+ }
1807
+ });
1611
1808
  var useColumns2;
1612
1809
  var init_column4 = __esm({
1613
1810
  "src/pages/overview/TransferHistory/column.tsx"() {
@@ -1618,7 +1815,7 @@ var init_column4 = __esm({
1618
1815
  };
1619
1816
  const { state } = useAccount();
1620
1817
  const sub = state.subAccounts ?? [];
1621
- const columns = React7.useMemo(() => {
1818
+ const columns = React12.useMemo(() => {
1622
1819
  return [
1623
1820
  {
1624
1821
  title: t("common.token"),
@@ -1638,7 +1835,7 @@ var init_column4 = __esm({
1638
1835
  rule: "date"
1639
1836
  },
1640
1837
  {
1641
- title: `${t("transfer.internalTransfer.from")} (Account ID)`,
1838
+ title: `${t("transfer.internalTransfer.from")} (${t("common.accountId")})`,
1642
1839
  dataIndex: "from_account_id",
1643
1840
  render(val) {
1644
1841
  const isMainAccount = val === state.mainAccountId;
@@ -1650,7 +1847,7 @@ var init_column4 = __esm({
1650
1847
  }
1651
1848
  },
1652
1849
  {
1653
- title: `${t("transfer.internalTransfer.to")} (Account ID)`,
1850
+ title: `${t("transfer.internalTransfer.to")} (${t("common.accountId")})`,
1654
1851
  dataIndex: "to_account_id",
1655
1852
  render(val) {
1656
1853
  const isMainAccount = val === state.mainAccountId;
@@ -1731,8 +1928,8 @@ var init_transfer_ui = __esm({
1731
1928
  name: "side",
1732
1929
  value: side,
1733
1930
  options: [
1734
- { value: "OUT", label: "Outflow" },
1735
- { value: "IN", label: "Inflow" }
1931
+ { value: "OUT", label: t("common.outflow") },
1932
+ { value: "IN", label: t("common.inflow") }
1736
1933
  ]
1737
1934
  },
1738
1935
  {
@@ -1780,18 +1977,18 @@ var init_useDataSource_script3 = __esm({
1780
1977
  init_date();
1781
1978
  init_transfer_ui();
1782
1979
  useTransferHistoryHook = () => {
1783
- const today = React7.useMemo(() => {
1980
+ const today = React12.useMemo(() => {
1784
1981
  const date = /* @__PURE__ */ new Date();
1785
1982
  return new Date(getYear(date), getMonth(date), getDate(date), 0, 0, 0);
1786
1983
  }, []);
1787
- const [dateRange, setDateRange] = React7.useState([
1984
+ const [dateRange, setDateRange] = React12.useState([
1788
1985
  subtractDaysFromCurrentDate(90, today),
1789
1986
  today
1790
1987
  ]);
1791
1988
  const { page, pageSize, setPage, parsePagination } = usePagination();
1792
1989
  const { state } = useAccount();
1793
- const [selectedAccount, setAccount] = React7.useState("All accounts" /* ALL */);
1794
- const [side, setSide] = React7.useState("OUT");
1990
+ const [selectedAccount, setAccount] = React12.useState("All accounts" /* ALL */);
1991
+ const [side, setSide] = React12.useState("OUT");
1795
1992
  const [data, { isLoading, meta }] = useTransferHistory({
1796
1993
  dataRange: [
1797
1994
  dateRange[0]?.getTime(),
@@ -1807,7 +2004,7 @@ var init_useDataSource_script3 = __esm({
1807
2004
  page,
1808
2005
  main_sub_only: true
1809
2006
  });
1810
- const filteredData = React7.useMemo(() => {
2007
+ const filteredData = React12.useMemo(() => {
1811
2008
  return data.filter((item) => {
1812
2009
  if (!selectedAccount || selectedAccount === "All accounts" /* ALL */) {
1813
2010
  return true;
@@ -1819,7 +2016,7 @@ var init_useDataSource_script3 = __esm({
1819
2016
  }
1820
2017
  });
1821
2018
  }, [data, selectedAccount]);
1822
- const onAccountFilter = React7.useCallback(
2019
+ const onAccountFilter = React12.useCallback(
1823
2020
  (filter) => {
1824
2021
  if (filter.name === "account") {
1825
2022
  setAccount(filter.value);
@@ -1834,7 +2031,7 @@ var init_useDataSource_script3 = __esm({
1834
2031
  },
1835
2032
  [setPage]
1836
2033
  );
1837
- const pagination = React7.useMemo(
2034
+ const pagination = React12.useMemo(
1838
2035
  () => parsePagination(meta),
1839
2036
  [parsePagination, meta]
1840
2037
  );
@@ -1856,11 +2053,16 @@ var init_useDataSource_script3 = __esm({
1856
2053
  var TransferHistoryWidget;
1857
2054
  var init_transfer_widget = __esm({
1858
2055
  "src/pages/overview/TransferHistory/transfer.widget.tsx"() {
2056
+ init_transfer_mobile_ui();
1859
2057
  init_transfer_ui();
1860
2058
  init_useDataSource_script3();
1861
2059
  TransferHistoryWidget = () => {
1862
2060
  const state = useTransferHistoryHook();
1863
2061
  const accountState = useAccount();
2062
+ const { isMobile } = useScreen();
2063
+ if (isMobile) {
2064
+ return /* @__PURE__ */ jsx(TransferHistoryMobileUI, { ...state, ...accountState });
2065
+ }
1864
2066
  return /* @__PURE__ */ jsx(TransferHistoryUI, { ...state, ...accountState });
1865
2067
  };
1866
2068
  }
@@ -1878,421 +2080,30 @@ var init_TransferHistory = __esm({
1878
2080
  init_transfer_ui();
1879
2081
  }
1880
2082
  });
1881
- var useColumns3;
1882
- var init_column5 = __esm({
1883
- "src/pages/overview/VaultsHistory/column.tsx"() {
1884
- useColumns3 = () => {
2083
+ var EMPTY_HOLDING, useAccountsData;
2084
+ var init_useAccountsData = __esm({
2085
+ "src/hooks/useAccountsData.ts"() {
2086
+ EMPTY_HOLDING = {
2087
+ token: "USDC",
2088
+ holding: 0,
2089
+ frozen: 0
2090
+ };
2091
+ useAccountsData = () => {
1885
2092
  const { t } = useTranslation();
1886
- const columns = React7.useMemo(() => {
1887
- return [
1888
- {
1889
- title: t("common.type"),
1890
- dataIndex: "type",
1891
- className: (record) => {
1892
- if (record?.type === "deposit") {
1893
- return "oui-text-success";
1894
- }
1895
- if (record?.type === "withdrawal") {
1896
- return "oui-text-danger";
1897
- }
1898
- return "";
1899
- },
1900
- render(val) {
1901
- if (val === "deposit") {
1902
- return t("common.deposit");
1903
- }
1904
- if (val === "withdrawal") {
1905
- return t("common.withdraw");
1906
- }
1907
- return null;
1908
- }
1909
- },
1910
- {
1911
- title: t("portfolio.overview.vaultName"),
1912
- dataIndex: "vaultName"
1913
- },
1914
- {
1915
- title: t("common.token"),
1916
- dataIndex: "token",
1917
- render(val) {
1918
- return /* @__PURE__ */ jsxs(Flex, { justify: "start", itemAlign: "center", gap: 2, children: [
1919
- /* @__PURE__ */ jsx(TokenIcon, { name: val }),
1920
- val
1921
- ] });
1922
- }
1923
- },
1924
- {
1925
- title: t("common.time"),
1926
- dataIndex: "created_time",
1927
- rule: "date"
1928
- },
1929
- {
1930
- title: t("common.status"),
1931
- dataIndex: "status",
1932
- render(val) {
1933
- return capitalizeString(val);
1934
- }
1935
- },
1936
- {
1937
- title: t("common.amount"),
1938
- dataIndex: "amount_change",
1939
- render(val) {
1940
- return /* @__PURE__ */ jsx(
1941
- Text.numeral,
1942
- {
1943
- showIdentifier: true,
1944
- className: cn(
1945
- "oui-select-none",
1946
- val >= 0 ? "oui-text-success" : "oui-text-danger"
1947
- ),
1948
- children: val
1949
- }
1950
- );
1951
- }
1952
- }
1953
- ];
1954
- }, [t]);
1955
- return columns;
1956
- };
1957
- }
1958
- });
1959
- var VaultsHistoryUI;
1960
- var init_transfer_ui2 = __esm({
1961
- "src/pages/overview/VaultsHistory/transfer.ui.tsx"() {
1962
- init_column5();
1963
- VaultsHistoryUI = (props) => {
1964
- const { dataSource: dataSource2, dateRange, isLoading, onFilter } = props;
1965
- const columns = useColumns3();
1966
- return /* @__PURE__ */ jsxs(Fragment, { children: [
1967
- /* @__PURE__ */ jsx(
1968
- DataFilter,
1969
- {
1970
- onFilter,
1971
- items: [
1972
- {
1973
- type: "range",
1974
- name: "dateRange",
1975
- value: {
1976
- from: dateRange[0],
1977
- to: dateRange[1]
1978
- }
1979
- }
1980
- ]
1981
- }
1982
- ),
1983
- /* @__PURE__ */ jsx(
1984
- AuthGuardDataTable,
1985
- {
1986
- bordered: true,
1987
- columns,
1988
- dataSource: dataSource2,
1989
- loading: isLoading,
1990
- className: "oui-font-semibold",
1991
- classNames: { root: "oui-h-[calc(100%_-_49px)]" },
1992
- pagination: props.pagination,
1993
- generatedRowKey: (row) => row.id
1994
- }
1995
- )
1996
- ] });
1997
- };
1998
- }
1999
- });
2000
- var useVaultsHistoryHook;
2001
- var init_useDataSource_script4 = __esm({
2002
- "src/pages/overview/VaultsHistory/useDataSource.script.ts"() {
2003
- init_date();
2004
- useVaultsHistoryHook = () => {
2005
- const today = React7.useMemo(() => {
2006
- const date = /* @__PURE__ */ new Date();
2007
- return new Date(getYear(date), getMonth(date), getDate(date), 0, 0, 0);
2008
- }, []);
2009
- const [dateRange, setDateRange] = React7.useState([
2010
- subtractDaysFromCurrentDate(90, today),
2011
- today
2012
- ]);
2013
- const { page, pageSize, setPage, parsePagination } = usePagination();
2014
- const [data, { isLoading, meta }] = useVaultsHistory({
2015
- dataRange: [
2016
- dateRange[0]?.getTime(),
2017
- set(dateRange[1], {
2018
- hours: 23,
2019
- minutes: 59,
2020
- seconds: 59,
2021
- milliseconds: 0
2022
- })?.getTime()
2023
- ],
2024
- size: pageSize,
2025
- page
2026
- });
2027
- const dataSource2 = React7.useMemo(() => {
2028
- if (!Array.isArray(data) || !data.length) {
2029
- return [];
2030
- }
2031
- return data.map((item) => ({
2032
- ...item,
2033
- token: "USDC",
2034
- // need to hard code for now
2035
- vaultName: "Orderly OmniVault",
2036
- amount_change: item.type === "withdrawal" ? -item.amount_change : item.amount_change
2037
- }));
2038
- }, [data]);
2039
- const onDateRangeFilter = React7.useCallback(
2040
- (filter) => {
2041
- if (filter.name === "dateRange") {
2042
- setDateRange(parseDateRangeForFilter(filter.value));
2043
- }
2044
- setPage(1);
2045
- },
2046
- [setPage]
2047
- );
2048
- const pagination = React7.useMemo(
2049
- () => parsePagination(meta),
2050
- [parsePagination, meta]
2051
- );
2052
- return {
2053
- dataSource: dataSource2,
2054
- isLoading,
2055
- dateRange,
2056
- onFilter: onDateRangeFilter,
2057
- pagination
2058
- };
2059
- };
2060
- }
2061
- });
2062
- var VaultsHistoryMobile;
2063
- var init_vaults_ui_mobile = __esm({
2064
- "src/pages/overview/VaultsHistory/vaults.ui.mobile.tsx"() {
2065
- VaultsHistoryMobile = (props) => {
2066
- const { dateRange, onFilter, dataSource: dataSource2, isLoading, pagination } = props;
2067
- const { t } = useTranslation();
2068
- const loadMore = () => {
2069
- if (dataSource2.length < (pagination?.count || 0)) {
2070
- pagination?.onPageSizeChange?.(pagination?.pageSize + 50);
2071
- }
2072
- };
2073
- const renderHistoryItem = (item) => {
2074
- const typeColor = item.type === "deposit" ? "buy" : "sell";
2075
- const typeText = item.type === "deposit" ? t("common.deposit") : t("common.withdraw");
2076
- const amountText = item.amount_change ? Math.abs(item.amount_change) : "-";
2077
- return /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-flex-col oui-rounded-xl oui-bg-base-9 oui-p-2 oui-font-semibold", children: [
2078
- /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center oui-justify-between oui-text-sm oui-text-base-contrast-80", children: [
2079
- /* @__PURE__ */ jsx("div", { children: item.vaultName }),
2080
- /* @__PURE__ */ jsx("div", { children: item.status?.slice(0, 1).toUpperCase() + item.status?.slice(1) })
2081
- ] }),
2082
- /* @__PURE__ */ jsx(Text.formatted, { rule: "date", intensity: 36, size: "2xs", children: item.created_time }),
2083
- /* @__PURE__ */ jsx(Divider, { className: "oui-my-2" }),
2084
- /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center [&>div]:oui-flex-1 [&>div]:oui-text-2xs [&>div]:oui-text-base-contrast-36", children: [
2085
- /* @__PURE__ */ jsxs("div", { children: [
2086
- /* @__PURE__ */ jsx("div", { children: t("common.token") }),
2087
- /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center oui-gap-1 oui-text-xs oui-text-base-contrast-80", children: [
2088
- /* @__PURE__ */ jsx(TokenIcon, { name: "USDC", size: "2xs" }),
2089
- /* @__PURE__ */ jsx(Text, { children: "USDC" })
2090
- ] })
2091
- ] }),
2092
- /* @__PURE__ */ jsxs("div", { children: [
2093
- /* @__PURE__ */ jsx("div", { children: t("common.type") }),
2094
- /* @__PURE__ */ jsx(Text, { color: typeColor, className: "oui-text-xs", children: typeText })
2095
- ] }),
2096
- /* @__PURE__ */ jsxs("div", { className: "oui-text-right", children: [
2097
- /* @__PURE__ */ jsx("div", { children: t("common.amount") }),
2098
- /* @__PURE__ */ jsx("div", { className: "oui-text-xs oui-text-base-contrast-80", children: amountText })
2099
- ] })
2100
- ] })
2101
- ] });
2102
- };
2103
- return /* @__PURE__ */ jsxs(Fragment, { children: [
2104
- /* @__PURE__ */ jsx(
2105
- DataFilter,
2106
- {
2107
- items: [
2108
- {
2109
- type: "range",
2110
- name: "dateRange",
2111
- value: {
2112
- from: dateRange[0],
2113
- to: dateRange[1]
2114
- }
2115
- }
2116
- ],
2117
- onFilter: (value) => {
2118
- onFilter(value);
2119
- },
2120
- className: "oui-sticky oui-top-[44px] oui-z-10 oui-border-none oui-bg-base-10 oui-px-3 oui-py-2"
2121
- }
2122
- ),
2123
- /* @__PURE__ */ jsx(
2124
- ListView,
2125
- {
2126
- dataSource: dataSource2,
2127
- renderItem: renderHistoryItem,
2128
- contentClassName: "!oui-space-y-1",
2129
- loadMore,
2130
- isLoading,
2131
- className: "oui-px-1"
2132
- }
2133
- )
2134
- ] });
2135
- };
2136
- }
2137
- });
2138
- var VaultsHistoryWidget;
2139
- var init_transfer_widget2 = __esm({
2140
- "src/pages/overview/VaultsHistory/transfer.widget.tsx"() {
2141
- init_transfer_ui2();
2142
- init_useDataSource_script4();
2143
- init_vaults_ui_mobile();
2144
- VaultsHistoryWidget = () => {
2145
- const state = useVaultsHistoryHook();
2146
- const { isMobile } = useScreen();
2147
- if (isMobile) {
2148
- return /* @__PURE__ */ jsx(VaultsHistoryMobile, { ...state });
2149
- }
2150
- return /* @__PURE__ */ jsx(VaultsHistoryUI, { ...state });
2151
- };
2152
- }
2153
- });
2154
-
2155
- // src/pages/overview/VaultsHistory/index.tsx
2156
- var VaultsHistory_exports = {};
2157
- __export(VaultsHistory_exports, {
2158
- VaultsHistoryUI: () => VaultsHistoryUI,
2159
- VaultsHistoryWidget: () => VaultsHistoryWidget
2160
- });
2161
- var init_VaultsHistory = __esm({
2162
- "src/pages/overview/VaultsHistory/index.tsx"() {
2163
- init_transfer_widget2();
2164
- init_transfer_ui2();
2165
- }
2166
- });
2167
- var LazyAssetHistoryWidget, LazyFundingHistoryWidget, LazyDistributionHistoryWidget, LazyTransferHistoryWidget, LazyVaultsHistoryWidget, HistoryDataGroupDesktop;
2168
- var init_historyDataGroup_ui_desktop = __esm({
2169
- "src/pages/overview/historyDataGroup/historyDataGroup.ui.desktop.tsx"() {
2170
- LazyAssetHistoryWidget = React7.lazy(
2171
- () => Promise.resolve().then(() => (init_assetHistory(), assetHistory_exports)).then((mod) => {
2172
- return { default: mod.AssetHistoryWidget };
2173
- })
2174
- );
2175
- LazyFundingHistoryWidget = React7.lazy(
2176
- () => Promise.resolve().then(() => (init_funding(), funding_exports)).then((mod) => {
2177
- return { default: mod.FundingHistoryWidget };
2178
- })
2179
- );
2180
- LazyDistributionHistoryWidget = React7.lazy(
2181
- () => Promise.resolve().then(() => (init_distribution(), distribution_exports)).then((mod) => {
2182
- return { default: mod.DistributionHistoryWidget };
2183
- })
2184
- );
2185
- LazyTransferHistoryWidget = React7.lazy(
2186
- () => Promise.resolve().then(() => (init_TransferHistory(), TransferHistory_exports)).then((mod) => {
2187
- return { default: mod.TransferHistoryWidget };
2188
- })
2189
- );
2190
- LazyVaultsHistoryWidget = React7.lazy(
2191
- () => Promise.resolve().then(() => (init_VaultsHistory(), VaultsHistory_exports)).then((mod) => {
2192
- return { default: mod.VaultsHistoryWidget };
2193
- })
2194
- );
2195
- HistoryDataGroupDesktop = (props) => {
2196
- const { active = "deposit", onTabChange } = props;
2197
- const { t } = useTranslation();
2198
- const { isMainAccount } = useAccount();
2199
- useEffect(() => {
2200
- if (active === "vaults" && !isMainAccount) {
2201
- onTabChange("deposit");
2202
- }
2203
- }, [active, isMainAccount]);
2204
- return /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(
2205
- Tabs,
2206
- {
2207
- value: active,
2208
- onValueChange: onTabChange,
2209
- variant: "contained",
2210
- size: "xl",
2211
- children: [
2212
- /* @__PURE__ */ jsx(
2213
- TabPanel,
2214
- {
2215
- title: t("common.deposits"),
2216
- icon: /* @__PURE__ */ jsx(ArrowDownSquareFillIcon, {}),
2217
- value: "deposit",
2218
- children: /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyAssetHistoryWidget, { side: AssetHistorySideEnum.DEPOSIT }) })
2219
- }
2220
- ),
2221
- /* @__PURE__ */ jsx(
2222
- TabPanel,
2223
- {
2224
- title: t("common.withdrawals"),
2225
- icon: /* @__PURE__ */ jsx(ArrowUpSquareFillIcon, {}),
2226
- value: "withdraw",
2227
- children: /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyAssetHistoryWidget, { side: AssetHistorySideEnum.WITHDRAW }) })
2228
- }
2229
- ),
2230
- /* @__PURE__ */ jsx(
2231
- TabPanel,
2232
- {
2233
- title: t("common.funding"),
2234
- icon: /* @__PURE__ */ jsx(FeeTierIcon, {}),
2235
- value: "funding",
2236
- children: /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyFundingHistoryWidget, {}) })
2237
- }
2238
- ),
2239
- /* @__PURE__ */ jsx(
2240
- TabPanel,
2241
- {
2242
- title: t("portfolio.overview.distribution"),
2243
- icon: /* @__PURE__ */ jsx(ServerFillIcon, {}),
2244
- value: "distribution",
2245
- children: /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyDistributionHistoryWidget, {}) })
2246
- }
2247
- ),
2248
- /* @__PURE__ */ jsx(
2249
- TabPanel,
2250
- {
2251
- title: t("portfolio.overview.transferHistory"),
2252
- icon: /* @__PURE__ */ jsx(ArrowLeftRightSquareFill, {}),
2253
- value: "transfer",
2254
- children: /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyTransferHistoryWidget, {}) })
2255
- }
2256
- ),
2257
- isMainAccount && /* @__PURE__ */ jsx(
2258
- TabPanel,
2259
- {
2260
- value: "vaults",
2261
- icon: /* @__PURE__ */ jsx(VaultsIcon, {}),
2262
- title: t("portfolio.overview.vaults"),
2263
- children: /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyVaultsHistoryWidget, {}) })
2264
- }
2265
- )
2266
- ]
2267
- }
2268
- ) });
2269
- };
2270
- }
2271
- });
2272
- var EMPTY_HOLDING, useAccountsData;
2273
- var init_useAccountsData = __esm({
2274
- "src/hooks/useAccountsData.ts"() {
2275
- EMPTY_HOLDING = {
2276
- token: "USDC",
2277
- holding: 0,
2278
- frozen: 0
2279
- };
2280
- useAccountsData = () => {
2281
- const { t } = useTranslation();
2282
- const { state, isMainAccount } = useAccount();
2283
- const { holding = [] } = useCollateral();
2284
- const subAccounts = state.subAccounts ?? [];
2285
- return useMemo(() => {
2286
- return produce(subAccounts, (draft) => {
2287
- for (const sub of draft) {
2288
- sub.account_id = sub.id;
2289
- if (Array.isArray(sub.holding) && sub.holding.length) {
2290
- sub.children = sub.holding.map((item) => ({
2291
- ...item,
2292
- account_id: sub.id
2293
- }));
2294
- } else {
2295
- sub.children = [{ ...EMPTY_HOLDING, account_id: sub.id }];
2093
+ const { state, isMainAccount } = useAccount();
2094
+ const { holding = [] } = useCollateral();
2095
+ const subAccounts = state.subAccounts ?? [];
2096
+ return useMemo(() => {
2097
+ return produce(subAccounts, (draft) => {
2098
+ for (const sub of draft) {
2099
+ sub.account_id = sub.id;
2100
+ if (Array.isArray(sub.holding) && sub.holding.length) {
2101
+ sub.children = sub.holding.map((item) => ({
2102
+ ...item,
2103
+ account_id: sub.id
2104
+ }));
2105
+ } else {
2106
+ sub.children = [{ ...EMPTY_HOLDING, account_id: sub.id }];
2296
2107
  }
2297
2108
  Reflect.deleteProperty(sub, "holding");
2298
2109
  }
@@ -2379,7 +2190,7 @@ var init_useAssetTotalValue = __esm({
2379
2190
  var LazyConvertHistoryWidget, TotalValueInfo, DepositAndWithdrawButton, DataFilterSection, AssetsDataTable, AssetsTable;
2380
2191
  var init_assets_ui_desktop = __esm({
2381
2192
  "src/pages/assets/assetsPage/assets.ui.desktop.tsx"() {
2382
- LazyConvertHistoryWidget = React7.lazy(
2193
+ LazyConvertHistoryWidget = React12.lazy(
2383
2194
  () => Promise.resolve().then(() => (init_convert_widget(), convert_widget_exports)).then((mod) => {
2384
2195
  return { default: mod.ConvertHistoryWidget };
2385
2196
  })
@@ -2683,7 +2494,19 @@ var init_assets_ui_desktop = __esm({
2683
2494
  value: "convertHistory",
2684
2495
  className: "oui-rounded-xl oui-bg-base-9 oui-px-6",
2685
2496
  title: t("portfolio.overview.tab.convert.history"),
2686
- children: /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyConvertHistoryWidget, {}) })
2497
+ children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsxs(
2498
+ Flex,
2499
+ {
2500
+ direction: "column",
2501
+ mt: 4,
2502
+ itemAlign: "center",
2503
+ className: "oui-w-full",
2504
+ children: [
2505
+ /* @__PURE__ */ jsx(Divider, { className: "oui-w-full oui-border-b oui-border-line-4 oui-pt-6" }),
2506
+ /* @__PURE__ */ jsx(LazyConvertHistoryWidget, {})
2507
+ ]
2508
+ }
2509
+ ) })
2687
2510
  }
2688
2511
  )
2689
2512
  ]
@@ -2705,7 +2528,7 @@ var init_useAssetsAccountFilter = __esm({
2705
2528
  init_assets_ui_desktop();
2706
2529
  useAssetsAccountFilter = (data) => {
2707
2530
  const { state, isMainAccount } = useAccount();
2708
- const [selectedAccount, setSelectedAccount] = React7.useState(
2531
+ const [selectedAccount, setSelectedAccount] = React12.useState(
2709
2532
  "All accounts" /* ALL */
2710
2533
  );
2711
2534
  const filteredData = useMemo(() => {
@@ -2724,7 +2547,7 @@ var init_useAssetsAccountFilter = __esm({
2724
2547
  }
2725
2548
  });
2726
2549
  }, [data, selectedAccount, isMainAccount, state]);
2727
- const onAccountFilter = React7.useCallback(
2550
+ const onAccountFilter = React12.useCallback(
2728
2551
  (filter) => {
2729
2552
  const { name, value } = filter;
2730
2553
  if (name === "account") {
@@ -2742,10 +2565,10 @@ var init_useAssetsAccountFilter = __esm({
2742
2565
  };
2743
2566
  useAssetsMultiFilter = (data) => {
2744
2567
  const { state, isMainAccount } = useAccount();
2745
- const [selectedAccount, setSelectedAccount] = React7.useState(
2568
+ const [selectedAccount, setSelectedAccount] = React12.useState(
2746
2569
  "All accounts" /* ALL */
2747
2570
  );
2748
- const [selectedAsset, setSelectedAsset] = React7.useState("all");
2571
+ const [selectedAsset, setSelectedAsset] = React12.useState("all");
2749
2572
  const filteredData = useMemo(() => {
2750
2573
  let accountFiltered = data;
2751
2574
  if (isMainAccount) {
@@ -2778,7 +2601,7 @@ var init_useAssetsAccountFilter = __esm({
2778
2601
  }
2779
2602
  return accountFiltered;
2780
2603
  }, [data, selectedAccount, selectedAsset, isMainAccount, state]);
2781
- const onFilter = React7.useCallback(
2604
+ const onFilter = React12.useCallback(
2782
2605
  (filter) => {
2783
2606
  const { name, value } = filter;
2784
2607
  if (name === "account") {
@@ -2816,6 +2639,7 @@ var init_convert_script = __esm({
2816
2639
  init_hooks();
2817
2640
  init_date();
2818
2641
  useConvertScript = () => {
2642
+ const { t } = useTranslation();
2819
2643
  const { isMainAccount, state } = useAccount();
2820
2644
  const { holding = [] } = useCollateral();
2821
2645
  const { data: indexPrices } = useIndexPricesStream();
@@ -2842,9 +2666,9 @@ var init_convert_script = __esm({
2842
2666
  value: item.token,
2843
2667
  label: item.token
2844
2668
  })) || [];
2845
- return [{ label: "All assets", value: "all" }, ...assetOptions];
2846
- }, [tokensInfo]);
2847
- const onFilter = React7.useCallback(
2669
+ return [{ label: t("common.allAssets"), value: "all" }, ...assetOptions];
2670
+ }, [tokensInfo, t]);
2671
+ const onFilter = React12.useCallback(
2848
2672
  (filter) => {
2849
2673
  const { name, value } = filter;
2850
2674
  if (name === "account") {
@@ -2864,7 +2688,7 @@ var init_convert_script = __esm({
2864
2688
  },
2865
2689
  [onAccountFilter, setPage]
2866
2690
  );
2867
- const queryUrl = React7.useMemo(() => {
2691
+ const queryUrl = React12.useMemo(() => {
2868
2692
  const params = new URLSearchParams();
2869
2693
  params.set("page", page.toString());
2870
2694
  params.set("size", pageSize.toString());
@@ -3031,7 +2855,7 @@ var init_convert_column = __esm({
3031
2855
  e.stopPropagation();
3032
2856
  toast.success(t("common.copy.copied"));
3033
2857
  };
3034
- const columns = React7.useMemo(() => {
2858
+ const columns = React12.useMemo(() => {
3035
2859
  return [
3036
2860
  {
3037
2861
  title: t("portfolio.overview.column.convert.convertedAsset"),
@@ -3128,7 +2952,7 @@ var init_convert_column = __esm({
3128
2952
  e.stopPropagation();
3129
2953
  toast.success(t("common.copy.copied"));
3130
2954
  };
3131
- const columns = React7.useMemo(() => {
2955
+ const columns = React12.useMemo(() => {
3132
2956
  return [
3133
2957
  {
3134
2958
  title: t("portfolio.overview.column.convert.convertedAsset"),
@@ -3220,24 +3044,10 @@ var init_convert_column = __esm({
3220
3044
  };
3221
3045
  }
3222
3046
  });
3223
- var CONVERT_STATUS_OPTIONS, ConvertDetailsModal, ConvertDesktopUI;
3047
+ var ConvertDetailsModal, ConvertDesktopUI;
3224
3048
  var init_convert_ui_desktop = __esm({
3225
3049
  "src/pages/assets/convertPage/convert.ui.desktop.tsx"() {
3226
3050
  init_convert_column();
3227
- CONVERT_STATUS_OPTIONS = [
3228
- {
3229
- label: "All status",
3230
- value: "all"
3231
- },
3232
- {
3233
- label: "Completed",
3234
- value: "completed"
3235
- },
3236
- {
3237
- label: "Pending",
3238
- value: "pending"
3239
- }
3240
- ];
3241
3051
  ConvertDetailsModal = modal.create((props) => {
3242
3052
  const { t } = useTranslation();
3243
3053
  const { visible, onOpenChange } = useModal();
@@ -3265,7 +3075,7 @@ var init_convert_ui_desktop = __esm({
3265
3075
  className: "oui-w-full",
3266
3076
  classNames: {
3267
3077
  header: "oui-h-10",
3268
- root: "oui-bg-base-8 oui-max-h-[60vh] oui-overflow-y-scroll"
3078
+ root: "oui-bg-base-8 oui-max-h-[60vh] oui-overflow-y-scroll oui-custom-scrollbar"
3269
3079
  },
3270
3080
  onRow: () => ({
3271
3081
  className: "oui-h-[40px]"
@@ -3279,6 +3089,7 @@ var init_convert_ui_desktop = __esm({
3279
3089
  ConvertDesktopUI = ({
3280
3090
  convertState
3281
3091
  }) => {
3092
+ const { t } = useTranslation();
3282
3093
  const handleDetailsClick = (convertId) => {
3283
3094
  const record = convertState.dataSource.find(
3284
3095
  (item) => item.convert_id === convertId
@@ -3301,6 +3112,14 @@ var init_convert_ui_desktop = __esm({
3301
3112
  onFilter,
3302
3113
  convertedAssetOptions
3303
3114
  } = convertState;
3115
+ const statusOptions = useMemo(
3116
+ () => [
3117
+ { label: t("common.status.all"), value: "all" },
3118
+ { label: t("orders.status.completed"), value: "completed" },
3119
+ { label: t("orders.status.pending"), value: "pending" }
3120
+ ],
3121
+ [t]
3122
+ );
3304
3123
  const dataFilter = useMemo(() => {
3305
3124
  return /* @__PURE__ */ jsx(
3306
3125
  DataFilter,
@@ -3324,7 +3143,7 @@ var init_convert_ui_desktop = __esm({
3324
3143
  type: "select",
3325
3144
  name: "status",
3326
3145
  value: statusFilter,
3327
- options: CONVERT_STATUS_OPTIONS
3146
+ options: statusOptions
3328
3147
  },
3329
3148
  {
3330
3149
  type: "range",
@@ -3342,24 +3161,23 @@ var init_convert_ui_desktop = __esm({
3342
3161
  statusFilter,
3343
3162
  dateRange,
3344
3163
  onFilter,
3345
- convertedAssetOptions
3164
+ convertedAssetOptions,
3165
+ statusOptions
3346
3166
  ]);
3347
- return /* @__PURE__ */ jsxs(Flex, { direction: "column", mt: 4, itemAlign: "center", className: "oui-w-full", children: [
3348
- /* @__PURE__ */ jsx(Divider, { className: "oui-w-full oui-border-b oui-border-line-4 oui-pt-6" }),
3349
- /* @__PURE__ */ jsx(Flex, { direction: "row", className: "oui-w-full", children: dataFilter }),
3167
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3168
+ dataFilter,
3350
3169
  /* @__PURE__ */ jsx(
3351
3170
  AuthGuardDataTable,
3352
3171
  {
3172
+ bordered: true,
3353
3173
  columns,
3354
3174
  dataSource: convertState.dataSource,
3355
3175
  loading: convertState.isLoading,
3356
- bordered: true,
3357
3176
  pagination: convertState.pagination,
3358
3177
  manualPagination: true,
3359
3178
  className: "oui-mt-4 oui-w-full",
3360
3179
  classNames: {
3361
- root: "oui-h-[calc(100vh_-_200px)]",
3362
- header: "oui-h-12"
3180
+ root: "oui-h-[calc(100%_-_49px)]"
3363
3181
  },
3364
3182
  onRow: () => ({
3365
3183
  className: "oui-h-[48px] oui-cursor-pointer"
@@ -3377,7 +3195,6 @@ var ConvertMobileUI, ConvertMobileField, ConvertMobileItem, ConverHistoryItemDet
3377
3195
  var init_convert_ui_mobile = __esm({
3378
3196
  "src/pages/assets/convertPage/convert.ui.mobile.tsx"() {
3379
3197
  init_convert_column();
3380
- init_convert_ui_desktop();
3381
3198
  ConvertMobileUI = ({
3382
3199
  convertState
3383
3200
  }) => {
@@ -3389,6 +3206,14 @@ var init_convert_ui_mobile = __esm({
3389
3206
  onFilter,
3390
3207
  convertedAssetOptions
3391
3208
  } = convertState;
3209
+ const statusOptions = useMemo(
3210
+ () => [
3211
+ { label: t("common.status.all"), value: "all" },
3212
+ { label: t("orders.status.completed"), value: "completed" },
3213
+ { label: t("orders.status.pending"), value: "pending" }
3214
+ ],
3215
+ [t]
3216
+ );
3392
3217
  const dataFilter = useMemo(() => {
3393
3218
  return /* @__PURE__ */ jsx(
3394
3219
  DataFilter,
@@ -3415,7 +3240,7 @@ var init_convert_ui_mobile = __esm({
3415
3240
  type: "picker",
3416
3241
  name: "status",
3417
3242
  value: statusFilter,
3418
- options: CONVERT_STATUS_OPTIONS,
3243
+ options: statusOptions,
3419
3244
  className: "oui-whitespace-nowrap"
3420
3245
  },
3421
3246
  {
@@ -3434,7 +3259,8 @@ var init_convert_ui_mobile = __esm({
3434
3259
  statusFilter,
3435
3260
  dateRange,
3436
3261
  onFilter,
3437
- convertedAssetOptions
3262
+ convertedAssetOptions,
3263
+ statusOptions
3438
3264
  ]);
3439
3265
  return /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-flex-col oui-gap-1 oui-px-3", children: [
3440
3266
  /* @__PURE__ */ jsx(ScrollIndicator, { className: "oui-pr-5", children: /* @__PURE__ */ jsx(Flex, { direction: "row", children: dataFilter }) }),
@@ -3621,32 +3447,436 @@ var init_convert_ui_mobile = __esm({
3621
3447
  ] })) })
3622
3448
  }
3623
3449
  );
3624
- });
3450
+ });
3451
+ }
3452
+ });
3453
+
3454
+ // src/pages/assets/convertPage/convert.widget.tsx
3455
+ var convert_widget_exports = {};
3456
+ __export(convert_widget_exports, {
3457
+ ConvertHistoryWidget: () => ConvertHistoryWidget
3458
+ });
3459
+ var ConvertHistoryWidget;
3460
+ var init_convert_widget = __esm({
3461
+ "src/pages/assets/convertPage/convert.widget.tsx"() {
3462
+ init_convert_script();
3463
+ init_convert_ui_desktop();
3464
+ init_convert_ui_mobile();
3465
+ ConvertHistoryWidget = () => {
3466
+ const convertState = useConvertScript();
3467
+ const { isMobile } = useScreen();
3468
+ if (isMobile) {
3469
+ return /* @__PURE__ */ jsx(ConvertMobileUI, { convertState });
3470
+ }
3471
+ return /* @__PURE__ */ jsx(ConvertDesktopUI, { convertState });
3472
+ };
3473
+ }
3474
+ });
3475
+ var useColumns3;
3476
+ var init_column5 = __esm({
3477
+ "src/pages/overview/VaultsHistory/column.tsx"() {
3478
+ useColumns3 = () => {
3479
+ const { t } = useTranslation();
3480
+ const columns = React12.useMemo(() => {
3481
+ return [
3482
+ {
3483
+ title: t("common.type"),
3484
+ dataIndex: "type",
3485
+ className: (record) => {
3486
+ if (record?.type === "deposit") {
3487
+ return "oui-text-success";
3488
+ }
3489
+ if (record?.type === "withdrawal") {
3490
+ return "oui-text-danger";
3491
+ }
3492
+ return "";
3493
+ },
3494
+ render(val) {
3495
+ if (val === "deposit") {
3496
+ return t("common.deposit");
3497
+ }
3498
+ if (val === "withdrawal") {
3499
+ return t("common.withdraw");
3500
+ }
3501
+ return null;
3502
+ }
3503
+ },
3504
+ {
3505
+ title: t("portfolio.overview.vaultName"),
3506
+ dataIndex: "vaultName"
3507
+ },
3508
+ {
3509
+ title: t("common.token"),
3510
+ dataIndex: "token",
3511
+ render(val) {
3512
+ return /* @__PURE__ */ jsxs(Flex, { justify: "start", itemAlign: "center", gap: 2, children: [
3513
+ /* @__PURE__ */ jsx(TokenIcon, { name: val }),
3514
+ val
3515
+ ] });
3516
+ }
3517
+ },
3518
+ {
3519
+ title: t("common.time"),
3520
+ dataIndex: "created_time",
3521
+ rule: "date"
3522
+ },
3523
+ {
3524
+ title: t("common.status"),
3525
+ dataIndex: "status",
3526
+ render(val) {
3527
+ return capitalizeString(val);
3528
+ }
3529
+ },
3530
+ {
3531
+ title: t("common.amount"),
3532
+ dataIndex: "amount_change",
3533
+ render(val) {
3534
+ return /* @__PURE__ */ jsx(
3535
+ Text.numeral,
3536
+ {
3537
+ showIdentifier: true,
3538
+ className: cn(
3539
+ "oui-select-none",
3540
+ val >= 0 ? "oui-text-success" : "oui-text-danger"
3541
+ ),
3542
+ children: val
3543
+ }
3544
+ );
3545
+ }
3546
+ }
3547
+ ];
3548
+ }, [t]);
3549
+ return columns;
3550
+ };
3551
+ }
3552
+ });
3553
+ var VaultsHistoryUI;
3554
+ var init_transfer_ui2 = __esm({
3555
+ "src/pages/overview/VaultsHistory/transfer.ui.tsx"() {
3556
+ init_column5();
3557
+ VaultsHistoryUI = (props) => {
3558
+ const { dataSource: dataSource2, dateRange, isLoading, onFilter } = props;
3559
+ const columns = useColumns3();
3560
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3561
+ /* @__PURE__ */ jsx(
3562
+ DataFilter,
3563
+ {
3564
+ onFilter,
3565
+ items: [
3566
+ {
3567
+ type: "range",
3568
+ name: "dateRange",
3569
+ value: {
3570
+ from: dateRange[0],
3571
+ to: dateRange[1]
3572
+ }
3573
+ }
3574
+ ]
3575
+ }
3576
+ ),
3577
+ /* @__PURE__ */ jsx(
3578
+ AuthGuardDataTable,
3579
+ {
3580
+ bordered: true,
3581
+ columns,
3582
+ dataSource: dataSource2,
3583
+ loading: isLoading,
3584
+ className: "oui-font-semibold",
3585
+ classNames: { root: "oui-h-[calc(100%_-_49px)]" },
3586
+ pagination: props.pagination,
3587
+ generatedRowKey: (row) => row.id
3588
+ }
3589
+ )
3590
+ ] });
3591
+ };
3592
+ }
3593
+ });
3594
+ var useVaultsHistoryHook;
3595
+ var init_useDataSource_script4 = __esm({
3596
+ "src/pages/overview/VaultsHistory/useDataSource.script.ts"() {
3597
+ init_date();
3598
+ useVaultsHistoryHook = () => {
3599
+ const today = React12.useMemo(() => {
3600
+ const date = /* @__PURE__ */ new Date();
3601
+ return new Date(getYear(date), getMonth(date), getDate(date), 0, 0, 0);
3602
+ }, []);
3603
+ const [dateRange, setDateRange] = React12.useState([
3604
+ subtractDaysFromCurrentDate(90, today),
3605
+ today
3606
+ ]);
3607
+ const { page, pageSize, setPage, parsePagination } = usePagination();
3608
+ const [data, { isLoading, meta }] = useVaultsHistory({
3609
+ dataRange: [
3610
+ dateRange[0]?.getTime(),
3611
+ set(dateRange[1], {
3612
+ hours: 23,
3613
+ minutes: 59,
3614
+ seconds: 59,
3615
+ milliseconds: 0
3616
+ })?.getTime()
3617
+ ],
3618
+ size: pageSize,
3619
+ page
3620
+ });
3621
+ const dataSource2 = React12.useMemo(() => {
3622
+ if (!Array.isArray(data) || !data.length) {
3623
+ return [];
3624
+ }
3625
+ return data.map((item) => ({
3626
+ ...item,
3627
+ token: "USDC",
3628
+ // need to hard code for now
3629
+ vaultName: "Orderly OmniVault",
3630
+ amount_change: item.type === "withdrawal" ? -item.amount_change : item.amount_change
3631
+ }));
3632
+ }, [data]);
3633
+ const onDateRangeFilter = React12.useCallback(
3634
+ (filter) => {
3635
+ if (filter.name === "dateRange") {
3636
+ setDateRange(parseDateRangeForFilter(filter.value));
3637
+ }
3638
+ setPage(1);
3639
+ },
3640
+ [setPage]
3641
+ );
3642
+ const pagination = React12.useMemo(
3643
+ () => parsePagination(meta),
3644
+ [parsePagination, meta]
3645
+ );
3646
+ return {
3647
+ dataSource: dataSource2,
3648
+ isLoading,
3649
+ dateRange,
3650
+ onFilter: onDateRangeFilter,
3651
+ pagination
3652
+ };
3653
+ };
3625
3654
  }
3626
3655
  });
3627
-
3628
- // src/pages/assets/convertPage/convert.widget.tsx
3629
- var convert_widget_exports = {};
3630
- __export(convert_widget_exports, {
3631
- ConvertHistoryWidget: () => ConvertHistoryWidget
3656
+ var VaultsHistoryMobile;
3657
+ var init_vaults_ui_mobile = __esm({
3658
+ "src/pages/overview/VaultsHistory/vaults.ui.mobile.tsx"() {
3659
+ VaultsHistoryMobile = (props) => {
3660
+ const { dateRange, onFilter, dataSource: dataSource2, isLoading, pagination } = props;
3661
+ const { t } = useTranslation();
3662
+ const loadMore = () => {
3663
+ if (dataSource2.length < (pagination?.count || 0)) {
3664
+ pagination?.onPageSizeChange?.(pagination?.pageSize + 50);
3665
+ }
3666
+ };
3667
+ const renderHistoryItem = (item) => {
3668
+ const typeColor = item.type === "deposit" ? "buy" : "sell";
3669
+ const typeText = item.type === "deposit" ? t("common.deposit") : t("common.withdraw");
3670
+ const amountText = item.amount_change ? Math.abs(item.amount_change) : "-";
3671
+ return /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-flex-col oui-rounded-xl oui-bg-base-9 oui-p-2 oui-font-semibold", children: [
3672
+ /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center oui-justify-between oui-text-sm oui-text-base-contrast-80", children: [
3673
+ /* @__PURE__ */ jsx("div", { children: item.vaultName }),
3674
+ /* @__PURE__ */ jsx("div", { children: item.status?.slice(0, 1).toUpperCase() + item.status?.slice(1) })
3675
+ ] }),
3676
+ /* @__PURE__ */ jsx(Text.formatted, { rule: "date", intensity: 36, size: "2xs", children: item.created_time }),
3677
+ /* @__PURE__ */ jsx(Divider, { className: "oui-my-2" }),
3678
+ /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center [&>div]:oui-flex-1 [&>div]:oui-text-2xs [&>div]:oui-text-base-contrast-36", children: [
3679
+ /* @__PURE__ */ jsxs("div", { children: [
3680
+ /* @__PURE__ */ jsx("div", { children: t("common.token") }),
3681
+ /* @__PURE__ */ jsxs("div", { className: "oui-flex oui-items-center oui-gap-1 oui-text-xs oui-text-base-contrast-80", children: [
3682
+ /* @__PURE__ */ jsx(TokenIcon, { name: "USDC", size: "2xs" }),
3683
+ /* @__PURE__ */ jsx(Text, { children: "USDC" })
3684
+ ] })
3685
+ ] }),
3686
+ /* @__PURE__ */ jsxs("div", { children: [
3687
+ /* @__PURE__ */ jsx("div", { children: t("common.type") }),
3688
+ /* @__PURE__ */ jsx(Text, { color: typeColor, className: "oui-text-xs", children: typeText })
3689
+ ] }),
3690
+ /* @__PURE__ */ jsxs("div", { className: "oui-text-right", children: [
3691
+ /* @__PURE__ */ jsx("div", { children: t("common.amount") }),
3692
+ /* @__PURE__ */ jsx("div", { className: "oui-text-xs oui-text-base-contrast-80", children: amountText })
3693
+ ] })
3694
+ ] })
3695
+ ] });
3696
+ };
3697
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3698
+ /* @__PURE__ */ jsx(
3699
+ DataFilter,
3700
+ {
3701
+ items: [
3702
+ {
3703
+ type: "range",
3704
+ name: "dateRange",
3705
+ value: {
3706
+ from: dateRange[0],
3707
+ to: dateRange[1]
3708
+ }
3709
+ }
3710
+ ],
3711
+ onFilter: (value) => {
3712
+ onFilter(value);
3713
+ },
3714
+ className: "oui-sticky oui-top-[44px] oui-z-10 oui-border-none oui-bg-base-10 oui-px-3 oui-py-2"
3715
+ }
3716
+ ),
3717
+ /* @__PURE__ */ jsx(
3718
+ ListView,
3719
+ {
3720
+ dataSource: dataSource2,
3721
+ renderItem: renderHistoryItem,
3722
+ contentClassName: "!oui-space-y-1",
3723
+ loadMore,
3724
+ isLoading,
3725
+ className: "oui-px-1"
3726
+ }
3727
+ )
3728
+ ] });
3729
+ };
3730
+ }
3632
3731
  });
3633
- var ConvertHistoryWidget;
3634
- var init_convert_widget = __esm({
3635
- "src/pages/assets/convertPage/convert.widget.tsx"() {
3636
- init_convert_script();
3637
- init_convert_ui_desktop();
3638
- init_convert_ui_mobile();
3639
- ConvertHistoryWidget = () => {
3640
- const convertState = useConvertScript();
3732
+ var VaultsHistoryWidget;
3733
+ var init_transfer_widget2 = __esm({
3734
+ "src/pages/overview/VaultsHistory/transfer.widget.tsx"() {
3735
+ init_transfer_ui2();
3736
+ init_useDataSource_script4();
3737
+ init_vaults_ui_mobile();
3738
+ VaultsHistoryWidget = () => {
3739
+ const state = useVaultsHistoryHook();
3641
3740
  const { isMobile } = useScreen();
3642
3741
  if (isMobile) {
3643
- return /* @__PURE__ */ jsx(ConvertMobileUI, { convertState });
3742
+ return /* @__PURE__ */ jsx(VaultsHistoryMobile, { ...state });
3644
3743
  }
3645
- return /* @__PURE__ */ jsx(ConvertDesktopUI, { convertState });
3744
+ return /* @__PURE__ */ jsx(VaultsHistoryUI, { ...state });
3646
3745
  };
3647
3746
  }
3648
3747
  });
3649
- var HistoryDataGroupMobile;
3748
+
3749
+ // src/pages/overview/VaultsHistory/index.tsx
3750
+ var VaultsHistory_exports = {};
3751
+ __export(VaultsHistory_exports, {
3752
+ VaultsHistoryUI: () => VaultsHistoryUI,
3753
+ VaultsHistoryWidget: () => VaultsHistoryWidget
3754
+ });
3755
+ var init_VaultsHistory = __esm({
3756
+ "src/pages/overview/VaultsHistory/index.tsx"() {
3757
+ init_transfer_widget2();
3758
+ init_transfer_ui2();
3759
+ }
3760
+ });
3761
+ var LazyAssetHistoryWidget, LazyFundingHistoryWidget, LazyDistributionHistoryWidget, LazyTransferHistoryWidget, LazyConvertHistoryWidget2, LazyVaultsHistoryWidget, HistoryDataGroupDesktop;
3762
+ var init_historyDataGroup_ui_desktop = __esm({
3763
+ "src/pages/overview/historyDataGroup/historyDataGroup.ui.desktop.tsx"() {
3764
+ LazyAssetHistoryWidget = React12.lazy(
3765
+ () => Promise.resolve().then(() => (init_assetHistory(), assetHistory_exports)).then((mod) => {
3766
+ return { default: mod.AssetHistoryWidget };
3767
+ })
3768
+ );
3769
+ LazyFundingHistoryWidget = React12.lazy(
3770
+ () => Promise.resolve().then(() => (init_funding(), funding_exports)).then((mod) => {
3771
+ return { default: mod.FundingHistoryWidget };
3772
+ })
3773
+ );
3774
+ LazyDistributionHistoryWidget = React12.lazy(
3775
+ () => Promise.resolve().then(() => (init_distribution(), distribution_exports)).then((mod) => {
3776
+ return { default: mod.DistributionHistoryWidget };
3777
+ })
3778
+ );
3779
+ LazyTransferHistoryWidget = React12.lazy(
3780
+ () => Promise.resolve().then(() => (init_TransferHistory(), TransferHistory_exports)).then((mod) => {
3781
+ return { default: mod.TransferHistoryWidget };
3782
+ })
3783
+ );
3784
+ LazyConvertHistoryWidget2 = React12.lazy(
3785
+ () => Promise.resolve().then(() => (init_convert_widget(), convert_widget_exports)).then((mod) => {
3786
+ return { default: mod.ConvertHistoryWidget };
3787
+ })
3788
+ );
3789
+ LazyVaultsHistoryWidget = React12.lazy(
3790
+ () => Promise.resolve().then(() => (init_VaultsHistory(), VaultsHistory_exports)).then((mod) => {
3791
+ return { default: mod.VaultsHistoryWidget };
3792
+ })
3793
+ );
3794
+ HistoryDataGroupDesktop = (props) => {
3795
+ const { active = "deposit", onTabChange } = props;
3796
+ const { t } = useTranslation();
3797
+ const { isMainAccount } = useAccount();
3798
+ useEffect(() => {
3799
+ if (active === "vaults" && !isMainAccount) {
3800
+ onTabChange("deposit");
3801
+ }
3802
+ }, [active, isMainAccount]);
3803
+ return /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(
3804
+ Tabs,
3805
+ {
3806
+ value: active,
3807
+ onValueChange: onTabChange,
3808
+ variant: "contained",
3809
+ size: "xl",
3810
+ children: [
3811
+ /* @__PURE__ */ jsx(
3812
+ TabPanel,
3813
+ {
3814
+ title: t("common.deposits"),
3815
+ icon: /* @__PURE__ */ jsx(ArrowDownSquareFillIcon, {}),
3816
+ value: "deposit",
3817
+ children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyAssetHistoryWidget, { side: AssetHistorySideEnum.DEPOSIT }) })
3818
+ }
3819
+ ),
3820
+ /* @__PURE__ */ jsx(
3821
+ TabPanel,
3822
+ {
3823
+ title: t("common.withdrawals"),
3824
+ icon: /* @__PURE__ */ jsx(ArrowUpSquareFillIcon, {}),
3825
+ value: "withdraw",
3826
+ children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyAssetHistoryWidget, { side: AssetHistorySideEnum.WITHDRAW }) })
3827
+ }
3828
+ ),
3829
+ /* @__PURE__ */ jsx(
3830
+ TabPanel,
3831
+ {
3832
+ title: t("common.funding"),
3833
+ icon: /* @__PURE__ */ jsx(FeeTierIcon, {}),
3834
+ value: "funding",
3835
+ children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyFundingHistoryWidget, {}) })
3836
+ }
3837
+ ),
3838
+ /* @__PURE__ */ jsx(
3839
+ TabPanel,
3840
+ {
3841
+ title: t("portfolio.overview.distribution"),
3842
+ icon: /* @__PURE__ */ jsx(ServerFillIcon, {}),
3843
+ value: "distribution",
3844
+ children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyDistributionHistoryWidget, {}) })
3845
+ }
3846
+ ),
3847
+ /* @__PURE__ */ jsx(
3848
+ TabPanel,
3849
+ {
3850
+ title: t("portfolio.overview.transferHistory"),
3851
+ icon: /* @__PURE__ */ jsx(ArrowLeftRightSquareFill, {}),
3852
+ value: "transfer",
3853
+ children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyTransferHistoryWidget, {}) })
3854
+ }
3855
+ ),
3856
+ /* @__PURE__ */ jsx(
3857
+ TabPanel,
3858
+ {
3859
+ title: t("portfolio.overview.tab.convert.history"),
3860
+ value: "convert",
3861
+ children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyConvertHistoryWidget2, {}) })
3862
+ }
3863
+ ),
3864
+ isMainAccount && /* @__PURE__ */ jsx(
3865
+ TabPanel,
3866
+ {
3867
+ value: "vaults",
3868
+ icon: /* @__PURE__ */ jsx(VaultsIcon, {}),
3869
+ title: t("portfolio.overview.vaults"),
3870
+ children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyVaultsHistoryWidget, {}) })
3871
+ }
3872
+ )
3873
+ ]
3874
+ }
3875
+ ) });
3876
+ };
3877
+ }
3878
+ });
3879
+ var LazyTransferHistoryWidget2, HistoryDataGroupMobile;
3650
3880
  var init_historyDataGroup_ui_mobile = __esm({
3651
3881
  "src/pages/overview/historyDataGroup/historyDataGroup.ui.mobile.tsx"() {
3652
3882
  init_convert_widget();
@@ -3654,6 +3884,11 @@ var init_historyDataGroup_ui_mobile = __esm({
3654
3884
  init_assetHistory();
3655
3885
  init_distribution();
3656
3886
  init_funding();
3887
+ LazyTransferHistoryWidget2 = React12.lazy(
3888
+ () => Promise.resolve().then(() => (init_TransferHistory(), TransferHistory_exports)).then((mod) => {
3889
+ return { default: mod.TransferHistoryWidget };
3890
+ })
3891
+ );
3657
3892
  HistoryDataGroupMobile = (props) => {
3658
3893
  const { active = "deposit", onTabChange } = props;
3659
3894
  const { t } = useTranslation();
@@ -3681,6 +3916,14 @@ var init_historyDataGroup_ui_mobile = __esm({
3681
3916
  children: /* @__PURE__ */ jsx(DistributionHistoryWidget, {})
3682
3917
  }
3683
3918
  ),
3919
+ /* @__PURE__ */ jsx(
3920
+ TabPanel,
3921
+ {
3922
+ title: t("portfolio.overview.transferHistory"),
3923
+ value: "transfer",
3924
+ children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyTransferHistoryWidget2, {}) })
3925
+ }
3926
+ ),
3684
3927
  /* @__PURE__ */ jsx(
3685
3928
  TabPanel,
3686
3929
  {
@@ -4169,7 +4412,7 @@ var init_periodHeader = __esm({
4169
4412
  var LazyPeriodTitle, AssetsChart;
4170
4413
  var init_assetsChart_ui = __esm({
4171
4414
  "src/pages/overview/assetChart/assetsChart.ui.tsx"() {
4172
- LazyPeriodTitle = React7.lazy(
4415
+ LazyPeriodTitle = React12.lazy(
4173
4416
  () => Promise.resolve().then(() => (init_periodHeader(), periodHeader_exports)).then((mod) => {
4174
4417
  return { default: mod.PeriodTitle };
4175
4418
  })
@@ -4180,7 +4423,7 @@ var init_assetsChart_ui = __esm({
4180
4423
  return /* @__PURE__ */ jsx(
4181
4424
  Card,
4182
4425
  {
4183
- title: /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
4426
+ title: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
4184
4427
  LazyPeriodTitle,
4185
4428
  {
4186
4429
  onPeriodChange,
@@ -4191,7 +4434,7 @@ var init_assetsChart_ui = __esm({
4191
4434
  ) }),
4192
4435
  id: "portfolio-overview-assets-chart",
4193
4436
  classNames: { content: "oui-h-[168px] oui-pb-0" },
4194
- children: /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(AssetAreaChart, { data, invisible: props.invisible }) })
4437
+ children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(AssetAreaChart, { data, invisible: props.invisible }) })
4195
4438
  }
4196
4439
  );
4197
4440
  };
@@ -4226,7 +4469,7 @@ var init_assetChart = __esm({
4226
4469
  var LazyPeriodTitle2, PerformanceUI, LabelWithHint, PerformancePnL, CumulativePnlChart;
4227
4470
  var init_performance_ui = __esm({
4228
4471
  "src/pages/overview/performance/performance.ui.tsx"() {
4229
- LazyPeriodTitle2 = React7.lazy(
4472
+ LazyPeriodTitle2 = React12.lazy(
4230
4473
  () => Promise.resolve().then(() => (init_periodHeader(), periodHeader_exports)).then((mod) => {
4231
4474
  return { default: mod.PeriodTitle };
4232
4475
  })
@@ -4246,7 +4489,7 @@ var init_performance_ui = __esm({
4246
4489
  return /* @__PURE__ */ jsxs(
4247
4490
  Card,
4248
4491
  {
4249
- title: /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
4492
+ title: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
4250
4493
  LazyPeriodTitle2,
4251
4494
  {
4252
4495
  onPeriodChange,
@@ -4498,7 +4741,7 @@ var init_performance = __esm({
4498
4741
  var EffectiveFee;
4499
4742
  var init_effectiveFee = __esm({
4500
4743
  "src/pages/feeTier/icons/effectiveFee.tsx"() {
4501
- EffectiveFee = React7.forwardRef((props, ref) => {
4744
+ EffectiveFee = React12.forwardRef((props, ref) => {
4502
4745
  const linearId = useId();
4503
4746
  return /* @__PURE__ */ jsxs(
4504
4747
  "svg",
@@ -5567,22 +5810,22 @@ var LazyCreateAPIKeyDialog, LazyCreatedAPIKeyDialog, LazyDeleteAPIKeyDialog, Laz
5567
5810
  var init_apiManager_ui = __esm({
5568
5811
  "src/pages/api/apiManager.ui.tsx"() {
5569
5812
  init_apiManager_script();
5570
- LazyCreateAPIKeyDialog = React7.lazy(
5813
+ LazyCreateAPIKeyDialog = React12.lazy(
5571
5814
  () => Promise.resolve().then(() => (init_createApiKey(), createApiKey_exports)).then((mod) => {
5572
5815
  return { default: mod.CreateAPIKeyDialog };
5573
5816
  })
5574
5817
  );
5575
- LazyCreatedAPIKeyDialog = React7.lazy(
5818
+ LazyCreatedAPIKeyDialog = React12.lazy(
5576
5819
  () => Promise.resolve().then(() => (init_createdApiKey(), createdApiKey_exports)).then((mod) => {
5577
5820
  return { default: mod.CreatedAPIKeyDialog };
5578
5821
  })
5579
5822
  );
5580
- LazyDeleteAPIKeyDialog = React7.lazy(
5823
+ LazyDeleteAPIKeyDialog = React12.lazy(
5581
5824
  () => Promise.resolve().then(() => (init_deleteApiKey(), deleteApiKey_exports)).then((mod) => {
5582
5825
  return { default: mod.DeleteAPIKeyDialog };
5583
5826
  })
5584
5827
  );
5585
- LazyEditAPIKeyDialog = React7.lazy(
5828
+ LazyEditAPIKeyDialog = React12.lazy(
5586
5829
  () => Promise.resolve().then(() => (init_editApiKey(), editApiKey_exports)).then((mod) => {
5587
5830
  return { default: mod.EditAPIKeyDialog };
5588
5831
  })
@@ -5611,8 +5854,8 @@ var init_apiManager_ui = __esm({
5611
5854
  ),
5612
5855
  /* @__PURE__ */ jsxs("div", { children: [
5613
5856
  /* @__PURE__ */ jsx(KeyList, { ...props }),
5614
- /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyCreateAPIKeyDialog, { ...props }) }),
5615
- /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyCreatedAPIKeyDialog, { ...props }) })
5857
+ /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyCreateAPIKeyDialog, { ...props }) }),
5858
+ /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyCreatedAPIKeyDialog, { ...props }) })
5616
5859
  ] })
5617
5860
  ]
5618
5861
  }
@@ -5851,7 +6094,7 @@ var init_apiManager_ui = __esm({
5851
6094
  children: t("common.edit")
5852
6095
  }
5853
6096
  ),
5854
- open && /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
6097
+ open && /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
5855
6098
  LazyEditAPIKeyDialog,
5856
6099
  {
5857
6100
  item,
@@ -5882,7 +6125,7 @@ var init_apiManager_ui = __esm({
5882
6125
  children: t("common.delete")
5883
6126
  }
5884
6127
  ),
5885
- open && /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
6128
+ open && /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
5886
6129
  LazyDeleteAPIKeyDialog,
5887
6130
  {
5888
6131
  item,
@@ -7309,22 +7552,22 @@ var MobileOverview = (props) => {
7309
7552
  )
7310
7553
  ] });
7311
7554
  };
7312
- var LazyAssetWidget = React7.lazy(
7555
+ var LazyAssetWidget = React12.lazy(
7313
7556
  () => Promise.resolve().then(() => (init_assets(), assets_exports)).then((mod) => {
7314
7557
  return { default: mod.AssetWidget };
7315
7558
  })
7316
7559
  );
7317
- var LazyAssetsChartWidget = React7.lazy(
7560
+ var LazyAssetsChartWidget = React12.lazy(
7318
7561
  () => Promise.resolve().then(() => (init_assetChart(), assetChart_exports)).then((mod) => {
7319
7562
  return { default: mod.AssetsChartWidget };
7320
7563
  })
7321
7564
  );
7322
- var LazyPerformanceWidget = React7.lazy(
7565
+ var LazyPerformanceWidget = React12.lazy(
7323
7566
  () => Promise.resolve().then(() => (init_performance(), performance_exports)).then((mod) => {
7324
7567
  return { default: mod.PerformanceWidget };
7325
7568
  })
7326
7569
  );
7327
- var LazyHistoryDataGroupWidget = React7.lazy(
7570
+ var LazyHistoryDataGroupWidget = React12.lazy(
7328
7571
  () => Promise.resolve().then(() => (init_historyDataGroup(), historyDataGroup_exports)).then((mod) => {
7329
7572
  return { default: mod.HistoryDataGroupWidget };
7330
7573
  })
@@ -7338,10 +7581,10 @@ var OverviewPage = (props) => {
7338
7581
  hideTraderCard: props.hideTraderCard
7339
7582
  }
7340
7583
  ) : /* @__PURE__ */ jsxs(Grid, { cols: 2, gap: 4, children: [
7341
- /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyAssetWidget, {}) }),
7342
- /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyAssetsChartWidget, {}) }),
7343
- /* @__PURE__ */ jsx(Grid.span, { colSpan: 2, children: /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyPerformanceWidget, {}) }) }),
7344
- /* @__PURE__ */ jsx(Grid.span, { colSpan: 2, children: /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyHistoryDataGroupWidget, {}) }) })
7584
+ /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyAssetWidget, {}) }),
7585
+ /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyAssetsChartWidget, {}) }),
7586
+ /* @__PURE__ */ jsx(Grid.span, { colSpan: 2, children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyPerformanceWidget, {}) }) }),
7587
+ /* @__PURE__ */ jsx(Grid.span, { colSpan: 2, children: /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyHistoryDataGroupWidget, {}) }) })
7345
7588
  ] }) });
7346
7589
  };
7347
7590
 
@@ -7351,7 +7594,7 @@ __export(feeTier_exports, {
7351
7594
  FeeTierPage: () => FeeTierPage,
7352
7595
  useFeeTierScript: () => useFeeTierScript
7353
7596
  });
7354
- var LazyFeeTierHeader = React7.lazy(
7597
+ var LazyFeeTierHeader = React12.lazy(
7355
7598
  () => Promise.resolve().then(() => (init_feeTierHeader(), feeTierHeader_exports)).then((mod) => {
7356
7599
  return { default: mod.FeeTierHeader };
7357
7600
  })
@@ -7457,7 +7700,7 @@ var FeeTier = (props) => {
7457
7700
  },
7458
7701
  children: [
7459
7702
  !isMobile && /* @__PURE__ */ jsx(Divider, {}),
7460
- /* @__PURE__ */ jsx(React7.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
7703
+ /* @__PURE__ */ jsx(React12.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
7461
7704
  LazyFeeTierHeader,
7462
7705
  {
7463
7706
  vol,
@@ -7658,8 +7901,8 @@ var PositionsPage = (props) => {
7658
7901
  const { t } = useTranslation();
7659
7902
  const { state, isMainAccount } = useAccount();
7660
7903
  const subAccounts = state.subAccounts ?? [];
7661
- const [selectedAccount, setAccount] = React7.useState("All accounts" /* ALL */);
7662
- const onAccountFilter = React7.useCallback(
7904
+ const [selectedAccount, setAccount] = React12.useState("All accounts" /* ALL */);
7905
+ const onAccountFilter = React12.useCallback(
7663
7906
  (filter) => {
7664
7907
  const { name, value } = filter;
7665
7908
  if (name === "account") {
@@ -7824,7 +8067,7 @@ var OrdersPage = (props) => {
7824
8067
  }
7825
8068
  );
7826
8069
  };
7827
- var TooltipIcon = React7.forwardRef(
8070
+ var TooltipIcon = React12.forwardRef(
7828
8071
  (props, ref) => {
7829
8072
  return /* @__PURE__ */ jsx(
7830
8073
  "svg",
@@ -8151,7 +8394,7 @@ var useAssetsColumns = (options) => {
8151
8394
  const tokensInfo = useAppStore((state) => state.tokensInfo);
8152
8395
  const { namespace } = useWalletConnector();
8153
8396
  const { onTransfer, onConvert } = options;
8154
- const columns = React7.useMemo(() => {
8397
+ const columns = React12.useMemo(() => {
8155
8398
  return [
8156
8399
  {
8157
8400
  title: t("portfolio.overview.column.token"),
@@ -8622,7 +8865,7 @@ var AssetsTableMobile = (props) => {
8622
8865
  value: "Main accounts" /* MAIN */
8623
8866
  };
8624
8867
  const ALL_ASSETS = {
8625
- label: "All assets",
8868
+ label: t("common.allAssets"),
8626
8869
  value: "all"
8627
8870
  };
8628
8871
  const memoizedOptions = useMemo(() => {
@@ -8679,7 +8922,7 @@ var AssetsTableMobile = (props) => {
8679
8922
  }
8680
8923
  ),
8681
8924
  /* @__PURE__ */ jsx("div", { className: "oui-flex oui-flex-col oui-gap-1", children: dataSource2?.map((assets, index) => {
8682
- return /* @__PURE__ */ jsxs(React7.Fragment, { children: [
8925
+ return /* @__PURE__ */ jsxs(React12.Fragment, { children: [
8683
8926
  /* @__PURE__ */ jsx(AccountTag, { name: assets.description ?? "sub account" }),
8684
8927
  Array.isArray(assets.children) && assets.children.map((child) => /* @__PURE__ */ jsx(
8685
8928
  AssetMobileItem,