| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Plutus.Contracts.SealedBidAuction
Synopsis
- data AuctionParams = AuctionParams {}
- newtype BidArgs = BidArgs {}
- newtype RevealArgs = RevealArgs {}
- data AuctionError
- type BidderSchema = (Endpoint "bid" BidArgs .\/ Endpoint "reveal" RevealArgs) .\/ Endpoint "payout" ()
- type SellerSchema = Endpoint "payout" ()
- startAuction :: Value -> POSIXTime -> POSIXTime -> Contract () SellerSchema AuctionError ()
- bid :: AuctionParams -> Promise () BidderSchema AuctionError ()
- reveal :: AuctionParams -> Promise () BidderSchema AuctionError ()
- payout :: HasEndpoint "payout" () s => AuctionParams -> Promise () s AuctionError ()
- packInteger :: Integer -> BuiltinByteString
- sellerContract :: AuctionParams -> Contract () SellerSchema AuctionError ()
- bidderContract :: AuctionParams -> Contract () BidderSchema AuctionError ()
Documentation
data AuctionParams Source #
Definition of an auction
Constructors
| AuctionParams | |
Fields
| |
Instances
Constructors
| BidArgs | |
Fields | |
Instances
| Show BidArgs Source # | |
| Generic BidArgs Source # | |
| ToJSON BidArgs Source # | |
| FromJSON BidArgs Source # | |
| type Rep BidArgs Source # | |
Defined in Plutus.Contracts.SealedBidAuction type Rep BidArgs = D1 ('MetaData "BidArgs" "Plutus.Contracts.SealedBidAuction" "plutus-use-cases-1.1.0.0-9kk4ZO09YVFKU77qwQaRsf" 'True) (C1 ('MetaCons "BidArgs" 'PrefixI 'True) (S1 ('MetaSel ('Just "secretBid") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SecretArgument Integer)))) | |
newtype RevealArgs Source #
Constructors
| RevealArgs | |
Instances
| Show RevealArgs Source # | |
Defined in Plutus.Contracts.SealedBidAuction | |
| Generic RevealArgs Source # | |
Defined in Plutus.Contracts.SealedBidAuction | |
| ToJSON RevealArgs Source # | |
Defined in Plutus.Contracts.SealedBidAuction Methods toJSON :: RevealArgs -> Value Source # toEncoding :: RevealArgs -> Encoding Source # toJSONList :: [RevealArgs] -> Value Source # toEncodingList :: [RevealArgs] -> Encoding Source # | |
| FromJSON RevealArgs Source # | |
Defined in Plutus.Contracts.SealedBidAuction Methods parseJSON :: Value -> Parser RevealArgs Source # parseJSONList :: Value -> Parser [RevealArgs] Source # | |
| type Rep RevealArgs Source # | |
Defined in Plutus.Contracts.SealedBidAuction type Rep RevealArgs = D1 ('MetaData "RevealArgs" "Plutus.Contracts.SealedBidAuction" "plutus-use-cases-1.1.0.0-9kk4ZO09YVFKU77qwQaRsf" '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
type BidderSchema = (Endpoint "bid" BidArgs .\/ Endpoint "reveal" RevealArgs) .\/ Endpoint "payout" () Source #
type SellerSchema = Endpoint "payout" () Source #
startAuction :: Value -> POSIXTime -> POSIXTime -> Contract () SellerSchema AuctionError () Source #
bid :: AuctionParams -> Promise () BidderSchema AuctionError () Source #
reveal :: AuctionParams -> Promise () BidderSchema 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