/// @inheritdoc IResolver
function getGrantStories(bytes32 grantUID) external view returns (GrantStory[] memory) {
return _stories[grantUID];
}
/// Struct that represents a grant story that appears as a timeline.
struct GrantStory {
uint256 timestamp;
bytes32 txUID;
bytes32[] badgeIds;
uint8[] badgeScores;
uint256 averageScore;
}
/// @param badgeId The badge ID to fetch.
/// @return badge The badge data struct.
function getBadge(bytes32 badgeId) external view returns (Badge memory);
/// Badge Struct.
struct Badge {
string name;
string description;
string metadata;
bytes data;
}
Use the grantUID to call the getGrantStories function on the Trustful Resolver.sol Contract.
It will return an array with all the history of the reviews.
Save all the returned values into the context.
It will take the most recent badgeIds from the array and then:
4.1. Call the getBadge function at the BadgeRegistry.sol contract and save it in the context the:
4.1.1. Name.
4.1.2. Description.
4.1.3. Metadata.
4.1.3.1. You need to check if the word "ipfs" is present, if yes search the ipfs link and if not,
assume it's a regular image on the internet and simply fetch as URL.
4.2. Then put this data into the front-end.
As soon as the user clicks on a Star in the Timeline/Navbar:
5.1. Repeat step 3.
grantUID
to call thegetGrantStories
function on the TrustfulResolver.sol
Contract.badgeIds
from the array and then: 4.1. Call thegetBadge
function at theBadgeRegistry.sol
contract and save it in the context the: 4.1.1. Name. 4.1.2. Description. 4.1.3. Metadata. 4.1.3.1. You need to check if the word "ipfs" is present, if yes search the ipfs link and if not,assume it's a regular image on the internet and simply fetch as URL. 4.2. Then put this data into the front-end.