diff --git a/app/selectors/accountsController.test.ts b/app/selectors/accountsController.test.ts index c2d7090d5a19..fdd9a2019f81 100644 --- a/app/selectors/accountsController.test.ts +++ b/app/selectors/accountsController.test.ts @@ -10,6 +10,8 @@ import { SolAccountType, SolScope, BtcScope, + TrxMethod, + TrxAccountType, } from '@metamask/keyring-api'; import { InternalAccount } from '@metamask/keyring-internal-api'; import StorageWrapper from '../store/storage-wrapper'; @@ -323,6 +325,16 @@ describe('selectCanSignTransactions', () => { methods: [EthMethod.SignTransaction], }; + const trxAccountWithSignMessageV2 = { + ...createMockInternalAccount( + 'T123', + 'TRX Account with SignMessageV2', + KeyringTypes.snap, + TrxAccountType.Eoa, + ), + methods: [TrxMethod.SignMessageV2], + }; + const solAccountWithSignTransaction = { ...createMockInternalAccount( '0x456', @@ -388,6 +400,12 @@ describe('selectCanSignTransactions', () => { expect(selectCanSignTransactions(state)).toBe(true); }); + it('returns true for TRX account with SignMessageV2 method', () => { + const state = getStateWithAccount(trxAccountWithSignMessageV2); + + expect(selectCanSignTransactions(state)).toBe(true); + }); + it('returns true for SOL account with SignTransaction method', () => { const state = getStateWithAccount(solAccountWithSignTransaction); expect(selectCanSignTransactions(state)).toBe(true); diff --git a/app/selectors/accountsController.ts b/app/selectors/accountsController.ts index 0f2983abd436..0558950ef5e5 100644 --- a/app/selectors/accountsController.ts +++ b/app/selectors/accountsController.ts @@ -13,6 +13,7 @@ import { SolAccountType, SolMethod, isEvmAccountType, + TrxMethod, } from '@metamask/keyring-api'; import { InternalAccount } from '@metamask/keyring-internal-api'; import { @@ -221,6 +222,7 @@ export const selectCanSignTransactions = createSelector( selectedAccount?.methods?.includes(SolMethod.SignMessage) || selectedAccount?.methods?.includes(SolMethod.SendAndConfirmTransaction) || selectedAccount?.methods?.includes(SolMethod.SignAndSendTransaction) || + selectedAccount?.methods?.includes(TrxMethod.SignMessageV2) || selectedAccount?.methods?.includes(BtcMethod.SignPsbt)) ?? false, );