NeokingdomDAO / dapp

https://dapp-neokingdom.vercel.app/
0 stars 1 forks source link

Display warning banner (with emojis) if subgraph is lagging behind #87

Closed vrde closed 1 year ago

vrde commented 1 year ago

On a :sunny: day, transactions are indexed in few seconds.

On a :sun_behind_large_cloud: day, transactions are indexed in few minutes.

On a :cloud_with_lightning_and_rain: day, transactions are not indexed.

The idea is to compare the last indexed block in subgraph

{
  _meta {
    hasIndexingErrors
    block {
      hash
      timestamp
      number
    }
  }
}

With the last block number from the provider: https://docs.ethers.org/v5/api/providers/provider/#Provider-getBlockNumber