Skip to content

Commit 9e33d31

Browse files
Store update with connect URL
1 parent a21d37f commit 9e33d31

File tree

3 files changed

+42
-34
lines changed

3 files changed

+42
-34
lines changed

apps/frontend/src/store/rootSelectors.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import { ApplicationModes, Units } from '../utilities/constants';
55

66
export const defaultRootState: RootState = {
77
authStatus: { isLoading: true, isAuthenticated: false, isValidPassword: true },
8-
showModals: { nodeInfoModal: false, connectWalletModal: false, loginModal: false, logoutModal: false, setPasswordModal: false, sqlTerminalModal: false },
8+
showModals: { nodeInfoModal: false, connectWalletModal: false, loginModal: false, logoutModal: false, setPasswordModal: false, sqlTerminalModal: false, qrCodeLarge: false, },
99
showToast: { show: false, message: '' },
1010
connectWallet: { isLoading: true },
11+
connectionUrl: '',
1112
appConfig: {
1213
isLoading: true,
1314
uiConfig: { unit: Units.SATS, fiatUnit: 'USD', appMode: ApplicationModes.LIGHT },
14-
serverConfig: { singleSignOn: false, lightningNodeType: 'CLN' },
15+
serverConfig: { singleSignOn: false },
1516
},
1617
fiatConfig: { isLoading: true, symbol: faDollarSign, venue: '', rate: 1 },
1718
walletBalances: {
@@ -61,6 +62,11 @@ export const selectWalletConnect = createSelector(
6162
(root) => root.connectWallet
6263
);
6364

65+
export const selectConnectionUrl = createSelector(
66+
selectRootState,
67+
(root) => root.connectionUrl
68+
);
69+
6470
export const selectAppConfig = createSelector(
6571
selectRootState,
6672
(root) => root.appConfig

apps/frontend/src/store/rootSlice.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ const rootSlice = createSlice({
9494
setConnectWallet(state, action: PayloadAction<RootState['connectWallet']>) {
9595
state.connectWallet = action.payload;
9696
},
97+
setConnectionUrl(state, action: PayloadAction<RootState['connectionUrl']>) {
98+
state.connectionUrl = action.payload;
99+
},
97100
setConfig(state, action: PayloadAction<RootState['appConfig']>) {
98101
state.appConfig = action.payload;
99102
},
@@ -133,6 +136,7 @@ export const {
133136
setShowModals,
134137
setShowToast,
135138
setConnectWallet,
139+
setConnectionUrl,
136140
setConfig,
137141
setFiatConfig,
138142
setNodeInfo,

apps/frontend/src/types/root.type.ts

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export type RootState = {
1717
showModals: ModalConfig;
1818
showToast: ToastConfig;
1919
connectWallet: WalletConnect;
20+
connectionUrl: string;
2021
appConfig: ApplicationConfiguration;
2122
fiatConfig: FiatConfig;
2223
walletBalances: WalletBalances;
@@ -50,52 +51,49 @@ export type NodeInfo = {
5051
error?: any;
5152
};
5253

53-
export type ConnectWalletFields = {
54-
protocol?: { title: string; field: string; };
55-
host: { title: string; field: string; };
56-
port: { title: string; field: string; }; // REST, Websocket or gRPC
57-
rune?: { title: string; field: string; };
58-
invoiceRune?: { title: string; field: string; };
59-
clientKey?: { title: string; field: string; };
60-
clientCert?: { title: string; field: string; };
61-
caCert?: { title: string; field: string; };
62-
connectUrl?: { title: string; field: string; };
63-
}
64-
6554
export type WalletConnect = {
6655
isLoading: boolean;
67-
SINGLE_SIGN_ON?: boolean;
68-
LOCAL_HOST?: string;
69-
DEVICE_DOMAIN_NAME?: string;
70-
BITCOIN_NODE_IP?: string;
56+
APP_SINGLE_SIGN_ON?: boolean;
57+
BITCOIN_HOST?: string;
7158
BITCOIN_NETWORK?: string;
59+
APP_PROTOCOL?: string;
60+
APP_HOST?: string;
61+
APP_PORT?: string;
7262
APP_CONFIG_FILE?: string;
7363
APP_LOG_FILE?: string;
7464
APP_MODE?: string;
7565
APP_CONNECT?: string;
76-
APP_PROTOCOL?: string;
77-
APP_IP?: string;
78-
APP_PORT?: string;
79-
LIGHTNING_IP?: string;
80-
LIGHTNING_PATH?: string;
81-
HIDDEN_SERVICE_URL?: string;
82-
TOR_SERVICE?: string;
83-
LIGHTNING_NODE_TYPE?: string;
84-
COMMANDO_CONFIG?: string;
66+
LIGHTNING_DATA_DIR?: string;
67+
LIGHTNING_HOST?: string;
68+
LIGHTNING_TOR_HOST?: string;
69+
LIGHTNING_VARS_FILE?: string;
8570
LIGHTNING_WS_PROTOCOL?: string;
8671
LIGHTNING_WS_PORT?: number;
72+
LIGHTNING_WS_CLIENT_KEY_FILE?: string;
73+
LIGHTNING_WS_CLIENT_CERT_FILE?: string;
74+
LIGHTNING_WS_CA_CERT_FILE?: string;
8775
LIGHTNING_REST_PROTOCOL?: string;
76+
LIGHTNING_REST_HOST?: string;
77+
LIGHTNING_REST_TOR_HOST?: string;
8878
LIGHTNING_REST_PORT?: number;
89-
LIGHTNING_CERTS_PATH?: string;
90-
LIGHTNING_GRPC_PROTOCOL?: string;
79+
LIGHTNING_REST_CLIENT_KEY_FILE?: string;
80+
LIGHTNING_REST_CLIENT_CERT_FILE?: string;
81+
LIGHTNING_REST_CA_CERT_FILE?: string;
82+
LIGHTNING_GRPC_HOST?: string;
83+
LIGHTNING_GRPC_TOR_HOST?: string;
9184
LIGHTNING_GRPC_PORT?: number;
85+
LIGHTNING_GRPC_PROTO_PATH?: string;
86+
LIGHTNING_GRPC_CLIENT_KEY_FILE?: string;
87+
LIGHTNING_GRPC_CLIENT_CERT_FILE?: string;
88+
LIGHTNING_GRPC_CA_CERT_FILE?: string;
89+
// Not added by the user
9290
APP_VERSION?: string;
9391
NODE_PUBKEY?: string;
94-
COMMANDO_RUNE?: string;
92+
ADMIN_RUNE?: string;
9593
INVOICE_RUNE?: string;
96-
CLIENT_KEY?: string;
97-
CLIENT_CERT?: string;
98-
CA_CERT?: string;
94+
LIGHTNING_WS_TLS_CERTS?: string;
95+
LIGHTNING_REST_TLS_CERTS?: string;
96+
LIGHTNING_GRPC_TLS_CERTS?: string;
9997
error?: any;
10098
};
10199

@@ -111,7 +109,6 @@ export type ApplicationConfiguration = {
111109
appPort?: string;
112110
appProtocol?: string;
113111
appVersion?: string;
114-
lightningNodeType?: string;
115112
singleSignOn?: boolean;
116113
}
117114
error?: any;
@@ -132,6 +129,7 @@ export type ModalConfig = {
132129
logoutModal: boolean;
133130
setPasswordModal: boolean;
134131
sqlTerminalModal: boolean;
132+
qrCodeLarge: boolean;
135133
};
136134

137135
export type ToastConfig = {

0 commit comments

Comments
 (0)