+
{t("MarketView.mostVolume")}
+
+
+

+
{t("currency." + mostVolume.pairInfo.baseAsset)}
-
{/*
-
-
{t("MarketView.MinTransactionVolume")}
-
-
-

-
{t("currency." + "BTC")}
-
-
-
25،1254،248
-
10% +
+
+
+ {mostVolume.pairInfo.quoteAsset}
+ {new BN(mostVolume?.volume).toFormat()}
+
% {new BN(mostVolume?.change).toFormat(2)}+
-
*/}
-
-
-
-
-
-
-
+
+ >
+ }
+ return (
+
+
+
+
{t("MarketView.title")}
+
+
+
+ {content()}
+
);
};
diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/MarketView.module.css b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/MarketView.module.css
index e6a8939d..ce488e29 100644
--- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/MarketView.module.css
+++ b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/MarketView/MarketView.module.css
@@ -14,4 +14,8 @@
}*/
.content {
height: 85%;
+}
+
+.thisLoading{
+ width: 5vw;
}
\ No newline at end of file
diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/PopularCryptocurrencies/PopularCryptocurrencies.js b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/PopularCryptocurrencies/PopularCryptocurrencies.js
deleted file mode 100644
index 0b1125ba..00000000
--- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/PopularCryptocurrencies/PopularCryptocurrencies.js
+++ /dev/null
@@ -1,61 +0,0 @@
-import React, {useState} from 'react';
-import classes from './PopularCryptocurrencies.module.css'
-import Icon from "../../../../../../../../components/Icon/Icon";
-import MarketInfoTable from "./components/MarketInfoTable/MarketInfoTable";
-import MarketInfoCard from "./components/MarketInfoCard/MarketInfoCard";
-import * as Routes from "../../../../../../Routes/routes";
-import {Link} from "react-router-dom";
-import {AllMarket} from "../../../../../../Routes/routes";
-
-const PopularCryptocurrencies = () => {
-
-
-
- const [card, setCard] = useState(false)
-
-
- const marketData = [
- {symbol: "BTCBUSD", baseAsset: "BTC", quoteAsset: "BUSD", price: "20,515.85", marketCap: "386,159,595,216", lowPrice: "15000", highPrice: "300050", volume: "44,351,555,144", pcp24h: "-8.58", pcp7d: "-15.58"},
- {symbol: "ETHBUSD", baseAsset: "ETH", quoteAsset: "BUSD", price: "1,054.71", marketCap: "124,977,581,341", lowPrice: "15000", highPrice: "300050", volume: "26,939,396,426", pcp24h: "-11.48", pcp7d: "+14.58"},
- {symbol: "USDT", baseAsset: "USDT", quoteAsset: "BUSD", price: "0.9985", marketCap: "70,750,495,039", lowPrice: "15000", highPrice: "300050", volume: "71,102,864,297", pcp24h: "+1.03", pcp7d: "-125.58"},
- {symbol: "BNB", baseAsset: "BNB", quoteAsset: "BUSD", price: "204.98", marketCap: "32,812,595,330", lowPrice: "15000", highPrice: "300050", volume: "1,681,153,480", pcp24h: "-8.18", pcp7d: "-5.58"},
- {symbol: "BUSD", baseAsset: "BUSD", quoteAsset: "BUSD", price: "1.00", marketCap: "17,437,053,356", lowPrice: "15000", highPrice: "300050", volume: "6,734,823,937", pcp24h: "-0.14", pcp7d: "-5.8"},
-
- {symbol: "BTCBUSD", baseAsset: "DOGE", quoteAsset: "BUSD", price: "20,515.85", marketCap: "386,159,595,216", lowPrice: "15000", highPrice: "300050", volume: "44,351,555,144", pcp24h: "-8.58", pcp7d: "-1.58"},
- {symbol: "ETHBUSD", baseAsset: "LTC", quoteAsset: "BUSD", price: "1,054.71", marketCap: "124,977,581,341", lowPrice: "15000", highPrice: "300050", volume: "26,939,396,426", pcp24h: "-11.48", pcp7d: "-19.58"},
-
-
- ]
-
-
- return (
-
-
-
-
-
setCard(prevState => !prevState)}/>
- بازار
-
- تومان
- {/*|*/}
- تتر
-
-
-
-
- نمایش تمام بازار
-
-
-
-
- {card ?
- b.marketCap - a.marketCap).slice(0 , 5)}/>
- :
- b.marketCap - a.marketCap).slice(0 , 5)}/>
- }
-
-
- );
-};
-
-export default PopularCryptocurrencies;
diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/PopularCryptocurrencies/PopularCryptocurrencies.module.css b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/PopularCryptocurrencies/PopularCryptocurrencies.module.css
deleted file mode 100644
index 5029901f..00000000
--- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/PopularCryptocurrencies/PopularCryptocurrencies.module.css
+++ /dev/null
@@ -1,15 +0,0 @@
-.container {
-
-}
-
-.header {
- height: 10vh;
-}
-
-.content {
- /* height: 85%;*/
-}
-
-.title {
- background-color: var(--cardHeaderAlpha);
-}
\ No newline at end of file
diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/PopularCryptocurrencies/components/MarketInfoTable/MarketInfoTable.js b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/PopularCryptocurrencies/components/MarketInfoTable/MarketInfoTable.js
deleted file mode 100644
index d864cd67..00000000
--- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/PopularCryptocurrencies/components/MarketInfoTable/MarketInfoTable.js
+++ /dev/null
@@ -1,58 +0,0 @@
-import React from 'react';
-import classes from './MarketInfoTable.module.css'
-import {useTranslation} from "react-i18next";
-import {images} from "../../../../../../../../../../assets/images";
-
-const MarketInfoTable = (props) => {
-
- const {t} = useTranslation();
-
- const {data, baseAsset, price, marketCap, lowPrice, highPrice, volume, pcp24h} = props
-
- let head = (
-
- {t("MarketInfo.name")}
- {t("MarketInfo.lastPrice")}
- {t("MarketInfo.pcp24h")}
- {t("MarketInfo.marketCap")}
- {t("MarketInfo.chart")}
-
- );
-
- let body = (
- <>
- {data.map((tr, index) => {
- return (
-
-
-
- {t("currency." + tr.baseAsset)}
-
-
0 ? "text-green" : "text-red"}`}>{tr.price}
-
0 ? "text-green" : "text-red"}`}>{tr.pcp24h} %
-
{tr.marketCap}
-
-
-
-
- )
- })}
- >
- );
-
-
- return (
- <>
- {head}
- {body}
- >
- );
-};
-
-export default MarketInfoTable;
diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/PopularCryptocurrencies/components/MarketInfoTable/MarketInfoTable.module.css b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/PopularCryptocurrencies/components/MarketInfoTable/MarketInfoTable.module.css
deleted file mode 100644
index a606e484..00000000
--- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/PopularCryptocurrencies/components/MarketInfoTable/MarketInfoTable.module.css
+++ /dev/null
@@ -1,9 +0,0 @@
-.row:last-child{
- border-bottom: none;
-}
-.row:nth-child(odd) {
- background-color: var(--tableRow);
-}
-.row:hover {
- background-color: var(--LoginContainer);
-}
\ No newline at end of file
diff --git a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/Spinner/Spinner.module.css b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/Spinner/Spinner.module.css
index 6fd52bef..82d4e718 100644
--- a/src/main/Browser/Pages/Landing/Sections/LandingContent/components/Spinner/Spinner.module.css
+++ b/src/main/Browser/Pages/Landing/Sections/LandingContent/components/Spinner/Spinner.module.css
@@ -14,7 +14,7 @@
.BTC{
width: 15%;
position: absolute;
- top: -5%;
+ top: -6.5%;
left: 50%;
z-index: 10;
animation-duration: 10s;
@@ -30,7 +30,7 @@
.ETH{
width: 15%;
position: absolute;
- bottom: -5%;
+ bottom: -6.5%;
left: 50%;
animation-duration: 7s;
}
@@ -45,7 +45,7 @@
.USDT{
width: 15%;
position: absolute;
- right: -5%;
+ right: -6.5%;
top: 40%;
animation-duration: 4s;
}
diff --git a/src/queries/hooks/useGetExchangeInfo.js b/src/queries/hooks/useGetExchangeInfo.js
new file mode 100644
index 00000000..e7b61aef
--- /dev/null
+++ b/src/queries/hooks/useGetExchangeInfo.js
@@ -0,0 +1,21 @@
+import {useQuery} from "@tanstack/react-query";
+import {getExchangeInfo} from "js-api-client";
+
+export const useGetExchangeInfo = (interval) => {
+ return useQuery(
+ ['exchangeInfo', interval],
+ () => getExchangeInfoFunc(interval),
+ {
+ staleTime: 5000,
+ refetchInterval: 10000,
+ notifyOnChangeProps: ['data', 'isLoading', 'error'],
+
+ });
+}
+
+const getExchangeInfoFunc = async (interval) => {
+ const {data} = await getExchangeInfo(interval)
+ return data;
+
+}
+
diff --git a/src/queries/hooks/useGetMarketStats.js b/src/queries/hooks/useGetMarketStats.js
new file mode 100644
index 00000000..7c697196
--- /dev/null
+++ b/src/queries/hooks/useGetMarketStats.js
@@ -0,0 +1,21 @@
+import {useQuery} from "@tanstack/react-query";
+import {getMarketStats} from "js-api-client";
+
+export const useGetMarketStats = (interval) => {
+ return useQuery(
+ ['marketStats', interval],
+ () => getMarketStatsFunc(interval),
+ {
+ staleTime: 5000,
+ refetchInterval: 10000,
+ notifyOnChangeProps: ['data', 'isLoading', 'error'],
+
+ });
+}
+
+const getMarketStatsFunc = async (interval) => {
+ const {data} = await getMarketStats(interval)
+ return data;
+
+}
+
diff --git a/src/queries/hooks/useOverview.js b/src/queries/hooks/useOverview.js
index e77b5197..b00e5080 100644
--- a/src/queries/hooks/useOverview.js
+++ b/src/queries/hooks/useOverview.js
@@ -9,7 +9,7 @@ export const useOverview = (symbol, period) => {
staleTime: 5000,
refetchInterval: 10000,
notifyOnChangeProps: ['data', 'isLoading', 'error'],
- select: (data) => data[0],
+ select: (data) => {return symbol ? data[0] : data},
});
}
diff --git a/src/queries/index.js b/src/queries/index.js
index fd774cf6..75afc7b9 100644
--- a/src/queries/index.js
+++ b/src/queries/index.js
@@ -1,5 +1,7 @@
//Hooks
export {useOverview} from "./hooks/useOverview";
+export {useGetExchangeInfo} from "./hooks/useGetExchangeInfo";
+export {useGetMarketStats} from "./hooks/useGetMarketStats";
export {useLastTrades} from "./hooks/useLastTrades";
export {useOrderBook} from "./hooks/useOrderBook";
export {useMyOpenOrders} from "./hooks/useMyOpenOrders";
diff --git a/yarn.lock b/yarn.lock
index e6ffeb27..e8b73afa 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -9712,12 +9712,12 @@ fsevents@^1.2.7:
languageName: node
linkType: hard
-"js-api-client@https://github.com/opexdev/js-api-client.git":
+"js-api-client@https://github.com/opexdev/js-api-client.git#develop":
version: 0.1.0
- resolution: "js-api-client@https://github.com/opexdev/js-api-client.git#commit=731088c4c92baafc05fe3ff3869f357ea3309907"
+ resolution: "js-api-client@https://github.com/opexdev/js-api-client.git#commit=3d44fef7199919e2e5500b3f0132699ffcac7894"
peerDependencies:
axios: ^0.22
- checksum: de66cea2f40bf5f298aafdd5230adf7732bd607afdd7b3b8903d18e1a5e178b594d960ea77ff4719d9598342f72b251b89a84c4f438ed613ea0a8ef2b42effca
+ checksum: c6584afd0cf54e4fd2e9d16fff00f930a7c560d03bd144c593611cc7d7cc7cc912cebfa13e506390a3678d949b9199c9d8ad0dc422683e143a6a3f92a2b45c7f
languageName: node
linkType: hard
@@ -11295,7 +11295,7 @@ fsevents@^1.2.7:
i18next: ^21.8.0
i18next-browser-languagedetector: ^6.1.4
i18next-http-backend: ^1.4.0
- js-api-client: "https://github.com/opexdev/js-api-client.git"
+ js-api-client: "https://github.com/opexdev/js-api-client.git#develop"
jwt-decode: ^3.1.2
lightweight-charts: ^3.8.0
moment-jalaali: ^0.9.2