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

Hydra.Tx.ScriptRegistry

Description

A data-type to keep track of reference Hydra scripts published on-chain, and needed to construct transactions leveraging reference inputs.

Synopsis

Documentation

data ScriptRegistry Source #

Hydra scripts published as reference scripts at these UTxO.

Constructors

ScriptRegistry 

Fields

Instances

Instances details
FromJSON ScriptRegistry Source # 
Instance details

Defined in Hydra.Tx.ScriptRegistry

Methods

parseJSON :: Value -> Parser ScriptRegistry

parseJSONList :: Value -> Parser [ScriptRegistry]

omittedField :: Maybe ScriptRegistry

ToJSON ScriptRegistry Source # 
Instance details

Defined in Hydra.Tx.ScriptRegistry

Generic ScriptRegistry Source # 
Instance details

Defined in Hydra.Tx.ScriptRegistry

Associated Types

type Rep ScriptRegistry :: Type -> Type Source #

Show ScriptRegistry Source # 
Instance details

Defined in Hydra.Tx.ScriptRegistry

Eq ScriptRegistry Source # 
Instance details

Defined in Hydra.Tx.ScriptRegistry

type Rep ScriptRegistry Source # 
Instance details

Defined in Hydra.Tx.ScriptRegistry

type Rep ScriptRegistry = D1 ('MetaData "ScriptRegistry" "Hydra.Tx.ScriptRegistry" "hydra-tx-0.19.0-CNt37yoHV6SLHPMLDZKDue" 'False) (C1 ('MetaCons "ScriptRegistry" 'PrefixI 'True) (S1 ('MetaSel ('Just "initialReference") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TxIn, TxOut CtxUTxO)) :*: (S1 ('MetaSel ('Just "commitReference") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TxIn, TxOut CtxUTxO)) :*: S1 ('MetaSel ('Just "headReference") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TxIn, TxOut CtxUTxO)))))

newScriptRegistry :: UTxO -> Either NewScriptRegistryException ScriptRegistry Source #

Create a script registry from a UTxO containing outputs with reference scripts. This will return Nothing if one or all of the references could not be found.

registryUTxO :: ScriptRegistry -> UTxO Source #

Get the UTxO that corresponds to a script registry.

  • *Property**:

    newScriptRegistry (registryUTxO r) === Just r