diff --git a/frontend/src/app/components/transaction/transaction.component.html b/frontend/src/app/components/transaction/transaction.component.html index ec08c9303..04d13b07a 100644 --- a/frontend/src/app/components/transaction/transaction.component.html +++ b/frontend/src/app/components/transaction/transaction.component.html @@ -67,7 +67,7 @@ - + Features @@ -468,6 +468,7 @@ + diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts index 899f5ee6b..c60d796e4 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -74,6 +74,12 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { flowEnabled: boolean; blockConversion: Price; tooltipPosition: { x: number, y: number }; + isMobile: boolean; + + featuresEnabled: boolean; + segwitEnabled: boolean; + rbfEnabled: boolean; + taprootEnabled: boolean; @ViewChild('graphContainer') graphContainer: ElementRef; @@ -197,6 +203,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { } this.tx = tx; + this.setFeatures(); this.isCached = true; if (tx.fee === undefined) { this.tx.fee = 0; @@ -291,6 +298,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { } this.tx = tx; + this.setFeatures(); this.isCached = false; if (tx.fee === undefined) { this.tx.fee = 0; @@ -428,9 +436,23 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { }); } + setFeatures(): void { + if (this.tx) { + this.segwitEnabled = !this.tx.status.confirmed || this.tx.status.block_height >= 477120; + this.taprootEnabled = !this.tx.status.confirmed || this.tx.status.block_height >= 709632; + this.rbfEnabled = !this.tx.status.confirmed || this.tx.status.block_height > 399700; + } else { + this.segwitEnabled = false; + this.taprootEnabled = false; + this.rbfEnabled = false; + } + this.featuresEnabled = this.segwitEnabled || this.taprootEnabled || this.rbfEnabled; + } + resetTransaction() { this.error = undefined; this.tx = null; + this.setFeatures(); this.waitingForTransaction = false; this.isLoadingTx = true; this.rbfTransaction = undefined; @@ -495,6 +517,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { @HostListener('window:resize', ['$event']) setGraphSize(): void { + this.isMobile = window.innerWidth < 850; if (this.graphContainer) { setTimeout(() => { this.graphWidth = this.graphContainer.nativeElement.clientWidth; diff --git a/frontend/src/app/components/tx-features/tx-features.component.html b/frontend/src/app/components/tx-features/tx-features.component.html index 54df244b2..e9e7a3b53 100644 --- a/frontend/src/app/components/tx-features/tx-features.component.html +++ b/frontend/src/app/components/tx-features/tx-features.component.html @@ -1,4 +1,4 @@ - + SegWit SegWit @@ -8,7 +8,7 @@ - + Taproot Taproot @@ -24,7 +24,7 @@ - + RBF RBF diff --git a/frontend/src/app/components/tx-features/tx-features.component.ts b/frontend/src/app/components/tx-features/tx-features.component.ts index 8f7d30b12..9376a0c7c 100644 --- a/frontend/src/app/components/tx-features/tx-features.component.ts +++ b/frontend/src/app/components/tx-features/tx-features.component.ts @@ -21,12 +21,19 @@ export class TxFeaturesComponent implements OnChanges { isRbfTransaction: boolean; isTaproot: boolean; + segwitEnabled: boolean; + rbfEnabled: boolean; + taprootEnabled: boolean; + constructor() { } ngOnChanges() { if (!this.tx) { return; } + this.segwitEnabled = !this.tx.status.confirmed || this.tx.status.block_height >= 477120; + this.taprootEnabled = !this.tx.status.confirmed || this.tx.status.block_height >= 709632; + this.rbfEnabled = !this.tx.status.confirmed || this.tx.status.block_height > 399700; this.segwitGains = calcSegwitFeeGains(this.tx); this.isRbfTransaction = this.tx.vin.some((v) => v.sequence < 0xfffffffe); this.isTaproot = this.tx.vin.some((v) => v.prevout && v.prevout.scriptpubkey_type === 'v1_p2tr');
Fee {{ tx.fee | number }} sat