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

Plutus.Contracts.Auction

Synopsis

Documentation

data AuctionState Source #

The states of the auction

Instances

Instances details
Eq AuctionState Source # 
Instance details

Defined in Plutus.Contracts.Auction

Show AuctionState Source # 
Instance details

Defined in Plutus.Contracts.Auction

Generic AuctionState Source # 
Instance details

Defined in Plutus.Contracts.Auction

Associated Types

type Rep AuctionState :: Type -> Type Source #

FromJSON AuctionState Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

parseJSON :: Value -> Parser AuctionState

parseJSONList :: Value -> Parser [AuctionState]

ToJSON AuctionState Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

toJSON :: AuctionState -> Value

toEncoding :: AuctionState -> Encoding

toJSONList :: [AuctionState] -> Value

toEncodingList :: [AuctionState] -> Encoding

ToData AuctionState Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

toBuiltinData :: AuctionState -> BuiltinData

FromData AuctionState Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

fromBuiltinData :: BuiltinData -> Maybe AuctionState

UnsafeFromData AuctionState Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

unsafeFromBuiltinData :: BuiltinData -> AuctionState

type Rep AuctionState Source # 
Instance details

Defined in Plutus.Contracts.Auction

type Rep AuctionState = D1 ('MetaData "AuctionState" "Plutus.Contracts.Auction" "plutus-use-cases-1.2.0.0-BuYOLXrynPcLosE012cowc" 'False) (C1 ('MetaCons "Ongoing" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HighestBid)) :+: C1 ('MetaCons "Finished" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HighestBid)))

data AuctionInput Source #

Transition between auction states

Constructors

Bid 

Fields

Payout 

Instances

Instances details
Show AuctionInput Source # 
Instance details

Defined in Plutus.Contracts.Auction

Generic AuctionInput Source # 
Instance details

Defined in Plutus.Contracts.Auction

Associated Types

type Rep AuctionInput :: Type -> Type Source #

FromJSON AuctionInput Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

parseJSON :: Value -> Parser AuctionInput

parseJSONList :: Value -> Parser [AuctionInput]

ToJSON AuctionInput Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

toJSON :: AuctionInput -> Value

toEncoding :: AuctionInput -> Encoding

toJSONList :: [AuctionInput] -> Value

toEncodingList :: [AuctionInput] -> Encoding

ToData AuctionInput Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

toBuiltinData :: AuctionInput -> BuiltinData

FromData AuctionInput Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

fromBuiltinData :: BuiltinData -> Maybe AuctionInput

UnsafeFromData AuctionInput Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

unsafeFromBuiltinData :: BuiltinData -> AuctionInput

type Rep AuctionInput Source # 
Instance details

Defined in Plutus.Contracts.Auction

