Liquidity Ads List Display Incomplete

Liquidity Ads List Display Incomplete
This commit is contained in:
Shahana Farooqui 2022-05-16 22:53:13 -04:00 committed by ShahanaFarooqui
parent 47011011d9
commit 346e414181
91 changed files with 623 additions and 188 deletions

View File

@ -2,7 +2,6 @@ name: Lint & Test
on:
push:
branches: [ master, 'Release-*' ]
tags: [ 'v*' ]
release:
types: [released]

View File

@ -64,3 +64,23 @@ export const feeRates = (req, res, next) => {
return res.status(err.statusCode).json({ message: err.message, error: err.error });
});
};
export const listNodes = (req, res, next) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Network', msg: 'List Nodes..' });
options = common.getOptions(req);
if (options.error) {
return res.status(options.statusCode).json({ message: options.message, error: options.error });
}
options.url = req.session.selectedNode.ln_server_url + '/v1/network/listNodes' + (req.query !== {} ? (JSON.stringify(req.query).replace('{', '?').replace('}', '').replace(/:/g, '=').replace(/,/g, '&').replace(/"/g, '')) : '');
request(options).then((body) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Network', msg: 'List Nodes Finished', data: body });
body.forEach((node) => {
node.option_will_fund.lease_fee_base_msat = (node.option_will_fund && node.option_will_fund.lease_fee_base_msat && typeof node.option_will_fund.lease_fee_base_msat === 'string' && node.option_will_fund.lease_fee_base_msat.includes('msat')) ? node.option_will_fund.lease_fee_base_msat.replace('msat', '') : node.option_will_fund.lease_fee_base_msat;
node.option_will_fund.channel_fee_max_base_msat = (node.option_will_fund && node.option_will_fund.channel_fee_max_base_msat && typeof node.option_will_fund.channel_fee_max_base_msat === 'string' && node.option_will_fund.channel_fee_max_base_msat.includes('msat')) ? node.option_will_fund.channel_fee_max_base_msat.replace('msat', '') : node.option_will_fund.channel_fee_max_base_msat;
return node;
});
res.status(200).json(body);
}).catch((errRes) => {
const err = common.handleError(errRes, 'Network', 'Node Lookup Error', req.session.selectedNode);
return res.status(err.statusCode).json({ message: err.message, error: err.error });
});
};

View File

@ -1,10 +1,11 @@
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getRoute, listNode, listChannel, feeRates } from '../../controllers/cln/network.js';
import { getRoute, listNode, listChannel, feeRates, listNodes } from '../../controllers/cln/network.js';
const router = Router();
router.get('/getRoute/:destPubkey/:amount', isAuthenticated, getRoute);
router.get('/listNode/:id', isAuthenticated, listNode);
router.get('/listChannel/:channelShortId', isAuthenticated, listChannel);
router.get('/feeRates/:feeRateStyle', isAuthenticated, feeRates);
router.get('/listNodes', isAuthenticated, listNodes);
export default router;

View File

