Skip to content

Commit 0bb29ce

Browse files
committed
chore: update migrations
1 parent d94c1e8 commit 0bb29ce

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

  • packages/keyring-snap-bridge/src/migrations

packages/keyring-snap-bridge/src/migrations/v1.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff 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';
1012
import { isBtcMainnetAddress } from '@metamask/keyring-utils';
1113
import { 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
/**

0 commit comments

Comments
 (0)