-
Notifications
You must be signed in to change notification settings - Fork 306
/
index.ts
65 lines (55 loc) · 2.28 KB
/
index.ts
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
const devOnly = process.env.NODE_ENV === 'development'
const prodOnly = process.env.NODE_ENV === 'production'
const insiderOnly = process.env.channel === 'insider' || devOnly
const betaOrInsiderOnly = insiderOnly || process.env.channel === 'beta'
// TODO: In future, we can turn this object into a Proxy to receive flags from remote
export const flags = {
isolated_dashboard_bridge_enabled: false,
mask_SDK_ready: betaOrInsiderOnly,
/** Firefox has a special API that can inject to the document with a higher permission. */
has_firefox_xray_vision: !!globalThis.navigator?.userAgent.includes('Firefox'),
support_testnet_switch: betaOrInsiderOnly,
shadowRootInit: {
mode: '__REACT_DEVTOOLS_GLOBAL_HOOK__' in globalThis || betaOrInsiderOnly ? 'open' : 'closed',
delegatesFocus: true,
} as const satisfies ShadowRootInit,
// #region Experimental features
trader_all_api_cached_enabled: devOnly,
/** Prohibit the use of test networks in production */
wallet_allow_testnet: betaOrInsiderOnly || process.env.NODE_ENV !== 'production',
// #endregion
bsc_enabled: true,
polygon_enabled: true,
arbitrum_enabled: true,
xdai_enabled: true,
optimism_enabled: true,
avalanche_enabled: true,
fantom_enabled: true,
celo_enabled: true,
aurora_enabled: true,
astar_enabled: true,
nft_airdrop_enabled: false,
post_actions_enabled: true,
next_id_tip_enabled: true,
using_emoji_flag: true,
i18nTranslationHotUpdate: true,
sandboxedPluginRuntime: false,
/** The earliest version for the sentry to watch events and exceptions. */
sentry_earliest_version: process.env.VERSION,
sentry_sample_rate: 0.05,
sentry_enabled: prodOnly,
sentry_event_enabled: prodOnly,
sentry_exception_enabled: prodOnly,
sentry_fetch_transaction_enabled: prodOnly,
sentry_async_transaction_enabled: devOnly,
// wallet connect
wc_mode: process.env.NODE_ENV === 'production' ? 'error' : 'debug',
wc_relay_url: 'wss://relay.walletconnect.com',
wc_project_id: '8f1769933420afe8873860925fcca14f',
wc_v1_enabled: true,
wc_v2_enabled: true,
} as const
Object.freeze(flags.shadowRootInit)
if (process.env.NODE_ENV === 'development') {
console.log('Mask Network starts with flags:', flags)
}