1 import { OnchainTransaction } from "src/types"; 2 import { swrFetcher } from "src/utils/swr"; 3 import useSWR, { SWRConfiguration } from "swr"; 4 5 const pollConfiguration: SWRConfiguration = { 6 refreshInterval: 30000, 7 }; 8 9 export function useOnchainTransactions() { 10 return useSWR<OnchainTransaction[]>( 11 "/api/node/transactions", 12 swrFetcher, 13 pollConfiguration 14 ); 15 } 16