Skip to content

Commit e9aae1c

Browse files
authored
Merge branch 'main' into refactor-parse-signTypedData-logic
2 parents 7ae1331 + 122c3e1 commit e9aae1c

File tree

187 files changed

+4919
-2714
lines changed

Some content is hidden

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

187 files changed

+4919
-2714
lines changed

CHANGELOG.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- fix(swaps): set default slippage when source or destination token is not stablecoin ([#14730](https://github.com/MetaMask/metamask-mobile/pull/14730))
13+
1014
### Changed
1115

1216
- fix(multi-srp): display errors only after all the words are have been entered ([#14607](https://github.com/MetaMask/metamask-mobile/pull/14607))
1317

1418
### Added
1519

20+
- feat(bridge): add solana chain support and improve bridge state management ([#14713](https://github.com/MetaMask/metamask-mobile/pull/14713))
1621
- feat(bridge): add error handling and input management for bridge quotes ([#14693](https://github.com/MetaMask/metamask-mobile/pull/14693))
1722
- feat(multi-srp): enable multi-srp in main and beta ([#14558](https://github.com/MetaMask/metamask-mobile/pull/14558))
1823
- feat(ramp): Update ramp data flow to fetch cryptos before payment methods ([#14437](https://github.com/MetaMask/metamask-mobile/pull/14437))
@@ -21,12 +26,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2126
- feat: add AppMetadataController controller ([#14513](https://github.com/MetaMask/metamask-mobile/pull/14513))
2227
- feat(bridge): implement bridge quote fetching ([#14413](https://github.com/MetaMask/metamask-mobile/pull/14413))
2328
- feat(multi-srp): add e2e tests ([#14583](https://github.com/MetaMask/metamask-mobile/pull/14583))
24-
29+
- feat(bridge): fetch token metadata for Bridge token pickers if not already available ([#14699](https://github.com/MetaMask/metamask-mobile/pull/14699))
30+
- feat(bridge): use `BridgeStatusController` for EVM and Solana Bridge transaction submission ([#14708](https://github.com/MetaMask/metamask-mobile/pull/14708))
2531

2632
### Changed
2733

2834
- feat(bridge): Handle Solana vs EVM swap and bridge routing ([#14614](https://github.com/MetaMask/metamask-mobile/pull/14614))
2935

36+
### Fixed
37+
38+
- fix(bridge): fix not switching networks when selecting source token ([#14712](https://github.com/MetaMask/metamask-mobile/pull/14712))
39+
3040
## [7.44.0]
3141

3242
### Added
@@ -99,11 +109,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99109
- fix: inherit icon size from text component parent ([#14024](https://github.com/MetaMask/metamask-mobile/pull/14024))
100110
- fix: animation added for loading state on SnapUILink button ([#13973](https://github.com/MetaMask/metamask-mobile/pull/13973))
101111
- fix: Revert "chore: upgrade Xcode 16 on bitrise.yml" ([#14012](https://github.com/MetaMask/metamask-mobile/pull/14012))
102-
103-
### Fixed
104-
105112
- fix(bridge): hide staked native assets from token selectors ([#14457](https://github.com/MetaMask/metamask-mobile/pull/14457))
106113

114+
107115
## [7.43.0]
108116

109117
### Added

app/components/Approvals/PermissionApproval/PermissionApproval.test.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ describe('PermissionApproval', () => {
147147
2: 'testAccount2',
148148
3: 'testAccount3',
149149
},
150+
accountsByChainId: {
151+
'0x1': {
152+
1: 'testAccount',
153+
2: 'testAccount2',
154+
3: 'testAccount3',
155+
},
156+
},
150157
},
151158
},
152159
},

app/components/Nav/App/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ import {
129129
} from '../../../util/trace';
130130
import getUIStartupSpan from '../../../core/Performance/UIStartup';
131131
import { selectUserLoggedIn } from '../../../reducers/user/selectors';
132-
import { Confirm } from '../../Views/confirmations/Confirm';
132+
import { Confirm } from '../../Views/confirmations/components/confirm';
133133
///: BEGIN:ONLY_INCLUDE_IF(multi-srp)
134134
import ImportNewSecretRecoveryPhrase from '../../Views/ImportNewSecretRecoveryPhrase';
135135
import { SelectSRPBottomSheet } from '../../Views/SelectSRP/SelectSRPBottomSheet';

app/components/Nav/Main/RootRPCMethodsUI.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ import { getDeviceId } from '../../../core/Ledger/Ledger';
6262
import { selectSelectedInternalAccountFormattedAddress } from '../../../selectors/accountsController';
6363
import { createLedgerTransactionModalNavDetails } from '../../UI/LedgerModals/LedgerTransactionModal';
6464
import ExtendedKeyringTypes from '../../../constants/keyringTypes';
65-
import { ConfirmRoot } from '../../../components/Views/confirmations/Confirm';
65+
import { ConfirmRoot } from '../../../components/Views/confirmations/components/confirm';
6666
import { useMetrics } from '../../../components/hooks/useMetrics';
6767
import { selectShouldUseSmartTransaction } from '../../../selectors/smartTransactionsController';
6868
import { STX_NO_HASH_ERROR } from '../../../util/smart-transactions/smart-publish-hook';

app/components/Snaps/SnapInterfaceContext.test.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ describe('SnapInterfaceContext', () => {
3030
},
3131
};
3232

33-
const mockContext = {};
3433
const mockInterfaceId = 'test-interface';
3534
const mockSnapId = 'test-snap';
3635

@@ -39,7 +38,6 @@ describe('SnapInterfaceContext', () => {
3938
interfaceId={mockInterfaceId}
4039
snapId={mockSnapId}
4140
initialState={mockInitialState}
42-
context={mockContext}
4341
>
4442
{children}
4543
</SnapInterfaceContextProvider>

app/components/Snaps/SnapInterfaceContext.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
State,
66
UserInputEventType,
77
} from '@metamask/snaps-sdk';
8-
import { Json } from '@metamask/utils';
98
import React, {
109
FunctionComponent,
1110
createContext,
@@ -50,7 +49,6 @@ export interface SnapInterfaceContextProviderProps {
5049
interfaceId: string;
5150
snapId: string;
5251
initialState: InterfaceState;
53-
context: Json;
5452
}
5553
/**
5654
* The Snap interface context provider that handles all the interface state operations.
@@ -60,12 +58,11 @@ export interface SnapInterfaceContextProviderProps {
6058
* @param params.interfaceId - The interface ID to use.
6159
* @param params.snapId - The Snap ID that requested the interface.
6260
* @param params.initialState - The initial state of the interface.
63-
* @param params.context - The context blob of the interface.
6461
* @returns The context provider.
6562
*/
6663
export const SnapInterfaceContextProvider: FunctionComponent<
6764
SnapInterfaceContextProviderProps
68-
> = ({ children, interfaceId, snapId, initialState, context }) => {
65+
> = ({ children, interfaceId, snapId, initialState }) => {
6966
// We keep an internal copy of the state to speed up the state update in the
7067
// UI. It's kept in a ref to avoid useless re-rendering of the entire tree of
7168
// components.
@@ -87,7 +84,7 @@ export const SnapInterfaceContextProvider: FunctionComponent<
8784
) => {
8885
handleSnapRequest(controllerMessenger, {
8986
snapId: snapId as SnapId,
90-
origin: '',
87+
origin: 'metamask',
9188
handler: HandlerType.OnUserInput,
9289
request: {
9390
jsonrpc: '2.0',
@@ -99,7 +96,6 @@ export const SnapInterfaceContextProvider: FunctionComponent<
9996
...(value !== undefined && value !== null ? { value } : {}),
10097
},
10198
id: interfaceId,
102-
context,
10399
},
104100
},
105101
});

app/components/Snaps/SnapUICard/SnapUICard.tsx

+13-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import Text, {
77
import { SnapUIImage } from '../SnapUIImage/SnapUIImage';
88
import {
99
FlexDirection,
10-
TextAlign,
1110
JustifyContent,
1211
AlignItems,
1312
} from '../../UI/Box/box.types';
@@ -54,12 +53,22 @@ export const SnapUICard: FunctionComponent<SnapUICardProps> = ({
5453
)}
5554
</Box>
5655
</Box>
57-
<Box flexDirection={FlexDirection.Column} textAlign={TextAlign.right}>
58-
<Text variant={TextVariant.BodyMDMedium} ellipsizeMode="tail">
56+
<Box flexDirection={FlexDirection.Column}>
57+
<Text
58+
variant={TextVariant.BodyMDMedium}
59+
ellipsizeMode="tail"
60+
// eslint-disable-next-line react-native/no-inline-styles
61+
style={{ textAlign: 'right' }}
62+
>
5963
{value}
6064
</Text>
6165
{extra && (
62-
<Text color={TextColor.Alternative} ellipsizeMode="tail">
66+
<Text
67+
color={TextColor.Alternative}
68+
ellipsizeMode="tail"
69+
// eslint-disable-next-line react-native/no-inline-styles
70+
style={{ textAlign: 'right' }}
71+
>
6372
{extra}
6473
</Text>
6574
)}

app/components/Snaps/SnapUIRenderer/SnapUIRenderer.test.tsx

+6-12
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,11 @@ describe('SnapUIRenderer', () => {
265265
'SnapController:handleRequest',
266266
{
267267
handler: 'onUserInput',
268-
origin: '',
268+
origin: 'metamask',
269269
request: {
270270
jsonrpc: '2.0',
271271
method: ' ',
272272
params: {
273-
context: null,
274273
event: { name: 'input', type: 'InputChangeEvent', value: 'a' },
275274
id: MOCK_INTERFACE_ID,
276275
},
@@ -402,12 +401,11 @@ describe('SnapUIRenderer', () => {
402401
'SnapController:handleRequest',
403402
{
404403
handler: 'onUserInput',
405-
origin: '',
404+
origin: 'metamask',
406405
request: {
407406
jsonrpc: '2.0',
408407
method: ' ',
409408
params: {
410-
context: null,
411409
event: { name: 'input', type: 'InputChangeEvent', value: 'abc' },
412410
id: MOCK_INTERFACE_ID,
413411
},
@@ -430,12 +428,11 @@ describe('SnapUIRenderer', () => {
430428
'SnapController:handleRequest',
431429
{
432430
handler: 'onUserInput',
433-
origin: '',
431+
origin: 'metamask',
434432
request: {
435433
jsonrpc: '2.0',
436434
method: ' ',
437435
params: {
438-
context: null,
439436
event: { name: 'checkbox', type: 'InputChangeEvent', value: true },
440437
id: MOCK_INTERFACE_ID,
441438
},
@@ -461,12 +458,11 @@ describe('SnapUIRenderer', () => {
461458
'SnapController:handleRequest',
462459
{
463460
handler: 'onUserInput',
464-
origin: '',
461+
origin: 'metamask',
465462
request: {
466463
jsonrpc: '2.0',
467464
method: ' ',
468465
params: {
469-
context: null,
470466
event: {
471467
name: 'selector',
472468
type: 'InputChangeEvent',
@@ -487,12 +483,11 @@ describe('SnapUIRenderer', () => {
487483
'SnapController:handleRequest',
488484
{
489485
handler: 'onUserInput',
490-
origin: '',
486+
origin: 'metamask',
491487
request: {
492488
jsonrpc: '2.0',
493489
method: ' ',
494490
params: {
495-
context: null,
496491
event: { name: 'submit', type: 'ButtonClickEvent' },
497492
id: MOCK_INTERFACE_ID,
498493
},
@@ -506,12 +501,11 @@ describe('SnapUIRenderer', () => {
506501
'SnapController:handleRequest',
507502
{
508503
handler: 'onUserInput',
509-
origin: '',
504+
origin: 'metamask',
510505
request: {
511506
jsonrpc: '2.0',
512507
method: ' ',
513508
params: {
514-
context: null,
515509
event: {
516510
name: 'form',
517511
type: 'FormSubmitEvent',

app/components/Snaps/SnapUIRenderer/SnapUIRenderer.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,13 @@ const SnapUIRendererComponent = ({
7474
return <ActivityIndicator size="large" color={Colors.primary} />;
7575
}
7676

77-
const { state: initialState, context } = interfaceState;
77+
const { state: initialState } = interfaceState;
7878
return (
7979
<View style={[styles.root, style]}>
8080
<SnapInterfaceContextProvider
8181
snapId={snapId}
8282
interfaceId={interfaceId}
8383
initialState={initialState}
84-
context={context}
8584
>
8685
<TemplateRenderer sections={sections} />
8786
{PERF_DEBUG && <PerformanceTracker />}

app/components/Snaps/SnapUIRenderer/__snapshots__/SnapUIRenderer.test.tsx.snap

+8-8
Original file line numberDiff line numberDiff line change
@@ -1041,12 +1041,10 @@ exports[`SnapUIRenderer renders complex nested components 1`] = `
10411041
[
10421042
{
10431043
"flexDirection": "column",
1044-
"textAlign": "right",
10451044
},
10461045
undefined,
10471046
]
10481047
}
1049-
textAlign="right"
10501048
>
10511049
<Text
10521050
accessibilityRole="text"
@@ -1059,6 +1057,7 @@ exports[`SnapUIRenderer renders complex nested components 1`] = `
10591057
"fontWeight": "500",
10601058
"letterSpacing": 0,
10611059
"lineHeight": 24,
1060+
"textAlign": "right",
10621061
}
10631062
}
10641063
>
@@ -1075,6 +1074,7 @@ exports[`SnapUIRenderer renders complex nested components 1`] = `
10751074
"fontWeight": "400",
10761075
"letterSpacing": 0,
10771076
"lineHeight": 24,
1077+
"textAlign": "right",
10781078
}
10791079
}
10801080
>
@@ -2166,12 +2166,10 @@ exports[`SnapUIRenderer supports forms with fields 1`] = `
21662166
[
21672167
{
21682168
"flexDirection": "column",
2169-
"textAlign": "right",
21702169
},
21712170
undefined,
21722171
]
21732172
}
2174-
textAlign="right"
21752173
>
21762174
<Text
21772175
accessibilityRole="text"
@@ -2184,6 +2182,7 @@ exports[`SnapUIRenderer supports forms with fields 1`] = `
21842182
"fontWeight": "500",
21852183
"letterSpacing": 0,
21862184
"lineHeight": 24,
2185+
"textAlign": "right",
21872186
}
21882187
}
21892188
>
@@ -2200,6 +2199,7 @@ exports[`SnapUIRenderer supports forms with fields 1`] = `
22002199
"fontWeight": "400",
22012200
"letterSpacing": 0,
22022201
"lineHeight": 24,
2202+
"textAlign": "right",
22032203
}
22042204
}
22052205
>
@@ -2603,12 +2603,10 @@ exports[`SnapUIRenderer supports forms with fields 1`] = `
26032603
[
26042604
{
26052605
"flexDirection": "column",
2606-
"textAlign": "right",
26072606
},
26082607
undefined,
26092608
]
26102609
}
2611-
textAlign="right"
26122610
>
26132611
<Text
26142612
accessibilityRole="text"
@@ -2621,6 +2619,7 @@ exports[`SnapUIRenderer supports forms with fields 1`] = `
26212619
"fontWeight": "500",
26222620
"letterSpacing": 0,
26232621
"lineHeight": 24,
2622+
"textAlign": "right",
26242623
}
26252624
}
26262625
>
@@ -2637,6 +2636,7 @@ exports[`SnapUIRenderer supports forms with fields 1`] = `
26372636
"fontWeight": "400",
26382637
"letterSpacing": 0,
26392638
"lineHeight": 24,
2639+
"textAlign": "right",
26402640
}
26412641
}
26422642
>
@@ -2753,12 +2753,10 @@ exports[`SnapUIRenderer supports forms with fields 1`] = `
27532753
[
27542754
{
27552755
"flexDirection": "column",
2756-
"textAlign": "right",
27572756
},
27582757
undefined,
27592758
]
27602759
}
2761-
textAlign="right"
27622760
>
27632761
<Text
27642762
accessibilityRole="text"
@@ -2771,6 +2769,7 @@ exports[`SnapUIRenderer supports forms with fields 1`] = `
27712769
"fontWeight": "500",
27722770
"letterSpacing": 0,
27732771
"lineHeight": 24,
2772+
"textAlign": "right",
27742773
}
27752774
}
27762775
>
@@ -2787,6 +2786,7 @@ exports[`SnapUIRenderer supports forms with fields 1`] = `
27872786
"fontWeight": "400",
27882787
"letterSpacing": 0,
27892788
"lineHeight": 24,
2789+
"textAlign": "right",
27902790
}
27912791
}
27922792
>

0 commit comments

Comments
 (0)