File tree Expand file tree Collapse file tree
packages/keyring-snap-bridge/src/migrations Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,8 +5,10 @@ import {
55 BtcScope ,
66 EthScope ,
77 SolScope ,
8+ TrxScope ,
9+ TrxAccountType ,
810} from '@metamask/keyring-api' ;
9- import type { CaipChainId , KeyringAccount } from '@metamask/keyring-api' ;
11+ import type { CaipChainId , KeyringAccount , KeyringAccountType } from '@metamask/keyring-api' ;
1012import { isBtcMainnetAddress } from '@metamask/keyring-utils' ;
1113import { is } from '@metamask/superstruct' ;
1214
@@ -69,6 +71,10 @@ export function getScopesForAccountV1(
6971 // Solana account supports multiple chains.
7072 return [ SolScope . Mainnet , SolScope . Testnet , SolScope . Devnet ] ;
7173 }
74+ case TrxAccountType . Eoa : {
75+ // TRON account supports multiple chains.
76+ return [ TrxScope . Mainnet , TrxScope . Nile , TrxScope . Shasta ] ;
77+ }
7278 default :
7379 // We re-use EOA scopes if we don't know what to do for now.
7480 return [ EthScope . Eoa ] ;
@@ -102,7 +108,7 @@ export function transformAccountV1(
102108
103109 // For all other non-EVM and ERC4337 Snap accounts, the `scopes` is required, and
104110 // each `*AccountStruct` should assert that automatically.
105- return assertKeyringAccount ( accountV1 ) ;
111+ return assertKeyringAccount ( accountV1 as { type : KeyringAccountType } ) ;
106112}
107113
108114/**
You can’t perform that action at this time.
0 commit comments