Label channel closes

This commit is contained in:
softsimon
2022-06-30 00:35:27 +02:00
parent 8ef5e7425b
commit f630754aa3
7 changed files with 26 additions and 14 deletions

View File

@@ -34,7 +34,8 @@ export class AddressLabelsComponent implements OnChanges {
}
handleChannel() {
this.label = `Channel open: ${this.channel.node_left.alias} <> ${this.channel.node_right.alias}`;
const type = this.vout ? 'open' : 'close';
this.label = `Channel ${type}: ${this.channel.node_left.alias} <> ${this.channel.node_right.alias}`;
}
handleVin() {

View File

@@ -77,7 +77,7 @@
{{ vin.prevout.scriptpubkey_type?.toUpperCase() }}
</ng-template>
<div>
<app-address-labels [vin]="vin"></app-address-labels>
<app-address-labels [vin]="vin" [channel]="channels && channels.inputs[i] || null"></app-address-labels>
</div>
</ng-template>
</ng-container>
@@ -172,7 +172,7 @@
</span>
</a>
<div>
<app-address-labels [vout]="vout" [channel]="channels && channels[i] && channels[i].transaction_vout === vindex ? channels[i] : null"></app-address-labels>
<app-address-labels [vout]="vout" [channel]="channels && channels.outputs[i] && channels.outputs[i].transaction_vout === vindex ? channels.outputs[i] : null"></app-address-labels>
</div>
<ng-template #scriptpubkey_type>
<ng-template [ngIf]="vout.pegout" [ngIfElse]="defaultscriptpubkey_type">

View File

@@ -36,7 +36,7 @@ export class TransactionsListComponent implements OnInit, OnChanges {
showDetails$ = new BehaviorSubject<boolean>(false);
outspends: Outspend[][] = [];
assetsMinimal: any;
channels: any[];
channels: { inputs: any[], outputs: any[] };
constructor(
public stateService: StateService,

View File

@@ -232,12 +232,12 @@ export class ApiService {
return this.httpClient.get<RewardStats>(this.apiBaseUrl + this.apiBasePath + `/api/v1/mining/reward-stats/${blockCount}`);
}
getChannelByTxIds$(txIds: string[]): Observable<any[]> {
getChannelByTxIds$(txIds: string[]): Observable<{ inputs: any[], outputs: any[] }> {
let params = new HttpParams();
txIds.forEach((txId: string) => {
params = params.append('txId[]', txId);
});
return this.httpClient.get<any[]>(this.apiBaseUrl + this.apiBasePath + '/lightning/api/v1/channels/txids/', { params });
return this.httpClient.get<{ inputs: any[], outputs: any[] }>(this.apiBaseUrl + this.apiBasePath + '/lightning/api/v1/channels/txids/', { params });
}
lightningSearch$(searchText: string): Observable<any[]> {