@@ -15,6 +15,8 @@ import {
1515 EthEoaAccountStruct ,
1616 EthErc4337AccountStruct ,
1717 SolDataAccountStruct ,
18+ TrxAccountType ,
19+ TrxEoaAccountStruct ,
1820} from '@metamask/keyring-api' ;
1921import { exactOptional , object } from '@metamask/keyring-utils' ;
2022import type { Infer , Struct } from '@metamask/superstruct' ;
@@ -23,7 +25,8 @@ import { boolean, string, number } from '@metamask/superstruct';
2325export type InternalAccountType =
2426 | EthAccountType
2527 | BtcAccountType
26- | SolAccountType ;
28+ | SolAccountType
29+ | TrxAccountType ;
2730
2831export const InternalAccountMetadataStruct = object ( {
2932 metadata : object ( {
@@ -79,6 +82,11 @@ export const InternalSolDataAccountStruct = object({
7982 ...InternalAccountMetadataStruct . schema ,
8083} ) ;
8184
85+ export const InternalTrxEoaAccountStruct = object ( {
86+ ...TrxEoaAccountStruct . schema ,
87+ ...InternalAccountMetadataStruct . schema ,
88+ } ) ;
89+
8290export type InternalEthEoaAccount = Infer < typeof InternalEthEoaAccountStruct > ;
8391
8492export type InternalEthErc4337Account = Infer <
@@ -99,6 +107,8 @@ export type InternalBtcP2trAccount = Infer<typeof InternalBtcP2trAccountStruct>;
99107
100108export type InternalSolDataAccount = Infer < typeof InternalSolDataAccountStruct > ;
101109
110+ export type InternalTrxEoaAccount = Infer < typeof InternalTrxEoaAccountStruct > ;
111+
102112export const InternalAccountStructs : Record <
103113 string ,
104114 | Struct < InternalEthEoaAccount >
@@ -108,6 +118,7 @@ export const InternalAccountStructs: Record<
108118 | Struct < InternalBtcP2wpkhAccount >
109119 | Struct < InternalBtcP2trAccount >
110120 | Struct < InternalSolDataAccount >
121+ | Struct < InternalTrxEoaAccount >
111122> = {
112123 [ `${ EthAccountType . Eoa } ` ] : InternalEthEoaAccountStruct ,
113124 [ `${ EthAccountType . Erc4337 } ` ] : InternalEthErc4337AccountStruct ,
@@ -116,6 +127,7 @@ export const InternalAccountStructs: Record<
116127 [ `${ BtcAccountType . P2wpkh } ` ] : InternalBtcP2wpkhAccountStruct ,
117128 [ `${ BtcAccountType . P2tr } ` ] : InternalBtcP2trAccountStruct ,
118129 [ `${ SolAccountType . DataAccount } ` ] : InternalSolDataAccountStruct ,
130+ [ `${ TrxAccountType . Eoa } ` ] : InternalTrxEoaAccountStruct ,
119131} ;
120132
121133export type InternalAccountTypes =
@@ -125,7 +137,8 @@ export type InternalAccountTypes =
125137 | InternalBtcP2shAccount
126138 | InternalBtcP2wpkhAccount
127139 | InternalBtcP2trAccount
128- | InternalSolDataAccount ;
140+ | InternalSolDataAccount
141+ | InternalTrxEoaAccount ;
129142
130143export const InternalAccountStruct = object ( {
131144 ...KeyringAccountStruct . schema ,
0 commit comments