diff --git a/src/api/incentives/getUnclaimedRewards.ts b/src/api/incentives/getUnclaimedRewards.ts index c4ae6d03..46df88d4 100644 --- a/src/api/incentives/getUnclaimedRewards.ts +++ b/src/api/incentives/getUnclaimedRewards.ts @@ -1,20 +1,20 @@ import { cacheFn, unclaimedRewardsCache } from 'api/cache' import { getIncentivesQueryClient } from 'api/cosmwasm-client' +import { ENV } from 'constants/env' import { BNCoin } from 'types/classes/BNCoin' +import iterateContractQuery from 'utils/iterateContractQuery' -export default async function getUnclaimedRewards( - user: string, - accountId: string, -): Promise { +export default async function getUnclaimedRewards(accountId: string): Promise { try { const client = await getIncentivesQueryClient() const unclaimedRewards = await cacheFn( () => - client.userUnclaimedRewards({ - user, - accountId, - limit: 100, - }), + iterateContractQuery(() => + client.userUnclaimedRewards({ + user: ENV.ADDRESS_CREDIT_MANAGER, + accountId, + }), + ), unclaimedRewardsCache, `incentives/${accountId}`, 60, diff --git a/src/components/RewardsCenter.tsx b/src/components/RewardsCenter.tsx index 81048349..649a4abb 100644 --- a/src/components/RewardsCenter.tsx +++ b/src/components/RewardsCenter.tsx @@ -31,10 +31,10 @@ const renderIncentives = (unclaimedRewards: BNCoin[]) => { const asset = ASSETS.find(byDenom(reward.denom)) if (!asset) return null return ( - <> +
{index !== 0 && } - +
) }) } @@ -109,7 +109,7 @@ export default function RewardsCenter() { <>