Module

Cardano.Types.Value

#Value

data Value

In Plutus, Ada is is stored inside the map (with currency symbol and token name being empty bytestrings). cardano-serialization-lib makes semantic distinction between native tokens and Ada, and we follow this convention.

Constructors

Instances

#empty

#add

#mkValue

#pprintValue

#valueOf

#getCoin

#getMultiAsset

#unionWith

unionWith :: (BigNum -> BigNum -> Maybe BigNum) -> Value -> Value -> Maybe Value

Combines Value with a binary function on BigInts.

#geq

geq :: Value -> Value -> Boolean

Check whether one Value is greater than or equal to another. See Value for an explanation of how operations on Values work.

#gt

gt :: Value -> Value -> Boolean

Check whether one Value is strictly greater than another. See Value for an explanation of how operations on Values work.

#leq

leq :: Value -> Value -> Boolean

Check whether one Value is less than or equal to another. See Value for an explanation of how operations on Values work.

#lt

lt :: Value -> Value -> Boolean

Check whether one Value is strictly less than another. See Value for an explanation of how operations on Values work.

#isPositive

isPositive :: Value -> Boolean

Checks if every asset has positive quantity

#isZero

isZero :: Value -> Boolean

Check whether a Value is zero.

#checkPred

#checkBinRel

#minus

#assetToValue

#getAssetQuantity

#flatten

#valueAssetClasses

#lovelaceValueOf

lovelaceValueOf :: BigNum -> Value

Convert a BigInt to Ada-only Value

#coinToValue

coinToValue :: Coin -> Value

Create a Value containing only the given Coin.

#valueToCoin

valueToCoin :: Value -> Coin

Get the Coin in the given Value.

#fromCsl

#toCsl

Modules