From 5baa7f1aac0ac540b0002b3ae63f1f461cea708e Mon Sep 17 00:00:00 2001 From: Mohammad Ranjbar Z Date: Wed, 22 Jan 2025 16:32:10 +0330 Subject: [PATCH] Return donations more than 0.05$ from giveth community project related to https://github.com/Giveth/GIVeconomy/issues/916 --- src/utils.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index e63a21f..2fdd9b0 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -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; +};