generated from lidofinance/lido-frontend-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathenv-dynamics.mjs
46 lines (39 loc) · 1.21 KB
/
env-dynamics.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* Convert to bool:
* - true to true
* - 'true' to true
* - 1 to true
* - '1' to true
* - another values to false
* @returns {Boolean}
*/
const toBoolean = (dataStr) => {
return !!(
dataStr?.toLowerCase?.() === 'true' ||
dataStr === true ||
Number.parseInt(dataStr, 10) === 1
);
};
/** @type string */
export const matomoHost = process.env.MATOMO_URL;
/** @type number */
export const defaultChain = parseInt(process.env.DEFAULT_CHAIN, 10) || 17000;
/** @type number[] */
export const supportedChains = process.env?.SUPPORTED_CHAINS?.split(',').map(
(chainId) => parseInt(chainId, 10),
) ?? [17000];
/** @type string */
export const walletconnectProjectId = process.env.WALLETCONNECT_PROJECT_ID;
/** @type boolean */
export const ipfsMode = toBoolean(process.env.IPFS_MODE);
/** @type string[] */
export const prefillUnsafeElRpcUrls1 =
process.env.PREFILL_UNSAFE_EL_RPC_URLS_1?.split(',') ?? [];
/** @type string[] */
export const prefillUnsafeElRpcUrls17000 =
process.env.PREFILL_UNSAFE_EL_RPC_URLS_17000?.split(',') ?? [];
/** @type string */
export const widgetApiBasePathForIpfs =
process.env.WIDGET_API_BASE_PATH_FOR_IPFS;
/** @type string */
export const surveyApi = process.env.SURVEY_API;