Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data AuctionParams = AuctionParams {
- apOwner :: Address
- apAsset :: Value
- apEndTime :: POSIXTime
- apPayoutTime :: POSIXTime
- newtype BidArgs = BidArgs {}
- newtype RevealArgs = RevealArgs {}
- data AuctionError
- = StateMachineContractError SMContractError
- | AuctionContractError ContractError
- 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
AuctionParams | |
|
Instances
Instances
Show BidArgs Source # | |
Generic BidArgs Source # | |
FromJSON BidArgs Source # | |
Defined in Plutus.Contracts.SealedBidAuction parseJSON :: Value -> Parser BidArgs parseJSONList :: Value -> Parser [BidArgs] | |
ToJSON BidArgs Source # | |
Defined in Plutus.Contracts.SealedBidAuction toEncoding :: BidArgs -> Encoding toJSONList :: [BidArgs] -> Value toEncodingList :: [BidArgs] -> Encoding | |
type Rep BidArgs Source # | |
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 #
Instances
Show RevealArgs Source # | |
Defined in Plutus.Contracts.SealedBidAuction | |
Generic RevealArgs Source # | |
Defined in Plutus.Contracts.SealedBidAuction from :: RevealArgs -> Rep RevealArgs x Source # to :: Rep RevealArgs x -> RevealArgs Source # | |
FromJSON RevealArgs Source # | |
Defined in Plutus.Contracts.SealedBidAuction parseJSON :: Value -> Parser RevealArgs parseJSONList :: Value -> Parser [RevealArgs] | |
ToJSON RevealArgs Source # | |
Defined in Plutus.Contracts.SealedBidAuction toJSON :: RevealArgs -> Value toEncoding :: RevealArgs -> Encoding toJSONList :: [RevealArgs] -> Value toEncodingList :: [RevealArgs] -> Encoding | |
type Rep RevealArgs Source # | |
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 #
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