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
- difference :: 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
Foldable UTxO' Source # | |
Defined in Cardano.Api.UTxO fold :: Monoid m => UTxO' m -> m Source # foldMap :: Monoid m => (a -> m) -> UTxO' a -> m Source # foldMap' :: Monoid m => (a -> m) -> UTxO' a -> m Source # foldr :: (a -> b -> b) -> b -> UTxO' a -> b Source # foldr' :: (a -> b -> b) -> b -> UTxO' a -> b Source # foldl :: (b -> a -> b) -> b -> UTxO' a -> b Source # foldl' :: (b -> a -> b) -> b -> UTxO' a -> b Source # foldr1 :: (a -> a -> a) -> UTxO' a -> a Source # foldl1 :: (a -> a -> a) -> UTxO' a -> a Source # toList :: UTxO' a -> [a] Source # null :: UTxO' a -> Bool Source # length :: UTxO' a -> Int Source # elem :: Eq a => a -> UTxO' a -> Bool Source # maximum :: Ord a => UTxO' a -> a Source # minimum :: Ord a => UTxO' a -> a Source # | |
Functor UTxO' Source # | |
FromJSON out => FromJSON (UTxO' out) Source # | |
Defined in Cardano.Api.UTxO parseJSON :: Value -> Parser (UTxO' out) # parseJSONList :: Value -> Parser [UTxO' out] # omittedField :: Maybe (UTxO' out) # | |
ToJSON out => ToJSON (UTxO' out) Source # | |
Defined in Cardano.Api.UTxO | |
Monoid (UTxO' out) Source # | |
Semigroup (UTxO' out) Source # | |
Show out => Show (UTxO' out) Source # | |
Eq out => Eq (UTxO' out) Source # | |
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.
difference :: UTxO' out -> UTxO' out -> UTxO' out Source #
Remove the right hand side from the left hand side.