From 6648e498075ceaffb14bc105b89dbd9cdb5a6d46 Mon Sep 17 00:00:00 2001 From: chase-45 Date: Wed, 1 Sep 2021 02:22:05 -0400 Subject: [PATCH] bridge_ui very simple check for solana NFTs Change-Id: I06074699f95f4252e96199cd13ba6e2dbdd123a0 --- .../TokenSelectors/SolanaSourceTokenSelector.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bridge_ui/src/components/TokenSelectors/SolanaSourceTokenSelector.tsx b/bridge_ui/src/components/TokenSelectors/SolanaSourceTokenSelector.tsx index 058dab52a..c26568128 100644 --- a/bridge_ui/src/components/TokenSelectors/SolanaSourceTokenSelector.tsx +++ b/bridge_ui/src/components/TokenSelectors/SolanaSourceTokenSelector.tsx @@ -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 = ( ( )}