type Rep AuctionInput = D1 ('MetaData "AuctionInput" "Plutus.Contracts.Auction" "plutus-use-cases-1.2.0.0-BuYOLXrynPcLosE012cowc" 'False) (C1 ('MetaCons "Bid" 'PrefixI 'True) (S1 ('MetaSel ('Just "newBid") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ada) :*: S1 ('MetaSel ('Just "newBidder") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Address)) :+: C1 ('MetaCons "Payout" 'PrefixI 'False) (U1 :: Type -> Type))

type BuyerSchema = Endpoint "bid" Ada Source #

type SellerSchema = EmptySchema Source #

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.

Instances

Instances details
Eq AuctionParams Source # 
Instance details

Defined in Plutus.Contracts.Auction

Show AuctionParams Source # 
Instance details

Defined in Plutus.Contracts.Auction

Generic AuctionParams Source # 
Instance details

Defined in Plutus.Contracts.Auction

Associated Types

type Rep AuctionParams :: Type -> Type Source #

FromJSON AuctionParams Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

parseJSON :: Value -> Parser AuctionParams

parseJSONList :: Value -> Parser [AuctionParams]

ToJSON AuctionParams Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

toJSON :: AuctionParams -> Value

toEncoding :: AuctionParams -> Encoding

toJSONList :: [AuctionParams] -> Value

toEncodingList :: [AuctionParams] -> Encoding

Lift DefaultUni AuctionParams Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

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

Typeable DefaultUni AuctionParams Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

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

type Rep AuctionParams Source # 
Instance details

Defined in Plutus.Contracts.Auction

type Rep AuctionParams = D1 ('MetaData "AuctionParams" "Plutus.Contracts.Auction" "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))))

data HighestBid Source #

Constructors

HighestBid 

Fields

Instances

Instances details
Eq HighestBid Source # 
Instance details

Defined in Plutus.Contracts.Auction

Show HighestBid Source # 
Instance details

Defined in Plutus.Contracts.Auction

Generic HighestBid Source # 
Instance details

Defined in Plutus.Contracts.Auction

Associated Types

type Rep HighestBid :: Type -> Type Source #

FromJSON HighestBid Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

parseJSON :: Value -> Parser HighestBid

parseJSONList :: Value -> Parser [HighestBid]

ToJSON HighestBid Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

toJSON :: HighestBid -> Value

toEncoding :: HighestBid -> Encoding

toJSONList :: [HighestBid] -> Value

toEncodingList :: [HighestBid] -> Encoding

ToData HighestBid Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

toBuiltinData :: HighestBid -> BuiltinData

FromData HighestBid Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

fromBuiltinData :: BuiltinData -> Maybe HighestBid

UnsafeFromData HighestBid Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

unsafeFromBuiltinData :: BuiltinData -> HighestBid

type Rep HighestBid Source # 
Instance details

Defined in Plutus.Contracts.Auction

type Rep HighestBid = D1 ('MetaData "HighestBid" "Plutus.Contracts.Auction" "plutus-use-cases-1.2.0.0-BuYOLXrynPcLosE012cowc" 'False) (C1 ('MetaCons "HighestBid" 'PrefixI 'True) (S1 ('MetaSel ('Just "highestBid") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ada) :*: S1 ('MetaSel ('Just "highestBidder") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Address)))

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

Client code for the seller

data AuctionOutput Source #

Observable state of the auction app

Instances

Instances details
Eq AuctionOutput Source # 
Instance details

Defined in Plutus.Contracts.Auction

Show AuctionOutput Source # 
Instance details

Defined in Plutus.Contracts.Auction

Generic AuctionOutput Source # 
Instance details

Defined in Plutus.Contracts.Auction

Associated Types

type Rep AuctionOutput :: Type -> Type Source #

Semigroup AuctionOutput Source # 
Instance details

Defined in Plutus.Contracts.Auction

Monoid AuctionOutput Source # 
Instance details

Defined in Plutus.Contracts.Auction

FromJSON AuctionOutput Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

parseJSON :: Value -> Parser AuctionOutput

parseJSONList :: Value -> Parser [AuctionOutput]

ToJSON AuctionOutput Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

toJSON :: AuctionOutput -> Value

toEncoding :: AuctionOutput -> Encoding

toJSONList :: [AuctionOutput] -> Value

toEncodingList :: [AuctionOutput] -> Encoding

type Rep AuctionOutput Source # 
Instance details

Defined in Plutus.Contracts.Auction

type Rep AuctionOutput = D1 ('MetaData "AuctionOutput" "Plutus.Contracts.Auction" "plutus-use-cases-1.2.0.0-BuYOLXrynPcLosE012cowc" 'False) (C1 ('MetaCons "AuctionOutput" 'PrefixI 'True) (S1 ('MetaSel ('Just "auctionState") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last AuctionState)) :*: S1 ('MetaSel ('Just "auctionThreadToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last ThreadToken))))

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.Auction

Show AuctionError Source # 
Instance details

Defined in Plutus.Contracts.Auction

Generic AuctionError Source # 
Instance details

Defined in Plutus.Contracts.Auction

Associated Types

type Rep AuctionError :: Type -> Type Source #

FromJSON AuctionError Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

parseJSON :: Value -> Parser AuctionError

parseJSONList :: Value -> Parser [AuctionError]

ToJSON AuctionError Source # 
Instance details

Defined in Plutus.Contracts.Auction

Methods

toJSON :: AuctionError -> Value

toEncoding :: AuctionError -> Encoding

toJSONList :: [AuctionError] -> Value

toEncodingList :: [AuctionError] -> Encoding

AsContractError AuctionError Source # 
Instance details

Defined in Plutus.Contracts.Auction

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.Auction

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.Auction

type Rep AuctionError = D1 ('MetaData "AuctionError" "Plutus.Contracts.Auction" "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)))

data ThreadToken #

Instances

Instances details
Eq ThreadToken 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Ord ThreadToken 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Show ThreadToken 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Generic ThreadToken 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Associated Types

type Rep ThreadToken :: Type -> Type Source #

FromJSON ThreadToken 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Methods

parseJSON :: Value -> Parser ThreadToken

parseJSONList :: Value -> Parser [ThreadToken]

ToJSON ThreadToken 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Methods

toJSON :: ThreadToken -> Value

toEncoding :: ThreadToken -> Encoding

toJSONList :: [ThreadToken] -> Value

toEncodingList :: [ThreadToken] -> Encoding

ToData ThreadToken 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Methods

toBuiltinData :: ThreadToken -> BuiltinData

FromData ThreadToken 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Methods

fromBuiltinData :: BuiltinData -> Maybe ThreadToken

UnsafeFromData ThreadToken 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Methods

unsafeFromBuiltinData :: BuiltinData -> ThreadToken

Lift DefaultUni ThreadToken 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Methods

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

Typeable DefaultUni ThreadToken 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

Methods

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

type Rep ThreadToken 
Instance details

Defined in Plutus.Contract.StateMachine.ThreadToken

type Rep ThreadToken = D1 ('MetaData "ThreadToken" "Plutus.Contract.StateMachine.ThreadToken" "plutus-contract-1.2.0.0-FH8LC9wh7UV4Nmv68NHXrC" 'False) (C1 ('MetaCons "ThreadToken" 'PrefixI 'True) (S1 ('MetaSel ('Just "ttOutRef") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TxOutRef) :*: S1 ('MetaSel ('Just "ttCurrencySymbol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CurrencySymbol)))

getThreadToken :: forall e w (schema :: Row Type). AsSMContractError e => Contract w schema e ThreadToken #

covIdx :: CoverageIndex Source #