-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathfeature-flags-mocks.ts
More file actions
207 lines (194 loc) · 6.11 KB
/
feature-flags-mocks.ts
File metadata and controls
207 lines (194 loc) · 6.11 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
export const confirmationFeatureFlags = [
{
mobileMinimumVersions: {
appMinimumBuild: 1243,
appleMinimumOS: 6,
androidMinimumAPIVersion: 21,
},
},
{
confirmations_eip_7702: {
contracts: {
'0xaa36a7': [
{
signature:
'0x016cf109489c415ba28e695eb3cb06ac46689c5c49e2aba101d7ec2f68c890282563b324f5c8df5e0536994451825aa235438b7346e8c18b4e64161d990781891c',
address: '0xCd8D6C5554e209Fbb0deC797C6293cf7eAE13454',
},
],
'0x539': [
{
address: '0x8438Ad1C834623CfF278AB6829a248E37C2D7E3f',
signature:
'0x4c15775d0c6d5bd37a7aa7aafc62e85597ea705024581b8b5cb0edccc4e6a69e26c495b3ae725815a377c9789bff43bf19e4dd1eaa679e65133e49ceee3ea87f1b',
},
],
'0x1': [
{
address: '0xabcabcabcabcabcabcabcabcabcabcabcabcabca',
signature:
'0x5b394cc656b760fc15e855f9b8b9d0eec6337328361771c696d7f5754f0348e06298d34243e815ff8b5ce869e5f310c37dd100c1827e91b56bb208d1fafcf3a71c',
},
],
'0x89': [
{
address: '0x63c0c19a282a1B52b07dD5a65b58948A07DAE32B',
signature:
'0x302aa2d59940e88f35d2fa140fe6a1e9dc682218a444a7fb2d88f007fbe7792b2b8d615f5ae1e4f184533a02c47d8ac0f6ba3f591679295dff93c65095c0f03d1b',
},
],
},
supportedChains: ['0xaa36a7', '0x539', '0x1', '0x89'],
},
},
];
export const remoteFeatureEip7702 = [
{
mobileMinimumVersions: {
appMinimumBuild: 1243,
appleMinimumOS: 6,
androidMinimumAPIVersion: 21,
},
},
{
confirmations_eip_7702: {
contracts: {
'0xaa36a7': [
{
signature:
'0x016cf109489c415ba28e695eb3cb06ac46689c5c49e2aba101d7ec2f68c890282563b324f5c8df5e0536994451825aa235438b7346e8c18b4e64161d990781891c',
address: '0xCd8D6C5554e209Fbb0deC797C6293cf7eAE13454',
},
],
'0x539': [
{
address: '0x8438Ad1C834623CfF278AB6829a248E37C2D7E3f',
signature:
'0x4c15775d0c6d5bd37a7aa7aafc62e85597ea705024581b8b5cb0edccc4e6a69e26c495b3ae725815a377c9789bff43bf19e4dd1eaa679e65133e49ceee3ea87f1b',
},
],
'0x1': [
{
address: '0xabcabcabcabcabcabcabcabcabcabcabcabcabca',
signature:
'0x5b394cc656b760fc15e855f9b8b9d0eec6337328361771c696d7f5754f0348e06298d34243e815ff8b5ce869e5f310c37dd100c1827e91b56bb208d1fafcf3a71c',
},
],
'0x89': [
{
name: 'Polygon',
signature:
'0x302aa2d59940e88f35d2fa140fe6a1e9dc682218a444a7fb2d88f007fbe7792b2b8d615f5ae1e4f184533a02c47d8ac0f6ba3f591679295dff93c65095c0f03d1b',
address: '0x63c0c19a282a1B52b07dD5a65b58948A07DAE32B',
},
],
},
supportedChains: ['0xaa36a7', '0x539', '0x1', '0x89'],
},
},
];
export const remoteFeatureMultichainAccountsAccountDetails = (
enabled = true,
) => ({
enableMultichainAccounts: {
enabled,
featureVersion: '1',
minimumVersion: '7.46.0',
},
});
export const remoteFeatureMultichainAccountsAccountDetailsV2 = (
enabled = true,
) => ({
enableMultichainAccountsState2: {
enabled,
featureVersion: '2',
minimumVersion: '7.46.0',
},
});
/**
* Disables the full-screen Predict / Polymarket GTM onboarding shown after reaching wallet home.
* Production remote-flag defaults enable this; `selectPredictGtmOnboardingModalEnabledFlag` prefers
* the remote value over `MM_PREDICT_GTM_MODAL_ENABLED`, so E2E tests should merge this into
* {@link setupRemoteFeatureFlagsMock} when the modal would block flows.
*/
export const remoteFeaturePredictGtmOnboardingModalDisabled = () => ({
predictGtmOnboardingModalEnabled: {
enabled: false,
minimumVersion: '7.60.0',
},
});
export const remoteFeatureFlagPredictEnabled = (enabled = true) => ({
predictEnabled: enabled,
predictTradingEnabled: {
enabled,
minimumVersion: '7.60.0',
},
predictGtmOnboardingModalEnabled: {
enabled: false,
minimumVersion: '7.60.0',
},
});
export const remoteFeatureFlagHomepageSectionsV1Enabled = (enabled = true) => ({
homepageSectionsV1: {
enabled,
minimumVersion: '0.0.0',
},
});
export const remoteFeatureFlagRampsUnifiedV1Enabled = (active = true) => ({
rampsUnifiedBuyV1: {
active,
minimumVersion: '7.61.0',
},
});
export const remoteFeatureFlagRampsUnifiedV2Enabled = (enabled = true) => ({
rampsUnifiedBuyV2: {
enabled,
minimumVersion: '7.63.0',
},
});
/**
* Enables both V1 and V2 unified ramps.
* V2 requires V1 to be enabled for the buy button to show.
*/
export const remoteFeatureFlagRampsUnifiedEnabled = (active = true) => ({
...remoteFeatureFlagRampsUnifiedV1Enabled(active),
...remoteFeatureFlagRampsUnifiedV2Enabled(active),
});
/**
* Independent V1/V2 toggles for E2E. Uses minimumVersion 0.0.0 so debug builds pass the gate.
* Pair with FixtureBuilder.withRampsUnifiedBuyRemoteFlagsSeededForE2E({ rampsUnifiedBuyV1, rampsUnifiedBuyV2 }).
*/
export const remoteFeatureFlagRampsUnifiedMatrixForE2E = (
rampsUnifiedBuyV1Active: boolean,
rampsUnifiedBuyV2Enabled: boolean,
) => ({
rampsUnifiedBuyV1: {
active: rampsUnifiedBuyV1Active,
minimumVersion: '0.0.0',
},
rampsUnifiedBuyV2: {
enabled: rampsUnifiedBuyV2Enabled,
minimumVersion: '0.0.0',
},
});
export const remoteFeatureFlagTrendingTokensEnabled = (enabled = true) => ({
trendingTokens: enabled,
});
export const remoteFeatureFlagTronAccounts = (enabled = true) => ({
tronAccounts: {
enabled,
minimumVersion: '0.0.0',
},
});
/**
* Enables the Market Insights (AI social market analysis) feature on asset details.
* Uses minimumVersion '0.0.0' so debug/test builds always pass the version gate.
* Selector: selectMarketInsightsEnabled (featureFlagController/marketInsights/index.ts)
* Flag key: aiSocialMarketAnalysisEnabled
*/
export const remoteFeatureFlagMarketInsightsEnabled = (enabled = true) => ({
aiSocialMarketAnalysisEnabled: {
enabled,
minimumVersion: '0.0.0',
},
});