bridge_ui very simple check for solana NFTs

Change-Id: I06074699f95f4252e96199cd13ba6e2dbdd123a0
This commit is contained in:
chase-45 2021-09-01 02:22:05 -04:00 committed by Hendrik Hofstadt
parent b234c223b8
commit 6648e49807
1 changed files with 12 additions and 1 deletions

View File

@ -137,6 +137,17 @@ export default function SolanaSourceTokenSelector(
const isLoading =
props.metaplexData.isFetching || props.solanaTokenMap?.isFetching;
//This exists to remove NFTs from the list of potential options. It requires reading the metaplex data, so it would be
//difficult to do before this point.
const filteredOptions = useMemo(() => {
return props.accounts.filter((x) => {
//TODO, do a better check which likely involves supply or checking masterEdition.
const isNFT =
x.decimals === 0 && memoizedMetaplex.get(x.mintKey)?.data?.uri;
return !isNFT;
});
}, [memoizedMetaplex, props.accounts]);
const autoComplete = (
<Autocomplete
autoComplete
@ -151,7 +162,7 @@ export default function SolanaSourceTokenSelector(
onChange(newValue);
}}
disabled={disabled}
options={props.accounts}
options={filteredOptions}
renderInput={(params) => (
<TextField {...params} label="Token Account" variant="outlined" />
)}