|
| 1 | +{-# LANGUAGE TemplateHaskell #-} |
| 2 | +{-# LANGUAGE UndecidableInstances #-} |
| 3 | +{-# OPTIONS_GHC -Wno-orphans #-} |
| 4 | + |
| 5 | +module Spec.HydraAuctionOnchain.Types.AuctionTerms |
| 6 | + ( AuctionTerms (..) |
| 7 | + ) where |
| 8 | + |
| 9 | +import HydraAuctionOnchain.Types.AuctionTerms (PAuctionTerms) |
| 10 | +import Plutarch.DataRepr (DerivePConstantViaData (DerivePConstantViaData)) |
| 11 | +import Plutarch.Lift (PConstantDecl, PUnsafeLiftDecl (PLifted)) |
| 12 | +import PlutusLedgerApi.V2 (BuiltinByteString, POSIXTime, PubKeyHash, Value) |
| 13 | +import PlutusTx (makeIsDataIndexed) |
| 14 | + |
| 15 | +data AuctionTerms = AuctionTerms |
| 16 | + { at'AuctionLot :: Value |
| 17 | + , at'SellerPkh :: PubKeyHash |
| 18 | + , at'SellerVk :: BuiltinByteString |
| 19 | + , at'Delegates :: [PubKeyHash] |
| 20 | + , at'BiddingStart :: POSIXTime |
| 21 | + , at'BiddingEnd :: POSIXTime |
| 22 | + , at'PurchaseDeadline :: POSIXTime |
| 23 | + , at'Cleanup :: POSIXTime |
| 24 | + , at'AuctionFeePerDelegate :: Integer |
| 25 | + , at'StartingBid :: Integer |
| 26 | + , at'MinBidIncrement :: Integer |
| 27 | + , at'MinDepositAmount :: Integer |
| 28 | + } |
| 29 | + deriving stock (Show, Eq) |
| 30 | + |
| 31 | +makeIsDataIndexed ''AuctionTerms [('AuctionTerms, 0)] |
| 32 | + |
| 33 | +deriving via |
| 34 | + (DerivePConstantViaData AuctionTerms PAuctionTerms) |
| 35 | + instance |
| 36 | + (PConstantDecl AuctionTerms) |
| 37 | + |
| 38 | +instance PUnsafeLiftDecl PAuctionTerms where |
| 39 | + type PLifted PAuctionTerms = AuctionTerms |
0 commit comments