| 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
- observeDepositTxOut :: Network -> TxOut CtxUTxO -> Maybe (HeadId, UTxO, POSIXTime)
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 decoding the target head id, deposit deadline and deposited utxo in the datum.
This includes checking whether - the transaction's first output is the deposit output - all of deposited value is contained in the deposit tx output, - 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 #