Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Hydra.Tx.Deposit
Contents
Synopsis
- depositTx :: NetworkId -> HeadId -> CommitBlueprintTx Tx -> SlotNo -> UTCTime -> Tx
- mkDepositOutput :: NetworkId -> HeadId -> UTxO -> UTCTime -> TxOut ctx
- depositAddress :: NetworkId -> AddressInEra
- data DepositObservation = DepositObservation {}
- observeDepositTx :: NetworkId -> Tx -> Maybe DepositObservation
- observeDepositTxOut :: Network -> TxOut CtxUTxO -> Maybe (HeadId, UTxO, POSIXTime)
Construction
Arguments
:: NetworkId | |
-> 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. |
-> Tx |
Builds a deposit transaction to lock funds into the v_deposit script.
mkDepositOutput :: NetworkId -> HeadId -> UTxO -> UTCTime -> TxOut ctx Source #
depositAddress :: NetworkId -> AddressInEra Source #
Observation
data DepositObservation Source #
Constructors
DepositObservation | |
Instances
observeDepositTx :: NetworkId -> Tx -> Maybe DepositObservation Source #
Observe a deposit transaction by decoding the target head id, deposit deadline and deposited utxo in the datum.
This includes checking whether - the first output is a deposit output - all inputs of deposited utxo are actually spent, - the deposit script output actually contains the deposited value, - an upper validity bound has been set (used as creation slot).
observeDepositTxOut :: Network -> TxOut CtxUTxO -> Maybe (HeadId, UTxO, POSIXTime) Source #