Skip to content

Commit c81932d

Browse files
committed
Merge branch 'main' of github.com:MetaMask/metamask-mobile into chore-mul-1132-portfolio-view-ff-removal
2 parents 9c9e5cb + 122458d commit c81932d

File tree

463 files changed

+14791
-8361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

463 files changed

+14791
-8361
lines changed

.js.env.example

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1-
# Sign up and generate your own keys at pubnub.com
2-
# Then rename this file to ".js.env" and rebuild the app
3-
#
4-
# In order for this feature to work properly, you need to
5-
# build metamask-extension from source (https://github.com/MetaMask/metamask-extension)
6-
# and set your the same values there.
7-
#
8-
# For more info take a look at https://github.com/MetaMask/metamask-extension/pull/5955
9-
10-
export MM_PUBNUB_SUB_KEY=""
11-
export MM_PUBNUB_PUB_KEY=""
12-
export MM_FOX_CODE="EXAMPLE_FOX_CODE"
13-
14-
# NOTE: Non-MetaMask only, will need to create an account and generate
15-
# API key at https://infura.io in order to connect to main and test nets.
16-
# More info: https://github.com/MetaMask/metamask-mobile/issues/1984
1+
# NOTE: External contributors only - create account at https://developer.metamask.io,
2+
# generate API key, add API key to MM_INFURA_PROJECT_ID below, then rename this file to ".js.env" and rebuild the app.
3+
# Internal contributors: get .js.env file from 1Password.
174

185
export MM_INFURA_PROJECT_ID="null"
6+
7+
# MetaMask Fox Code
8+
# Used as cryptographic salt automatically by app for encryption and transaction identification
9+
# Internal contributors: get real value from 1Password and add to .js.env if needed
10+
# External contributors: leave as "EXAMPLE_FOX_CODE"
11+
export MM_FOX_CODE="EXAMPLE_FOX_CODE"
12+
1913
export IGNORE_BOXLOGS_DEVELOPMENT="false"
2014

