File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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" : {
Original file line number Diff line number Diff 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 & {
2523export 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/**
Original file line number Diff line number Diff 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"
You can’t perform that action at this time.
0 commit comments