Skip to content

Commit

Permalink
Return donations more than 0.05$ from giveth community project
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadranjbarz committed Jan 22, 2025
1 parent cda892b commit 5baa7f1
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,18 @@ export const getBlockByTimestamp = async (timestamp: number, chainId: number) :P
}

export const isDonationAmountValid = (params: {
donation: GivethIoDonation, minEligibleValueUsd: number, givethCommunityProjectSlug:string
donation: GivethIoDonation,
minEligibleValueUsd: number,
givethCommunityProjectSlug: string
}): boolean => {
const { donation, minEligibleValueUsd, givethCommunityProjectSlug } = params
return donation.valueUsd >= minEligibleValueUsd || donation.project.slug === givethCommunityProjectSlug
}
const { donation, minEligibleValueUsd, givethCommunityProjectSlug } = params;

// Check if donation is to the specified Giveth community project
if (donation.project.slug === givethCommunityProjectSlug) {
// https://github.com/Giveth/GIVeconomy/issues/916
return donation.valueUsd > 0.05; // Only consider if value is greater than $0.05
}

// For all other projects, use the minEligibleValueUsd check
return donation.valueUsd >= minEligibleValueUsd;
};

0 comments on commit 5baa7f1

Please sign in to comment.