1- import {
2- AccountGroupType ,
3- AccountWalletType ,
4- isBip44Account ,
5- toMultichainAccountGroupId ,
6- toMultichainAccountWalletId ,
7- } from '@metamask/account-api' ;
1+ import { AccountGroupType , AccountWalletType } from '@metamask/account-api' ;
82import { isEvmAccountType } from '@metamask/keyring-api' ;
93import { KeyringTypes } from '@metamask/keyring-controller' ;
10- import type { InternalAccount } from '@metamask/keyring-internal-api' ;
114
125import type { AccountGroupObjectOf } from '../group' ;
136import { BaseRule , type Rule , type RuleResult } from '../rule' ;
@@ -29,53 +22,10 @@ export class EntropyRule
2922 . findIndex ( ( keyring ) => keyring . metadata . id === entropySource ) ;
3023 }
3124
32- match (
33- account : InternalAccount ,
34- ) :
25+ match ( ) :
3526 | RuleResult < AccountWalletType . Entropy , AccountGroupType . MultichainAccount >
3627 | undefined {
37- if ( ! isBip44Account ( account ) ) {
38- return undefined ;
39- }
40-
41- const entropySource = account . options . entropy . id ;
42- const entropySourceIndex = this . getEntropySourceIndex ( entropySource ) ;
43- if ( entropySourceIndex === - 1 ) {
44- console . warn (
45- `! Found an unknown entropy ID: "${ entropySource } ", account "${ account . id } " won't be grouped by entropy.` ,
46- ) ;
47- return undefined ;
48- }
49-
50- const walletId = toMultichainAccountWalletId ( entropySource ) ;
51- const groupId = toMultichainAccountGroupId (
52- walletId ,
53- account . options . entropy . groupIndex ,
54- ) ;
55-
56- return {
57- wallet : {
58- type : this . walletType ,
59- id : walletId ,
60- metadata : {
61- entropy : {
62- id : entropySource ,
63- } ,
64- } ,
65- } ,
66-
67- group : {
68- type : this . groupType ,
69- id : groupId ,
70- metadata : {
71- entropy : {
72- groupIndex : account . options . entropy . groupIndex ,
73- } ,
74- pinned : false ,
75- hidden : false ,
76- } ,
77- } ,
78- } ;
28+ throw new Error ( 'Entropy rule is no longer supported' ) ;
7929 }
8030
8131 getDefaultAccountWalletName (
0 commit comments