Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
-
newtype
PolicyID
crypto =
PolicyID
{
- policyID :: ScriptHash crypto
- newtype AssetName = AssetName { }
- data Value crypto = Value ! Integer !( Map ( PolicyID crypto) ( Map AssetName Integer ))
- insert :: ( Integer -> Integer -> Integer ) -> PolicyID crypto -> AssetName -> Integer -> Value crypto -> Value crypto
- lookup :: PolicyID crypto -> AssetName -> Value crypto -> Integer
- policies :: Value crypto -> Set ( PolicyID crypto)
- prune :: Map ( PolicyID crypto) ( Map AssetName Integer ) -> Map ( PolicyID crypto) ( Map AssetName Integer )
- representationSize :: forall crypto. Crypto crypto => [( PolicyID crypto, AssetName , Integer )] -> Int
- showValue :: Value crypto -> String
- valueFromList :: Integer -> [( PolicyID era, AssetName , Integer )] -> Value era
- gettriples' :: Value crypto -> ( Integer , [( PolicyID crypto, AssetName , Integer )], [ PolicyID crypto])
Documentation
newtype PolicyID crypto Source #
Policy ID
PolicyID | |
|
Instances
Eq ( PolicyID crypto) Source # | |
Ord ( PolicyID crypto) Source # | |
Defined in Cardano.Ledger.Mary.Value compare :: PolicyID crypto -> PolicyID crypto -> Ordering Source # (<) :: PolicyID crypto -> PolicyID crypto -> Bool Source # (<=) :: PolicyID crypto -> PolicyID crypto -> Bool Source # (>) :: PolicyID crypto -> PolicyID crypto -> Bool Source # (>=) :: PolicyID crypto -> PolicyID crypto -> Bool Source # max :: PolicyID crypto -> PolicyID crypto -> PolicyID crypto Source # min :: PolicyID crypto -> PolicyID crypto -> PolicyID crypto Source # |
|
Show ( PolicyID crypto) Source # | |
NFData ( PolicyID crypto) Source # | |
Defined in Cardano.Ledger.Mary.Value |
|
Crypto crypto => ToCBOR ( PolicyID crypto) Source # | |
Crypto crypto => FromCBOR ( PolicyID crypto) Source # | |
NoThunks ( PolicyID crypto) Source # | |
Asset Name
Instances
Eq AssetName Source # | |
Ord AssetName Source # | |
Defined in Cardano.Ledger.Mary.Value |
|
Show AssetName Source # | |
NFData AssetName Source # | |
Defined in Cardano.Ledger.Mary.Value |
|
ToCBOR AssetName Source # | |
FromCBOR AssetName Source # | |
NoThunks AssetName Source # | |
The Value representing MultiAssets
Instances
insert :: ( Integer -> Integer -> Integer ) -> PolicyID crypto -> AssetName -> Integer -> Value crypto -> Value crypto Source #
insert comb policy asset n v, if comb = old new -> old, the integer in the Value is prefered over n if comb = old new -> new, then n is prefered over the integer in the Value if (comb old new) == 0, then that value should not be stored in the Map part of the Value.
policies :: Value crypto -> Set ( PolicyID crypto) Source #
Extract the set of policies in the Value.
This function is equivalent to computing the support of the value in the spec.
prune :: Map ( PolicyID crypto) ( Map AssetName Integer ) -> Map ( PolicyID crypto) ( Map AssetName Integer ) Source #
Remove 0 assets from a map
representationSize :: forall crypto. Crypto crypto => [( PolicyID crypto, AssetName , Integer )] -> Int Source #