-
Notifications
You must be signed in to change notification settings - Fork 13
/
env-dynamics.mjs
88 lines (72 loc) · 2.83 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/**
* Convert to bool:
* - true to true
* - 'true' to true
* - 1 to true
* - '1' to true
* - another values to false
* @returns {Boolean}
*/
const toBoolean = (val) => {
return !!(
val?.toLowerCase?.() === 'true' ||
val === true ||
Number.parseInt(val, 10) === 1
);
};
/** @type boolean */
export const ipfsMode = toBoolean(process.env.IPFS_MODE);
/** @type string */
export const selfOrigin = process.env.SELF_ORIGIN || 'https://stake.lido.fi';
// Fix in the build time (build time don't have env vars)
/** @type string */
export const rootOrigin = process.env.ROOT_ORIGIN || 'https://lido.fi';
// Fix in the build time (build time don't have env vars)
/** @type string */
export const docsOrigin = process.env.DOCS_ORIGIN || 'https://docs.lido.fi';
// Fix in the build time (build time don't have env vars)
/** @type string */
export const helpOrigin = process.env.HELP_ORIGIN || 'https://help.lido.fi';
// Fix in the build time (build time don't have env vars)
/** @type string */
export const researchOrigin =
process.env.RESEARCH_ORIGIN || 'https://research.lido.fi';
// Fix in the build time (build time don't have env vars)
/** @type string */
export const blogOrigin = process.env.BLOG_ORIGIN || 'https://blog.lido.fi';
// Fix in the build time (build time don't have env vars)
// Keep fallback as in 'config/get-secret-config.ts'
/** @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 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 prefillUnsafeElRpcUrls11155111 =
process.env.PREFILL_UNSAFE_EL_RPC_URLS_11155111?.split(',') ?? [];
/** @type string[] */
export const prefillUnsafeElRpcUrls10 = process.env.PREFILL_UNSAFE_EL_RPC_URLS_10?.split(',') ?? [];
/** @type string[] */
export const prefillUnsafeElRpcUrls11155420 = process.env.PREFILL_UNSAFE_EL_RPC_URLS_11155420?.split(',') ?? [];
/** @type boolean */
export const enableQaHelpers = toBoolean(process.env.ENABLE_QA_HELPERS);
export const walletconnectProjectId = process.env.WALLETCONNECT_PROJECT_ID;
/** @type string */
export const matomoHost = process.env.MATOMO_URL;
/** @type string */
export const ethAPIBasePath = process.env.ETH_API_BASE_PATH;
/** @type string */
export const wqAPIBasePath = process.env.WQ_API_BASE_PATH;
/** @type string */
/** @type string */
export const widgetApiBasePathForIpfs =
process.env.WIDGET_API_BASE_PATH_FOR_IPFS;
/** @type string */
export const rewardsBackendBasePath = process.env.REWARDS_BACKEND_BASE_PATH;