cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.Skeleton.Value

Description

This modules exposes optics around Value and Lovelace that we use in our TxSkel and are not defined anywhere else.

Synopsis

Optics

valueAssetClassesI :: Iso' Value [(CurrencySymbol, TokenName, Integer)] Source #

An isomorphism between a value and its flattened representation. The flattened representation is always sorted by asset class (as produced by flattenValue), and building a value back from a list canonicalises it the same way, so that the internal map ordering of the resulting value does not depend on the order of the input list.

valueAssetClassAmountL :: ToMintingPolicyHash mp => mp -> TokenName -> Lens' Value Integer Source #

Focuses on the amount of tokens of a certain AssetClass in a given Value. This removes the entry if the new amount is 0.

valueAssetClassAmountP :: ToMintingPolicyHash mp => mp -> TokenName -> Prism' Value Integer Source #

Builds or retrieves the amount of tokens of a certain AssetClass in an Value, treating a zero amount as absent

valueLovelaceP :: Prism' Value Lovelace Source #

Builds or retrieves the Lovelace of an Value

lovelaceIntegerI :: Iso' Lovelace Integer Source #

An isomorphism between an Lovelace and an Integer

Orphan instances

Ord Value Source # 
Instance details

Methods

compare :: Value -> Value -> Ordering #

(<) :: Value -> Value -> Bool #

(<=) :: Value -> Value -> Bool #

(>) :: Value -> Value -> Bool #

(>=) :: Value -> Value -> Bool #

max :: Value -> Value -> Value #

min :: Value -> Value -> Value #