hydra-tx-0.20.0: Hydra transaction library
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Tx.Init

Synopsis

Construction

initTx Source #

Arguments

:: NetworkId 
-> TxIn

Seed input.

-> [OnChainId]

Verification key hashes of all participants.

-> HeadParameters 
-> Tx 

Create the init transaction from some HeadParameters and a single TxIn which will be used as unique parameter for minting NFTs.

mkHeadOutput :: NetworkId -> PolicyId -> TxOutDatum ctx -> TxOut ctx Source #

mkHeadOutputInitial :: NetworkId -> TxIn -> HeadParameters -> TxOut CtxTx Source #

mkInitialOutput :: NetworkId -> TxIn -> OnChainId -> TxOut CtxTx Source #

Observation

data InitObservation Source #

Data which can be observed from an initTx.

Constructors

InitObservation 

Fields

Instances

Instances details
Generic InitObservation Source # 
Instance details

Defined in Hydra.Tx.Init

Associated Types

type Rep InitObservation :: Type -> Type Source #

Show InitObservation Source # 
Instance details

Defined in Hydra.Tx.Init

Eq InitObservation Source # 
Instance details

Defined in Hydra.Tx.Init

type Rep InitObservation Source # 
Instance details

Defined in Hydra.Tx.Init

type Rep InitObservation = D1 ('MetaData "InitObservation" "Hydra.Tx.Init" "hydra-tx-0.20.0-b01Sd51Fpn1r0Mfj7XdB1" 'False) (C1 ('MetaCons "InitObservation" 'PrefixI 'True) ((S1 ('MetaSel ('Just "initialThreadUTxO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TxIn, TxOut CtxUTxO)) :*: (S1 ('MetaSel ('Just "initials") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(TxIn, TxOut CtxUTxO)]) :*: S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HeadId))) :*: ((S1 ('MetaSel ('Just "seedTxIn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TxIn) :*: S1 ('MetaSel ('Just "contestationPeriod") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ContestationPeriod)) :*: (S1 ('MetaSel ('Just "parties") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Party]) :*: S1 ('MetaSel ('Just "participants") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [OnChainId])))))

data NotAnInitReason Source #

Instances

Instances details
Generic NotAnInitReason Source # 
Instance details

Defined in Hydra.Tx.Init

Associated Types

type Rep NotAnInitReason :: Type -> Type Source #

Show NotAnInitReason Source # 
Instance details

Defined in Hydra.Tx.Init

Eq NotAnInitReason Source # 
Instance details

Defined in Hydra.Tx.Init

type Rep NotAnInitReason Source # 
Instance details

Defined in Hydra.Tx.Init

type Rep NotAnInitReason = D1 ('MetaData "NotAnInitReason" "Hydra.Tx.Init" "hydra-tx-0.20.0-b01Sd51Fpn1r0Mfj7XdB1" 'False) ((C1 ('MetaCons "NoHeadOutput" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NotAHeadDatum" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "InvalidPartyInDatum" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "NoSTFound" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NotAHeadPolicy" 'PrefixI 'False) (U1 :: Type -> Type))))

observeInitTx :: Tx -> Either NotAnInitReason InitObservation Source #

Identify a init tx by checking the output value for holding tokens that are valid head tokens (checked by seed + policy).