From 03cdbaf3d84753e3912df1d2df8a5f7c0db8d7ba Mon Sep 17 00:00:00 2001 From: kingsleydon <10992364+kingsleydon@users.noreply.github.com> Date: Thu, 29 Feb 2024 21:24:20 +0800 Subject: [PATCH] feat(analytics): new circulation api --- .vscode/settings.json | 2 + .../analytics/src/lib/ChainCirculation.svelte | 262 ++++++++---------- apps/analytics/src/lib/Computation.svelte | 262 +++++++++--------- apps/analytics/src/routes/token/+page.svelte | 117 ++++---- apps/analytics/src/stores/circulation.ts | 41 +-- 5 files changed, 329 insertions(+), 355 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 4471b8f0..d6ebc573 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -20,6 +20,7 @@ "cSpell.words": [ "biomejs", "bunx", + "crowdloan", "fontawesome", "fortawesome", "karura", @@ -36,6 +37,7 @@ "staker", "stakers", "subbridge", + "Subscan", "subsquid", "svgs", "sygma", diff --git a/apps/analytics/src/lib/ChainCirculation.svelte b/apps/analytics/src/lib/ChainCirculation.svelte index f81d6e8f..a7c93488 100644 --- a/apps/analytics/src/lib/ChainCirculation.svelte +++ b/apps/analytics/src/lib/ChainCirculation.svelte @@ -1,150 +1,130 @@
diff --git a/apps/analytics/src/lib/Computation.svelte b/apps/analytics/src/lib/Computation.svelte index 5ba47a9a..836c9437 100644 --- a/apps/analytics/src/lib/Computation.svelte +++ b/apps/analytics/src/lib/Computation.svelte @@ -1,147 +1,147 @@

Computation

diff --git a/apps/analytics/src/routes/token/+page.svelte b/apps/analytics/src/routes/token/+page.svelte index b05411a9..5790d1d8 100644 --- a/apps/analytics/src/routes/token/+page.svelte +++ b/apps/analytics/src/routes/token/+page.svelte @@ -1,75 +1,64 @@ diff --git a/apps/analytics/src/stores/circulation.ts b/apps/analytics/src/stores/circulation.ts index 9af6331a..c6dbee35 100644 --- a/apps/analytics/src/stores/circulation.ts +++ b/apps/analytics/src/stores/circulation.ts @@ -1,26 +1,29 @@ import {createQuery} from '@tanstack/svelte-query' +interface PhalaCirculation { + circulation: string + crowdloan: string + reward: string + sygmaBridge: string + timestamp: string + totalIssuance: string +} + +interface EthereumCirculation { + circulation: string + phalaChainBridge: string + khalaChainBridge: string + reward: string + sygmaBridge: string + timestamp: string + totalSupply: string +} + interface CirculationData { - ethereumTotalSupply: string - ethereumMiningRewards: string - ethereumPhalaChainbridge: string - ethereumKhalaChainbridge: string - ethereumSygmaBridge: string - ethereumCirculation: string - phalaTotalIssuance: string - phalaMiningRewards: string - phalaCrowdloan: string - phalaChainbridge: string - phalaSygmaBridge: string - phalaCirculation: string - khalaTotalIssuance: string - khalaMiningRewards: string - khalaCrowdloan: string - khalaChainbridge: string - khalaSygmaBridge: string - khalaCirculation: string + phala: PhalaCirculation + khala: PhalaCirculation + ethereum: EthereumCirculation totalCirculation: string - lastUpdate: number } const fetchCirculationData = async () => {