cardano-api-1.30.0
Safe HaskellNone
LanguageHaskell2010

Cardano.Api.Value

Description

Currency values

Synopsis

Documentation

newtype Lovelace Source #

Constructors

Lovelace Integer 

Instances

Instances details
Enum Lovelace Source # 
Instance details

Defined in Cardano.Api.Value

Eq Lovelace Source # 
Instance details

Defined in Cardano.Api.Value

Num Lovelace Source # 
Instance details

Defined in Cardano.Api.Value

Ord Lovelace Source # 
Instance details

Defined in Cardano.Api.Value

Show Lovelace Source # 
Instance details

Defined in Cardano.Api.Value

Semigroup Lovelace Source # 
Instance details

Defined in Cardano.Api.Value

Monoid Lovelace Source # 
Instance details

Defined in Cardano.Api.Value

FromJSON Lovelace Source # 
Instance details

Defined in Cardano.Api.Value

Methods

parseJSON ∷ Value → Parser Lovelace #

parseJSONList ∷ Value → Parser [Lovelace] #

ToJSON Lovelace Source # 
Instance details

Defined in Cardano.Api.Value

Methods

toJSONLovelace → Value #

toEncodingLovelace → Encoding #

toJSONList ∷ [Lovelace] → Value #

toEncodingList ∷ [Lovelace] → Encoding #

FromCBOR Lovelace Source # 
Instance details

Defined in Cardano.Api.Value

Methods

fromCBOR ∷ Decoder s Lovelace #

labelProxy LovelaceText #

ToCBOR Lovelace Source # 
Instance details

Defined in Cardano.Api.Value

Methods

toCBORLovelace → Encoding #

encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy Lovelace → Size #

encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [Lovelace] → Size #

Multi-asset values

newtype Quantity Source #

Constructors

Quantity Integer 

Instances

Instances details
Eq Quantity Source # 
Instance details

Defined in Cardano.Api.Value

Num Quantity Source # 
Instance details

Defined in Cardano.Api.Value

Ord Quantity Source # 
Instance details

Defined in Cardano.Api.Value

Show Quantity Source # 
Instance details

Defined in Cardano.Api.Value

Semigroup Quantity Source # 
Instance details

Defined in Cardano.Api.Value

Monoid Quantity Source # 
Instance details

Defined in Cardano.Api.Value

FromJSON Quantity Source # 
Instance details

Defined in Cardano.Api.Value

Methods

parseJSON ∷ Value → Parser Quantity #

parseJSONList ∷ Value → Parser [Quantity] #

ToJSON Quantity Source # 
Instance details

Defined in Cardano.Api.Value

Methods

toJSONQuantity → Value #

toEncodingQuantity → Encoding #

toJSONList ∷ [Quantity] → Value #

toEncodingList ∷ [Quantity] → Encoding #

newtype PolicyId Source #

Constructors

PolicyId ScriptHash 

Instances

Instances details
Eq PolicyId Source # 
Instance details

Defined in Cardano.Api.Value

Ord PolicyId Source # 
Instance details

Defined in Cardano.Api.Value

Show PolicyId Source # 
Instance details

Defined in Cardano.Api.Value

IsString PolicyId Source # 
Instance details

Defined in Cardano.Api.Value

FromJSON PolicyId Source # 
Instance details

Defined in Cardano.Api.Value

Methods

parseJSON ∷ Value → Parser PolicyId #

parseJSONList ∷ Value → Parser [PolicyId] #

ToJSON PolicyId Source # 
Instance details

Defined in Cardano.Api.Value

Methods

toJSONPolicyId → Value #

toEncodingPolicyId → Encoding #

toJSONList ∷ [PolicyId] → Value #

toEncodingList ∷ [PolicyId] → Encoding #

HasTypeProxy PolicyId Source # 
Instance details

Defined in Cardano.Api.Value

Associated Types

data AsType PolicyId Source #

SerialiseAsRawBytes PolicyId Source # 
Instance details

Defined in Cardano.Api.Value

data AsType PolicyId Source # 
Instance details

Defined in Cardano.Api.Value

newtype AssetName Source #

Constructors

AssetName ByteString 

Instances

Instances details
Eq AssetName Source # 
Instance details

Defined in Cardano.Api.Value

Ord AssetName Source # 
Instance details

Defined in Cardano.Api.Value

Show AssetName Source # 
Instance details

