diff --git a/schema.graphql b/schema.graphql index c0c02de..dc15db8 100644 --- a/schema.graphql +++ b/schema.graphql @@ -47,6 +47,7 @@ type Auction @entity { category: Int! buyNowPrice: BigInt! startBidPrice: BigInt! + isBuyNow: Boolean! } type Bid @entity { diff --git a/src/helper.ts b/src/helper.ts index 3d00188..909a329 100644 --- a/src/helper.ts +++ b/src/helper.ts @@ -84,6 +84,7 @@ export function getOrCreateAuction( auction.totalBids = BIGINT_ZERO; auction.buyNowPrice = BIGINT_ZERO; auction.startBidPrice = BIGINT_ZERO; + auction.isBuyNow = false; } return auction; diff --git a/src/mapping.ts b/src/mapping.ts index e30cca9..435c396 100644 --- a/src/mapping.ts +++ b/src/mapping.ts @@ -319,6 +319,7 @@ export function handleAuction_Initialized( auction.cancelled = false; auction.buyNowPrice = BigInt.fromI32(0); auction.startBidPrice = BigInt.fromI32(0); + auction.isBuyNow = false; // Update Auction auction = updateAuction(auction, event); @@ -598,6 +599,7 @@ export function handleAuction_BoughtNow( } auction.claimed = true; auction.claimAt = event.block.timestamp; + auction.isBuyNow = true; let bid = getOrCreateBid( auction.highestBidder,