Skip to content

Commit

Permalink
Merge pull request #42 from Parifi/features-0.1.12
Browse files Browse the repository at this point in the history
[PFT-620] Add referral rewards data in tokens
  • Loading branch information
sudeepb02 authored Apr 9, 2024
2 parents 0861f58 + 10350de commit 2a718ae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/common/subgraphMapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,9 @@ export const mapReferralDataToInterface = (response: any): Referral | undefined
sizeInUsd: response.sizeInUsd,
timestamp: response.timestamp,
txHash: response.txHash,
rewardToken: response.rewardToken ? mapSubgraphResponseToTokenInterface(response.rewardToken) : undefined,
referralRewardsInUsd: response.referralRewardsInUsd,
referralRewardsInToken: response.referralRewardsInToken,
};
} catch (error) {
console.log('Error while mapping data', error);
Expand Down
6 changes: 6 additions & 0 deletions src/interfaces/subgraphTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,4 +553,10 @@ export interface Referral {

// " Referral rewards in USD "
referralRewardsInUsd?: string;

// " ERC20 Token in which referral rewards are received "
rewardToken?: Token;

// " Referral reward in reward token "
referralRewardsInToken?: string;
}
2 changes: 2 additions & 0 deletions src/subgraph/orders/subgraphQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ export const fetchPartnerRewards = (partnerAddress: string, count: number = 20,
sizeInUsd
timestamp
txHash
rewardToken { id symbol decimals }
referralRewardsInUsd
referralRewardsInToken
}
}
`;

0 comments on commit 2a718ae

Please sign in to comment.