Defined in Cardano.Api.Value

IsString AssetName Source # 
Instance details

Defined in Cardano.Api.Value

FromJSON AssetName Source # 
Instance details

Defined in Cardano.Api.Value

Methods

parseJSON ∷ Value → Parser AssetName #

parseJSONList ∷ Value → Parser [AssetName] #

ToJSON AssetName Source # 
Instance details

Defined in Cardano.Api.Value

Methods

toJSONAssetName → Value #

toEncodingAssetName → Encoding #

toJSONList ∷ [AssetName] → Value #

toEncodingList ∷ [AssetName] → Encoding #

FromJSONKey AssetName Source # 
Instance details

Defined in Cardano.Api.Value

Methods

fromJSONKey ∷ FromJSONKeyFunction AssetName

fromJSONKeyList ∷ FromJSONKeyFunction [AssetName]

ToJSONKey AssetName Source # 
Instance details

Defined in Cardano.Api.Value

Methods

toJSONKey ∷ ToJSONKeyFunction AssetName

toJSONKeyList ∷ ToJSONKeyFunction [AssetName]

HasTypeProxy AssetName Source # 
Instance details

Defined in Cardano.Api.Value

Associated Types

data AsType AssetName Source #

SerialiseAsRawBytes AssetName Source # 
Instance details

Defined in Cardano.Api.Value

data AsType AssetName Source # 
Instance details

Defined in Cardano.Api.Value

data AssetId Source #

Instances

Instances details
Eq AssetId Source # 
Instance details

Defined in Cardano.Api.Value

Methods

(==)AssetIdAssetIdBool Source #

(/=)AssetIdAssetIdBool Source #

Ord AssetId Source # 
Instance details

Defined in Cardano.Api.Value

Show AssetId Source # 
Instance details

Defined in Cardano.Api.Value

data Value Source #

Instances

Instances details
Eq Value Source # 
Instance details

Defined in Cardano.Api.Value

Methods

(==)ValueValueBool Source #

(/=)ValueValueBool Source #

Show Value Source # 
Instance details

Defined in Cardano.Api.Value

Semigroup Value Source # 
Instance details

Defined in Cardano.Api.Value

Methods

(<>)ValueValueValue Source #

sconcatNonEmpty ValueValue Source #

stimesIntegral b ⇒ b → ValueValue Source #

Monoid Value Source # 
Instance details

Defined in Cardano.Api.Value

FromJSON Value Source # 
Instance details

Defined in Cardano.Api.Value

Methods

parseJSON ∷ Value0 → Parser Value #

parseJSONList ∷ Value0 → Parser [Value] #

ToJSON Value Source # 
Instance details

Defined in Cardano.Api.Value

Methods

toJSONValue → Value0 #

toEncodingValue → Encoding #

toJSONList ∷ [Value] → Value0 #

toEncodingList ∷ [Value] → Encoding #

negateValueValueValue Source #

This lets you write a - b as a <> negateValue b.

calcMinimumDepositValueLovelaceLovelace Source #

Calculate cost of making a UTxO entry for a given Value and mininimum UTxO value derived from the ProtocolParameters

Ada / Lovelace specifically

valueToLovelaceValueMaybe Lovelace Source #

Check if the Value consists of only Lovelace and no other assets, and if so then return the Lovelace.

See also selectLovelace to select the Lovelace quantity from the Value, ignoring other assets.

Alternative nested representation

newtype ValueNestedRep Source #

An alternative nested representation for Value that groups assets that share a PolicyId.

Rendering

renderValueValueText Source #

Render a textual representation of a Value.

renderValuePrettyValueText Source #

Render a "prettified" textual representation of a Value.

Internal conversion functions

toMaryValueValue → Value StandardCrypto Source #

fromMaryValue ∷ Value StandardCrypto → Value Source #

Data family instances

data family AsType t Source #

A family of singleton types used in this API to indicate which type to use where it would otherwise be ambiguous or merely unclear.

Values of this type are passed to deserialisation functions for example.

Instances

Instances details
data AsType AlonzoEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AsType MaryEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AsType AllegraEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AsType ShelleyEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AsType ByronEra Source # 
Instance details

Defined in Cardano.Api.Eras

data AsType TextEnvelope Source # 
Instance details

Defined in Cardano.Api.SerialiseTextEnvelope

data AsType TxMetadata Source # 
Instance details

Defined in Cardano.Api.TxMetadata

