diff --git a/schema.gql b/schema.gql index 0d76bde57..126ad4ae6 100644 --- a/schema.gql +++ b/schema.gql @@ -309,6 +309,7 @@ enum AuctionStatusEnum { } enum AuctionTypeEnum { + FixedPrice Nft NftBid None diff --git a/src/modules/auctions/auctions-setter.service.ts b/src/modules/auctions/auctions-setter.service.ts index 8f4ea07f6..6cb4f2706 100644 --- a/src/modules/auctions/auctions-setter.service.ts +++ b/src/modules/auctions/auctions-setter.service.ts @@ -1,5 +1,5 @@ import { Injectable, Logger } from '@nestjs/common'; -import { Auction, AuctionAbi, AuctionStatusEnum, ExternalAuctionAbi } from './models'; +import { Auction, AuctionAbi, AuctionStatusEnum, AuctionTypeEnum, ExternalAuctionAbi } from './models'; import '../../utils/extensions'; import { AuctionEntity } from 'src/db/auctions'; import { NftMarketplaceAbiService } from './nft-marketplace.abi.service'; @@ -56,6 +56,14 @@ export class AuctionsSetterService { ); } + if ( + auctionEntity.maxBidDenominated === auctionEntity.minBidDenominated && + auctionEntity.type !== AuctionTypeEnum.SftAll && + auctionEntity.type !== AuctionTypeEnum.SftOnePerPayment + ) { + auctionEntity.type = AuctionTypeEnum.FixedPrice; + } + const savedAuction = await this.persistenceService.insertAuction(auctionEntity); if (asset?.tags) { diff --git a/src/modules/auctions/models/AuctionType.enum.ts b/src/modules/auctions/models/AuctionType.enum.ts index ebfb0f1c0..981917931 100644 --- a/src/modules/auctions/models/AuctionType.enum.ts +++ b/src/modules/auctions/models/AuctionType.enum.ts @@ -4,6 +4,7 @@ export enum AuctionTypeEnum { None = 'None', Nft = 'Nft', NftBid = 'NftBid', + FixedPrice = 'FixedPrice', SftAll = 'SftAll', SftOnePerPayment = 'SftOnePerPayment', }