plutus-pab-0.1.0.0
Safe HaskellNone
LanguageHaskell2010

Plutus.PAB.Effects.Contract.Builtin

Synopsis

Documentation

data Builtin a Source #

Contracts that are built into the PAB (ie. compiled with it) and receive an initial value of type a.

We have a dummy constructor so that we can convert this datatype in Purescript with '(equal * (genericShow * mkSumType)) (Proxy @(Builtin A))'.

Instances

Instances details
Eq (Builtin a) Source # 
Instance details

Defined in Plutus.PAB.Effects.Contract.Builtin

Methods

(==) :: Builtin a -> Builtin a -> Bool Source #

(/=) :: Builtin a -> Builtin a -> Bool Source #

Generic (Builtin a) Source # 
Instance details

Defined in Plutus.PAB.Effects.Contract.Builtin

Associated Types

type Rep (Builtin a) :: Type -> Type Source #

Methods

from :: Builtin a -> Rep (Builtin a) x Source #

to :: Rep (Builtin a) x -> Builtin a Source #

ToSchema t => ToSchema (Builtin t) Source # 
Instance details

Defined in Plutus.PAB.Effects.Contract.Builtin

PABContract (Builtin a) Source # 
Instance details

Defined in Plutus.PAB.Effects.Contract.Builtin

Associated Types

type ContractDef (Builtin a) Source #

type State (Builtin a) Source #

type Rep (Builtin a) Source # 
Instance details

Defined in Plutus.PAB.Effects.Contract.Builtin

type Rep (Builtin a) = D1 ('MetaData "Builtin" "Plutus.PAB.Effects.Contract.Builtin" "plutus-pab-0.1.0.0-1vc1rt5g5zvBlHvXKfwLQ7" 'False) (C1 ('MetaCons "Builtin" 'PrefixI 'False) (U1 :: Type -> Type))
type ContractDef (Builtin a) Source # 
Instance details

Defined in Plutus.PAB.Effects.Contract.Builtin

type ContractDef (Builtin a) = a
type State (Builtin a) Source # 
Instance details

Defined in Plutus.PAB.Effects.Contract.Builtin

type ContractConstraints w schema error = (Monoid w, Forall (Output schema) ToJSON, Forall (Input schema) ToJSON, Forall (Input schema) FromJSON, ToJSON error, ToJSON w, FromJSON w, AllUniqueLabels (Input schema)) Source #

data SomeBuiltin where Source #

Plutus contract with all parameters existentially quantified. Can be any contract that satisfies the ContractConstraints.

Constructors

SomeBuiltin :: forall contract w schema error a. (ContractConstraints w schema error, IsContract contract) => contract w schema error a -> SomeBuiltin 

data SomeBuiltinState a where Source #

Constructors

SomeBuiltinState 

Fields

newtype BuiltinHandler a Source #

Defined in order to prevent type errors like: "Couldn't match type effs with effs1".

Constructors

BuiltinHandler 

Fields

handleBuiltin :: HasDefinitions a => BuiltinHandler a Source #

Handle the ContractEffect for a builtin contract type with parameter a.

Extracting schemas from contracts

type family (l :: Row k) .\\ (r :: Row k) :: Row k where ... infixl 6 Source #

Type level Row difference. That is, l .\\ r is the row remaining after removing any matching elements of r from l.

Equations

('R l :: Row a) .\\ ('R r :: Row a) = 'R (Diff l r) 

type family (l :: Row k) .\/ (r :: Row k) :: Row k where ... infixl 6 Source #

The minimum join of the two rows.

Equations

(x :: Row k) .\/ ('R ('[] :: [LT k]) :: Row k) = x 
('R ('[] :: [LT k]) :: Row k) .\/ (y :: Row k) = y 
('R l :: Row a) .\/ ('R r :: Row a) = 'R (MinJoinR l r) 

type Empty = 'R ('[] :: [LT a]) Source #

Type level version of empty

fromResponse :: forall a effs. (Member (LogMsg (PABMultiAgentMsg (Builtin a))) effs, Member (Error PABError) effs) => ContractInstanceId -> SomeBuiltin -> ContractResponse Value Value PABResp PABReq -> Eff effs (SomeBuiltinState a) Source #

Reconstruct a state from a serialised response by replaying back the actions.

class HasDefinitions a where Source #

Allows contract type a to specify its available contract definitions. Also, for each contract type, we specify its contract function and its schemas.

Methods

getDefinitions Source #

Arguments

:: [a]

Available contract definitions for a contract type a

getContract Source #

Arguments

:: a 
-> SomeBuiltin

The actual contract function of contract type a

getSchema :: a -> [FunctionSchema FormSchema] Source #