Skip to content

Commit

Permalink
fix: default to a total assets static value (#296)
Browse files Browse the repository at this point in the history
* fix: default to a total assets static value

* v1.4.9
  • Loading branch information
DiogoSoaress authored Mar 27, 2024
1 parent 34859f3 commit b2e20a7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "safe-homepage",
"homepage": "https://github.com/safe-global/safe-homepage",
"version": "1.4.8",
"version": "1.4.9",
"scripts": {
"build": "next build && next export",
"lint": "tsc && next lint",
Expand Down
6 changes: 3 additions & 3 deletions src/content/home.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@
"text": "Previously called Gnosis Safe, <i>Safe</i> spun out with a mission to build a better standard for ownership with smart accounts",
"items": [
{
"title": "17M",
"title": "39M",
"text": "Total transactions",
"link": {
"href": "https://dune.com/queries/2093960/3449499"
}
},
{
"title": "$52B",
"title": "$124B",
"text": "Total assets stored",
"link": {
"href": "https://dune.com/queries/2893829/4821383"
}
},
{
"title": "4.4M",
"title": "7.6M",
"text": "Safe accounts deployed",
"link": {
"href": "https://dune.com/queries/2459401/4044167"
Expand Down
12 changes: 7 additions & 5 deletions src/hooks/useSafeStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DUNE_API_KEY } from '@/config/constants'
import { duneQueryUrlBuilder } from '@/lib/duneQueryUrlBuilder'

const QUERY_ID_TOTAL_TRANSACTIONS = 2093960
const QUERY_ID_TOTAL_ASSETS = 2893829
// const QUERY_ID_TOTAL_ASSETS = 2893829
const QUERY_ID_TOTAL_SAFES_DEPLOYED = 2459401

export const fetchTotalTransactions = async (): Promise<number | null> => {
Expand All @@ -16,10 +16,12 @@ export const fetchTotalTransactions = async (): Promise<number | null> => {
}

export const fetchTotalAssets = async (): Promise<number | null> => {
return fetch(duneQueryUrlBuilder(QUERY_ID_TOTAL_ASSETS, DUNE_API_KEY))
.then((res) => res.json())
.then((data) => data.result.rows[0].usd_value)
.catch(() => null)
return null
// Dune query has a but that needs to be fixed so defaulting to a static value
// return fetch(duneQueryUrlBuilder(QUERY_ID_TOTAL_ASSETS, DUNE_API_KEY))
// .then((res) => res.json())
// .then((data) => data.result.rows[0].usd_value)
// .catch(() => null)
}

export const fetchTotalSafesDeployed = async (): Promise<number | null> => {
Expand Down

0 comments on commit b2e20a7

Please sign in to comment.