Skip to content

Commit f3480b1

Browse files
committed
fix(explorer, explored-types): add missing address event types
1 parent e403940 commit f3480b1

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

.changeset/shiny-islands-decide.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'explorer': minor
3+
'@siafoundation/explored-types': minor
4+
---
5+
6+
Fixed missing address event types.

apps/explorer/components/Address/index.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,12 @@ function formatV2ContractResolutionEntity(
244244

245245
function formatPayoutEntity(payout: ExplorerEvent): EntityListItemProps {
246246
const { siacoinElement } = payout.data as EventPayout
247+
const capitalizedType =
248+
payout.type.slice(0, 1).toUpperCase() + payout.type.slice(1)
247249
return {
248250
hash: payout.id,
249-
label: 'Payout',
250-
initials: 'P',
251+
label: `${capitalizedType} Payout`,
252+
initials: `${capitalizedType.slice(0, 1)}P`,
251253
href: routes.address.view.replace(':id', siacoinElement.source),
252254
height: payout.index.height,
253255
sc: new BigNumber(siacoinElement.siacoinOutput.value),
@@ -287,7 +289,9 @@ const formatEvent = (
287289
case 'v2ContractResolution':
288290
baseEntity = formatV2ContractResolutionEntity(event)
289291
break
290-
case 'payout':
292+
case 'miner':
293+
case 'foundation':
294+
case 'siafundClaim':
291295
baseEntity = formatPayoutEntity(event)
292296
break
293297
}

libs/explored-types/src/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ type ExplorerEventBase = {
9595
}
9696

9797
type ExplorerMinerPayoutEvent = ExplorerEventBase & {
98-
type: 'payout'
98+
type: 'miner' | 'foundation' | 'siafundClaim'
9999
data: EventPayout
100100
}
101101

0 commit comments

Comments
 (0)