mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
start adapting queries
This commit is contained in:
parent
4f9cd4a7f8
commit
76bb997fe1
@ -12,12 +12,19 @@ import useNetworkMetadata, {
|
||||
import { LoggerInstance } from '@oceanprotocol/lib'
|
||||
import styles from './MarketStats.module.css'
|
||||
|
||||
const getTotalPoolsValues = gql`
|
||||
query PoolsData {
|
||||
poolFactories {
|
||||
totalValueLocked
|
||||
totalOceanLiquidity
|
||||
finalizedPoolCount
|
||||
const getGlobalStatsValues = gql`
|
||||
query FooterStatsValues {
|
||||
globalStats(subgraphError: deny) {
|
||||
poolCount
|
||||
nftCount
|
||||
datatokenCount
|
||||
orderCount
|
||||
totalLiquidity {
|
||||
token {
|
||||
id
|
||||
}
|
||||
value
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
@ -121,11 +128,11 @@ export default function MarketStats(): ReactElement {
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetchData(getTotalPoolsValues, null, context)
|
||||
const response = await fetchData(getGlobalStatsValues, null, context)
|
||||
if (!response) continue
|
||||
|
||||
const { totalValueLocked, totalOceanLiquidity, finalizedPoolCount } =
|
||||
response?.data?.poolFactories[0]
|
||||
response?.data?.globalStats[0]
|
||||
|
||||
await setTotalValueLocked((prevState) => ({
|
||||
...prevState,
|
||||
|
Loading…
Reference in New Issue
Block a user