mars-v2-frontend/src/hooks/useWalletBalances.tsx

11 lines
296 B
TypeScript
Raw Normal View History

import useSWR from 'swr'
import getWalletBalances from 'api/wallets/getWalletBalances'
export default function useWalletBalances(address?: string) {
return useSWR(`walletBalances${address}`, () => getWalletBalances(address || ''), {
isPaused: () => !address,
fallbackData: [],
})
}