mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-29 23:58:06 +01:00
20 lines
525 B
JavaScript
20 lines
525 B
JavaScript
|
import { useSelector } from 'react-redux';
|
||
|
|
||
|
import { isEqualCaseInsensitive } from '../../shared/modules/string-utils';
|
||
|
|
||
|
export const useTransactionInfo = (txData = {}) => {
|
||
|
const {
|
||
|
allNftContracts,
|
||
|
selectedAddress,
|
||
|
provider: { chainId },
|
||
|
} = useSelector((state) => state.metamask);
|
||
|
|
||
|
const isNftTransfer = Boolean(
|
||
|
allNftContracts?.[selectedAddress]?.[chainId]?.find((contract) => {
|
||
|
return isEqualCaseInsensitive(contract.address, txData.txParams.to);
|
||
|
}),
|
||
|
);
|
||
|
|
||
|
return { isNftTransfer };
|
||
|
};
|