Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
HoangVD2 committed Apr 26, 2024
1 parent bdc093c commit f06f4e1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
8 changes: 8 additions & 0 deletions assets-services/assets-and-prices-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,10 @@ const query = `query Gainers {
price {
amount
scalingFactor
dailyHigh
dailyLow
allTimeLow
allTimeHigh
}
symbol
type
Expand Down Expand Up @@ -562,6 +566,10 @@ const query = `query Losers {
price {
amount
scalingFactor
dailyHigh
dailyLow
allTimeLow
allTimeHigh
}
symbol
type
Expand Down
14 changes: 11 additions & 3 deletions components/AssetsTrendingTokens.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import LoadingIcon from './LoadingIcon';
import PlayIcon from './PlayIcon';

const AssetsTrendingTokens = (
{ type } // Add type prop
{ type }
) => {
const GRAPHQL_ENDPOINT = 'https://gql-router.xdefi.services/graphql';
const [response, setResponse] = useState({});
Expand Down Expand Up @@ -39,6 +39,10 @@ const AssetsTrendingTokens = (
price {
amount
scalingFactor
dailyHigh
dailyLow
allTimeLow
allTimeHigh
}
symbol
type
Expand All @@ -55,6 +59,10 @@ const AssetsTrendingTokens = (
price {
amount
scalingFactor
dailyHigh
dailyLow
allTimeLow
allTimeHigh
}
symbol
type
Expand All @@ -66,10 +74,10 @@ const AssetsTrendingTokens = (
let query = ``

switch (type) {
case 'gainer':
case 'gainers':
query = gainerQuery;
break;
case 'loser':
case 'losers':
query = loserQuery;
break;
default:
Expand Down

0 comments on commit f06f4e1

Please sign in to comment.