diff --git a/frontend/types/types.d.ts b/frontend/types/types.d.ts index bb3f518..9d7af1b 100644 --- a/frontend/types/types.d.ts +++ b/frontend/types/types.d.ts @@ -4,31 +4,3 @@ declare module "*.png" { const value: any; export = value; } - -export interface RentContract { - lenderAddress: string; - borrowerAddress: string; - nftCollection: string; - nftId: string; - startDate: Date; - dueDate: Date - rentalPayment: number; - collateral: number; - collateralPayoutPeriod: number; -} - -export interface AvaliableDates { - startDate: Date; - endDate: Date; -} - -export interface Listing { - nftListingName: string; - nftListingDescription: string; - datesForRent: AvaliableDates[]; -} - -export interface Nft { - contract?: RentContract; - listing: Listing; -} diff --git a/frontend/types/types.ts b/frontend/types/types.ts new file mode 100644 index 0000000..49cb7c9 --- /dev/null +++ b/frontend/types/types.ts @@ -0,0 +1,57 @@ +// declare modules here + +export interface NftSpecification { + nftCollection: string; + nftId: string; +} + +export interface RentContract { + lenderAddress: string; + borrowerAddress: string; + startDate: Date; + dueDate: Date + rentalPayment: number; + collateralPayoutPeriod: number; +} + +export interface AvaliableDates { + startDate: Date; + endDate: Date; +} + +export interface Listing { + name: string; + description: string; + datesForRent: AvaliableDates[]; + pricePerDay: number; + collateral: number; +} + +export interface Nft { + contract?: RentContract; + listing: Listing; + nftSpecification: NftSpecification; +} + +export enum AvaliabilityStatus { + Avaliabile, + Unavaliabile, + Rented, + Upcoming, +} +export interface Avaliability { + status: AvaliabilityStatus; + AvaliabiltyDate?: Date; +} + +export interface Attribute { + traitType: string, + value: string, +} + +export interface NftWithMetadata { + nft: Nft; + image: string; + avaliability: Avaliability; + attributes: Attribute[]; +} \ No newline at end of file