File tree Expand file tree Collapse file tree 2 files changed +29
-5
lines changed Expand file tree Collapse file tree 2 files changed +29
-5
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ const getPercentageRatio = (v) => {
86
86
}
87
87
88
88
const getSectorName = (item ) => {
89
- return item .time ? DateTime .fromISO (item .time ).hour : DateTime .now ().hour
89
+ return item? .time ? DateTime .fromISO (item? .time ).hour : DateTime .now ().hour
90
90
}
91
91
< / script>
92
92
Original file line number Diff line number Diff line change @@ -74,23 +74,47 @@ export const fetchLatestBlocks = async ({ limit }) => {
74
74
}
75
75
}
76
76
77
+ // export const fetchAvgBlockTime = async ({ from }) => {
78
+ // try {
79
+ // const url = new URL(`${useServerURL()}/stats/summary/block_stats/avg?column=block_time`)
80
+
81
+ // url.searchParams.append("from", from)
82
+
83
+ // const data = await useFetch(url.href)
84
+ // return data
85
+ // } catch (error) {
86
+ // console.error(error)
87
+ // }
88
+ // }
89
+
90
+ // export const fetchBlockByHeight = async (height) => {
91
+ // try {
92
+ // const data = await useFetch(`${useServerURL()}/block/${height}?stats=true`)
93
+ // return data
94
+ // } catch (error) {
95
+ // console.error(error)
96
+ // }
97
+ // }
98
+
77
99
export const fetchAvgBlockTime = async ( { from } ) => {
78
100
try {
79
101
const url = new URL ( `${ useServerURL ( ) } /stats/summary/block_stats/avg?column=block_time` )
80
102
81
103
url . searchParams . append ( "from" , from )
82
104
83
- const data = await useFetch ( url . href )
84
- return data
105
+ return useFetch ( url . href , {
106
+ key : "avg_block_time" ,
107
+ } )
85
108
} catch ( error ) {
86
109
console . error ( error )
87
110
}
88
111
}
89
112
90
113
export const fetchBlockByHeight = async ( height ) => {
91
114
try {
92
- const data = await useFetch ( `${ useServerURL ( ) } /block/${ height } ?stats=true` )
93
- return data
115
+ return useFetch ( `${ useServerURL ( ) } /block/${ height } ?stats=true` , {
116
+ key : "block" ,
117
+ } )
94
118
} catch ( error ) {
95
119
console . error ( error )
96
120
}
You can’t perform that action at this time.
0 commit comments