• Hook to fetch and validate a single RewardKit Boost for a given Boost ID and claimant address.

    This hook uses react-query to fetch boost details and claims, and validates the response against a Valibot schema. Automatically handles stale time of 5 minutes and disables retries.

    See useQuery from react-query

    Parameters

    • params: RewardKitBoostParams

      RewardKitBoostParams

      • boostId

        The ID of the boost to fetch

      • claimantAddress

        Address of the potential claimant

    Returns UseQueryResult<
        {
            boost: {
                id: string;
                chainId: number;
                incentives: {
                    type: IncentiveTypeString;
                    assetAddress?: `0x${string}`;
                    rewardAmount?: string;
                    rewardAmountFormatted?: string;
                    rewardPercentage?: number;
                    maxReward?: string;
                    rewardUsdValue?: number;
                    tokenSymbol?: string;
                    tokenImageUri?: string;
                    metadata?: | null
                    | {
                        id: string;
                        chainId: number;
                        address: `0x${string}`;
                        decimals: number;
                        name: string;
                        symbol: string;
                        imageUri: string;
                    };
                }[];
                actionTemplate: | null
                | {
                    id: string;
                    actionType: string;
                    projectId: string;
                    projectImage?: string;
                };
                boostName?: null
                | string;
                tokenImageUri?: null | string;
                nftImageUri?: null | string;
                nftName?: null | string;
                status?: "active" | "claimable" | "claimed";
                txHash?: string;
                blockTimestamp?: string;
            };
            totalClaims: number;
            claims: { address: `0x${string}`; txHash: string; timestamp: string }[];
            status: "active" | "claimable" | "claimed";
            txHash?: string;
        },
        Error,
    >

    The Boost information, claims, and status for the provided boost ID and claimant address

    const { data, isLoading } = useRewardKitBoost({
    boostId: "chainId:address:index",
    claimantAddress: "0x1234..."
    });

    if (isLoading) return <div>Loading...</div>;
    if (!data) return null;

    return <div>Boost Status: {data.status}</div>;