Skip to content

Commit cb2adae

Browse files
authored
Merge branch 'main' into jc/WAPI-409
2 parents 80eba8b + 22a1921 commit cb2adae

File tree

31 files changed

+700
-132
lines changed

31 files changed

+700
-132
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metamask/core-monorepo",
3-
"version": "561.0.0",
3+
"version": "563.0.0",
44
"private": true,
55
"description": "Monorepo for packages shared between MetaMask clients",
66
"repository": {

packages/account-tree-controller/CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.16.1]
11+
12+
### Added
13+
14+
- Export user storage paths for account syncing ([#6643](https://github.com/MetaMask/core/pull/6643))
15+
16+
### Changed
17+
18+
- Swallow group creation errors in backup and sync `createMultichainAccountGroup` ([#6642](https://github.com/MetaMask/core/pull/6642))
19+
1020
### Removed
1121

1222
- Remove full sync triggers when single sync operations are enqueued and `hasSyncedAtLeastOnce` is `false` ([#6634](https://github.com/MetaMask/core/pull/6634))
@@ -245,7 +255,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
245255
- Initial release ([#5847](https://github.com/MetaMask/core/pull/5847))
246256
- Grouping accounts into 3 main categories: Entropy source, Snap ID, keyring types.
247257

248-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/account-tree-controller@0.16.0...HEAD
258+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/account-tree-controller@0.16.1...HEAD
259+
[0.16.1]: https://github.com/MetaMask/core/compare/@metamask/account-tree-controller@0.16.0...@metamask/account-tree-controller@0.16.1
249260
[0.16.0]: https://github.com/MetaMask/core/compare/@metamask/account-tree-controller@0.15.1...@metamask/account-tree-controller@0.16.0
250261
[0.15.1]: https://github.com/MetaMask/core/compare/@metamask/account-tree-controller@0.15.0...@metamask/account-tree-controller@0.15.1
251262
[0.15.0]: https://github.com/MetaMask/core/compare/@metamask/account-tree-controller@0.14.0...@metamask/account-tree-controller@0.15.0

packages/account-tree-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metamask/account-tree-controller",
3-
"version": "0.16.0",
3+
"version": "0.16.1",
44
"description": "Controller to group account together based on some pre-defined rules",
55
"keywords": [
66
"MetaMask",

packages/account-tree-controller/src/backup-and-sync/syncing/group.ts

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,18 @@ export const createMultichainAccountGroup = async (
5858
});
5959
}
6060
} catch (error) {
61+
// This can happen if the Snap Keyring is not ready yet when invoking
62+
// `MultichainAccountService:createMultichainAccountGroup`.
63+
// Since `MultichainAccountService:createMultichainAccountGroup` will at
64+
// least create the EVM account and the account group before throwing, we can safely
65+
// ignore this error and swallow it.
66+
// Any missing Snap accounts will be added later with alignment.
67+
6168
backupAndSyncLogger(
6269
`Failed to create group ${groupIndex} for entropy ${entropySourceId}:`,
6370
// istanbul ignore next
6471
error instanceof Error ? error.message : String(error),
6572
);
66-
throw error;
6773
}
6874
};
6975

@@ -85,30 +91,20 @@ export async function createLocalGroupsFromUserStorage(
8591
...groupsFromUserStorage.map((g) => g.groupIndex),
8692
);
8793

94+
// Creating multichain account group is idempotent, so we can safely
95+
// re-create every groups starting from 0.
8896
for (
8997
let groupIndex = 0;
9098
groupIndex <= numberOfAccountGroupsToCreate;
9199
groupIndex++
92100
) {
93-
try {
94-
// Creating multichain account group is idempotent, so we can safely
95-
// re-create every groups starting from 0.
96-
await createMultichainAccountGroup(
97-
context,
98-
entropySourceId,
99-
groupIndex,
100-
profileId,
101-
BackupAndSyncAnalyticsEvent.GroupAdded,
102-
);
103-
} catch {
104-
// This can happen if the Snap Keyring is not ready yet when invoking
105-
// `MultichainAccountService:createMultichainAccountGroup`.
106-
// Since `MultichainAccountService:createMultichainAccountGroup` will at
107-
// least create the EVM account and the account group before throwing, we can safely
108-
// ignore this error and continue.
109-
// Any missing Snap accounts will be added later with alignment.
110-
continue;
111-
}
101+
await createMultichainAccountGroup(
102+
context,
103+
entropySourceId,
104+
groupIndex,
105+
profileId,
106+
BackupAndSyncAnalyticsEvent.GroupAdded,
107+
);
112108
}
113109
}
114110

packages/account-tree-controller/src/backup-and-sync/syncing/legacy.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ export const performLegacyAccountSyncing = async (
4949
);
5050

5151
if (numberOfAccountGroupsToCreate > 0) {
52+
// Creating multichain account group is idempotent, so we can safely
53+
// re-create every groups starting from 0.
5254
for (let i = 0; i < numberOfAccountGroupsToCreate; i++) {
5355
backupAndSyncLogger(`Creating account group ${i} for legacy account`);
5456
await createMultichainAccountGroup(

packages/account-tree-controller/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ export type { AccountWalletObject } from './wallet';
22
export type { AccountGroupObject } from './group';
33
export { isAccountGroupNameUnique } from './group';
44

5+
export {
6+
USER_STORAGE_GROUPS_FEATURE_KEY,
7+
USER_STORAGE_WALLETS_FEATURE_KEY,
8+
} from './backup-and-sync/user-storage/constants';
9+
510
export type {
611
AccountTreeControllerState,
712
AccountTreeControllerGetStateAction,

packages/assets-controllers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"devDependencies": {
8181
"@babel/runtime": "^7.23.9",
8282
"@metamask/account-api": "^0.12.0",
83-
"@metamask/account-tree-controller": "^0.16.0",
83+
"@metamask/account-tree-controller": "^0.16.1",
8484
"@metamask/accounts-controller": "^33.1.0",
8585
"@metamask/approval-controller": "^7.1.3",
8686
"@metamask/auto-changelog": "^3.4.4",

packages/bridge-controller/CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [43.1.0]
11+
1012
### Added
1113

14+
- Add `selectDefaultSlippagePercentage` that returns the default slippage for a chain and token combination ([#6616](https://github.com/MetaMask/core/pull/6616))
15+
- Return `0.5` if requesting a bridge quote
16+
- Return `undefined` (auto) if requesting a Solana swap
17+
- Return `0.5` if both tokens are stablecoins (based on dynamic `stablecoins` list from LD chain config)
18+
- Return `2` for all other EVM swaps
1219
- Add new controller metadata properties to `BridgeController` ([#6589](https://github.com/MetaMask/core/pull/6589))
1320

1421
### Changed
@@ -578,7 +585,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
578585

579586
- Initial release ([#5317](https://github.com/MetaMask/core/pull/5317))
580587

581-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@43.0.0...HEAD
588+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@43.1.0...HEAD
589+
[43.1.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@43.0.0...@metamask/bridge-controller@43.1.0
582590
[43.0.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@42.0.0...@metamask/bridge-controller@43.0.0
583591
[42.0.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@41.4.0...@metamask/bridge-controller@42.0.0
584592
[41.4.0]: https://github.com/MetaMask/core/compare/@metamask/bridge-controller@41.3.0...@metamask/bridge-controller@41.4.0

packages/bridge-controller/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@metamask/bridge-controller",
3-
"version": "43.0.0",
3+
"version": "43.1.0",
44
"description": "Manages bridge-related quote fetching functionality for MetaMask",
55
"keywords": [
66
"MetaMask",

packages/bridge-controller/src/constants/bridge.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export const BRIDGE_QUOTE_MAX_ETA_SECONDS = 60 * 60; // 1 hour
3737
export const BRIDGE_QUOTE_MAX_RETURN_DIFFERENCE_PERCENTAGE = 0.5; // if a quote returns in x times less return than the best quote, ignore it
3838

3939
export const BRIDGE_PREFERRED_GAS_ESTIMATE = 'medium';
40-
export const BRIDGE_DEFAULT_SLIPPAGE = 0.5;
4140
export const BRIDGE_MM_FEE_RATE = 0.875;
4241
export const REFRESH_INTERVAL_MS = 30 * 1000;
4342
export const DEFAULT_MAX_REFRESH_COUNT = 5;

0 commit comments

Comments
 (0)