Skip to content

Commit

Permalink
Expose bitcoin finality
Browse files Browse the repository at this point in the history
  • Loading branch information
gabmontes committed Apr 3, 2024
1 parent ddee04d commit be9ddc2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions types/api/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export interface Block {
bitcoin_merged_mining_merkle_proof?: string | null;
hash_for_merged_mining?: string | null;
minimum_gas_price?: string | null;
// HEMI FIELDS
btc_finality?: number;
}

export interface BlocksResponse {
Expand Down
2 changes: 2 additions & 0 deletions types/api/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ export type Transaction = {
zkevm_batch_number?: number;
zkevm_status?: typeof ZKEVM_L2_TX_STATUSES[number];
zkevm_sequence_hash?: string;
// Hemi fields
btc_finality?: number;
}

export const ZKEVM_L2_TX_STATUSES = [ 'Confirmed by Sequencer', 'L1 Confirmed' ];
Expand Down
11 changes: 11 additions & 0 deletions ui/block/BlockDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@ const BlockDetails = ({ query }: Props) => {
>
<DetailsTimestamp timestamp={ data.timestamp } isLoading={ isPlaceholderData }/>
</DetailsInfoItem>
{ data.btc_finality && (
<DetailsInfoItem
title="Bitcoin finality"
hint="Number of Bitcoin block confirmations protecting this block."
isLoading={ isPlaceholderData }
>
<Skeleton isLoaded={ !isPlaceholderData }>
{ data.btc_finality }
</Skeleton>
</DetailsInfoItem>
) }
<DetailsInfoItem
title="Transactions"
hint="The number of transactions in the block"
Expand Down
11 changes: 11 additions & 0 deletions ui/tx/details/TxInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,17 @@ const TxInfo = ({ data, isLoading, socketStatus }: Props) => {
) }
</DetailsInfoItem>
) }
{ data.btc_finality && (
<DetailsInfoItem
title="Bitcoin finality"
hint="Number of Bitcoin block confirmations protecting this transaction."
isLoading={ isLoading }
>
<Skeleton isLoaded={ !isLoading }>
{ data.btc_finality }
</Skeleton>
</DetailsInfoItem>
) }
{ data.execution_node && (
<DetailsInfoItem
title="Kettle"
Expand Down

0 comments on commit be9ddc2

Please sign in to comment.