CL fixes
This commit is contained in:
Shahana Farooqui 2020-01-04 15:24:17 -05:00
parent 41db338656
commit b3d85d30fc
21 changed files with 72 additions and 105 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -12,5 +12,5 @@
<link rel="stylesheet" href="styles.50c2f6a606d60f850d7c.css"></head>
<body>
<rtl-app></rtl-app>
<script src="runtime.f855ea0cbc4f9069b03d.js" defer></script><script src="polyfills-es5.b8e32dec482ae69710a2.js" nomodule defer></script><script src="polyfills.ebf9033c33aa4a5af12a.js" defer></script><script src="main.b4d9830f7088e62218ba.js" defer></script></body>
<script src="runtime.05dca71f751b1d7befeb.js" defer></script><script src="polyfills-es5.b8e32dec482ae69710a2.js" nomodule defer></script><script src="polyfills.ebf9033c33aa4a5af12a.js" defer></script><script src="main.c57e3ff765ca9ee015b5.js" defer></script></body>
</html>

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
!function(e){function r(r){for(var n,a,i=r[0],f=r[1],c=r[2],p=0,s=[];p<i.length;p++)a=i[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&s.push(o[a][0]),o[a]=0;for(n in f)Object.prototype.hasOwnProperty.call(f,n)&&(e[n]=f[n]);for(l&&l(r);s.length;)s.shift()();return u.push.apply(u,c||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++)0!==o[t[i]]&&(n=!1);n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={0:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({}[e]||e)+"."+{1:"77d491bf73b15683870f",6:"5a3f5136d706d4191aba",7:"92fe25b3a99b58bf5108"}[e]+".js"}(e);var f=new Error;u=function(r){i.onerror=i.onload=null,clearTimeout(c);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;f.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",f.name="ChunkLoadError",f.type=n,f.request=u,t[1](f)}o[e]=void 0}};var c=setTimeout((function(){u({type:"timeout",target:i})}),12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,(function(r){return e[r]}).bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="",a.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],f=i.push.bind(i);i.push=r,i=i.slice();for(var c=0;c<i.length;c++)r(i[c]);var l=f;t()}([]);
!function(e){function r(r){for(var n,a,i=r[0],c=r[1],f=r[2],p=0,s=[];p<i.length;p++)a=i[p],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&s.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++)0!==o[t[i]]&&(n=!1);n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={0:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({}[e]||e)+"."+{1:"77d491bf73b15683870f",6:"b4a9bd707a549a4eb404",7:"84e864ea895f0d630a75"}[e]+".js"}(e);var c=new Error;u=function(r){i.onerror=i.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var f=setTimeout((function(){u({type:"timeout",target:i})}),12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,(function(r){return e[r]}).bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="",a.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var f=0;f<i.length;f++)r(i[f]);var l=c;t()}([]);

View file

@ -9,9 +9,9 @@ exports.listChannels = (req, res, next) => {
request(options).then(function (body) {
logger.info({fileName: 'Channels', msg: 'List Channels: ' + JSON.stringify(body)});
body.map(channel => {
local = (channel.our_channel_reserve_satoshis) ? +channel.our_channel_reserve_satoshis : 0;
remote = (channel.their_channel_reserve_satoshis) ? +channel.their_channel_reserve_satoshis : 0;
total = local + remote;
local = (channel.msatoshi_to_us) ? +channel.msatoshi_to_us : 0;
remote = (channel.msatoshi_to_them) ? +msatoshi_to_them : 0;
total = channel.msatoshi_total ? +channel.msatoshi_total : 0;
channel.balancedness = (1 - Math.abs((local-remote)/total)).toFixed(3);
})
res.status(200).json(body);

View file

@ -26,6 +26,28 @@ exports.getInfo = (req, res, next) => {
} else {
body.currency_unit = 'BTC';
body.smaller_currency_unit = 'Sats';
body.lnImplementation = 'C-Lightning';
let chainObj = { chain: '', network: '' };
if (body.network === 'testnet') {
chainObj.chain = 'Bitcoin';
chainObj.network = 'Testnet';
} else if (body.network === 'bitcoin') {
chainObj.chain = 'Bitcoin';
chainObj.network = 'Mainnet';
} else if (body.network === 'litecoin') {
chainObj.chain = 'Litecoin';
chainObj.network = 'Mainnet';
} else if (body.network === 'litecoin-testnet') {
chainObj.chain = 'Litecoin';
chainObj.network = 'Testnet';
}
body.chains = [chainObj];
body.uris = [];
if (body.address && body.address.length>0) {
body.address.forEach(addr => {
body.uris.push(body.id + '@' + addr.address + ':' + addr.port);
});
}
res.status(200).json(body);
}
})

View file

@ -17,14 +17,14 @@
<div *ngFor="let channel of allChannels" class="mt-2">
<span class="dashboard-capacity-header" matTooltip="{{channel.alias || channel.id}}" matTooltipDisabled="{{(channel.alias || channel.id).length < 26}}">{{(channel.alias || channel.id) | slice:0:24}}{{(channel.alias || channel.id).length > 25 ? '...' : ''}}</span>
<div fxLayout="row" fxLayoutAlign="space-between start" class="w-100">
<mat-hint fxFlex="40" fxLayoutAlign="start center" class="font-size-90 color-primary"><strong class="font-weight-900 mr-5px">Local:</strong>{{channel.our_channel_reserve_satoshis || 0 | number}} Sats</mat-hint>
<mat-hint fxFlex="40" fxLayoutAlign="start center" class="font-size-90 color-primary"><strong class="font-weight-900 mr-5px">Local:</strong>{{channel.msatoshi_to_us/1000 || 0 | number}} Sats</mat-hint>
<mat-hint fxFlex="20" fxLayoutAlign="center center" class="font-size-90 color-primary">
<fa-icon [icon]="faBalanceScale" class="color-primary mr-3px" matTooltip="Balance Score"></fa-icon>
({{channel.balancedness || 0 | number}})
</mat-hint>
<mat-hint fxFlex="40" fxLayoutAlign="end center" class="font-size-90 color-primary"><strong class="font-weight-900 mr-5px">Remote:</strong>{{channel.their_channel_reserve_satoshis || 0 | number}} Sats</mat-hint>
<mat-hint fxFlex="40" fxLayoutAlign="end center" class="font-size-90 color-primary"><strong class="font-weight-900 mr-5px">Remote:</strong>{{channel.msatoshi_to_them/1000 || 0 | number}} Sats</mat-hint>
</div>
<mat-progress-bar class="dashboard-progress-bar" mode="determinate" value="{{channel.our_channel_reserve_satoshis && channel.our_channel_reserve_satoshis > 0 ? ((+channel.our_channel_reserve_satoshis/((+channel.our_channel_reserve_satoshis)+(+channel.their_channel_reserve_satoshis)))*100) : 0}}"></mat-progress-bar>
<mat-progress-bar class="dashboard-progress-bar" mode="determinate" value="{{channel.msatoshi_to_us && channel.msatoshi_to_us > 0 ? ((+channel.msatoshi_to_us/((+channel.msatoshi_to_us)+(+channel.msatoshi_to_them)))*100) : 0}}"></mat-progress-bar>
</div>
</div>
</div>

View file

@ -10,11 +10,11 @@
<div *ngFor="let channel of allChannels" class="mt-2">
<span class="dashboard-capacity-header" matTooltip="{{channel.alias || channel.id}}" matTooltipDisabled="{{(channel.alias || channel.id).length < 26}}">{{(channel.alias || channel.id) | slice:0:24}}{{(channel.alias || channel.id).length > 25 ? '...' : ''}}</span>
<div fxLayout="row" fxLayoutAlign="space-between start" class="w-100">
<mat-hint *ngIf="direction === 'In'" fxFlex="100" fxLayoutAlign="start center" class="font-size-90 color-primary"><strong class="font-weight-900 mr-5px">Capacity: </strong>{{channel.their_channel_reserve_satoshis || 0 | number}} Sats</mat-hint>
<mat-hint *ngIf="direction === 'Out'" fxFlex="100" fxLayoutAlign="start center" class="font-size-90 color-primary"><strong class="font-weight-900 mr-5px">Capacity: </strong>{{channel.our_channel_reserve_satoshis || 0 | number}} Sats</mat-hint>
<mat-hint *ngIf="direction === 'In'" fxFlex="100" fxLayoutAlign="start center" class="font-size-90 color-primary"><strong class="font-weight-900 mr-5px">Capacity: </strong>{{channel.msatoshi_to_them/1000 || 0 | number}} Sats</mat-hint>
<mat-hint *ngIf="direction === 'Out'" fxFlex="100" fxLayoutAlign="start center" class="font-size-90 color-primary"><strong class="font-weight-900 mr-5px">Capacity: </strong>{{channel.msatoshi_to_us/1000 || 0 | number}} Sats</mat-hint>
</div>
<mat-progress-bar *ngIf="direction === 'In'" class="dashboard-progress-bar" mode="determinate" value="{{(totalLiquidity > 0) ? ((+channel.their_channel_reserve_satoshis || 0)/(totalLiquidity) * 100) : 0}}"></mat-progress-bar>
<mat-progress-bar *ngIf="direction === 'Out'" class="dashboard-progress-bar" mode="determinate" value="{{(totalLiquidity > 0) ? ((+channel.our_channel_reserve_satoshis || 0)/(totalLiquidity) * 100) : 0}}"></mat-progress-bar>
<mat-progress-bar *ngIf="direction === 'In'" class="dashboard-progress-bar" mode="determinate" value="{{(totalLiquidity > 0) ? ((+channel.msatoshi_to_them/1000 || 0)/(totalLiquidity) * 100) : 0}}"></mat-progress-bar>
<mat-progress-bar *ngIf="direction === 'Out'" class="dashboard-progress-bar" mode="determinate" value="{{(totalLiquidity > 0) ? ((+channel.msatoshi_to_us/1000 || 0)/(totalLiquidity) * 100) : 0}}"></mat-progress-bar>
</div>
</div>
</div>

View file

@ -1,4 +1,4 @@
import { Component, OnChanges, Input } from '@angular/core';
import { Component, Input } from '@angular/core';
import { ChannelCL } from '../../../shared/models/clModels';
@ -7,22 +7,11 @@ import { ChannelCL } from '../../../shared/models/clModels';
templateUrl: './channel-liquidity-info.component.html',
styleUrls: ['./channel-liquidity-info.component.scss']
})
export class CLChannelLiquidityInfoComponent implements OnChanges {
export class CLChannelLiquidityInfoComponent {
@Input() direction: string;
@Input() totalLiquidity: number;
@Input() allChannels: ChannelCL[];
public maxAmount = 0;
constructor() {}
ngOnChanges() {
if (this.allChannels && this.allChannels.length > 0) {
if(this.direction === 'In') {
this.maxAmount = +this.allChannels[0].their_channel_reserve_satoshis <= 4294967 ? +this.allChannels[0].their_channel_reserve_satoshis : 4294967;
} else {
this.maxAmount = +this.allChannels[0].our_channel_reserve_satoshis <= 4294967 ? +this.allChannels[0].our_channel_reserve_satoshis : 4294967;
}
}
}
}

View file

@ -3,34 +3,10 @@
<h4 fxLayoutAlign="start" class="dashboard-info-title">Total</h4>
<div class="overflow-wrap dashboard-info-value">{{fees?.feeCollected | number}} Sats</div>
</div>
<!-- <div>
<h4 fxLayoutAlign="start" class="dashboard-info-title">Weekly</h4>
<div class="overflow-wrap dashboard-info-value">{{fees?.feeCollected | number}} Sats</div>
</div>
<div>
<h4 fxLayoutAlign="start" class="dashboard-info-title">Monthly</h4>
<div class="overflow-wrap dashboard-info-value">{{fees?.feeCollected | number}} Sats</div>
</div> -->
<div fxFlex="20">
<h4 class="dashboard-info-title"></h4>
<span class="overflow-wrap dashboard-info-value"></span>
</div>
</div>
<!-- <div fxLayout="column" fxFlex="50" fxLayoutAlign="space-between stretch">
<div fxLayout="column" fxFlex="50" fxLayoutAlign="space-between stretch">
<div>
<h4 fxLayoutAlign="start" class="dashboard-info-title">Transactions</h4>
<div class="overflow-wrap dashboard-info-value">{{fees?.daily_tx_count | number}}</div>
<div class="overflow-wrap dashboard-info-value">{{fees?.totalTxCount | number}}</div>
</div>
<div>
<h4 fxLayoutAlign="start" class="dashboard-info-title">Transactions</h4>
<div class="overflow-wrap dashboard-info-value">{{fees?.weekly_tx_count | number}}</div>
</div>
<div>
<h4 fxLayoutAlign="start" class="dashboard-info-title">Transactions</h4>
<div class="overflow-wrap dashboard-info-value">{{fees?.monthly_tx_count | number}}</div>
</div>
<div fxFlex="20">
<h4 class="dashboard-info-title"></h4>
<span class="overflow-wrap dashboard-info-value"></span>
</div>
</div> -->
</div>

View file

@ -10,7 +10,7 @@ import { faAngleDoubleDown, faAngleDoubleUp, faChartPie, faBolt, faServer, faNet
import { LoggerService } from '../../shared/services/logger.service';
import { CommonService } from '../../shared/services/common.service';
import { UserPersonaEnum, ScreenSizeEnum } from '../../shared/services/consts-enums-functions';
import { ChannelsStatusCL, GetInfoCL, FeesCL, ChannelCL, BalanceCL, LocalRemoteBalanceCL, FeeRatesCL } from '../../shared/models/clModels';
import { ChannelsStatusCL, GetInfoCL, FeesCL, ChannelCL, BalanceCL, FeeRatesCL } from '../../shared/models/clModels';
import { SelNodeChild } from '../../shared/models/RTLconfig';
import * as fromRTLReducer from '../../store/rtl.reducers';
import * as RTLActions from '../../store/rtl.actions';
@ -63,7 +63,7 @@ export class CLHomeComponent implements OnInit, OnDestroy {
this.operatorCards = [
{ id: 'node', icon: this.faServer, title: 'Node Information', cols: 10, rows: 1 },
{ id: 'balance', goTo: 'On-Chain', link: '/cl/onchain', icon: this.faChartPie, title: 'Balances', cols: 10, rows: 1 },
{ id: 'fee', goTo: 'Routing', link: '/cl/routing', icon: this.faBolt, title: 'Routing Fee Report', cols: 10, rows: 1 },
{ id: 'fee', goTo: 'Routing', link: '/cl/routing', icon: this.faBolt, title: 'Routing Fee', cols: 10, rows: 1 },
{ id: 'status', goTo: 'Channels', link: '/cl/peerschannels', icon: this.faNetworkWired, title: 'Channels', cols: 10, rows: 1 },
{ id: 'capacity', goTo: 'Channels', link: '/cl/peerschannels', icon: this.faNetworkWired, title: 'Channels Capacity', cols: 10, rows: 2 }
];
@ -77,7 +77,7 @@ export class CLHomeComponent implements OnInit, OnDestroy {
this.operatorCards = [
{ id: 'node', icon: this.faServer, title: 'Node Information', cols: 5, rows: 1 },
{ id: 'balance', goTo: 'On-Chain', link: '/cl/onchain', icon: this.faChartPie, title: 'Balances', cols: 5, rows: 1 },
{ id: 'fee', goTo: 'Routing', link: '/cl/routing', icon: this.faBolt, title: 'Routing Fee Report', cols: 5, rows: 1 },
{ id: 'fee', goTo: 'Routing', link: '/cl/routing', icon: this.faBolt, title: 'Routing Fee', cols: 5, rows: 1 },
{ id: 'status', goTo: 'Channels', link: '/cl/peerschannels', icon: this.faNetworkWired, title: 'Channels', cols: 5, rows: 1 },
{ id: 'capacity', goTo: 'Channels', link: '/cl/peerschannels', icon: this.faNetworkWired, title: 'Channels Capacity', cols: 10, rows: 2 }
];
@ -94,7 +94,7 @@ export class CLHomeComponent implements OnInit, OnDestroy {
{ id: 'node', icon: this.faServer, title: 'Node Information', cols: 3, rows: 1 },
{ id: 'balance', goTo: 'On-Chain', link: '/cl/onchain', icon: this.faChartPie, title: 'Balances', cols: 3, rows: 1 },
{ id: 'capacity', goTo: 'Channels', link: '/cl/peerschannels', icon: this.faNetworkWired, title: 'Channels Capacity', cols: 4, rows: 2 },
{ id: 'fee', goTo: 'Routing', link: '/cl/routing', icon: this.faBolt, title: 'Routing Fee Report', cols: 3, rows: 1 },
{ id: 'fee', goTo: 'Routing', link: '/cl/routing', icon: this.faBolt, title: 'Routing Fee', cols: 3, rows: 1 },
{ id: 'status', goTo: 'Channels', link: '/cl/peerschannels', icon: this.faNetworkWired, title: 'Channels', cols: 3, rows: 1 }
];
this.merchantCards = [
@ -138,12 +138,16 @@ export class CLHomeComponent implements OnInit, OnDestroy {
}
this.fees = rtlStore.fees;
this.fees.totalTxCount = 0;
if (rtlStore.forwardingHistory && rtlStore.forwardingHistory.forwarding_events && rtlStore.forwardingHistory.forwarding_events.length) {
this.fees.totalTxCount = rtlStore.forwardingHistory.forwarding_events.filter(event => event.status === 'settled').length
}
if (this.flgLoading[1] !== 'error') {
this.flgLoading[1] = (undefined !== this.fees.feeCollected) ? false : true;
}
this.totalBalance = rtlStore.balance;
this.balances.onchain = rtlStore.balance.confBalance;
this.balances.onchain = rtlStore.balance.totalBalance;
this.balances.lightning = rtlStore.localRemoteBalance.localBalance;
this.balances.total = this.balances.lightning + this.balances.onchain;
this.balances = Object.assign({}, this.balances);
@ -176,11 +180,11 @@ export class CLHomeComponent implements OnInit, OnDestroy {
this.totalOutboundLiquidity = 0;
this.allChannels = rtlStore.allChannels.filter(channel => channel.connected);
this.allChannelsCapacity = JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels, 'balancedness')));
this.allInboundChannels = JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels.filter(channel => +channel.their_channel_reserve_satoshis > 0), 'their_channel_reserve_satoshis')));
this.allOutboundChannels = JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels.filter(channel => +channel.our_channel_reserve_satoshis > 0), 'our_channel_reserve_satoshis')));
this.allInboundChannels = JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels.filter(channel => channel.msatoshi_to_them > 0), 'msatoshi_to_them')));
this.allOutboundChannels = JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels.filter(channel => channel.msatoshi_to_us > 0), 'msatoshi_to_us')));
this.allChannels.forEach(channel => {
this.totalInboundLiquidity = this.totalInboundLiquidity + +channel.their_channel_reserve_satoshis;
this.totalOutboundLiquidity = this.totalOutboundLiquidity + +channel.our_channel_reserve_satoshis;
this.totalInboundLiquidity = this.totalInboundLiquidity + channel.msatoshi_to_them;
this.totalOutboundLiquidity = this.totalOutboundLiquidity + channel.msatoshi_to_us;
});
if (this.flgLoading[5] !== 'error') {
this.flgLoading[5] = (this.allChannels && this.allChannels.length) ? false : true;
@ -212,8 +216,8 @@ export class CLHomeComponent implements OnInit, OnDestroy {
if (this.sortField === 'Balance Score') {
this.sortField = 'Capacity';
this.allChannelsCapacity = this.allChannels.sort(function (a, b) {
const x = +a.our_channel_reserve_satoshis + +a.their_channel_reserve_satoshis;
const y = +b.their_channel_reserve_satoshis + +b.their_channel_reserve_satoshis;
const x = +a.msatoshi_to_us + +a.msatoshi_to_them;
const y = +b.msatoshi_to_them + +b.msatoshi_to_them;
return ((x > y) ? -1 : ((x < y) ? 1 : 0));
});
} else {

View file

@ -15,7 +15,7 @@
</div>
<div>
<h4 class="dashboard-info-title">Implementation</h4>
<div class="overflow-wrap dashboard-info-value">{{(information.lnImplementation || information.version) ? information.lnImplementation + ' v' + information.version : ''}}</div>
<div class="overflow-wrap dashboard-info-value">{{(information.lnImplementation || information.version) ? information.lnImplementation + ' ' + information.version : ''}}</div>
</div>
<div>
<h4 class="dashboard-info-title">Chain</h4>

View file

@ -41,22 +41,6 @@ export class CLEffects implements OnDestroy {
.pipe(
map((info) => {
this.logger.info(info);
info.lnImplementation = 'C-Lightning';
let chainObj = { chain: '', network: '' };
if (info.network === 'testnet') {
chainObj.chain = 'Bitcoin';
chainObj.network = 'Testnet';
} else if (info.network === 'bitcoin') {
chainObj.chain = 'Bitcoin';
chainObj.network = 'Mainnet';
} else if (info.network === 'litecoin') {
chainObj.chain = 'Litecoin';
chainObj.network = 'Mainnet';
} else if (info.network === 'litecoin-testnet') {
chainObj.chain = 'Litecoin';
chainObj.network = 'Testnet';
}
info.chains = [chainObj];
this.initializeRemainingData(info, action.payload.loadPage);
return {
type: RTLActions.SET_INFO_CL,
@ -710,6 +694,7 @@ export class CLEffects implements OnDestroy {
alias: info.alias,
testnet: (info.network === 'testnet' || info.network === 'litecoin-testnet') ? true : false,
chains: info.chains,
uris: info.uris,
version: info.version,
currency_unit: 'BTC',
smaller_currency_unit: 'Sats',
@ -723,6 +708,7 @@ export class CLEffects implements OnDestroy {
this.store.dispatch(new RTLActions.FetchFeeRatesCL('perkw'));
this.store.dispatch(new RTLActions.FetchFeeRatesCL('perkb'));
this.store.dispatch(new RTLActions.FetchPeersCL());
this.store.dispatch(new RTLActions.GetForwardingHistoryCL());
let newRoute = this.location.path();
if(newRoute.includes('/lnd/')) {
newRoute = newRoute.replace('/lnd/', '/cl/');

View file

@ -1,4 +1,4 @@
import { Component, OnChanges, Input } from '@angular/core';
import { Component, Input } from '@angular/core';
import { Channel } from '../../../shared/models/lndModels';
@ -7,22 +7,10 @@ import { Channel } from '../../../shared/models/lndModels';
templateUrl: './channel-liquidity-info.component.html',
styleUrls: ['./channel-liquidity-info.component.scss']
})
export class ChannelLiquidityInfoComponent implements OnChanges {
export class ChannelLiquidityInfoComponent {
@Input() direction: string;
@Input() totalLiquidity: number;
@Input() allChannels: Channel[];
public maxAmount = 0;
constructor() {}
ngOnChanges() {
if (this.allChannels && this.allChannels.length > 0) {
if(this.direction === 'In') {
this.maxAmount = this.allChannels[0].remote_balance <= 4294967 ? this.allChannels[0].remote_balance : 4294967;
} else {
this.maxAmount = this.allChannels[0].local_balance <= 4294967 ? this.allChannels[0].local_balance : 4294967;
}
}
}
}

View file

@ -60,7 +60,7 @@ export class HomeComponent implements OnInit, OnDestroy {
this.operatorCards = [
{ id: 'node', icon: this.faServer, title: 'Node Information', cols: 10, rows: 1 },
{ id: 'balance', goTo: 'On-Chain', link: '/lnd/onchain', icon: this.faChartPie, title: 'Balances', cols: 10, rows: 1 },
{ id: 'fee', goTo: 'Routing', link: '/lnd/routing', icon: this.faBolt, title: 'Routing Fee Report', cols: 10, rows: 1 },
{ id: 'fee', goTo: 'Routing', link: '/lnd/routing', icon: this.faBolt, title: 'Routing Fee', cols: 10, rows: 1 },
{ id: 'status', goTo: 'Channels', link: '/lnd/peerschannels', icon: this.faNetworkWired, title: 'Channels', cols: 10, rows: 1 },
{ id: 'capacity', goTo: 'Channels', link: '/lnd/peerschannels', icon: this.faNetworkWired, title: 'Channels Capacity', cols: 10, rows: 2 }
];
@ -74,7 +74,7 @@ export class HomeComponent implements OnInit, OnDestroy {
this.operatorCards = [
{ id: 'node', icon: this.faServer, title: 'Node Information', cols: 5, rows: 1 },
{ id: 'balance', goTo: 'On-Chain', link: '/lnd/onchain', icon: this.faChartPie, title: 'Balances', cols: 5, rows: 1 },
{ id: 'fee', goTo: 'Routing', link: '/lnd/routing', icon: this.faBolt, title: 'Routing Fee Report', cols: 5, rows: 1 },
{ id: 'fee', goTo: 'Routing', link: '/lnd/routing', icon: this.faBolt, title: 'Routing Fee', cols: 5, rows: 1 },
{ id: 'status', goTo: 'Channels', link: '/lnd/peerschannels', icon: this.faNetworkWired, title: 'Channels', cols: 5, rows: 1 },
{ id: 'capacity', goTo: 'Channels', link: '/lnd/peerschannels', icon: this.faNetworkWired, title: 'Channels Capacity', cols: 10, rows: 2 }
];
@ -91,7 +91,7 @@ export class HomeComponent implements OnInit, OnDestroy {
{ id: 'node', icon: this.faServer, title: 'Node Information', cols: 3, rows: 1 },
{ id: 'balance', goTo: 'On-Chain', link: '/lnd/onchain', icon: this.faChartPie, title: 'Balances', cols: 3, rows: 1 },
{ id: 'capacity', goTo: 'Channels', link: '/lnd/peerschannels', icon: this.faNetworkWired, title: 'Channels Capacity', cols: 4, rows: 2 },
{ id: 'fee', goTo: 'Routing', link: '/lnd/routing', icon: this.faBolt, title: 'Routing Fee Report', cols: 3, rows: 1 },
{ id: 'fee', goTo: 'Routing', link: '/lnd/routing', icon: this.faBolt, title: 'Routing Fee', cols: 3, rows: 1 },
{ id: 'status', goTo: 'Channels', link: '/lnd/peerschannels', icon: this.faNetworkWired, title: 'Channels', cols: 3, rows: 1 }
];
this.merchantCards = [

View file

@ -15,7 +15,7 @@
</div>
<div>
<h4 class="dashboard-info-title">Implementation</h4>
<div class="overflow-wrap dashboard-info-value">{{(information.lnImplementation || information.version) ? information.lnImplementation + ' v' + information.version : ''}}</div>
<div class="overflow-wrap dashboard-info-value">{{(information.lnImplementation || information.version) ? information.lnImplementation + ' ' + information.version : ''}}</div>
</div>
<div>
<h4 class="dashboard-info-title">Chain</h4>

View file

@ -46,7 +46,7 @@ export class NetworkInfoComponent implements OnInit, OnDestroy {
this.nodeCards = [
{ id: 'node', icon: this.faServer, title: 'Node Information', cols: 3, rows: 1 },
{ id: 'status', icon: this.faNetworkWired, title: 'Channels', cols: 3, rows: 1 },
{ id: 'fee', icon: this.faBolt, title: 'Routing Fee Report', cols: 3, rows: 1 }
{ id: 'fee', icon: this.faBolt, title: 'Routing Fee', cols: 3, rows: 1 }
];
} else {
this.networkCards = [
@ -57,7 +57,7 @@ export class NetworkInfoComponent implements OnInit, OnDestroy {
this.nodeCards = [
{ id: 'node', icon: this.faServer, title: 'Node Information', cols: 1, rows: 1 },
{ id: 'status', icon: this.faNetworkWired, title: 'Channels', cols: 1, rows: 1 },
{ id: 'fee', icon: this.faBolt, title: 'Routing Fee Report', cols: 1, rows: 1 }
{ id: 'fee', icon: this.faBolt, title: 'Routing Fee', cols: 1, rows: 1 }
];
}
}

View file

@ -50,6 +50,7 @@ export interface GetInfoCL {
export interface FeesCL {
feeCollected?: number;
btc_feeCollected?: number;
totalTxCount?: number;
}
export interface BalanceCL {
@ -195,8 +196,9 @@ export interface ChannelCL {
channel_id?: string;
funding_txid?: string;
private?: boolean;
msatoshi_to_us?: string;
msatoshi_total?: string;
msatoshi_to_us?: number;
msatoshi_to_them?: number;
msatoshi_total?: number;
their_channel_reserve_satoshis?: string;
our_channel_reserve_satoshis?: string;
spendable_msatoshi?: string;