decentraland-ui
Version:
Decentraland's UI components and styles
132 lines (131 loc) • 8.52 kB
TypeScript
import { NFTCategory, NotificationType, Rarity } from '@dcl/schemas';
export declare enum NotificationActiveTab {
NEWEST = "newest",
READ = "read"
}
export declare type NotificationLocale = 'en' | 'es' | 'zh';
export declare type RawDecentralandNotification<T extends NotificationType, M> = {
id: string;
type: T;
address: string;
timestamp: number;
read: boolean;
created_at: string;
updated_at: string;
metadata: M;
};
declare type CommonNFTNotificationMetadata = {
link: string;
image: string;
rarity: Rarity;
nftName: string;
network: 'ethereum' | 'polygon';
category: NFTCategory;
};
declare type ItemSoldMetadata = CommonNFTNotificationMetadata & {
seller: string;
};
declare type RoyalitesEarnedMetadata = CommonNFTNotificationMetadata & {
royaltiesCollector: string;
royaltiesCut: string;
};
declare type BidAcceptedMetadata = CommonNFTNotificationMetadata & {
price: string;
};
declare type BidReceivedMetadata = CommonNFTNotificationMetadata & {
price: string;
};
export declare type ItemSoldNotification = RawDecentralandNotification<NotificationType.ITEM_SOLD, ItemSoldMetadata>;
export declare type RoyalitesEarnedNotification = RawDecentralandNotification<NotificationType.ROYALTIES_EARNED, RoyalitesEarnedMetadata>;
export declare type BidAcceptedNotification = RawDecentralandNotification<NotificationType.BID_ACCEPTED, BidAcceptedMetadata>;
export declare type BidReceivedNotification = RawDecentralandNotification<NotificationType.BID_RECEIVED, BidReceivedMetadata>;
declare type MarketplaceNotifications = ItemSoldNotification | RoyalitesEarnedNotification | BidAcceptedNotification | BidReceivedNotification;
declare type CommonGovernanceNotificationMetadata = {
proposalId: string;
proposalTitle: string;
title: string;
description: string;
link: string;
};
export declare type GovernanceAnnouncementNotification = RawDecentralandNotification<NotificationType.GOVERNANCE_ANNOUNCEMENT, Omit<CommonGovernanceNotificationMetadata, 'proposalId' | 'proposalTitle'>>;
export declare type GovernanceProposalEnactedNotification = RawDecentralandNotification<NotificationType.GOVERNANCE_PROPOSAL_ENACTED, CommonGovernanceNotificationMetadata>;
export declare type GovernanceCoauthorRequestedNotification = RawDecentralandNotification<NotificationType.GOVERNANCE_COAUTHOR_REQUESTED, CommonGovernanceNotificationMetadata>;
export declare type GovernanceAuthoredProposalFinishedNotification = RawDecentralandNotification<NotificationType.GOVERNANCE_AUTHORED_PROPOSAL_FINISHED, CommonGovernanceNotificationMetadata>;
export declare type GovernanceVotingEndedVoterNotification = RawDecentralandNotification<NotificationType.GOVERNANCE_VOTING_ENDED_VOTER, CommonGovernanceNotificationMetadata>;
export declare type GovernanceNewCommentOnProposalNotification = RawDecentralandNotification<NotificationType.GOVERNANCE_NEW_COMMENT_ON_PROPOSAL, CommonGovernanceNotificationMetadata>;
export declare type GovernanceNewCommentOnProjectUpdateNotification = RawDecentralandNotification<NotificationType.GOVERNANCE_NEW_COMMENT_ON_PROJECT_UPDATE, CommonGovernanceNotificationMetadata>;
export declare type GovernancePitchPassedNotification = RawDecentralandNotification<NotificationType.GOVERNANCE_PITCH_PASSED, CommonGovernanceNotificationMetadata>;
export declare type GovernanceTenderPassedNotification = RawDecentralandNotification<NotificationType.GOVERNANCE_TENDER_PASSED, CommonGovernanceNotificationMetadata>;
export declare type GovernanceVotedOnBehalfNotification = RawDecentralandNotification<NotificationType.GOVERNANCE_VOTED_ON_BEHALF, CommonGovernanceNotificationMetadata>;
export declare type GovernanceWhaleVoteNotification = RawDecentralandNotification<NotificationType.GOVERNANCE_WHALE_VOTE, CommonGovernanceNotificationMetadata>;
export declare type GovernanceCliffEndedNotification = RawDecentralandNotification<NotificationType.GOVERNANCE_CLIFF_ENDED, CommonGovernanceNotificationMetadata>;
declare type GovernanceNotifications = GovernanceAnnouncementNotification | GovernanceProposalEnactedNotification | GovernanceCoauthorRequestedNotification | GovernanceCliffEndedNotification | GovernanceAuthoredProposalFinishedNotification | GovernanceVotingEndedVoterNotification | GovernanceNewCommentOnProposalNotification | GovernanceNewCommentOnProjectUpdateNotification | GovernancePitchPassedNotification | GovernanceTenderPassedNotification | GovernanceVotedOnBehalfNotification | GovernanceWhaleVoteNotification;
declare type CommonWorldsNotificationMetadata = {
title: string;
description: string;
url: string;
};
declare type WorldsNotificationMetadataWithWhen = CommonWorldsNotificationMetadata & {
when: number;
};
export declare type WorldsMissingResourcesNotification = RawDecentralandNotification<NotificationType.WORLDS_MISSING_RESOURCES, WorldsNotificationMetadataWithWhen>;
export declare type WorldsAccessRestrictedNotification = RawDecentralandNotification<NotificationType.WORLDS_ACCESS_RESTRICTED, WorldsNotificationMetadataWithWhen>;
export declare type WorldsAccessRestoredNotification = RawDecentralandNotification<NotificationType.WORLDS_ACCESS_RESTORED, CommonWorldsNotificationMetadata>;
declare type WorldPermissionMetadata = {
title: string;
description: string;
world: string;
permissions: string[];
};
export declare type WorldsPermissionGrantedNotification = RawDecentralandNotification<NotificationType.WORLDS_PERMISSION_GRANTED, WorldPermissionMetadata>;
export declare type WorldsPermissionRevokedNotification = RawDecentralandNotification<NotificationType.WORLDS_PERMISSION_REVOKED, WorldPermissionMetadata>;
declare type WorldsNotifications = WorldsMissingResourcesNotification | WorldsAccessRestrictedNotification | WorldsAccessRestoredNotification | WorldsPermissionGrantedNotification | WorldsPermissionRevokedNotification;
declare type LandNotificationMetadata = {
description: string;
link: string;
title: string;
contract: string;
lessor: string;
tenant: string;
operator: string;
startedAt: string;
endedAt: string;
tokenId: string;
land: string;
};
export declare type LandRentedNotification = RawDecentralandNotification<NotificationType.LAND_RENTED, LandNotificationMetadata>;
export declare type LandRentalEndedNotification = RawDecentralandNotification<NotificationType.LAND_RENTAL_ENDED, LandNotificationMetadata>;
declare type LandNotifications = LandRentedNotification | LandRentalEndedNotification;
declare type CommonRewardsMetadata = {
tokenName: string;
tokenImage: string;
tokenRarity: Rarity;
};
declare type CommonCampaignMetadata = {
link?: string;
campaignName: string;
};
export declare type RewardAssignedNotification = RawDecentralandNotification<NotificationType.REWARD_ASSIGNED, CommonRewardsMetadata>;
export declare type RewardInProgressNotification = RawDecentralandNotification<NotificationType.REWARD_IN_PROGRESS, CommonRewardsMetadata>;
export declare type RewardDelayedNotification = RawDecentralandNotification<NotificationType.REWARD_DELAYED, CommonRewardsMetadata>;
export declare type CampaignOutOfStockNotification = RawDecentralandNotification<NotificationType.REWARD_CAMPAIGN_OUT_OF_STOCK, CommonCampaignMetadata>;
export declare type CampaignOutOfFundsNotification = RawDecentralandNotification<NotificationType.REWARD_CAMPAIGN_OUT_OF_FUNDS, CommonCampaignMetadata>;
export declare type CampaignGasPriceHigherThanExpectedNotification = RawDecentralandNotification<NotificationType.REWARD_CAMPAIGN_GAS_PRICE_HIGHER_THAN_EXPECTED, CommonCampaignMetadata>;
declare type CommonEventsMetadata = {
image: string;
link: string;
name: string;
};
export declare type EventsStartsSoonNotification = RawDecentralandNotification<NotificationType.EVENTS_STARTS_SOON, CommonEventsMetadata & {
startsAt: string;
endsAt: string;
}>;
export declare type EventsStartedNotification = RawDecentralandNotification<NotificationType.EVENTS_STARTED, CommonEventsMetadata>;
declare type EventsNotificatiosn = EventsStartsSoonNotification | EventsStartedNotification;
export declare type DCLNotification = MarketplaceNotifications | GovernanceNotifications | WorldsNotifications | LandNotifications | RewardAssignedNotification | EventsNotificatiosn;
export declare type CommonNotificationProps<N> = {
notification: N;
locale: NotificationLocale;
renderProfile?: (address: string) => JSX.Element | string | null;
};
export {};