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

12 lines
329 B
TypeScript
Raw Normal View History

import useSWR from 'swr'
import getAccountIds from 'api/wallets/getAccountIds'
export default function useAccountIds(address?: string, suspense = true) {
return useSWR(`wallets/${address}/account-ids`, () => getAccountIds(address), {
suspense: suspense,
fallback: [] as string[],
revalidateOnFocus: false,
})
}