Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
lfportal committed Sep 24, 2024
1 parent f99db36 commit 4785b81
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
22 changes: 12 additions & 10 deletions packages/orderbook/src/orderbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export class Orderbook {
listingParams[0].sell,
listingParams[0].buy,
listingParams[0].sell.type === 'ERC1155',
new Date(),
listingParams[0].orderStart || new Date(),
listingParams[0].orderExpiry || Orderbook.defaultOrderExpiry(),
);

Expand Down Expand Up @@ -283,7 +283,7 @@ export class Orderbook {
listing.sell,
listing.buy,
listing.sell.type === 'ERC1155',
new Date(),
listing.orderStart || new Date(),
listing.orderExpiry || Orderbook.defaultOrderExpiry(),
)));

Expand Down Expand Up @@ -344,12 +344,12 @@ export class Orderbook {
track('orderbookmr', 'bulkListings', { walletType: 'EOA', makerAddress, listingsCount: listingParams.length });
const { actions, preparedOrders } = await this.seaport.prepareBulkSeaportOrders(
makerAddress,
listingParams.map((orderParam) => ({
offerItem: orderParam.sell,
considerationItem: orderParam.buy,
allowPartialFills: orderParam.sell.type === 'ERC1155',
orderStart: new Date(),
orderExpiry: orderParam.orderExpiry || Orderbook.defaultOrderExpiry(),
listingParams.map((listing) => ({
offerItem: listing.sell,
considerationItem: listing.buy,
allowPartialFills: listing.sell.type === 'ERC1155',
orderStart: listing.orderStart || new Date(),
orderExpiry: listing.orderExpiry || Orderbook.defaultOrderExpiry(),
})),
);

Expand Down Expand Up @@ -408,6 +408,7 @@ export class Orderbook {
makerAddress,
sell,
buy,
orderStart,
orderExpiry,
}: PrepareListingParams): Promise<PrepareListingResponse> {
return this.seaport.prepareSeaportOrder(
Expand All @@ -416,7 +417,7 @@ export class Orderbook {
buy,
sell.type === 'ERC1155',
// Default order start to now
new Date(),
orderStart || new Date(),
// Default order expiry to 2 years from now
orderExpiry || Orderbook.defaultOrderExpiry(),
);
Expand Down Expand Up @@ -451,6 +452,7 @@ export class Orderbook {
makerAddress,
sell,
buy,
orderStart,
orderExpiry,
}: PrepareBidParams): Promise<PrepareBidResponse> {
return this.seaport.prepareSeaportOrder(
Expand All @@ -459,7 +461,7 @@ export class Orderbook {
buy,
buy.type === 'ERC1155',
// Default order start to now
new Date(),
orderStart || new Date(),
// Default order expiry to 2 years from now
orderExpiry || Orderbook.defaultOrderExpiry(),
);
Expand Down
3 changes: 3 additions & 0 deletions packages/orderbook/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ export interface PrepareListingParams {
makerAddress: string;
sell: ERC721Item | ERC1155Item;
buy: NativeItem | ERC20Item;
orderStart?: Date;
orderExpiry?: Date;
}

Expand All @@ -199,6 +200,7 @@ export interface PrepareBulkListingsParams {
sell: ERC721Item | ERC1155Item;
buy: NativeItem | ERC20Item;
makerFees: FeeValue[];
orderStart?: Date;
orderExpiry?: Date;
}[];
}
Expand Down Expand Up @@ -250,6 +252,7 @@ export interface PrepareBidParams {
makerAddress: string;
sell: ERC20Item;
buy: ERC721Item | ERC1155Item;
orderStart?: Date;
orderExpiry?: Date;
}

Expand Down

0 comments on commit 4785b81

Please sign in to comment.