Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
NOTE (1): This module is meant to be imported qualified as UTxO
.
NOTE (2): This module is name-spaces slightly different from the rest
because it is meant to be used as a replacement of the UTxO type of the
cardano-api which is not convenient enough to work with. Having it as
UTxO
causes cyclic imports with other modules also
relying on this newtype. So instead, we do 'as if' it was part of the
cardano-api in the first palce.
Synopsis
- type Era = ConwayEra
- type UTxO = UTxO' (TxOut CtxUTxO Era)
- newtype UTxO' out = UTxO {}
- fromPairs :: [(TxIn, out)] -> UTxO' out
- singleton :: (TxIn, out) -> UTxO' out
- resolve :: TxIn -> UTxO' out -> Maybe out
- pairs :: UTxO' out -> [(TxIn, out)]
- find :: (out -> Bool) -> UTxO' out -> Maybe (TxIn, out)
- findBy :: ((TxIn, out) -> Bool) -> UTxO' out -> Maybe (TxIn, out)
- filter :: (out -> Bool) -> UTxO' out -> UTxO' out
- inputSet :: UTxO' out -> Set TxIn
- render :: (TxIn, TxOut ctx era) -> Text
- min :: UTxO -> UTxO
- difference :: UTxO' out -> UTxO' out -> UTxO' out
- (\\) :: UTxO' out -> UTxO' out -> UTxO' out
- fromApi :: UTxO era -> UTxO
- toApi :: UTxO -> UTxO Era
Documentation
Newtype with phantom types mostly required to work around the poor interface
of UTXO
and provide Monoid
and Foldable
instances to make utxo
manipulation bareable.
Instances
singleton :: (TxIn, out) -> UTxO' out Source #
Create a UTxO
from a single unspent transaction output.
find :: (out -> Bool) -> UTxO' out -> Maybe (TxIn, out) Source #
Find first UTxO
using the output in predicate.
findBy :: ((TxIn, out) -> Bool) -> UTxO' out -> Maybe (TxIn, out) Source #
Find first UTxO
using both input and output in predicate.
filter :: (out -> Bool) -> UTxO' out -> UTxO' out Source #
Filter UTxO to only include out
s satisfying given predicate.
render :: (TxIn, TxOut ctx era) -> Text Source #
Get a human-readable pretty text representation of a UTxO.
Select the minimum (by TxIn) utxo entry from the UTxO map.
This function is partial.
difference :: UTxO' out -> UTxO' out -> UTxO' out Source #
Remove the right hand side from the left hand side.