data AsType StakePoolKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType GenesisUTxOKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType GenesisDelegateExtendedKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType GenesisDelegateKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType GenesisExtendedKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType GenesisKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType StakeExtendedKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType StakeKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType PaymentExtendedKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType PaymentKey Source # 
Instance details

Defined in Cardano.Api.KeysShelley

data AsType ScriptData Source # 
Instance details

Defined in Cardano.Api.ScriptData

data AsType ScriptHash Source # 
Instance details

Defined in Cardano.Api.Script

data AsType ScriptInAnyLang Source # 
Instance details

Defined in Cardano.Api.Script

data AsType PlutusScriptV2 Source # 
Instance details

Defined in Cardano.Api.Script

data AsType PlutusScriptV1 Source # 
Instance details

Defined in Cardano.Api.Script

data AsType SimpleScriptV2 Source # 
Instance details

Defined in Cardano.Api.Script

data AsType SimpleScriptV1 Source # 
Instance details

Defined in Cardano.Api.Script

data AsType ByronKeyLegacy Source # 
Instance details

Defined in Cardano.Api.KeysByron

data AsType ByronKey Source # 
Instance details

Defined in Cardano.Api.KeysByron

data AsType ByronVote Source # 
Instance details

Defined in Cardano.Api.SpecialByron

data AsType ByronUpdateProposal Source # 
Instance details

Defined in Cardano.Api.SpecialByron

data AsType VrfKey Source # 
Instance details

Defined in Cardano.Api.KeysPraos

data AsType KesKey Source # 
Instance details

Defined in Cardano.Api.KeysPraos

data AsType StakePoolMetadata Source # 
Instance details

Defined in Cardano.Api.StakePoolMetadata

data AsType StakeAddress Source # 
Instance details

Defined in Cardano.Api.Address

data AsType AddressAny Source # 
Instance details

Defined in Cardano.Api.Address

data AsType ShelleyAddr Source # 
Instance details

Defined in Cardano.Api.Address

data AsType ByronAddr Source # 
Instance details

Defined in Cardano.Api.Address

data AsType AssetName Source # 
Instance details

Defined in Cardano.Api.Value

data AsType PolicyId Source # 
Instance details

Defined in Cardano.Api.Value

data AsType UpdateProposal Source # 
Instance details

Defined in Cardano.Api.ProtocolParameters

data AsType PraosNonce Source # 
Instance details

Defined in Cardano.Api.ProtocolParameters

data AsType Certificate Source # 
Instance details

Defined in Cardano.Api.Certificate

data AsType TxId Source # 
Instance details

Defined in Cardano.Api.TxBody

data AsType OperationalCertificateIssueCounter Source # 
Instance details

Defined in Cardano.Api.OperationalCertificate

data AsType OperationalCertificate Source # 
Instance details

Defined in Cardano.Api.OperationalCertificate

data AsType BlockHeader Source # 
Instance details

Defined in Cardano.Api.Block

data AsType (Hash a) Source # 
Instance details

Defined in Cardano.Api.Hash

data AsType (Hash a) = AsHash (AsType a)
data AsType (VerificationKey a) Source # 
Instance details

Defined in Cardano.Api.Key

data AsType (SigningKey a) Source # 
Instance details

Defined in Cardano.Api.Key

data AsType (PlutusScript lang) Source # 
Instance details

Defined in Cardano.Api.Script

data AsType (SimpleScript lang) Source # 
Instance details

Defined in Cardano.Api.Script

data AsType (ScriptInEra era) Source # 
Instance details

Defined in Cardano.Api.Script

data AsType (Script lang) Source # 
Instance details

Defined in Cardano.Api.Script

data AsType (Script lang) = AsScript (AsType lang)
data AsType (AddressInEra era) Source # 
Instance details

Defined in Cardano.Api.Address

data AsType (Address addrtype) Source # 
Instance details

Defined in Cardano.Api.Address

data AsType (Address addrtype) = AsAddress (AsType addrtype)
data AsType (TxBody era) Source # 
Instance details

Defined in Cardano.Api.TxBody

data AsType (TxBody era) = AsTxBody (AsType era)
data AsType (KeyWitness era) Source # 
Instance details

Defined in Cardano.Api.Tx

data AsType (Tx era) Source # 
Instance details

Defined in Cardano.Api.Tx

data AsType (Tx era) = AsTx (AsType era)