Skip to content

Commit 4b580d9

Browse files
committed
Merge branch 'main' into feat/wallet-status
2 parents 8db8dfc + f911a42 commit 4b580d9

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

packages/account-api/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Add wallet `status` ([#367](https://github.com/MetaMask/accounts/pull/367))
1313

14+
### Changed
15+
16+
- Make `isBip44Account` faster ([#369](https://github.com/MetaMask/accounts/pull/369))
17+
- We mainly rely on the `options.entropy.type` now and no longer use `superstruct` for this function.
18+
1419
## [0.10.0]
1520

1621
### Added

packages/account-api/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
"dependencies": {
5959
"@metamask/keyring-api": "workspace:^",
6060
"@metamask/keyring-utils": "workspace:^",
61-
"@metamask/superstruct": "^3.1.0",
6261
"uuid": "^9.0.1"
6362
},
6463
"devDependencies": {

packages/account-api/src/api/bip44.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import type {
22
KeyringAccount,
33
KeyringAccountEntropyMnemonicOptions,
44
} from '@metamask/keyring-api';
5-
import { KeyringAccountEntropyMnemonicOptionsStruct } from '@metamask/keyring-api';
6-
import { is } from '@metamask/superstruct';
75

86
/**
97
* BIP-44 compatible account type.
@@ -25,11 +23,9 @@ export type Bip44Account<Account extends KeyringAccount> = Account & {
2523
export function isBip44Account<Account extends KeyringAccount>(
2624
account: Account,
2725
): account is Bip44Account<Account> {
28-
// To be BIP-44 compatible, you just need to use this set of options:
29-
return is(
30-
account.options.entropy,
31-
KeyringAccountEntropyMnemonicOptionsStruct,
32-
);
26+
// To be BIP-44 compatible, we just check for the entropy type (the
27+
// the `entropy` shape will be inferred automatically).
28+
return account.options.entropy?.type === 'mnemonic';
3329
}
3430

3531
/**

yarn.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,6 @@ __metadata:
14421442
"@metamask/auto-changelog": "npm:^3.4.4"
14431443
"@metamask/keyring-api": "workspace:^"
14441444
"@metamask/keyring-utils": "workspace:^"
1445-
"@metamask/superstruct": "npm:^3.1.0"
14461445
"@ts-bridge/cli": "npm:^0.6.3"
14471446
"@types/jest": "npm:^29.5.12"
14481447
"@types/node": "npm:^20.12.12"

0 commit comments

Comments
 (0)