@ -60,3 +60,22 @@ export const feeRates = (req, res, next) => {
return res.status(err.statusCode).json({ message: err.message, error: err.error });
});
};
export const listNodes = (req, res, next) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Network', msg: 'List Nodes..' });
options = common.getOptions(req);
if (options.error) { return res.status(options.statusCode).json({ message: options.message, error: options.error }); }
options.url = req.session.selectedNode.ln_server_url + '/v1/network/listNodes' + (req.query !== {} ? (JSON.stringify(req.query).replace('{', '?').replace('}', '').replace(/:/g, '=').replace(/,/g, '&').replace(/"/g, '')) : '');
request(options).then((body) => {
logger.log({ selectedNode: req.session.selectedNode, level: 'INFO', fileName: 'Network', msg: 'List Nodes Finished', data: body });
body.forEach((node) => {
node.option_will_fund.lease_fee_base_msat = (node.option_will_fund && node.option_will_fund.lease_fee_base_msat && typeof node.option_will_fund.lease_fee_base_msat === 'string' && node.option_will_fund.lease_fee_base_msat.includes('msat')) ? node.option_will_fund.lease_fee_base_msat.replace('msat', '') : node.option_will_fund.lease_fee_base_msat;
node.option_will_fund.channel_fee_max_base_msat = (node.option_will_fund && node.option_will_fund.channel_fee_max_base_msat && typeof node.option_will_fund.channel_fee_max_base_msat === 'string' && node.option_will_fund.channel_fee_max_base_msat.includes('msat')) ? node.option_will_fund.channel_fee_max_base_msat.replace('msat', '') : node.option_will_fund.channel_fee_max_base_msat;
return node;
});
res.status(200).json(body);
}).catch((errRes) => {
const err = common.handleError(errRes, 'Network', 'Node Lookup Error', req.session.selectedNode);
return res.status(err.statusCode).json({ message: err.message, error: err.error });
});
};

View File

@ -1,7 +1,7 @@
import exprs from 'express';
const { Router } = exprs;
import { isAuthenticated } from '../../utils/authCheck.js';
import { getRoute, listNode, listChannel, feeRates } from '../../controllers/cln/network.js';
import { getRoute, listNode, listChannel, feeRates, listNodes } from '../../controllers/cln/network.js';
const router = Router();
@ -9,5 +9,6 @@ router.get('/getRoute/:destPubkey/:amount', isAuthenticated, getRoute);
router.get('/listNode/:id', isAuthenticated, listNode);
router.get('/listChannel/:channelShortId', isAuthenticated, listChannel);
router.get('/feeRates/:feeRateStyle', isAuthenticated, feeRates);
router.get('/listNodes', isAuthenticated, listNodes);
export default router;

View File

@ -56,6 +56,7 @@ import { CLNCreateOfferComponent } from './transactions/offers/create-offer-moda
import { CLNOfferInformationComponent } from './transactions/offers/offer-information-modal/offer-information.component';
import { CLNOffersTableComponent } from './transactions/offers/offers-table/offers-table.component';
import { CLNOfferBookmarksTableComponent } from './transactions/offers/offer-bookmarks-table/offer-bookmarks-table.component';
import { CLNLiquidityAdsComponent } from './liquidity-ads/liquidity-ads.component';
import { CLNUnlockedGuard } from '../shared/services/auth.guard';
@ -117,7 +118,8 @@ import { CLNUnlockedGuard } from '../shared/services/auth.guard';
CLNCreateOfferComponent,
CLNOfferInformationComponent,
CLNOffersTableComponent,
CLNOfferBookmarksTableComponent
CLNOfferBookmarksTableComponent,
CLNLiquidityAdsComponent
],
providers: [
CLNUnlockedGuard

View File

@ -34,6 +34,7 @@ import { CLNGraphComponent } from './graph/graph.component';
import { CLNOffersTableComponent } from './transactions/offers/offers-table/offers-table.component';
import { CLNOfferBookmarksTableComponent } from './transactions/offers/offer-bookmarks-table/offer-bookmarks-table.component';
import { CLNLocalFailedTransactionsComponent } from './routing/local-failed-transactions/local-failed-transactions.component';
import { CLNLiquidityAdsComponent } from './liquidity-ads/liquidity-ads.component';
export const ClnRoutes: Routes = [
{
@ -62,6 +63,7 @@ export const ClnRoutes: Routes = [
{ path: 'peers', component: CLNPeersComponent, data: { sweepAll: false }, canActivate: [CLNUnlockedGuard] }
]
},
{ path: 'liquidityads', component: CLNLiquidityAdsComponent, canActivate: [CLNUnlockedGuard] },
{
path: 'transactions', component: CLNTransactionsComponent, canActivate: [CLNUnlockedGuard], children: [
{ path: '', pathMatch: 'full', redirectTo: 'payments' },

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { faSearch } from '@fortawesome/free-solid-svg-icons';
@ -22,9 +22,11 @@ export class CLNGraphComponent implements OnInit, OnDestroy {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
}

View File

@ -3,7 +3,7 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { ChannelEdge, GetInfo } from '../../../../shared/models/clModels';
import { ChannelEdge, GetInfo } from '../../../../shared/models/clnModels';
import { RTLState } from '../../../../store/rtl.state';
import { clnNodeInformation } from '../../../store/cln.selector';

View File

@ -3,7 +3,7 @@ import { MatSnackBar } from '@angular/material/snack-bar';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { LookupNode } from '../../../../shared/models/clModels';
import { LookupNode } from '../../../../shared/models/clnModels';
import { NODE_FEATURES_CLN } from '../../../../shared/services/consts-enums-functions';
import { LoggerService } from '../../../../shared/services/logger.service';

View File

@ -6,7 +6,7 @@ import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { faRoute, faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import { Routes } from '../../../shared/models/clModels';
import { Routes } from '../../../shared/models/clnModels';
import { AlertTypeEnum, DataTypeEnum, ScreenSizeEnum } from '../../../shared/services/consts-enums-functions';
import { CommonService } from '../../../shared/services/common.service';

View File

@ -2,7 +2,7 @@ import { Component, Input } from '@angular/core';
import { Router } from '@angular/router';
import { faBalanceScale, faDumbbell } from '@fortawesome/free-solid-svg-icons';
import { Channel } from '../../../shared/models/clModels';
import { Channel } from '../../../shared/models/clnModels';
@Component({
selector: 'rtl-cln-channel-capacity-info',

View File

@ -1,7 +1,7 @@
import { Component, Input, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Channel } from '../../../shared/models/clModels';
import { Channel } from '../../../shared/models/clnModels';
import { ScreenSizeEnum } from '../../../shared/services/consts-enums-functions';
import { CommonService } from '../../../shared/services/common.service';

View File

@ -1,5 +1,5 @@
import { Component, Input } from '@angular/core';
import { ChannelsStatus } from '../../../shared/models/clModels';
import { ChannelsStatus } from '../../../shared/models/clnModels';
@Component({
selector: 'rtl-cln-channel-status-info',

View File

@ -1,5 +1,5 @@
import { Component, Input } from '@angular/core';
import { Fees } from '../../../shared/models/clModels';
import { Fees } from '../../../shared/models/clnModels';
@Component({
selector: 'rtl-cln-fee-info',

View File

@ -9,7 +9,7 @@ import { faAngleDoubleDown, faAngleDoubleUp, faChartPie, faBolt, faServer, faNet
import { SelNodeChild } from '../../shared/models/RTLconfig';
import { UserPersonaEnum, ScreenSizeEnum, APICallStatusEnum } from '../../shared/services/consts-enums-functions';
import { ChannelsStatus, GetInfo, Fees, Channel, Balance, LocalRemoteBalance } from '../../shared/models/clModels';
import { ChannelsStatus, GetInfo, Fees, Channel, Balance, LocalRemoteBalance } from '../../shared/models/clnModels';
import { ApiCallStatusPayload } from '../../shared/models/apiCallsPayload';
import { LoggerService } from '../../shared/services/logger.service';
import { CommonService } from '../../shared/services/common.service';

View File

@ -1,5 +1,5 @@
import { Component, OnChanges, Input } from '@angular/core';
import { GetInfo } from '../../../shared/models/clModels';
import { GetInfo } from '../../../shared/models/clnModels';
import { CommonService } from '../../../shared/services/common.service';
@Component({

View File

@ -0,0 +1,127 @@
<div fxLayout="row" fxLayoutAlign="start center" class="page-title-container">
<fa-icon [icon]="faWater" class="page-title-img mr-1"></fa-icon>
<span class="page-title">Liquidity Ads</span>
</div>
<div fxLayout="column" class="padding-gap-x">
<mat-card>
<mat-card-content class="padding-gap-large">
<div fxLayout="column" fxFlex="100" fxLayoutAlign="space-between stretch">
<form fxLayout="column" fxLayoutAlign="space-between stretch" fxLayout.gt-sm="row wrap" #formAsk="ngForm">
<div fxFlex="100" fxLayout="row" class="alert alert-warn">
<fa-icon [icon]="faExclamationTriangle" class="mr-1 alert-icon"></fa-icon>
<span>Ads should be suplemented with additional research of the nodes, before buying liquidity.</span>
</div>
<div fxLayout="column" fxLayout.gt-sm="row wrap" fxFlex="100" fxLayoutAlign.gt-sm="space-between center" fxLayoutAlign="start start" class="page-sub-title-container mt-1">
<div fxFlex="30">
<span class="page-title">
Liquidity Ask
<mat-icon matTooltip="Tooltip for Liquidity Ask" matTooltipPosition="above" class="info-icon info-icon-primary">info_outline</mat-icon>
</span>
</div>
<mat-form-field fxFlex="34">
<input autoFocus matInput placeholder="Channel Amount (Sats)" name="channelAmount" [(ngModel)]="channelAmount" tabindex="1" type="number" step="1000" required>
<mat-error *ngIf="!channelAmount">Channel amount is required.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="34">
<input matInput placeholder="Channel Opening Fee Rate (Sats/vByte)" name="channelOpeningFeeRate" [(ngModel)]="channelOpeningFeeRate" type="number" step="1" tabindex="2" required>
<mat-error *ngIf="!channelOpeningFeeRate">Channel opening fee rate is required.</mat-error>
</mat-form-field>
</div>
<div fxLayout="row" class="my-1">
<button class="mr-1" mat-stroked-button color="primary" tabindex="3" type="reset" (click)="onReset()">Clear</button>
<button mat-flat-button color="primary" (click)="onRecalculate()" tabindex="4" type="submit">Recalculate</button>
</div>
</form>
<mat-divider [inset]="true" class="my-2"></mat-divider>
<form fxLayout="column" fxLayoutAlign="space-between stretch" fxLayout.gt-sm="row wrap" #formFilter="ngForm">
<div fxLayout="column" fxLayout.gt-sm="row wrap" fxFlex="100" fxLayoutAlign.gt-sm="space-between center" fxLayoutAlign="start start" class="page-sub-title-container mt-1">
<div fxFlex="30">
<span class="page-title">
Nodes Advertising Liquidity
<mat-icon matTooltip="Tooltip for Nodes Advertising Liquidity" matTooltipPosition="above" class="info-icon info-icon-primary">info_outline</mat-icon>
</span>
</div>
<mat-form-field fxFlex="34">
<input matInput placeholder="Node Capacity (Sats)" name="nodeCapacity" [(ngModel)]="nodeCapacity" tabindex="5" type="number" step="1000" required>
<mat-error *ngIf="!nodeCapacity">Node capacity is required.</mat-error>
</mat-form-field>
<mat-form-field fxFlex="34">
<input matInput placeholder="Channel Count" name="channelCount" [(ngModel)]="channelCount" type="number" step="1" tabindex="6" required>
<mat-error *ngIf="!channelCount">Channel count is required.</mat-error>
</mat-form-field>
</div>
<div fxLayout="row" class="my-1">
<button class="mr-1" mat-stroked-button color="primary" tabindex="7" type="reset" (click)="onFilterReset()">Clear</button>
<button mat-flat-button color="primary" (click)="onFilter()" tabindex="8" type="submit">Filter</button>
</div>
</form>
<div [perfectScrollbar] fxLayout="column" fxLayoutAlign="start center" fxFlex="100" class="table-container">
<mat-progress-bar *ngIf="apiCallStatus.status === apiCallStatusEnum.INITIATED" mode="indeterminate"></mat-progress-bar>
<table mat-table #table [dataSource]="liquidityNodes" matSort [ngClass]="{'overflow-auto error-border': errorMessage !== '','overflow-auto': true}">
<ng-container matColumnDef="alias">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Alias </th>
<td mat-cell *matCellDef="let lqNode" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '40rem'}">
{{lqNode?.alias}}
</td>
</ng-container>
<ng-container matColumnDef="capacity">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Capacity </th>
<td mat-cell *matCellDef="let lqNode"><span fxLayoutAlign="end center">
{{lqNode?.option_will_fund?.lease_fee_basis | number:'1.0-0'}} </span></td>
</ng-container>
<ng-container matColumnDef="numChannels">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Channels </th>
<td mat-cell *matCellDef="let lqNode"><span fxLayoutAlign="end center">
{{lqNode?.option_will_fund?.lease_fee_basis | number:'1.0-0'}} </span></td>
</ng-container>
<ng-container matColumnDef="leaseFeeBasis">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Lease Fee </th>
<td mat-cell *matCellDef="let lqNode"><span fxLayoutAlign="end center">
{{lqNode?.option_will_fund?.lease_fee_basis | number:'1.0-0'}} </span></td>
</ng-container>
<ng-container matColumnDef="routingFee">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Routing Fee </th>
<td mat-cell *matCellDef="let lqNode"><span fxLayoutAlign="end center">
{{lqNode?.option_will_fund?.lease_fee_basis | number:'1.0-0'}} </span></td>
</ng-container>
<ng-container matColumnDef="channelOpenFee">
<th mat-header-cell *matHeaderCellDef mat-sort-header arrowPosition="before"> Channel Open Fee </th>
<td mat-cell *matCellDef="let lqNode"><span fxLayoutAlign="end center">
{{lqNode?.option_will_fund?.lease_fee_basis | number:'1.0-0'}} </span></td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef class="px-3">
<div class="bordered-box table-actions-select">
<mat-select placeholder="Actions" tabindex="1" class="mr-0">
<mat-select-trigger></mat-select-trigger>
<mat-option (click)="onDownloadCSV()">Download CSV</mat-option>
</mat-select>
</div>
</th>
<td mat-cell *matCellDef="let lqNode" fxLayoutAlign="end center" class="px-3">
<div class="bordered-box table-actions-select" fxLayoutAlign="center center">
<mat-select placeholder="Actions" tabindex="1" class="mr-0">
<mat-select-trigger></mat-select-trigger>
<mat-option (click)="onNodeClick(lqNode)">View Info</mat-option>
<mat-option (click)="onOpenChannel(lqNode)">Open Channel</mat-option>
</mat-select>
</div>
</td>
</ng-container>
<ng-container matColumnDef="no_lqNode">
<td mat-footer-cell *matFooterCellDef colspan="4">
<p *ngIf="(!liquidityNodes?.data || liquidityNodes?.data?.length<1) && apiCallStatus.status === apiCallStatusEnum.COMPLETED">No node with liquidity.</p>
<p *ngIf="(!liquidityNodes?.data || liquidityNodes?.data?.length<1) && apiCallStatus.status === apiCallStatusEnum.INITIATED">Getting nodes with liquidity...</p>
<p *ngIf="(!liquidityNodes?.data || liquidityNodes?.data?.length<1) && apiCallStatus.status === apiCallStatusEnum.ERROR">{{errorMessage}}</p>
</td>
</ng-container>
<tr mat-footer-row *matFooterRowDef="['no_lqNode']" [ngClass]="{'display-none': liquidityNodes?.data && liquidityNodes?.data?.length>0}"></tr>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: flgSticky;"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</div>
<mat-paginator [pageSize]="pageSize" [pageSizeOptions]="pageSizeOptions" [showFirstLastButtons]="screenSize === screenSizeEnum.XS ? false : true" class="mb-1"></mat-paginator>
</div>
</mat-card-content>
</mat-card>
</div>

View File

@ -0,0 +1,10 @@
.mat-column-alias {
flex: 1 1 20%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.mat-column-actions {
min-height: 4.8rem;
}

View File

@ -0,0 +1,39 @@
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { SharedModule } from '../../shared/shared.module';
import { DataService } from '../../shared/services/data.service';
import { CommonService } from '../../shared/services/common.service';
import { mockDataService } from '../../shared/test-helpers/mock-services';
import { CLNLiquidityAdsComponent } from './liquidity-ads.component';
describe('CLNLiquidityAdsComponent', () => {
let component: CLNLiquidityAdsComponent;
let fixture: ComponentFixture<CLNLiquidityAdsComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [CLNLiquidityAdsComponent],
imports: [
BrowserAnimationsModule,
SharedModule
],
providers: [
CommonService,
{ provide: DataService, useClass: mockDataService }
]
}).
compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CLNLiquidityAdsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@ -0,0 +1,128 @@
import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { MatTableDataSource } from '@angular/material/table';
import { MatSort } from '@angular/material/sort';
import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator';
import { faWater, faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import { DataService } from '../../shared/services/data.service';
import { LoggerService } from '../../shared/services/logger.service';
import { CommonService } from '../../shared/services/common.service';
import { APICallStatusEnum, getPaginatorLabel, PAGE_SIZE, PAGE_SIZE_OPTIONS, ScreenSizeEnum } from '../../shared/services/consts-enums-functions';
import { LookupNode } from '../../shared/models/clnModels';
import { ApiCallStatusPayload } from '../../shared/models/apiCallsPayload';
@Component({
selector: 'rtl-cln-liquidity-ads',
templateUrl: './liquidity-ads.component.html',
styleUrls: ['./liquidity-ads.component.scss'],
providers: [
{ provide: MatPaginatorIntl, useValue: getPaginatorLabel('Liquidity Ads') }
]
})
export class CLNLiquidityAdsComponent implements OnInit, OnDestroy {
@ViewChild(MatSort, { static: false }) sort: MatSort | undefined;
@ViewChild(MatPaginator, { static: false }) paginator: MatPaginator | undefined;
public displayedColumns: any[] = [];
public faWater = faWater;
public faExclamationTriangle = faExclamationTriangle;
public channelAmount = 0;
public channelOpeningFeeRate = 0;
public nodeCapacity = 0;
public channelCount = 0;
public liquidityNodesData: LookupNode[] = [];
public liquidityNodes: any;
public flgSticky = false;
public pageSize = PAGE_SIZE;
public pageSizeOptions = PAGE_SIZE_OPTIONS;
public screenSize = '';
public screenSizeEnum = ScreenSizeEnum;
public errorMessage = '';
public apiCallStatus: ApiCallStatusPayload = { status: APICallStatusEnum.INITIATED };
public apiCallStatusEnum = APICallStatusEnum;
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private dataService: DataService, private commonService: CommonService) {
this.screenSize = this.commonService.getScreenSize();
if (this.screenSize === ScreenSizeEnum.XS) {
this.flgSticky = false;
this.displayedColumns = ['alias', 'capacity', 'actions'];
} else if (this.screenSize === ScreenSizeEnum.SM) {
this.flgSticky = false;
this.displayedColumns = ['alias', 'capacity', 'numChannels', 'leaseFeeBasis', 'routingFee', 'channelOpenFee', 'actions'];
} else if (this.screenSize === ScreenSizeEnum.MD) {
this.flgSticky = false;
this.displayedColumns = ['alias', 'capacity', 'numChannels', 'leaseFeeBasis', 'routingFee', 'channelOpenFee', 'actions'];
} else {
this.flgSticky = true;
this.displayedColumns = ['alias', 'capacity', 'numChannels', 'leaseFeeBasis', 'routingFee', 'channelOpenFee', 'actions'];
}
}
ngOnInit(): void {
this.dataService.listNetworkNodes('?liquidity_ads=yes').pipe(takeUntil(this.unSubs[0])).subscribe({
next: (res: any) => {
this.logger.info('Received Liquidity Ads Enabled Nodes: ' + JSON.stringify(res));
this.apiCallStatus.status = APICallStatusEnum.COMPLETED;
this.liquidityNodesData = res;
this.loadLiqNodesTable(this.liquidityNodesData);
}, error: (err) => {
this.logger.error('Liquidity Ads Nodes Error: ' + JSON.stringify(err));
this.apiCallStatus.status = APICallStatusEnum.ERROR;
this.errorMessage = JSON.stringify(err);
}
});
}
onRecalculate() {
}
onFilter() {
this.logger.info(this.nodeCapacity);
this.logger.info(this.channelCount);
// this.liquidityNodes.filter = this.nodeCapacity + ' ' + this.channelCount;
}
loadLiqNodesTable(liqNodes: LookupNode[]) {
this.liquidityNodes = new MatTableDataSource<LookupNode>([...liqNodes]);
this.liquidityNodes.sortingDataAccessor = (data: any, sortHeaderId: string) => ((data[sortHeaderId] && isNaN(data[sortHeaderId])) ? data[sortHeaderId].toLocaleLowerCase() : data[sortHeaderId] ? +data[sortHeaderId] : null);
this.liquidityNodes.sort = this.sort;
this.liquidityNodes.filterPredicate = (node: LookupNode, fltr: string) => JSON.stringify(node).toLowerCase().includes(fltr);
this.liquidityNodes.paginator = this.paginator;
this.onFilter();
}
onOpenChannel(lqNode: LookupNode) {
}
onNodeClick(lqNode: LookupNode) {
}
onDownloadCSV() {
if (this.liquidityNodes.data && this.liquidityNodes.data.length > 0) {
this.commonService.downloadFile(this.liquidityNodes.data, 'LiquidityNodes');
}
}
onReset() {
this.channelAmount = 0;
this.channelOpeningFeeRate = 0;
}
onFilterReset() {
this.nodeCapacity = 0;
this.channelCount = 0;
}
ngOnDestroy() {
this.unSubs.forEach((completeSub) => {
completeSub.next(null);
completeSub.complete();
});
}
}

View File

@ -1,6 +1,6 @@
import { Component, AfterContentChecked, Input } from '@angular/core';
import { FeeRates, FeeRatePerObj, feeRateStyle } from '../../../shared/models/clModels';
import { FeeRates, FeeRatePerObj, feeRateStyle } from '../../../shared/models/clnModels';
@Component({
selector: 'rtl-cln-fee-rates',

View File

@ -5,7 +5,7 @@ import { Store } from '@ngrx/store';
import { faBolt, faServer, faNetworkWired, faLink } from '@fortawesome/free-solid-svg-icons';
import { SelNodeChild } from '../../shared/models/RTLconfig';
import { GetInfo, Fees, ChannelsStatus, FeeRates, ForwardingEvent, LocalRemoteBalance, Channel } from '../../shared/models/clModels';
import { GetInfo, Fees, ChannelsStatus, FeeRates, ForwardingEvent, LocalRemoteBalance, Channel } from '../../shared/models/clnModels';
import { APICallStatusEnum, ScreenSizeEnum, UserPersonaEnum } from '../../shared/services/consts-enums-functions';
import { ApiCallStatusPayload } from '../../shared/models/apiCallsPayload';
import { LoggerService } from '../../shared/services/logger.service';

View File

@ -1,6 +1,6 @@
import { Component, Input } from '@angular/core';
import { FeeRates } from '../../../shared/models/clModels';
import { FeeRates } from '../../../shared/models/clnModels';
@Component({
selector: 'rtl-cln-onchain-fee-estimates',

View File

@ -13,7 +13,7 @@ import * as sha256 from 'sha256';
import { SelNodeChild, RTLConfiguration } from '../../../shared/models/RTLconfig';
import { CLNOnChainSendFunds } from '../../../shared/models/alertData';
import { GetInfo, Balance, OnChain, UTXO } from '../../../shared/models/clModels';
import { GetInfo, Balance, OnChain, UTXO } from '../../../shared/models/clnModels';
import { CURRENCY_UNITS, CurrencyUnitEnum, CURRENCY_UNIT_FORMATS, ADDRESS_TYPES, FEE_RATE_TYPES, APICallStatusEnum, CLNActions, ScreenSizeEnum } from '../../../shared/services/consts-enums-functions';
import { CommonService } from '../../../shared/services/common.service';
import { LoggerService } from '../../../shared/services/logger.service';

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd, ActivatedRoute } from '@angular/router';
import { Router, ResolveEnd, ActivatedRoute, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -10,7 +10,7 @@ import { SelNodeChild } from '../../shared/models/RTLconfig';
import { RTLState } from '../../store/rtl.state';
import { openAlert } from '../../store/rtl.actions';
import { balance, clnNodeSettings } from '../store/cln.selector';
import { Balance } from '../../shared/models/clModels';
import { Balance } from '../../shared/models/clnModels';
import { ApiCallStatusPayload } from '../../shared/models/apiCallsPayload';
@Component({
@ -37,10 +37,12 @@ export class CLNOnChainComponent implements OnInit, OnDestroy {
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.selectedTable = this.tables.find((table) => table.name === this.router.url.substring(this.router.url.lastIndexOf('/') + 1));
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.selectedTable = this.tables.find((table) => table.name === value.urlAfterRedirects.substring(value.urlAfterRedirects.lastIndexOf('/') + 1));
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.selectedTable = this.tables.find((table) => table.name === (<ResolveEnd>value).urlAfterRedirects.substring((<ResolveEnd>value).urlAfterRedirects.lastIndexOf('/') + 1));
}
});
this.store.select(clnNodeSettings).pipe(takeUntil(this.unSubs[1])).
subscribe((nodeSettings: SelNodeChild) => {

View File

@ -3,7 +3,7 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { UTXO } from '../../../shared/models/clModels';
import { UTXO } from '../../../shared/models/clnModels';
import { LoggerService } from '../../../shared/services/logger.service';
import { RTLState } from '../../../store/rtl.state';

View File

@ -6,7 +6,7 @@ import { Store } from '@ngrx/store';
import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { UTXO } from '../../../../shared/models/clModels';
import { UTXO } from '../../../../shared/models/clnModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, AlertTypeEnum, DataTypeEnum, ScreenSizeEnum, APICallStatusEnum } from '../../../../shared/services/consts-enums-functions';
import { ApiCallStatusPayload } from '../../../../shared/models/apiCallsPayload';
import { LoggerService } from '../../../../shared/services/logger.service';

View File

@ -8,7 +8,7 @@ import { faCopy, faInfoCircle, faExclamationTriangle } from '@fortawesome/free-s
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar } from '@angular/material/snack-bar';
import { Channel } from '../../../../shared/models/clModels';
import { Channel } from '../../../../shared/models/clnModels';
import { CLNChannelInformation } from '../../../../shared/models/alertData';
import { ADDRESS_TYPES, APICallStatusEnum, CLNActions } from '../../../../shared/services/consts-enums-functions';
import { LoggerService } from '../../../../shared/services/logger.service';

View File

@ -6,7 +6,7 @@ import { MatSnackBar } from '@angular/material/snack-bar';
import { LoggerService } from '../../../../shared/services/logger.service';
import { CommonService } from '../../../../shared/services/common.service';
import { CLNChannelInformation } from '../../../../shared/models/alertData';
import { Channel } from '../../../../shared/models/clModels';
import { Channel } from '../../../../shared/models/clnModels';
import { ScreenSizeEnum } from '../../../../shared/services/consts-enums-functions';
@Component({

View File

@ -8,7 +8,7 @@ import { faEye, faEyeSlash } from '@fortawesome/free-solid-svg-icons';
import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { Channel, GetInfo, ChannelEdge, Balance } from '../../../../../shared/models/clModels';
import { Channel, GetInfo, ChannelEdge, Balance } from '../../../../../shared/models/clnModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, AlertTypeEnum, DataTypeEnum, ScreenSizeEnum, FEE_RATE_TYPES, APICallStatusEnum, UI_MESSAGES } from '../../../../../shared/services/consts-enums-functions';
import { ApiCallStatusPayload } from '../../../../../shared/models/apiCallsPayload';
import { LoggerService } from '../../../../../shared/services/logger.service';

View File

@ -6,7 +6,7 @@ import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { GetInfo, Channel, Balance } from '../../../../../shared/models/clModels';
import { GetInfo, Channel, Balance } from '../../../../../shared/models/clnModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, ScreenSizeEnum, FEE_RATE_TYPES, AlertTypeEnum, APICallStatusEnum, CLNChannelPendingState } from '../../../../../shared/services/consts-enums-functions';
import { ApiCallStatusPayload } from '../../../../../shared/models/apiCallsPayload';
import { LoggerService } from '../../../../../shared/services/logger.service';

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -7,7 +7,7 @@ import { Store } from '@ngrx/store';
import { CLNOpenChannelComponent } from '../open-channel-modal/open-channel.component';
import { CommonService } from '../../../../shared/services/common.service';
import { LoggerService } from '../../../../shared/services/logger.service';
import { Balance, Channel, GetInfo, Peer, UTXO } from '../../../../shared/models/clModels';
import { Balance, Channel, GetInfo, Peer, UTXO } from '../../../../shared/models/clnModels';
import { SelNodeChild } from '../../../../shared/models/RTLconfig';
import { RTLState } from '../../../../store/rtl.state';
@ -38,8 +38,10 @@ export class CLNChannelsTablesComponent implements OnInit, OnDestroy {
ngOnInit() {
this.activeLink = this.links.findIndex((link) => link.link === this.router.url.substring(this.router.url.lastIndexOf('/') + 1));
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
this.activeLink = this.links.findIndex((link) => link.link === value.urlAfterRedirects.substring(value.urlAfterRedirects.lastIndexOf('/') + 1));
subscribe({
next: (value: ResolveEnd | Event) => {
this.activeLink = this.links.findIndex((link) => link.link === (<ResolveEnd>value).urlAfterRedirects.substring((<ResolveEnd>value).urlAfterRedirects.lastIndexOf('/') + 1));
}
});
this.store.select(nodeInfoAndNodeSettingsAndBalance).pipe(takeUntil(this.unSubs[1])).
subscribe((infoSettingsBalSelector: { information: GetInfo, nodeSettings: SelNodeChild, balance: Balance }) => {

View File

@ -9,7 +9,7 @@ import { Actions } from '@ngrx/effects';
import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import { CommonService } from '../../../../shared/services/common.service';
import { Peer, GetInfo, UTXO } from '../../../../shared/models/clModels';
import { Peer, GetInfo, UTXO } from '../../../../shared/models/clnModels';
import { CLNOpenChannelAlert } from '../../../../shared/models/alertData';
import { APICallStatusEnum, CLNActions, FEE_RATE_TYPES, ScreenSizeEnum } from '../../../../shared/services/consts-enums-functions';

View File

@ -10,7 +10,7 @@ import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import { CommonService } from '../../../shared/services/common.service';
import { LoggerService } from '../../../shared/services/logger.service';
import { Peer } from '../../../shared/models/clModels';
import { Peer } from '../../../shared/models/clnModels';
import { CLNOpenChannelAlert } from '../../../shared/models/alertData';
import { APICallStatusEnum, CLNActions, FEE_RATE_TYPES, ScreenSizeEnum } from '../../../shared/services/consts-enums-functions';

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -10,7 +10,7 @@ import { LoggerService } from '../../shared/services/logger.service';
import { RTLState } from '../../store/rtl.state';
import { ApiCallStatusPayload } from '../../shared/models/apiCallsPayload';
import { balance, channels, peers } from '../store/cln.selector';
import { Balance, Channel, Peer } from '../../shared/models/clModels';
import { Balance, Channel, Peer } from '../../shared/models/clnModels';
@Component({
selector: 'rtl-cln-connections',
@ -33,8 +33,10 @@ export class CLNConnectionsComponent implements OnInit, OnDestroy {
ngOnInit() {
this.activeLink = this.links.findIndex((link) => link.link === this.router.url.substring(this.router.url.lastIndexOf('/') + 1));
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
this.activeLink = this.links.findIndex((link) => link.link === value.urlAfterRedirects.substring(value.urlAfterRedirects.lastIndexOf('/') + 1));
subscribe({
next: (value: ResolveEnd | Event) => {
this.activeLink = this.links.findIndex((link) => link.link === (<ResolveEnd>value).urlAfterRedirects.substring((<ResolveEnd>value).urlAfterRedirects.lastIndexOf('/') + 1));
}
});
this.store.select(channels).pipe(takeUntil(this.unSubs[1])).
subscribe((channelsSeletor: { activeChannels: Channel[], pendingChannels: Channel[], inactiveChannels: Channel[], apiCallStatus: ApiCallStatusPayload }) => {

View File

@ -9,7 +9,7 @@ import { faUsers } from '@fortawesome/free-solid-svg-icons';
import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { Peer, GetInfo, Balance } from '../../../shared/models/clModels';
import { Peer, GetInfo, Balance } from '../../../shared/models/clnModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, AlertTypeEnum, ScreenSizeEnum, APICallStatusEnum, CLNActions } from '../../../shared/services/consts-enums-functions';
import { ApiCallStatusPayload } from '../../../shared/models/apiCallsPayload';
import { LoggerService } from '../../../shared/services/logger.service';

View File

@ -22,9 +22,11 @@ export class CLNReportsComponent implements OnInit, OnDestroy {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
}

View File

@ -3,7 +3,7 @@ import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { ForwardingEvent } from '../../../shared/models/clModels';
import { ForwardingEvent } from '../../../shared/models/clnModels';
import { APICallStatusEnum, MONTHS, ReportBy, ScreenSizeEnum, SCROLL_RANGES } from '../../../shared/services/consts-enums-functions';
import { ApiCallStatusPayload } from '../../../shared/models/apiCallsPayload';
import { LoggerService } from '../../../shared/services/logger.service';

View File

@ -3,7 +3,7 @@ import { Subject } from 'rxjs';
import { takeUntil, withLatestFrom } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { Payment, Invoice, ListInvoices } from '../../../shared/models/clModels';
import { Payment, Invoice, ListInvoices } from '../../../shared/models/clnModels';
import { CommonService } from '../../../shared/services/common.service';
import { MONTHS, ScreenSizeEnum, SCROLL_RANGES } from '../../../shared/services/consts-enums-functions';
import { fadeIn } from '../../../shared/animation/opacity-animation';

View File

@ -8,7 +8,7 @@ import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { ForwardingEvent } from '../../../shared/models/clModels';
import { ForwardingEvent } from '../../../shared/models/clnModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, AlertTypeEnum, DataTypeEnum, ScreenSizeEnum, APICallStatusEnum } from '../../../shared/services/consts-enums-functions';
import { ApiCallStatusPayload } from '../../../shared/models/apiCallsPayload';
import { LoggerService } from '../../../shared/services/logger.service';

View File

@ -7,7 +7,7 @@ import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { ForwardingEvent } from '../../../shared/models/clModels';
import { ForwardingEvent } from '../../../shared/models/clnModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, AlertTypeEnum, DataTypeEnum, ScreenSizeEnum, APICallStatusEnum } from '../../../shared/services/consts-enums-functions';
import { ApiCallStatusPayload } from '../../../shared/models/apiCallsPayload';
import { LoggerService } from '../../../shared/services/logger.service';

View File

@ -8,7 +8,7 @@ import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { LocalFailedEvent } from '../../../shared/models/clModels';
import { LocalFailedEvent } from '../../../shared/models/clnModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, AlertTypeEnum, DataTypeEnum, ScreenSizeEnum, APICallStatusEnum, CLNFailReason } from '../../../shared/services/consts-enums-functions';
import { ApiCallStatusPayload } from '../../../shared/models/apiCallsPayload';
import { LoggerService } from '../../../shared/services/logger.service';

View File

@ -7,7 +7,7 @@ import { MatSort } from '@angular/material/sort';
import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator';
import { MatTableDataSource } from '@angular/material/table';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, ScreenSizeEnum, APICallStatusEnum } from '../../../shared/services/consts-enums-functions';
import { ForwardingEvent, RoutingPeer } from '../../../shared/models/clModels';
import { ForwardingEvent, RoutingPeer } from '../../../shared/models/clnModels';
import { ApiCallStatusPayload } from '../../../shared/models/apiCallsPayload';
import { LoggerService } from '../../../shared/services/logger.service';
import { CommonService } from '../../../shared/services/common.service';

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { faMapSigns } from '@fortawesome/free-solid-svg-icons';
@ -22,9 +22,11 @@ export class CLNRoutingComponent implements OnInit, OnDestroy {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: ResolveEnd) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { faUserCheck } from '@fortawesome/free-solid-svg-icons';
@ -22,9 +22,11 @@ export class CLNSignVerifyMessageComponent implements OnInit, OnDestroy {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: ResolveEnd) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
}

View File

@ -3,7 +3,7 @@ import { createAction, props } from '@ngrx/store';
import { CLNActions } from '../../shared/services/consts-enums-functions';
import { ApiCallStatusPayload } from '../../shared/models/apiCallsPayload';
import { SelNodeChild } from '../../shared/models/RTLconfig';
import { GetInfo, Fees, Peer, Payment, QueryRoutes, Channel, FeeRates, ForwardingEvent, Invoice, ListInvoices, OnChain, UTXO, SaveChannel, GetNewAddress, DetachPeer, UpdateChannel, CloseChannel, SendPayment, GetQueryRoutes, ChannelLookup, OfferInvoice, Offer, OfferBookmark, LocalFailedEvent } from '../../shared/models/clModels';
import { GetInfo, Fees, Peer, Payment, QueryRoutes, Channel, FeeRates, ForwardingEvent, Invoice, ListInvoices, OnChain, UTXO, SaveChannel, GetNewAddress, DetachPeer, UpdateChannel, CloseChannel, SendPayment, GetQueryRoutes, ChannelLookup, OfferInvoice, Offer, OfferBookmark, LocalFailedEvent } from '../../shared/models/clnModels';
export const updateCLAPICallStatus = createAction(CLNActions.UPDATE_API_CALL_STATUS_CLN, props<{ payload: ApiCallStatusPayload }>());

View File

@ -14,7 +14,7 @@ import { SessionService } from '../../shared/services/session.service';
import { WebSocketClientService } from '../../shared/services/web-socket.service';
import { ErrorMessageComponent } from '../../shared/components/data-modal/error-message/error-message.component';
import { CLNInvoiceInformationComponent } from '../transactions/invoices/invoice-information-modal/invoice-information.component';
import { GetInfo, Fees, Balance, LocalRemoteBalance, Payment, FeeRates, ListInvoices, Invoice, Peer, ForwardingEvent, OnChain, QueryRoutes, PayRequest, SaveChannel, GetNewAddress, DetachPeer, UpdateChannel, CloseChannel, DecodePayment, SendPayment, GetQueryRoutes, ChannelLookup, FetchInvoices, Channel, OfferInvoice, Offer } from '../../shared/models/clModels';
import { GetInfo, Fees, Balance, LocalRemoteBalance, Payment, FeeRates, ListInvoices, Invoice, Peer, ForwardingEvent, OnChain, QueryRoutes, PayRequest, SaveChannel, GetNewAddress, DetachPeer, UpdateChannel, CloseChannel, DecodePayment, SendPayment, GetQueryRoutes, ChannelLookup, FetchInvoices, Channel, OfferInvoice, Offer } from '../../shared/models/clnModels';
import { AlertTypeEnum, APICallStatusEnum, UI_MESSAGES, CLNWSEventTypeEnum, CLNActions, RTLActions } from '../../shared/services/consts-enums-functions';
import { closeAllDialogs, closeSpinner, logout, openAlert, openSnackBar, openSpinner, setApiUrl, setNodeData } from '../../store/rtl.actions';

View File

@ -6,7 +6,7 @@ import {
setInfo, setInvoices, setLocalRemoteBalance, setOffers, addOffer, setPayments, setPeers, setUTXOs,
updateCLAPICallStatus, updateInvoice, updateOffer, setOfferBookmarks, addUpdateOfferBookmark, removeOfferBookmark
} from './cln.actions';
import { Channel, OfferBookmark } from '../../shared/models/clModels';
import { Channel, OfferBookmark } from '../../shared/models/clnModels';
export const CLNReducer = createReducer(initCLNState,
on(updateCLAPICallStatus, (state, { payload }) => {

View File

@ -1,5 +1,5 @@
import { createFeatureSelector, createSelector } from '@ngrx/store';
import { Offer } from '../../shared/models/clModels';
import { Offer } from '../../shared/models/clnModels';
import { CLNState } from './cln.state';
export const clnState = createFeatureSelector<CLNState>('cln');

View File

@ -1,6 +1,6 @@
import { SelNodeChild } from '../../shared/models/RTLconfig';
import { APICallStatusEnum, UserPersonaEnum } from '../../shared/services/consts-enums-functions';
import { GetInfo, Fees, Balance, LocalRemoteBalance, Peer, Payment, Channel, FeeRates, ForwardingEvent, ListInvoices, UTXO, Offer, OfferBookmark, LocalFailedEvent } from '../../shared/models/clModels';
import { GetInfo, Fees, Balance, LocalRemoteBalance, Peer, Payment, Channel, FeeRates, ForwardingEvent, ListInvoices, UTXO, Offer, OfferBookmark, LocalFailedEvent } from '../../shared/models/clnModels';
import { ApiCallsListCL } from '../../shared/models/apiCallsPayload';
export interface CLNState {

View File

@ -10,7 +10,7 @@ import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import { CLNInvoiceInformation } from '../../../../shared/models/alertData';
import { TimeUnitEnum, CurrencyUnitEnum, TIME_UNITS, CURRENCY_UNIT_FORMATS, PAGE_SIZE, APICallStatusEnum, CLNActions } from '../../../../shared/services/consts-enums-functions';
import { SelNodeChild } from '../../../../shared/models/RTLconfig';
import { GetInfo } from '../../../../shared/models/clModels';
import { GetInfo } from '../../../../shared/models/clnModels';
import { CommonService } from '../../../../shared/services/common.service';
import { RTLState } from '../../../../store/rtl.state';

View File

@ -16,7 +16,7 @@ import { DataService } from '../../../../shared/services/data.service';
import { RTLState } from '../../../../store/rtl.state';
import { listInvoices } from '../../../store/cln.selector';
import { ApiCallStatusPayload } from '../../../../shared/models/apiCallsPayload';
import { ListInvoices } from '../../../../shared/models/clModels';
import { ListInvoices } from '../../../../shared/models/clnModels';
describe('CLNInvoiceInformationComponent', () => {
let component: CLNInvoiceInformationComponent;

View File

@ -11,7 +11,7 @@ import { CommonService } from '../../../../shared/services/common.service';
import { CLNInvoiceInformation } from '../../../../shared/models/alertData';
import { ScreenSizeEnum } from '../../../../shared/services/consts-enums-functions';
import { GetInfo, Invoice, ListInvoices } from '../../../../shared/models/clModels';
import { GetInfo, Invoice, ListInvoices } from '../../../../shared/models/clnModels';
import { RTLState } from '../../../../store/rtl.state';
import { clnNodeInformation, listInvoices } from '../../../store/cln.selector';
import { ApiCallStatusPayload } from '../../../../shared/models/apiCallsPayload';

View File

@ -12,7 +12,7 @@ import { MatTableDataSource } from '@angular/material/table';
import { CurrencyUnitEnum, CURRENCY_UNIT_FORMATS, PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, ScreenSizeEnum, APICallStatusEnum, UI_MESSAGES, CLNActions } from '../../../../shared/services/consts-enums-functions';
import { ApiCallStatusPayload } from '../../../../shared/models/apiCallsPayload';
import { SelNodeChild } from '../../../../shared/models/RTLconfig';
import { GetInfo, Invoice, ListInvoices } from '../../../../shared/models/clModels';
import { GetInfo, Invoice, ListInvoices } from '../../../../shared/models/clnModels';
import { LoggerService } from '../../../../shared/services/logger.service';
import { CommonService } from '../../../../shared/services/common.service';

View File

@ -10,7 +10,7 @@ import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import { CLNOfferInformation } from '../../../../shared/models/alertData';
import { CurrencyUnitEnum, CURRENCY_UNIT_FORMATS, PAGE_SIZE, APICallStatusEnum, CLNActions } from '../../../../shared/services/consts-enums-functions';
import { SelNodeChild } from '../../../../shared/models/RTLconfig';
import { GetInfo } from '../../../../shared/models/clModels';
import { GetInfo } from '../../../../shared/models/clnModels';
import { CommonService } from '../../../../shared/services/common.service';
import { RTLState } from '../../../../store/rtl.state';

View File

@ -9,7 +9,7 @@ import { MatTableDataSource } from '@angular/material/table';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, ScreenSizeEnum, APICallStatusEnum, PaymentTypes, AlertTypeEnum } from '../../../../shared/services/consts-enums-functions';
import { ApiCallStatusPayload } from '../../../../shared/models/apiCallsPayload';
import { OfferBookmark } from '../../../../shared/models/clModels';
import { OfferBookmark } from '../../../../shared/models/clnModels';
import { LoggerService } from '../../../../shared/services/logger.service';
import { CommonService } from '../../../../shared/services/common.service';

View File

@ -12,7 +12,7 @@ import { CommonService } from '../../../../shared/services/common.service';
import { CLNOfferInformation } from '../../../../shared/models/alertData';
import { ScreenSizeEnum } from '../../../../shared/services/consts-enums-functions';
import { GetInfo, Offer, OfferRequest } from '../../../../shared/models/clModels';
import { GetInfo, Offer, OfferRequest } from '../../../../shared/models/clnModels';
import { RTLState } from '../../../../store/rtl.state';
import { clnNodeInformation } from '../../../store/cln.selector';

View File

@ -14,7 +14,7 @@ import * as pdfFonts from 'pdfmake/build/vfs_fonts';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, ScreenSizeEnum, APICallStatusEnum, AlertTypeEnum } from '../../../../shared/services/consts-enums-functions';
import { ApiCallStatusPayload } from '../../../../shared/models/apiCallsPayload';
import { SelNodeChild } from '../../../../shared/models/RTLconfig';
import { GetInfo, Offer, OfferRequest } from '../../../../shared/models/clModels';
import { GetInfo, Offer, OfferRequest } from '../../../../shared/models/clnModels';
import { DataService } from '../../../../shared/services/data.service';
import { LoggerService } from '../../../../shared/services/logger.service';
import { CommonService } from '../../../../shared/services/common.service';

View File

@ -8,7 +8,7 @@ import { faHistory } from '@fortawesome/free-solid-svg-icons';
import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { GetInfo, Payment, PayRequest } from '../../../shared/models/clModels';
import { GetInfo, Payment, PayRequest } from '../../../shared/models/clnModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, AlertTypeEnum, DataTypeEnum, ScreenSizeEnum, CurrencyUnitEnum, CURRENCY_UNIT_FORMATS, APICallStatusEnum, UI_MESSAGES, PaymentTypes } from '../../../shared/services/consts-enums-functions';
import { ApiCallStatusPayload } from '../../../shared/models/apiCallsPayload';
import { DataService } from '../../../shared/services/data.service';

View File

@ -9,7 +9,7 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
import { SelNodeChild } from '../../../shared/models/RTLconfig';
import { PayRequest, Channel, GetInfo, OfferRequest, OfferInvoice } from '../../../shared/models/clModels';
import { PayRequest, Channel, GetInfo, OfferRequest, OfferInvoice } from '../../../shared/models/clnModels';
import { APICallStatusEnum, CLNActions, PaymentTypes, CurrencyUnitEnum, CURRENCY_UNIT_FORMATS, FEE_LIMIT_TYPES, UI_MESSAGES } from '../../../shared/services/consts-enums-functions';
import { DataService } from '../../../shared/services/data.service';
import { CommonService } from '../../../shared/services/common.service';

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter, withLatestFrom } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -10,7 +10,7 @@ import { LoggerService } from '../../shared/services/logger.service';
import { RTLState } from '../../store/rtl.state';
import { clnNodeSettings, localRemoteBalance } from '../store/cln.selector';
import { LocalRemoteBalance } from '../../shared/models/clModels';
import { LocalRemoteBalance } from '../../shared/models/clnModels';
import { ApiCallStatusPayload } from '../../shared/models/apiCallsPayload';
import { SelNodeChild } from '../../shared/models/RTLconfig';
import { fetchOffers, fetchOfferBookmarks } from '../store/cln.actions';
@ -38,10 +38,13 @@ export class CLNTransactionsComponent implements OnInit, OnDestroy {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.routerUrl = value.urlAfterRedirects;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.routerUrl = (<ResolveEnd>value).urlAfterRedirects;
}
});
this.store.select(clnNodeSettings).pipe(takeUntil(this.unSubs[1])).subscribe((nodeSettings: SelNodeChild) => {
this.selNode = nodeSettings;

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { faSearch } from '@fortawesome/free-solid-svg-icons';
@ -22,9 +22,11 @@ export class ECLGraphComponent implements OnInit, OnDestroy {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -34,9 +34,11 @@ export class ECLOnChainComponent implements OnInit, OnDestroy {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
this.store.select(eclnNodeSettings).pipe(takeUntil(this.unSubs[1])).
subscribe((nodeSettings) => {

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -37,8 +37,10 @@ export class ECLChannelsTablesComponent implements OnInit, OnDestroy {
ngOnInit() {
this.activeLink = this.links.findIndex((link) => link.link === this.router.url.substring(this.router.url.lastIndexOf('/') + 1));
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
this.activeLink = this.links.findIndex((link) => link.link === value.urlAfterRedirects.substring(value.urlAfterRedirects.lastIndexOf('/') + 1));
subscribe({
next: (value: ResolveEnd | Event) => {
this.activeLink = this.links.findIndex((link) => link.link === (<ResolveEnd>value).urlAfterRedirects.substring((<ResolveEnd>value).urlAfterRedirects.lastIndexOf('/') + 1));
}
});
this.store.select(allChannelsInfo).pipe(takeUntil(this.unSubs[1])).
subscribe((allChannelsSelector: ({ activeChannels: Channel[], pendingChannels: Channel[], inactiveChannels: Channel[], lightningBalance: LightningBalance, channelsStatus: ChannelsStatus, apiCallStatus: ApiCallStatusPayload })) => {

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -31,8 +31,10 @@ export class ECLConnectionsComponent implements OnInit, OnDestroy {
ngOnInit() {
this.activeLink = this.links.findIndex((link) => link.link === this.router.url.substring(this.router.url.lastIndexOf('/') + 1));
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
this.activeLink = this.links.findIndex((link) => link.link === value.urlAfterRedirects.substring(value.urlAfterRedirects.lastIndexOf('/') + 1));
subscribe({
next: (value: ResolveEnd | Event) => {
this.activeLink = this.links.findIndex((link) => link.link === (<ResolveEnd>value).urlAfterRedirects.substring((<ResolveEnd>value).urlAfterRedirects.lastIndexOf('/') + 1));
}
});
this.store.select(peers).pipe(takeUntil(this.unSubs[1])).
subscribe((peersSelector: { peers: Peer[], apiCallStatus: ApiCallStatusPayload }) => {

View File

@ -22,9 +22,11 @@ export class ECLReportsComponent implements OnInit, OnDestroy {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { faMapSigns } from '@fortawesome/free-solid-svg-icons';
@ -20,15 +20,17 @@ export class ECLRoutingComponent implements OnInit, OnDestroy {
public activeLink = this.links[0].link;
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject()];
constructor(private router: Router) {}
constructor(private router: Router) { }
ngOnInit() {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: ResolveEnd) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter, withLatestFrom } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -34,9 +34,11 @@ export class ECLTransactionsComponent implements OnInit, OnDestroy {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
this.store.select(allChannelsInfo).pipe(takeUntil(this.unSubs[1]),
withLatestFrom(this.store.select(eclnNodeSettings))).

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { faDownload } from '@fortawesome/free-solid-svg-icons';
@ -16,15 +16,17 @@ export class BackupComponent implements OnInit, OnDestroy {
public activeLink = this.links[0].link;
private unSubs: Array<Subject<void>> = [new Subject(), new Subject()];
constructor(private router: Router) {}
constructor(private router: Router) { }
ngOnInit() {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: ResolveEnd) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { faSearch } from '@fortawesome/free-solid-svg-icons';
@ -22,9 +22,11 @@ export class GraphComponent implements OnInit, OnDestroy {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd, ActivatedRoute, NavigationExtras } from '@angular/router';
import { Router, ResolveEnd, ActivatedRoute, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -35,10 +35,12 @@ export class OnChainComponent implements OnInit, OnDestroy {
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.selectedTable = this.tables.find((table) => table.name === this.router.url.substring(this.router.url.lastIndexOf('/') + 1));
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.selectedTable = this.tables.find((table) => table.name === value.urlAfterRedirects.substring(value.urlAfterRedirects.lastIndexOf('/') + 1));
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.selectedTable = this.tables.find((table) => table.name === (<ResolveEnd>value).urlAfterRedirects.substring((<ResolveEnd>value).urlAfterRedirects.lastIndexOf('/') + 1));
}
});
this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[1])).
subscribe((nodeSettings: SelNodeChild) => {

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -36,8 +36,10 @@ export class ChannelsTablesComponent implements OnInit, OnDestroy {
ngOnInit() {
this.activeLink = this.links.findIndex((link) => link.link === this.router.url.substring(this.router.url.lastIndexOf('/') + 1));
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
this.activeLink = this.links.findIndex((link) => link.link === value.urlAfterRedirects.substring(value.urlAfterRedirects.lastIndexOf('/') + 1));
subscribe({
next: (value: ResolveEnd | Event) => {
this.activeLink = this.links.findIndex((link) => link.link === (<ResolveEnd>value).urlAfterRedirects.substring((<ResolveEnd>value).urlAfterRedirects.lastIndexOf('/') + 1));
}
});
this.store.select(lndNodeInformation).pipe(takeUntil(this.unSubs[1])).subscribe((nodeInfo: GetInfo) => { this.information = nodeInfo; });
this.store.select(channels).pipe(takeUntil(this.unSubs[2])).

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -35,8 +35,10 @@ export class ConnectionsComponent implements OnInit, OnDestroy {
ngOnInit() {
this.activeLink = this.links.findIndex((link) => link.link === this.router.url.substring(this.router.url.lastIndexOf('/') + 1));
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
this.activeLink = this.links.findIndex((link) => link.link === value.urlAfterRedirects.substring(value.urlAfterRedirects.lastIndexOf('/') + 1));
subscribe({
next: (value: ResolveEnd | Event) => {
this.activeLink = this.links.findIndex((link) => link.link === (<ResolveEnd>value).urlAfterRedirects.substring((<ResolveEnd>value).urlAfterRedirects.lastIndexOf('/') + 1));
}
});
this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[1])).subscribe((nodeSettings: SelNodeChild) => { this.selNode = nodeSettings; });
this.store.select(peers).pipe(takeUntil(this.unSubs[2])).

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -7,9 +7,6 @@ import { faMapSigns } from '@fortawesome/free-solid-svg-icons';
import { RTLState } from '../../store/rtl.state';
import { getForwardingHistory, setForwardingHistory } from '../store/lnd.actions';
import { channels } from '../store/lnd.selector';
import { Channel, ChannelsSummary, LightningBalance } from '../../shared/models/lndModels';
import { ApiCallStatusPayload } from '../../shared/models/apiCallsPayload';
import { LoggerService } from '../../shared/services/logger.service';
@Component({
@ -36,9 +33,11 @@ export class RoutingComponent implements OnInit, OnDestroy {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { faUserCheck } from '@fortawesome/free-solid-svg-icons';
@ -16,15 +16,17 @@ export class SignVerifyMessageComponent implements OnInit, OnDestroy {
public activeLink = this.links[0].link;
private unSubs: Array<Subject<void>> = [new Subject(), new Subject()];
constructor(private router: Router) {}
constructor(private router: Router) { }
ngOnInit() {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: ResolveEnd) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter, withLatestFrom } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -34,9 +34,11 @@ export class TransactionsComponent implements OnInit, OnDestroy {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
this.store.select(channels).pipe(takeUntil(this.unSubs[1]),
withLatestFrom(this.store.select(lndNodeSettings))).

View File

@ -15,7 +15,7 @@ import { setChildNodeSettingsECL } from '../../../../eclair/store/ecl.actions';
import { DataService } from '../../../services/data.service';
import { ServicesEnum, UI_MESSAGES, LADS_POLICY } from '../../../services/consts-enums-functions';
import { balance } from '../../../../cln/store/cln.selector';
import { Balance, FunderPolicy } from '../../../models/clModels';
import { Balance, FunderPolicy } from '../../../models/clnModels';
import { ApiCallStatusPayload } from '../../../models/apiCallsPayload';
@Component({

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -27,8 +27,10 @@ export class LNPConfigComponent implements OnInit, OnDestroy {
ngOnInit() {
this.selectedNodeType = (this.router.url.includes('bconfig')) ? 'bitcoind' : 'ln';
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
this.selectedNodeType = (value.urlAfterRedirects.includes('bconfig')) ? 'bitcoind' : 'ln';
subscribe({
next: (value: ResolveEnd | Event) => {
this.selectedNodeType = ((<ResolveEnd>value).urlAfterRedirects.includes('bconfig')) ? 'bitcoind' : 'ln';
}
});
this.store.dispatch(fetchConfig({ payload: this.selectedNodeType }));
this.rtlEffects.showLnConfig.

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -30,9 +30,11 @@ export class NodeConfigComponent implements OnInit, OnDestroy {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[1])).subscribe((selNode) => {
this.showLnConfig = false;

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { faLayerGroup } from '@fortawesome/free-solid-svg-icons';
@ -22,9 +22,11 @@ export class ServicesSettingsComponent implements OnInit, OnDestroy {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -37,10 +37,12 @@ export class BoltzRootComponent implements OnInit, OnDestroy {
this.activeTab = linkFound ? linkFound : this.links[0];
this.selectedSwapType = linkFound && linkFound.link === 'swapin' ? SwapTypeEnum.SWAP_IN : SwapTypeEnum.SWAP_OUT;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeTab = linkFound ? linkFound : this.links[0];
this.selectedSwapType = linkFound && linkFound.link === 'swapin' ? SwapTypeEnum.SWAP_IN : SwapTypeEnum.SWAP_OUT;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeTab = linkFound ? linkFound : this.links[0];
this.selectedSwapType = linkFound && linkFound.link === 'swapin' ? SwapTypeEnum.SWAP_IN : SwapTypeEnum.SWAP_OUT;
}
});
this.boltzService.swapsChanged.
pipe(takeUntil(this.unSubs[1])).

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -42,10 +42,12 @@ export class LoopComponent implements OnInit, OnDestroy {
this.activeTab = linkFound ? linkFound : this.links[0];
this.selectedSwapType = linkFound && linkFound.link === 'loopin' ? LoopTypeEnum.LOOP_IN : LoopTypeEnum.LOOP_OUT;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeTab = linkFound ? linkFound : this.links[0];
this.selectedSwapType = linkFound && linkFound.link === 'loopin' ? LoopTypeEnum.LOOP_IN : LoopTypeEnum.LOOP_OUT;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeTab = linkFound ? linkFound : this.links[0];
this.selectedSwapType = linkFound && linkFound.link === 'loopin' ? LoopTypeEnum.LOOP_IN : LoopTypeEnum.LOOP_OUT;
}
});
this.loopService.swapsChanged.
pipe(takeUntil(this.unSubs[1])).

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -31,9 +31,11 @@ export class ServicesComponent implements OnInit, OnDestroy {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[1])).
subscribe((selNode) => {

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -27,8 +27,10 @@ export class BitcoinConfigComponent implements OnInit, OnDestroy {
ngOnInit() {
this.selectedNodeType = (this.router.url.includes('bconfig')) ? 'bitcoind' : 'ln';
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
this.selectedNodeType = (value.urlAfterRedirects.includes('bconfig')) ? 'bitcoind' : 'ln';
subscribe({
next: (value: ResolveEnd | Event) => {
this.selectedNodeType = ((<ResolveEnd>value).urlAfterRedirects.includes('bconfig')) ? 'bitcoind' : 'ln';
}
});
this.store.dispatch(fetchConfig({ payload: this.selectedNodeType }));
this.rtlEffects.showLnConfig.

View File

@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router, ResolveEnd } from '@angular/router';
import { Router, ResolveEnd, Event } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { Store } from '@ngrx/store';
@ -30,9 +30,11 @@ export class SettingsComponent implements OnInit, OnDestroy {
const linkFound = this.links.find((link) => this.router.url.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
this.router.events.pipe(takeUntil(this.unSubs[0]), filter((e) => e instanceof ResolveEnd)).
subscribe((value: any) => {
const linkFound = this.links.find((link) => value.urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
subscribe({
next: (value: ResolveEnd | Event) => {
const linkFound = this.links.find((link) => (<ResolveEnd>value).urlAfterRedirects.includes(link.link));
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
this.store.select(rootAppConfig).pipe(takeUntil(this.unSubs[1])).subscribe((appConfig) => {
this.appConfig = appConfig;

View File

@ -1,7 +1,7 @@
import { DataTypeEnum, LoopTypeEnum, PaymentTypes, SwapTypeEnum } from '../services/consts-enums-functions';
import { GetInfoRoot, RTLConfiguration } from './RTLconfig';
import { GetInfo, Invoice, Channel, Peer, PendingOpenChannel, UTXO } from './lndModels';
import { Invoice as InvoiceCLN, GetInfo as GetInfoCLN, Peer as PeerCLN, Channel as ChannelCLN, UTXO as UTXOCLN, Offer as OfferCLN } from './clModels';
import { Invoice as InvoiceCLN, GetInfo as GetInfoCLN, Peer as PeerCLN, Channel as ChannelCLN, UTXO as UTXOCLN, Offer as OfferCLN } from './clnModels';
import { GetInfo as GetInfoECL, Peer as PeerECL, Channel as ChannelECL, Invoice as InvoiceECL, PaymentSent as PaymentSentECL } from './eclModels';
import { LoopQuote } from './loopModels';
import { ServiceInfo } from './boltzModels';

View File

@ -340,6 +340,14 @@ export interface LookupNode {
last_timestamp?: number;
features?: string;
addresses?: Address[];
option_will_fund?: {
lease_fee_base_msat?: number;
lease_fee_basis?: number;
funding_weight?: number;
channel_fee_max_base_msat?: number;
channel_fee_max_proportional_thousandths?: number;
compact_lease?: string;
};
}
export interface FeeRatePerObj {

View File

@ -1,4 +1,4 @@
import { faTachometerAlt, faLink, faBolt, faExchangeAlt, faUsers, faMapSigns, faQuestion, faSearch, faChartBar, faTools, faProjectDiagram, faDownload, faServer, faPercentage, faInfinity, faUserCheck, faLayerGroup, faSync } from '@fortawesome/free-solid-svg-icons';
import { faTachometerAlt, faLink, faBolt, faExchangeAlt, faUsers, faMapSigns, faQuestion, faSearch, faChartBar, faTools, faProjectDiagram, faDownload, faServer, faPercentage, faInfinity, faUserCheck, faLayerGroup, faAd, faWater } from '@fortawesome/free-solid-svg-icons';
import { UserPersonaEnum } from '../services/consts-enums-functions';
export class MenuChildNode {
@ -54,13 +54,14 @@ export const MENU_DATA: MenuRootNode = {
{
id: 3, parentId: 0, name: 'Lightning', iconType: 'FA', icon: faBolt, link: '/cln/connections', userPersona: UserPersonaEnum.ALL, children: [
{ id: 31, parentId: 3, name: 'Peers/Channels', iconType: 'FA', icon: faUsers, link: '/cln/connections', userPersona: UserPersonaEnum.ALL },
{ id: 32, parentId: 3, name: 'Transactions', iconType: 'FA', icon: faExchangeAlt, link: '/cln/transactions', userPersona: UserPersonaEnum.ALL },
{ id: 33, parentId: 3, name: 'Routing', iconType: 'FA', icon: faMapSigns, link: '/cln/routing', userPersona: UserPersonaEnum.ALL },
{ id: 34, parentId: 3, name: 'Reports', iconType: 'FA', icon: faChartBar, link: '/cln/reports', userPersona: UserPersonaEnum.ALL },
{ id: 35, parentId: 3, name: 'Graph Lookup', iconType: 'FA', icon: faSearch, link: '/cln/graph', userPersona: UserPersonaEnum.ALL },
{ id: 36, parentId: 3, name: 'Sign/Verify', iconType: 'FA', icon: faUserCheck, link: '/cln/messages', userPersona: UserPersonaEnum.ALL },
{ id: 37, parentId: 3, name: 'Fee Rates', iconType: 'FA', icon: faPercentage, link: '/cln/rates', userPersona: UserPersonaEnum.OPERATOR },
{ id: 38, parentId: 3, name: 'Node/Fee Rates', iconType: 'FA', icon: faServer, link: '/cln/rates', userPersona: UserPersonaEnum.MERCHANT }
{ id: 32, parentId: 3, name: 'Liquidity Ads', iconType: 'FA', icon: faWater, link: '/cln/liquidityads', userPersona: UserPersonaEnum.ALL },
{ id: 33, parentId: 3, name: 'Transactions', iconType: 'FA', icon: faExchangeAlt, link: '/cln/transactions', userPersona: UserPersonaEnum.ALL },
{ id: 34, parentId: 3, name: 'Routing', iconType: 'FA', icon: faMapSigns, link: '/cln/routing', userPersona: UserPersonaEnum.ALL },
{ id: 35, parentId: 3, name: 'Reports', iconType: 'FA', icon: faChartBar, link: '/cln/reports', userPersona: UserPersonaEnum.ALL },
{ id: 36, parentId: 3, name: 'Graph Lookup', iconType: 'FA', icon: faSearch, link: '/cln/graph', userPersona: UserPersonaEnum.ALL },
{ id: 37, parentId: 3, name: 'Sign/Verify', iconType: 'FA', icon: faUserCheck, link: '/cln/messages', userPersona: UserPersonaEnum.ALL },
{ id: 38, parentId: 3, name: 'Fee Rates', iconType: 'FA', icon: faPercentage, link: '/cln/rates', userPersona: UserPersonaEnum.OPERATOR },
{ id: 39, parentId: 3, name: 'Node/Fee Rates', iconType: 'FA', icon: faServer, link: '/cln/rates', userPersona: UserPersonaEnum.MERCHANT }
]
},
{ id: 4, parentId: 0, name: 'Node Config', iconType: 'FA', icon: faTools, link: '/config', userPersona: UserPersonaEnum.ALL },

View File

@ -318,7 +318,8 @@ export const UI_MESSAGES = {
CREATE_OFFER: 'Creating Offer...',
DELETE_OFFER_BOOKMARK: 'Deleting Bookmark...',
GET_FUNDER_POLICY: 'Getting Or Updating Funder Policy...',
GET_LIST_CONFIGS: 'Getting List Configurations...',
GET_LIST_CONFIGS: 'Getting Configurations List...',
LIST_NETWORK_NODES: 'Getting Network Nodes List...',
LOG_OUT: 'Logging Out...'
};

View File

@ -16,6 +16,7 @@ import { fetchTransactions, fetchUTXOs } from '../../lnd/store/lnd.actions';
import { RTLState } from '../../store/rtl.state';
import { allChannels } from '../../lnd/store/lnd.selector';
import { LookupNode } from '../models/clnModels';
@Injectable()
export class DataService implements OnDestroy {
@ -262,6 +263,22 @@ export class DataService implements OnDestroy {
}));
}
listNetworkNodes(queryParams: string = '') {
return this.lnImplementationUpdated.pipe(first((val) => val !== null), mergeMap((updatedLnImplementation) => {
this.store.dispatch(openSpinner({ payload: UI_MESSAGES.LIST_NETWORK_NODES }));
return this.httpClient.get(this.APIUrl + '/' + updatedLnImplementation + environment.NETWORK_API + '/listNodes' + queryParams).pipe(
takeUntil(this.unSubs[8]),
mergeMap((res) => {
this.store.dispatch(closeSpinner({ payload: UI_MESSAGES.LIST_NETWORK_NODES }));
return of(res);
}), catchError((err) => {
this.handleErrorWithoutAlert('List Network Nodes', UI_MESSAGES.LIST_NETWORK_NODES, err);
return throwError(() => this.extractErrorMessage(err));
})
);
}));
}
listConfigs() {
return this.lnImplementationUpdated.pipe(first((val) => val !== null), mergeMap((updatedLnImplementation) => {
this.store.dispatch(openSpinner({ payload: UI_MESSAGES.GET_LIST_CONFIGS }));
@ -283,7 +300,7 @@ export class DataService implements OnDestroy {
const postParams = policy ? { policy: policy, policy_mod: policyMod, lease_fee_base_msat: leaseFeeBaseMsat, lease_fee_basis: leaseFeeBasis, channel_fee_max_base_msat: channelFeeMaxBaseMsat, channel_fee_max_proportional_thousandths: channelFeeMaxProportional } : null;
this.store.dispatch(openSpinner({ payload: UI_MESSAGES.GET_FUNDER_POLICY }));
return this.httpClient.post(this.APIUrl + '/' + updatedLnImplementation + environment.CHANNELS_API + '/funderUpdate', postParams).pipe(
takeUntil(this.unSubs[8]),
takeUntil(this.unSubs[10]),
map((res) => {
this.store.dispatch(closeSpinner({ payload: UI_MESSAGES.GET_FUNDER_POLICY }));
if (postParams) {