plutus-playground-server-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Game

Synopsis

Documentation

newtype HashedString Source #

Instances

Instances details
UnsafeFromData HashedString Source # 
Instance details

Defined in Game

FromData HashedString Source # 
Instance details

Defined in Game

ToData HashedString Source # 
Instance details

Defined in Game

Lift DefaultUni HashedString Source # 
Instance details

Defined in Game

Typeable DefaultUni HashedString Source # 
Instance details

Defined in Game

newtype ClearString Source #

Instances

Instances details
UnsafeFromData ClearString Source # 
Instance details

Defined in Game

FromData ClearString Source # 
Instance details

Defined in Game

ToData ClearString Source # 
Instance details

Defined in Game

Lift DefaultUni ClearString Source # 
Instance details

Defined in Game

Typeable DefaultUni ClearString Source # 
Instance details

Defined in Game

data Game Source #

Instances

Instances details
ValidatorTypes Game Source # 
Instance details

Defined in Game

Associated Types

type RedeemerType Game Source #

type DatumType Game Source #

type DatumType Game Source # 
Instance details

Defined in Game

type RedeemerType Game Source # 
Instance details

Defined in Game

validateGuess :: HashedString -> ClearString -> ScriptContext -> Bool Source #

The validation function (Datum -> Redeemer -> ScriptContext -> Bool)

gameValidator :: Validator Source #

The validator script of the game.

gameAddress :: Address Source #

The address of the game (the hash of its validator script)

data LockParams Source #

Parameters for the "lock" endpoint

Constructors

LockParams 

Fields

Instances

Instances details
Eq LockParams Source # 
Instance details

Defined in Game

Show LockParams Source # 
Instance details

Defined in Game

Generic LockParams Source # 
Instance details

Defined in Game

Associated Types

type Rep LockParams :: Type -> Type Source #

ToJSON LockParams Source # 
Instance details

Defined in Game

FromJSON LockParams Source # 
Instance details

Defined in Game

ToSchema LockParams Source # 
Instance details

Defined in Game

ToArgument LockParams Source # 
Instance details

Defined in Game

type Rep LockParams Source # 
Instance details

Defined in Game

type Rep LockParams = D1 ('MetaData "LockParams" "Game" "plutus-playground-server-0.1.0.0-9o0UzebbZ3FL7h93YOvSmI" 'False) (C1 ('MetaCons "LockParams" 'PrefixI 'True) (S1 ('MetaSel ('Just "secretWord") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "amount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value)))

newtype GuessParams Source #

Constructors

GuessParams 

Fields

Instances

Instances details
Eq GuessParams Source # 
Instance details

Defined in Game

Show GuessParams Source # 
Instance details

Defined in Game

Generic GuessParams Source # 
Instance details

Defined in Game

Associated Types

type Rep GuessParams :: Type -> Type Source #

ToJSON GuessParams Source # 
Instance details

Defined in Game

FromJSON GuessParams Source # 
Instance details

Defined in Game

ToSchema GuessParams Source # 
Instance details

Defined in Game

ToArgument GuessParams Source # 
Instance details

Defined in Game

type Rep GuessParams Source # 
Instance details

Defined in Game

type Rep GuessParams = D1 ('MetaData "GuessParams" "Game" "plutus-playground-server-0.1.0.0-9o0UzebbZ3FL7h93YOvSmI" 'True) (C1 ('MetaCons "GuessParams" 'PrefixI 'True) (S1 ('MetaSel ('Just "guessWord") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))

lock :: AsContractError e => Promise () GameSchema e () Source #

The "lock" contract endpoint. See note [Contract endpoints]

guess :: AsContractError e => Promise () GameSchema e () Source #

The "guess" contract endpoint. See note [Contract endpoints]

findSecretWordValue :: Map TxOutRef ChainIndexTxOut -> Maybe HashedString Source #

Find the secret word in the Datum of the UTxOs

secretWordValue :: ChainIndexTxOut -> Maybe HashedString Source #

Extract the secret word in the Datum of a given transaction output is possible