Skip to content

Commit

Permalink
updating the types
Browse files Browse the repository at this point in the history
  • Loading branch information
cyficowley committed Apr 29, 2022
1 parent e41cf62 commit 1182875
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 28 deletions.
28 changes: 0 additions & 28 deletions frontend/types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
57 changes: 57 additions & 0 deletions frontend/types/types.ts
Original file line number Diff line number Diff line change
@@ -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[];
}

0 comments on commit 1182875

Please sign in to comment.