WIP: Bisq DAO support. Transactions list and details.
This commit is contained in:
@@ -148,6 +148,21 @@
|
||||
|
||||
<br>
|
||||
|
||||
<ng-template [ngIf]="bisqTx">
|
||||
<h2>BSQ Information</h2>
|
||||
|
||||
<app-bisq-transaction-details [tx]="bisqTx"></app-bisq-transaction-details>
|
||||
|
||||
<br>
|
||||
|
||||
<h2>BSQ transfers</h2>
|
||||
|
||||
<app-bisq-transfers [tx]="bisqTx"></app-bisq-transfers>
|
||||
|
||||
<br>
|
||||
|
||||
</ng-template>
|
||||
|
||||
<h2>Inputs & Outputs</h2>
|
||||
|
||||
<app-transactions-list [transactions]="[tx]" [transactionPage]="true"></app-transactions-list>
|
||||
|
||||
@@ -10,6 +10,7 @@ import { AudioService } from 'src/app/services/audio.service';
|
||||
import { ApiService } from 'src/app/services/api.service';
|
||||
import { SeoService } from 'src/app/services/seo.service';
|
||||
import { calcSegwitFeeGains } from 'src/app/bitcoin.utils';
|
||||
import { BisqTransaction } from 'src/app/interfaces/bisq.interfaces';
|
||||
|
||||
@Component({
|
||||
selector: 'app-transaction',
|
||||
@@ -37,6 +38,7 @@ export class TransactionComponent implements OnInit, OnDestroy {
|
||||
};
|
||||
isRbfTransaction: boolean;
|
||||
rbfTransaction: undefined | Transaction;
|
||||
bisqTx: BisqTransaction;
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
@@ -90,6 +92,10 @@ export class TransactionComponent implements OnInit, OnDestroy {
|
||||
this.segwitGains = calcSegwitFeeGains(tx);
|
||||
this.isRbfTransaction = tx.vin.some((v) => v.sequence < 0xfffffffe);
|
||||
|
||||
if (this.network === 'bisq') {
|
||||
this.loadBisqTransaction();
|
||||
}
|
||||
|
||||
if (!tx.status.confirmed) {
|
||||
this.websocketService.startTrackTransaction(tx.txid);
|
||||
|
||||
@@ -133,6 +139,17 @@ export class TransactionComponent implements OnInit, OnDestroy {
|
||||
.subscribe((rbfTransaction) => this.rbfTransaction = rbfTransaction);
|
||||
}
|
||||
|
||||
loadBisqTransaction() {
|
||||
if (history.state.bsqTx) {
|
||||
this.bisqTx = history.state.bsqTx;
|
||||
} else {
|
||||
this.apiService.getBisqTransaction$(this.txId)
|
||||
.subscribe((tx) => {
|
||||
this.bisqTx = tx;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
handleLoadElectrsTransactionError(error: any): Observable<any> {
|
||||
if (error.status === 404 && /^[a-fA-F0-9]{64}$/.test(this.txId)) {
|
||||
this.websocketService.startMultiTrackTransaction(this.txId);
|
||||
@@ -204,6 +221,7 @@ export class TransactionComponent implements OnInit, OnDestroy {
|
||||
this.waitingForTransaction = false;
|
||||
this.isLoadingTx = true;
|
||||
this.rbfTransaction = undefined;
|
||||
this.bisqTx = undefined;
|
||||
this.transactionTime = -1;
|
||||
document.body.scrollTo(0, 0);
|
||||
this.leaveTransaction();
|
||||
|
||||
Reference in New Issue
Block a user