@@ -10,7 +10,7 @@ import { getRankCategory } from "@/services/constants/rollups"
1010import Tooltip from " @/components/ui/Tooltip.vue"
1111
1212/** API */
13- import { fetchPriceSeries , fetchTVS } from " @/services/api/stats"
13+ import { fetchPriceSeries , fetchSummary , fetchTVS } from " @/services/api/stats"
1414
1515/** Store */
1616import { useAppStore } from " @/store/app.store"
@@ -21,8 +21,6 @@ const activityStore = useActivityStore()
2121const head = computed (() => appStore .lastHead )
2222const currentPrice = computed (() => appStore .currentPrice )
2323
24- const totalSupply = computed (() => head .value .total_supply / 1_000_000 )
25- const totalSupplyUSD = computed (() => totalSupply .value * currentPrice .value ? .close )
2624const totalFees = computed (() => head .value .total_fee / 1_000_000 )
2725const totalFeesUSD = computed (() => totalFees .value * currentPrice .value ? .close )
2826const topRollup = computed (() => {
@@ -46,6 +44,9 @@ const price = reactive({
4644 side: null ,
4745})
4846const tvs = computed (() => appStore .tvs )
47+ const txCount24h = ref (0 )
48+ const bytesInBlocks24h = ref (0 )
49+
4950onMounted (async () => {
5051 const dataSeries = await fetchPriceSeries ({ from: parseInt (DateTime .now ().minus ({ days: 3 }).ts / 1_000 ) })
5152 series .value = dataSeries
@@ -65,6 +66,15 @@ onMounted(async () => {
6566 appStore .tvs = _tvs .value
6667 }
6768
69+ const startTime = parseInt (DateTime .now ().minus ({ days: 1 }).toSeconds ())
70+ const params = {
71+ table: " block_stats" ,
72+ func: " sum" ,
73+ from: startTime,
74+ }
75+ txCount24h .value = await fetchSummary ({ ... params, column: " tx_count" })
76+ bytesInBlocks24h .value = await fetchSummary ({ ... params, column: " bytes_in_block" })
77+
6878 isLoading .value = false
6979})
7080< / script>
@@ -112,35 +122,12 @@ onMounted(async () => {
112122
113123 < div : class = " $style.dot" / >
114124 < / template>
115-
116- < Tooltip>
117- < Flex align= " center" gap= " 6" : class = " $style.stat" >
118- < Icon name= " tx" size= " 12" color= " secondary" : class = " $style.icon" / >
119- < Flex align= " center" gap= " 4" >
120- < Text size= " 12" weight= " 500" color= " tertiary" noWrap : class = " $style.key" > Txs: < / Text >
121-
122- < Text v- if = " head.total_tx" size= " 12" weight= " 600" noWrap : class = " $style.value" > {{
123- abbreviate (head .total_tx )
124- }}< / Text >
125- < Skeleton v- else w= " 40" h= " 12" / >
126- < / Flex>
127- < / Flex>
128-
129- < template #content>
130- < Flex align= " center" justify= " between" gap= " 8" >
131- < Text size= " 12" weight= " 500" color= " tertiary" > Total Txs: < / Text >
132- < Text size= " 12" weight= " 600" color= " secondary" > {{ comma (head .total_tx ) }} < / Text >
133- < / Flex>
134- < / template>
135- < / Tooltip>
136-
137- < div : class = " $style.dot" / >
138-
125+
139126 < Tooltip>
140127 < Flex align= " center" gap= " 6" : class = " $style.stat" >
141128 < Icon name= " coins" size= " 12" color= " secondary" : class = " $style.icon" / >
142129 < Flex align= " center" gap= " 4" >
143- < Text size= " 12" weight= " 500" color= " tertiary" noWrap : class = " $style.key" > TVS : < / Text >
130+ < Text size= " 12" weight= " 500" color= " tertiary" noWrap : class = " $style.key" > Current TVS : < / Text >
144131
145132 < Text v- if = " !isLoading" size= " 12" weight= " 600" noWrap : class = " $style.value" >
146133 {{ abbreviate (tvs, 2 ) }} USD
@@ -161,21 +148,21 @@ onMounted(async () => {
161148
162149 < Tooltip>
163150 < Flex align= " center" gap= " 6" : class = " $style.stat" >
164- < Icon name= " namespace " size= " 12" color= " secondary" : class = " $style.icon" / >
151+ < Icon name= " tx " size= " 12" color= " secondary" : class = " $style.icon" / >
165152 < Flex align= " center" gap= " 4" >
166- < Text size= " 12" weight= " 500" color= " tertiary" noWrap : class = " $style.key" > Blobs Size : < / Text >
153+ < Text size= " 12" weight= " 500" color= " tertiary" noWrap : class = " $style.key" > Txs : < / Text >
167154
168- < Text v- if = " head.total_blobs_size " size= " 12" weight= " 600" noWrap : class = " $style.value" > {{
169- formatBytes ( head . total_blobs_size )
155+ < Text v- if = " !isLoading " size= " 12" weight= " 600" noWrap : class = " $style.value" > {{
156+ abbreviate (txCount24h )
170157 }}< / Text >
171158 < Skeleton v- else w= " 40" h= " 12" / >
172159 < / Flex>
173160 < / Flex>
174161
175162 < template #content>
176163 < Flex align= " center" justify= " between" gap= " 8" >
177- < Text size= " 12" weight= " 500" color= " tertiary" > Total Blobs Size : < / Text >
178- < Text size= " 12" weight= " 600" color= " secondary" > {{ comma (head . total_blobs_size ) }} Bytes < / Text >
164+ < Text size= " 12" weight= " 500" color= " tertiary" > 24h Tx Count : < / Text >
165+ < Text size= " 12" weight= " 600" color= " secondary" > {{ comma (txCount24h ) }} < / Text >
179166 < / Flex>
180167 < / template>
181168 < / Tooltip>
@@ -184,21 +171,21 @@ onMounted(async () => {
184171
185172 < Tooltip>
186173 < Flex align= " center" gap= " 6" : class = " $style.stat" >
187- < Icon name= " tag " size= " 12" color= " secondary" : class = " $style.icon" / >
174+ < Icon name= " block " size= " 12" color= " secondary" : class = " $style.icon" / >
188175 < Flex align= " center" gap= " 4" >
189- < Text size= " 12" weight= " 500" color= " tertiary" noWrap : class = " $style.key" > Fees : < / Text >
176+ < Text size= " 12" weight= " 500" color= " tertiary" noWrap : class = " $style.key" > Bytes In Blocks : < / Text >
190177
191- < Text v- if = " head.total_fee " size= " 12" weight= " 600" noWrap : class = " $style.value" >
192- {{ abbreviate ( parseInt (totalFees)) }} TIA
193- < / Text >
178+ < Text v- if = " !isLoading " size= " 12" weight= " 600" noWrap : class = " $style.value" > {{
179+ formatBytes (bytesInBlocks24h)
180+ }} < / Text >
194181 < Skeleton v- else w= " 40" h= " 12" / >
195182 < / Flex>
196183 < / Flex>
197184
198185 < template #content>
199186 < Flex align= " center" justify= " between" gap= " 8" >
200- < Text size= " 12" weight= " 500" color= " tertiary" > Total Fees : < / Text >
201- < Text size= " 12" weight= " 600" color= " secondary" > {{ abbreviate (totalFeesUSD ) }} USD < / Text >
187+ < Text size= " 12" weight= " 500" color= " tertiary" > 24h Bytes In Blocks : < / Text >
188+ < Text size= " 12" weight= " 600" color= " secondary" > {{ comma (bytesInBlocks24h ) }} Bytes < / Text >
202189 < / Flex>
203190 < / template>
204191 < / Tooltip>
0 commit comments