2115
# Sentry.init dsn value
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/dist/constants.cjs b/dist/constants.cjs
2+
index 394aca551c114318741b7b54b04ea357de636f88..b35ea08439b898cfba2ca4d9a5005856d7ac77b3 100644
3+
--- a/dist/constants.cjs
4+
+++ b/dist/constants.cjs
5+
@@ -14,5 +14,6 @@ exports.POPULAR_NETWORKS = [
6+
'0x144',
7+
'0x2a15c308d',
8+
'0x3e7', // HyperEVM (999)
9+
+ '0x8f', // Monad
10+
];
11+
//# sourceMappingURL=constants.cjs.map
12+
diff --git a/dist/constants.mjs b/dist/constants.mjs
13+
index abc923ddd7f6611ccb5353ded80fcf87e1ad969e..68a6f478a5d804ec15c5bfa4897d0aa52245246c 100644
14+
--- a/dist/constants.mjs
15+
+++ b/dist/constants.mjs
16+
@@ -11,5 +11,6 @@ export const POPULAR_NETWORKS = [
17+
'0x144',
18+
'0x2a15c308d',
19+
'0x3e7', // HyperEVM (999)
20+
+ '0x8f', // Monad
21+
];
22+
//# sourceMappingURL=constants.mjs.map
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
diff --git a/dist/TransactionController.cjs b/dist/TransactionController.cjs
2+
index 64d41f16b495a364eeeab7d014758355f9a1a879..9648bde2c018274e6ae082dafef6878a64281776 100644
3+
--- a/dist/TransactionController.cjs
4+
+++ b/dist/TransactionController.cjs
5+
@@ -97,6 +97,12 @@ const metadata = {
6+
includeInDebugSnapshot: false,
7+
usedInUi: false,
8+
},
9+
+ swapsTransactions: {
10+
+ includeInStateLogs: true,
11+
+ persist: true,
12+
+ includeInDebugSnapshot: false,
13+
+ usedInUi: true,
14+
+ },
15+
};
16+
const SUBMIT_HISTORY_LIMIT = 100;
17+
/**
18+
diff --git a/dist/TransactionController.mjs b/dist/TransactionController.mjs
19+
index b74920b6fb915b6cae7e074d80c1f307618238c7..05aaef45926e813c76809b442cd27b481db2fd74 100644
20+
--- a/dist/TransactionController.mjs
21+
+++ b/dist/TransactionController.mjs
22+
@@ -99,6 +99,12 @@ const metadata = {
23+
includeInDebugSnapshot: false,
24+
usedInUi: false,
25+
},
26+
+ swapsTransactions: {
27+
+ includeInStateLogs: true,
28+
+ persist: true,
29+
+ includeInDebugSnapshot: false,
30+
+ usedInUi: true,
31+
+ },
32+
};
33+
const SUBMIT_HISTORY_LIMIT = 100;
34+
/**

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,26 @@ To learn how to contribute to the MetaMask codebase, visit our [Contributor Docs
2929

3030
## Getting started
3131

32+
### Infura Project Setup
33+
34+
MetaMask Mobile requires an Infura project ID to connect to blockchain networks.
35+
36+
#### Internal Contributors
37+
38+
1. Grab the `.js.env` file from 1Password, ask around for the correct vault. This file contains the `MM_INFURA_PROJECT_ID`.
39+
40+
#### External Contributors
41+
42+
1. Go to [https://developer.metamask.io](https://developer.metamask.io) and create an account
43+
2. Generate an API key
44+
3. Add API key to `MM_INFURA_PROJECT_ID` in `.js.env.example`
45+
4. Rename `.js.env.example` to `.js.env`
46+
5. Rebuild the app
47+
48+
[!CAUTION]
49+
50+
> Without an Infura project ID, the app cannot connect to blockchain networks.
51+
3252
### Using Expo (recommended)
3353

3454
Expo is the fastest way to start developing. With the Expo framework, developers don't need to compile the native side of the application as before, hence no need for any native environment setup, developers only need to download a precompiled development build and run the javascript bundler. The development build will then connect with the bundler to load the javascript code.

app/component-library/components-temp/MultichainAccounts/MultichainAccountSelectorList/AccountListFooter/AccountListFooter.test.tsx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ describe('AccountListFooter', () => {
112112
onAccountCreated={jest.fn()}
113113
/>,
114114
);
115-
expect(getByText('Create account')).toBeOnTheScreen();
115+
expect(getByText('Add account')).toBeOnTheScreen();
116116
});
117117
});
118118

@@ -125,7 +125,7 @@ describe('AccountListFooter', () => {
125125
/>,
126126
);
127127

128-
fireEvent.press(getByText('Create account'));
128+
fireEvent.press(getByText('Add account'));
129129

130130
await waitFor(() => {
131131
expect(InteractionManager.runAfterInteractions).toHaveBeenCalled();
@@ -140,10 +140,10 @@ describe('AccountListFooter', () => {
140140
/>,
141141
);
142142

143-
fireEvent.press(getByText('Create account'));
143+
fireEvent.press(getByText('Add account'));
144144

145145
await waitFor(() => {
146-
expect(getByText('Creating account...')).toBeOnTheScreen();
146+
expect(getByText('Adding account...')).toBeOnTheScreen();
147147
});
148148
});
149149
});
@@ -161,7 +161,7 @@ describe('AccountListFooter', () => {
161161
/>,
162162
);
163163

164-
fireEvent.press(getByText('Create account'));
164+
fireEvent.press(getByText('Add account'));
165165

166166
await waitFor(() => {
167167
expect(
@@ -184,14 +184,14 @@ describe('AccountListFooter', () => {
184184
/>,
185185
);
186186

187-
fireEvent.press(getByText('Create account'));
187+
fireEvent.press(getByText('Add account'));
188188

189189
await waitFor(() => {
190-
expect(getByText('Creating account...')).toBeOnTheScreen();
190+
expect(getByText('Adding account...')).toBeOnTheScreen();
191191
});
192192

193193
await waitFor(() => {
194-
expect(getByText('Create account')).toBeOnTheScreen();
194+
expect(getByText('Add account')).toBeOnTheScreen();
195195
});
196196
});
197197
});
@@ -205,10 +205,10 @@ describe('AccountListFooter', () => {
205205
/>,
206206
);
207207

208-
fireEvent.press(getByText('Create account'));
208+
fireEvent.press(getByText('Add account'));
209209

210210
await waitFor(() => {
211-
expect(getByText('Creating account...')).toBeOnTheScreen();
211+
expect(getByText('Adding account...')).toBeOnTheScreen();
212212
});
213213
});
214214

@@ -224,14 +224,14 @@ describe('AccountListFooter', () => {
224224
/>,
225225
);
226226

227-
fireEvent.press(getByText('Create account'));
227+
fireEvent.press(getByText('Add account'));
228228

229229
await waitFor(() => {
230-
expect(getByText('Creating account...')).toBeOnTheScreen();
230+
expect(getByText('Adding account...')).toBeOnTheScreen();
231231
});
232232

233233
await waitFor(() => {
234-
expect(getByText('Create account')).toBeOnTheScreen();
234+
expect(getByText('Add account')).toBeOnTheScreen();
235235
});
236236
});
237237

@@ -247,14 +247,14 @@ describe('AccountListFooter', () => {
247247
/>,
248248
);
249249

250-
fireEvent.press(getByText('Create account'));
250+
fireEvent.press(getByText('Add account'));
251251

252252
await waitFor(() => {
253-
expect(getByText('Creating account...')).toBeOnTheScreen();
253+
expect(getByText('Adding account...')).toBeOnTheScreen();
254254
});
255255

256256
await waitFor(() => {
257-
expect(getByText('Create account')).toBeOnTheScreen();
257+
expect(getByText('Add account')).toBeOnTheScreen();
258258
});
259259
});
260260

@@ -272,7 +272,7 @@ describe('AccountListFooter', () => {
272272
/>,
273273
);
274274

275-
expect(getByText('Create account')).toBeOnTheScreen();
275+
expect(getByText('Add account')).toBeOnTheScreen();
276276

277277
// Simulate account syncing starting
278278
mockUseAccountWalletOperationsLoadingStates.mockReturnValue({
@@ -302,7 +302,7 @@ describe('AccountListFooter', () => {
302302
/>,
303303
);
304304

305-
expect(getByText('Create account')).toBeOnTheScreen();
305+
expect(getByText('Add account')).toBeOnTheScreen();
306306
});
307307
});
308308

@@ -315,7 +315,7 @@ describe('AccountListFooter', () => {
315315
/>,
316316
);
317317

318-
fireEvent.press(getByText('Create account'));
318+
fireEvent.press(getByText('Add account'));
319319

320320
await waitFor(() => {
321321
expect(InteractionManager.runAfterInteractions).toHaveBeenCalledWith(
@@ -339,7 +339,7 @@ describe('AccountListFooter', () => {
339339
/>,
340340
);
341341

342-
fireEvent.press(getByText('Create account'));
342+
fireEvent.press(getByText('Add account'));
343343

344344
await waitFor(() => {
345345
expect(mockLogger.error).toHaveBeenCalledWith(
@@ -349,7 +349,7 @@ describe('AccountListFooter', () => {
349349
});
350350

351351
await waitFor(() => {
352-
expect(getByText('Create account')).toBeOnTheScreen();
352+
expect(getByText('Add account')).toBeOnTheScreen();
353353
});
354354

355355
expect(
@@ -372,7 +372,7 @@ describe('AccountListFooter', () => {
372372
/>,
373373
);
374374

375-
fireEvent.press(getByText('Create account'));
375+
fireEvent.press(getByText('Add account'));
376376

377377
await waitFor(() => {
378378
expect(onAccountCreated).toHaveBeenCalledWith('new-account-group-id');
@@ -381,18 +381,18 @@ describe('AccountListFooter', () => {
381381
});
382382

383383
describe('Wallet Type Filtering', () => {
384-
it('renders create account button only for Entropy wallet type', () => {
384+
it('renders Add account button only for Entropy wallet type', () => {
385385
const { getByText } = render(
386386
<AccountListFooter
387387
walletId={mockWalletId}
388388
onAccountCreated={jest.fn()}
389389
/>,
390390
);
391391

392-
expect(getByText('Create account')).toBeOnTheScreen();
392+
expect(getByText('Add account')).toBeOnTheScreen();
393393
});
394394

395-
it('does not render create account button for non-Entropy wallet types', () => {
395+
it('does not render Add account button for non-Entropy wallet types', () => {
396396
const testCases = [
397397
{
398398
name: 'Keyring wallet type',
@@ -427,11 +427,11 @@ describe('AccountListFooter', () => {
427427
/>,
428428
);
429429

430-
expect(queryByText('Create account')).not.toBeOnTheScreen();
430+
expect(queryByText('Add account')).not.toBeOnTheScreen();
431431
});
432432
});
433433

434-
it('does not render create account button when wallet is undefined', () => {
434+
it('does not render Add account button when wallet is undefined', () => {
435435
// Override the selector mock for this test
436436
(useSelector as jest.Mock).mockImplementationOnce((selector: unknown) => {
437437
if (selector === selectWalletsMap) {
@@ -447,7 +447,7 @@ describe('AccountListFooter', () => {
447447
/>,
448448
);
449449

450-
expect(queryByText('Create account')).not.toBeOnTheScreen();
450+
expect(queryByText('Add account')).not.toBeOnTheScreen();
451451
});
452452
});
453453
});

app/component-library/components-temp/MultichainAccounts/MultichainAccountSelectorList/MultichainAccountSelectorList.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ describe('MultichainAccountSelectorList', () => {
725725

726726
// Verify the component renders correctly with AccountListFooter
727727
expect(getByText('Account 1')).toBeTruthy();
728-
expect(getByText('Create account')).toBeTruthy();
728+
expect(getByText('Add account')).toBeTruthy();
729729
});
730730

731731
it('handles multiple wallets with AccountListFooter', () => {
@@ -757,8 +757,8 @@ describe('MultichainAccountSelectorList', () => {
757757
{ state: createMockState([wallet1, wallet2], internalAccounts) },
758758
);
759759

760-
// Should have multiple "Create account" buttons (one per wallet)
761-
const createAccountButtons = getAllByText('Create account');
760+
// Should have multiple "Add account" buttons (one per wallet)
761+
const createAccountButtons = getAllByText('Add account');
762762
expect(createAccountButtons.length).toBe(2);
763763
});
764764

@@ -783,7 +783,7 @@ describe('MultichainAccountSelectorList', () => {
783783

784784
// Verify the component renders correctly
785785
expect(getByText('Account 1')).toBeTruthy();
786-
expect(getByText('Create account')).toBeTruthy();
786+
expect(getByText('Add account')).toBeTruthy();
787787
});
788788

789789
it('positions the list so the first selected account is initially visible', () => {

app/components/Nav/Main/MainNavigator.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import AdvancedSettings from '../../Views/Settings/AdvancedSettings';
1313
import BackupAndSyncSettings from '../../Views/Settings/Identity/BackupAndSyncSettings';
1414
import SecuritySettings from '../../Views/Settings/SecuritySettings';
1515
import ExperimentalSettings from '../../Views/Settings/ExperimentalSettings';
16-
import NetworksSettings from '../../Views/Settings/NetworksSettings';
1716
import NotificationsSettings from '../../Views/Settings/NotificationsSettings';
1817
import NotificationsView from '../../Views/Notifications';
1918
import NotificationsDetails from '../../Views/Notifications/Details';
@@ -394,11 +393,6 @@ const SettingsFlow = () => (
394393
component={ExperimentalSettings}
395394
options={ExperimentalSettings.navigationOptions}
396395
/>
397-
<Stack.Screen
398-
name="NetworksSettings"
399-
component={NetworksSettings}
400-
options={NetworksSettings.navigationOptions}
401-
/>
402396
<Stack.Screen
403397
name="CompanySettings"
404398
component={AppInformation}

app/components/UI/AddCustomToken/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -533,20 +533,20 @@ class AddCustomToken extends PureComponent {
533533
const addressInputStyle = onFocusAddress
534534
? { ...styles.textInput, ...styles.textInputFocus }
535535
: warningAddress
536-
? styles.textInputError
537-
: styles.textInput;
536+
? styles.textInputError
537+
: styles.textInput;
538538

539539
const textInputDecimalsStyle = !isDecimalEditable
540540
? { ...styles.textInput, ...styles.textInputDisabled }
541541
: warningDecimals
542-
? styles.textInputError
543-
: styles.textInput;
542+
? styles.textInputError
543+
: styles.textInput;
544544

545545
const textInputSymbolStyle = !isSymbolEditable
546546
? { ...styles.textInput, ...styles.textInputDisabled }
547547
: warningSymbol
548-
? styles.textInputError
549-
: styles.textInput;
548+
? styles.textInputError
549+
: styles.textInput;
550550

551551
const { title, url } = getBlockExplorerAddressUrl(
552552
this.props.type,

0 commit comments

Comments
 (0)