plutus-use-cases-1.2.0.0: Collection of smart contracts to develop the plutus/wallet interface
Safe HaskellNone
LanguageHaskell2010

Plutus.Contracts.Currency

Description

Implements a custom currency with a minting policy that allows the minting of a fixed amount of units.

Synopsis

Documentation

data OneShotCurrency Source #

A currency that can be created exactly once

Constructors

OneShotCurrency 

Fields

Instances

Instances details
Eq OneShotCurrency Source # 
Instance details

Defined in Plutus.Contracts.Currency

Show OneShotCurrency Source # 
Instance details

Defined in Plutus.Contracts.Currency

Generic OneShotCurrency Source # 
Instance details

Defined in Plutus.Contracts.Currency

Associated Types

type Rep OneShotCurrency :: Type -> Type Source #

FromJSON OneShotCurrency Source # 
Instance details

Defined in Plutus.Contracts.Currency

Methods

parseJSON :: Value -> Parser OneShotCurrency

parseJSONList :: Value -> Parser [OneShotCurrency]

ToJSON OneShotCurrency Source # 
Instance details

Defined in Plutus.Contracts.Currency

Methods

toJSON :: OneShotCurrency -> Value

toEncoding :: OneShotCurrency -> Encoding

toJSONList :: [OneShotCurrency] -> Value

toEncodingList :: [OneShotCurrency] -> Encoding

Lift DefaultUni OneShotCurrency Source # 
Instance details

Defined in Plutus.Contracts.Currency

Methods

lift :: OneShotCurrency -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Typeable DefaultUni OneShotCurrency Source # 
Instance details

Defined in Plutus.Contracts.Currency

Methods

typeRep :: Proxy OneShotCurrency -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep OneShotCurrency Source # 
Instance details

Defined in Plutus.Contracts.Currency

type Rep OneShotCurrency = D1 ('MetaData "OneShotCurrency" "Plutus.Contracts.Currency" "plutus-use-cases-1.2.0.0-BuYOLXrynPcLosE012cowc" 'False) (C1 ('MetaCons "OneShotCurrency" 'PrefixI 'True) (S1 ('MetaSel ('Just "curRefTransactionOutput") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TxId, Integer)) :*: S1 ('MetaSel ('Just "curAmounts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map TokenName Integer))))

type CurrencySchema = Endpoint "Create native token" SimpleMPS Source #

newtype CurrencyError Source #

Constructors

CurContractError ContractError 

Instances

Instances details
Eq CurrencyError Source # 
Instance details

Defined in Plutus.Contracts.Currency

Show CurrencyError Source # 
Instance details

Defined in Plutus.Contracts.Currency

Generic CurrencyError Source # 
Instance details

Defined in Plutus.Contracts.Currency

Associated Types

type Rep CurrencyError :: Type -> Type Source #

FromJSON CurrencyError Source # 
Instance details

Defined in Plutus.Contracts.Currency

Methods

parseJSON :: Value -> Parser CurrencyError

parseJSONList :: Value -> Parser [CurrencyError]

ToJSON CurrencyError Source # 
Instance details

Defined in Plutus.Contracts.Currency

Methods

toJSON :: CurrencyError -> Value

toEncoding :: CurrencyError -> Encoding

toJSONList :: [CurrencyError] -> Value

toEncodingList :: [CurrencyError] -> Encoding

AsContractError CurrencyError Source # 
Instance details

Defined in Plutus.Contracts.Currency

Methods

_ContractError :: Prism' CurrencyError ContractError

_WalletContractError :: Prism' CurrencyError WalletAPIError

_ChainIndexContractError :: Prism' CurrencyError (Text, ChainIndexResponse)

_ConstraintResolutionContractError :: Prism' CurrencyError MkTxError

_ToCardanoConvertContractError :: Prism' CurrencyError ToCardanoError

_ResumableContractError :: Prism' CurrencyError MatchingError

_CCheckpointContractError :: Prism' CurrencyError CheckpointError

_EndpointDecodeContractError :: Prism' CurrencyError (EndpointDescription, EndpointValue Value, Text)

_OtherContractError :: Prism' CurrencyError Text

AsCurrencyError CurrencyError Source # 
Instance details

Defined in Plutus.Contracts.Currency

type Rep CurrencyError Source # 
Instance details

Defined in Plutus.Contracts.Currency

type Rep CurrencyError = D1 ('MetaData "CurrencyError" "Plutus.Contracts.Currency" "plutus-use-cases-1.2.0.0-BuYOLXrynPcLosE012cowc" 'True) (C1 ('MetaCons "CurContractError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ContractError)))

class AsCurrencyError r where Source #

Minimal complete definition

_CurrencyError

Methods

_CurrencyError :: Prism' r CurrencyError Source #

_CurContractError :: Prism' r ContractError Source #

curPolicy :: OneShotCurrency -> MintingPolicy Source #

Actions etc

mintContract :: forall w s e. AsCurrencyError e => CardanoAddress -> [(TokenName, Integer)] -> Contract w s e OneShotCurrency Source #

mint [(n1, c1), ..., (n_k, c_k)] creates a new currency with k token names, minting c_i units of each token n_i. If k == 0 then no value is minted. A one-shot minting policy script is used to ensure that no more units of the currency can be minted afterwards.

mintedValue :: OneShotCurrency -> Value Source #

The Value minted by the OneShotCurrency contract

currencySymbol :: OneShotCurrency -> CurrencySymbol Source #

Simple minting policy currency

data SimpleMPS Source #

Minting policy for a currency that has a fixed amount of tokens issued in one transaction

Constructors

SimpleMPS 

Fields

Instances

Instances details
Eq SimpleMPS Source # 
Instance details

Defined in Plutus.Contracts.Currency

Show SimpleMPS Source # 
Instance details

Defined in Plutus.Contracts.Currency

Generic SimpleMPS Source # 
Instance details

Defined in Plutus.Contracts.Currency

Associated Types

type Rep SimpleMPS :: Type -> Type Source #

FromJSON SimpleMPS Source # 
Instance details

Defined in Plutus.Contracts.Currency

Methods

parseJSON :: Value -> Parser SimpleMPS

parseJSONList :: Value -> Parser [SimpleMPS]

ToJSON SimpleMPS Source # 
Instance details

Defined in Plutus.Contracts.Currency

Methods

toJSON :: SimpleMPS -> Value

toEncoding :: SimpleMPS -> Encoding

toJSONList :: [SimpleMPS] -> Value

toEncodingList :: [SimpleMPS] -> Encoding

type Rep SimpleMPS Source # 
Instance details

Defined in Plutus.Contracts.Currency

type Rep SimpleMPS = D1 ('MetaData "SimpleMPS" "Plutus.Contracts.Currency" "plutus-use-cases-1.2.0.0-BuYOLXrynPcLosE012cowc" 'False) (C1 ('MetaCons "SimpleMPS" 'PrefixI 'True) (S1 ('MetaSel ('Just "tokenName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TokenName) :*: S1 ('MetaSel ('Just "amount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))