@orderly.network/markets 2.8.12 → 2.8.13-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.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.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ import { SortOrder, Column, TableSort, DataTableClassNames, FormattedTextProps }
|
|
|
5
5
|
import * as _orderly_network_types from '@orderly.network/types';
|
|
6
6
|
import { API, RouterAdapter } from '@orderly.network/types';
|
|
7
7
|
import * as _orderly_network_hooks from '@orderly.network/hooks';
|
|
8
|
-
import { useMarkets, FavoriteTab, Favorite } from '@orderly.network/hooks';
|
|
8
|
+
import { useMarkets, MarketsType, FavoriteTab, Favorite } from '@orderly.network/hooks';
|
|
9
9
|
import { LeftNavProps } from '@orderly.network/ui-scaffold';
|
|
10
10
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
11
11
|
|
|
@@ -107,13 +107,19 @@ type MarketsDataListProps = UseMarketsDataListScript;
|
|
|
107
107
|
declare const MarketsDataList: react__default.FC<MarketsDataListProps>;
|
|
108
108
|
|
|
109
109
|
type MarketsListFullWidgetProps = {
|
|
110
|
-
type?:
|
|
110
|
+
type?: MarketsListFullType;
|
|
111
111
|
initialSort?: SortType;
|
|
112
112
|
};
|
|
113
113
|
declare const MarketsListFullWidget: React.FC<MarketsListFullWidgetProps>;
|
|
114
114
|
|
|
115
115
|
type UseMarketsListFullScriptOptions = MarketsListFullWidgetProps;
|
|
116
116
|
type UseMarketsListFullReturn = ReturnType<typeof useMarketsListFullScript>;
|
|
117
|
+
declare const MarketsTypeMap: {
|
|
118
|
+
all: MarketsType;
|
|
119
|
+
new: MarketsType;
|
|
120
|
+
rwa: MarketsType;
|
|
121
|
+
};
|
|
122
|
+
type MarketsListFullType = keyof typeof MarketsTypeMap;
|
|
117
123
|
declare const useMarketsListFullScript: (options: UseMarketsListFullScriptOptions) => {
|
|
118
124
|
loading: boolean;
|
|
119
125
|
dataSource: any[];
|
|
@@ -153,7 +159,7 @@ declare const useMarketsListFullScript: (options: UseMarketsListFullScriptOption
|
|
|
153
159
|
};
|
|
154
160
|
|
|
155
161
|
type MarketsListFullProps = UseMarketsListFullReturn & {
|
|
156
|
-
type?:
|
|
162
|
+
type?: MarketsListFullType;
|
|
157
163
|
};
|
|
158
164
|
declare const MarketsListFull: FC<MarketsListFullProps>;
|
|
159
165
|
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { SortOrder, Column, TableSort, DataTableClassNames, FormattedTextProps }
|
|
|
5
5
|
import * as _orderly_network_types from '@orderly.network/types';
|
|
6
6
|
import { API, RouterAdapter } from '@orderly.network/types';
|
|
7
7
|
import * as _orderly_network_hooks from '@orderly.network/hooks';
|
|
8
|
-
import { useMarkets, FavoriteTab, Favorite } from '@orderly.network/hooks';
|
|
8
|
+
import { useMarkets, MarketsType, FavoriteTab, Favorite } from '@orderly.network/hooks';
|
|
9
9
|
import { LeftNavProps } from '@orderly.network/ui-scaffold';
|
|
10
10
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
11
11
|
|
|
@@ -107,13 +107,19 @@ type MarketsDataListProps = UseMarketsDataListScript;
|
|
|
107
107
|
declare const MarketsDataList: react__default.FC<MarketsDataListProps>;
|
|
108
108
|
|
|
109
109
|
type MarketsListFullWidgetProps = {
|
|
110
|
-
type?:
|
|
110
|
+
type?: MarketsListFullType;
|
|
111
111
|
initialSort?: SortType;
|
|
112
112
|
};
|
|
113
113
|
declare const MarketsListFullWidget: React.FC<MarketsListFullWidgetProps>;
|
|
114
114
|
|
|
115
115
|
type UseMarketsListFullScriptOptions = MarketsListFullWidgetProps;
|
|
116
116
|
type UseMarketsListFullReturn = ReturnType<typeof useMarketsListFullScript>;
|
|
117
|
+
declare const MarketsTypeMap: {
|
|
118
|
+
all: MarketsType;
|
|
119
|
+
new: MarketsType;
|
|
120
|
+
rwa: MarketsType;
|
|
121
|
+
};
|
|
122
|
+
type MarketsListFullType = keyof typeof MarketsTypeMap;
|
|
117
123
|
declare const useMarketsListFullScript: (options: UseMarketsListFullScriptOptions) => {
|
|
118
124
|
loading: boolean;
|
|
119
125
|
dataSource: any[];
|
|
@@ -153,7 +159,7 @@ declare const useMarketsListFullScript: (options: UseMarketsListFullScriptOption
|
|
|
153
159
|
};
|
|
154
160
|
|
|
155
161
|
type MarketsListFullProps = UseMarketsListFullReturn & {
|
|
156
|
-
type?:
|
|
162
|
+
type?: MarketsListFullType;
|
|
157
163
|
};
|
|
158
164
|
declare const MarketsListFull: FC<MarketsListFullProps>;
|
|
159
165
|
|
package/dist/index.js
CHANGED
|
@@ -1857,9 +1857,23 @@ var init_marketsList = __esm({
|
|
|
1857
1857
|
init_marketsList_widget();
|
|
1858
1858
|
}
|
|
1859
1859
|
});
|
|
1860
|
-
var RwaTab;
|
|
1860
|
+
var RwaIconTab, RwaTab;
|
|
1861
1861
|
var init_rwaTab = __esm({
|
|
1862
1862
|
"src/components/rwaTab.tsx"() {
|
|
1863
|
+
RwaIconTab = (props) => {
|
|
1864
|
+
const { iconSize = 12 } = props;
|
|
1865
|
+
const { t } = i18n.useTranslation();
|
|
1866
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { gap: 1, children: [
|
|
1867
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1868
|
+
ui.RwaIcon,
|
|
1869
|
+
{
|
|
1870
|
+
size: iconSize,
|
|
1871
|
+
className: "group-data-[state=active]:oui-text-base-contrast group-data-[state=inactive]:oui-text-base-contrast-36"
|
|
1872
|
+
}
|
|
1873
|
+
),
|
|
1874
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.Text, { children: t("common.rwa") })
|
|
1875
|
+
] });
|
|
1876
|
+
};
|
|
1863
1877
|
RwaTab = () => {
|
|
1864
1878
|
const { t } = i18n.useTranslation();
|
|
1865
1879
|
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Flex, { gap: 1, children: [
|
|
@@ -2531,7 +2545,7 @@ var init_marketsDataList_mobile_ui = __esm({
|
|
|
2531
2545
|
children: renderTab("all" /* All */)
|
|
2532
2546
|
}
|
|
2533
2547
|
),
|
|
2534
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.TabPanel, { title: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2548
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TabPanel, { title: /* @__PURE__ */ jsxRuntime.jsx(RwaIconTab, {}), value: "rwa", children: renderTab("rwa" /* Rwa */) }),
|
|
2535
2549
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2536
2550
|
ui.TabPanel,
|
|
2537
2551
|
{
|
|
@@ -2922,7 +2936,7 @@ var init_marketsListFull_ui = __esm({
|
|
|
2922
2936
|
onSymbolChange?.(record);
|
|
2923
2937
|
favorite.addToHistory(record);
|
|
2924
2938
|
},
|
|
2925
|
-
"data-testid": `oui-testid-markets-${type === "new" ? "newListing" : "all"}-tr-${record.symbol}`
|
|
2939
|
+
"data-testid": `oui-testid-markets-${type === "new" ? "newListing" : type === "rwa" ? "rwa" : "all"}-tr-${record.symbol}`
|
|
2926
2940
|
};
|
|
2927
2941
|
},
|
|
2928
2942
|
generatedRowKey: (record) => record.symbol,
|
|
@@ -2939,17 +2953,23 @@ var init_marketsListFull_ui = __esm({
|
|
|
2939
2953
|
};
|
|
2940
2954
|
}
|
|
2941
2955
|
});
|
|
2942
|
-
exports.useMarketsListFullScript = void 0;
|
|
2956
|
+
var MarketsTypeMap2; exports.useMarketsListFullScript = void 0;
|
|
2943
2957
|
var init_marketsListFull_script = __esm({
|
|
2944
2958
|
"src/components/marketsListFull/marketsListFull.script.ts"() {
|
|
2945
2959
|
init_marketsProvider();
|
|
2946
2960
|
init_utils();
|
|
2961
|
+
MarketsTypeMap2 = {
|
|
2962
|
+
all: hooks.MarketsType.ALL,
|
|
2963
|
+
new: hooks.MarketsType.NEW_LISTING,
|
|
2964
|
+
rwa: hooks.MarketsType.RWA
|
|
2965
|
+
};
|
|
2947
2966
|
exports.useMarketsListFullScript = (options) => {
|
|
2967
|
+
const { type = "all" } = options;
|
|
2948
2968
|
const [loading, setLoading] = React6.useState(true);
|
|
2949
2969
|
const { setPage, pagination } = ui.usePagination({
|
|
2950
2970
|
pageSize: 10
|
|
2951
2971
|
});
|
|
2952
|
-
const [data, favorite] = hooks.useMarkets(
|
|
2972
|
+
const [data, favorite] = hooks.useMarkets(MarketsTypeMap2[type]);
|
|
2953
2973
|
const { searchValue } = useMarketsContext();
|
|
2954
2974
|
const { onSort, getSortedList, sort } = useSort(options.initialSort);
|
|
2955
2975
|
const dataSource = React6.useMemo(() => {
|
|
@@ -2963,17 +2983,17 @@ var init_marketsListFull_script = __esm({
|
|
|
2963
2983
|
setPage(1);
|
|
2964
2984
|
}, [searchValue]);
|
|
2965
2985
|
React6.useEffect(() => {
|
|
2966
|
-
if (
|
|
2986
|
+
if (type === "all") {
|
|
2967
2987
|
favorite.updateTabsSortState("all", sort?.sortKey, sort?.sortOrder);
|
|
2968
2988
|
}
|
|
2969
|
-
}, [sort,
|
|
2989
|
+
}, [sort, type]);
|
|
2970
2990
|
const initialSort = React6.useMemo(() => {
|
|
2971
|
-
const sortStore =
|
|
2991
|
+
const sortStore = type === "all" ? favorite.tabSort?.all : void 0;
|
|
2972
2992
|
return {
|
|
2973
2993
|
sortKey: sortStore?.sortKey || options?.initialSort?.sortKey,
|
|
2974
2994
|
sort: sortStore?.sortOrder || options?.initialSort?.sortOrder
|
|
2975
2995
|
};
|
|
2976
|
-
}, [favorite.tabSort, options.initialSort,
|
|
2996
|
+
}, [favorite.tabSort, options.initialSort, type]);
|
|
2977
2997
|
return {
|
|
2978
2998
|
loading,
|
|
2979
2999
|
dataSource,
|
|
@@ -3015,6 +3035,7 @@ var LazySearchInput, LazyFavoritesListFullWidget, LazyMarketsListFullWidget; exp
|
|
|
3015
3035
|
var init_marketsDataList_ui = __esm({
|
|
3016
3036
|
"src/pages/home/marketsDataList/marketsDataList.ui.tsx"() {
|
|
3017
3037
|
init_favoritesEmpty();
|
|
3038
|
+
init_rwaTab();
|
|
3018
3039
|
init_icons();
|
|
3019
3040
|
init_type();
|
|
3020
3041
|
LazySearchInput = React6__default.default.lazy(
|
|
@@ -3079,6 +3100,21 @@ var init_marketsDataList_ui = __esm({
|
|
|
3079
3100
|
) })
|
|
3080
3101
|
}
|
|
3081
3102
|
),
|
|
3103
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3104
|
+
ui.TabPanel,
|
|
3105
|
+
{
|
|
3106
|
+
title: /* @__PURE__ */ jsxRuntime.jsx(RwaIconTab, {}),
|
|
3107
|
+
value: "rwa",
|
|
3108
|
+
testid: "oui-testid-markets-rwa-tab",
|
|
3109
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(React6__default.default.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3110
|
+
LazyMarketsListFullWidget,
|
|
3111
|
+
{
|
|
3112
|
+
type: "rwa",
|
|
3113
|
+
initialSort: { sortKey: "24h_amount", sortOrder: "desc" }
|
|
3114
|
+
}
|
|
3115
|
+
) })
|
|
3116
|
+
}
|
|
3117
|
+
),
|
|
3082
3118
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3083
3119
|
ui.TabPanel,
|
|
3084
3120
|
{
|
|
@@ -5005,7 +5041,7 @@ var SubMenuMarkets = (props) => {
|
|
|
5005
5041
|
onSort: onTabSort("all" /* All */)
|
|
5006
5042
|
}
|
|
5007
5043
|
) }),
|
|
5008
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.TabPanel, { title: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5044
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TabPanel, { title: /* @__PURE__ */ jsxRuntime.jsx(RwaIconTab, {}), value: "rwa" /* Rwa */, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5009
5045
|
MarketTabPanel,
|
|
5010
5046
|
{
|
|
5011
5047
|
type: "rwa" /* Rwa */,
|
|
@@ -6261,7 +6297,7 @@ var useHorizontalMarketsScript = (options) => {
|
|
|
6261
6297
|
SIDE_MARKETS_SEL_TAB_KEY,
|
|
6262
6298
|
defaultMarketType || "all"
|
|
6263
6299
|
);
|
|
6264
|
-
const
|
|
6300
|
+
const MarketsTypeMap3 = {
|
|
6265
6301
|
all: hooks.MarketsType.ALL,
|
|
6266
6302
|
recent: hooks.MarketsType.RECENT,
|
|
6267
6303
|
newListing: hooks.MarketsType.NEW_LISTING,
|
|
@@ -6269,7 +6305,7 @@ var useHorizontalMarketsScript = (options) => {
|
|
|
6269
6305
|
};
|
|
6270
6306
|
const marketTypeKey = selectedMarketType || "all";
|
|
6271
6307
|
const [markets, favorite] = hooks.useMarkets(
|
|
6272
|
-
|
|
6308
|
+
MarketsTypeMap3[marketTypeKey] || hooks.MarketsType.ALL
|
|
6273
6309
|
);
|
|
6274
6310
|
const filteredMarkets = React6.useMemo(() => {
|
|
6275
6311
|
if (selectedMarketType === "favorites") {
|