Add blocks.extras.totalFees and show it in blockchain blocks component
This commit is contained in:
		
							parent
							
								
									201eff593b
								
							
						
					
					
						commit
						c1092adfd9
					
				@ -116,6 +116,9 @@ class Blocks {
 | 
			
		||||
      Common.median(transactionsTmp.map((tx) => tx.effectiveFeePerVsize)) : 0;
 | 
			
		||||
    blockExtended.extras.feeRange = transactionsTmp.length > 0 ?
 | 
			
		||||
      Common.getFeesInRange(transactionsTmp, 8) : [0, 0];
 | 
			
		||||
    blockExtended.extras.totalFees = transactionsTmp.reduce((acc, tx) => {
 | 
			
		||||
      return acc + tx.fee;
 | 
			
		||||
    }, 0)
 | 
			
		||||
 | 
			
		||||
    if (Common.indexingEnabled()) {
 | 
			
		||||
      let pool: PoolTag;
 | 
			
		||||
 | 
			
		||||
@ -78,6 +78,7 @@ export interface TransactionStripped {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface BlockExtension {
 | 
			
		||||
  totalFees?: number;
 | 
			
		||||
  medianFee?: number;
 | 
			
		||||
  feeRange?: number[];
 | 
			
		||||
  reward?: number;
 | 
			
		||||
 | 
			
		||||
@ -14,7 +14,7 @@
 | 
			
		||||
          {{ block?.extras?.feeRange[1] | number:feeRounding }} - {{ block?.extras?.feeRange[block?.extras?.feeRange.length - 1] | number:feeRounding }} <ng-container i18n="shared.sat-vbyte|sat/vB">sat/vB</ng-container>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div *ngIf="showMiningInfo" class="block-size">
 | 
			
		||||
          <app-amount [satoshis]="block.extras.reward" digitsInfo="1.2-3" [noFiat]="true"></app-amount>
 | 
			
		||||
          <app-amount [satoshis]="block.extras?.totalFees ?? 0" digitsInfo="1.2-3" [noFiat]="true"></app-amount>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div *ngIf="!showMiningInfo" class="block-size" [innerHTML]="'‎' + (block.size | bytes: 2)"></div>
 | 
			
		||||
        <div class="transaction-count">
 | 
			
		||||
 | 
			
		||||
@ -101,6 +101,7 @@ export interface PoolStat {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface BlockExtension {
 | 
			
		||||
  totalFees?: number;
 | 
			
		||||
  medianFee?: number;
 | 
			
		||||
  feeRange?: number[];
 | 
			
		||||
  reward?: number;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user