All: Removed child node settings

pull/1382/head
ShahanaFarooqui 2 weeks ago
parent 80dc699a18
commit 502932fb70

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

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

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
(()=>{"use strict";var e,v={},m={};function r(e){var d=m[e];if(void 0!==d)return d.exports;var t=m[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=(d,t,i,f)=>{if(!t){var a=1/0;for(n=0;n<e.length;n++){for(var[t,i,f]=e[n],s=!0,o=0;o<t.length;o++)(!1&f||a>=f)&&Object.keys(r.O).every(b=>r.O[b](t[o]))?t.splice(o--,1):(s=!1,f<a&&(a=f));if(s){e.splice(n--,1);var u=i();void 0!==u&&(d=u)}}return d}f=f||0;for(var n=e.length;n>0&&e[n-1][2]>f;n--)e[n]=e[n-1];e[n]=[t,i,f]},r.d=(e,d)=>{for(var t in d)r.o(d,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:d[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((d,t)=>(r.f[t](e,d),d),[])),r.u=e=>e+"."+{125:"cb20f4b15dc644e7",456:"4e5a06b45d3c8f64",570:"255349a168f6c523",758:"db0aa17832e6073d"}[e]+".js",r.miniCssF=e=>{},r.o=(e,d)=>Object.prototype.hasOwnProperty.call(e,d),(()=>{var e={},d="RTLApp:";r.l=(t,i,f,n)=>{if(e[t])e[t].push(i);else{var a,s;if(void 0!==f)for(var o=document.getElementsByTagName("script"),u=0;u<o.length;u++){var l=o[u];if(l.getAttribute("src")==t||l.getAttribute("data-webpack")==d+f){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",d+f),a.src=r.tu(t)),e[t]=[i];var c=(g,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(y=>y(b)),g)return g(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=>{typeof Symbol<"u"&&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:d=>d},typeof trustedTypes<"u"&&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=(i,f)=>{var n=r.o(e,i)?e[i]:void 0;if(0!==n)if(n)f.push(n[2]);else if(666!=i){var a=new Promise((l,c)=>n=e[i]=[l,c]);f.push(n[2]=a);var s=r.p+r.u(i),o=new Error;r.l(s,l=>{if(r.o(e,i)&&(0!==(n=e[i])&&(e[i]=void 0),n)){var c=l&&("load"===l.type?"missing":l.type),p=l&&l.target&&l.target.src;o.message="Loading chunk "+i+" failed.\n("+c+": "+p+")",o.name="ChunkLoadError",o.type=c,o.request=p,n[1](o)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var d=(i,f)=>{var o,u,[n,a,s]=f,l=0;if(n.some(p=>0!==e[p])){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(s)var c=s(r)}for(i&&i(f);l<n.length;l++)r.o(e,u=n[l])&&e[u]&&e[u][0](),e[u]=0;return r.O(c)},t=self.webpackChunkRTLApp=self.webpackChunkRTLApp||[];t.forEach(d.bind(null,0)),t.push=d.bind(null,t.push.bind(t))})()})();

@ -1 +0,0 @@
(()=>{"use strict";var e,v={},m={};function r(e){var f=m[e];if(void 0!==f)return f.exports;var t=m[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=(f,t,i,o)=>{if(!t){var a=1/0;for(n=0;n<e.length;n++){for(var[t,i,o]=e[n],s=!0,d=0;d<t.length;d++)(!1&o||a>=o)&&Object.keys(r.O).every(b=>r.O[b](t[d]))?t.splice(d--,1):(s=!1,o<a&&(a=o));if(s){e.splice(n--,1);var u=i();void 0!==u&&(f=u)}}return f}o=o||0;for(var n=e.length;n>0&&e[n-1][2]>o;n--)e[n]=e[n-1];e[n]=[t,i,o]},r.d=(e,f)=>{for(var t in f)r.o(f,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:f[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((f,t)=>(r.f[t](e,f),f),[])),r.u=e=>e+"."+{125:"3d2fff0dc042e6f8",456:"526382858b470223",570:"12d89c463aa15a79",758:"db0aa17832e6073d"}[e]+".js",r.miniCssF=e=>{},r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),(()=>{var e={},f="RTLApp:";r.l=(t,i,o,n)=>{if(e[t])e[t].push(i);else{var a,s;if(void 0!==o)for(var d=document.getElementsByTagName("script"),u=0;u<d.length;u++){var l=d[u];if(l.getAttribute("src")==t||l.getAttribute("data-webpack")==f+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",f+o),a.src=r.tu(t)),e[t]=[i];var c=(g,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(y=>y(b)),g)return g(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=>{typeof Symbol<"u"&&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:f=>f},typeof trustedTypes<"u"&&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=(i,o)=>{var n=r.o(e,i)?e[i]:void 0;if(0!==n)if(n)o.push(n[2]);else if(666!=i){var a=new Promise((l,c)=>n=e[i]=[l,c]);o.push(n[2]=a);var s=r.p+r.u(i),d=new Error;r.l(s,l=>{if(r.o(e,i)&&(0!==(n=e[i])&&(e[i]=void 0),n)){var c=l&&("load"===l.type?"missing":l.type),p=l&&l.target&&l.target.src;d.message="Loading chunk "+i+" failed.\n("+c+": "+p+")",d.name="ChunkLoadError",d.type=c,d.request=p,n[1](d)}},"chunk-"+i,i)}else e[i]=0},r.O.j=i=>0===e[i];var f=(i,o)=>{var d,u,[n,a,s]=o,l=0;if(n.some(p=>0!==e[p])){for(d in a)r.o(a,d)&&(r.m[d]=a[d]);if(s)var c=s(r)}for(i&&i(o);l<n.length;l++)r.o(e,u=n[l])&&e[u]&&e[u][0](),e[u]=0;return r.O(c)},t=self.webpackChunkRTLApp=self.webpackChunkRTLApp||[];t.forEach(f.bind(null,0)),t.push=f.bind(null,t.push.bind(t))})()})();

@ -14,6 +14,7 @@ import { LoggerService } from '../../shared/services/logger.service';
import { CommonService } from '../../shared/services/common.service';
import { RTLState } from '../../store/rtl.state';
import { rootSelectedNode } from '../../store/rtl.selector';
import { channels, utxoBalances, nodeInfoAndAPIsStatus } from '../store/cln.selector';
export interface Tile {
@ -117,21 +118,22 @@ export class CLNHomeComponent implements OnInit, OnDestroy {
}
ngOnInit() {
this.store.select(nodeInfoAndAPIsStatus).pipe(takeUntil(this.unSubs[0])).
subscribe((infoSettingsStatusSelector: { information: GetInfo, nodeSettings: Node | null, fees: Fees, apisCallStatus: ApiCallStatusPayload[] }) => {
this.store.select(nodeInfoAndAPIsStatus).pipe(takeUntil(this.unSubs[0]),
withLatestFrom(this.store.select(rootSelectedNode))).
subscribe(([infoFeeStatusSelector, nodeSettings]: [{ information: GetInfo, fees: Fees, apisCallStatus: ApiCallStatusPayload[] }, Node | null]) => {
this.errorMessages[0] = '';
this.errorMessages[3] = '';
this.apiCallStatusNodeInfo = infoSettingsStatusSelector.apisCallStatus[0];
this.apiCallStatusFHistory = infoSettingsStatusSelector.apisCallStatus[1];
this.apiCallStatusNodeInfo = infoFeeStatusSelector.apisCallStatus[0];
this.apiCallStatusFHistory = infoFeeStatusSelector.apisCallStatus[1];
if (this.apiCallStatusNodeInfo.status === APICallStatusEnum.ERROR) {
this.errorMessages[0] = !this.apiCallStatusNodeInfo.message ? '' : (typeof (this.apiCallStatusNodeInfo.message) === 'object') ? JSON.stringify(this.apiCallStatusNodeInfo.message) : this.apiCallStatusNodeInfo.message;
}
if (this.apiCallStatusFHistory.status === APICallStatusEnum.ERROR) {
this.errorMessages[3] = !this.apiCallStatusFHistory.message ? '' : (typeof (this.apiCallStatusFHistory.message) === 'object') ? JSON.stringify(this.apiCallStatusFHistory.message) : this.apiCallStatusFHistory.message;
}
this.selNode = infoSettingsStatusSelector.nodeSettings;
this.information = infoSettingsStatusSelector.information;
this.fees = infoSettingsStatusSelector.fees;
this.selNode = nodeSettings;
this.information = infoFeeStatusSelector.information;
this.fees = infoFeeStatusSelector.fees;
});
this.store.select(channels).pipe(takeUntil(this.unSubs[2])).
subscribe((channelsSeletor: { activeChannels: Channel[], pendingChannels: Channel[], inactiveChannels: Channel[], apiCallStatus: ApiCallStatusPayload }) => {

@ -9,9 +9,7 @@ import { PageSettings } from '../../shared/models/pageSettings';
export const updateCLNAPICallStatus = createAction(CLNActions.UPDATE_API_CALL_STATUS_CLN, props<{ payload: ApiCallStatusPayload }>());
export const resetCLNStore = createAction(CLNActions.RESET_CLN_STORE, props<{ payload: Node | null }>());
export const setChildNodeSettingsCLN = createAction(CLNActions.SET_CHILD_NODE_SETTINGS_CLN, props<{ payload: Node }>());
export const resetCLNStore = createAction(CLNActions.RESET_CLN_STORE);
export const fetchPageSettings = createAction(CLNActions.FETCH_PAGE_SETTINGS_CLN);

@ -2,9 +2,9 @@ import { createReducer, on } from '@ngrx/store';
import { initCLNState } from './cln.state';
import {
addInvoice, addPeer, removeChannel, removePeer, resetCLNStore, setChannels,
setChildNodeSettingsCLN, setFeeRates, setForwardingHistory,
setInfo, setInvoices, setOffers, addOffer, setPayments, setPeers, setUTXOBalances,
updateCLNAPICallStatus, updateInvoice, updateOffer, setOfferBookmarks, addUpdateOfferBookmark, removeOfferBookmark, setPageSettings
setFeeRates, setForwardingHistory, setInfo, setInvoices, setOffers, addOffer,
setPayments, setPeers, setUTXOBalances, updateCLNAPICallStatus, updateInvoice,
updateOffer, setOfferBookmarks, addUpdateOfferBookmark, removeOfferBookmark, setPageSettings
} from './cln.actions';
import { Channel, OfferBookmark } from '../../shared/models/clnModels';
import { CLNForwardingEventsStatusEnum, CLN_DEFAULT_PAGE_SETTINGS } from '../../shared/services/consts-enums-functions';
@ -27,13 +27,8 @@ export const CLNReducer = createReducer(initCLNState,
apisCallStatus: updatedApisCallStatus
};
}),
on(setChildNodeSettingsCLN, (state, { payload }) => ({
...state,
nodeSettings: payload
})),
on(resetCLNStore, (state, { payload }) => ({
...initCLNState,
nodeSettings: payload
on(resetCLNStore, (state) => ({
...initCLNState
})),
on(setInfo, (state, { payload }) => ({
...state,

@ -1,14 +1,7 @@
import { APICallStatusEnum, CLN_DEFAULT_PAGE_SETTINGS, UserPersonaEnum } from '../../shared/services/consts-enums-functions';
import { APICallStatusEnum, CLN_DEFAULT_PAGE_SETTINGS } from '../../shared/services/consts-enums-functions';
import { GetInfo, Fees, Balance, LocalRemoteBalance, Peer, Payment, Channel, FeeRates, ListInvoices, UTXO, Offer, OfferBookmark, ListForwards } from '../../shared/models/clnModels';
import { ApiCallsListCL } from '../../shared/models/apiCallsPayload';
import { PageSettings } from '../../shared/models/pageSettings';
import { Authentication, Node, Settings } from '../../shared/models/RTLconfig';
const initNodeSettings: Settings = { userPersona: UserPersonaEnum.OPERATOR, themeMode: 'DAY', themeColor: 'PURPLE',
channelBackupPath: '', selCurrencyUnit: 'USD', unannouncedChannels: false, fiatConversion: false,
currencyUnits: ['Sats', 'BTC', 'USD'], bitcoindConfigPath: '', enableOffers: false, enablePeerswap: false,
logLevel: 'ERROR', lnServerUrl: '', swapServerUrl: '', boltzServerUrl: '', currencyUnit: 'USD' };
const initNodeAuthentication: Authentication = { configPath: '', swapMacaroonPath: '', boltzMacaroonPath: '' };
export interface CLNState {
apisCallStatus: ApiCallsListCL;

@ -14,7 +14,8 @@ import { ApiCallStatusPayload } from '../../shared/models/apiCallsPayload';
import { Node } from '../../shared/models/RTLconfig';
import { RTLState } from '../../store/rtl.state';
import { allChannelsInfo, eclNodeSettings, fees, nodeInfoStatus, onchainBalance } from '../store/ecl.selector';
import { rootSelectedNode } from '../../store/rtl.selector';
import { allChannelsInfo, fees, nodeInfoStatus, onchainBalance } from '../store/ecl.selector';
export interface Tile {
id: string;
@ -117,7 +118,7 @@ export class ECLHomeComponent implements OnInit, OnDestroy {
}
ngOnInit() {
this.store.select(eclNodeSettings).pipe(takeUntil(this.unSubs[0])).
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[0])).
subscribe((nodeSettings) => {
this.selNode = nodeSettings;
});

@ -8,8 +8,9 @@ import { faExchangeAlt, faChartPie } from '@fortawesome/free-solid-svg-icons';
import { ECLOnChainSendModalComponent } from './on-chain-send-modal/on-chain-send-modal.component';
import { Node } from '../../shared/models/RTLconfig';
import { RTLState } from '../../store/rtl.state';
import { rootSelectedNode } from '../../store/rtl.selector';
import { openAlert } from '../../store/rtl.actions';
import { eclNodeSettings, onchainBalance } from '../store/ecl.selector';
import { onchainBalance } from '../store/ecl.selector';
import { OnChainBalance } from '../../shared/models/eclModels';
import { ApiCallStatusPayload } from '../../shared/models/apiCallsPayload';
@ -40,7 +41,7 @@ export class ECLOnChainComponent implements OnInit, OnDestroy {
this.activeLink = linkFound ? linkFound.link : this.links[0].link;
}
});
this.store.select(eclNodeSettings).pipe(takeUntil(this.unSubs[1])).
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[1])).
subscribe((nodeSettings) => {
this.selNode = nodeSettings;
});

@ -11,7 +11,8 @@ import { Node } from '../../../../shared/models/RTLconfig';
import { RTLState } from '../../../../store/rtl.state';
import { openAlert } from '../../../../store/rtl.actions';
import { allChannelsInfo, eclNodeInformation, eclNodeSettings, onchainBalance, peers } from '../../../store/ecl.selector';
import { rootSelectedNode } from '../../../../store/rtl.selector';
import { allChannelsInfo, eclNodeInformation, onchainBalance, peers } from '../../../store/ecl.selector';
import { ApiCallStatusPayload } from '../../../../shared/models/apiCallsPayload';
@Component({
@ -49,7 +50,7 @@ export class ECLChannelsTablesComponent implements OnInit, OnDestroy {
this.numOfInactiveChannels = (allChannelsSelector.channelsStatus && allChannelsSelector.channelsStatus.inactive && allChannelsSelector.channelsStatus.inactive.channels) ? allChannelsSelector.channelsStatus.inactive.channels : 0;
this.logger.info(allChannelsSelector);
});
this.store.select(eclNodeSettings).pipe(takeUntil(this.unSubs[2])).
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[2])).
subscribe((nodeSettings: Node | null) => {
this.selNode = nodeSettings;
});

@ -12,9 +12,9 @@ import { APICallStatusEnum, ECLActions } from '../../../../shared/services/const
import { ECLOpenChannelAlert } from '../../../../shared/models/alertData';
import { RTLState } from '../../../../store/rtl.state';
import { rootSelectedNode } from '../../../../store/rtl.selector';
import { saveNewChannel } from '../../../store/ecl.actions';
import { Node } from '../../../../shared/models/RTLconfig';
import { eclNodeSettings } from '../../../store/ecl.selector';
@Component({
selector: 'rtl-ecl-open-channel',
@ -57,7 +57,7 @@ export class ECLOpenChannelComponent implements OnInit, OnDestroy {
this.peers = [];
}
this.alertTitle = this.data.alertTitle || 'Alert';
this.store.select(eclNodeSettings).pipe(takeUntil(this.unSubs[0])).
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[0])).
subscribe((nodeSettings: Node | null) => {
this.selNode = nodeSettings;
this.isPrivate = !!nodeSettings?.settings.unannouncedChannels;

@ -15,7 +15,7 @@ import { LoggerService } from '../../../shared/services/logger.service';
import { RTLState } from '../../../store/rtl.state';
import { saveNewChannel, saveNewPeer } from '../../store/ecl.actions';
import { eclNodeSettings } from '../../store/ecl.selector';
import { rootSelectedNode } from '../../../store/rtl.selector';
import { Node } from '../../../shared/models/RTLconfig';
@Component({
@ -66,7 +66,7 @@ export class ECLConnectPeerComponent implements OnInit, OnDestroy {
hiddenAmount: ['', [Validators.required]]
});
this.statusFormGroup = this.formBuilder.group({});
this.store.select(eclNodeSettings).pipe(takeUntil(this.unSubs[0])).
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[0])).
subscribe((nodeSettings: Node | null) => {
this.selNode = nodeSettings;
this.channelFormGroup.controls.isPrivate.setValue(!!nodeSettings?.settings.unannouncedChannels);

@ -10,9 +10,7 @@ import { PageSettings } from '../../shared/models/pageSettings';
export const updateECLAPICallStatus = createAction(ECLActions.UPDATE_API_CALL_STATUS_ECL, props<{ payload: ApiCallStatusPayload }>());
export const resetECLStore = createAction(ECLActions.RESET_ECL_STORE, props<{ payload: Node | null }>());
export const setChildNodeSettingsECL = createAction(ECLActions.SET_CHILD_NODE_SETTINGS_ECL, props<{ payload: Node }>());
export const resetECLStore = createAction(ECLActions.RESET_ECL_STORE);
export const fetchPageSettings = createAction(ECLActions.FETCH_PAGE_SETTINGS_ECL);

@ -1,7 +1,7 @@
import { createReducer, on } from '@ngrx/store';
import { initECLState } from './ecl.state';
import { addInvoice, removeChannel, removePeer, resetECLStore, setActiveChannels, setChannelsStatus, setChildNodeSettingsECL,
import { addInvoice, removeChannel, removePeer, resetECLStore, setActiveChannels, setChannelsStatus,
setFees, setInactiveChannels, setInfo, setInvoices, setLightningBalance, setOnchainBalance, setPayments, setPeers, setPendingChannels,
setTransactions, updateECLAPICallStatus, updateChannelState, updateInvoice, updateRelayedPayment, setPageSettings } from './ecl.actions';
import { Channel, PaymentReceived, PaymentRelayed } from '../../shared/models/eclModels';
@ -25,13 +25,8 @@ export const ECLReducer = createReducer(initECLState,
apisCallStatus: updatedApisCallStatus
};
}),
on(setChildNodeSettingsECL, (state, { payload }) => ({
...state,
nodeSettings: payload
})),
on(resetECLStore, (state, { payload }) => ({
...initECLState,
nodeSettings: payload
on(resetECLStore, (state) => ({
...initECLState
})),
on(setInfo, (state, { payload }) => ({
...state,

@ -2,7 +2,6 @@ import { createFeatureSelector, createSelector } from '@ngrx/store';
import { ECLState } from './ecl.state';
export const eclState = createFeatureSelector<ECLState>('ecl');
export const eclNodeSettings = createSelector(eclState, (state: ECLState) => state.nodeSettings);
export const eclPageSettings = createSelector(eclState, (state: ECLState) => ({ pageSettings: state.pageSettings, apiCallStatus: state.apisCallStatus.FetchPageSettings }));
export const eclNodeInformation = createSelector(eclState, (state: ECLState) => state.information);
export const nodeInfoStatus = createSelector(eclState, (state: ECLState) => ({ information: state.information, apiCallStatus: state.apisCallStatus.FetchInfo }));

@ -1,18 +1,10 @@
import { Authentication, Node, Settings } from '../../shared/models/RTLconfig';
import { GetInfo, Channel, Fees, OnChainBalance, LightningBalance, Peer, ChannelsStatus, Payments, Transaction, Invoice } from '../../shared/models/eclModels';
import { ApiCallsListECL } from '../../shared/models/apiCallsPayload';
import { APICallStatusEnum, ECL_DEFAULT_PAGE_SETTINGS, UserPersonaEnum } from '../../shared/services/consts-enums-functions';
import { APICallStatusEnum, ECL_DEFAULT_PAGE_SETTINGS } from '../../shared/services/consts-enums-functions';
import { PageSettings } from '../../shared/models/pageSettings';
const initNodeSettings: Settings = { userPersona: UserPersonaEnum.OPERATOR, themeMode: 'DAY', themeColor: 'PURPLE',
channelBackupPath: '', selCurrencyUnit: 'USD', unannouncedChannels: false, fiatConversion: false,
currencyUnits: ['Sats', 'BTC', 'USD'], bitcoindConfigPath: '', enableOffers: false, enablePeerswap: false,
logLevel: 'ERROR', lnServerUrl: '', swapServerUrl: '', boltzServerUrl: '', currencyUnit: 'USD' };
const initNodeAuthentication: Authentication = { configPath: '', swapMacaroonPath: '', boltzMacaroonPath: '' };
export interface ECLState {
apisCallStatus: ApiCallsListECL;
nodeSettings: Node | null;
pageSettings: PageSettings[];
information: GetInfo;
fees: Fees;
@ -40,7 +32,6 @@ export const initECLState: ECLState = {
FetchInvoices: { status: APICallStatusEnum.UN_INITIATED },
FetchTransactions: { status: APICallStatusEnum.UN_INITIATED }
},
nodeSettings: { index: 1, lnNode: 'Node 1', settings: initNodeSettings, authentication: initNodeAuthentication, lnImplementation: 'ECL' },
pageSettings: ECL_DEFAULT_PAGE_SETTINGS,
information: {},
fees: {},

@ -14,8 +14,9 @@ import { GetInfo } from '../../../shared/models/eclModels';
import { CommonService } from '../../../shared/services/common.service';
import { RTLState } from '../../../store/rtl.state';
import { rootSelectedNode } from '../../../store/rtl.selector';
import { createInvoice } from '../../store/ecl.actions';
import { eclNodeInformation, eclNodeSettings } from '../../store/ecl.selector';
import { eclNodeInformation } from '../../store/ecl.selector';
import { ConvertedCurrency } from '../../../shared/models/rtlModels';
@Component({
@ -47,7 +48,7 @@ export class ECLCreateInvoiceComponent implements OnInit, OnDestroy {
ngOnInit() {
this.pageSize = this.data.pageSize;
this.store.select(eclNodeSettings).pipe(takeUntil(this.unSubs[0])).
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[0])).
subscribe((nodeSettings: Node | null) => {
this.selNode = nodeSettings;
});

@ -21,9 +21,10 @@ import { ECLCreateInvoiceComponent } from '../create-invoice-modal/create-invoic
import { ECLInvoiceInformationComponent } from '../invoice-information-modal/invoice-information.component';
import { RTLState } from '../../../store/rtl.state';
import { rootSelectedNode } from '../../../store/rtl.selector';
import { openAlert } from '../../../store/rtl.actions';
import { createInvoice, invoiceLookup } from '../../store/ecl.actions';
import { eclNodeInformation, eclNodeSettings, eclPageSettings, invoices } from '../../store/ecl.selector';
import { eclNodeInformation, eclPageSettings, invoices } from '../../store/ecl.selector';
import { ColumnDefinition, PageSettings, TableSetting } from '../../../shared/models/pageSettings';
import { CamelCaseWithSpacesPipe } from '../../../shared/pipes/app.pipe';
import { ConvertedCurrency } from '../../../shared/models/rtlModels';
@ -76,7 +77,7 @@ export class ECLLightningInvoicesComponent implements OnInit, AfterViewInit, OnD
}
ngOnInit() {
this.store.select(eclNodeSettings).pipe(takeUntil(this.unSubs[0])).
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[0])).
subscribe((nodeSettings: Node | null) => {
this.selNode = nodeSettings;
});

@ -22,9 +22,10 @@ import { Node } from '../../../shared/models/RTLconfig';
import { RTLEffects } from '../../../store/rtl.effects';
import { RTLState } from '../../../store/rtl.state';
import { rootSelectedNode } from '../../../store/rtl.selector';
import { openAlert, openConfirmation } from '../../../store/rtl.actions';
import { sendPayment } from '../../store/ecl.actions';
import { eclNodeInformation, eclNodeSettings, eclPageSettings, payments } from '../../store/ecl.selector';
import { eclNodeInformation, eclPageSettings, payments } from '../../store/ecl.selector';
import { ColumnDefinition, PageSettings, TableSetting } from '../../../shared/models/pageSettings';
import { CamelCaseWithSpacesPipe } from '../../../shared/pipes/app.pipe';
import { ConvertedCurrency } from '../../../shared/models/rtlModels';
@ -77,7 +78,7 @@ export class ECLLightningPaymentsComponent implements OnInit, AfterViewInit, OnD
}
ngOnInit() {
this.store.select(eclNodeSettings).pipe(takeUntil(this.unSubs[0])).
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[0])).
subscribe((nodeSettings: Node | null) => {
this.selNode = nodeSettings;
});

@ -17,8 +17,9 @@ import { DataService } from '../../../shared/services/data.service';
import { ECLEffects } from '../../store/ecl.effects';
import { RTLState } from '../../../store/rtl.state';
import { rootSelectedNode } from '../../../store/rtl.selector';
import { sendPayment } from '../../store/ecl.actions';
import { allChannelsInfo, eclNodeSettings } from '../../store/ecl.selector';
import { allChannelsInfo } from '../../store/ecl.selector';
import { ApiCallStatusPayload } from '../../../shared/models/apiCallsPayload';
import { ConvertedCurrency } from '../../../shared/models/rtlModels';
@ -50,7 +51,7 @@ export class ECLLightningSendPaymentsComponent implements OnInit, OnDestroy {
constructor(public dialogRef: MatDialogRef<ECLLightningSendPaymentsComponent>, private store: Store<RTLState>, private eclEffects: ECLEffects, private logger: LoggerService, private commonService: CommonService, private decimalPipe: DecimalPipe, private actions: Actions, private dataService: DataService) { }
ngOnInit() {
this.store.select(eclNodeSettings).pipe(takeUntil(this.unSubs[0])).
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[0])).
subscribe((nodeSettings: Node | null) => {
this.selNode = nodeSettings;
});

@ -8,7 +8,8 @@ import { faExchangeAlt, faChartPie } from '@fortawesome/free-solid-svg-icons';
import { UserPersonaEnum } from '../../shared/services/consts-enums-functions';
import { LoggerService } from '../../shared/services/logger.service';
import { RTLState } from '../../store/rtl.state';
import { eclNodeSettings, allChannelsInfo } from '../store/ecl.selector';
import { rootSelectedNode } from '../../store/rtl.selector';
import { allChannelsInfo } from '../store/ecl.selector';
import { Channel, ChannelsStatus, LightningBalance } from '../../shared/models/eclModels';
import { ApiCallStatusPayload } from '../../shared/models/apiCallsPayload';
import { Node } from '../../shared/models/RTLconfig';
@ -41,7 +42,7 @@ export class ECLTransactionsComponent implements OnInit, OnDestroy {
}
});
this.store.select(allChannelsInfo).pipe(takeUntil(this.unSubs[1]),
withLatestFrom(this.store.select(eclNodeSettings))).
withLatestFrom(this.store.select(rootSelectedNode))).
subscribe(([allChannels, nodeSettings]: [{ activeChannels: Channel[], pendingChannels: Channel[], inactiveChannels: Channel[], lightningBalance: LightningBalance, channelsStatus: ChannelsStatus, apiCallStatus: ApiCallStatusPayload }, (Node | null)]) => {
this.currencyUnits = nodeSettings?.settings.currencyUnits || [];
if (nodeSettings && nodeSettings.settings.userPersona === UserPersonaEnum.OPERATOR) {

@ -9,6 +9,8 @@ import { ChannelInformationComponent } from '../../peers-channels/channels/chann
import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { MAT_SELECT_CONFIG } from '@angular/material/select';
import { Node } from '../../../shared/models/RTLconfig';
import { Channel, ChannelsSummary, LightningBalance } from '../../../shared/models/lndModels';
import { PAGE_SIZE, PAGE_SIZE_OPTIONS, getPaginatorLabel, ScreenSizeEnum, APICallStatusEnum, UI_MESSAGES, LNDActions, RTLActions } from '../../../shared/services/consts-enums-functions';
@ -17,10 +19,10 @@ import { LoggerService } from '../../../shared/services/logger.service';
import { CommonService } from '../../../shared/services/common.service';
import { RTLState } from '../../../store/rtl.state';
import { rootSelectedNode } from '../../../store/rtl.selector';
import { fetchFile, openAlert } from '../../../store/rtl.actions';
import { backupChannels, verifyChannel } from '../../store/lnd.actions';
import { channels, lndNodeSettings } from '../../store/lnd.selector';
import { MAT_SELECT_CONFIG } from '@angular/material/select';
import { channels } from '../../store/lnd.selector';
@Component({
selector: 'rtl-channel-backup-table',
@ -58,7 +60,7 @@ export class ChannelBackupTableComponent implements OnInit, AfterViewInit, OnDes
}
ngOnInit() {
this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: Node | null) => { this.selNode = nodeSettings; });
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: Node | null) => { this.selNode = nodeSettings; });
this.store.select(channels).pipe(takeUntil(this.unSubs[1])).
subscribe((channelsSeletor: { channels: Channel[], channelsSummary: ChannelsSummary, lightningBalance: LightningBalance, apiCallStatus: ApiCallStatusPayload }) => {
this.errorMessage = '';

@ -14,8 +14,8 @@ import { CommonService } from '../../../shared/services/common.service';
import { LNDEffects } from '../../store/lnd.effects';
import { RTLState } from '../../../store/rtl.state';
import { rootSelectedNode } from '../../../store/rtl.selector';
import { restoreChannels, restoreChannelsList } from '../../store/lnd.actions';
import { lndNodeSettings } from '../../store/lnd.selector';
@Component({
selector: 'rtl-channel-restore-table',
@ -49,7 +49,7 @@ export class ChannelRestoreTableComponent implements OnInit, AfterViewInit, OnDe
ngOnInit() {
this.store.dispatch(restoreChannelsList());
this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: Node | null) => { this.selNode = nodeSettings; });
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: Node | null) => { this.selNode = nodeSettings; });
this.lndEffects.setRestoreChannelList.pipe(takeUntil(this.unSubs[1])).
subscribe((resRCList) => {
this.allRestoreExists = resRCList.all_restore_exists;

@ -12,8 +12,8 @@ import { CommonService } from '../../../shared/services/common.service';
import { RTLState } from '../../../store/rtl.state';
import { openAlert } from '../../../store/rtl.actions';
import { rootSelectedNode } from '../../../store/rtl.selector';
import { Node } from '../../../shared/models/RTLconfig';
import { lndNodeSettings } from '../../store/lnd.selector';
@Component({
selector: 'rtl-channel-liquidity-info',
@ -36,7 +36,7 @@ export class ChannelLiquidityInfoComponent implements OnInit, OnDestroy {
ngOnInit() {
this.screenSize = this.commonService.getScreenSize();
this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: Node | null) => {
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: Node | null) => {
this.showLoop = !!((nodeSettings?.settings.swapServerUrl && nodeSettings.settings.swapServerUrl.trim() !== ''));
});
}

@ -1,7 +1,7 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Router } from '@angular/router';
import { Subject } from 'rxjs';
import { takeUntil, filter } from 'rxjs/operators';
import { takeUntil, filter, withLatestFrom } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { Actions } from '@ngrx/effects';
import { faSmile, faFrown } from '@fortawesome/free-regular-svg-icons';
@ -15,7 +15,8 @@ import { ChannelsStatus, GetInfo, Fees, Channel, BlockchainBalance, PendingChann
import { Node } from '../../shared/models/RTLconfig';
import { RTLState } from '../../store/rtl.state';
import { blockchainBalance, channels, fees, nodeInfoAndNodeSettingsAndAPIStatus, pendingChannels } from '../store/lnd.selector';
import { rootSelectedNode } from 'src/app/store/rtl.selector';
import { blockchainBalance, channels, fees, nodeInfoAndAPIStatus, pendingChannels } from '../store/lnd.selector';
export interface Tile {
id: string;
@ -144,15 +145,16 @@ export class HomeComponent implements OnInit, OnDestroy {
}
ngOnInit() {
this.store.select(nodeInfoAndNodeSettingsAndAPIStatus).pipe(takeUntil(this.unSubs[0])).
subscribe((infoSettingsStatusSelector: { information: GetInfo, nodeSettings: Node | null, apiCallStatus: ApiCallStatusPayload }) => {
this.store.select(nodeInfoAndAPIStatus).pipe(takeUntil(this.unSubs[0]),
withLatestFrom(this.store.select(rootSelectedNode))).
subscribe(([infoStatusSelector, nodeSettings]: [{ information: GetInfo | null, apiCallStatus: ApiCallStatusPayload }, nodeSettings: Node]) => {
this.errorMessages[0] = '';
this.apiCallStatusNodeInfo = infoSettingsStatusSelector.apiCallStatus;
this.apiCallStatusNodeInfo = infoStatusSelector.apiCallStatus;
if (this.apiCallStatusNodeInfo.status === APICallStatusEnum.ERROR) {
this.errorMessages[0] = (typeof (this.apiCallStatusNodeInfo.message) === 'object') ? JSON.stringify(this.apiCallStatusNodeInfo.message) : this.apiCallStatusNodeInfo.message ? this.apiCallStatusNodeInfo.message : '';
}
this.selNode = infoSettingsStatusSelector.nodeSettings;
this.information = infoSettingsStatusSelector.information;
this.selNode = nodeSettings;
this.information = infoStatusSelector.information;
});
this.store.select(fees).pipe(takeUntil(this.unSubs[1])).
subscribe((feesSelector: { fees: Fees, apiCallStatus: ApiCallStatusPayload }) => {

@ -1,6 +1,6 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { takeUntil, withLatestFrom } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { faProjectDiagram, faBolt, faServer, faNetworkWired } from '@fortawesome/free-solid-svg-icons';
@ -9,10 +9,11 @@ import { GetInfo, NetworkInfo, Fees, ChannelsStatus, PendingChannels, PendingCha
import { Node } from '../../shared/models/RTLconfig';
import { CommonService } from '../../shared/services/common.service';
import { APICallStatusEnum, ScreenSizeEnum, UserPersonaEnum } from '../../shared/services/consts-enums-functions';
import { ApiCallsListLND, ApiCallStatusPayload } from '../../shared/models/apiCallsPayload';
import { ApiCallStatusPayload } from '../../shared/models/apiCallsPayload';
import { RTLState } from '../../store/rtl.state';
import { channels, fees, networkInfo, nodeInfoAndNodeSettingsAndAPIStatus, pendingChannels } from '../store/lnd.selector';
import { rootSelectedNode } from 'src/app/store/rtl.selector';
import { channels, fees, networkInfo, pendingChannels, nodeInfoAndAPIStatus } from '../store/lnd.selector';
@Component({
selector: 'rtl-network-info',
@ -72,15 +73,16 @@ export class NetworkInfoComponent implements OnInit, OnDestroy {
}
ngOnInit() {
this.store.select(nodeInfoAndNodeSettingsAndAPIStatus).pipe(takeUntil(this.unSubs[0])).
subscribe((infoSettingsStatusSelector: { information: GetInfo, nodeSettings: Node | null, apiCallStatus: ApiCallStatusPayload }) => {
this.store.select(nodeInfoAndAPIStatus).pipe(takeUntil(this.unSubs[0]),
withLatestFrom(this.store.select(rootSelectedNode))).
subscribe(([infoStatusSelector, nodeSettings]: [{ information: GetInfo | null, apiCallStatus: ApiCallStatusPayload }, nodeSettings: Node]) => {
this.errorMessages[0] = '';
this.apiCallStatusNodeInfo = infoSettingsStatusSelector.apiCallStatus;
this.apiCallStatusNodeInfo = infoStatusSelector.apiCallStatus;
if (this.apiCallStatusNodeInfo.status === APICallStatusEnum.ERROR) {
this.errorMessages[0] = (typeof (this.apiCallStatusNodeInfo.message) === 'object') ? JSON.stringify(this.apiCallStatusNodeInfo.message) : this.apiCallStatusNodeInfo.message ? this.apiCallStatusNodeInfo.message : '';
}
this.selNode = infoSettingsStatusSelector.nodeSettings;
this.information = infoSettingsStatusSelector.information;
this.selNode = nodeSettings;
this.information = infoStatusSelector.information;
});
this.store.select(networkInfo).pipe(takeUntil(this.unSubs[1])).
subscribe((networkInfoSelector: { networkInfo: NetworkInfo, apiCallStatus: ApiCallStatusPayload }) => {

@ -7,7 +7,8 @@ import { faExchangeAlt, faChartPie } from '@fortawesome/free-solid-svg-icons';
import { Node } from '../../shared/models/RTLconfig';
import { RTLState } from '../../store/rtl.state';
import { blockchainBalance, lndNodeSettings } from '../store/lnd.selector';
import { rootSelectedNode } from '../../store/rtl.selector';
import { blockchainBalance } from '../store/lnd.selector';
import { ApiCallStatusPayload } from '../../shared/models/apiCallsPayload';
import { BlockchainBalance } from '../../shared/models/lndModels';
@ -42,7 +43,7 @@ export class OnChainComponent implements OnInit, OnDestroy {
this.selectedTable = this.tables.find((table) => table.name === (<ResolveEnd>value).urlAfterRedirects.substring((<ResolveEnd>value).urlAfterRedirects.lastIndexOf('/') + 1)) || this.tables[0];
}
});
this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[1])).
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[1])).
subscribe((nodeSettings: Node | null) => {
this.selNode = nodeSettings;
});

@ -7,6 +7,7 @@ import { MatPaginator, MatPaginatorIntl } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { faEye, faEyeSlash } from '@fortawesome/free-solid-svg-icons';
import { MAT_SELECT_CONFIG } from '@angular/material/select';
import { ChannelInformationComponent } from '../../channel-information-modal/channel-information.component';
import { Node } from '../../../../../shared/models/RTLconfig';
@ -23,12 +24,12 @@ import { LoopModalComponent } from '../../../../../shared/components/ln-services
import { LNDEffects } from '../../../../store/lnd.effects';
import { RTLEffects } from '../../../../../store/rtl.effects';
import { RTLState } from '../../../../../store/rtl.state';
import { rootSelectedNode } from '../../../../../store/rtl.selector';
import { openAlert, openConfirmation } from '../../../../../store/rtl.actions';
import { channelLookup, fetchChannels, updateChannel } from '../../../../store/lnd.actions';
import { blockchainBalance, channels, lndNodeInformation, lndNodeSettings, lndPageSettings, peers } from '../../../../store/lnd.selector';
import { blockchainBalance, channels, lndNodeInformation, lndPageSettings, peers } from '../../../../store/lnd.selector';
import { ColumnDefinition, PageSettings, TableSetting } from '../../../../../shared/models/pageSettings';
import { CamelCaseWithReplacePipe } from '../../../../../shared/pipes/app.pipe';
import { MAT_SELECT_CONFIG } from '@angular/material/select';
@Component({
selector: 'rtl-channel-open-table',
@ -89,7 +90,7 @@ export class ChannelOpenTableComponent implements OnInit, AfterViewInit, OnDestr
this.selFilterBy = window.history.state.filterColumn || 'all';
this.selFilter = window.history.state.filterValue || '';
}
this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[0])).
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[0])).
subscribe((nodeSettings) => {
this.selNode = nodeSettings;
});

@ -5,6 +5,9 @@ import { Store } from '@ngrx/store';
import { MatSort } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { MAT_SELECT_CONFIG } from '@angular/material/select';
import { MatPaginatorIntl } from '@angular/material/paginator';
import { Channel, GetInfo, PendingChannels, PendingClosingChannel, PendingForceClosingChannel, PendingOpenChannel, WaitingCloseChannel } from '../../../../../shared/models/lndModels';
import { AlertTypeEnum, APICallStatusEnum, DataTypeEnum, getPaginatorLabel, LND_DEFAULT_PAGE_SETTINGS, PAGE_SIZE, ScreenSizeEnum, SortOrderEnum } from '../../../../../shared/services/consts-enums-functions';
import { ApiCallStatusPayload } from '../../../../../shared/models/apiCallsPayload';
@ -15,10 +18,9 @@ import { BumpFeeComponent } from '../../bump-fee-modal/bump-fee.component';
import { openAlert } from '../../../../../store/rtl.actions';
import { RTLState } from '../../../../../store/rtl.state';
import { lndNodeInformation, lndNodeSettings, lndPageSettings, pendingChannels } from '../../../../store/lnd.selector';
import { rootSelectedNode } from '../../../../../store/rtl.selector';
import { lndNodeInformation, lndPageSettings, pendingChannels } from '../../../../store/lnd.selector';
import { PageSettings, TableSetting } from '../../../../../shared/models/pageSettings';
import { MAT_SELECT_CONFIG } from '@angular/material/select';
import { MatPaginatorIntl } from '@angular/material/paginator';
@Component({
selector: 'rtl-channel-pending-table',
@ -64,7 +66,7 @@ export class ChannelPendingTableComponent implements OnInit, AfterViewInit, OnDe
}
ngOnInit() {
this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: Node | null) => { this.selNode = nodeSettings; });
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: Node | null) => { this.selNode = nodeSettings; });
this.store.select(lndNodeInformation).pipe(takeUntil(this.unSubs[1])).subscribe((nodeInfo: GetInfo) => { this.information = nodeInfo; });
this.store.select(lndPageSettings).pipe(takeUntil(this.unSubs[2])).
subscribe((settings: { pageSettings: PageSettings[], apiCallStatus: ApiCallStatusPayload }) => {

@ -12,9 +12,9 @@ import { OpenChannelAlert } from '../../../../shared/models/alertData';
import { APICallStatusEnum, LNDActions, TRANS_TYPES } from '../../../../shared/services/consts-enums-functions';
import { RTLState } from '../../../../store/rtl.state';
import { rootSelectedNode } from '../../../../store/rtl.selector';
import { saveNewChannel } from '../../../store/lnd.actions';
import { Node } from '../../../../shared/models/RTLconfig';
import { lndNodeSettings } from '../../../store/lnd.selector';
import { CommonService } from '../../../../shared/services/common.service';
@Component({
@ -66,7 +66,7 @@ export class OpenChannelComponent implements OnInit, OnDestroy {
this.isTaprootAvailable = false;
}
this.alertTitle = this.data.alertTitle || 'Alert';
this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[0])).
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[0])).
subscribe((nodeSettings: Node | null) => {
this.selNode = nodeSettings;
this.isPrivate = !!nodeSettings?.settings.unannouncedChannels;

@ -1,7 +1,7 @@
import { Component, OnInit, OnDestroy, ViewChild, Inject } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms';
import { Subject } from 'rxjs';
import { take, takeUntil, filter } from 'rxjs/operators';
import { take, takeUntil, filter, withLatestFrom } from 'rxjs/operators';
import { Store } from '@ngrx/store';
import { Actions } from '@ngrx/effects';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
@ -15,8 +15,9 @@ import { APICallStatusEnum, LNDActions, TRANS_TYPES } from '../../../shared/serv
import { LNDEffects } from '../../store/lnd.effects';
import { RTLState } from '../../../store/rtl.state';
import { rootSelectedNode } from '../../../store/rtl.selector';
import { fetchGraphNode, saveNewChannel, saveNewPeer } from '../../store/lnd.actions';
import { nodeInfoAndNodeSettingsAndAPIStatus } from '../../store/lnd.selector';
import { nodeInfoAndAPIStatus } from '../../store/lnd.selector';
import { Node } from '../../../shared/models/RTLconfig';
import { CommonService } from '../../../shared/services/common.service';
import { ApiCallStatusPayload } from '../../../shared/models/apiCallsPayload';
@ -70,11 +71,12 @@ export class ConnectPeerComponent implements OnInit, OnDestroy {
hiddenAmount: ['', [Validators.required]]
});
this.statusFormGroup = this.formBuilder.group({});
this.store.select(nodeInfoAndNodeSettingsAndAPIStatus).pipe(takeUntil(this.unSubs[0])).
subscribe((infoSettingsStatusSelector: { information: GetInfo, nodeSettings: Node | null, apiCallStatus: ApiCallStatusPayload }) => {
this.selNode = infoSettingsStatusSelector.nodeSettings;
this.channelFormGroup.controls.isPrivate.setValue(!!infoSettingsStatusSelector.nodeSettings?.settings.unannouncedChannels);
this.isTaprootAvailable = this.commonService.isVersionCompatible(infoSettingsStatusSelector.information.version, '0.17.0');
this.store.select(nodeInfoAndAPIStatus).pipe(takeUntil(this.unSubs[0]),
withLatestFrom(this.store.select(rootSelectedNode))).
subscribe(([infoStatusSelector, nodeSettings]: [{ information: GetInfo | null, apiCallStatus: ApiCallStatusPayload }, nodeSettings: Node]) => {
this.selNode = nodeSettings;
this.channelFormGroup.controls.isPrivate.setValue(!!nodeSettings?.settings.unannouncedChannels);
this.isTaprootAvailable = this.commonService.isVersionCompatible(infoStatusSelector.information.version, '0.17.0');
});
this.channelFormGroup.controls.selTransType.valueChanges.pipe(takeUntil(this.unSubs[1])).subscribe((transType) => {
if (transType === TRANS_TYPES[0].id) {

@ -9,7 +9,8 @@ import { Node } from '../../shared/models/RTLconfig';
import { LoggerService } from '../../shared/services/logger.service';
import { RTLState } from '../../store/rtl.state';
import { blockchainBalance, channels, lndNodeSettings, peers } from '../store/lnd.selector';
import { rootSelectedNode } from '../../store/rtl.selector';
import { blockchainBalance, channels, peers } from '../store/lnd.selector';
import { ApiCallStatusPayload } from '../../shared/models/apiCallsPayload';
import { BlockchainBalance, Channel, ChannelsSummary, LightningBalance, Peer } from '../../shared/models/lndModels';
@ -40,7 +41,7 @@ export class ConnectionsComponent implements OnInit, OnDestroy {
this.activeLink = this.links.findIndex((link) => link.link === (<ResolveEnd>value).urlAfterRedirects.substring((<ResolveEnd>value).urlAfterRedirects.lastIndexOf('/') + 1));
}
});
this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[1])).subscribe((nodeSettings: Node | null) => { this.selNode = nodeSettings; });
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[1])).subscribe((nodeSettings: Node | null) => { this.selNode = nodeSettings; });
this.store.select(peers).pipe(takeUntil(this.unSubs[2])).
subscribe((peersSelector: { peers: Peer[], apiCallStatus: ApiCallStatusPayload }) => {
this.activePeers = (peersSelector.peers && peersSelector.peers.length) ? peersSelector.peers.length : 0;

@ -13,9 +13,7 @@ import { PageSettings } from '../../shared/models/pageSettings';
export const updateLNDAPICallStatus = createAction(LNDActions.UPDATE_API_CALL_STATUS_LND, props<{ payload: ApiCallStatusPayload }>());
export const resetLNDStore = createAction(LNDActions.RESET_LND_STORE, props<{ payload: Node | null }>());
export const setChildNodeSettingsLND = createAction(LNDActions.SET_CHILD_NODE_SETTINGS_LND, props<{ payload: Node }>());
export const resetLNDStore = createAction(LNDActions.RESET_LND_STORE);
export const fetchPageSettings = createAction(LNDActions.FETCH_PAGE_SETTINGS_LND);

@ -2,7 +2,7 @@ import { createReducer, on } from '@ngrx/store';
import { initLNDState } from './lnd.state';
import { addInvoice, removeChannel, removePeer, resetLNDStore, setChannels, setAllLightningTransactions, setBalanceBlockchain,
setChildNodeSettingsLND, setClosedChannels, setFees, setForwardingHistory, setInfo, setInvoices, setNetwork, setPayments, setPeers,
setClosedChannels, setFees, setForwardingHistory, setInfo, setInvoices, setNetwork, setPayments, setPeers,
setPendingChannels, setTransactions, setUTXOs, updateLNDAPICallStatus, updateInvoice, updatePayment, setPageSettings } from './lnd.actions';
import { Channel, ClosedChannel, SetAllLightningTransactions } from '../../shared/models/lndModels';
import { PageSettings } from '../../shared/models/pageSettings';
@ -28,13 +28,8 @@ export const LNDReducer = createReducer(initLNDState,
apisCallStatus: updatedApisCallStatus
};
}),
on(setChildNodeSettingsLND, (state, { payload }) => ({
...state,
nodeSettings: payload
})),
on(resetLNDStore, (state, { payload }) => ({
...initLNDState,
nodeSettings: payload
on(resetLNDStore, (state) => ({
...initLNDState
})),
on(setInfo, (state, { payload }) => ({
...state,

@ -2,7 +2,6 @@ import { createFeatureSelector, createSelector } from '@ngrx/store';
import { LNDState } from './lnd.state';
export const lndState = createFeatureSelector<LNDState>('lnd');
export const lndNodeSettings = createSelector(lndState, (state: LNDState) => state.nodeSettings);
export const lndPageSettings = createSelector(lndState, (state: LNDState) => ({ pageSettings: state.pageSettings, apiCallStatus: state.apisCallStatus.FetchPageSettings }));
export const lndNodeInformation = createSelector(lndState, (state: LNDState) => state.information);
export const nodeInfoStatus = createSelector(lndState, (state: LNDState) => ({ information: state.information, apiCallStatus: state.apisCallStatus.FetchInfo }));
@ -23,4 +22,4 @@ export const utxos = createSelector(lndState, (state: LNDState) => ({ utxos: sta
export const networkInfo = createSelector(lndState, (state: LNDState) => ({ networkInfo: state.networkInfo, apiCallStatus: state.apisCallStatus.FetchNetwork }));
export const allLightningTransactions = createSelector(lndState, (state: LNDState) => ({ allLightningTransactions: state.allLightningTransactions, apiCallStatus: state.apisCallStatus.FetchLightningTransactions }));
export const allChannels = createSelector(lndState, (state: LNDState) => ({ channels: state.channels, pendingChannels: state.pendingChannels, closedChannels: state.closedChannels }));
export const nodeInfoAndNodeSettingsAndAPIStatus = createSelector(lndState, (state: LNDState) => ({ information: state.information, nodeSettings: state.nodeSettings, apiCallStatus: state.apisCallStatus.FetchInfo }));
export const nodeInfoAndAPIStatus = createSelector(lndState, (state: LNDState) => ({ information: state.information, apiCallStatus: state.apisCallStatus.FetchInfo }));

@ -1,18 +1,10 @@
import { Authentication, Node, Settings } from '../../shared/models/RTLconfig';
import { ApiCallsListLND } from '../../shared/models/apiCallsPayload';
import { APICallStatusEnum, LND_DEFAULT_PAGE_SETTINGS, UserPersonaEnum } from '../../shared/services/consts-enums-functions';
import { APICallStatusEnum, LND_DEFAULT_PAGE_SETTINGS } from '../../shared/services/consts-enums-functions';
import { GetInfo, Peer, Fees, NetworkInfo, BlockchainBalance, Channel, ListInvoices, PendingChannels, ClosedChannel, Transaction, SwitchRes, PendingChannelsSummary, UTXO, ListPayments, LightningBalance, ChannelsSummary } from '../../shared/models/lndModels';
import { PageSettings } from '../../shared/models/pageSettings';
const initNodeSettings: Settings = { userPersona: UserPersonaEnum.OPERATOR, themeMode: 'DAY', themeColor: 'PURPLE',
channelBackupPath: '', selCurrencyUnit: 'USD', unannouncedChannels: false, fiatConversion: false,
currencyUnits: ['Sats', 'BTC', 'USD'], bitcoindConfigPath: '', enableOffers: false, enablePeerswap: false,
logLevel: 'ERROR', lnServerUrl: '', swapServerUrl: '', boltzServerUrl: '', currencyUnit: 'USD' };
const initNodeAuthentication: Authentication = { configPath: '', swapMacaroonPath: '', boltzMacaroonPath: '' };
export interface LNDState {
apisCallStatus: ApiCallsListLND;
nodeSettings: Node | null;
pageSettings: PageSettings[];
information: GetInfo;
peers: Peer[];
@ -51,7 +43,6 @@ export const initLNDState: LNDState = {
FetchLightningTransactions: { status: APICallStatusEnum.UN_INITIATED },
FetchNetwork: { status: APICallStatusEnum.UN_INITIATED }
},
nodeSettings: { index: 1, lnNode: 'Node 1', settings: initNodeSettings, authentication: initNodeAuthentication, lnImplementation: 'LND' },
pageSettings: LND_DEFAULT_PAGE_SETTINGS,
information: {},
peers: [],

@ -14,8 +14,9 @@ import { GetInfo } from '../../../shared/models/lndModels';
import { CommonService } from '../../../shared/services/common.service';
import { RTLState } from '../../../store/rtl.state';
import { rootSelectedNode } from '../../../store/rtl.selector';
import { saveNewInvoice } from '../../store/lnd.actions';
import { lndNodeInformation, lndNodeSettings } from '../../store/lnd.selector';
import { lndNodeInformation } from '../../store/lnd.selector';
import { ConvertedCurrency } from '../../../shared/models/rtlModels';
@Component({
@ -48,7 +49,7 @@ export class CreateInvoiceComponent implements OnInit, OnDestroy {
ngOnInit() {
this.pageSize = this.data.pageSize;
this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: Node | null) => { this.selNode = nodeSettings; });
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: Node | null) => { this.selNode = nodeSettings; });
this.store.select(lndNodeInformation).pipe(takeUntil(this.unSubs[1])).subscribe((nodeInfo: GetInfo) => { this.information = nodeInfo; });
this.actions.pipe(takeUntil(this.unSubs[2]),
filter((action) => action.type === LNDActions.UPDATE_API_CALL_STATUS_LND)).

@ -22,8 +22,9 @@ import { InvoiceInformationComponent } from '../invoice-information-modal/invoic
import { RTLState } from '../../../store/rtl.state';
import { openAlert } from '../../../store/rtl.actions';
import { rootSelectedNode } from '../../../store/rtl.selector';
import { fetchInvoices, invoiceLookup, saveNewInvoice } from '../../store/lnd.actions';
import { invoices, lndNodeInformation, lndNodeSettings, lndPageSettings } from '../../store/lnd.selector';
import { invoices, lndNodeInformation, lndPageSettings } from '../../store/lnd.selector';
import { ColumnDefinition, PageSettings, TableSetting } from '../../../shared/models/pageSettings';
import { CamelCaseWithReplacePipe } from '../../../shared/pipes/app.pipe';
import { ConvertedCurrency } from '../../../shared/models/rtlModels';
@ -87,7 +88,7 @@ export class LightningInvoicesComponent implements OnInit, AfterViewInit, OnDest
}
ngOnInit() {
this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: Node | null) => { this.selNode = nodeSettings; });
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: Node | null) => { this.selNode = nodeSettings; });
this.store.select(lndNodeInformation).pipe(takeUntil(this.unSubs[1])).subscribe((nodeInfo: GetInfo) => { this.information = nodeInfo; });
this.store.select(lndPageSettings).pipe(takeUntil(this.unSubs[2])).
subscribe((settings: { pageSettings: PageSettings[], apiCallStatus: ApiCallStatusPayload }) => {

@ -21,9 +21,10 @@ import { LightningSendPaymentsComponent } from '../send-payment-modal/send-payme
import { RTLEffects } from '../../../store/rtl.effects';
import { RTLState } from '../../../store/rtl.state';
import { rootSelectedNode } from '../../../store/rtl.selector';
import { openAlert, openConfirmation } from '../../../store/rtl.actions';
import { sendPayment } from '../../store/lnd.actions';
import { lndNodeInformation, lndNodeSettings, lndPageSettings, payments, peers } from '../../store/lnd.selector';
import { lndNodeInformation, lndPageSettings, payments, peers } from '../../store/lnd.selector';
import { ColumnDefinition, PageSettings, TableSetting } from '../../../shared/models/pageSettings';
import { CamelCaseWithReplacePipe } from '../../../shared/pipes/app.pipe';
import { ConvertedCurrency } from '../../../shared/models/rtlModels';
@ -80,7 +81,7 @@ export class LightningPaymentsComponent implements OnInit, AfterViewInit, OnDest
}
ngOnInit() {
this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: Node | null) => { this.selNode = nodeSettings; });
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: Node | null) => { this.selNode = nodeSettings; });
this.store.select(lndNodeInformation).pipe(takeUntil(this.unSubs[1])).subscribe((nodeInfo: GetInfo) => { this.information = nodeInfo; });
this.store.select(peers).pipe(takeUntil(this.unSubs[2])).
subscribe((peersSelector: { peers: Peer[], apiCallStatus: ApiCallStatusPayload }) => {

@ -16,8 +16,9 @@ import { LoggerService } from '../../../shared/services/logger.service';
import { DataService } from '../../../shared/services/data.service';
import { RTLState } from '../../../store/rtl.state';
import { rootSelectedNode } from '../../../store/rtl.selector';
import { sendPayment } from '../../store/lnd.actions';
import { channels, lndNodeSettings } from '../../store/lnd.selector';
import { channels } from '../../store/lnd.selector';
import { ApiCallStatusPayload } from '../../../shared/models/apiCallsPayload';
import { ConvertedCurrency } from '../../../shared/models/rtlModels';
@ -52,7 +53,7 @@ export class LightningSendPaymentsComponent implements OnInit, OnDestroy {
constructor(public dialogRef: MatDialogRef<LightningSendPaymentsComponent>, private store: Store<RTLState>, private logger: LoggerService, private commonService: CommonService, private decimalPipe: DecimalPipe, private actions: Actions, private dataService: DataService) { }
ngOnInit() {
this.store.select(lndNodeSettings).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: Node | null) => { this.selNode = nodeSettings; });
this.store.select(rootSelectedNode).pipe(takeUntil(this.unSubs[0])).subscribe((nodeSettings: Node | null) => { this.selNode = nodeSettings; });
this.store.select(channels).pipe(takeUntil(this.unSubs[1])).
subscribe((channelsSelector: { channels: Channel[], channelsSummary: ChannelsSummary, lightningBalance: LightningBalance, apiCallStatus: ApiCallStatusPayload }) => {
this.activeChannels = channelsSelector.channels && channelsSelector.channels.length ? channelsSelector.channels?.filter((channel) => channel.active) : [];

@ -8,7 +8,8 @@ import { faExchangeAlt, faChartPie } from '@fortawesome/free-solid-svg-icons';
import { UserPersonaEnum } from '../../shared/services/consts-enums-functions';
import { LoggerService } from '../../shared/services/logger.service';
import { RTLState } from '../../store/rtl.state';
import { channels, lndNodeSettings } from '../store/lnd.selector';
import { rootSelectedNode } from '../../store/rtl.selector';
import { channels } from '../store/lnd.selector';
import { Channel, ChannelsSummary, LightningBalance } from '../../shared/models/lndModels';
import { ApiCallStatusPayload } from '../../shared/models/apiCallsPayload';
import { Node } from '../../shared/models/RTLconfig';
@ -41,7 +42,7 @@ export class TransactionsComponent implements OnInit, OnDestroy {
}
});
this.store.select(channels).pipe(takeUntil(this.unSubs[1]),
withLatestFrom(this.store.select(lndNodeSettings))).
withLatestFrom(this.store.select(rootSelectedNode))).
subscribe(([channelsSelector, nodeSettings]: [{ channels: Channel[], channelsSummary: ChannelsSummary, lightningBalance: LightningBalance, apiCallStatus: ApiCallStatusPayload }, (Node | null)]) => {
this.currencyUnits = nodeSettings?.settings.currencyUnits || [];
if (nodeSettings?.settings.userPersona === UserPersonaEnum.OPERATOR) {

@ -14,10 +14,10 @@ import { rootSelectedNode } from '../../../../store/rtl.selector';
import { Node } from '../../../models/RTLconfig';
import { TableSetting, PageSettings } from '../../../models/pageSettings';
import { clnPageSettings } from '../../../../cln/store/cln.selector';
import { lndNodeSettings, lndPageSettings } from '../../../../lnd/store/lnd.selector';
import { lndPageSettings } from '../../../../lnd/store/lnd.selector';
import { savePageSettings as savePageSettingsCLN } from '../../../../cln/store/cln.actions';
import { savePageSettings as savePageSettingsLND } from '../../../../lnd/store/lnd.actions';
import { eclNodeSettings, eclPageSettings } from '../../../../eclair/store/ecl.selector';
import { eclPageSettings } from '../../../../eclair/store/ecl.selector';
import { savePageSettings as savePageSettingsECL } from '../../../../eclair/store/ecl.actions';
@Component({
@ -95,9 +95,8 @@ export class PageSettingsComponent implements OnInit, OnDestroy {
this.initialPageSettings = Object.assign([], ECL_DEFAULT_PAGE_SETTINGS);
this.defaultSettings = Object.assign([], ECL_DEFAULT_PAGE_SETTINGS);
this.nodePageDefs = ECL_PAGE_DEFS;
this.store.select(eclPageSettings).pipe(takeUntil(this.unSubs[1]),
withLatestFrom(this.store.select(eclNodeSettings))).
subscribe(([settings, nodeSettings]: [{ pageSettings: PageSettings[], apiCallStatus: ApiCallStatusPayload }, (Node | null)]) => {
this.store.select(eclPageSettings).pipe(takeUntil(this.unSubs[1])).
subscribe((settings: { pageSettings: PageSettings[], apiCallStatus: ApiCallStatusPayload }) => {
const updatedPageSettings = JSON.parse(JSON.stringify(settings.pageSettings));
this.errorMessage = null;
this.apiCallStatus = settings.apiCallStatus;
@ -124,7 +123,7 @@ export class PageSettingsComponent implements OnInit, OnDestroy {
this.defaultSettings = Object.assign([], LND_DEFAULT_PAGE_SETTINGS);
this.nodePageDefs = LND_PAGE_DEFS;
this.store.select(lndPageSettings).pipe(takeUntil(this.unSubs[1]),
withLatestFrom(this.store.select(lndNodeSettings))).
withLatestFrom(this.store.select(rootSelectedNode))).
subscribe(([settings, nodeSettings]: [{ pageSettings: PageSettings[], apiCallStatus: ApiCallStatusPayload }, (Node | null)]) => {
const updatedPageSettings: PageSettings[] = JSON.parse(JSON.stringify(settings.pageSettings));
this.errorMessage = null;

@ -88,9 +88,9 @@ describe('RTL Root Effects', () => {
expect(storeDispatchSpy.calls.all()[2].args[0]).toEqual(updateRootAPICallStatus({ payload: { action: 'UpdateSelNode', status: APICallStatusEnum.COMPLETED } }));
expect(storeDispatchSpy.calls.all()[3].args[0]).toEqual(closeSpinner({ payload: UI_MESSAGES.UPDATE_SELECTED_NODE }));
expect(storeDispatchSpy.calls.all()[4].args[0]).toEqual(resetRootStore({ payload: mockActionsData.resetRootStore }));
expect(storeDispatchSpy.calls.all()[5].args[0]).toEqual(resetLNDStore({ payload: mockActionsData.resetChildrenStores }));
expect(storeDispatchSpy.calls.all()[6].args[0]).toEqual(resetCLNStore({ payload: mockActionsData.resetChildrenStores }));
expect(storeDispatchSpy.calls.all()[7].args[0]).toEqual(resetECLStore({ payload: mockActionsData.resetChildrenStores }));
expect(storeDispatchSpy.calls.all()[5].args[0]).toEqual(resetLNDStore());
expect(storeDispatchSpy.calls.all()[6].args[0]).toEqual(resetCLNStore());
expect(storeDispatchSpy.calls.all()[7].args[0]).toEqual(resetECLStore());
expect(storeDispatchSpy.calls.all()[8].args[0]).toEqual(fetchPageSettingsLND());
expect(storeDispatchSpy.calls.all()[9].args[0]).toEqual(fetchInfoLND({ payload: { loadPage: 'HOME' } }));
expect(storeDispatchSpy).toHaveBeenCalledTimes(10);

@ -27,9 +27,9 @@ import { ShowPubkeyComponent } from '../shared/components/data-modal/show-pubkey
import { RTLState } from './rtl.state';
import { resetRootStore, setNodeData, setSelectedNode, updateRootAPICallStatus, closeSpinner, openAlert, openSpinner, openSnackBar, fetchRTLConfig, closeAllDialogs, logout, setSelectedNodeSettings } from './rtl.actions';
import { fetchInfoLND, resetLNDStore, fetchPageSettings as fetchPageSettingsLND, setChildNodeSettingsLND } from '../lnd/store/lnd.actions';
import { fetchInfoCLN, resetCLNStore, fetchPageSettings as fetchPageSettingsCLN, setChildNodeSettingsCLN } from '../cln/store/cln.actions';
import { fetchInfoECL, resetECLStore, fetchPageSettings as fetchPageSettingsECL, setChildNodeSettingsECL } from '../eclair/store/ecl.actions';
import { fetchInfoLND, resetLNDStore, fetchPageSettings as fetchPageSettingsLND } from '../lnd/store/lnd.actions';
import { fetchInfoCLN, resetCLNStore, fetchPageSettings as fetchPageSettingsCLN } from '../cln/store/cln.actions';
import { fetchInfoECL, resetECLStore, fetchPageSettings as fetchPageSettingsECL } from '../eclair/store/ecl.actions';
import { rootAppConfig, rootNodeData } from './rtl.selector';
@Injectable()
@ -259,9 +259,6 @@ export class RTLEffects implements OnDestroy {
this.store.dispatch(closeSpinner({ payload: UI_MESSAGES.UPDATE_NODE_SETTINGS }));
updatedNode.settings.currencyUnits = [...CURRENCY_UNITS, (updatedNode.settings?.currencyUnit ? updatedNode.settings?.currencyUnit : '')];
this.store.dispatch(setSelectedNodeSettings({ payload: updatedNode }));
this.store.dispatch(setChildNodeSettingsLND({ payload: updatedNode }));
this.store.dispatch(setChildNodeSettingsCLN({ payload: updatedNode }));
this.store.dispatch(setChildNodeSettingsECL({ payload: updatedNode }));
return {
type: RTLActions.OPEN_SNACK_BAR,
payload: 'Node settings updated successfully!'
@ -366,9 +363,9 @@ export class RTLEffects implements OnDestroy {
ofType(RTLActions.LOGIN),
withLatestFrom(this.store.select(rootAppConfig)),
mergeMap(([action, appConfig]: [{ type: string, payload: Login }, RTLConfiguration]) => {
this.store.dispatch(resetLNDStore({ payload: null }));
this.store.dispatch(resetCLNStore({ payload: null }));
this.store.dispatch(resetECLStore({ payload: null }));
this.store.dispatch(resetLNDStore());
this.store.dispatch(resetCLNStore());
this.store.dispatch(resetECLStore());
this.store.dispatch(updateRootAPICallStatus({ payload: { action: 'Login', status: APICallStatusEnum.INITIATED } }));
return this.httpClient.post(API_END_POINTS.AUTHENTICATE_API, {
authenticateWith: (!action.payload.password) ? AuthenticateWith.JWT : AuthenticateWith.PASSWORD,
@ -529,9 +526,9 @@ export class RTLEffects implements OnDestroy {
this.sessionService.removeItem('eclUnlocked');
node.settings.currencyUnits = [...CURRENCY_UNITS, (node.settings?.currencyUnit ? node.settings?.currencyUnit : '')];
this.store.dispatch(resetRootStore({ payload: node }));
this.store.dispatch(resetLNDStore({ payload: node }));
this.store.dispatch(resetCLNStore({ payload: node }));
this.store.dispatch(resetECLStore({ payload: node }));
this.store.dispatch(resetLNDStore());
this.store.dispatch(resetCLNStore());
this.store.dispatch(resetECLStore());
if (this.sessionService.getItem('token')) {
const nodeLnImplementation = node.lnImplementation ? node.lnImplementation.toUpperCase() : 'LND';
this.dataService.setLnImplementation(nodeLnImplementation);

Loading…
Cancel
Save