Safe Haskell | None |
---|---|
Language | Haskell2010 |
Currency values
Synopsis
- newtype Entropic = Entropic Integer
- newtype Quantity = Quantity Integer
- newtype PolicyId = PolicyId ScriptHash
- scriptPolicyId ∷ Script lang → PolicyId
- newtype AssetName = AssetName ByteString
- data AssetId
- data Value
- selectAsset ∷ Value → AssetId → Quantity
- valueFromList ∷ [(AssetId, Quantity)] → Value
- valueToList ∷ Value → [(AssetId, Quantity)]
- filterValue ∷ (AssetId → Bool) → Value → Value
- negateValue ∷ Value → Value
- calcMinimumDeposit ∷ Value → Entropic → Entropic
- quantityToEntropic ∷ Quantity → Entropic
- entropicToQuantity ∷ Entropic → Quantity
- selectEntropic ∷ Value → Entropic
- entropicToValue ∷ Entropic → Value
- valueToEntropic ∷ Value → Maybe Entropic
- newtype ValueNestedRep = ValueNestedRep [ValueNestedBundle]
- data ValueNestedBundle
- valueToNestedRep ∷ Value → ValueNestedRep
- valueFromNestedRep ∷ ValueNestedRep → Value
- renderValue ∷ Value → Text
- renderValuePretty ∷ Value → Text
- toColeEntropic ∷ Entropic → Maybe Entropic
- fromColeEntropic ∷ Entropic → Entropic
- toSophieEntropic ∷ Entropic → Coin
- fromSophieEntropic ∷ Coin → Entropic
- fromSophieDeltaEntropic ∷ DeltaCoin → Entropic
- toJenValue ∷ Value → Value StandardCrypto
- fromJenValue ∷ Value StandardCrypto → Value
- data family AsType t
Documentation
Instances
Enum Entropic Source # | |
Defined in Bcc.Api.Value succ ∷ Entropic → Entropic Source # pred ∷ Entropic → Entropic Source # toEnum ∷ Int → Entropic Source # fromEnum ∷ Entropic → Int Source # enumFrom ∷ Entropic → [Entropic] Source # enumFromThen ∷ Entropic → Entropic → [Entropic] Source # enumFromTo ∷ Entropic → Entropic → [Entropic] Source # enumFromThenTo ∷ Entropic → Entropic → Entropic → [Entropic] Source # | |
Eq Entropic Source # | |
Num Entropic Source # | |
Defined in Bcc.Api.Value | |
Ord Entropic Source # | |
Show Entropic Source # | |
Semigroup Entropic Source # | |
Monoid Entropic Source # | |
FromJSON Entropic Source # | |
Defined in Bcc.Api.Value | |
ToJSON Entropic Source # | |
Defined in Bcc.Api.Value toEncoding ∷ Entropic → Encoding # toJSONList ∷ [Entropic] → Value # toEncodingList ∷ [Entropic] → Encoding # | |
FromCBOR Entropic Source # | |
ToCBOR Entropic Source # | |
Multi-asset values
Instances
Eq Quantity Source # | |
Num Quantity Source # | |
Defined in Bcc.Api.Value | |
Ord Quantity Source # | |
Show Quantity Source # | |
Semigroup Quantity Source # | |
Monoid Quantity Source # | |
FromJSON Quantity Source # | |
Defined in Bcc.Api.Value | |
ToJSON Quantity Source # | |
Defined in Bcc.Api.Value toEncoding ∷ Quantity → Encoding # toJSONList ∷ [Quantity] → Value # toEncodingList ∷ [Quantity] → Encoding # |
Instances
Eq PolicyId Source # | |
Ord PolicyId Source # | |
Show PolicyId Source # | |
IsString PolicyId Source # | |
Defined in Bcc.Api.Value fromString ∷ String → PolicyId Source # | |
FromJSON PolicyId Source # | |
Defined in Bcc.Api.Value | |
ToJSON PolicyId Source # | |
Defined in Bcc.Api.Value toEncoding ∷ PolicyId → Encoding # toJSONList ∷ [PolicyId] → Value # toEncodingList ∷ [PolicyId] → Encoding # | |
HasTypeProxy PolicyId Source # | |
SerialiseAsRawBytes PolicyId Source # | |
Defined in Bcc.Api.Value | |
data AsType PolicyId Source # | |
Defined in Bcc.Api.Value |
scriptPolicyId ∷ Script lang → PolicyId Source #
Instances
Eq AssetName Source # | |
Ord AssetName Source # | |
Show AssetName Source # | |
IsString AssetName Source # | |
Defined in Bcc.Api.Value fromString ∷ String → AssetName Source # | |
FromJSON AssetName Source # | |
Defined in Bcc.Api.Value | |
ToJSON AssetName Source # | |
Defined in Bcc.Api.Value toEncoding ∷ AssetName → Encoding # toJSONList ∷ [AssetName] → Value # toEncodingList ∷ [AssetName] → Encoding # | |
FromJSONKey AssetName Source # | |
Defined in Bcc.Api.Value fromJSONKey ∷ FromJSONKeyFunction AssetName fromJSONKeyList ∷ FromJSONKeyFunction [AssetName] | |
ToJSONKey AssetName Source # | |
Defined in Bcc.Api.Value toJSONKey ∷ ToJSONKeyFunction AssetName toJSONKeyList ∷ ToJSONKeyFunction [AssetName] | |
HasTypeProxy AssetName Source # | |
SerialiseAsRawBytes AssetName Source # | |
Defined in Bcc.Api.Value | |
data AsType AssetName Source # | |
Defined in Bcc.Api.Value |
negateValue ∷ Value → Value Source #
This lets you write a - b
as a <> negateValue b
.
calcMinimumDeposit ∷ Value → Entropic → Entropic Source #
Calculate cost of making a UTxO entry for a given Value
and
mininimum UTxO value derived from the ProtocolParameters
Bcc / Entropic specifically
valueToEntropic ∷ Value → Maybe Entropic Source #
Check if the Value
consists of only Entropic
and no other assets,
and if so then return the Entropic.
See also selectEntropic
to select the Entropic quantity from the Value,
ignoring other assets.
Alternative nested representation
newtype ValueNestedRep Source #
Instances
data ValueNestedBundle Source #
A bundle within a ValueNestedRep
for a single PolicyId
, or for the
special case of bcc.
Instances
Eq ValueNestedBundle Source # | |
Defined in Bcc.Api.Value | |
Ord ValueNestedBundle Source # | |
Defined in Bcc.Api.Value compare ∷ ValueNestedBundle → ValueNestedBundle → Ordering Source # (<) ∷ ValueNestedBundle → ValueNestedBundle → Bool Source # (<=) ∷ ValueNestedBundle → ValueNestedBundle → Bool Source # (>) ∷ ValueNestedBundle → ValueNestedBundle → Bool Source # (>=) ∷ ValueNestedBundle → ValueNestedBundle → Bool Source # max ∷ ValueNestedBundle → ValueNestedBundle → ValueNestedBundle Source # min ∷ ValueNestedBundle → ValueNestedBundle → ValueNestedBundle Source # | |
Show ValueNestedBundle Source # | |
Defined in Bcc.Api.Value |
Rendering
Internal conversion functions
toColeEntropic ∷ Entropic → Maybe Entropic Source #
fromColeEntropic ∷ Entropic → Entropic Source #
toSophieEntropic ∷ Entropic → Coin Source #
fromSophieEntropic ∷ Coin → Entropic Source #
fromSophieDeltaEntropic ∷ DeltaCoin → Entropic Source #
toJenValue ∷ Value → Value StandardCrypto Source #
fromJenValue ∷ Value StandardCrypto → Value Source #
Data family instances
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.