cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.Skeleton.Output

Description

This module exposes the outputs constructs used in a TxSkel and their associated utilities. To build payments in a skeleton, the usual way is to invoke txSkelIns = [pk receives Value v, script receives (InlineDatum dat && ReferenceScript script)]

Synopsis

Type constraints

class IsTxSkelOutAllowedOwner a where Source #

A conveniency typeclass to automated the creation of TxSkelOut owners, to be used alongside Payable with the smart constructor receives.

Instances

Instances details
IsTxSkelOutAllowedOwner VScript Source # 
Instance details

Defined in Cooked.Skeleton.Output

IsTxSkelOutAllowedOwner Wallet Source # 
Instance details

Defined in Cooked.Skeleton.Output

IsTxSkelOutAllowedOwner PubKeyHash Source # 
Instance details

Defined in Cooked.Skeleton.Output

IsTxSkelOutAllowedOwner (Versioned Validator) Source # 
Instance details

Defined in Cooked.Skeleton.Output

Typeable a => IsTxSkelOutAllowedOwner (TypedValidator a) Source # 
Instance details

Defined in Cooked.Skeleton.Output

Typeable a => IsTxSkelOutAllowedOwner (MultiPurposeScript a) Source # 
Instance details

Defined in Cooked.Skeleton.Output

IsTxSkelOutAllowedOwner (User 'IsEither 'Allocation) Source # 
Instance details

Defined in Cooked.Skeleton.Output

IsTxSkelOutAllowedOwner (User 'IsPubKey 'Allocation) Source # 
Instance details

Defined in Cooked.Skeleton.Output

Data types

data PayableKind where Source #

The kind of possible components of a TxSkelOut, other than the owner

data Payable :: [PayableKind] -> Type where Source #

Payable elements. Created from concrete elements or composed. Notice that there is no way of building an element of Type Payable '[] so when using an element of Type Payable els we are sure that something was in fact paid. Also, there is no way of building an element of type Payable '[a,a] so we also know at most one occurrence of each type of payment is performed.

Constructors

VisibleHashedDatum :: DatumConstrs a => a -> Payable '[IsDatum]

Hashed datums visible in the transaction are payable

InlineDatum :: DatumConstrs a => a -> Payable '[IsDatum]

Inline datums are payable

HiddenHashedDatum :: DatumConstrs a => a -> Payable '[IsDatum]

Hashed datums hidden from the transaction are payable

ReferenceScript :: ToVScript s => s -> Payable '[IsReferenceScript]

Reference scripts are payable

Value :: ToValue a => a -> Payable '[IsValue]

Values are payable and are subject to min ada adjustment

FixedValue :: ToValue a => a -> Payable '[IsValue]

Fixed Values are payable but are NOT subject to min ada adjustment

StakingCredential :: ToMaybeStakingCredential cred => cred -> Payable '[IsStakingCredential]

Staking credentials are payable

PayableAnd :: els els' => Payable els -> Payable els' -> Payable (els els')

Payables can be combined as long as their list of tags are disjoint

data TxSkelOut where Source #

An output to be put into a TxSkel

Instances

Instances details
Monoid DoubleSatDelta Source # 
Instance details

Defined in Cooked.Attack.DoubleSat

Semigroup DoubleSatDelta Source # 
Instance details

Defined in Cooked.Attack.DoubleSat

Show TxSkelOut Source # 
Instance details

Defined in Cooked.Skeleton.Output

PrettyCooked TxSkelOut Source # 
Instance details

Defined in Cooked.Pretty.Skeleton

PrettyCookedList TxSkelOut Source # 
Instance details

Defined in Cooked.Pretty.Skeleton

Eq TxSkelOut Source # 
Instance details

Defined in Cooked.Skeleton.Output

Ord TxSkelOut Source # 
Instance details

Defined in Cooked.Skeleton.Output

ToAddress TxSkelOut Source # 
Instance details

Defined in Cooked.Skeleton.Output

ToCredential TxSkelOut Source # 
Instance details

Defined in Cooked.Skeleton.Output

Optics

txSkelOutValueAutoAdjustL :: Lens' TxSkelOut Bool Source #

Focuses on whether the Value contained in this TxSkelOut can be adjusted to min ADA during transaction generation

txSkelOutDatumL :: Lens' TxSkelOut TxSkelOutDatum Source #

Optics focusing on the datum of a TxSkelOut

Focuses on the TxSkelOutDatum of this TxSkelOut

txSkelOutMReferenceScriptL :: Lens' TxSkelOut (Maybe VScript) Source #

Focuses on the Maybe VScript corresponding to the possible reference script contained in this TxSkelOut

txSkelOutMStakingCredentialL :: Lens' TxSkelOut (Maybe StakingCredential) Source #

Focuses on the Maybe StakingCredential of this TxSkelOut

txSkelOutReferenceScriptHashAF :: AffineFold TxSkelOut ScriptHash Source #

Returns the possible reference script has of this TxSkelOut

Smart constructors

(<&&>) :: els els' => Payable els -> Payable els' -> Payable (els els') Source #

An infix-usable alias for PayableAnd

receives :: IsTxSkelOutAllowedOwner owner => owner -> Payable els -> TxSkelOut infix 1 Source #

Smart constructor to build a TxSkelOut from an owner and Payable. This should be the main way of building outputs.