diff --git a/src/app/cln/store/cln.actions.ts b/src/app/cln/store/cln.actions.ts index 64d58c70..4f356a8d 100644 --- a/src/app/cln/store/cln.actions.ts +++ b/src/app/cln/store/cln.actions.ts @@ -7,11 +7,11 @@ import { GetInfo, Fees, Peer, Payment, QueryRoutes, Channel, FeeRates, Invoice, GetNewAddress, DetachPeer, UpdateChannel, CloseChannel, SendPayment, GetQueryRoutes, ChannelLookup, OfferInvoice, Offer, OfferBookmark, ListForwards, FetchListForwards } from '../../shared/models/clnModels'; import { PageSettings } from '../../shared/models/pageSettings'; -export const updateCLAPICallStatus = createAction(CLNActions.UPDATE_API_CALL_STATUS_CLN, props<{ payload: ApiCallStatusPayload }>()); +export const updateCLNAPICallStatus = createAction(CLNActions.UPDATE_API_CALL_STATUS_CLN, props<{ payload: ApiCallStatusPayload }>()); -export const resetCLStore = createAction(CLNActions.RESET_CLN_STORE, props<{ payload: SelNodeChild | null }>()); +export const resetCLNStore = createAction(CLNActions.RESET_CLN_STORE, props<{ payload: SelNodeChild | null }>()); -export const setChildNodeSettingsCL = createAction(CLNActions.SET_CHILD_NODE_SETTINGS_CLN, props<{ payload: SelNodeChild }>()); +export const setChildNodeSettingsCLN = createAction(CLNActions.SET_CHILD_NODE_SETTINGS_CLN, props<{ payload: SelNodeChild }>()); export const fetchPageSettings = createAction(CLNActions.FETCH_PAGE_SETTINGS_CLN); @@ -19,7 +19,7 @@ export const setPageSettings = createAction(CLNActions.SET_PAGE_SETTINGS_CLN, pr export const savePageSettings = createAction(CLNActions.SAVE_PAGE_SETTINGS_CLN, props<{ payload: PageSettings[] }>()); -export const fetchInfoCL = createAction(CLNActions.FETCH_INFO_CLN, props<{ payload: { loadPage: string } }>()); +export const fetchInfoCLN = createAction(CLNActions.FETCH_INFO_CLN, props<{ payload: { loadPage: string } }>()); export const setInfo = createAction(CLNActions.SET_INFO_CLN, props<{ payload: GetInfo }>()); diff --git a/src/app/cln/store/cln.effects.ts b/src/app/cln/store/cln.effects.ts index 120a438d..327660b2 100644 --- a/src/app/cln/store/cln.effects.ts +++ b/src/app/cln/store/cln.effects.ts @@ -19,8 +19,8 @@ import { closeAllDialogs, closeSpinner, logout, openAlert, openSnackBar, openSpi import { RTLState } from '../../store/rtl.state'; import { addUpdateOfferBookmark, fetchBalance, fetchChannels, fetchFeeRates, fetchFees, fetchInvoices, fetchLocalRemoteBalance, - fetchPayments, fetchPeers, fetchUTXOs, setLookup, setPeers, setQueryRoutes, updateCLAPICallStatus, updateInvoice, setOfferInvoice, - sendPaymentStatus, setForwardingHistory, fetchPageSettings } from './cln.actions'; + fetchPayments, fetchPeers, fetchUTXOs, setLookup, setPeers, setQueryRoutes, updateCLNAPICallStatus, updateInvoice, setOfferInvoice, + sendPaymentStatus, setForwardingHistory } from './cln.actions'; import { allAPIsCallStatus } from './cln.selector'; import { ApiCallsListCL } from '../../shared/models/apiCallsPayload'; import { CLNOfferInformationComponent } from '../transactions/offers/offer-information-modal/offer-information.component'; @@ -89,7 +89,7 @@ export class CLNEffects implements OnDestroy { mergeMap((action: { type: string, payload: { loadPage: string } }) => { this.flgInitialized = false; this.store.dispatch(setApiUrl({ payload: this.CHILD_API_URL })); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchInfo', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchInfo', status: APICallStatusEnum.INITIATED } })); this.store.dispatch(openSpinner({ payload: UI_MESSAGES.GET_NODE_INFO })); return this.httpClient.get(this.CHILD_API_URL + API_END_POINTS.GETINFO_API). pipe( @@ -103,7 +103,7 @@ export class CLNEffects implements OnDestroy { (info?.chains[0].chain.toLowerCase().indexOf('bitcoin') < 0 && info?.chains[0].chain.toLowerCase().indexOf('liquid') < 0) ) ) { - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchInfo', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchInfo', status: APICallStatusEnum.COMPLETED } })); this.store.dispatch(closeSpinner({ payload: UI_MESSAGES.GET_NODE_INFO })); this.store.dispatch(closeAllDialogs()); setTimeout(() => { @@ -122,7 +122,7 @@ export class CLNEffects implements OnDestroy { }; } else { this.initializeRemainingData(info, action.payload.loadPage); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchInfo', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchInfo', status: APICallStatusEnum.COMPLETED } })); this.store.dispatch(closeSpinner({ payload: UI_MESSAGES.GET_NODE_INFO })); return { type: CLNActions.SET_INFO_CLN, @@ -144,12 +144,12 @@ export class CLNEffects implements OnDestroy { fetchFeesCL = createEffect(() => this.actions.pipe( ofType(CLNActions.FETCH_FEES_CLN), mergeMap(() => { - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchFees', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchFees', status: APICallStatusEnum.INITIATED } })); return this.httpClient.get(this.CHILD_API_URL + API_END_POINTS.FEES_API); }), map((fees) => { this.logger.info(fees); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchFees', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchFees', status: APICallStatusEnum.COMPLETED } })); return { type: CLNActions.SET_FEES_CLN, payload: fees ? fees : {} @@ -164,12 +164,12 @@ export class CLNEffects implements OnDestroy { fetchFeeRatesCL = createEffect(() => this.actions.pipe( ofType(CLNActions.FETCH_FEE_RATES_CLN), mergeMap((action: { type: string, payload: string }) => { - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchFeeRates' + action.payload, status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchFeeRates' + action.payload, status: APICallStatusEnum.INITIATED } })); return this.httpClient.get(this.CHILD_API_URL + API_END_POINTS.NETWORK_API + '/feeRates/' + action.payload). pipe( map((feeRates) => { this.logger.info(feeRates); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchFeeRates' + action.payload, status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchFeeRates' + action.payload, status: APICallStatusEnum.COMPLETED } })); return { type: CLNActions.SET_FEE_RATES_CLN, payload: feeRates ? feeRates : {} @@ -186,12 +186,12 @@ export class CLNEffects implements OnDestroy { fetchBalanceCL = createEffect(() => this.actions.pipe( ofType(CLNActions.FETCH_BALANCE_CLN), mergeMap(() => { - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchBalance', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchBalance', status: APICallStatusEnum.INITIATED } })); return this.httpClient.get(this.CHILD_API_URL + API_END_POINTS.BALANCE_API); }), map((balance) => { this.logger.info(balance); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchBalance', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchBalance', status: APICallStatusEnum.COMPLETED } })); return { type: CLNActions.SET_BALANCE_CLN, payload: balance ? balance : {} @@ -206,12 +206,12 @@ export class CLNEffects implements OnDestroy { fetchLocalRemoteBalanceCL = createEffect(() => this.actions.pipe( ofType(CLNActions.FETCH_LOCAL_REMOTE_BALANCE_CLN), mergeMap(() => { - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchLocalRemoteBalance', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchLocalRemoteBalance', status: APICallStatusEnum.INITIATED } })); return this.httpClient.get(this.CHILD_API_URL + API_END_POINTS.CHANNELS_API + '/localRemoteBalance'); }), map((lrBalance) => { this.logger.info(lrBalance); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchLocalRemoteBalance', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchLocalRemoteBalance', status: APICallStatusEnum.COMPLETED } })); return { type: CLNActions.SET_LOCAL_REMOTE_BALANCE_CLN, payload: lrBalance ? lrBalance : {} @@ -259,12 +259,12 @@ export class CLNEffects implements OnDestroy { peersFetchCL = createEffect(() => this.actions.pipe( ofType(CLNActions.FETCH_PEERS_CLN), mergeMap(() => { - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchPeers', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchPeers', status: APICallStatusEnum.INITIATED } })); return this.httpClient.get(this.CHILD_API_URL + API_END_POINTS.PEERS_API). pipe( map((peers: any) => { this.logger.info(peers); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchPeers', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchPeers', status: APICallStatusEnum.COMPLETED } })); return { type: CLNActions.SET_PEERS_CLN, payload: peers || [] @@ -282,12 +282,12 @@ export class CLNEffects implements OnDestroy { ofType(CLNActions.SAVE_NEW_PEER_CLN), mergeMap((action: { type: string, payload: { id: string } }) => { this.store.dispatch(openSpinner({ payload: UI_MESSAGES.CONNECT_PEER })); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'SaveNewPeer', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'SaveNewPeer', status: APICallStatusEnum.INITIATED } })); return this.httpClient.post(this.CHILD_API_URL + API_END_POINTS.PEERS_API, { id: action.payload.id }). pipe( map((postRes: Peer[]) => { this.logger.info(postRes); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'SaveNewPeer', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'SaveNewPeer', status: APICallStatusEnum.COMPLETED } })); this.store.dispatch(closeSpinner({ payload: UI_MESSAGES.CONNECT_PEER })); this.store.dispatch(setPeers({ payload: (postRes || []) })); return { @@ -329,7 +329,7 @@ export class CLNEffects implements OnDestroy { channelsFetchCL = createEffect(() => this.actions.pipe( ofType(CLNActions.FETCH_CHANNELS_CLN), mergeMap(() => { - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchChannels', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchChannels', status: APICallStatusEnum.INITIATED } })); const listChannelsEndpoint = this.commonService.isVersionCompatible(this.CLN_VERISON, '23.02') && this.commonService.isVersionCompatible(this.API_VERION, '0.10.3') ? @@ -338,7 +338,7 @@ export class CLNEffects implements OnDestroy { }), map((channels: Channel[]) => { this.logger.info(channels); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchChannels', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchChannels', status: APICallStatusEnum.COMPLETED } })); const sortedChannels = { activeChannels: [], pendingChannels: [], inactiveChannels: [] }; channels.forEach((channel) => { if (channel.id) { channel.peer_id = channel.id; } @@ -368,7 +368,7 @@ export class CLNEffects implements OnDestroy { ofType(CLNActions.SAVE_NEW_CHANNEL_CLN), mergeMap((action: { type: string, payload: SaveChannel }) => { this.store.dispatch(openSpinner({ payload: UI_MESSAGES.OPEN_CHANNEL })); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'SaveNewChannel', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'SaveNewChannel', status: APICallStatusEnum.INITIATED } })); const newPayload = { id: action.payload.peerId, satoshis: action.payload.satoshis, feeRate: action.payload.feeRate, announce: action.payload.announce }; if (action.payload.minconf) { newPayload['minconf'] = action.payload.minconf; } if (action.payload.utxos) { newPayload['utxos'] = action.payload.utxos; } @@ -378,7 +378,7 @@ export class CLNEffects implements OnDestroy { pipe( map((postRes: any) => { this.logger.info(postRes); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'SaveNewChannel', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'SaveNewChannel', status: APICallStatusEnum.COMPLETED } })); this.store.dispatch(closeSpinner({ payload: UI_MESSAGES.OPEN_CHANNEL })); this.store.dispatch(openSnackBar({ payload: 'Channel Added Successfully!' })); this.store.dispatch(fetchBalance()); @@ -450,12 +450,12 @@ export class CLNEffects implements OnDestroy { paymentsFetchCL = createEffect(() => this.actions.pipe( ofType(CLNActions.FETCH_PAYMENTS_CLN), mergeMap(() => { - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchPayments', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchPayments', status: APICallStatusEnum.INITIATED } })); return this.httpClient.get(this.CHILD_API_URL + API_END_POINTS.PAYMENTS_API); }), map((payments) => { this.logger.info(payments); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchPayments', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchPayments', status: APICallStatusEnum.COMPLETED } })); return { type: CLNActions.SET_PAYMENTS_CLN, payload: payments || [] @@ -472,13 +472,13 @@ export class CLNEffects implements OnDestroy { ofType(CLNActions.FETCH_OFFER_INVOICE_CLN), mergeMap((action: { type: string, payload: { offer: string, amount_msat?: string } }) => { this.store.dispatch(openSpinner({ payload: UI_MESSAGES.FETCH_INVOICE })); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchOfferInvoice', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchOfferInvoice', status: APICallStatusEnum.INITIATED } })); return this.httpClient.post(this.CHILD_API_URL + API_END_POINTS.OFFERS_API + '/fetchOfferInvoice', action.payload). pipe( map((fetchedInvoice: any) => { this.logger.info(fetchedInvoice); setTimeout(() => { - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchOfferInvoice', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchOfferInvoice', status: APICallStatusEnum.COMPLETED } })); this.store.dispatch(closeSpinner({ payload: UI_MESSAGES.FETCH_INVOICE })); this.store.dispatch(setOfferInvoice({ payload: (fetchedInvoice ? fetchedInvoice : {}) })); }, 500); @@ -507,11 +507,11 @@ export class CLNEffects implements OnDestroy { ofType(CLNActions.SEND_PAYMENT_CLN), mergeMap((action: { type: string, payload: SendPayment }) => { this.store.dispatch(openSpinner({ payload: action.payload.uiMessage })); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'SendPayment', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'SendPayment', status: APICallStatusEnum.INITIATED } })); return this.httpClient.post(this.CHILD_API_URL + API_END_POINTS.PAYMENTS_API, action.payload).pipe( map((sendRes: any) => { this.logger.info(sendRes); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'SendPayment', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'SendPayment', status: APICallStatusEnum.COMPLETED } })); let snackBarMessageStr = 'Payment Sent Successfully!'; if (sendRes.saveToDBError) { snackBarMessageStr = 'Payment Sent Successfully but Offer Saving to Database Failed.'; @@ -546,12 +546,12 @@ export class CLNEffects implements OnDestroy { queryRoutesFetchCL = createEffect(() => this.actions.pipe( ofType(CLNActions.GET_QUERY_ROUTES_CLN), mergeMap((action: { type: string, payload: GetQueryRoutes }) => { - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'GetQueryRoutes', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'GetQueryRoutes', status: APICallStatusEnum.INITIATED } })); return this.httpClient.get(this.CHILD_API_URL + API_END_POINTS.NETWORK_API + '/getRoute/' + action.payload.destPubkey + '/' + action.payload.amount). pipe( map((qrRes: any) => { this.logger.info(qrRes); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'GetQueryRoutes', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'GetQueryRoutes', status: APICallStatusEnum.COMPLETED } })); return { type: CLNActions.SET_QUERY_ROUTES_CLN, payload: qrRes @@ -578,12 +578,12 @@ export class CLNEffects implements OnDestroy { ofType(CLNActions.PEER_LOOKUP_CLN), mergeMap((action: { type: string, payload: string }) => { this.store.dispatch(openSpinner({ payload: UI_MESSAGES.SEARCHING_NODE })); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'Lookup', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'Lookup', status: APICallStatusEnum.INITIATED } })); return this.httpClient.get(this.CHILD_API_URL + API_END_POINTS.NETWORK_API + '/listNode/' + action.payload). pipe( map((resPeer) => { this.logger.info(resPeer); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'Lookup', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'Lookup', status: APICallStatusEnum.COMPLETED } })); this.store.dispatch(closeSpinner({ payload: UI_MESSAGES.SEARCHING_NODE })); return { type: CLNActions.SET_LOOKUP_CLN, @@ -602,12 +602,12 @@ export class CLNEffects implements OnDestroy { ofType(CLNActions.CHANNEL_LOOKUP_CLN), mergeMap((action: { type: string, payload: ChannelLookup }) => { this.store.dispatch(openSpinner({ payload: action.payload.uiMessage })); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'Lookup', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'Lookup', status: APICallStatusEnum.INITIATED } })); return this.httpClient.get(this.CHILD_API_URL + API_END_POINTS.NETWORK_API + '/listChannel/' + action.payload.shortChannelID). pipe( map((resChannel) => { this.logger.info(resChannel); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'Lookup', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'Lookup', status: APICallStatusEnum.COMPLETED } })); this.store.dispatch(closeSpinner({ payload: action.payload.uiMessage })); return { type: CLNActions.SET_LOOKUP_CLN, @@ -631,12 +631,12 @@ export class CLNEffects implements OnDestroy { ofType(CLNActions.INVOICE_LOOKUP_CLN), mergeMap((action: { type: string, payload: string }) => { this.store.dispatch(openSpinner({ payload: UI_MESSAGES.SEARCHING_INVOICE })); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'Lookup', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'Lookup', status: APICallStatusEnum.INITIATED } })); return this.httpClient.get(this.CHILD_API_URL + API_END_POINTS.INVOICES_API + '?label=' + action.payload). pipe( map((resInvoice: any) => { this.logger.info(resInvoice); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'Lookup', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'Lookup', status: APICallStatusEnum.COMPLETED } })); this.store.dispatch(closeSpinner({ payload: UI_MESSAGES.SEARCHING_INVOICE })); if (resInvoice.invoices && resInvoice.invoices.length && resInvoice.invoices.length > 0) { this.store.dispatch(updateInvoice({ payload: resInvoice.invoices[0] })); @@ -670,12 +670,12 @@ export class CLNEffects implements OnDestroy { ofType(CLNActions.GET_FORWARDING_HISTORY_CLN), mergeMap((action: { type: string, payload: { status: string } }) => { const statusInitial = action.payload.status.charAt(0).toUpperCase(); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchForwardingHistory' + statusInitial, status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchForwardingHistory' + statusInitial, status: APICallStatusEnum.INITIATED } })); return this.httpClient.get(this.CHILD_API_URL + API_END_POINTS.CHANNELS_API + '/listForwards?status=' + action.payload.status). pipe( map((fhRes: any) => { this.logger.info(fhRes); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchForwardingHistory' + statusInitial, status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchForwardingHistory' + statusInitial, status: APICallStatusEnum.COMPLETED } })); if (action.payload.status === CLNForwardingEventsStatusEnum.FAILED) { this.store.dispatch(setForwardingHistory({ payload: { status: CLNForwardingEventsStatusEnum.FAILED, totalForwards: fhRes.length, listForwards: fhRes } })); } else if (action.payload.status === CLNForwardingEventsStatusEnum.LOCAL_FAILED) { @@ -721,14 +721,14 @@ export class CLNEffects implements OnDestroy { ofType(CLNActions.SAVE_NEW_INVOICE_CLN), mergeMap((action: { type: string, payload: { amount: number, label: string, description: string, expiry: number, private: boolean } }) => { this.store.dispatch(openSpinner({ payload: UI_MESSAGES.ADD_INVOICE })); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'SaveNewInvoice', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'SaveNewInvoice', status: APICallStatusEnum.INITIATED } })); return this.httpClient.post(this.CHILD_API_URL + API_END_POINTS.INVOICES_API, { label: action.payload.label, amount: action.payload.amount, description: action.payload.description, expiry: action.payload.expiry, private: action.payload.private }). pipe( map((postRes: Invoice) => { this.logger.info(postRes); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'SaveNewInvoice', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'SaveNewInvoice', status: APICallStatusEnum.COMPLETED } })); this.store.dispatch(closeSpinner({ payload: UI_MESSAGES.ADD_INVOICE })); postRes.amount_msat = action.payload.amount; postRes.label = action.payload.label; @@ -763,12 +763,12 @@ export class CLNEffects implements OnDestroy { ofType(CLNActions.SAVE_NEW_OFFER_CLN), mergeMap((action: { type: string, payload: { amount: string, description: string, issuer: string } }) => { this.store.dispatch(openSpinner({ payload: UI_MESSAGES.CREATE_OFFER })); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'SaveNewOffer', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'SaveNewOffer', status: APICallStatusEnum.INITIATED } })); return this.httpClient.post(this.CHILD_API_URL + API_END_POINTS.OFFERS_API, { amount: action.payload.amount, description: action.payload.description, issuer: action.payload.issuer }).pipe(map((postRes: Offer) => { this.logger.info(postRes); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'SaveNewOffer', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'SaveNewOffer', status: APICallStatusEnum.COMPLETED } })); this.store.dispatch(closeSpinner({ payload: UI_MESSAGES.CREATE_OFFER })); setTimeout(() => { this.store.dispatch(openAlert({ @@ -796,7 +796,7 @@ export class CLNEffects implements OnDestroy { invoicesFetchCL = createEffect(() => this.actions.pipe( ofType(CLNActions.FETCH_INVOICES_CLN), mergeMap((action: { type: string, payload: FetchInvoices }) => { - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchInvoices', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchInvoices', status: APICallStatusEnum.INITIATED } })); const num_max_invoices = (action.payload.num_max_invoices) ? action.payload.num_max_invoices : 1000000; const index_offset = (action.payload.index_offset) ? action.payload.index_offset : 0; const reversed = (action.payload.reversed) ? action.payload.reversed : true; @@ -804,7 +804,7 @@ export class CLNEffects implements OnDestroy { pipe( map((res: ListInvoices) => { this.logger.info(res); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchInvoices', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchInvoices', status: APICallStatusEnum.COMPLETED } })); return { type: CLNActions.SET_INVOICES_CLN, payload: res @@ -821,11 +821,11 @@ export class CLNEffects implements OnDestroy { offersFetchCL = createEffect(() => this.actions.pipe( ofType(CLNActions.FETCH_OFFERS_CLN), mergeMap((action: { type: string, payload: any }) => { - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchOffers', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchOffers', status: APICallStatusEnum.INITIATED } })); return this.httpClient.get(this.CHILD_API_URL + API_END_POINTS.OFFERS_API). pipe(map((res: any) => { this.logger.info(res); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchOffers', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchOffers', status: APICallStatusEnum.COMPLETED } })); return { type: CLNActions.SET_OFFERS_CLN, payload: res.offers ? res.offers : [] @@ -841,11 +841,11 @@ export class CLNEffects implements OnDestroy { ofType(CLNActions.DISABLE_OFFER_CLN), mergeMap((action: { type: string, payload: { offer_id: string } }) => { this.store.dispatch(openSpinner({ payload: UI_MESSAGES.DISABLE_OFFER })); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'DisableOffer', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'DisableOffer', status: APICallStatusEnum.INITIATED } })); return this.httpClient.delete(this.CHILD_API_URL + API_END_POINTS.OFFERS_API + '/' + action.payload.offer_id). pipe(map((postRes: any) => { this.logger.info(postRes); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'DisableOffer', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'DisableOffer', status: APICallStatusEnum.COMPLETED } })); this.store.dispatch(closeSpinner({ payload: UI_MESSAGES.DISABLE_OFFER })); this.store.dispatch(openSnackBar({ payload: 'Offer Disabled Successfully!' })); return { @@ -862,11 +862,11 @@ export class CLNEffects implements OnDestroy { offerBookmarksFetchCL = createEffect(() => this.actions.pipe( ofType(CLNActions.FETCH_OFFER_BOOKMARKS_CLN), mergeMap((action: { type: string, payload: any }) => { - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchOfferBookmarks', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchOfferBookmarks', status: APICallStatusEnum.INITIATED } })); return this.httpClient.get(this.CHILD_API_URL + API_END_POINTS.OFFERS_API + '/offerbookmarks'). pipe(map((res: any) => { this.logger.info(res); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchOfferBookmarks', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchOfferBookmarks', status: APICallStatusEnum.COMPLETED } })); return { type: CLNActions.SET_OFFER_BOOKMARKS_CLN, payload: res || [] @@ -882,11 +882,11 @@ export class CLNEffects implements OnDestroy { ofType(CLNActions.DELETE_OFFER_BOOKMARK_CLN), mergeMap((action: { type: string, payload: { bolt12: string } }) => { this.store.dispatch(openSpinner({ payload: UI_MESSAGES.DELETE_OFFER_BOOKMARK })); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'DeleteOfferBookmark', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'DeleteOfferBookmark', status: APICallStatusEnum.INITIATED } })); return this.httpClient.delete(this.CHILD_API_URL + API_END_POINTS.OFFERS_API + '/offerbookmark/' + action.payload.bolt12). pipe(map((postRes: any) => { this.logger.info(postRes); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'DeleteOfferBookmark', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'DeleteOfferBookmark', status: APICallStatusEnum.COMPLETED } })); this.store.dispatch(closeSpinner({ payload: UI_MESSAGES.DELETE_OFFER_BOOKMARK })); this.store.dispatch(openSnackBar({ payload: 'Offer Bookmark Deleted Successfully!' })); return { @@ -904,12 +904,12 @@ export class CLNEffects implements OnDestroy { ofType(CLNActions.SET_CHANNEL_TRANSACTION_CLN), mergeMap((action: { type: string, payload: OnChain }) => { this.store.dispatch(openSpinner({ payload: UI_MESSAGES.SEND_FUNDS })); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'SetChannelTransaction', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'SetChannelTransaction', status: APICallStatusEnum.INITIATED } })); return this.httpClient.post(this.CHILD_API_URL + API_END_POINTS.ON_CHAIN_API, action.payload). pipe( map((postRes: any) => { this.logger.info(postRes); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'SetChannelTransaction', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'SetChannelTransaction', status: APICallStatusEnum.COMPLETED } })); this.store.dispatch(closeSpinner({ payload: UI_MESSAGES.SEND_FUNDS })); this.store.dispatch(fetchBalance()); this.store.dispatch(fetchUTXOs()); @@ -929,12 +929,12 @@ export class CLNEffects implements OnDestroy { utxosFetch = createEffect(() => this.actions.pipe( ofType(CLNActions.FETCH_UTXOS_CLN), mergeMap(() => { - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchUTXOs', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchUTXOs', status: APICallStatusEnum.INITIATED } })); return this.httpClient.get(this.CHILD_API_URL + API_END_POINTS.ON_CHAIN_API + '/utxos'); }), map((utxos: any) => { this.logger.info(utxos); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchUTXOs', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchUTXOs', status: APICallStatusEnum.COMPLETED } })); utxos.outputs.forEach((output) => { // For backward compatibility if (output.value) { output.amount_msat = output.value; @@ -954,11 +954,11 @@ export class CLNEffects implements OnDestroy { pageSettingsFetchCL = createEffect(() => this.actions.pipe( ofType(CLNActions.FETCH_PAGE_SETTINGS_CLN), mergeMap(() => { - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchPageSettings', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchPageSettings', status: APICallStatusEnum.INITIATED } })); return this.httpClient.get(API_END_POINTS.PAGE_SETTINGS_API).pipe( map((pageSettings: any) => { this.logger.info(pageSettings); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'FetchPageSettings', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'FetchPageSettings', status: APICallStatusEnum.COMPLETED } })); return { type: CLNActions.SET_PAGE_SETTINGS_CLN, payload: pageSettings || [] @@ -976,12 +976,12 @@ export class CLNEffects implements OnDestroy { ofType(CLNActions.SAVE_PAGE_SETTINGS_CLN), mergeMap((action: { type: string, payload: any }) => { this.store.dispatch(openSpinner({ payload: UI_MESSAGES.UPDATE_PAGE_SETTINGS })); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'SavePageSettings', status: APICallStatusEnum.INITIATED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'SavePageSettings', status: APICallStatusEnum.INITIATED } })); return this.httpClient.post(API_END_POINTS.PAGE_SETTINGS_API, action.payload). pipe( map((postRes: any) => { this.logger.info(postRes); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: 'SavePageSettings', status: APICallStatusEnum.COMPLETED } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: 'SavePageSettings', status: APICallStatusEnum.COMPLETED } })); this.store.dispatch(closeSpinner({ payload: UI_MESSAGES.UPDATE_PAGE_SETTINGS })); this.store.dispatch(openSnackBar({ payload: 'Page Layout Updated Successfully!' })); return { @@ -1021,7 +1021,6 @@ export class CLNEffects implements OnDestroy { newRoute = '/cln/home'; } this.router.navigate([newRoute]); - this.store.dispatch(fetchPageSettings()); this.store.dispatch(fetchInvoices({ payload: { num_max_invoices: 1000000, index_offset: 0, reversed: true } })); this.store.dispatch(fetchFees()); this.store.dispatch(fetchChannels()); @@ -1044,7 +1043,7 @@ export class CLNEffects implements OnDestroy { } else { this.store.dispatch(closeSpinner({ payload: uiMessage })); const errMsg = this.commonService.extractErrorMessage(err, genericErrorMessage); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: actionName, status: APICallStatusEnum.ERROR, statusCode: err.status.toString(), message: errMsg } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: actionName, status: APICallStatusEnum.ERROR, statusCode: err.status.toString(), message: errMsg } })); } } @@ -1068,7 +1067,7 @@ export class CLNEffects implements OnDestroy { } } })); - this.store.dispatch(updateCLAPICallStatus({ payload: { action: actionName, status: APICallStatusEnum.ERROR, statusCode: err.status.toString(), message: errMsg, URL: errURL } })); + this.store.dispatch(updateCLNAPICallStatus({ payload: { action: actionName, status: APICallStatusEnum.ERROR, statusCode: err.status.toString(), message: errMsg, URL: errURL } })); } } diff --git a/src/app/cln/store/cln.reducers.ts b/src/app/cln/store/cln.reducers.ts index 30b006e5..bb89a2d5 100644 --- a/src/app/cln/store/cln.reducers.ts +++ b/src/app/cln/store/cln.reducers.ts @@ -1,17 +1,17 @@ import { createReducer, on } from '@ngrx/store'; import { initCLNState } from './cln.state'; import { - addInvoice, addPeer, removeChannel, removePeer, resetCLStore, setBalance, setChannels, - setChildNodeSettingsCL, setFeeRates, setFees, setForwardingHistory, + addInvoice, addPeer, removeChannel, removePeer, resetCLNStore, setBalance, setChannels, + setChildNodeSettingsCLN, setFeeRates, setFees, setForwardingHistory, setInfo, setInvoices, setLocalRemoteBalance, setOffers, addOffer, setPayments, setPeers, setUTXOs, - updateCLAPICallStatus, updateInvoice, updateOffer, setOfferBookmarks, addUpdateOfferBookmark, removeOfferBookmark, setPageSettings + 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'; import { PageSettings } from '../../shared/models/pageSettings'; export const CLNReducer = createReducer(initCLNState, - on(updateCLAPICallStatus, (state, { payload }) => { + on(updateCLNAPICallStatus, (state, { payload }) => { const updatedApisCallStatus = JSON.parse(JSON.stringify(state.apisCallStatus)); if (payload.action) { updatedApisCallStatus[payload.action] = { @@ -27,11 +27,11 @@ export const CLNReducer = createReducer(initCLNState, apisCallStatus: updatedApisCallStatus }; }), - on(setChildNodeSettingsCL, (state, { payload }) => ({ + on(setChildNodeSettingsCLN, (state, { payload }) => ({ ...state, nodeSettings: payload })), - on(resetCLStore, (state, { payload }) => ({ + on(resetCLNStore, (state, { payload }) => ({ ...initCLNState, nodeSettings: payload })), diff --git a/src/app/shared/components/node-config/experimental-settings/experimental-settings.component.ts b/src/app/shared/components/node-config/experimental-settings/experimental-settings.component.ts index 7ea6b0f0..599c3c58 100644 --- a/src/app/shared/components/node-config/experimental-settings/experimental-settings.component.ts +++ b/src/app/shared/components/node-config/experimental-settings/experimental-settings.component.ts @@ -10,7 +10,7 @@ import { rootSelectedNode } from '../../../../store/rtl.selector'; import { ConfigSettingsNode } from '../../../models/RTLconfig'; import { updateServiceSettings } from '../../../../store/rtl.actions'; import { setChildNodeSettingsLND } from '../../../../lnd/store/lnd.actions'; -import { setChildNodeSettingsCL } from '../../../../cln/store/cln.actions'; +import { setChildNodeSettingsCLN } from '../../../../cln/store/cln.actions'; import { setChildNodeSettingsECL } from '../../../../eclair/store/ecl.actions'; import { DataService } from '../../../services/data.service'; import { CommonService } from '../../../services/common.service'; @@ -98,7 +98,7 @@ export class ExperimentalSettingsComponent implements OnInit, OnDestroy { unannouncedChannels: this.selNode.settings.unannouncedChannels, lnImplementation: this.selNode.lnImplementation, swapServerUrl: this.selNode.settings.swapServerUrl, boltzServerUrl: this.selNode.settings.boltzServerUrl, enableOffers: this.enableOffers } })); - this.store.dispatch(setChildNodeSettingsCL({ + this.store.dispatch(setChildNodeSettingsCLN({ payload: { userPersona: this.selNode.settings.userPersona, channelBackupPath: this.selNode.settings.channelBackupPath, selCurrencyUnit: this.selNode.settings.currencyUnit, currencyUnits: this.selNode.settings.currencyUnits, fiatConversion: this.selNode.settings.fiatConversion, unannouncedChannels: this.selNode.settings.unannouncedChannels, lnImplementation: this.selNode.lnImplementation, swapServerUrl: this.selNode.settings.swapServerUrl, boltzServerUrl: this.selNode.settings.boltzServerUrl, enableOffers: this.enableOffers diff --git a/src/app/shared/components/node-config/node-settings/node-settings.component.ts b/src/app/shared/components/node-config/node-settings/node-settings.component.ts index 88588d24..e652bfcc 100644 --- a/src/app/shared/components/node-config/node-settings/node-settings.component.ts +++ b/src/app/shared/components/node-config/node-settings/node-settings.component.ts @@ -11,7 +11,7 @@ import { CommonService } from '../../../services/common.service'; import { RTLState } from '../../../../store/rtl.state'; import { saveSettings, setSelectedNode } from '../../../../store/rtl.actions'; import { setChildNodeSettingsECL } from '../../../../eclair/store/ecl.actions'; -import { setChildNodeSettingsCL } from '../../../../cln/store/cln.actions'; +import { setChildNodeSettingsCLN } from '../../../../cln/store/cln.actions'; import { setChildNodeSettingsLND } from '../../../../lnd/store/lnd.actions'; import { rootSelectedNode } from '../../../../store/rtl.selector'; @@ -68,7 +68,7 @@ export class NodeSettingsComponent implements OnInit, OnDestroy { lnImplementation: this.selNode.lnImplementation, swapServerUrl: this.selNode.settings.swapServerUrl, boltzServerUrl: this.selNode.settings.boltzServerUrl } })); - this.store.dispatch(setChildNodeSettingsCL({ + this.store.dispatch(setChildNodeSettingsCLN({ payload: { userPersona: this.selNode.settings.userPersona, channelBackupPath: this.selNode.settings.channelBackupPath, selCurrencyUnit: event.value, currencyUnits: this.selNode.settings.currencyUnits, fiatConversion: this.selNode.settings.fiatConversion, unannouncedChannels: this.selNode.settings.unannouncedChannels, @@ -111,7 +111,7 @@ export class NodeSettingsComponent implements OnInit, OnDestroy { swapServerUrl: this.selNode.settings.swapServerUrl, boltzServerUrl: this.selNode.settings.boltzServerUrl } })); - this.store.dispatch(setChildNodeSettingsCL({ + this.store.dispatch(setChildNodeSettingsCLN({ payload: { userPersona: this.selNode.settings.userPersona, channelBackupPath: this.selNode.settings.channelBackupPath, selCurrencyUnit: this.selNode.settings.currencyUnit, currencyUnits: this.selNode.settings.currencyUnits, diff --git a/src/app/shared/components/node-config/services-settings/boltz-service-settings/boltz-service-settings.component.ts b/src/app/shared/components/node-config/services-settings/boltz-service-settings/boltz-service-settings.component.ts index fedb6b4c..8007c70a 100644 --- a/src/app/shared/components/node-config/services-settings/boltz-service-settings/boltz-service-settings.component.ts +++ b/src/app/shared/components/node-config/services-settings/boltz-service-settings/boltz-service-settings.component.ts @@ -10,7 +10,7 @@ import { faInfoCircle } from '@fortawesome/free-solid-svg-icons'; import { updateServiceSettings } from '../../../../../store/rtl.actions'; import { RTLState } from '../../../../../store/rtl.state'; import { setChildNodeSettingsLND } from '../../../../../lnd/store/lnd.actions'; -import { setChildNodeSettingsCL } from '../../../../../cln/store/cln.actions'; +import { setChildNodeSettingsCLN } from '../../../../../cln/store/cln.actions'; import { setChildNodeSettingsECL } from '../../../../../eclair/store/ecl.actions'; import { rootSelectedNode } from '../../../../../store/rtl.selector'; @@ -76,7 +76,7 @@ export class BoltzServiceSettingsComponent implements OnInit, OnDestroy { unannouncedChannels: this.selNode.unannouncedChannels, lnImplementation: this.selNode.lnImplementation, swapServerUrl: this.selNode.settings.swapServerUrl, boltzServerUrl: this.serverUrl, enableOffers: this.selNode.settings.enableOffers } })); - this.store.dispatch(setChildNodeSettingsCL({ + this.store.dispatch(setChildNodeSettingsCLN({ payload: { userPersona: this.selNode.settings.userPersona, channelBackupPath: this.selNode.settings.channelBackupPath, selCurrencyUnit: this.selNode.settings.currencyUnit, currencyUnits: this.selNode.settings.currencyUnits, fiatConversion: this.selNode.settings.fiatConversion, unannouncedChannels: this.selNode.unannouncedChannels, lnImplementation: this.selNode.lnImplementation, swapServerUrl: this.selNode.settings.swapServerUrl, boltzServerUrl: this.serverUrl, enableOffers: this.selNode.settings.enableOffers diff --git a/src/app/shared/components/node-config/services-settings/loop-service-settings/loop-service-settings.component.ts b/src/app/shared/components/node-config/services-settings/loop-service-settings/loop-service-settings.component.ts index 1e96af4f..3d2a1736 100644 --- a/src/app/shared/components/node-config/services-settings/loop-service-settings/loop-service-settings.component.ts +++ b/src/app/shared/components/node-config/services-settings/loop-service-settings/loop-service-settings.component.ts @@ -10,7 +10,7 @@ import { faInfoCircle } from '@fortawesome/free-solid-svg-icons'; import { updateServiceSettings } from '../../../../../store/rtl.actions'; import { RTLState } from '../../../../../store/rtl.state'; import { setChildNodeSettingsLND } from '../../../../../lnd/store/lnd.actions'; -import { setChildNodeSettingsCL } from '../../../../../cln/store/cln.actions'; +import { setChildNodeSettingsCLN } from '../../../../../cln/store/cln.actions'; import { setChildNodeSettingsECL } from '../../../../../eclair/store/ecl.actions'; import { rootSelectedNode } from '../../../../../store/rtl.selector'; @@ -64,7 +64,7 @@ export class LoopServiceSettingsComponent implements OnInit, OnDestroy { unannouncedChannels: this.selNode.unannouncedChannels, lnImplementation: this.selNode.lnImplementation, swapServerUrl: this.selNode.settings.swapServerUrl, boltzServerUrl: this.selNode.settings.boltzServerUrl, enableOffers: this.selNode.settings.enableOffers } })); - this.store.dispatch(setChildNodeSettingsCL({ + this.store.dispatch(setChildNodeSettingsCLN({ payload: { userPersona: this.selNode.settings.userPersona, channelBackupPath: this.selNode.settings.channelBackupPath, selCurrencyUnit: this.selNode.settings.currencyUnit, currencyUnits: this.selNode.settings.currencyUnits, fiatConversion: this.selNode.settings.fiatConversion, unannouncedChannels: this.selNode.unannouncedChannels, lnImplementation: this.selNode.lnImplementation, swapServerUrl: this.selNode.settings.swapServerUrl, boltzServerUrl: this.selNode.settings.boltzServerUrl, enableOffers: this.selNode.settings.enableOffers diff --git a/src/app/shared/components/node-config/services-settings/peerswap-service-settings/peerswap-service-settings.component.ts b/src/app/shared/components/node-config/services-settings/peerswap-service-settings/peerswap-service-settings.component.ts index cb26c83e..cdc736ff 100644 --- a/src/app/shared/components/node-config/services-settings/peerswap-service-settings/peerswap-service-settings.component.ts +++ b/src/app/shared/components/node-config/services-settings/peerswap-service-settings/peerswap-service-settings.component.ts @@ -10,7 +10,7 @@ import { faInfoCircle } from '@fortawesome/free-solid-svg-icons'; import { updateServiceSettings } from '../../../../../store/rtl.actions'; import { RTLState } from '../../../../../store/rtl.state'; import { setChildNodeSettingsLND } from '../../../../../lnd/store/lnd.actions'; -import { setChildNodeSettingsCL } from '../../../../../cln/store/cln.actions'; +import { setChildNodeSettingsCLN } from '../../../../../cln/store/cln.actions'; import { setChildNodeSettingsECL } from '../../../../../eclair/store/ecl.actions'; import { rootSelectedNode } from '../../../../../store/rtl.selector'; @@ -46,7 +46,7 @@ export class PeerswapServiceSettingsComponent implements OnInit, OnDestroy { unannouncedChannels: this.selNode.unannouncedChannels, lnImplementation: this.selNode.lnImplementation, swapServerUrl: this.selNode.settings.swapServerUrl, boltzServerUrl: this.selNode.settings.boltzServerUrl, enableOffers: this.selNode.settings.enableOffers, enablePeerswap: this.selNode.settings.enablePeerswap } })); - this.store.dispatch(setChildNodeSettingsCL({ + this.store.dispatch(setChildNodeSettingsCLN({ payload: { userPersona: this.selNode.settings.userPersona, channelBackupPath: this.selNode.settings.channelBackupPath, selCurrencyUnit: this.selNode.settings.currencyUnit, currencyUnits: this.selNode.settings.currencyUnits, fiatConversion: this.selNode.settings.fiatConversion, unannouncedChannels: this.selNode.unannouncedChannels, lnImplementation: this.selNode.lnImplementation, swapServerUrl: this.selNode.settings.swapServerUrl, boltzServerUrl: this.selNode.settings.boltzServerUrl, enableOffers: this.selNode.settings.enableOffers, enablePeerswap: this.selNode.settings.enablePeerswap diff --git a/src/app/store/rtl.effects.spec.ts b/src/app/store/rtl.effects.spec.ts index 2296d066..ad8b55ae 100644 --- a/src/app/store/rtl.effects.spec.ts +++ b/src/app/store/rtl.effects.spec.ts @@ -27,7 +27,7 @@ import { RTLEffects } from './rtl.effects'; import { RTLState } from './rtl.state'; import { updateRootAPICallStatus, openSpinner, closeSpinner, openAlert, resetRootStore } from './rtl.actions'; import { resetLNDStore, fetchInfoLND } from '../lnd/store/lnd.actions'; -import { resetCLStore } from '../cln/store/cln.actions'; +import { resetCLNStore } from '../cln/store/cln.actions'; import { resetECLStore } from '../eclair/store/ecl.actions'; describe('RTL Root Effects', () => { @@ -89,7 +89,7 @@ describe('RTL Root Effects', () => { 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(resetCLStore({ 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()[8].args[0]).toEqual(fetchInfoLND({ payload: { loadPage: 'HOME' } })); expect(storeDispatchSpy).toHaveBeenCalledTimes(9);