Skip to content
This repository has been archived by the owner on Sep 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #23 from blinklabs-io/fix/return-and-string
Browse files Browse the repository at this point in the history
fix: return claimableTokens and pass string to getRewards
  • Loading branch information
wolf31o2 authored Dec 7, 2023
2 parents 0b2ad2d + 952247e commit c388657
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ app.get(
isWhitelisted = true;
}
} else {
const claimableTokens = await getRewards(stakeAddress);
const claimableTokens = await getRewards(`${stakeAddress}`);
for (let token of claimableTokens) {
if (token.native) {
isNativeSelected = true;
Expand Down
6 changes: 3 additions & 3 deletions server/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,12 @@ export async function getRewards(stakeAddress: string) {
MinswapService.getPrices(),
]);

if (getRewardsResponse == null) return;
if (tokens == null) return;
const claimableTokens: ClaimableToken[] = [];
if (getRewardsResponse == null) return claimableTokens;
if (tokens == null) return claimableTokens;

const consolidatedAvailableReward: { [key: string]: number } = {};
const consolidatedAvailableRewardPremium: { [key: string]: number } = {};
const claimableTokens: ClaimableToken[] = [];

/** handle regular tokens */
const regularRewards: Record<string, number> = {
Expand Down

0 comments on commit c388657

Please sign in to comment.