mars-v2-frontend/src/hooks/useAccountIds.tsx
Bob van der Helm 0f48e4bd27
Hls latest (#637)
* env: enable HLS

* feat: added background and orb fading

* tidy: updated the token logos (#629)

* tidy: updated the token logos

* feat: added dydx

* fix: increase load spead of trading charts

* feat: first version of the UI shift

* Deployment for HLS testing

*  add APY to HLS staking

*  add APY account overview and summary

* fix: fixed the intro component visibility

*  add warning messages HLS

* fix: menu order

*  implement live APRs

* auto-select first account, add no balance message

* enable tabs for hls, fix net APY for deposit

* fix button for hls, sorting apy and console warnings

* disable feature flag HLS

* fix slider

* update routing

---------

Co-authored-by: Linkie Link <linkielink.dev@gmail.com>
2023-11-16 11:16:16 +01:00

24 lines
664 B
TypeScript

import useSWR from 'swr'
import getAccountIds from 'api/wallets/getAccountIds'
export default function useAccountIdsAndKinds(address?: string, suspense = true, noHls = false) {
return useSWR(
`wallets/${address}/account-ids`,
() =>
getAccountIds(address).then((accountIdsAndKinds) => {
if (noHls) {
return accountIdsAndKinds
.filter((accountIdAndKind) => accountIdAndKind.kind !== 'high_levered_strategy')
.map((a) => a.id)
}
return accountIdsAndKinds.map((a) => a.id)
}),
{
suspense: suspense,
fallback: [] as string[],
revalidateOnFocus: false,
},
)
}