Skip to content

Commit 8b9d8e6

Browse files
committed
feat: add CL consolidations table
See: BEDS-1351
1 parent c328c71 commit 8b9d8e6

File tree

3 files changed

+120
-0
lines changed

3 files changed

+120
-0
lines changed

frontend/composables/useDashboardData.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import type {
2+
GetValidatorDashboardConsensusLayerConsolidationsResponse,
23
GetValidatorDashboardConsensusLayerDepositsResponse,
4+
GetValidatorDashboardExecutionLayerConsolidationsResponse,
35
GetValidatorDashboardExecutionLayerDepositsResponse,
46
GetValidatorDashboardTotalConsensusDepositsResponse,
57
GetValidatorDashboardTotalExecutionDepositsResponse,
@@ -60,10 +62,40 @@ export const useDashboardData = () => {
6062

6163
return res
6264
}
65+
async function fetchElConsolidations(
66+
dashboardKey: DashboardKey,
67+
query?: TableQueryParams,
68+
) {
69+
const res
70+
= await fetch<GetValidatorDashboardExecutionLayerConsolidationsResponse>(
71+
'DASHBOARD_EL_CONSOLIDATIONS',
72+
undefined,
73+
{ dashboardKey },
74+
query,
75+
)
76+
77+
return res
78+
}
79+
async function fetchClConsolidations(
80+
dashboardKey: DashboardKey,
81+
query?: TableQueryParams,
82+
) {
83+
const res
84+
= await fetch<GetValidatorDashboardConsensusLayerConsolidationsResponse>(
85+
'DASHBOARD_CL_CONSOLIDATIONS',
86+
undefined,
87+
{ dashboardKey },
88+
query,
89+
)
90+
91+
return res
92+
}
6393

6494
return {
95+
fetchClConsolidations,
6596
fetchClDeposits,
6697
fetchClDpositsTotalAmount,
98+
fetchElConsolidations,
6799
fetchELDeposits,
68100
fetchELDpositsTotalAmount,
69101
}

frontend/i18n/locales/en.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,30 @@
225225
"search_placeholder_public": "Index, Public Key",
226226
"title": "Blocks"
227227
},
228+
"cl_consolidations": {
229+
"info_slot_processed_estimated": "This is an estimation since this consolidation is still queued.",
230+
"reject_reason": {
231+
"full_queue": "The consolidation queue is full.",
232+
"insufficient_consolidation_churn": "Not enough churn capacity available to consolidate.",
233+
"source_address_mismatch": "The source address doesn't match",
234+
"source_equals_target": "Source and target must be different.",
235+
"source_exiting": "The source is currently exiting and cannot be used for consolidation.",
236+
"source_inactive": "The source is inactive and cannot be used for consolidation.",
237+
"source_no_execution_withdrawal_credentials": "The source has no execution withdrawal credentials.",
238+
"source_pending_withdrawals": "The source has pending withdrawals that must be completed before consolidating.",
239+
"source_slashed": "The source has been slashed and cannot be used for consolidation.",
240+
"source_too_young": "The source is too new to be eligible for consolidation.",
241+
"source_unknown_pubkey": "The source public key could not be found.",
242+
"target_exiting": "The target is currently exiting and cannot receive consolidation.",
243+
"target_inactive": "The target is inactive and cannot receive consolidation.",
244+
"target_not_compounding": "The target is not compounding.",
245+
"target_unknown_pubkey": "The target public key could not be found."
246+
},
247+
"search_placeholder": "Index, Slot",
248+
"slot_processed": "Slot Processed",
249+
"slot_queued": "Slot Queued",
250+
"title": "Consensus Layer"
251+
},
228252
"cl_deposits": {
229253
"info_slot_processed_estimated": "This is an estimation since this deposit is still queued.",
230254
"search_placeholder_guest_dashboard": "Index, Slot, Withdrawal Credential",

frontend/pages/dashboard/[[id]]/index.vue

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,61 @@ const clDeposits = computed(() => {
259259
})
260260
const clDepositsTotalAmount = computed(() => clDepositsData.value?.[1])
261261
262+
// Execution Layer Consolidations data
263+
const elConsolidationsQueryParams = ref<TableQueryParams>({
264+
limit: 5, sort: 'block_processed:desc',
265+
})
266+
const {
267+
data: elConsolidationsData,
268+
refresh: refreshElConsolidationsData,
269+
status: elConsolidationsDataStatus,
270+
} = useAsyncData('el_consolidations', () => {
271+
return dashboardData.fetchElConsolidations(
272+
dashboardKey.value,
273+
elConsolidationsQueryParams.value,
274+
)
275+
},
276+
{
277+
immediate: false,
278+
watch: [ elConsolidationsQueryParams ],
279+
})
280+
const elConsolidations = computed(() => {
281+
return elConsolidationsData.value || undefined
282+
})
283+
284+
// Consolidations Layer Consolidations data
285+
const clConsolidationsQueryParams = ref<TableQueryParams>({
286+
limit: 5, sort: 'timestamp:desc',
287+
})
288+
const {
289+
data: clConsolidationsData,
290+
refresh: refreshClConsolidationsData,
291+
status: clConsolidationsDataStatus,
292+
} = useAsyncData('cl_consolidations', () => {
293+
return dashboardData.fetchClConsolidations(
294+
dashboardKey.value,
295+
clConsolidationsQueryParams.value,
296+
)
297+
},
298+
{
299+
immediate: false,
300+
watch: [ clConsolidationsQueryParams ],
301+
})
302+
const clConsolidations = computed(() => {
303+
return clConsolidationsData.value || undefined
304+
})
305+
262306
// tabs
263307
const route = useRoute()
264308
265309
const activeTab = computed(() => route.hash)
266310
267311
const refreshActiveTab = () => {
268312
switch (activeTab.value) {
313+
case '#consolidations':
314+
refreshElConsolidationsData()
315+
refreshClConsolidationsData()
316+
break
269317
case '#deposits':
270318
refreshElDepositsData()
271319
refreshClDepositsData()
@@ -347,6 +395,22 @@ watch(
347395
:is-loading="clDepositsDataStatus === 'pending'"
348396
/>
349397
</template>
398+
<template #tab-panel-consolidations>
399+
<DashboardTableElConsolidations
400+
v-model:query="elConsolidationsQueryParams"
401+
:el-consolidations
402+
:is-loading="elConsolidationsDataStatus === 'pending'"
403+
/>
404+
<BcIcon
405+
name="arrow-down"
406+
class="down_icon"
407+
/>
408+
<DashboardTableClConsolidations
409+
v-model:query="clConsolidationsQueryParams"
410+
:cl-consolidations
411+
:is-loading="clConsolidationsDataStatus === 'pending'"
412+
/>
413+
</template>
350414
</BcTabList>
351415
</BcPageWrapper>
352416
</div>

0 commit comments

Comments
 (0)