plutus-ledger-api-0.1.0.0: Interface to the Plutus ledger for the Cardano ledger.
Safe HaskellNone
LanguageHaskell2010

Plutus.V1.Ledger.Ada

Description

Functions for working with Ada in Template Haskell.

Synopsis

Documentation

newtype Ada Source #

ADA, the special currency on the Cardano blockchain. The unit of Ada is Lovelace, and 1M Lovelace is one Ada. See note [Currencies] in TH.

Constructors

Lovelace 

Fields

Instances

Instances details
Enum Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Eq Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Methods

(==) :: Ada -> Ada -> Bool Source #

(/=) :: Ada -> Ada -> Bool Source #

Integral Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Methods

quot :: Ada -> Ada -> Ada Source #

rem :: Ada -> Ada -> Ada Source #

div :: Ada -> Ada -> Ada Source #

mod :: Ada -> Ada -> Ada Source #

quotRem :: Ada -> Ada -> (Ada, Ada) Source #

divMod :: Ada -> Ada -> (Ada, Ada) Source #

toInteger :: Ada -> Integer Source #

Num Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Ord Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Methods

compare :: Ada -> Ada -> Ordering Source #

(<) :: Ada -> Ada -> Bool Source #

(<=) :: Ada -> Ada -> Bool Source #

(>) :: Ada -> Ada -> Bool Source #

(>=) :: Ada -> Ada -> Bool Source #

max :: Ada -> Ada -> Ada Source #

min :: Ada -> Ada -> Ada Source #

Real Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Show Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Generic Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Associated Types

type Rep Ada :: Type -> Type Source #

Methods

from :: Ada -> Rep Ada x Source #

to :: Rep Ada x -> Ada Source #

Semigroup Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Methods

(<>) :: Ada -> Ada -> Ada Source #

sconcat :: NonEmpty Ada -> Ada Source #

stimes :: Integral b => b -> Ada -> Ada Source #

Monoid Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

ToJSON Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

FromJSON Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Pretty Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Methods

pretty :: Ada -> Doc ann Source #

prettyList :: [Ada] -> Doc ann Source #

ToData Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

FromData Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

UnsafeFromData Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

AdditiveSemigroup Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Methods

(+) :: Ada -> Ada -> Ada Source #

AdditiveMonoid Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Methods

zero :: Ada Source #

AdditiveGroup Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Methods

(-) :: Ada -> Ada -> Ada Source #

MultiplicativeSemigroup Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Methods

(*) :: Ada -> Ada -> Ada Source #

MultiplicativeMonoid Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Methods

one :: Ada Source #

Monoid Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Methods

mempty :: Ada Source #

Semigroup Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Methods

(<>) :: Ada -> Ada -> Ada Source #

Ord Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Methods

compare :: Ada -> Ada -> Ordering Source #

(<) :: Ada -> Ada -> Bool Source #

(<=) :: Ada -> Ada -> Bool Source #

(>) :: Ada -> Ada -> Bool Source #

(>=) :: Ada -> Ada -> Bool Source #

max :: Ada -> Ada -> Ada Source #

min :: Ada -> Ada -> Ada Source #

Eq Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Methods

(==) :: Ada -> Ada -> Bool Source #

Serialise Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Lift DefaultUni Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

Typeable DefaultUni Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

type Rep Ada Source # 
Instance details

Defined in Plutus.V1.Ledger.Ada

type Rep Ada = D1 ('MetaData "Ada" "Plutus.V1.Ledger.Ada" "plutus-ledger-api-0.1.0.0-6XBf4FRRdNK1B20rg7kZGy" 'True) (C1 ('MetaCons "Lovelace" 'PrefixI 'True) (S1 ('MetaSel ('Just "getLovelace") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer)))

getAda :: Ada -> Micro Source #

Get the amount of Ada (the unit of the currency Ada) in this Ada value.

adaToken :: TokenName Source #

The TokenName of the Ada currency.

Constructors

fromValue :: Value -> Ada Source #

Get the Ada in the given Value.

toValue :: Ada -> Value Source #

Create a Value containing only the given Ada.

lovelaceOf :: Integer -> Ada Source #

Create Ada representing the given quantity of Lovelace (the unit of the currency Ada).

adaOf :: Micro -> Ada Source #

Create Ada representing the given quantity of Ada (1M Lovelace).

lovelaceValueOf :: Integer -> Value Source #

A Value with the given amount of Lovelace (the currency unit).

lovelaceValueOf == toValue . lovelaceOf

adaValueOf :: Micro -> Value Source #

A Value with the given amount of Ada (the currency unit).

adaValueOf == toValue . adaOf

Num operations

divide :: Ada -> Ada -> Ada Source #

Divide one Ada value by another.

Etc.

isZero :: Ada -> Bool Source #

Check whether an Ada value is zero.