mirror of
https://github.com/mempool/mempool.git
synced 2025-01-10 07:26:46 +01:00
28 lines
798 B
TypeScript
28 lines
798 B
TypeScript
|
import { Component, ChangeDetectionStrategy, OnChanges, Input } from '@angular/core';
|
||
|
import { calcSegwitFeeGains } from 'src/app/bitcoin.utils';
|
||
|
import { Transaction } from 'src/app/interfaces/electrs.interface';
|
||
|
|
||
|
@Component({
|
||
|
selector: 'app-tx-features',
|
||
|
templateUrl: './tx-features.component.html',
|
||
|
styleUrls: ['./tx-features.component.scss'],
|
||
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||
|
})
|
||
|
export class TxFeaturesComponent implements OnChanges {
|
||
|
@Input() tx: Transaction;
|
||
|
|
||
|
segwitGains = {
|
||
|
realizedGains: 0,
|
||
|
potentialBech32Gains: 0,
|
||
|
potentialP2shGains: 0,
|
||
|
};
|
||
|
isRbfTransaction: boolean;
|
||
|
|
||
|
constructor() { }
|
||
|
|
||
|
ngOnChanges() {
|
||
|
this.segwitGains = calcSegwitFeeGains(this.tx);
|
||
|
this.isRbfTransaction = this.tx.vin.some((v) => v.sequence < 0xfffffffe);
|
||
|
}
|
||
|
}
|