blub-sdk
Version:
A modular SDK for interacting with the BLUB ecosystem on the Sui blockchain.
13 lines (10 loc) • 356 B
text/typescript
// src/hooks/useStakingSummary.ts
import useSWR from "swr";
import { getStakingSummary } from "./StakingService";
export function useStakingSummary(address?: string) {
const { data, error, isLoading } = useSWR(
address ? ["stakingSummary", address] : null,
() => getStakingSummary(address!)
);
return { summary: data, isLoading, error };
}