From c4ca4d1c43282f38302fbe32c34832248d513c1f Mon Sep 17 00:00:00 2001 From: Alissa Crane Date: Wed, 6 Nov 2024 15:50:54 -0800 Subject: [PATCH] remove unused hook --- app/components/AgentAssets.tsx | 5 ---- app/hooks/useGetNfts.ts | 47 ---------------------------------- 2 files changed, 52 deletions(-) delete mode 100644 app/hooks/useGetNfts.ts diff --git a/app/components/AgentAssets.tsx b/app/components/AgentAssets.tsx index 1aa4e4d..7aaadfb 100644 --- a/app/components/AgentAssets.tsx +++ b/app/components/AgentAssets.tsx @@ -1,5 +1,4 @@ import { useCallback, useEffect, useMemo, useState } from 'react'; -import getNfts from '../hooks/useGetNfts'; // TODO: add assets export default function AgentAssets() { @@ -30,10 +29,6 @@ export default function AgentAssets() { return () => setTab(tab); }, []); - useEffect(() => { - getNfts(); - }, []); - return (
diff --git a/app/hooks/useGetNfts.ts b/app/hooks/useGetNfts.ts deleted file mode 100644 index c2e8598..0000000 --- a/app/hooks/useGetNfts.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { AGENT_WALLET_ADDRESS } from '../constants'; - -const baseUrl = - 'https://api.wallet.coinbase.com/rpc/v2/collectibles/getUserCollectionList?'; - -export default async function getNfts() { - try { - const response = await fetch( - `${baseUrl}userAddress=${AGENT_WALLET_ADDRESS}&chainId=84532`, - { - method: 'GET', - headers: { - 'Content-Type': 'application/json', - }, - // body: JSON.stringify({ input }), - }, - ); - - if (!response.ok) { - throw new Error(`Error: ${response.status} - ${response.statusText}`); - } - - console.log({ response }); - - // const text = await response.text(); - // const parsedMessages = text - // .trim() - // .split('\n') - // .map((line) => { - // try { - // return JSON.parse(line); - // } catch (error) { - // console.error('Failed to parse line as JSON:', line, error); - // return null; - // } - // }) - // .filter(Boolean); - - // onSuccess(parsedMessages); - // return { messages: parsedMessages, error: null }; - } catch (error) { - console.error('Error posting chat:', error); - return { messages: [], error: error as Error }; - } finally { - // setIsLoading(false); - } -}