diff --git a/backend/src/api/mempool.ts b/backend/src/api/mempool.ts index 4eedf5bca..9ca360457 100644 --- a/backend/src/api/mempool.ts +++ b/backend/src/api/mempool.ts @@ -1,6 +1,6 @@ const config = require('../../mempool-config.json'); import bitcoinApi from './bitcoin/electrs-api'; -import { MempoolInfo, TransactionExtended, Transaction } from '../interfaces'; +import { MempoolInfo, TransactionExtended, Transaction, VbytesPerSecond } from '../interfaces'; class Mempool { private inSync: boolean = false; @@ -12,7 +12,7 @@ class Mempool { private txPerSecondArray: number[] = []; private txPerSecond: number = 0; - private vBytesPerSecondArray: any[] = []; + private vBytesPerSecondArray: VbytesPerSecond[] = []; private vBytesPerSecond: number = 0; constructor() { diff --git a/backend/src/interfaces.ts b/backend/src/interfaces.ts index a9500d42b..d525f18c6 100644 --- a/backend/src/interfaces.ts +++ b/backend/src/interfaces.ts @@ -222,3 +222,8 @@ export interface WebsocketResponse { 'track-address': string; 'watch-mempool': boolean; } + +export interface VbytesPerSecond { + unixTime: number; + vSize: number; +} diff --git a/frontend/src/app/app.constants.ts b/frontend/src/app/app.constants.ts index bfd80a03e..de257f833 100644 --- a/frontend/src/app/app.constants.ts +++ b/frontend/src/app/app.constants.ts @@ -35,3 +35,4 @@ export const feeLevels = [1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 20, 30, 40, 50, 60, 7 250, 300, 350, 400, 500, 600, 700, 800, 900, 1000, 1200, 1400, 1600, 1800, 2000]; export const ELCTRS_ITEMS_PER_PAGE = 25; +export const KEEP_BLOCKS_AMOUNT = 8; diff --git a/frontend/src/app/components/address-labels/address-labels.component.html b/frontend/src/app/components/address-labels/address-labels.component.html index b7ed241f1..16deecabf 100644 --- a/frontend/src/app/components/address-labels/address-labels.component.html +++ b/frontend/src/app/components/address-labels/address-labels.component.html @@ -1,2 +1,2 @@ multisig {{ multisigM }} of {{ multisigN }} -Layer2 Peg-out +Layer{{ network === 'liquid' ? '3' : '2' }} Peg-out diff --git a/frontend/src/app/components/address-labels/address-labels.component.ts b/frontend/src/app/components/address-labels/address-labels.component.ts index e90461cae..e7a48dc07 100644 --- a/frontend/src/app/components/address-labels/address-labels.component.ts +++ b/frontend/src/app/components/address-labels/address-labels.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit, ChangeDetectionStrategy, Input } from '@angular/core'; import { Vin, Vout } from '../../interfaces/electrs.interface'; +import { StateService } from 'src/app/services/state.service'; @Component({ selector: 'app-address-labels', @@ -8,6 +9,7 @@ import { Vin, Vout } from '../../interfaces/electrs.interface'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class AddressLabelsComponent implements OnInit { + network = ''; @Input() vin: Vin; @Input() vout: Vout; @@ -18,7 +20,11 @@ export class AddressLabelsComponent implements OnInit { secondLayerClose = false; - constructor() { } + constructor( + stateService: StateService, + ) { + this.network = stateService.network; + } ngOnInit() { if (this.vin) { diff --git a/frontend/src/app/components/block/block.component.ts b/frontend/src/app/components/block/block.component.ts index 473a3e43d..60624e250 100644 --- a/frontend/src/app/components/block/block.component.ts +++ b/frontend/src/app/components/block/block.component.ts @@ -120,7 +120,7 @@ export class BlockComponent implements OnInit, OnDestroy { }); this.stateService.blocks$ - .subscribe((block) => this.latestBlock = block); + .subscribe(([block]) => this.latestBlock = block); this.stateService.networkChanged$ .subscribe((network) => this.network = network); diff --git a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html index f7b0d223f..8da403914 100644 --- a/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html +++ b/frontend/src/app/components/blockchain-blocks/blockchain-blocks.component.html @@ -1,6 +1,6 @@