From 1182875990104571de1822c3432b1f03c05c31ec Mon Sep 17 00:00:00 2001 From: Cyrus Cowley Date: Fri, 29 Apr 2022 12:38:36 -0700 Subject: [PATCH] updating the types --- frontend/types/types.d.ts | 28 ------------------- frontend/types/types.ts | 57 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 28 deletions(-) create mode 100644 frontend/types/types.ts 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