| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Hydra.Tx.Deposit
Contents
Synopsis
- depositTx :: HasCallStack => NetworkId -> PParams LedgerEra -> HeadId -> CommitBlueprintTx Tx -> SlotNo -> UTCTime -> Maybe AddressInEra -> Tx
- mkDepositOutput :: NetworkId -> HeadId -> UTxO -> UTCTime -> TxOut ctx
- constructDepositUTxO :: TxId -> [TxOut CtxTx] -> UTxO
- depositAddress :: NetworkId -> AddressInEra
- data DepositObservation = DepositObservation {}
- observeDepositTx :: NetworkId -> Tx -> Maybe DepositObservation
- decodeDepositDatum :: Network -> TxOut CtxUTxO -> Maybe (HeadId, UTxO, POSIXTime)
- observeDepositTxOut :: Network -> TxOut CtxUTxO -> Maybe (HeadId, UTxO, POSIXTime)
- deserializeRoundTripping :: Network -> Commit -> Maybe (TxIn, TxOut CtxUTxO)
Construction
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 | |
Instances
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 #