Skip to content

Commit

Permalink
feat: fix merge conflicts with accounts controller selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
k-g-j committed Oct 18, 2024
1 parent 5d9350a commit d958792
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/selectors/accountsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { createSelector } from 'reselect';
import { RootState } from '../reducers';
import { createDeepEqualSelector } from './util';
import { selectFlattenedKeyringAccounts } from './keyringController';
import { InternalAccount } from '@metamask/keyring-api';
import { EthMethod, InternalAccount } from '@metamask/keyring-api';

/**
*
Expand Down Expand Up @@ -80,3 +80,12 @@ export const selectSelectedInternalAccountAddress = createSelector(
return selectedAddress || undefined;
},
);

/**
* A memoized selector that returns whether the selected internal account can sign transactions
*/
export const selectCanSignTransactions = createSelector(
selectSelectedInternalAccount,
(selectedAccount) =>
selectedAccount?.methods?.includes(EthMethod.SignTransaction) ?? false,
);

0 comments on commit d958792

Please sign in to comment.