From 346e414181d2407b74f288759d28749ea8f7d109 Mon Sep 17 00:00:00 2001 From: Shahana Farooqui Date: Mon, 16 May 2022 22:53:13 -0400 Subject: [PATCH] Liquidity Ads List Display Incomplete Liquidity Ads List Display Incomplete --- .github/workflows/checks.yml | 1 - backend/controllers/cln/network.js | 20 +++ backend/routes/cln/network.js | 3 +- server/controllers/cln/network.ts | 19 +++ server/routes/cln/network.ts | 3 +- src/app/cln/cln.module.ts | 4 +- src/app/cln/cln.routing.ts | 2 + src/app/cln/graph/graph.component.ts | 10 +- .../channel-lookup.component.ts | 2 +- .../node-lookup/node-lookup.component.ts | 2 +- .../query-routes/query-routes.component.ts | 2 +- .../channel-capacity-info.component.ts | 2 +- .../channel-liquidity-info.component.ts | 2 +- .../channel-status-info.component.ts | 2 +- .../cln/home/fee-info/fee-info.component.ts | 2 +- src/app/cln/home/home.component.ts | 2 +- .../cln/home/node-info/node-info.component.ts | 2 +- .../liquidity-ads.component.html | 127 +++++++++++++++++ .../liquidity-ads.component.scss | 10 ++ .../liquidity-ads.component.spec.ts | 39 ++++++ .../liquidity-ads/liquidity-ads.component.ts | 128 ++++++++++++++++++ .../fee-rates/fee-rates.component.ts | 2 +- .../network-info/network-info.component.ts | 2 +- .../on-chain-fee-estimates.component.ts | 2 +- .../on-chain-send-modal.component.ts | 2 +- src/app/cln/on-chain/on-chain.component.ts | 14 +- .../utxo-tables/utxo-tables.component.ts | 2 +- .../utxo-tables/utxos/utxos.component.ts | 2 +- .../bump-fee-modal/bump-fee.component.ts | 2 +- .../channel-information.component.ts | 2 +- .../channel-open-table.component.ts | 2 +- .../channel-pending-table.component.ts | 2 +- .../channels-tables.component.ts | 10 +- .../open-channel.component.ts | 2 +- .../connect-peer/connect-peer.component.ts | 2 +- .../peers-channels/connections.component.ts | 10 +- .../peers-channels/peers/peers.component.ts | 2 +- src/app/cln/reports/reports.component.ts | 8 +- .../routing/routing-report.component.ts | 2 +- .../transactions-report.component.ts | 2 +- .../failed-transactions.component.ts | 2 +- .../forwarding-history.component.ts | 2 +- .../local-failed-transactions.component.ts | 2 +- .../routing-peers/routing-peers.component.ts | 2 +- src/app/cln/routing/routing.component.ts | 10 +- .../sign-verify-message.component.ts | 10 +- src/app/cln/store/cln.actions.ts | 2 +- src/app/cln/store/cln.effects.ts | 2 +- src/app/cln/store/cln.reducers.ts | 2 +- src/app/cln/store/cln.selector.ts | 2 +- src/app/cln/store/cln.state.ts | 2 +- .../create-invoice.component.ts | 2 +- .../invoice-information.component.spec.ts | 2 +- .../invoice-information.component.ts | 2 +- .../lightning-invoices-table.component.ts | 2 +- .../create-offer.component.ts | 2 +- .../offer-bookmarks-table.component.ts | 2 +- .../offer-information.component.ts | 2 +- .../offers-table/offers-table.component.ts | 2 +- .../payments/lightning-payments.component.ts | 2 +- .../send-payment.component.ts | 2 +- .../transactions/transactions.component.ts | 15 +- src/app/eclair/graph/graph.component.ts | 10 +- src/app/eclair/on-chain/on-chain.component.ts | 10 +- .../channels-tables.component.ts | 8 +- .../peers-channels/connections.component.ts | 8 +- src/app/eclair/reports/reports.component.ts | 8 +- src/app/eclair/routing/routing.component.ts | 12 +- .../transactions/transactions.component.ts | 10 +- src/app/lnd/backup/backup.component.ts | 12 +- src/app/lnd/graph/graph.component.ts | 10 +- src/app/lnd/on-chain/on-chain.component.ts | 12 +- .../channels-tables.component.ts | 8 +- .../peers-channels/connections.component.ts | 8 +- src/app/lnd/routing/routing.component.ts | 13 +- .../sign-verify-message.component.ts | 12 +- .../transactions/transactions.component.ts | 10 +- .../experimental-settings.component.ts | 2 +- .../lnp-config/lnp-config.component.ts | 8 +- .../node-config/node-config.component.ts | 10 +- .../services-settings.component.ts | 10 +- .../services/boltz/boltz-root.component.ts | 12 +- .../services/loop/loop.component.ts | 12 +- .../components/services/services.component.ts | 10 +- .../bitcoin-config.component.ts | 8 +- .../components/settings/settings.component.ts | 10 +- src/app/shared/models/alertData.ts | 2 +- .../models/{clModels.ts => clnModels.ts} | 8 ++ src/app/shared/models/navMenu.ts | 17 +-- .../shared/services/consts-enums-functions.ts | 3 +- src/app/shared/services/data.service.ts | 19 ++- 91 files changed, 623 insertions(+), 188 deletions(-) create mode 100644 src/app/cln/liquidity-ads/liquidity-ads.component.html create mode 100644 src/app/cln/liquidity-ads/liquidity-ads.component.scss create mode 100644 src/app/cln/liquidity-ads/liquidity-ads.component.spec.ts create mode 100644 src/app/cln/liquidity-ads/liquidity-ads.component.ts rename src/app/shared/models/{clModels.ts => clnModels.ts} (97%) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 19c03c4f..093d12af 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -2,7 +2,6 @@ name: Lint & Test on: push: - branches: [ master, 'Release-*' ] tags: [ 'v*' ] release: types: [released] diff --git a/backend/controllers/cln/network.js b/backend/controllers/cln/network.js index e79981ff..e07f6582 100644 --- a/backend/controllers/cln/network.js +++ b/backend/controllers/cln/network.js @@ -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 }); + }); +}; diff --git a/backend/routes/cln/network.js b/backend/routes/cln/network.js index bf486061..e4fb2f22 100644 --- a/backend/routes/cln/network.js +++ b/backend/routes/cln/network.js @@ -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; diff --git a/server/controllers/cln/network.ts b/server/controllers/cln/network.ts index bb6be74d..ae83dd12 100644 --- a/server/controllers/cln/network.ts +++ b/server/controllers/cln/network.ts @@ -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 }); + }); +}; diff --git a/server/routes/cln/network.ts b/server/routes/cln/network.ts index bc549530..6e1c8e4e 100644 --- a/server/routes/cln/network.ts +++ b/server/routes/cln/network.ts @@ -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; diff --git a/src/app/cln/cln.module.ts b/src/app/cln/cln.module.ts index ef8b2db5..5dd7f064 100644 --- a/src/app/cln/cln.module.ts +++ b/src/app/cln/cln.module.ts @@ -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 diff --git a/src/app/cln/cln.routing.ts b/src/app/cln/cln.routing.ts index b4b4e1d8..bb27e400 100644 --- a/src/app/cln/cln.routing.ts +++ b/src/app/cln/cln.routing.ts @@ -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' }, diff --git a/src/app/cln/graph/graph.component.ts b/src/app/cln/graph/graph.component.ts index ebbc9101..1a5b3e5b 100644 --- a/src/app/cln/graph/graph.component.ts +++ b/src/app/cln/graph/graph.component.ts @@ -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) => (value).urlAfterRedirects.includes(link.link)); + this.activeLink = linkFound ? linkFound.link : this.links[0].link; + } }); } diff --git a/src/app/cln/graph/lookups/channel-lookup/channel-lookup.component.ts b/src/app/cln/graph/lookups/channel-lookup/channel-lookup.component.ts index e3a45083..aa021d7c 100644 --- a/src/app/cln/graph/lookups/channel-lookup/channel-lookup.component.ts +++ b/src/app/cln/graph/lookups/channel-lookup/channel-lookup.component.ts @@ -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'; diff --git a/src/app/cln/graph/lookups/node-lookup/node-lookup.component.ts b/src/app/cln/graph/lookups/node-lookup/node-lookup.component.ts index e0b31086..6fc46973 100644 --- a/src/app/cln/graph/lookups/node-lookup/node-lookup.component.ts +++ b/src/app/cln/graph/lookups/node-lookup/node-lookup.component.ts @@ -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'; diff --git a/src/app/cln/graph/query-routes/query-routes.component.ts b/src/app/cln/graph/query-routes/query-routes.component.ts index d7551021..175ad1e6 100644 --- a/src/app/cln/graph/query-routes/query-routes.component.ts +++ b/src/app/cln/graph/query-routes/query-routes.component.ts @@ -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'; diff --git a/src/app/cln/home/channel-capacity-info/channel-capacity-info.component.ts b/src/app/cln/home/channel-capacity-info/channel-capacity-info.component.ts index 1f8aeaf0..b5503c4e 100644 --- a/src/app/cln/home/channel-capacity-info/channel-capacity-info.component.ts +++ b/src/app/cln/home/channel-capacity-info/channel-capacity-info.component.ts @@ -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', diff --git a/src/app/cln/home/channel-liquidity-info/channel-liquidity-info.component.ts b/src/app/cln/home/channel-liquidity-info/channel-liquidity-info.component.ts index 710d2f79..b5e0c109 100644 --- a/src/app/cln/home/channel-liquidity-info/channel-liquidity-info.component.ts +++ b/src/app/cln/home/channel-liquidity-info/channel-liquidity-info.component.ts @@ -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'; diff --git a/src/app/cln/home/channel-status-info/channel-status-info.component.ts b/src/app/cln/home/channel-status-info/channel-status-info.component.ts index 6ea14447..95c46f11 100644 --- a/src/app/cln/home/channel-status-info/channel-status-info.component.ts +++ b/src/app/cln/home/channel-status-info/channel-status-info.component.ts @@ -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', diff --git a/src/app/cln/home/fee-info/fee-info.component.ts b/src/app/cln/home/fee-info/fee-info.component.ts index a91c6302..c8a75ef3 100644 --- a/src/app/cln/home/fee-info/fee-info.component.ts +++ b/src/app/cln/home/fee-info/fee-info.component.ts @@ -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', diff --git a/src/app/cln/home/home.component.ts b/src/app/cln/home/home.component.ts index de517845..c4678651 100644 --- a/src/app/cln/home/home.component.ts +++ b/src/app/cln/home/home.component.ts @@ -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'; diff --git a/src/app/cln/home/node-info/node-info.component.ts b/src/app/cln/home/node-info/node-info.component.ts index 1c5c1049..fc970b04 100644 --- a/src/app/cln/home/node-info/node-info.component.ts +++ b/src/app/cln/home/node-info/node-info.component.ts @@ -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({ diff --git a/src/app/cln/liquidity-ads/liquidity-ads.component.html b/src/app/cln/liquidity-ads/liquidity-ads.component.html new file mode 100644 index 00000000..49e57122 --- /dev/null +++ b/src/app/cln/liquidity-ads/liquidity-ads.component.html @@ -0,0 +1,127 @@ +
+ + Liquidity Ads +
+
+ + +
+
+
+ + Ads should be suplemented with additional research of the nodes, before buying liquidity. +
+
+
+ + Liquidity Ask + info_outline + +
+ + + Channel amount is required. + + + + Channel opening fee rate is required. + +
+
+ + +
+
+ +
+
+
+ + Nodes Advertising Liquidity + info_outline + +
+ + + Node capacity is required. + + + + Channel count is required. + +
+
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Alias + {{lqNode?.alias}} + Capacity + {{lqNode?.option_will_fund?.lease_fee_basis | number:'1.0-0'}} Channels + {{lqNode?.option_will_fund?.lease_fee_basis | number:'1.0-0'}} Lease Fee + {{lqNode?.option_will_fund?.lease_fee_basis | number:'1.0-0'}} Routing Fee + {{lqNode?.option_will_fund?.lease_fee_basis | number:'1.0-0'}} Channel Open Fee + {{lqNode?.option_will_fund?.lease_fee_basis | number:'1.0-0'}} +
+ + + Download CSV + +
+
+
+ + + View Info + Open Channel + +
+
+

