Final Liquidity Ads Updates

Final Liquidity Ads Updates
pull/1056/head
Shahana Farooqui 2 years ago
parent 70abf7af25
commit 428e9a5fd9

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -13,6 +13,6 @@
<style>@font-face{font-family:Roboto;src:url(Roboto-Thin.f7a95c9c5999532c.woff2) format("woff2"),url(Roboto-Thin.c13c157cb81e8ebb.woff) format("woff");font-weight:100;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-ThinItalic.b0e084abf689f393.woff2) format("woff2"),url(Roboto-ThinItalic.1111028df6cea564.woff) format("woff");font-weight:100;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Light.0e01b6cd13b3857f.woff2) format("woff2"),url(Roboto-Light.603ca9a537b88428.woff) format("woff");font-weight:300;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-LightItalic.232ef4b20215f720.woff2) format("woff2"),url(Roboto-LightItalic.1b5e142f787151c8.woff) format("woff");font-weight:300;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Regular.475ba9e4e2d63456.woff2) format("woff2"),url(Roboto-Regular.bcefbfee882bc1cb.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-RegularItalic.e3a9ebdaac06bbc4.woff2) format("woff2"),url(Roboto-RegularItalic.0668fae6af0cf8c2.woff) format("woff");font-weight:400;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Medium.457532032ceb0168.woff2) format("woff2"),url(Roboto-Medium.6e1ae5f0b324a0aa.woff) format("woff");font-weight:500;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-MediumItalic.872f7060602d55d2.woff2) format("woff2"),url(Roboto-MediumItalic.e06fb533801cbb08.woff) format("woff");font-weight:500;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Bold.447291a88c067396.woff2) format("woff2"),url(Roboto-Bold.fc482e6133cf5e26.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BoldItalic.1b15168ef6fa4e16.woff2) format("woff2"),url(Roboto-BoldItalic.e26ba339b06f09f7.woff) format("woff");font-weight:700;font-style:italic}@font-face{font-family:Roboto;src:url(Roboto-Black.2eaa390d458c877d.woff2) format("woff2"),url(Roboto-Black.b25f67ad8583da68.woff) format("woff");font-weight:900;font-style:normal}@font-face{font-family:Roboto;src:url(Roboto-BlackItalic.7dc03ee444552bc5.woff2) format("woff2"),url(Roboto-BlackItalic.c8dc642467cb3099.woff) format("woff");font-weight:900;font-style:italic}html{width:100%;height:99%;line-height:1.5;overflow-x:hidden;font-family:Roboto,sans-serif!important;font-size:62.5%}body{box-sizing:border-box;height:100%;margin:0;overflow:hidden}*{margin:0;padding:0}</style><link rel="stylesheet" href="styles.2872d180f488fe2c.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.2872d180f488fe2c.css"></noscript></head>
<body>
<rtl-app></rtl-app>
<script src="runtime.ab2ec7717d8728af.js" type="module"></script><script src="polyfills.c0773154203456c6.js" type="module"></script><script src="main.f7b1d554d6bf2f0b.js" type="module"></script>
<script src="runtime.6c847084a0e0cbfe.js" type="module"></script><script src="polyfills.c0773154203456c6.js" type="module"></script><script src="main.64033974e336461f.js" type="module"></script>
</body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +1 @@
(()=>{"use strict";var e,v={},g={};function r(e){var n=g[e];if(void 0!==n)return n.exports;var t=g[e]={id:e,loaded:!1,exports:{}};return v[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(n,t,f,o)=>{if(!t){var a=1/0;for(i=0;i<e.length;i++){for(var[t,f,o]=e[i],s=!0,u=0;u<t.length;u++)(!1&o||a>=o)&&Object.keys(r.O).every(b=>r.O[b](t[u]))?t.splice(u--,1):(s=!1,o<a&&(a=o));if(s){e.splice(i--,1);var d=f();void 0!==d&&(n=d)}}return n}o=o||0;for(var i=e.length;i>0&&e[i-1][2]>o;i--)e[i]=e[i-1];e[i]=[t,f,o]},r.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return r.d(n,{a:n}),n},r.d=(e,n)=>{for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((n,t)=>(r.f[t](e,n),n),[])),r.u=e=>e+"."+{564:"b17937ec0876060b",636:"16dbf9186b428247",893:"355edadcb4ce94f4",924:"ff524ffae95c311b"}[e]+".js",r.miniCssF=e=>{},r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={},n="RTLApp:";r.l=(t,f,o,i)=>{if(e[t])e[t].push(f);else{var a,s;if(void 0!==o)for(var u=document.getElementsByTagName("script"),d=0;d<u.length;d++){var l=u[d];if(l.getAttribute("src")==t||l.getAttribute("data-webpack")==n+o){a=l;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",n+o),a.src=r.tu(t)),e[t]=[f];var c=(m,b)=>{a.onerror=a.onload=null,clearTimeout(p);var h=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),h&&h.forEach(_=>_(b)),m)return m(b)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.bind(null,a.onload),s&&document.head.appendChild(a)}}})(),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:n=>n},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={666:0};r.f.j=(f,o)=>{var i=r.o(e,f)?e[f]:void 0;if(0!==i)if(i)o.push(i[2]);else if(666!=f){var a=new Promise((l,c)=>i=e[f]=[l,c]);o.push(i[2]=a);var s=r.p+r.u(f),u=new Error;r.l(s,l=>{if(r.o(e,f)&&(0!==(i=e[f])&&(e[f]=void 0),i)){var c=l&&("load"===l.type?"missing":l.type),p=l&&l.target&&l.target.src;u.message="Loading chunk "+f+" failed.\n("+c+": "+p+")",u.name="ChunkLoadError",u.type=c,u.request=p,i[1](u)}},"chunk-"+f,f)}else e[f]=0},r.O.j=f=>0===e[f];var n=(f,o)=>{var u,d,[i,a,s]=o,l=0;if(i.some(p=>0!==e[p])){for(u in a)r.o(a,u)&&(r.m[u]=a[u]);if(s)var c=s(r)}for(f&&f(o);l<i.length;l++)r.o(e,d=i[l])&&e[d]&&e[d][0](),e[d]=0;return r.O(c)},t=self.webpackChunkRTLApp=self.webpackChunkRTLApp||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))})()})();
(()=>{"use strict";var e,v={},g={};function r(e){var n=g[e];if(void 0!==n)return n.exports;var t=g[e]={id:e,loaded:!1,exports:{}};return v[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=v,e=[],r.O=(n,t,f,o)=>{if(!t){var a=1/0;for(i=0;i<e.length;i++){for(var[t,f,o]=e[i],s=!0,u=0;u<t.length;u++)(!1&o||a>=o)&&Object.keys(r.O).every(b=>r.O[b](t[u]))?t.splice(u--,1):(s=!1,o<a&&(a=o));if(s){e.splice(i--,1);var d=f();void 0!==d&&(n=d)}}return n}o=o||0;for(var i=e.length;i>0&&e[i-1][2]>o;i--)e[i]=e[i-1];e[i]=[t,f,o]},r.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return r.d(n,{a:n}),n},r.d=(e,n)=>{for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((n,t)=>(r.f[t](e,n),n),[])),r.u=e=>e+"."+{564:"4d2583964e4b9c16",636:"16dbf9186b428247",893:"355edadcb4ce94f4",924:"ff524ffae95c311b"}[e]+".js",r.miniCssF=e=>{},r.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),(()=>{var e={},n="RTLApp:";r.l=(t,f,o,i)=>{if(e[t])e[t].push(f);else{var a,s;if(void 0!==o)for(var u=document.getElementsByTagName("script"),d=0;d<u.length;d++){var l=u[d];if(l.getAttribute("src")==t||l.getAttribute("data-webpack")==n+o){a=l;break}}a||(s=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",n+o),a.src=r.tu(t)),e[t]=[f];var c=(m,b)=>{a.onerror=a.onload=null,clearTimeout(p);var h=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),h&&h.forEach(_=>_(b)),m)return m(b)},p=setTimeout(c.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=c.bind(null,a.onerror),a.onload=c.bind(null,a.onload),s&&document.head.appendChild(a)}}})(),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:n=>n},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={666:0};r.f.j=(f,o)=>{var i=r.o(e,f)?e[f]:void 0;if(0!==i)if(i)o.push(i[2]);else if(666!=f){var a=new Promise((l,c)=>i=e[f]=[l,c]);o.push(i[2]=a);var s=r.p+r.u(f),u=new Error;r.l(s,l=>{if(r.o(e,f)&&(0!==(i=e[f])&&(e[f]=void 0),i)){var c=l&&("load"===l.type?"missing":l.type),p=l&&l.target&&l.target.src;u.message="Loading chunk "+f+" failed.\n("+c+": "+p+")",u.name="ChunkLoadError",u.type=c,u.request=p,i[1](u)}},"chunk-"+f,f)}else e[f]=0},r.O.j=f=>0===e[f];var n=(f,o)=>{var u,d,[i,a,s]=o,l=0;if(i.some(p=>0!==e[p])){for(u in a)r.o(a,u)&&(r.m[u]=a[u]);if(s)var c=s(r)}for(f&&f(o);l<i.length;l++)r.o(e,d=i[l])&&e[d]&&e[d][0](),e[d]=0;return r.O(c)},t=self.webpackChunkRTLApp=self.webpackChunkRTLApp||[];t.forEach(n.bind(null,0)),t.push=n.bind(null,t.push.bind(t))})()})();

@ -52,7 +52,7 @@
<ng-container matColumnDef="alias">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Alias </th>
<td mat-cell *matCellDef="let lqNode" [ngStyle]="{'max-width': (screenSize === screenSizeEnum.XS) ? '10rem' : '40rem'}">
{{lqNode?.alias}}
{{lqNode?.alias}}<span *ngIf="lqNode.tor_node" matBadge="Tor Node" matBadgeOverlap="false" class="tab-badge"></span>
</td>
</ng-container>
<ng-container matColumnDef="capacityChannels">

@ -85,7 +85,10 @@ export class CLNLiquidityAdsListComponent implements OnInit, OnDestroy {
if (nodeListRes && !(<any[]>nodeListRes).length) { nodeListRes = []; }
this.logger.info('Received Liquidity Ads Enabled Nodes: ' + JSON.stringify(nodeListRes));
this.apiCallStatus.status = APICallStatusEnum.COMPLETED;
this.liquidityNodesData = (<LookupNode[]>nodeListRes).filter((node) => node.nodeid !== this.information.id);
this.liquidityNodesData = (<LookupNode[]>nodeListRes).filter((node) => {
node.tor_node = (node.addresses) ? node.addresses.filter((addr) => addr?.type?.includes('tor')).length > 0 : false;
return node.nodeid !== this.information.id;
});
this.onCalculateOpeningFee();
this.loadLiqNodesTable(this.liquidityNodesData);
}, error: (err) => {

@ -25,11 +25,11 @@
<mat-hint>Remaining Bal: {{totalBalance - ((localAmount) ? localAmount : 0) | number}}</mat-hint>
<span matSuffix> Sats </span>
<mat-error *ngIf="lamount.errors?.required">Local amount is required.</mat-error>
<mat-error *ngIf="lamount.errors?.min">Local amount must be greater than or equal to 20000.</mat-error>
<mat-error *ngIf="lamount.errors?.min">Local amount must be greater than or equal to 20000. This estimate covers force close fee for the provider.</mat-error>
<mat-error *ngIf="lamount.errors?.max">Local amount must be less than or equal to {{totalBalance}}.</mat-error>
</mat-form-field>
</div>
<div fxFlex="100" class="alert alert-info mt-2">
<div fxFlex="100" class="alert alert-info mt-4">
<span>Total cost to lease {{node.channelOpeningFee | number}} (Sats)</span>
</div>
<div fxFlex="100" class="alert alert-danger mt-2" *ngIf="channelConnectionError !== ''">

@ -24,7 +24,7 @@ export class CLNOpenLiquidityChannelComponent implements OnInit, OnDestroy {
@ViewChild('form', { static: true }) form: any;
public alertTitle: string;
public totalBalance = 0;
public node: LookupNode;
public node: LookupNode = {};
public requestedAmount = 0;
public feeRate = 0;
public localAmount = 0;
@ -35,12 +35,12 @@ export class CLNOpenLiquidityChannelComponent implements OnInit, OnDestroy {
constructor(public dialogRef: MatDialogRef<CLNOpenLiquidityChannelComponent>, @Inject(MAT_DIALOG_DATA) public data: CLNOpenLiquidityChannelAlert, private actions: Actions, private store: Store<RTLState>) { }
ngOnInit() {
this.alertTitle = this.data.alertTitle;
this.totalBalance = this.data.message.balance;
this.node = this.data.message.node;
this.requestedAmount = this.data.message.requestedAmount;
this.feeRate = this.data.message.feeRate;
this.localAmount = this.data.message.localAmount;
this.alertTitle = this.data.alertTitle || '';
this.totalBalance = this.data.message?.balance || 0;
this.node = this.data.message?.node || {};
this.requestedAmount = this.data.message?.requestedAmount || 0;
this.feeRate = this.data.message?.feeRate || 0;
this.localAmount = this.data.message?.localAmount || 0;
this.actions.pipe(
takeUntil(this.unSubs[0]),
filter((action) => action.type === CLNActions.UPDATE_API_CALL_STATUS_CLN || action.type === CLNActions.FETCH_CHANNELS_CLN)).
@ -60,28 +60,28 @@ export class CLNOpenLiquidityChannelComponent implements OnInit, OnDestroy {
resetData() {
this.form.resetForm();
this.form.controls.ramount.setValue(this.data.message.requestedAmount);
this.form.controls.feerate.setValue(this.data.message.feeRate);
this.form.controls.lamount.setValue(this.data.message.localAmount);
this.form.controls.ramount.setValue(this.data.message?.requestedAmount);
this.form.controls.feerate.setValue(this.data.message?.feeRate);
this.form.controls.lamount.setValue(this.data.message?.localAmount);
this.calculateFee();
this.channelConnectionError = '';
}
calculateFee() {
this.node.channelOpeningFee = (+(this.node.option_will_fund.lease_fee_base_msat) / 1000) + (this.requestedAmount * (+this.node.option_will_fund.lease_fee_basis) / 10000) + ((+this.node.option_will_fund.funding_weight / 4) * this.feeRate);
this.node.channelOpeningFee = (+(this.node.option_will_fund?.lease_fee_base_msat || 0) / 1000) + (this.requestedAmount * (+(this.node.option_will_fund?.lease_fee_basis || 0)) / 10000) + ((+(this.node.option_will_fund?.funding_weight || 0) / 4) * this.feeRate);
}
onOpenChannel(): boolean | void {
if (!this.node || !this.node.option_will_fund || !this.requestedAmount || !this.feeRate || !this.localAmount) {
if (!this.node || !this.node.option_will_fund || !this.requestedAmount || !this.feeRate || !this.localAmount || this.localAmount < 20000) {
return true;
}
const newChannel = { peerId: this.node.nodeid, satoshis: this.localAmount.toString(), feeRate: this.feeRate + 'perkb', requestAmount: this.requestedAmount.toString(), compactLease: this.node.option_will_fund.compact_lease };
const newChannel = { peerId: this.node.nodeid || '', satoshis: this.localAmount.toString(), feeRate: this.feeRate + 'perkb', requestAmount: this.requestedAmount.toString(), compactLease: this.node.option_will_fund.compact_lease };
this.store.dispatch(saveNewChannel({ payload: newChannel }));
}
ngOnDestroy() {
this.unSubs.forEach((completeSub) => {
completeSub.next(null);
completeSub.next(<any>null);
completeSub.complete();
});
}

@ -78,7 +78,11 @@
<mat-error *ngIf="!channelFeeMaxProportional">Max channel routing fee rate is required.</mat-error>
</mat-form-field>
</div>
<h4 *ngIf="flgUpdateCalled" fxLayoutAlign="start" class="font-bold-500 mt-2">{{(updateMsg.error && updateMsg.error !== '') ? (('Error: ' + updateMsg.error) || 'Unknown Error') : ((updateMsg) || 'Successfully Updated the Funding Policy!')}}</h4>
<h4 *ngIf="flgUpdateCalled" fxLayoutAlign="start stretch" class="font-bold-500 mt-2">
<span fxFlex="100" class="alert" [ngClass]="{'alert-danger': !!updateMsg.error, 'alert-info': !!updateMsg.data}">
{{(updateMsg.error && updateMsg.error !== '') ? (('Error: ' + updateMsg.error) || 'Unknown Error') : (updateMsg.data && updateMsg.data !== '') ? updateMsg.data : 'Successfully Updated the Funding Policy!'}}
</span>
</h4>
<div fxLayout="row" class="my-1">
<button class="mr-1" mat-stroked-button color="primary" (click)="onResetPolicy()" tabindex="7">Reset</button>
<button mat-flat-button color="primary" (click)="onUpdateFundingPolicy()" tabindex="8">Update</button>

@ -13,6 +13,7 @@ import { setChildNodeSettingsLND } from '../../../../lnd/store/lnd.actions';
import { setChildNodeSettingsCL } from '../../../../cln/store/cln.actions';
import { setChildNodeSettingsECL } from '../../../../eclair/store/ecl.actions';
import { DataService } from '../../../services/data.service';
import { CommonService } from '../../../services/common.service';
import { ServicesEnum, UI_MESSAGES, LADS_POLICY } from '../../../services/consts-enums-functions';
import { balance } from '../../../../cln/store/cln.selector';
import { Balance, FunderPolicy } from '../../../models/clnModels';
@ -31,20 +32,20 @@ export class ExperimentalSettingsComponent implements OnInit, OnDestroy {
public features = [{ name: 'Offers', enabled: false }, { name: 'Channel Funding Policy', enabled: false }];
public enableOffers = false;
public selNode: ConfigSettingsNode;
public fundingPolicy: FunderPolicy = null;
public fundingPolicy: FunderPolicy = {};
public policyTypes = LADS_POLICY;
public selPolicyType = LADS_POLICY[0];
public policyMod: number;
public leaseFeeBaseSat: number;
public leaseFeeBasis: number;
public channelFeeMaxBaseSat: number;
public channelFeeMaxProportional: number;
public policyMod: number | null;
public leaseFeeBaseSat: number | null;
public leaseFeeBasis: number | null;
public channelFeeMaxBaseSat: number | null;
public channelFeeMaxProportional: number | null;
public flgUpdateCalled = false;
public updateMsg = '';
public updateMsg: { error?: string } | { data?: string } = {};
private unSubs: Array<Subject<void>> = [new Subject(), new Subject(), new Subject(), new Subject(), new Subject()];
constructor(private logger: LoggerService, private store: Store<RTLState>, private dataService: DataService) { }
constructor(private logger: LoggerService, private store: Store<RTLState>, private dataService: DataService, private commonService: CommonService) { }
ngOnInit() {
this.dataService.listConfigs().pipe(takeUntil(this.unSubs[0])).subscribe({
@ -59,7 +60,7 @@ export class ExperimentalSettingsComponent implements OnInit, OnDestroy {
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[1])).
subscribe((selNode) => {
this.selNode = selNode;
this.enableOffers = this.selNode.settings.enableOffers;
this.enableOffers = this.selNode.settings.enableOffers || false;
this.features[0].enabled = this.enableOffers;
this.logger.info(this.selNode);
});
@ -70,12 +71,12 @@ export class ExperimentalSettingsComponent implements OnInit, OnDestroy {
}
onPanelExpanded(panelId: number) {
if (panelId === 1 && !this.fundingPolicy) {
if (panelId === 1 && !this.fundingPolicy.policy) {
this.dataService.getOrUpdateFunderPolicy().pipe(takeUntil(this.unSubs[3])).subscribe((res: any) => {
this.logger.info('Received Funder Update Policy: ' + JSON.stringify(res));
this.fundingPolicy = res;
if (this.fundingPolicy.policy) {
this.selPolicyType = LADS_POLICY.find((policy) => policy.id === this.fundingPolicy.policy);
this.selPolicyType = LADS_POLICY.find((policy) => policy.id === this.fundingPolicy.policy) || this.policyTypes[0];
}
this.policyMod = this.fundingPolicy.policy_mod || this.fundingPolicy.policy_mod === 0 ? this.fundingPolicy.policy_mod : null;
this.leaseFeeBaseSat = this.fundingPolicy.lease_fee_base_msat ? this.fundingPolicy.lease_fee_base_msat / 1000 : this.fundingPolicy.lease_fee_base_msat === 0 ? 0 : null;
@ -112,28 +113,29 @@ export class ExperimentalSettingsComponent implements OnInit, OnDestroy {
}
onUpdateFundingPolicy() {
this.flgUpdateCalled = false;
this.updateMsg = '';
this.dataService.getOrUpdateFunderPolicy(this.selPolicyType.id, this.policyMod, this.leaseFeeBaseSat, this.leaseFeeBasis, this.channelFeeMaxBaseSat * 1000, this.channelFeeMaxProportional / 1000).
this.flgUpdateCalled = true;
this.updateMsg = {};
this.dataService.getOrUpdateFunderPolicy(this.selPolicyType.id, this.policyMod, this.leaseFeeBaseSat, this.leaseFeeBasis, (this.channelFeeMaxBaseSat || 0) * 1000, this.channelFeeMaxProportional ? this.channelFeeMaxProportional / 1000 : 0).
pipe(takeUntil(this.unSubs[4])).
subscribe({
next: (updatePolicyRes: any) => {
this.logger.info(updatePolicyRes);
this.fundingPolicy = updatePolicyRes;
this.onResetPolicy();
this.updateMsg = 'Compact Lease: ' + updatePolicyRes.compact_lease;
this.updateMsg = { data: 'Compact Lease: ' + updatePolicyRes.compact_lease };
setTimeout(() => { this.flgUpdateCalled = false; }, 5000);
}, error: (err) => {
this.logger.error(err);
this.updateMsg = JSON.stringify(err.error.error.message);
this.updateMsg = { error: this.commonService.extractErrorMessage(err, 'Error in updating funder policy') };
setTimeout(() => { this.flgUpdateCalled = false; }, 5000);
}
});
}
onResetPolicy() {
this.flgUpdateCalled = false;
this.updateMsg = '';
this.updateMsg = {};
if (this.fundingPolicy.policy) {
this.selPolicyType = LADS_POLICY.find((policy) => policy.id === this.fundingPolicy.policy);
this.selPolicyType = LADS_POLICY.find((policy) => policy.id === this.fundingPolicy.policy) || this.policyTypes[0];
} else {
this.selPolicyType = LADS_POLICY[0];
}
@ -146,7 +148,7 @@ export class ExperimentalSettingsComponent implements OnInit, OnDestroy {
ngOnDestroy() {
this.unSubs.forEach((completeSub) => {
completeSub.next(null);
completeSub.next(<any>null);
completeSub.complete();
});
}

@ -346,6 +346,7 @@ export interface LookupNode {
alias?: string;
color?: string;
last_timestamp?: number;
tor_node?: boolean;
features?: string;
channelCount?: number;
nodeCapacity?: number;

@ -308,7 +308,7 @@ export class CommonService implements OnDestroy {
extractErrorMessage(err: any, genericErrorMessage: string = 'Unknown Error.') {
const msg = this.titleCase(
(err.error.text && typeof err.error.text === 'string' && err.error.text.includes('<!DOCTYPE html><html lang="en">')) ? 'API Route Does Not Exist.' :
(err.error && err.error.text && typeof err.error.text === 'string' && err.error.text.includes('<!DOCTYPE html><html lang="en">')) ? 'API Route Does Not Exist.' :
(err.error && err.error.error && err.error.error.error && err.error.error.error.error && err.error.error.error.error.error && typeof err.error.error.error.error.error === 'string') ? err.error.error.error.error.error :
(err.error && err.error.error && err.error.error.error && err.error.error.error.error && typeof err.error.error.error.error === 'string') ? err.error.error.error.error :
(err.error && err.error.error && err.error.error.error && typeof err.error.error.error === 'string') ? err.error.error.error :

@ -319,10 +319,10 @@ export class DataService implements OnDestroy {
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[11]),
map((res) => {
map((res: any) => {
this.store.dispatch(closeSpinner({ payload: UI_MESSAGES.GET_FUNDER_POLICY }));
if (postParams) {
this.store.dispatch(openSnackBar({ payload: 'Funder Policy Updated Successfully!' }));
this.store.dispatch(openSnackBar({ payload: 'Funder Policy Updated Successfully with Compact Lease: ' + res.compact_lease + '!' }));
}
return res;
}), catchError((err) => {

Loading…
Cancel
Save