| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Plutus.Contracts.Auction
Synopsis
- data AuctionState
- data AuctionInput
- type BuyerSchema = Endpoint "bid" Ada
- type SellerSchema = EmptySchema
- data AuctionParams = AuctionParams {}
- data HighestBid = HighestBid {}
- auctionBuyer :: ThreadToken -> AuctionParams -> Contract AuctionOutput BuyerSchema AuctionError ()
- auctionSeller :: Value -> POSIXTime -> Contract AuctionOutput SellerSchema AuctionError ()
- data AuctionOutput = AuctionOutput {}
- data AuctionError
- data ThreadToken
- getThreadToken :: forall e w (schema :: Row Type). AsSMContractError e => Contract w schema e ThreadToken
- covIdx :: CoverageIndex
Documentation
data AuctionState Source #
The states of the auction
Constructors
| Ongoing HighestBid | |
| Finished HighestBid |
Instances
data AuctionInput Source #
Transition between auction states
Instances
type BuyerSchema = Endpoint "bid" Ada Source #
type SellerSchema = EmptySchema Source #
data AuctionParams Source #
Definition of an auction
Constructors
| AuctionParams | |
Instances
data HighestBid Source #
Constructors
| HighestBid | |
Fields
| |
Instances
auctionBuyer :: ThreadToken -> AuctionParams -> Contract AuctionOutput BuyerSchema AuctionError () Source #
auctionSeller :: Value -> POSIXTime -> Contract AuctionOutput SellerSchema AuctionError () Source #
Client code for the seller
data AuctionOutput Source #
Observable state of the auction app
Constructors
| AuctionOutput | |
Fields | |
Instances
data AuctionError Source #
Constructors
| StateMachineContractError SMContractError | State machine operation failed |
| AuctionContractError ContractError | Endpoint, coin selection, etc. failed |
Instances
data ThreadToken Source #
Instances
getThreadToken :: forall e w (schema :: Row Type). AsSMContractError e => Contract w schema e ThreadToken Source #
Create a thread token. The thread token contains a reference to an unspent output of the wallet,
so it needs to used with mkStateMachine immediately, and the machine must be initialised,
to prevent the output from getting spent in the mean time.