No node with liquidity.

+

Getting nodes with liquidity...

+

{{errorMessage}}

+
+
+ +
+
+
+
diff --git a/src/app/cln/liquidity-ads/liquidity-ads.component.scss b/src/app/cln/liquidity-ads/liquidity-ads.component.scss new file mode 100644 index 00000000..fee2d214 --- /dev/null +++ b/src/app/cln/liquidity-ads/liquidity-ads.component.scss @@ -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; +} diff --git a/src/app/cln/liquidity-ads/liquidity-ads.component.spec.ts b/src/app/cln/liquidity-ads/liquidity-ads.component.spec.ts new file mode 100644 index 00000000..8afdeb54 --- /dev/null +++ b/src/app/cln/liquidity-ads/liquidity-ads.component.spec.ts @@ -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; + + 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(); + }); +}); diff --git a/src/app/cln/liquidity-ads/liquidity-ads.component.ts b/src/app/cln/liquidity-ads/liquidity-ads.component.ts new file mode 100644 index 00000000..494ecef8 --- /dev/null +++ b/src/app/cln/liquidity-ads/liquidity-ads.component.ts @@ -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> = [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([...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(); + }); + } + +} diff --git a/src/app/cln/network-info/fee-rates/fee-rates.component.ts b/src/app/cln/network-info/fee-rates/fee-rates.component.ts index 7c84acb7..7cfe705f 100644 --- a/src/app/cln/network-info/fee-rates/fee-rates.component.ts +++ b/src/app/cln/network-info/fee-rates/fee-rates.component.ts @@ -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', diff --git a/src/app/cln/network-info/network-info.component.ts b/src/app/cln/network-info/network-info.component.ts index d3c96246..a9ec8b84 100644 --- a/src/app/cln/network-info/network-info.component.ts +++ b/src/app/cln/network-info/network-info.component.ts @@ -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'; diff --git a/src/app/cln/network-info/on-chain-fee-estimates/on-chain-fee-estimates.component.ts b/src/app/cln/network-info/on-chain-fee-estimates/on-chain-fee-estimates.component.ts index 84ce9872..7ecaf001 100644 --- a/src/app/cln/network-info/on-chain-fee-estimates/on-chain-fee-estimates.component.ts +++ b/src/app/cln/network-info/on-chain-fee-estimates/on-chain-fee-estimates.component.ts @@ -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', diff --git a/src/app/cln/on-chain/on-chain-send-modal/on-chain-send-modal.component.ts b/src/app/cln/on-chain/on-chain-send-modal/on-chain-send-modal.component.ts index 17675c00..6c9b22a1 100644 --- a/src/app/cln/on-chain/on-chain-send-modal/on-chain-send-modal.component.ts +++ b/src/app/cln/on-chain/on-chain-send-modal/on-chain-send-modal.component.ts @@ -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'; diff --git a/src/app/cln/on-chain/on-chain.component.ts b/src/app/cln/on-chain/on-chain.component.ts index 50ceb8fa..f68c41b5 100644 --- a/src/app/cln/on-chain/on-chain.component.ts +++ b/src/app/cln/on-chain/on-chain.component.ts @@ -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) => (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)); + } }); this.store.select(clnNodeSettings).pipe(takeUntil(this.unSubs[1])). subscribe((nodeSettings: SelNodeChild) => { diff --git a/src/app/cln/on-chain/utxo-tables/utxo-tables.component.ts b/src/app/cln/on-chain/utxo-tables/utxo-tables.component.ts index 32862e39..d14741ba 100644 --- a/src/app/cln/on-chain/utxo-tables/utxo-tables.component.ts +++ b/src/app/cln/on-chain/utxo-tables/utxo-tables.component.ts @@ -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'; diff --git a/src/app/cln/on-chain/utxo-tables/utxos/utxos.component.ts b/src/app/cln/on-chain/utxo-tables/utxos/utxos.component.ts index 77f2745e..ea079aae 100644 --- a/src/app/cln/on-chain/utxo-tables/utxos/utxos.component.ts +++ b/src/app/cln/on-chain/utxo-tables/utxos/utxos.component.ts @@ -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'; diff --git a/src/app/cln/peers-channels/channels/bump-fee-modal/bump-fee.component.ts b/src/app/cln/peers-channels/channels/bump-fee-modal/bump-fee.component.ts index 83db89c6..3a862a70 100644 --- a/src/app/cln/peers-channels/channels/bump-fee-modal/bump-fee.component.ts +++ b/src/app/cln/peers-channels/channels/bump-fee-modal/bump-fee.component.ts @@ -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'; diff --git a/src/app/cln/peers-channels/channels/channel-information-modal/channel-information.component.ts b/src/app/cln/peers-channels/channels/channel-information-modal/channel-information.component.ts index cbd76e67..765727c7 100644 --- a/src/app/cln/peers-channels/channels/channel-information-modal/channel-information.component.ts +++ b/src/app/cln/peers-channels/channels/channel-information-modal/channel-information.component.ts @@ -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({ diff --git a/src/app/cln/peers-channels/channels/channels-tables/channel-open-table/channel-open-table.component.ts b/src/app/cln/peers-channels/channels/channels-tables/channel-open-table/channel-open-table.component.ts index 26804398..7651b1ef 100644 --- a/src/app/cln/peers-channels/channels/channels-tables/channel-open-table/channel-open-table.component.ts +++ b/src/app/cln/peers-channels/channels/channels-tables/channel-open-table/channel-open-table.component.ts @@ -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'; diff --git a/src/app/cln/peers-channels/channels/channels-tables/channel-pending-table/channel-pending-table.component.ts b/src/app/cln/peers-channels/channels/channels-tables/channel-pending-table/channel-pending-table.component.ts index f28e6f5b..b1873446 100644 --- a/src/app/cln/peers-channels/channels/channels-tables/channel-pending-table/channel-pending-table.component.ts +++ b/src/app/cln/peers-channels/channels/channels-tables/channel-pending-table/channel-pending-table.component.ts @@ -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'; diff --git a/src/app/cln/peers-channels/channels/channels-tables/channels-tables.component.ts b/src/app/cln/peers-channels/channels/channels-tables/channels-tables.component.ts index a3d78e9b..6d39cd94 100644 --- a/src/app/cln/peers-channels/channels/channels-tables/channels-tables.component.ts +++ b/src/app/cln/peers-channels/channels/channels-tables/channels-tables.component.ts @@ -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 === (value).urlAfterRedirects.substring((value).urlAfterRedirects.lastIndexOf('/') + 1)); + } }); this.store.select(nodeInfoAndNodeSettingsAndBalance).pipe(takeUntil(this.unSubs[1])). subscribe((infoSettingsBalSelector: { information: GetInfo, nodeSettings: SelNodeChild, balance: Balance }) => { diff --git a/src/app/cln/peers-channels/channels/open-channel-modal/open-channel.component.ts b/src/app/cln/peers-channels/channels/open-channel-modal/open-channel.component.ts index 5cd2cb16..d4fa7882 100644 --- a/src/app/cln/peers-channels/channels/open-channel-modal/open-channel.component.ts +++ b/src/app/cln/peers-channels/channels/open-channel-modal/open-channel.component.ts @@ -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'; diff --git a/src/app/cln/peers-channels/connect-peer/connect-peer.component.ts b/src/app/cln/peers-channels/connect-peer/connect-peer.component.ts index d27c479c..662bba2b 100644 --- a/src/app/cln/peers-channels/connect-peer/connect-peer.component.ts +++ b/src/app/cln/peers-channels/connect-peer/connect-peer.component.ts @@ -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'; diff --git a/src/app/cln/peers-channels/connections.component.ts b/src/app/cln/peers-channels/connections.component.ts index fcc86050..22c13e97 100644 --- a/src/app/cln/peers-channels/connections.component.ts +++ b/src/app/cln/peers-channels/connections.component.ts @@ -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 === (value).urlAfterRedirects.substring((value).urlAfterRedirects.lastIndexOf('/') + 1)); + } }); this.store.select(channels).pipe(takeUntil(this.unSubs[1])). subscribe((channelsSeletor: { activeChannels: Channel[], pendingChannels: Channel[], inactiveChannels: Channel[], apiCallStatus: ApiCallStatusPayload }) => { diff --git a/src/app/cln/peers-channels/peers/peers.component.ts b/src/app/cln/peers-channels/peers/peers.component.ts index 20c7081b..0b128072 100644 --- a/src/app/cln/peers-channels/peers/peers.component.ts +++ b/src/app/cln/peers-channels/peers/peers.component.ts @@ -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'; diff --git a/src/app/cln/reports/reports.component.ts b/src/app/cln/reports/reports.component.ts index 3a8e3322..b398ce09 100644 --- a/src/app/cln/reports/reports.component.ts +++ b/src/app/cln/reports/reports.component.ts @@ -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) => (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) => (value).urlAfterRedirects.includes(link.link)); + this.activeLink = linkFound ? linkFound.link : this.links[0].link; + } }); } diff --git a/src/app/cln/reports/routing/routing-report.component.ts b/src/app/cln/reports/routing/routing-report.component.ts index 6f665d62..505bb9dd 100644 --- a/src/app/cln/reports/routing/routing-report.component.ts +++ b/src/app/cln/reports/routing/routing-report.component.ts @@ -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'; diff --git a/src/app/cln/reports/transactions/transactions-report.component.ts b/src/app/cln/reports/transactions/transactions-report.component.ts index 81918366..ba448e32 100644 --- a/src/app/cln/reports/transactions/transactions-report.component.ts +++ b/src/app/cln/reports/transactions/transactions-report.component.ts @@ -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'; diff --git a/src/app/cln/routing/failed-transactions/failed-transactions.component.ts b/src/app/cln/routing/failed-transactions/failed-transactions.component.ts index 2be8e217..b6e8719b 100644 --- a/src/app/cln/routing/failed-transactions/failed-transactions.component.ts +++ b/src/app/cln/routing/failed-transactions/failed-transactions.component.ts @@ -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'; diff --git a/src/app/cln/routing/forwarding-history/forwarding-history.component.ts b/src/app/cln/routing/forwarding-history/forwarding-history.component.ts index 0146d7e8..59287ed4 100644 --- a/src/app/cln/routing/forwarding-history/forwarding-history.component.ts +++ b/src/app/cln/routing/forwarding-history/forwarding-history.component.ts @@ -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'; diff --git a/src/app/cln/routing/local-failed-transactions/local-failed-transactions.component.ts b/src/app/cln/routing/local-failed-transactions/local-failed-transactions.component.ts index b7f55042..dcf173fe 100644 --- a/src/app/cln/routing/local-failed-transactions/local-failed-transactions.component.ts +++ b/src/app/cln/routing/local-failed-transactions/local-failed-transactions.component.ts @@ -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'; diff --git a/src/app/cln/routing/routing-peers/routing-peers.component.ts b/src/app/cln/routing/routing-peers/routing-peers.component.ts index bda596da..1b6f2742 100644 --- a/src/app/cln/routing/routing-peers/routing-peers.component.ts +++ b/src/app/cln/routing/routing-peers/routing-peers.component.ts @@ -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'; diff --git a/src/app/cln/routing/routing.component.ts b/src/app/cln/routing/routing.component.ts index 80acd10c..3e1d7633 100644 --- a/src/app/cln/routing/routing.component.ts +++ b/src/app/cln/routing/routing.component.ts @@ -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) => (value).urlAfterRedirects.includes(link.link)); + this.activeLink = linkFound ? linkFound.link : this.links[0].link; + } }); } diff --git a/src/app/cln/sign-verify-message/sign-verify-message.component.ts b/src/app/cln/sign-verify-message/sign-verify-message.component.ts index adfbde2d..4c54f885 100644 --- a/src/app/cln/sign-verify-message/sign-verify-message.component.ts +++ b/src/app/cln/sign-verify-message/sign-verify-message.component.ts @@ -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) => (value).urlAfterRedirects.includes(link.link)); + this.activeLink = linkFound ? linkFound.link : this.links[0].link; + } }); } diff --git a/src/app/cln/store/cln.actions.ts b/src/app/cln/store/cln.actions.ts index 0ea68930..6fec2e45 100644 --- a/src/app/cln/store/cln.actions.ts +++ b/src/app/cln/store/cln.actions.ts @@ -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 }>()); diff --git a/src/app/cln/store/cln.effects.ts b/src/app/cln/store/cln.effects.ts index e417cd62..47ca3342 100644 --- a/src/app/cln/store/cln.effects.ts +++ b/src/app/cln/store/cln.effects.ts @@ -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'; diff --git a/src/app/cln/store/cln.reducers.ts b/src/app/cln/store/cln.reducers.ts index e8c5c6ce..bc05a19c 100644 --- a/src/app/cln/store/cln.reducers.ts +++ b/src/app/cln/store/cln.reducers.ts @@ -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 }) => { diff --git a/src/app/cln/store/cln.selector.ts b/src/app/cln/store/cln.selector.ts index a6ddff4c..b3a1c75f 100644 --- a/src/app/cln/store/cln.selector.ts +++ b/src/app/cln/store/cln.selector.ts @@ -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('cln'); diff --git a/src/app/cln/store/cln.state.ts b/src/app/cln/store/cln.state.ts index db620456..7f66baa7 100644 --- a/src/app/cln/store/cln.state.ts +++ b/src/app/cln/store/cln.state.ts @@ -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 { diff --git a/src/app/cln/transactions/invoices/create-invoice-modal/create-invoice.component.ts b/src/app/cln/transactions/invoices/create-invoice-modal/create-invoice.component.ts index 2d0dd163..bcf22269 100644 --- a/src/app/cln/transactions/invoices/create-invoice-modal/create-invoice.component.ts +++ b/src/app/cln/transactions/invoices/create-invoice-modal/create-invoice.component.ts @@ -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'; diff --git a/src/app/cln/transactions/invoices/invoice-information-modal/invoice-information.component.spec.ts b/src/app/cln/transactions/invoices/invoice-information-modal/invoice-information.component.spec.ts index d6a22a16..231a76fb 100644 --- a/src/app/cln/transactions/invoices/invoice-information-modal/invoice-information.component.spec.ts +++ b/src/app/cln/transactions/invoices/invoice-information-modal/invoice-information.component.spec.ts @@ -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; diff --git a/src/app/cln/transactions/invoices/invoice-information-modal/invoice-information.component.ts b/src/app/cln/transactions/invoices/invoice-information-modal/invoice-information.component.ts index e29556fd..40f27ba9 100644 --- a/src/app/cln/transactions/invoices/invoice-information-modal/invoice-information.component.ts +++ b/src/app/cln/transactions/invoices/invoice-information-modal/invoice-information.component.ts @@ -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'; diff --git a/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.ts b/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.ts index a16fc9d7..46f2907d 100644 --- a/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.ts +++ b/src/app/cln/transactions/invoices/invoices-table/lightning-invoices-table.component.ts @@ -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'; diff --git a/src/app/cln/transactions/offers/create-offer-modal/create-offer.component.ts b/src/app/cln/transactions/offers/create-offer-modal/create-offer.component.ts index 41b7d549..2b73b8c9 100644 --- a/src/app/cln/transactions/offers/create-offer-modal/create-offer.component.ts +++ b/src/app/cln/transactions/offers/create-offer-modal/create-offer.component.ts @@ -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'; diff --git a/src/app/cln/transactions/offers/offer-bookmarks-table/offer-bookmarks-table.component.ts b/src/app/cln/transactions/offers/offer-bookmarks-table/offer-bookmarks-table.component.ts index f6e2a100..41e7f600 100644 --- a/src/app/cln/transactions/offers/offer-bookmarks-table/offer-bookmarks-table.component.ts +++ b/src/app/cln/transactions/offers/offer-bookmarks-table/offer-bookmarks-table.component.ts @@ -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'; diff --git a/src/app/cln/transactions/offers/offer-information-modal/offer-information.component.ts b/src/app/cln/transactions/offers/offer-information-modal/offer-information.component.ts index 42744a64..fdc8c25a 100644 --- a/src/app/cln/transactions/offers/offer-information-modal/offer-information.component.ts +++ b/src/app/cln/transactions/offers/offer-information-modal/offer-information.component.ts @@ -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'; diff --git a/src/app/cln/transactions/offers/offers-table/offers-table.component.ts b/src/app/cln/transactions/offers/offers-table/offers-table.component.ts index a097ceba..800916ed 100644 --- a/src/app/cln/transactions/offers/offers-table/offers-table.component.ts +++ b/src/app/cln/transactions/offers/offers-table/offers-table.component.ts @@ -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'; diff --git a/src/app/cln/transactions/payments/lightning-payments.component.ts b/src/app/cln/transactions/payments/lightning-payments.component.ts index 6884ca65..7a9454ef 100644 --- a/src/app/cln/transactions/payments/lightning-payments.component.ts +++ b/src/app/cln/transactions/payments/lightning-payments.component.ts @@ -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'; diff --git a/src/app/cln/transactions/send-payment-modal/send-payment.component.ts b/src/app/cln/transactions/send-payment-modal/send-payment.component.ts index 3d52cc71..6d61b67a 100644 --- a/src/app/cln/transactions/send-payment-modal/send-payment.component.ts +++ b/src/app/cln/transactions/send-payment-modal/send-payment.component.ts @@ -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'; diff --git a/src/app/cln/transactions/transactions.component.ts b/src/app/cln/transactions/transactions.component.ts index c57fa7bf..1f1dfae4 100644 --- a/src/app/cln/transactions/transactions.component.ts +++ b/src/app/cln/transactions/transactions.component.ts @@ -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) => (value).urlAfterRedirects.includes(link.link)); + + this.activeLink = linkFound ? linkFound.link : this.links[0].link; + this.routerUrl = (value).urlAfterRedirects; + } }); this.store.select(clnNodeSettings).pipe(takeUntil(this.unSubs[1])).subscribe((nodeSettings: SelNodeChild) => { this.selNode = nodeSettings; diff --git a/src/app/eclair/graph/graph.component.ts b/src/app/eclair/graph/graph.component.ts index 1e0ded73..0176639a 100644 --- a/src/app/eclair/graph/graph.component.ts +++ b/src/app/eclair/graph/graph.component.ts @@ -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) => (value).urlAfterRedirects.includes(link.link)); + this.activeLink = linkFound ? linkFound.link : this.links[0].link; + } }); } diff --git a/src/app/eclair/on-chain/on-chain.component.ts b/src/app/eclair/on-chain/on-chain.component.ts index 685ee865..28e4a546 100644 --- a/src/app/eclair/on-chain/on-chain.component.ts +++ b/src/app/eclair/on-chain/on-chain.component.ts @@ -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) => (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) => { diff --git a/src/app/eclair/peers-channels/channels/channels-tables/channels-tables.component.ts b/src/app/eclair/peers-channels/channels/channels-tables/channels-tables.component.ts index a36fb382..56dde583 100644 --- a/src/app/eclair/peers-channels/channels/channels-tables/channels-tables.component.ts +++ b/src/app/eclair/peers-channels/channels/channels-tables/channels-tables.component.ts @@ -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 === (value).urlAfterRedirects.substring((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 })) => { diff --git a/src/app/eclair/peers-channels/connections.component.ts b/src/app/eclair/peers-channels/connections.component.ts index b670de74..5fe9f5ee 100644 --- a/src/app/eclair/peers-channels/connections.component.ts +++ b/src/app/eclair/peers-channels/connections.component.ts @@ -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 === (value).urlAfterRedirects.substring((value).urlAfterRedirects.lastIndexOf('/') + 1)); + } }); this.store.select(peers).pipe(takeUntil(this.unSubs[1])). subscribe((peersSelector: { peers: Peer[], apiCallStatus: ApiCallStatusPayload }) => { diff --git a/src/app/eclair/reports/reports.component.ts b/src/app/eclair/reports/reports.component.ts index 60093ef5..0bc96f52 100644 --- a/src/app/eclair/reports/reports.component.ts +++ b/src/app/eclair/reports/reports.component.ts @@ -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) => (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) => (value).urlAfterRedirects.includes(link.link)); + this.activeLink = linkFound ? linkFound.link : this.links[0].link; + } }); } diff --git a/src/app/eclair/routing/routing.component.ts b/src/app/eclair/routing/routing.component.ts index 7cd9f3e6..48938c34 100644 --- a/src/app/eclair/routing/routing.component.ts +++ b/src/app/eclair/routing/routing.component.ts @@ -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> = [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) => (value).urlAfterRedirects.includes(link.link)); + this.activeLink = linkFound ? linkFound.link : this.links[0].link; + } }); } diff --git a/src/app/eclair/transactions/transactions.component.ts b/src/app/eclair/transactions/transactions.component.ts index 1c9f9b1d..03289421 100644 --- a/src/app/eclair/transactions/transactions.component.ts +++ b/src/app/eclair/transactions/transactions.component.ts @@ -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) => (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))). diff --git a/src/app/lnd/backup/backup.component.ts b/src/app/lnd/backup/backup.component.ts index a90b6555..c88cecf7 100644 --- a/src/app/lnd/backup/backup.component.ts +++ b/src/app/lnd/backup/backup.component.ts @@ -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> = [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) => (value).urlAfterRedirects.includes(link.link)); + this.activeLink = linkFound ? linkFound.link : this.links[0].link; + } }); } diff --git a/src/app/lnd/graph/graph.component.ts b/src/app/lnd/graph/graph.component.ts index 77838f9e..edce1d43 100644 --- a/src/app/lnd/graph/graph.component.ts +++ b/src/app/lnd/graph/graph.component.ts @@ -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) => (value).urlAfterRedirects.includes(link.link)); + this.activeLink = linkFound ? linkFound.link : this.links[0].link; + } }); } diff --git a/src/app/lnd/on-chain/on-chain.component.ts b/src/app/lnd/on-chain/on-chain.component.ts index 694c423f..be867d35 100644 --- a/src/app/lnd/on-chain/on-chain.component.ts +++ b/src/app/lnd/on-chain/on-chain.component.ts @@ -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) => (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)); + } }); this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[1])). subscribe((nodeSettings: SelNodeChild) => { diff --git a/src/app/lnd/peers-channels/channels/channels-tables/channels-tables.component.ts b/src/app/lnd/peers-channels/channels/channels-tables/channels-tables.component.ts index cbbc0334..8408fb60 100644 --- a/src/app/lnd/peers-channels/channels/channels-tables/channels-tables.component.ts +++ b/src/app/lnd/peers-channels/channels/channels-tables/channels-tables.component.ts @@ -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 === (value).urlAfterRedirects.substring((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])). diff --git a/src/app/lnd/peers-channels/connections.component.ts b/src/app/lnd/peers-channels/connections.component.ts index 37d4b4cb..5b2b6a0d 100644 --- a/src/app/lnd/peers-channels/connections.component.ts +++ b/src/app/lnd/peers-channels/connections.component.ts @@ -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 === (value).urlAfterRedirects.substring((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])). diff --git a/src/app/lnd/routing/routing.component.ts b/src/app/lnd/routing/routing.component.ts index a8cc3202..1a9204f5 100644 --- a/src/app/lnd/routing/routing.component.ts +++ b/src/app/lnd/routing/routing.component.ts @@ -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) => (value).urlAfterRedirects.includes(link.link)); + this.activeLink = linkFound ? linkFound.link : this.links[0].link; + } }); } diff --git a/src/app/lnd/sign-verify-message/sign-verify-message.component.ts b/src/app/lnd/sign-verify-message/sign-verify-message.component.ts index c21174af..0e2cdd7d 100644 --- a/src/app/lnd/sign-verify-message/sign-verify-message.component.ts +++ b/src/app/lnd/sign-verify-message/sign-verify-message.component.ts @@ -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> = [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) => (value).urlAfterRedirects.includes(link.link)); + this.activeLink = linkFound ? linkFound.link : this.links[0].link; + } }); } diff --git a/src/app/lnd/transactions/transactions.component.ts b/src/app/lnd/transactions/transactions.component.ts index 5df5cdb9..2b5d0928 100644 --- a/src/app/lnd/transactions/transactions.component.ts +++ b/src/app/lnd/transactions/transactions.component.ts @@ -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) => (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))). diff --git a/src/app/shared/components/node-config/experimental-settings/experimental-settings.component.ts b/src/app/shared/components/node-config/experimental-settings/experimental-settings.component.ts index c4d8b67a..3be0d908 100644 --- a/src/app/shared/components/node-config/experimental-settings/experimental-settings.component.ts +++ b/src/app/shared/components/node-config/experimental-settings/experimental-settings.component.ts @@ -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({ diff --git a/src/app/shared/components/node-config/lnp-config/lnp-config.component.ts b/src/app/shared/components/node-config/lnp-config/lnp-config.component.ts index c5189447..2961c383 100644 --- a/src/app/shared/components/node-config/lnp-config/lnp-config.component.ts +++ b/src/app/shared/components/node-config/lnp-config/lnp-config.component.ts @@ -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 = ((value).urlAfterRedirects.includes('bconfig')) ? 'bitcoind' : 'ln'; + } }); this.store.dispatch(fetchConfig({ payload: this.selectedNodeType })); this.rtlEffects.showLnConfig. diff --git a/src/app/shared/components/node-config/node-config.component.ts b/src/app/shared/components/node-config/node-config.component.ts index d4f410a2..ef8e9e50 100644 --- a/src/app/shared/components/node-config/node-config.component.ts +++ b/src/app/shared/components/node-config/node-config.component.ts @@ -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) => (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; diff --git a/src/app/shared/components/node-config/services-settings/services-settings.component.ts b/src/app/shared/components/node-config/services-settings/services-settings.component.ts index 685ed7f1..fc20c7dc 100644 --- a/src/app/shared/components/node-config/services-settings/services-settings.component.ts +++ b/src/app/shared/components/node-config/services-settings/services-settings.component.ts @@ -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) => (value).urlAfterRedirects.includes(link.link)); + this.activeLink = linkFound ? linkFound.link : this.links[0].link; + } }); } diff --git a/src/app/shared/components/services/boltz/boltz-root.component.ts b/src/app/shared/components/services/boltz/boltz-root.component.ts index b828badc..f13c7713 100644 --- a/src/app/shared/components/services/boltz/boltz-root.component.ts +++ b/src/app/shared/components/services/boltz/boltz-root.component.ts @@ -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) => (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])). diff --git a/src/app/shared/components/services/loop/loop.component.ts b/src/app/shared/components/services/loop/loop.component.ts index f900d8bf..1e5099b8 100644 --- a/src/app/shared/components/services/loop/loop.component.ts +++ b/src/app/shared/components/services/loop/loop.component.ts @@ -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) => (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])). diff --git a/src/app/shared/components/services/services.component.ts b/src/app/shared/components/services/services.component.ts index a052059d..a2d269dd 100644 --- a/src/app/shared/components/services/services.component.ts +++ b/src/app/shared/components/services/services.component.ts @@ -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) => (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) => { diff --git a/src/app/shared/components/settings/bitcoin-config/bitcoin-config.component.ts b/src/app/shared/components/settings/bitcoin-config/bitcoin-config.component.ts index 89b80219..083ebf04 100644 --- a/src/app/shared/components/settings/bitcoin-config/bitcoin-config.component.ts +++ b/src/app/shared/components/settings/bitcoin-config/bitcoin-config.component.ts @@ -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 = ((value).urlAfterRedirects.includes('bconfig')) ? 'bitcoind' : 'ln'; + } }); this.store.dispatch(fetchConfig({ payload: this.selectedNodeType })); this.rtlEffects.showLnConfig. diff --git a/src/app/shared/components/settings/settings.component.ts b/src/app/shared/components/settings/settings.component.ts index 0ecd4f06..7be4f2e4 100644 --- a/src/app/shared/components/settings/settings.component.ts +++ b/src/app/shared/components/settings/settings.component.ts @@ -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) => (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; diff --git a/src/app/shared/models/alertData.ts b/src/app/shared/models/alertData.ts index b4a30163..3ad56dce 100644 --- a/src/app/shared/models/alertData.ts +++ b/src/app/shared/models/alertData.ts @@ -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'; diff --git a/src/app/shared/models/clModels.ts b/src/app/shared/models/clnModels.ts similarity index 97% rename from src/app/shared/models/clModels.ts rename to src/app/shared/models/clnModels.ts index 61ef2b51..a9d985d5 100644 --- a/src/app/shared/models/clModels.ts +++ b/src/app/shared/models/clnModels.ts @@ -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 { diff --git a/src/app/shared/models/navMenu.ts b/src/app/shared/models/navMenu.ts index 07336a81..a9242413 100644 --- a/src/app/shared/models/navMenu.ts +++ b/src/app/shared/models/navMenu.ts @@ -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 }, diff --git a/src/app/shared/services/consts-enums-functions.ts b/src/app/shared/services/consts-enums-functions.ts index 32977778..98cf3753 100644 --- a/src/app/shared/services/consts-enums-functions.ts +++ b/src/app/shared/services/consts-enums-functions.ts @@ -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...' }; diff --git a/src/app/shared/services/data.service.ts b/src/app/shared/services/data.service.ts index eced6bae..0687e6ca 100644 --- a/src/app/shared/services/data.service.ts +++ b/src/app/shared/services/data.service.ts @@ -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) {