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' ;
8
2
import { isEvmAccountType } from '@metamask/keyring-api' ;
9
3
import { KeyringTypes } from '@metamask/keyring-controller' ;
10
- import type { InternalAccount } from '@metamask/keyring-internal-api' ;
11
4
12
5
import type { AccountGroupObjectOf } from '../group' ;
13
6
import { BaseRule , type Rule , type RuleResult } from '../rule' ;
@@ -29,53 +22,10 @@ export class EntropyRule
29
22
. findIndex ( ( keyring ) => keyring . metadata . id === entropySource ) ;
30
23
}
31
24
32
- match (
33
- account : InternalAccount ,
34
- ) :
25
+ match ( ) :
35
26
| RuleResult < AccountWalletType . Entropy , AccountGroupType . MultichainAccount >
36
27
| 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' ) ;
79
29
}
80
30
81
31
getDefaultAccountWalletName (
0 commit comments