14.05.2026 rip

This commit is contained in:
2026-05-14 15:50:22 +03:00
parent 0f88a68c59
commit 79f1ee371b
8 changed files with 142 additions and 7 deletions

View File

@@ -0,0 +1,20 @@
import { useQuery, useQueries } from '@tanstack/react-query'
import { getWalletBalance, getPrices, CHAINS } from '../api/walletApi'
export function useAllWalletBalances() {
return useQueries({
queries: CHAINS.map(chain => ({
queryKey: ['wallet', 'balance', chain],
queryFn: () => getWalletBalance(chain),
staleTime: 30_000,
})),
})
}
export function usePrices(symbols: string[]) {
return useQuery({
queryKey: ['wallet', 'prices', symbols.join(',')],
queryFn: () => getPrices(symbols),
staleTime: 5 * 60 * 1000,
})
}