Skip to content

Commit b02bd4f

Browse files
authored
Merge branch 'develop' into multichain-remove-bottom-nav
2 parents 48356ab + 46e755b commit b02bd4f

59 files changed

Lines changed: 2890 additions & 631 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
diff --git a/dist/utils.js b/dist/utils.js
2+
index 810f229841ffff83f7a28191bc558862b1809e01..aa2ea845d4cccfac8e28f575d7972bd2dba8decf 100644
3+
--- a/dist/utils.js
4+
+++ b/dist/utils.js
5+
@@ -11,35 +11,40 @@ const uuid_1 = require("uuid");
6+
* @returns The name of the keyring type.
7+
*/
8+
function keyringTypeToName(keyringType) {
9+
- switch (keyringType) {
10+
- case keyring_controller_1.KeyringTypes.simple: {
11+
- return 'Account';
12+
- }
13+
- case keyring_controller_1.KeyringTypes.hd: {
14+
- return 'Account';
15+
- }
16+
- case keyring_controller_1.KeyringTypes.trezor: {
17+
- return 'Trezor';
18+
- }
19+
- case keyring_controller_1.KeyringTypes.ledger: {
20+
- return 'Ledger';
21+
- }
22+
- case keyring_controller_1.KeyringTypes.lattice: {
23+
- return 'Lattice';
24+
- }
25+
- case keyring_controller_1.KeyringTypes.qr: {
26+
- return 'QR';
27+
- }
28+
- case keyring_controller_1.KeyringTypes.snap: {
29+
- return 'Snap Account';
30+
- }
31+
- case keyring_controller_1.KeyringTypes.custody: {
32+
- return 'Custody';
33+
- }
34+
- default: {
35+
- throw new Error(`Unknown keyring ${keyringType}`);
36+
- }
37+
+ // Custody Keyrings follow this pattern
38+
+ if (/^Custody.*/.test(keyringType)) {
39+
+ return "Custody";
40+
+ }
41+
+
42+
+ switch (keyringType) {
43+
+ case keyring_controller_1.KeyringTypes.simple: {
44+
+ return "Account";
45+
}
46+
+ case keyring_controller_1.KeyringTypes.hd: {
47+
+ return "Account";
48+
+ }
49+
+ case keyring_controller_1.KeyringTypes.trezor: {
50+
+ return "Trezor";
51+
+ }
52+
+ case keyring_controller_1.KeyringTypes.ledger: {
53+
+ return "Ledger";
54+
+ }
55+
+ case keyring_controller_1.KeyringTypes.lattice: {
56+
+ return "Lattice";
57+
+ }
58+
+ case keyring_controller_1.KeyringTypes.qr: {
59+
+ return "QR";
60+
+ }
61+
+ case keyring_controller_1.KeyringTypes.snap: {
62+
+ return "Snap Account";
63+
+ }
64+
+ case keyring_controller_1.KeyringTypes.custody: {
65+
+ return "Custody";
66+
+ }
67+
+ default: {
68+
+ throw new Error(`Unknown keyring ${keyringType}`);
69+
+ }
70+
+ }
71+
}
72+
exports.keyringTypeToName = keyringTypeToName;
73+
/**
74+
@@ -48,10 +53,10 @@ exports.keyringTypeToName = keyringTypeToName;
75+
* @returns The generated UUID.
76+
*/
77+
function getUUIDFromAddressOfNormalAccount(address) {
78+
- const v4options = {
79+
- random: (0, ethereumjs_util_1.sha256FromString)(address).slice(0, 16),
80+
- };
81+
- return (0, uuid_1.v4)(v4options);
82+
+ const v4options = {
83+
+ random: (0, ethereumjs_util_1.sha256FromString)(address).slice(0, 16),
84+
+ };
85+
+ return (0, uuid_1.v4)(v4options);
86+
}
87+
exports.getUUIDFromAddressOfNormalAccount = getUUIDFromAddressOfNormalAccount;
88+
//# sourceMappingURL=utils.js.map

.yarn/patches/@metamask-accounts-controller-npm-5.0.0-f877105fa0.patch

Lines changed: 0 additions & 18 deletions
This file was deleted.

app/_locales/en/messages.json

Lines changed: 9 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/scripts/controllers/metametrics.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,10 +819,8 @@ export default class MetaMetricsController {
819819
[MetaMetricsUserTrait.SecurityProviders]: securityProvider
820820
? [securityProvider]
821821
: [],
822-
///: BEGIN:ONLY_INCLUDE_IF(petnames)
823822
[MetaMetricsUserTrait.PetnameAddressCount]:
824823
this._getPetnameAddressCount(metamaskState),
825-
///: END:ONLY_INCLUDE_IF
826824
};
827825

828826
if (!previousUserTraits) {
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export type AccountIdentityEntry = {
2+
address: string;
3+
name: string;
4+
};
5+
6+
export type PreferencesControllerState = {
7+
identities: { [address: string]: AccountIdentityEntry };
8+
securityAlertsEnabled: boolean;
9+
};
10+
11+
export type PreferencesController = {
12+
store: {
13+
getState: () => PreferencesControllerState;
14+
subscribe: (callback: (state: PreferencesControllerState) => void) => void;
15+
};
16+
};

app/scripts/controllers/preferences.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export default class PreferencesController {
9191
showTestNetworks: false,
9292
useNativeCurrencyAsPrimaryCurrency: true,
9393
hideZeroBalanceTokens: false,
94+
petnamesEnabled: true,
9495
},
9596
// ENS decentralized website resolution
9697
ipfsGateway: IPFS_DEFAULT_GATEWAY_URL,
@@ -107,9 +108,7 @@ export default class PreferencesController {
107108
snapsAddSnapAccountModalDismissed: false,
108109
///: END:ONLY_INCLUDE_IF
109110
isLineaMainnetReleased: false,
110-
///: BEGIN:ONLY_INCLUDE_IF(petnames)
111111
useExternalNameSources: true,
112-
///: END:ONLY_INCLUDE_IF
113112
...opts.initState,
114113
};
115114

@@ -271,7 +270,6 @@ export default class PreferencesController {
271270
}
272271
///: END:ONLY_INCLUDE_IF
273272

274-
///: BEGIN:ONLY_INCLUDE_IF(petnames)
275273
/**
276274
* Setter for the `useExternalNameSources` property
277275
*
@@ -282,7 +280,6 @@ export default class PreferencesController {
282280
useExternalNameSources,
283281
});
284282
}
285-
///: END:ONLY_INCLUDE_IF
286283

287284
/**
288285
* Setter for the `advancedGasFee` property

0 commit comments

Comments
 (0)