plutus-use-cases-1.2.0.0: Collection of smart contracts to develop the plutus/wallet interface
Safe HaskellNone
LanguageHaskell2010

Plutus.Contracts.SealedBidAuction

Synopsis

Documentation

data AuctionParams Source #

Definition of an auction

Constructors

AuctionParams 

Fields

  • apOwner :: Address

    Current owner of the asset. This is where the proceeds of the auction will be sent.

  • apAsset :: Value

    The asset itself. This value is going to be locked by the auction script output.

  • apEndTime :: POSIXTime

    When the time window for bidding ends.

  • apPayoutTime :: POSIXTime

    When the time window for revealing your bid ends.

Instances

Instances details
Eq AuctionParams Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Show AuctionParams Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Generic AuctionParams Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Associated Types

type Rep AuctionParams :: Type -> Type Source #

FromJSON AuctionParams Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Methods

parseJSON :: Value -> Parser AuctionParams

parseJSONList :: Value -> Parser [AuctionParams]

ToJSON AuctionParams Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Methods

toJSON :: AuctionParams -> Value

toEncoding :: AuctionParams -> Encoding

toJSONList :: [AuctionParams] -> Value

toEncodingList :: [AuctionParams] -> Encoding

Lift DefaultUni AuctionParams Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Methods

lift :: AuctionParams -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Typeable DefaultUni AuctionParams Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Methods

typeRep :: Proxy AuctionParams -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep AuctionParams Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

type Rep AuctionParams = D1 ('MetaData "AuctionParams" "Plutus.Contracts.SealedBidAuction" "plutus-use-cases-1.2.0.0-BuYOLXrynPcLosE012cowc" 'False) (C1 ('MetaCons "AuctionParams" 'PrefixI 'True) ((S1 ('MetaSel ('Just "apOwner") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Address) :*: S1 ('MetaSel ('Just "apAsset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value)) :*: (S1 ('MetaSel ('Just "apEndTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 POSIXTime) :*: S1 ('MetaSel ('Just "apPayoutTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 POSIXTime))))

newtype BidArgs Source #

Constructors

BidArgs 

Fields

Instances

Instances details
Show BidArgs Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Generic BidArgs Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Associated Types

type Rep BidArgs :: Type -> Type Source #

FromJSON BidArgs Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Methods

parseJSON :: Value -> Parser BidArgs

parseJSONList :: Value -> Parser [BidArgs]

ToJSON BidArgs Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Methods

toJSON :: BidArgs -> Value

toEncoding :: BidArgs -> Encoding

toJSONList :: [BidArgs] -> Value

toEncodingList :: [BidArgs] -> Encoding

type Rep BidArgs Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

type Rep BidArgs = D1 ('MetaData "BidArgs" "Plutus.Contracts.SealedBidAuction" "plutus-use-cases-1.2.0.0-BuYOLXrynPcLosE012cowc" 'True) (C1 ('MetaCons "BidArgs" 'PrefixI 'True) (S1 ('MetaSel ('Just "secretBid") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SecretArgument Integer))))

newtype RevealArgs Source #

Constructors

RevealArgs 

Fields

Instances

Instances details
Show RevealArgs Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Generic RevealArgs Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Associated Types

type Rep RevealArgs :: Type -> Type Source #

FromJSON RevealArgs Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Methods

parseJSON :: Value -> Parser RevealArgs

parseJSONList :: Value -> Parser [RevealArgs]

ToJSON RevealArgs Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Methods

toJSON :: RevealArgs -> Value

toEncoding :: RevealArgs -> Encoding

toJSONList :: [RevealArgs] -> Value

toEncodingList :: [RevealArgs] -> Encoding

type Rep RevealArgs Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

type Rep RevealArgs = D1 ('MetaData "RevealArgs" "Plutus.Contracts.SealedBidAuction" "plutus-use-cases-1.2.0.0-BuYOLXrynPcLosE012cowc" 'True) (C1 ('MetaCons "RevealArgs" 'PrefixI 'True) (S1 ('MetaSel ('Just "publicBid") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))

data AuctionError Source #

Constructors

StateMachineContractError SMContractError

State machine operation failed

AuctionContractError ContractError

Endpoint, coin selection, etc. failed

Instances

Instances details
Eq AuctionError Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Show AuctionError Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Generic AuctionError Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Associated Types

type Rep AuctionError :: Type -> Type Source #

FromJSON AuctionError Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Methods

parseJSON :: Value -> Parser AuctionError

parseJSONList :: Value -> Parser [AuctionError]

ToJSON AuctionError Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Methods

toJSON :: AuctionError -> Value

toEncoding :: AuctionError -> Encoding

toJSONList :: [AuctionError] -> Value

toEncodingList :: [AuctionError] -> Encoding

AsContractError AuctionError Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Methods

_ContractError :: Prism' AuctionError ContractError

_WalletContractError :: Prism' AuctionError WalletAPIError

_ChainIndexContractError :: Prism' AuctionError (Text, ChainIndexResponse)

_ConstraintResolutionContractError :: Prism' AuctionError MkTxError

_ToCardanoConvertContractError :: Prism' AuctionError ToCardanoError

_ResumableContractError :: Prism' AuctionError MatchingError

_CCheckpointContractError :: Prism' AuctionError CheckpointError

_EndpointDecodeContractError :: Prism' AuctionError (EndpointDescription, EndpointValue Value, Text)

_OtherContractError :: Prism' AuctionError Text

AsSMContractError AuctionError Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

Methods

_SMContractError :: Prism' AuctionError SMContractError

_ChooserError :: Prism' AuctionError Text

_UnableToExtractTransition :: Prism' AuctionError ()

_SMCContractError :: Prism' AuctionError ContractError

type Rep AuctionError Source # 
Instance details

Defined in Plutus.Contracts.SealedBidAuction

type Rep AuctionError = D1 ('MetaData "AuctionError" "Plutus.Contracts.SealedBidAuction" "plutus-use-cases-1.2.0.0-BuYOLXrynPcLosE012cowc" 'False) (C1 ('MetaCons "StateMachineContractError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SMContractError)) :+: C1 ('MetaCons "AuctionContractError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ContractError)))

type BidderSchema = (Endpoint "bid" BidArgs .\/ Endpoint "reveal" RevealArgs) .\/ Endpoint "payout" () Source #

type SellerSchema = Endpoint "payout" () Source #

startAuction :: Value -> POSIXTime -> POSIXTime -> Contract () SellerSchema AuctionError () Source #

payout :: HasEndpoint "payout" () s => AuctionParams -> Promise () s AuctionError () Source #

packInteger :: Integer -> BuiltinByteString Source #

Pack an integer into a byte string with a leading sign byte in little-endian order

sellerContract :: AuctionParams -> Contract () SellerSchema AuctionError () Source #

Top-level contract for seller

bidderContract :: AuctionParams -> Contract () BidderSchema AuctionError () Source #

Top-level contract for buyer