hydra-tx
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Tx.Deposit

Synopsis

Construction

depositTx Source #

Arguments

:: HasCallStack 
=> NetworkId 
-> PParams LedgerEra 
-> HeadId 
-> CommitBlueprintTx Tx 
-> SlotNo

Slot to use as upper validity. Will mark the time of creation of the deposit.

-> UTCTime

Deposit deadline from which onward the deposit can be recovered.

-> Maybe AddressInEra 
-> Tx 

Builds a deposit transaction to lock funds into the v_deposit script.

mkDepositOutput :: NetworkId -> HeadId -> UTxO -> UTCTime -> TxOut ctx Source #

constructDepositUTxO :: TxId -> [TxOut CtxTx] -> UTxO Source #

depositAddress :: NetworkId -> AddressInEra Source #

Observation

data DepositObservation Source #

Constructors

DepositObservation 

Fields

Instances

Instances details
FromJSON DepositObservation Source # 
Instance details

Defined in Hydra.Tx.Deposit

ToJSON DepositObservation Source # 
Instance details

Defined in Hydra.Tx.Deposit

Generic DepositObservation Source # 
Instance details

Defined in Hydra.Tx.Deposit

Associated Types

type Rep DepositObservation :: Type -> Type Source #

Show DepositObservation Source # 
Instance details

Defined in Hydra.Tx.Deposit

Eq DepositObservation Source # 
Instance details

Defined in Hydra.Tx.Deposit

type Rep DepositObservation Source # 
Instance details

Defined in Hydra.Tx.Deposit

type Rep DepositObservation = D1 ('MetaData "DepositObservation" "Hydra.Tx.Deposit" "hydra-tx-2.4.1-6u9wd83eS2xF3WS9TuJN93" 'False) (C1 ('MetaCons "DepositObservation" 'PrefixI 'True) ((S1 ('MetaSel ('Just "headId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HeadId) :*: S1 ('MetaSel ('Just "depositTxId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TxId)) :*: (S1 ('MetaSel ('Just "deposited") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTxO) :*: (S1 ('MetaSel ('Just "created") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SlotNo) :*: S1 ('MetaSel ('Just "deadline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime)))))

observeDepositTx :: NetworkId -> Tx -> Maybe DepositObservation Source #

Observe a deposit transaction by its shape: the deposit output and its datum alone. Nothing here tells a deposit from a head transaction that happens to produce such an output first (a fanout can), so when classifying arbitrary chain transactions use observeHeadTx, which tries the head observers first and skips this one for any transaction spending a head output.

decodeDepositDatum :: Network -> TxOut CtxUTxO -> Maybe (HeadId, UTxO, POSIXTime) Source #

Decode head id, deposited UTxO and deadline from a deposit output's datum. Does NOT check the datum against the output's value; observeDepositTxOut adds that guard.

observeDepositTxOut :: Network -> TxOut CtxUTxO -> Maybe (HeadId, UTxO, POSIXTime) Source #

deserializeRoundTripping :: Network -> Commit -> Maybe (TxIn, TxOut CtxUTxO) Source #