@orderly.network/markets 2.8.13-rc.0 → 2.8.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +48 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +49 -13
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +8 -8
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React6, { memo, createContext, useState, useRef, useEffect, useCallback, useMemo, useContext } from 'react';
|
|
2
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { useSymbolsInfo, useMarkets, MarketsType, useFundingRateHistory, useFundingRates, useQuery, useMarketsStream, useLocalStorage, useGetRwaSymbolInfo, useTickerStream, useFundingRate, useMarketsStore, useFundingDetails, useSessionStorage, useFundingRateBySymbol, usePositionStream, isCurrentlyTrading } from '@orderly.network/hooks';
|
|
4
|
-
import { Flex, TokenIcon, Text, Box, cn, Marquee, Checkbox, Divider, useEmblaCarousel, useScreen, Badge, Tooltip, CloseIcon, CheckedSquareFillIcon, CheckSquareEmptyIcon, Button, DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuContent, Input, CloseCircleFillIcon, PlusIcon, DataTable, usePagination, Tabs, TabPanel, EmptyDataState, NewsFillIcon, modal, GradientText, EmptyStateIcon, Picker, Select } from '@orderly.network/ui';
|
|
4
|
+
import { Flex, TokenIcon, Text, Box, cn, Marquee, Checkbox, Divider, useEmblaCarousel, useScreen, Badge, Tooltip, CloseIcon, CheckedSquareFillIcon, CheckSquareEmptyIcon, Button, DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuContent, Input, CloseCircleFillIcon, PlusIcon, DataTable, usePagination, Tabs, TabPanel, EmptyDataState, NewsFillIcon, modal, RwaIcon, GradientText, EmptyStateIcon, Picker, Select } from '@orderly.network/ui';
|
|
5
5
|
import { useTranslation, Trans, i18n } from '@orderly.network/i18n';
|
|
6
6
|
import { Decimal, formatSymbol } from '@orderly.network/utils';
|
|
7
7
|
import { pick } from 'ramda';
|
|
@@ -1851,9 +1851,23 @@ var init_marketsList = __esm({
|
|
|
1851
1851
|
init_marketsList_widget();
|
|
1852
1852
|
}
|
|
1853
1853
|
});
|
|
1854
|
-
var RwaTab;
|
|
1854
|
+
var RwaIconTab, RwaTab;
|
|
1855
1855
|
var init_rwaTab = __esm({
|
|
1856
1856
|
"src/components/rwaTab.tsx"() {
|
|
1857
|
+
RwaIconTab = (props) => {
|
|
1858
|
+
const { iconSize = 12 } = props;
|
|
1859
|
+
const { t } = useTranslation();
|
|
1860
|
+
return /* @__PURE__ */ jsxs(Flex, { gap: 1, children: [
|
|
1861
|
+
/* @__PURE__ */ jsx(
|
|
1862
|
+
RwaIcon,
|
|
1863
|
+
{
|
|
1864
|
+
size: iconSize,
|
|
1865
|
+
className: "group-data-[state=active]:oui-text-base-contrast group-data-[state=inactive]:oui-text-base-contrast-36"
|
|
1866
|
+
}
|
|
1867
|
+
),
|
|
1868
|
+
/* @__PURE__ */ jsx(Text, { children: t("common.rwa") })
|
|
1869
|
+
] });
|
|
1870
|
+
};
|
|
1857
1871
|
RwaTab = () => {
|
|
1858
1872
|
const { t } = useTranslation();
|
|
1859
1873
|
return /* @__PURE__ */ jsxs(Flex, { gap: 1, children: [
|
|
@@ -2525,7 +2539,7 @@ var init_marketsDataList_mobile_ui = __esm({
|
|
|
2525
2539
|
children: renderTab("all" /* All */)
|
|
2526
2540
|
}
|
|
2527
2541
|
),
|
|
2528
|
-
/* @__PURE__ */ jsx(TabPanel, { title: /* @__PURE__ */ jsx(
|
|
2542
|
+
/* @__PURE__ */ jsx(TabPanel, { title: /* @__PURE__ */ jsx(RwaIconTab, {}), value: "rwa", children: renderTab("rwa" /* Rwa */) }),
|
|
2529
2543
|
/* @__PURE__ */ jsx(
|
|
2530
2544
|
TabPanel,
|
|
2531
2545
|
{
|
|
@@ -2916,7 +2930,7 @@ var init_marketsListFull_ui = __esm({
|
|
|
2916
2930
|
onSymbolChange?.(record);
|
|
2917
2931
|
favorite.addToHistory(record);
|
|
2918
2932
|
},
|
|
2919
|
-
"data-testid": `oui-testid-markets-${type === "new" ? "newListing" : "all"}-tr-${record.symbol}`
|
|
2933
|
+
"data-testid": `oui-testid-markets-${type === "new" ? "newListing" : type === "rwa" ? "rwa" : "all"}-tr-${record.symbol}`
|
|
2920
2934
|
};
|
|
2921
2935
|
},
|
|
2922
2936
|
generatedRowKey: (record) => record.symbol,
|
|
@@ -2933,17 +2947,23 @@ var init_marketsListFull_ui = __esm({
|
|
|
2933
2947
|
};
|
|
2934
2948
|
}
|
|
2935
2949
|
});
|
|
2936
|
-
var useMarketsListFullScript;
|
|
2950
|
+
var MarketsTypeMap2, useMarketsListFullScript;
|
|
2937
2951
|
var init_marketsListFull_script = __esm({
|
|
2938
2952
|
"src/components/marketsListFull/marketsListFull.script.ts"() {
|
|
2939
2953
|
init_marketsProvider();
|
|
2940
2954
|
init_utils();
|
|
2955
|
+
MarketsTypeMap2 = {
|
|
2956
|
+
all: MarketsType.ALL,
|
|
2957
|
+
new: MarketsType.NEW_LISTING,
|
|
2958
|
+
rwa: MarketsType.RWA
|
|
2959
|
+
};
|
|
2941
2960
|
useMarketsListFullScript = (options) => {
|
|
2961
|
+
const { type = "all" } = options;
|
|
2942
2962
|
const [loading, setLoading] = useState(true);
|
|
2943
2963
|
const { setPage, pagination } = usePagination({
|
|
2944
2964
|
pageSize: 10
|
|
2945
2965
|
});
|
|
2946
|
-
const [data, favorite] = useMarkets(
|
|
2966
|
+
const [data, favorite] = useMarkets(MarketsTypeMap2[type]);
|
|
2947
2967
|
const { searchValue } = useMarketsContext();
|
|
2948
2968
|
const { onSort, getSortedList, sort } = useSort(options.initialSort);
|
|
2949
2969
|
const dataSource = useMemo(() => {
|
|
@@ -2957,17 +2977,17 @@ var init_marketsListFull_script = __esm({
|
|
|
2957
2977
|
setPage(1);
|
|
2958
2978
|
}, [searchValue]);
|
|
2959
2979
|
useEffect(() => {
|
|
2960
|
-
if (
|
|
2980
|
+
if (type === "all") {
|
|
2961
2981
|
favorite.updateTabsSortState("all", sort?.sortKey, sort?.sortOrder);
|
|
2962
2982
|
}
|
|
2963
|
-
}, [sort,
|
|
2983
|
+
}, [sort, type]);
|
|
2964
2984
|
const initialSort = useMemo(() => {
|
|
2965
|
-
const sortStore =
|
|
2985
|
+
const sortStore = type === "all" ? favorite.tabSort?.all : void 0;
|
|
2966
2986
|
return {
|
|
2967
2987
|
sortKey: sortStore?.sortKey || options?.initialSort?.sortKey,
|
|
2968
2988
|
sort: sortStore?.sortOrder || options?.initialSort?.sortOrder
|
|
2969
2989
|
};
|
|
2970
|
-
}, [favorite.tabSort, options.initialSort,
|
|
2990
|
+
}, [favorite.tabSort, options.initialSort, type]);
|
|
2971
2991
|
return {
|
|
2972
2992
|
loading,
|
|
2973
2993
|
dataSource,
|
|
@@ -3009,6 +3029,7 @@ var LazySearchInput, LazyFavoritesListFullWidget, LazyMarketsListFullWidget, Mar
|
|
|
3009
3029
|
var init_marketsDataList_ui = __esm({
|
|
3010
3030
|
"src/pages/home/marketsDataList/marketsDataList.ui.tsx"() {
|
|
3011
3031
|
init_favoritesEmpty();
|
|
3032
|
+
init_rwaTab();
|
|
3012
3033
|
init_icons();
|
|
3013
3034
|
init_type();
|
|
3014
3035
|
LazySearchInput = React6.lazy(
|
|
@@ -3073,6 +3094,21 @@ var init_marketsDataList_ui = __esm({
|
|
|
3073
3094
|
) })
|
|
3074
3095
|
}
|
|
3075
3096
|
),
|
|
3097
|
+
/* @__PURE__ */ jsx(
|
|
3098
|
+
TabPanel,
|
|
3099
|
+
{
|
|
3100
|
+
title: /* @__PURE__ */ jsx(RwaIconTab, {}),
|
|
3101
|
+
value: "rwa",
|
|
3102
|
+
testid: "oui-testid-markets-rwa-tab",
|
|
3103
|
+
children: /* @__PURE__ */ jsx(React6.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(
|
|
3104
|
+
LazyMarketsListFullWidget,
|
|
3105
|
+
{
|
|
3106
|
+
type: "rwa",
|
|
3107
|
+
initialSort: { sortKey: "24h_amount", sortOrder: "desc" }
|
|
3108
|
+
}
|
|
3109
|
+
) })
|
|
3110
|
+
}
|
|
3111
|
+
),
|
|
3076
3112
|
/* @__PURE__ */ jsx(
|
|
3077
3113
|
TabPanel,
|
|
3078
3114
|
{
|
|
@@ -4999,7 +5035,7 @@ var SubMenuMarkets = (props) => {
|
|
|
4999
5035
|
onSort: onTabSort("all" /* All */)
|
|
5000
5036
|
}
|
|
5001
5037
|
) }),
|
|
5002
|
-
/* @__PURE__ */ jsx(TabPanel, { title: /* @__PURE__ */ jsx(
|
|
5038
|
+
/* @__PURE__ */ jsx(TabPanel, { title: /* @__PURE__ */ jsx(RwaIconTab, {}), value: "rwa" /* Rwa */, children: /* @__PURE__ */ jsx(
|
|
5003
5039
|
MarketTabPanel,
|
|
5004
5040
|
{
|
|
5005
5041
|
type: "rwa" /* Rwa */,
|
|
@@ -6255,7 +6291,7 @@ var useHorizontalMarketsScript = (options) => {
|
|
|
6255
6291
|
SIDE_MARKETS_SEL_TAB_KEY,
|
|
6256
6292
|
defaultMarketType || "all"
|
|
6257
6293
|
);
|
|
6258
|
-
const
|
|
6294
|
+
const MarketsTypeMap3 = {
|
|
6259
6295
|
all: MarketsType.ALL,
|
|
6260
6296
|
recent: MarketsType.RECENT,
|
|
6261
6297
|
newListing: MarketsType.NEW_LISTING,
|
|
@@ -6263,7 +6299,7 @@ var useHorizontalMarketsScript = (options) => {
|
|
|
6263
6299
|
};
|
|
6264
6300
|
const marketTypeKey = selectedMarketType || "all";
|
|
6265
6301
|
const [markets, favorite] = useMarkets(
|
|
6266
|
-
|
|
6302
|
+
MarketsTypeMap3[marketTypeKey] || MarketsType.ALL
|
|
6267
6303
|
);
|
|
6268
6304
|
const filteredMarkets = useMemo(() => {
|
|
6269
6305
|
if (selectedMarketType === "favorites") {
|