plutus-wallet-api-0.1.0.0: Wallet API

Safe HaskellNone
LanguageHaskell2010

Ledger.Ada

Contents

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
Enum Ada Source # 
Instance details

Defined in Ledger.Ada

Eq Ada Source # 
Instance details

Defined in Ledger.Ada

Methods

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

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

Integral Ada Source # 
Instance details

Defined in 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 Ledger.Ada

Ord Ada Source # 
Instance details

Defined in 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 Ledger.Ada

Show Ada Source # 
Instance details

Defined in Ledger.Ada

Generic Ada Source # 
Instance details

Defined in 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 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 Ledger.Ada

IotsType Ada Source # 
Instance details

Defined in Ledger.Ada

ToSchema Ada Source # 
Instance details

Defined in Ledger.Ada

Serialise Ada Source # 
Instance details

Defined in Ledger.Ada

Methods

encode :: Ada -> Encoding

decode :: Decoder s Ada

encodeList :: [Ada] -> Encoding

decodeList :: Decoder s [Ada]

FromJSON Ada Source # 
Instance details

Defined in Ledger.Ada

Methods

parseJSON :: Value -> Parser Ada

parseJSONList :: Value -> Parser [Ada]

ToJSON Ada Source # 
Instance details

Defined in Ledger.Ada

Methods

toJSON :: Ada -> Value

toEncoding :: Ada -> Encoding

toJSONList :: [Ada] -> Value

toEncodingList :: [Ada] -> Encoding

Lift Ada Source # 
Instance details

Defined in Ledger.Ada

Methods

lift :: Ada -> RTCompile (Term TyName Name ())

Eq Ada Source # 
Instance details

Defined in Ledger.Ada

Methods

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

Monoid Ada Source # 
Instance details

Defined in Ledger.Ada

Methods

mempty :: Ada

AdditiveGroup Ada Source # 
Instance details

Defined in Ledger.Ada

Methods

(-) :: Ada -> Ada -> Ada

AdditiveMonoid Ada Source # 
Instance details

Defined in Ledger.Ada

Methods

zero :: Ada

AdditiveSemigroup Ada Source # 
Instance details

Defined in Ledger.Ada

Methods

(+) :: Ada -> Ada -> Ada

MultiplicativeMonoid Ada Source # 
Instance details

Defined in Ledger.Ada

Methods

one :: Ada

MultiplicativeSemigroup Ada Source # 
Instance details

Defined in Ledger.Ada

Methods

(*) :: Ada -> Ada -> Ada

Ord Ada Source # 
Instance details

Defined in Ledger.Ada

Methods

compare :: Ada -> Ada -> Ordering

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

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

(>) :: Ada -> Ada -> Bool

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

max :: Ada -> Ada -> Ada

min :: Ada -> Ada -> Ada

Semigroup Ada Source # 
Instance details

Defined in Ledger.Ada

Methods

(<>) :: Ada -> Ada -> Ada

Typeable Ada Source # 
Instance details

Defined in Ledger.Ada

Methods

typeRep :: Proxy Ada -> RTCompile (Type TyName ())

type Rep Ada Source # 
Instance details

Defined in Ledger.Ada

type Rep Ada = D1 (MetaData "Ada" "Ledger.Ada" "plutus-wallet-api-0.1.0.0-BdsTjp7uGUGANkPkvyfvD2-plutus-ledger" 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.