Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Cooked.Currencies
Description
This module introduces currencies (namely the quick values and the permanent values) which make it convenient to manipulate assets that are already supposed to exist when running a mock chain. For example, a market maker would exchange Ada against other assets. Yet, when writing traces for such a contract we would need to define a minting policy for those tokens, which is tedious. Moreover, we often want wallets to have some of such tokens from the start (see Cooked.InitialDistribution).
The quick
prefixed functions provide access to tokens from the const
(const True)
minting policy. That is, these can be minted and burnt at will,
at any point in time.
The permanent
prefixed functions provide access to tokens from the const
(const False)
minting policy. That is, these cannot ever be minted or
burnt and must be present in an initial distribution.
Synopsis
- quickTokenName :: String -> TokenName
- quickAssetClass :: String -> AssetClass
- quickValue :: String -> Integer -> Value
- permanentTokenName :: String -> TokenName
- permanentAssetClass :: String -> AssetClass
- permanentValue :: String -> Integer -> Value
- quickCurrencyPolicy :: MintingPolicy
- quickCurrencyPolicyV3 :: Versioned MintingPolicy
- quickCurrencySymbol :: CurrencySymbol
- permanentCurrencyPolicy :: MintingPolicy
- permanentCurrencyPolicyV3 :: Versioned MintingPolicy
- permanentCurrencySymbol :: CurrencySymbol
- currencySymbolFromLanguageAndMP :: Language -> MintingPolicy -> CurrencySymbol
Documentation
quickTokenName :: String -> TokenName Source #
Token name of a quick asset class; prefixes the name with a
to make
it easy to distinguish between quick and permanent tokens.q
quickAssetClass :: String -> AssetClass Source #
Quick asset class from a token name
quickValue :: String -> Integer -> Value Source #
Constructor for quick values from token name and amount
permanentTokenName :: String -> TokenName Source #
Token name of a permanent asset class
permanentAssetClass :: String -> AssetClass Source #
Permanent asset class from a token name
permanentValue :: String -> Integer -> Value Source #
Constructor for Permanent values from token name and amount
currencySymbolFromLanguageAndMP :: Language -> MintingPolicy -> CurrencySymbol Source #
Takes a minting policy and a language version and returns the associated currency symbol